@semcore/data-table 17.0.0-prerelease.31 → 17.0.0-prerelease.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/lib/cjs/components/AccordionRows/AccordionRows.js +50 -51
- package/lib/cjs/components/AccordionRows/AccordionRows.js.map +1 -1
- package/lib/cjs/components/Body/Body.js +65 -88
- package/lib/cjs/components/Body/Body.js.map +1 -1
- package/lib/cjs/components/Body/Body.types.js.map +1 -1
- package/lib/cjs/components/Body/Cell.js +50 -51
- package/lib/cjs/components/Body/Cell.js.map +1 -1
- package/lib/cjs/components/Body/LimitOverlay.js +50 -51
- package/lib/cjs/components/Body/LimitOverlay.js.map +1 -1
- package/lib/cjs/components/Body/Row.js +65 -90
- package/lib/cjs/components/Body/Row.js.map +1 -1
- package/lib/cjs/components/Body/Row.types.js.map +1 -1
- package/lib/cjs/components/Body/RowGroup.js +133 -0
- package/lib/cjs/components/Body/RowGroup.js.map +1 -0
- package/lib/cjs/components/Body/style.shadow.css +86 -151
- package/lib/cjs/components/DataTable/DataTable.js +35 -12
- package/lib/cjs/components/DataTable/DataTable.js.map +1 -1
- package/lib/cjs/components/DataTable/DataTable.types.js.map +1 -1
- package/lib/cjs/components/Head/Head.js +45 -14
- package/lib/cjs/components/Head/Head.js.map +1 -1
- package/lib/cjs/components/Head/Head.types.js.map +1 -1
- package/lib/cjs/components/RowSelector/RowsSelector.js +112 -0
- package/lib/cjs/components/RowSelector/RowsSelector.js.map +1 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/store/SelectableRows.js +129 -0
- package/lib/cjs/store/SelectableRows.js.map +1 -0
- package/lib/es6/components/AccordionRows/AccordionRows.js +50 -51
- package/lib/es6/components/AccordionRows/AccordionRows.js.map +1 -1
- package/lib/es6/components/Body/Body.js +67 -90
- package/lib/es6/components/Body/Body.js.map +1 -1
- package/lib/es6/components/Body/Body.types.js.map +1 -1
- package/lib/es6/components/Body/Cell.js +50 -51
- package/lib/es6/components/Body/Cell.js.map +1 -1
- package/lib/es6/components/Body/LimitOverlay.js +50 -51
- package/lib/es6/components/Body/LimitOverlay.js.map +1 -1
- package/lib/es6/components/Body/Row.js +66 -91
- package/lib/es6/components/Body/Row.js.map +1 -1
- package/lib/es6/components/Body/Row.types.js.map +1 -1
- package/lib/es6/components/Body/RowGroup.js +125 -0
- package/lib/es6/components/Body/RowGroup.js.map +1 -0
- package/lib/es6/components/Body/style.shadow.css +86 -151
- package/lib/es6/components/DataTable/DataTable.js +35 -12
- package/lib/es6/components/DataTable/DataTable.js.map +1 -1
- package/lib/es6/components/DataTable/DataTable.types.js.map +1 -1
- package/lib/es6/components/Head/Head.js +45 -14
- package/lib/es6/components/Head/Head.js.map +1 -1
- package/lib/es6/components/Head/Head.types.js.map +1 -1
- package/lib/es6/components/RowSelector/RowsSelector.js +104 -0
- package/lib/es6/components/RowSelector/RowsSelector.js.map +1 -0
- package/lib/es6/index.js +2 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/store/SelectableRows.js +121 -0
- package/lib/es6/store/SelectableRows.js.map +1 -0
- package/lib/esm/components/AccordionRows/AccordionRows.mjs +51 -52
- package/lib/esm/components/Body/Body.mjs +68 -91
- package/lib/esm/components/Body/Cell.mjs +51 -52
- package/lib/esm/components/Body/LimitOverlay.mjs +51 -52
- package/lib/esm/components/Body/Row.mjs +66 -90
- package/lib/esm/components/Body/RowGroup.mjs +124 -0
- package/lib/esm/components/Body/style.shadow.css +86 -151
- package/lib/esm/components/DataTable/DataTable.mjs +34 -12
- package/lib/esm/components/Head/Head.mjs +46 -14
- package/lib/esm/components/RowSelector/RowsSelector.mjs +107 -0
- package/lib/esm/index.mjs +2 -0
- package/lib/esm/store/SelectableRows.mjs +123 -0
- package/lib/types/components/Body/Body.types.d.ts +2 -1
- package/lib/types/components/Body/Row.d.ts +0 -2
- package/lib/types/components/Body/Row.types.d.ts +2 -1
- package/lib/types/components/Body/RowGroup.d.ts +19 -0
- package/lib/types/components/DataTable/DataTable.types.d.ts +21 -12
- package/lib/types/components/Head/Head.types.d.ts +2 -1
- package/lib/types/components/RowSelector/RowsSelector.d.ts +31 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/store/SelectableRows.d.ts +56 -0
- package/package.json +18 -18
|
@@ -66,46 +66,20 @@ SCollapseRow > SCellWrapper > SCell {
|
|
|
66
66
|
display: block;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/* DEFAULT THEME */
|
|
70
|
-
|
|
71
|
-
SRow[active] > SCellWrapper > SCell:not([theme]) {
|
|
72
|
-
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
69
|
SRow[accordionType='row'][expanded] > SCellWrapper > SCell:not([theme]),
|
|
76
70
|
SCell:not([theme])[expanded][withAccordion] {
|
|
77
71
|
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
SCell[theme='muted'][expanded][withAccordion] {
|
|
81
|
-
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
SCell[theme='info'][expanded][withAccordion] {
|
|
85
|
-
background-color: var(--intergalactic-table-td-cell-selected-hover, #c4e5fe);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
SCell[theme='success'][expanded][withAccordion] {
|
|
89
|
-
background-color: var(--intergalactic-table-td-cell-new-hover, #9ef2c9);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
SCell[theme='warning'][expanded][withAccordion] {
|
|
93
|
-
background-color: var(--intergalactic-table-td-cell-warning-hover, #ffdca2);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
SCell[theme='danger'][expanded][withAccordion] {
|
|
97
|
-
background-color: var(--intergalactic-table-td-cell-critical-hover, #ffd7df);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
74
|
SCollapseRow > SCellWrapper > SCell:not([theme]), SRow[isAccordionRow] > SCellWrapper > SCell:not([theme]) {
|
|
101
75
|
background-color: var(--intergalactic-table-td-cell-accordion, #f4f5f9);
|
|
102
76
|
}
|
|
103
77
|
|
|
104
78
|
/* we need a media query here because of the postcssHoverMediaFeature plugin. it doesn't handle this type of selectors correctly */
|
|
105
79
|
@media (hover: hover) {
|
|
106
|
-
SRow:not([accordionType='row'][expanded]):hover:not([isNonInteractive]):not([aria-hidden]):not(:has(SLimitOverlayCellWrapper:hover)) > SCellWrapper > SCell:not([theme]):not([expanded][withAccordion]):not([aria-hidden]),
|
|
107
|
-
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell:not([theme]):not([expanded][withAccordion]):not([aria-hidden]),
|
|
108
|
-
SRowGroup:has(SCell:hover) > SRow:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]):not([expanded][withAccordion]):not([aria-hidden]) {
|
|
80
|
+
:not(SRowGroup:has([data-row-selector="true"] input:checked)) > SRow:not([accordionType='row'][expanded]):hover:not([isNonInteractive]):not(:has([data-row-selector="true"] input:checked)):not([aria-hidden]):not(:has(SLimitOverlayCellWrapper:hover)) > SCellWrapper > SCell:not([theme]):not([expanded][withAccordion]):not([aria-hidden]),
|
|
81
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover):not(:has([data-row-selector="true"] input:checked)) > SRow:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell:not([theme]):not([expanded][withAccordion]):not([aria-hidden]),
|
|
82
|
+
SRowGroup:has(SCell:hover):not(:has([data-row-selector="true"] input:checked)) > SRow:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]):not([expanded][withAccordion]):not([aria-hidden]) {
|
|
109
83
|
background-color: var(--intergalactic-table-td-cell-hover, #f0f0f4);
|
|
110
84
|
}
|
|
111
85
|
|
|
@@ -121,9 +95,13 @@ SCollapseRow > SCellWrapper > SCell:not([theme]), SRow[isAccordionRow] > SCellWr
|
|
|
121
95
|
|
|
122
96
|
/* INFO THEME */
|
|
123
97
|
SRow:hover:not([isNonInteractive]):not([aria-hidden]):not(:has(SLimitOverlayCellWrapper:hover)) > SCellWrapper > SCell[theme='info']:not([aria-hidden]),
|
|
98
|
+
SRow:hover:has([data-row-selector="true"] input:checked):not([isNonInteractive]):not([aria-hidden]):not(:has(SLimitOverlayCellWrapper:hover)) > SCellWrapper > SCell:not([aria-hidden]),
|
|
124
99
|
SRow[theme='info']:hover:not([expanded][isNonInteractive]):not([aria-hidden]):not(:has(SLimitOverlayCellWrapper:hover)) > SCellWrapper > SCell:not([theme]):not([expanded][withAccordion]):not([aria-hidden]),
|
|
125
100
|
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell[theme='info']:not([aria-hidden]),
|
|
101
|
+
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover):has([data-row-selector="true"] input:checked) SRow:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell:not([aria-hidden]),
|
|
126
102
|
SRowGroup:has(SCell[data-grouped-by='rowgroup']:hover) > SRow[theme='info']:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell:not([theme]):not([aria-hidden]),
|
|
103
|
+
SRowGroup:has(SCell:hover):has([data-row-selector="true"] input:checked) > SRow:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([aria-hidden]),
|
|
104
|
+
SRowGroup:has([data-row-selector="true"] input:checked) > SRow:hover:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell:not([aria-hidden]),
|
|
127
105
|
SRowGroup:has(SCell:hover) > SRow:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell[data-grouped-by='rowgroup'][theme='info']:not([aria-hidden]),
|
|
128
106
|
SRowGroup:has(SCell:hover) > SRow[theme='info']:not([isNonInteractive]):not([aria-hidden]) > SCellWrapper > SCell[data-grouped-by='rowgroup']:not([theme]):not([aria-hidden]) {
|
|
129
107
|
background-color: var(--intergalactic-table-td-cell-selected-hover, #c4e5fe);
|
|
@@ -160,81 +138,15 @@ SCollapseRow > SCellWrapper > SCell:not([theme]), SRow[isAccordionRow] > SCellWr
|
|
|
160
138
|
}
|
|
161
139
|
}
|
|
162
140
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
&:not([expanded][withAccordion]) {
|
|
167
|
-
background-color: var(--intergalactic-table-td-cell-unread, #f4f5f9);
|
|
168
|
-
}
|
|
169
|
-
&[expanded][withAccordion] {
|
|
170
|
-
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
SRow[theme='muted'][active] > SCellWrapper > SCell:not([theme]) {
|
|
175
|
-
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* INFO THEME */
|
|
141
|
+
SRowGroup:has([data-row-selector="true"] input:checked) > SRow > SCellWrapper > SCell,
|
|
142
|
+
SRow:has([data-row-selector="true"] input:checked) > SCellWrapper > SCell {
|
|
143
|
+
background-color: var(--intergalactic-table-td-cell-selected, #e9f7ff);
|
|
179
144
|
|
|
180
|
-
SRow[theme='info'] SCell:not([theme]) {
|
|
181
|
-
&:not([expanded][withAccordion]) {
|
|
182
|
-
background-color: var(--intergalactic-table-td-cell-selected, #e9f7ff);
|
|
183
|
-
}
|
|
184
145
|
&[expanded][withAccordion] {
|
|
185
146
|
background-color: var(--intergalactic-table-td-cell-selected-active, #c4e5fe);
|
|
186
147
|
}
|
|
187
148
|
}
|
|
188
149
|
|
|
189
|
-
SRow[theme='info'][active] > SCellWrapper > SCell:not([theme]) {
|
|
190
|
-
background-color: var(--intergalactic-table-td-cell-selected-active, #c4e5fe);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/* SUCCESS THEME */
|
|
194
|
-
|
|
195
|
-
SRow[theme='success'] SCell:not([theme]) {
|
|
196
|
-
&:not([expanded][withAccordion]) {
|
|
197
|
-
background-color: var(--intergalactic-table-td-cell-new, #dbfee8);
|
|
198
|
-
}
|
|
199
|
-
&[expanded][withAccordion] {
|
|
200
|
-
background-color: var(--intergalactic-table-td-cell-new-active, #9ef2c9);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
SRow[theme='success'][active] > SCellWrapper > SCell:not([theme]) {
|
|
205
|
-
background-color: var(--intergalactic-table-td-cell-new-active, #9ef2c9);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/* WARNING THEME */
|
|
209
|
-
|
|
210
|
-
SRow[theme='warning'] SCell:not([theme]) {
|
|
211
|
-
&:not([expanded][withAccordion]) {
|
|
212
|
-
background-color: var(--intergalactic-table-td-cell-warning, #fff3d9);
|
|
213
|
-
}
|
|
214
|
-
&[expanded][withAccordion] {
|
|
215
|
-
background-color: var(--intergalactic-table-td-cell-warning-active, #ffdca2);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
SRow[theme='warning'][active] > SCellWrapper > SCell:not([theme]) {
|
|
220
|
-
background-color: var(--intergalactic-table-td-cell-warning-active, #ffdca2);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/* DANGER THEME */
|
|
224
|
-
|
|
225
|
-
SRow[theme='danger'] SCell:not([theme]) {
|
|
226
|
-
&:not([expanded][withAccordion]) {
|
|
227
|
-
background-color: var(--intergalactic-table-td-cell-critical, #fff0f7);
|
|
228
|
-
}
|
|
229
|
-
&[expanded][withAccordion] {
|
|
230
|
-
background-color: var(--intergalactic-table-td-cell-critical-active, #ffd7df);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
SRow[theme='danger'][active] > SCellWrapper > SCell:not([theme]) {
|
|
235
|
-
background-color: var(--intergalactic-table-td-cell-critical-active, #ffd7df);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
150
|
SCell {
|
|
239
151
|
display: flex;
|
|
240
152
|
height: 100%;
|
|
@@ -267,68 +179,94 @@ SCell {
|
|
|
267
179
|
&[withoutBorder] {
|
|
268
180
|
border-bottom: none;
|
|
269
181
|
}
|
|
270
|
-
}
|
|
271
182
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
183
|
+
&[use='primary'] {
|
|
184
|
+
padding: var(--intergalactic-spacing-3x, 12px);
|
|
185
|
+
min-height: 45px;
|
|
186
|
+
background-color: var(--intergalactic-bg-primary-neutral, #ffffff);
|
|
275
187
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
188
|
+
&[data-aria-level] {
|
|
189
|
+
padding-left: calc(var(--intergalactic-spacing-3x, 12px) + ((var(--intergalactic-spacing-5x, 20px) + var(--intergalactic-spacing-1x, 4px) + var(--intergalactic-spacing-05x, 2px)) * (var(--data-aria-level) - 1)));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
280
192
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
193
|
+
&[use='secondary'] {
|
|
194
|
+
padding: var(--intergalactic-spacing-2x, 8px);
|
|
195
|
+
min-height: 37px;
|
|
196
|
+
background-color: var(--intergalactic-bg-primary-neutral, #ffffff);
|
|
285
197
|
|
|
286
|
-
|
|
287
|
-
|
|
198
|
+
&[data-aria-level] {
|
|
199
|
+
padding-left: calc(var(--intergalactic-spacing-2x, 8px) + ((var(--intergalactic-spacing-5x, 20px) + var(--intergalactic-spacing-1x, 4px) + var(--intergalactic-spacing-05x, 2px)) * (var(--data-aria-level) - 1)));
|
|
200
|
+
}
|
|
288
201
|
}
|
|
289
|
-
}
|
|
290
202
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
min-height: 37px;
|
|
294
|
-
background-color: var(--intergalactic-bg-primary-neutral, #ffffff);
|
|
203
|
+
&[theme='muted'] {
|
|
204
|
+
background-color: var(--intergalactic-table-td-cell-unread, #f4f5f9);
|
|
295
205
|
|
|
296
|
-
|
|
297
|
-
|
|
206
|
+
&[expanded][withAccordion] {
|
|
207
|
+
background-color: var(--intergalactic-table-td-cell-active, #e6e7ed);
|
|
208
|
+
}
|
|
298
209
|
}
|
|
299
|
-
}
|
|
300
210
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
211
|
+
&[theme='info'] {
|
|
212
|
+
background-color: var(--intergalactic-table-td-cell-selected, #e9f7ff);
|
|
304
213
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
214
|
+
&[expanded][withAccordion] {
|
|
215
|
+
background-color: var(--intergalactic-table-td-cell-selected-active, #c4e5fe);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
308
218
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
z-index: 2;
|
|
312
|
-
}
|
|
219
|
+
&[theme='success'] {
|
|
220
|
+
background-color: var(--intergalactic-table-td-cell-new, #dbfee8);
|
|
313
221
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
222
|
+
&[expanded][withAccordion] {
|
|
223
|
+
background-color: var(--intergalactic-table-td-cell-new-active, #9ef2c9);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
317
226
|
|
|
318
|
-
|
|
319
|
-
|
|
227
|
+
&[theme='warning'] {
|
|
228
|
+
background-color: var(--intergalactic-table-td-cell-warning, #fff3d9);
|
|
229
|
+
|
|
230
|
+
&[expanded][withAccordion] {
|
|
231
|
+
background-color: var(--intergalactic-table-td-cell-warning-active, #ffdca2);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&[theme='danger'] {
|
|
236
|
+
background-color: var(--intergalactic-table-td-cell-critical, #fff0f7);
|
|
237
|
+
|
|
238
|
+
&[expanded][withAccordion] {
|
|
239
|
+
background-color: var(--intergalactic-table-td-cell-critical-active, #ffd7df);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&[borders='both'],
|
|
244
|
+
&[borders='left'] {
|
|
245
|
+
border-left: 1px solid var(--intergalactic-border-secondary, #e0e1e9);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&[borders='both'],
|
|
249
|
+
&[borders='right'] {
|
|
250
|
+
border-right: 1px solid var(--intergalactic-border-secondary, #e0e1e9);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
&[innerOutline]:focus-visible {
|
|
254
|
+
transition: none;
|
|
255
|
+
}
|
|
320
256
|
}
|
|
321
257
|
|
|
322
|
-
SCell[
|
|
323
|
-
|
|
258
|
+
SRow[accordionType='row'] > SCellWrapper > SCell, SCell[withAccordion], SCell[name='Symbol(SELECT_ALL)'] {
|
|
259
|
+
cursor: pointer;
|
|
324
260
|
}
|
|
325
261
|
|
|
326
|
-
|
|
327
|
-
|
|
262
|
+
SCheckboxCell[aria-hidden] {
|
|
263
|
+
filter: blur(3px);
|
|
264
|
+
pointer-events: none;
|
|
328
265
|
}
|
|
329
266
|
|
|
330
|
-
|
|
331
|
-
|
|
267
|
+
SCellWrapper[fixed] {
|
|
268
|
+
position: sticky;
|
|
269
|
+
z-index: 2;
|
|
332
270
|
}
|
|
333
271
|
|
|
334
272
|
SSpinContainer {
|
|
@@ -342,13 +280,14 @@ SSpinContainer {
|
|
|
342
280
|
justify-content: center;
|
|
343
281
|
background-color: var(--intergalactic-overlay-limitation-secondary, rgba(255, 255, 255, 0.85));
|
|
344
282
|
z-index: 15;
|
|
345
|
-
}
|
|
346
|
-
SSpinContainer:focus-visible {
|
|
347
|
-
z-index: 15;
|
|
348
|
-
}
|
|
349
283
|
|
|
350
|
-
|
|
351
|
-
|
|
284
|
+
&:focus-visible {
|
|
285
|
+
z-index: 15;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&[headerHeight] {
|
|
289
|
+
top: var(--headerHeight);
|
|
290
|
+
}
|
|
352
291
|
}
|
|
353
292
|
|
|
354
293
|
SEmptyData {
|
|
@@ -426,7 +365,3 @@ SLimitOverlayCellWrapper[left] {
|
|
|
426
365
|
position: sticky;
|
|
427
366
|
left: var(---left);
|
|
428
367
|
}
|
|
429
|
-
|
|
430
|
-
SCell[innerOutline]:focus-visible {
|
|
431
|
-
transition: none;
|
|
432
|
-
}
|
|
@@ -11,6 +11,7 @@ import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
|
11
11
|
import { hasFocusableIn, isFocusInside } from "@semcore/core/lib/utils/use/useFocusLock";
|
|
12
12
|
import { NoData } from "@semcore/widget-empty";
|
|
13
13
|
import * as React from "react";
|
|
14
|
+
import { SelectableRows } from "../../store/SelectableRows.mjs";
|
|
14
15
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
15
16
|
import { Body } from "../Body/Body.mjs";
|
|
16
17
|
import { MergedRowsCell, MergedColumnsCell } from "../Body/MergedCells.mjs";
|
|
@@ -104,7 +105,7 @@ class DataTableRoot extends Component {
|
|
|
104
105
|
});
|
|
105
106
|
_defineProperty(this, "selectAllMessageTimer", 0);
|
|
106
107
|
_defineProperty(this, "headerNodesMap", /* @__PURE__ */ new Map());
|
|
107
|
-
_defineProperty(this, "
|
|
108
|
+
_defineProperty(this, "selectedRowsContainer", void 0);
|
|
108
109
|
_defineProperty(this, "lastSelectedRowKey", void 0);
|
|
109
110
|
_defineProperty(this, "state", {
|
|
110
111
|
scrollTop: 0,
|
|
@@ -151,14 +152,20 @@ class DataTableRoot extends Component {
|
|
|
151
152
|
this.initFocusableCell([this.hasFocusableInHeader() ? opt.rowIndex + 1 : opt.rowIndex, opt.colIndex]);
|
|
152
153
|
}
|
|
153
154
|
});
|
|
155
|
+
_defineProperty(this, "handleSelectAllRows", (selectedRows, event) => {
|
|
156
|
+
if (!("onSelectedRowsChange" in this.asProps) || !this.asProps.onSelectedRowsChange || !Array.isArray(selectedRows)) return;
|
|
157
|
+
this.asProps.onSelectedRowsChange(selectedRows, event);
|
|
158
|
+
});
|
|
154
159
|
_defineProperty(this, "handleSelectRow", (isSelected, selectedRowIndex, row, event) => {
|
|
155
160
|
const {
|
|
156
|
-
selectedRows
|
|
161
|
+
selectedRows
|
|
162
|
+
} = this.asProps;
|
|
163
|
+
if (!selectedRows || !("onSelectedRowsChange" in this.asProps) || !this.asProps.onSelectedRowsChange || !Array.isArray(selectedRows)) return;
|
|
164
|
+
const {
|
|
157
165
|
onSelectedRowsChange
|
|
158
166
|
} = this.asProps;
|
|
159
|
-
if (!selectedRows || !onSelectedRowsChange) return;
|
|
160
167
|
const selectedRowsSet = new Set(selectedRows);
|
|
161
|
-
if (this.isPressedShift && selectedRowsSet.size > 0 && this.lastSelectedRowKey && (isSelected ? selectedRowsSet.has(this.lastSelectedRowKey) : true)) {
|
|
168
|
+
if (this.selectedRowsContainer.isPressedShift && selectedRowsSet.size > 0 && this.lastSelectedRowKey && (isSelected ? selectedRowsSet.has(this.lastSelectedRowKey) : true)) {
|
|
162
169
|
let select = false;
|
|
163
170
|
const firstColumnKey = this.columns[0].name;
|
|
164
171
|
const isMerged = this.flatRows.some((item) => item[firstColumnKey] instanceof MergedRowsCell);
|
|
@@ -362,13 +369,13 @@ class DataTableRoot extends Component {
|
|
|
362
369
|
break;
|
|
363
370
|
}
|
|
364
371
|
case "Shift": {
|
|
365
|
-
this.isPressedShift = true;
|
|
372
|
+
this.selectedRowsContainer.isPressedShift = true;
|
|
366
373
|
}
|
|
367
374
|
}
|
|
368
375
|
});
|
|
369
376
|
_defineProperty(this, "handleKeyUp", (e) => {
|
|
370
377
|
if (e.key === "Shift") {
|
|
371
|
-
this.isPressedShift = false;
|
|
378
|
+
this.selectedRowsContainer.isPressedShift = false;
|
|
372
379
|
}
|
|
373
380
|
});
|
|
374
381
|
_defineProperty(this, "handleScroll", trottle((e) => {
|
|
@@ -552,6 +559,11 @@ class DataTableRoot extends Component {
|
|
|
552
559
|
this.calculatedRows = this.getRows();
|
|
553
560
|
this.flatRows = this.calculatedRows.flat();
|
|
554
561
|
this.tmpData = props.data;
|
|
562
|
+
if (Array.isArray(props.selectedRows) || !props.selectedRows) {
|
|
563
|
+
this.selectedRowsContainer = new SelectableRows();
|
|
564
|
+
} else {
|
|
565
|
+
this.selectedRowsContainer = props.selectedRows;
|
|
566
|
+
}
|
|
555
567
|
}
|
|
556
568
|
componentDidMount() {
|
|
557
569
|
const {
|
|
@@ -585,7 +597,7 @@ class DataTableRoot extends Component {
|
|
|
585
597
|
this.calculateVerticalShadow();
|
|
586
598
|
}
|
|
587
599
|
}
|
|
588
|
-
if (prevProps.selectedRows !== selectedRows && selectedRows !== void 0) {
|
|
600
|
+
if (prevProps.selectedRows !== selectedRows && selectedRows !== void 0 && Array.isArray(selectedRows)) {
|
|
589
601
|
const selectedRowsSet = new Set(selectedRows);
|
|
590
602
|
const allChecked = [];
|
|
591
603
|
const allUnchecked = [];
|
|
@@ -602,6 +614,9 @@ class DataTableRoot extends Component {
|
|
|
602
614
|
this.setSelectAllMessage(false);
|
|
603
615
|
}
|
|
604
616
|
}
|
|
617
|
+
if (prevProps.selectedRows !== selectedRows && selectedRows !== void 0 && !Array.isArray(selectedRows)) {
|
|
618
|
+
this.selectedRowsContainer = selectedRows;
|
|
619
|
+
}
|
|
605
620
|
}
|
|
606
621
|
componentWillUnmount() {
|
|
607
622
|
var _a;
|
|
@@ -672,7 +687,6 @@ class DataTableRoot extends Component {
|
|
|
672
687
|
getI18nText,
|
|
673
688
|
uid,
|
|
674
689
|
headerProps,
|
|
675
|
-
onSelectedRowsChange,
|
|
676
690
|
selectedRows,
|
|
677
691
|
sideIndents,
|
|
678
692
|
variant
|
|
@@ -704,7 +718,7 @@ class DataTableRoot extends Component {
|
|
|
704
718
|
totalRows: this.totalRows,
|
|
705
719
|
selectedRows,
|
|
706
720
|
flatRows: this.getFlatRows(),
|
|
707
|
-
onChangeSelectAll:
|
|
721
|
+
onChangeSelectAll: Array.isArray(selectedRows) ? this.handleSelectAllRows : void 0,
|
|
708
722
|
getFixedStyle: this.getFixedStyle,
|
|
709
723
|
onCellClick: this.handleCellClick,
|
|
710
724
|
shadowVertical,
|
|
@@ -774,7 +788,7 @@ class DataTableRoot extends Component {
|
|
|
774
788
|
renderEmptyData,
|
|
775
789
|
sideIndents,
|
|
776
790
|
selectedRows,
|
|
777
|
-
onSelectRow: this.handleSelectRow,
|
|
791
|
+
onSelectRow: Array.isArray(selectedRows) ? this.handleSelectRow : void 0,
|
|
778
792
|
getFixedStyle: this.getFixedStyle,
|
|
779
793
|
onCellClick: this.handleCellClick,
|
|
780
794
|
rawData,
|
|
@@ -836,7 +850,7 @@ class DataTableRoot extends Component {
|
|
|
836
850
|
const width = w ?? (this.columns.some((c) => c.gtcWidth === "auto" || c.gtcWidth === "1fr") ? "100%" : void 0);
|
|
837
851
|
let gridTemplateRows = void 0;
|
|
838
852
|
if (virtualScroll && typeof virtualScroll !== "boolean" && "rowHeight" in virtualScroll) {
|
|
839
|
-
gridTemplateRows = `auto auto repeat(${this.totalRows}, minmax(${virtualScroll.rowHeight}px, auto)`;
|
|
853
|
+
gridTemplateRows = `auto auto repeat(${this.totalRows}, minmax(${virtualScroll.rowHeight}px, auto))`;
|
|
840
854
|
}
|
|
841
855
|
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(ScrollArea, _ref2.cn("ScrollArea", {
|
|
842
856
|
"leftOffset": offsetLeftSum,
|
|
@@ -1024,12 +1038,14 @@ class DataTableRoot extends Component {
|
|
|
1024
1038
|
const {
|
|
1025
1039
|
data,
|
|
1026
1040
|
uid,
|
|
1027
|
-
uniqueRowKey
|
|
1041
|
+
uniqueRowKey,
|
|
1042
|
+
selectedRows
|
|
1028
1043
|
} = this.props;
|
|
1029
1044
|
if (this.tmpData === data) {
|
|
1030
1045
|
return this.calculatedRows;
|
|
1031
1046
|
}
|
|
1032
1047
|
this.tmpData = data;
|
|
1048
|
+
const availableRowKeys = [];
|
|
1033
1049
|
const rows = [];
|
|
1034
1050
|
const columnNames = columns.map((column) => column.name);
|
|
1035
1051
|
let rowIndex = 0;
|
|
@@ -1099,6 +1115,9 @@ class DataTableRoot extends Component {
|
|
|
1099
1115
|
dtRow[value] = "";
|
|
1100
1116
|
});
|
|
1101
1117
|
}
|
|
1118
|
+
if (!excludeColumns) {
|
|
1119
|
+
availableRowKeys.push(dtRow[UNIQ_ROW_KEY]);
|
|
1120
|
+
}
|
|
1102
1121
|
return dtRow;
|
|
1103
1122
|
};
|
|
1104
1123
|
data.forEach((row) => {
|
|
@@ -1156,6 +1175,9 @@ class DataTableRoot extends Component {
|
|
|
1156
1175
|
}
|
|
1157
1176
|
});
|
|
1158
1177
|
this.calculatedRows = rows;
|
|
1178
|
+
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
1179
|
+
selectedRows.setAvailableKeys(availableRowKeys);
|
|
1180
|
+
}
|
|
1159
1181
|
return rows;
|
|
1160
1182
|
}
|
|
1161
1183
|
calculateGridTemplateColumn(c) {
|
|
@@ -6,6 +6,7 @@ import Checkbox from "@semcore/checkbox";
|
|
|
6
6
|
import React__default from "react";
|
|
7
7
|
import { Column } from "./Column.mjs";
|
|
8
8
|
import { Group } from "./Group.mjs";
|
|
9
|
+
import { SelectableRows } from "../../store/SelectableRows.mjs";
|
|
9
10
|
import { UNIQ_ROW_KEY, SELECT_ALL, DataTable } from "../DataTable/DataTable.mjs";
|
|
10
11
|
/*!__reshadow-styles__:"./style.shadow.css"*/
|
|
11
12
|
const style = (
|
|
@@ -57,22 +58,31 @@ const style = (
|
|
|
57
58
|
class HeadRoot extends Component {
|
|
58
59
|
constructor(...args) {
|
|
59
60
|
super(...args);
|
|
61
|
+
_defineProperty(this, "unsubscribeSelectAll", void 0);
|
|
60
62
|
_defineProperty(this, "handleSelectAll", (value, event) => {
|
|
61
63
|
var _a, _b;
|
|
62
64
|
const {
|
|
63
|
-
selectedRows
|
|
65
|
+
selectedRows
|
|
64
66
|
} = this.asProps;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
if (Array.isArray(selectedRows)) {
|
|
68
|
+
const idsSet = new Set(selectedRows);
|
|
69
|
+
if (value) {
|
|
70
|
+
this.selectableRows.forEach((row) => {
|
|
71
|
+
idsSet.add(row[UNIQ_ROW_KEY]);
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
this.selectableRows.forEach((row) => {
|
|
75
|
+
idsSet.delete(row[UNIQ_ROW_KEY]);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
(_b = (_a = this.asProps).onChangeSelectAll) == null ? void 0 : _b.call(_a, Array.from(idsSet), event);
|
|
79
|
+
} else if (selectedRows) {
|
|
80
|
+
if (value) {
|
|
81
|
+
selectedRows.selectAll();
|
|
82
|
+
} else {
|
|
83
|
+
selectedRows.clearAllAvailable();
|
|
84
|
+
}
|
|
74
85
|
}
|
|
75
|
-
(_b = (_a = this.asProps).onChangeSelectAll) == null ? void 0 : _b.call(_a, Array.from(idsSet), event);
|
|
76
86
|
});
|
|
77
87
|
_defineProperty(this, "handleClickSelectAll", (value) => (event) => {
|
|
78
88
|
event == null ? void 0 : event.preventDefault();
|
|
@@ -80,6 +90,20 @@ class HeadRoot extends Component {
|
|
|
80
90
|
this.handleSelectAll(value, event);
|
|
81
91
|
});
|
|
82
92
|
}
|
|
93
|
+
componentDidMount() {
|
|
94
|
+
const {
|
|
95
|
+
selectedRows
|
|
96
|
+
} = this.asProps;
|
|
97
|
+
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
98
|
+
this.unsubscribeSelectAll = selectedRows.subscribe(SelectableRows.SELECT_ALL_EVENT, () => {
|
|
99
|
+
this.forceUpdate();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
componentWillUnmount() {
|
|
104
|
+
var _a;
|
|
105
|
+
(_a = this.unsubscribeSelectAll) == null ? void 0 : _a.call(this);
|
|
106
|
+
}
|
|
83
107
|
sortableColumnDescribeId() {
|
|
84
108
|
const {
|
|
85
109
|
uid
|
|
@@ -189,15 +213,23 @@ class HeadRoot extends Component {
|
|
|
189
213
|
}
|
|
190
214
|
get areAllRowsSelected() {
|
|
191
215
|
const {
|
|
192
|
-
selectedRows
|
|
216
|
+
selectedRows
|
|
193
217
|
} = this.asProps;
|
|
194
|
-
|
|
218
|
+
if (Array.isArray(selectedRows)) {
|
|
219
|
+
return selectedRows.length > 0 && this.selectableRows.every((row) => selectedRows == null ? void 0 : selectedRows.includes(row[UNIQ_ROW_KEY]));
|
|
220
|
+
} else if (selectedRows) {
|
|
221
|
+
return selectedRows.isAllSelected();
|
|
222
|
+
}
|
|
195
223
|
}
|
|
196
224
|
get isIndeterminate() {
|
|
197
225
|
const {
|
|
198
226
|
selectedRows
|
|
199
227
|
} = this.asProps;
|
|
200
|
-
|
|
228
|
+
if (Array.isArray(selectedRows)) {
|
|
229
|
+
return this.selectableRows.some((row) => selectedRows == null ? void 0 : selectedRows.includes(row[UNIQ_ROW_KEY]));
|
|
230
|
+
} else if (selectedRows) {
|
|
231
|
+
return selectedRows.isIndeterminate();
|
|
232
|
+
}
|
|
201
233
|
}
|
|
202
234
|
get selectableRows() {
|
|
203
235
|
const {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import Checkbox from "@semcore/checkbox";
|
|
3
|
+
import React__default from "react";
|
|
4
|
+
import { SelectableRows } from "../../store/SelectableRows.mjs";
|
|
5
|
+
import { Row } from "../Body/Row.mjs";
|
|
6
|
+
import { UNIQ_ROW_KEY, SELECT_ALL } from "../DataTable/DataTable.mjs";
|
|
7
|
+
class RowSelector extends React__default.PureComponent {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
_defineProperty(this, "state", {
|
|
11
|
+
checked: false
|
|
12
|
+
});
|
|
13
|
+
_defineProperty(this, "unsubscribeToggle", void 0);
|
|
14
|
+
_defineProperty(this, "handleSelectRow", (value, event) => {
|
|
15
|
+
const {
|
|
16
|
+
row,
|
|
17
|
+
rowIndex,
|
|
18
|
+
onSelectRow,
|
|
19
|
+
selectedRows
|
|
20
|
+
} = this.props;
|
|
21
|
+
onSelectRow == null ? void 0 : onSelectRow(value, rowIndex, row, event);
|
|
22
|
+
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
23
|
+
selectedRows.toggle(value, row);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
_defineProperty(this, "handleClickCheckbox", (value) => (event) => {
|
|
27
|
+
event == null ? void 0 : event.preventDefault();
|
|
28
|
+
event == null ? void 0 : event.stopPropagation();
|
|
29
|
+
const {
|
|
30
|
+
row,
|
|
31
|
+
rowIndex,
|
|
32
|
+
onSelectRow,
|
|
33
|
+
selectedRows
|
|
34
|
+
} = this.props;
|
|
35
|
+
onSelectRow == null ? void 0 : onSelectRow(value, rowIndex, row, event);
|
|
36
|
+
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
37
|
+
selectedRows.toggle(value, row);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const {
|
|
41
|
+
row: _row,
|
|
42
|
+
selectedRows: _selectedRows
|
|
43
|
+
} = props;
|
|
44
|
+
if (_selectedRows && !Array.isArray(_selectedRows)) {
|
|
45
|
+
this.state.checked = _selectedRows.has(_row[UNIQ_ROW_KEY]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
componentDidMount() {
|
|
49
|
+
const {
|
|
50
|
+
row,
|
|
51
|
+
selectedRows
|
|
52
|
+
} = this.props;
|
|
53
|
+
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
54
|
+
this.unsubscribeToggle = selectedRows.subscribe(SelectableRows.TOGGLE_EVENT, (key) => {
|
|
55
|
+
if (row[UNIQ_ROW_KEY] === key) {
|
|
56
|
+
this.setState({
|
|
57
|
+
checked: selectedRows.has(row[UNIQ_ROW_KEY])
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
componentWillUnmount() {
|
|
64
|
+
var _a;
|
|
65
|
+
(_a = this.unsubscribeToggle) == null ? void 0 : _a.call(this);
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
const SCheckboxCell = Row.Cell;
|
|
69
|
+
const {
|
|
70
|
+
row,
|
|
71
|
+
rowIndex,
|
|
72
|
+
gridRowIndex,
|
|
73
|
+
expanded,
|
|
74
|
+
withAccordion,
|
|
75
|
+
isAccordionRow,
|
|
76
|
+
isCellHidden,
|
|
77
|
+
theme,
|
|
78
|
+
uid,
|
|
79
|
+
selectedRows
|
|
80
|
+
} = this.props;
|
|
81
|
+
const rowUniqKey = row[UNIQ_ROW_KEY];
|
|
82
|
+
const checked = Array.isArray(selectedRows) ? selectedRows.includes(rowUniqKey) : this.state.checked;
|
|
83
|
+
return /* @__PURE__ */ React__default.createElement(SCheckboxCell, {
|
|
84
|
+
row,
|
|
85
|
+
rowIndex,
|
|
86
|
+
column: {
|
|
87
|
+
name: SELECT_ALL.toString()
|
|
88
|
+
},
|
|
89
|
+
columnIndex: 0,
|
|
90
|
+
gridRowIndex,
|
|
91
|
+
onClick: this.handleClickCheckbox(!checked),
|
|
92
|
+
expanded,
|
|
93
|
+
isAccordionRow,
|
|
94
|
+
"aria-hidden": isCellHidden,
|
|
95
|
+
withAccordion,
|
|
96
|
+
theme,
|
|
97
|
+
"data-row-selector": true
|
|
98
|
+
}, /* @__PURE__ */ React__default.createElement(Checkbox, {
|
|
99
|
+
checked,
|
|
100
|
+
"aria-labelledby": `${uid}_${rowUniqKey}_1`,
|
|
101
|
+
onChange: this.handleSelectRow
|
|
102
|
+
}, /* @__PURE__ */ React__default.createElement(Checkbox.Value, null)));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
RowSelector
|
|
107
|
+
};
|