@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
|
-
}
|
|
@@ -19,6 +19,7 @@ var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID
|
|
|
19
19
|
var _useFocusLock = require("@semcore/core/lib/utils/use/useFocusLock");
|
|
20
20
|
var _widgetEmpty = require("@semcore/widget-empty");
|
|
21
21
|
var React = _interopRequireWildcard(require("react"));
|
|
22
|
+
var _SelectableRows = require("../../store/SelectableRows");
|
|
22
23
|
var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
|
|
23
24
|
var _Body = require("../Body/Body");
|
|
24
25
|
var _MergedCells = require("../Body/MergedCells");
|
|
@@ -98,7 +99,7 @@ class DataTableRoot extends _core.Component {
|
|
|
98
99
|
});
|
|
99
100
|
(0, _defineProperty2.default)(this, "selectAllMessageTimer", 0);
|
|
100
101
|
(0, _defineProperty2.default)(this, "headerNodesMap", new Map());
|
|
101
|
-
(0, _defineProperty2.default)(this, "
|
|
102
|
+
(0, _defineProperty2.default)(this, "selectedRowsContainer", void 0);
|
|
102
103
|
(0, _defineProperty2.default)(this, "lastSelectedRowKey", void 0);
|
|
103
104
|
(0, _defineProperty2.default)(this, "state", {
|
|
104
105
|
scrollTop: 0,
|
|
@@ -144,14 +145,20 @@ class DataTableRoot extends _core.Component {
|
|
|
144
145
|
this.initFocusableCell([this.hasFocusableInHeader() ? opt.rowIndex + 1 : opt.rowIndex, opt.colIndex]);
|
|
145
146
|
}
|
|
146
147
|
});
|
|
148
|
+
(0, _defineProperty2.default)(this, "handleSelectAllRows", (selectedRows, event) => {
|
|
149
|
+
if (!('onSelectedRowsChange' in this.asProps) || !this.asProps.onSelectedRowsChange || !Array.isArray(selectedRows)) return;
|
|
150
|
+
this.asProps.onSelectedRowsChange(selectedRows, event);
|
|
151
|
+
});
|
|
147
152
|
(0, _defineProperty2.default)(this, "handleSelectRow", (isSelected, selectedRowIndex, row, event) => {
|
|
148
153
|
const {
|
|
149
|
-
selectedRows
|
|
154
|
+
selectedRows
|
|
155
|
+
} = this.asProps;
|
|
156
|
+
if (!selectedRows || !('onSelectedRowsChange' in this.asProps) || !this.asProps.onSelectedRowsChange || !Array.isArray(selectedRows)) return;
|
|
157
|
+
const {
|
|
150
158
|
onSelectedRowsChange
|
|
151
159
|
} = this.asProps;
|
|
152
|
-
if (!selectedRows || !onSelectedRowsChange) return;
|
|
153
160
|
const selectedRowsSet = new Set(selectedRows);
|
|
154
|
-
if (this.isPressedShift && selectedRowsSet.size > 0 && this.lastSelectedRowKey && (isSelected ? selectedRowsSet.has(this.lastSelectedRowKey) : true)) {
|
|
161
|
+
if (this.selectedRowsContainer.isPressedShift && selectedRowsSet.size > 0 && this.lastSelectedRowKey && (isSelected ? selectedRowsSet.has(this.lastSelectedRowKey) : true)) {
|
|
155
162
|
let select = false;
|
|
156
163
|
const firstColumnKey = this.columns[0].name;
|
|
157
164
|
const isMerged = this.flatRows.some(item => item[firstColumnKey] instanceof _MergedCells.MergedRowsCell);
|
|
@@ -362,13 +369,13 @@ class DataTableRoot extends _core.Component {
|
|
|
362
369
|
}
|
|
363
370
|
case 'Shift':
|
|
364
371
|
{
|
|
365
|
-
this.isPressedShift = true;
|
|
372
|
+
this.selectedRowsContainer.isPressedShift = true;
|
|
366
373
|
}
|
|
367
374
|
}
|
|
368
375
|
});
|
|
369
376
|
(0, _defineProperty2.default)(this, "handleKeyUp", e => {
|
|
370
377
|
if (e.key === 'Shift') {
|
|
371
|
-
this.isPressedShift = false;
|
|
378
|
+
this.selectedRowsContainer.isPressedShift = false;
|
|
372
379
|
}
|
|
373
380
|
});
|
|
374
381
|
(0, _defineProperty2.default)(this, "handleScroll", (0, _rafTrottle.default)(e => {
|
|
@@ -549,6 +556,11 @@ class DataTableRoot extends _core.Component {
|
|
|
549
556
|
this.calculatedRows = this.getRows();
|
|
550
557
|
this.flatRows = this.calculatedRows.flat();
|
|
551
558
|
this.tmpData = props.data;
|
|
559
|
+
if (Array.isArray(props.selectedRows) || !props.selectedRows) {
|
|
560
|
+
this.selectedRowsContainer = new _SelectableRows.SelectableRows();
|
|
561
|
+
} else {
|
|
562
|
+
this.selectedRowsContainer = props.selectedRows;
|
|
563
|
+
}
|
|
552
564
|
}
|
|
553
565
|
componentDidMount() {
|
|
554
566
|
const {
|
|
@@ -582,7 +594,7 @@ class DataTableRoot extends _core.Component {
|
|
|
582
594
|
this.calculateVerticalShadow();
|
|
583
595
|
}
|
|
584
596
|
}
|
|
585
|
-
if (prevProps.selectedRows !== selectedRows && selectedRows !== undefined) {
|
|
597
|
+
if (prevProps.selectedRows !== selectedRows && selectedRows !== undefined && Array.isArray(selectedRows)) {
|
|
586
598
|
const selectedRowsSet = new Set(selectedRows);
|
|
587
599
|
const allChecked = [];
|
|
588
600
|
const allUnchecked = [];
|
|
@@ -599,6 +611,9 @@ class DataTableRoot extends _core.Component {
|
|
|
599
611
|
this.setSelectAllMessage(false);
|
|
600
612
|
}
|
|
601
613
|
}
|
|
614
|
+
if (prevProps.selectedRows !== selectedRows && selectedRows !== undefined && !Array.isArray(selectedRows)) {
|
|
615
|
+
this.selectedRowsContainer = selectedRows;
|
|
616
|
+
}
|
|
602
617
|
}
|
|
603
618
|
componentWillUnmount() {
|
|
604
619
|
if ((0, _canUseDOM.default)()) {
|
|
@@ -668,7 +683,6 @@ class DataTableRoot extends _core.Component {
|
|
|
668
683
|
getI18nText,
|
|
669
684
|
uid,
|
|
670
685
|
headerProps,
|
|
671
|
-
onSelectedRowsChange,
|
|
672
686
|
selectedRows,
|
|
673
687
|
sideIndents,
|
|
674
688
|
variant
|
|
@@ -700,7 +714,7 @@ class DataTableRoot extends _core.Component {
|
|
|
700
714
|
totalRows: this.totalRows,
|
|
701
715
|
selectedRows,
|
|
702
716
|
flatRows: this.getFlatRows(),
|
|
703
|
-
onChangeSelectAll:
|
|
717
|
+
onChangeSelectAll: Array.isArray(selectedRows) ? this.handleSelectAllRows : undefined,
|
|
704
718
|
getFixedStyle: this.getFixedStyle,
|
|
705
719
|
onCellClick: this.handleCellClick,
|
|
706
720
|
shadowVertical,
|
|
@@ -770,7 +784,7 @@ class DataTableRoot extends _core.Component {
|
|
|
770
784
|
renderEmptyData,
|
|
771
785
|
sideIndents,
|
|
772
786
|
selectedRows,
|
|
773
|
-
onSelectRow: this.handleSelectRow,
|
|
787
|
+
onSelectRow: Array.isArray(selectedRows) ? this.handleSelectRow : undefined,
|
|
774
788
|
getFixedStyle: this.getFixedStyle,
|
|
775
789
|
onCellClick: this.handleCellClick,
|
|
776
790
|
rawData,
|
|
@@ -832,7 +846,7 @@ class DataTableRoot extends _core.Component {
|
|
|
832
846
|
const width = w ?? (this.columns.some(c => c.gtcWidth === 'auto' || c.gtcWidth === '1fr') ? '100%' : undefined);
|
|
833
847
|
let gridTemplateRows = undefined;
|
|
834
848
|
if (virtualScroll && typeof virtualScroll !== 'boolean' && 'rowHeight' in virtualScroll) {
|
|
835
|
-
gridTemplateRows = `auto auto repeat(${this.totalRows}, minmax(${virtualScroll.rowHeight}px, auto)`;
|
|
849
|
+
gridTemplateRows = `auto auto repeat(${this.totalRows}, minmax(${virtualScroll.rowHeight}px, auto))`;
|
|
836
850
|
}
|
|
837
851
|
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/React.createElement(_baseComponents.ScrollArea, _ref2.cn("ScrollArea", {
|
|
838
852
|
"leftOffset": offsetLeftSum,
|
|
@@ -1024,12 +1038,14 @@ class DataTableRoot extends _core.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;
|
|
@@ -1101,6 +1117,10 @@ class DataTableRoot extends _core.Component {
|
|
|
1101
1117
|
dtRow[value] = '';
|
|
1102
1118
|
});
|
|
1103
1119
|
}
|
|
1120
|
+
if (!excludeColumns) {
|
|
1121
|
+
// we should add only the main row in mergedRows or default rows
|
|
1122
|
+
availableRowKeys.push(dtRow[UNIQ_ROW_KEY]);
|
|
1123
|
+
}
|
|
1104
1124
|
return dtRow;
|
|
1105
1125
|
};
|
|
1106
1126
|
data.forEach(row => {
|
|
@@ -1157,6 +1177,9 @@ class DataTableRoot extends _core.Component {
|
|
|
1157
1177
|
}
|
|
1158
1178
|
});
|
|
1159
1179
|
this.calculatedRows = rows;
|
|
1180
|
+
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
1181
|
+
selectedRows.setAvailableKeys(availableRowKeys);
|
|
1182
|
+
}
|
|
1160
1183
|
return rows;
|
|
1161
1184
|
}
|
|
1162
1185
|
calculateGridTemplateColumn(c) {
|