@@ -14,7 +14,7 @@ import { useTheme } from '@table-library/react-table-library/theme';
14
14
15
15
import { nodes } from '../data' ;
16
16
17
- storiesOf ( 'Features/Column Grouping' , module )
17
+ storiesOf ( 'Misc/Cell Grouping' , module )
18
18
. addParameters ( {
19
19
component : Table ,
20
20
subcomponents : {
@@ -26,7 +26,7 @@ storiesOf('Features/Column Grouping', module)
26
26
Cell,
27
27
} ,
28
28
} )
29
- . add ( 'base ' , ( ) => {
29
+ . add ( 'by column ' , ( ) => {
30
30
const data = { nodes } ;
31
31
32
32
return (
@@ -35,10 +35,18 @@ storiesOf('Features/Column Grouping', module)
35
35
< >
36
36
< Header >
37
37
< HeaderRow >
38
- < HeaderCell colSpan = { 2 } style = { { backgroundColor : 'blue' , color : 'white' } } >
38
+ < HeaderCell
39
+ gridColumnStart = { 1 }
40
+ gridColumnEnd = { 3 }
41
+ style = { { backgroundColor : 'blue' , color : 'white' } }
42
+ >
39
43
Task
40
44
</ HeaderCell >
41
- < HeaderCell colSpan = { 2 } style = { { backgroundColor : 'green' , color : 'white' } } >
45
+ < HeaderCell
46
+ gridColumnStart = { 3 }
47
+ gridColumnEnd = { 5 }
48
+ style = { { backgroundColor : 'green' , color : 'white' } }
49
+ >
42
50
Type
43
51
</ HeaderCell >
44
52
< HeaderCell > Tasks</ HeaderCell >
@@ -49,7 +57,11 @@ storiesOf('Features/Column Grouping', module)
49
57
{ tableList . map ( ( item , index ) =>
50
58
index === 1 ? (
51
59
< Row key = { item . id } item = { item } >
52
- < Cell colSpan = { 3 } style = { { backgroundColor : 'red' , color : 'white' } } >
60
+ < Cell
61
+ gridColumnStart = { 1 }
62
+ gridColumnEnd = { 4 }
63
+ style = { { backgroundColor : 'red' , color : 'white' } }
64
+ >
53
65
{ item . name }
54
66
</ Cell >
55
67
< Cell > { item . isComplete . toString ( ) } </ Cell >
@@ -66,14 +78,22 @@ storiesOf('Features/Column Grouping', module)
66
78
} ) }
67
79
</ Cell >
68
80
< Cell > { item . type } </ Cell >
69
- < Cell colSpan = { 2 } style = { { backgroundColor : 'blue' , color : 'white' } } >
81
+ < Cell
82
+ gridColumnStart = { 4 }
83
+ gridColumnEnd = { 6 }
84
+ style = { { backgroundColor : 'blue' , color : 'white' } }
85
+ >
70
86
{ item . isComplete . toString ( ) }
71
87
</ Cell >
72
88
</ Row >
73
89
) : index === 3 ? (
74
90
< Row key = { item . id } item = { item } >
75
91
< Cell > { item . name } </ Cell >
76
- < Cell colSpan = { 2 } style = { { backgroundColor : 'orange' , color : 'white' } } >
92
+ < Cell
93
+ gridColumnStart = { 2 }
94
+ gridColumnEnd = { 4 }
95
+ style = { { backgroundColor : 'orange' , color : 'white' } }
96
+ >
77
97
{ item . deadline . toLocaleDateString ( 'en-US' , {
78
98
year : 'numeric' ,
79
99
month : '2-digit' ,
@@ -85,11 +105,19 @@ storiesOf('Features/Column Grouping', module)
85
105
</ Row >
86
106
) : index === 4 ? (
87
107
< Row key = { item . id } item = { item } >
88
- < Cell colSpan = { 2 } style = { { backgroundColor : 'green' , color : 'white' } } >
108
+ < Cell
109
+ gridColumnStart = { 1 }
110
+ gridColumnEnd = { 3 }
111
+ style = { { backgroundColor : 'green' , color : 'white' } }
112
+ >
89
113
{ item . name }
90
114
</ Cell >
91
115
< Cell > { item . type } </ Cell >
92
- < Cell colSpan = { 2 } style = { { backgroundColor : 'green' , color : 'white' } } >
116
+ < Cell
117
+ gridColumnStart = { 4 }
118
+ gridColumnEnd = { 6 }
119
+ style = { { backgroundColor : 'green' , color : 'white' } }
120
+ >
93
121
{ item . isComplete . toString ( ) }
94
122
</ Cell >
95
123
</ Row >
0 commit comments