@cloudscape-design/components 3.0.1327 → 3.0.1328
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/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +70 -67
- package/help-panel/styles.selectors.js +6 -6
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/option/utils/filter-options.d.ts.map +1 -1
- package/internal/components/option/utils/filter-options.js +8 -7
- package/internal/components/option/utils/filter-options.js.map +1 -1
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +4 -8
- package/table/thead.js.map +1 -1
package/help-panel/styles.css.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"help-panel": "awsui_help-
|
|
5
|
-
"loading": "
|
|
6
|
-
"header": "
|
|
7
|
-
"with-toolbar": "awsui_with-
|
|
8
|
-
"content": "
|
|
9
|
-
"footer": "
|
|
4
|
+
"help-panel": "awsui_help-panel_1d237_kjmc1_181",
|
|
5
|
+
"loading": "awsui_loading_1d237_kjmc1_354",
|
|
6
|
+
"header": "awsui_header_1d237_kjmc1_359",
|
|
7
|
+
"with-toolbar": "awsui_with-toolbar_1d237_kjmc1_377",
|
|
8
|
+
"content": "awsui_content_1d237_kjmc1_396",
|
|
9
|
+
"footer": "awsui_footer_1d237_kjmc1_448"
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
*/
|
|
179
179
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
180
180
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
181
|
-
.awsui_help-
|
|
181
|
+
.awsui_help-panel_1d237_kjmc1_181:not(#\9) {
|
|
182
182
|
border-collapse: separate;
|
|
183
183
|
border-spacing: 0;
|
|
184
184
|
box-sizing: border-box;
|
|
@@ -210,40 +210,40 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
210
210
|
-moz-osx-font-smoothing: auto;
|
|
211
211
|
word-wrap: break-word;
|
|
212
212
|
padding-block-start: var(--space-panel-header-vertical-ckfgmy, 20px);
|
|
213
|
-
padding-block-end:
|
|
213
|
+
padding-block-end: 0;
|
|
214
214
|
/* stylelint-disable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
215
215
|
/* stylelint-enable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
216
216
|
}
|
|
217
|
-
.awsui_help-
|
|
217
|
+
.awsui_help-panel_1d237_kjmc1_181 hr:not(#\9) {
|
|
218
218
|
border-block: none;
|
|
219
219
|
border-inline: none;
|
|
220
220
|
border-block-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
221
221
|
margin-block: var(--space-scaled-xl-dunxp5, 24px);
|
|
222
222
|
margin-inline: calc(-1 * var(--space-panel-divider-margin-horizontal-yw31p0, 8px));
|
|
223
223
|
}
|
|
224
|
-
.awsui_help-
|
|
225
|
-
.awsui_help-
|
|
224
|
+
.awsui_help-panel_1d237_kjmc1_181 ol:not(#\9),
|
|
225
|
+
.awsui_help-panel_1d237_kjmc1_181 ul:not(#\9) {
|
|
226
226
|
padding-inline-start: var(--space-l-2ud1p3, 20px);
|
|
227
227
|
list-style-position: outside;
|
|
228
228
|
margin-block: var(--space-s-tvghoh, 12px);
|
|
229
229
|
margin-inline: 0;
|
|
230
230
|
}
|
|
231
|
-
.awsui_help-
|
|
231
|
+
.awsui_help-panel_1d237_kjmc1_181 li:not(#\9) {
|
|
232
232
|
margin-block: var(--space-scaled-xxs-pfm1nx, 4px);
|
|
233
233
|
margin-inline: 0;
|
|
234
234
|
}
|
|
235
|
-
.awsui_help-
|
|
236
|
-
.awsui_help-
|
|
237
|
-
.awsui_help-
|
|
238
|
-
.awsui_help-
|
|
239
|
-
.awsui_help-
|
|
240
|
-
.awsui_help-
|
|
241
|
-
.awsui_help-
|
|
235
|
+
.awsui_help-panel_1d237_kjmc1_181 a:not(#\9),
|
|
236
|
+
.awsui_help-panel_1d237_kjmc1_181 h2:not(#\9),
|
|
237
|
+
.awsui_help-panel_1d237_kjmc1_181 h3:not(#\9),
|
|
238
|
+
.awsui_help-panel_1d237_kjmc1_181 h4:not(#\9),
|
|
239
|
+
.awsui_help-panel_1d237_kjmc1_181 h5:not(#\9),
|
|
240
|
+
.awsui_help-panel_1d237_kjmc1_181 pre:not(#\9),
|
|
241
|
+
.awsui_help-panel_1d237_kjmc1_181 code:not(#\9) {
|
|
242
242
|
margin-block: var(--space-xs-ymlm0b, 8px);
|
|
243
243
|
margin-inline: 0;
|
|
244
244
|
padding-block: 0;
|
|
245
245
|
}
|
|
246
|
-
.awsui_help-
|
|
246
|
+
.awsui_help-panel_1d237_kjmc1_181 code:not(#\9) {
|
|
247
247
|
font-size: var(--font-size-body-s-smc8cv, 12px);
|
|
248
248
|
line-height: var(--line-height-body-s-nu5hx1, 16px);
|
|
249
249
|
letter-spacing: var(--letter-spacing-body-s-gq78ok, 0.005em);
|
|
@@ -254,7 +254,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
254
254
|
word-wrap: break-word;
|
|
255
255
|
white-space: pre-wrap;
|
|
256
256
|
}
|
|
257
|
-
.awsui_help-
|
|
257
|
+
.awsui_help-panel_1d237_kjmc1_181 pre:not(#\9) {
|
|
258
258
|
font-size: var(--font-size-body-s-smc8cv, 12px);
|
|
259
259
|
line-height: var(--line-height-body-s-nu5hx1, 16px);
|
|
260
260
|
letter-spacing: var(--letter-spacing-body-s-gq78ok, 0.005em);
|
|
@@ -267,38 +267,41 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
267
267
|
padding-block: var(--space-xxs-hwfkai, 4px);
|
|
268
268
|
padding-inline: var(--space-xxs-hwfkai, 4px);
|
|
269
269
|
}
|
|
270
|
-
.awsui_help-
|
|
270
|
+
.awsui_help-panel_1d237_kjmc1_181 dl:not(#\9) {
|
|
271
271
|
margin-block: var(--space-s-tvghoh, 12px);
|
|
272
272
|
margin-inline: 0;
|
|
273
273
|
/* stylelint-disable-next-line selector-max-universal */
|
|
274
274
|
}
|
|
275
|
-
.awsui_help-
|
|
275
|
+
.awsui_help-panel_1d237_kjmc1_181 dl *:not(#\9) {
|
|
276
276
|
margin-block: 0;
|
|
277
277
|
}
|
|
278
|
-
.awsui_help-
|
|
278
|
+
.awsui_help-panel_1d237_kjmc1_181 dt:not(#\9) {
|
|
279
279
|
margin-block-start: var(--space-xs-ymlm0b, 8px);
|
|
280
280
|
font-weight: var(--font-weight-bold-fo1afg, 700);
|
|
281
281
|
}
|
|
282
|
-
.awsui_help-
|
|
282
|
+
.awsui_help-panel_1d237_kjmc1_181 dd:not(#\9) {
|
|
283
283
|
margin-block-start: 0;
|
|
284
284
|
margin-block-end: var(--space-xs-ymlm0b, 8px);
|
|
285
285
|
margin-inline: 0;
|
|
286
286
|
}
|
|
287
|
-
.awsui_help-
|
|
288
|
-
.awsui_help-
|
|
289
|
-
.awsui_help-
|
|
290
|
-
.awsui_help-
|
|
291
|
-
.awsui_help-
|
|
287
|
+
.awsui_help-panel_1d237_kjmc1_181 h2:not(#\9),
|
|
288
|
+
.awsui_help-panel_1d237_kjmc1_181 h3:not(#\9),
|
|
289
|
+
.awsui_help-panel_1d237_kjmc1_181 h4:not(#\9),
|
|
290
|
+
.awsui_help-panel_1d237_kjmc1_181 h5:not(#\9),
|
|
291
|
+
.awsui_help-panel_1d237_kjmc1_181 h6:not(#\9) {
|
|
292
292
|
margin-block-start: var(--space-xl-jfy3x4, 24px);
|
|
293
293
|
color: var(--color-text-heading-default-izpp46, #0f141a);
|
|
294
294
|
}
|
|
295
|
-
.awsui_help-
|
|
295
|
+
.awsui_help-panel_1d237_kjmc1_181 > :not(#\9):last-child {
|
|
296
|
+
margin-block-end: var(--space-panel-content-bottom-24c6lu, 40px);
|
|
297
|
+
}
|
|
298
|
+
.awsui_help-panel_1d237_kjmc1_181 p:not(#\9) {
|
|
296
299
|
color: inherit;
|
|
297
300
|
text-decoration: none;
|
|
298
301
|
margin-block: var(--space-s-tvghoh, 12px);
|
|
299
302
|
margin-inline: 0;
|
|
300
303
|
}
|
|
301
|
-
.awsui_help-
|
|
304
|
+
.awsui_help-panel_1d237_kjmc1_181 h1:not(#\9) {
|
|
302
305
|
font-family: var(--font-family-heading-ugphat, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
303
306
|
font-size: var(--font-size-heading-xl-wvkbur, 24px);
|
|
304
307
|
line-height: var(--line-height-heading-xl-hko6p0, 30px);
|
|
@@ -307,7 +310,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
307
310
|
-webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
|
|
308
311
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
|
|
309
312
|
}
|
|
310
|
-
.awsui_help-
|
|
313
|
+
.awsui_help-panel_1d237_kjmc1_181 h2:not(#\9) {
|
|
311
314
|
font-family: var(--font-family-heading-ugphat, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
312
315
|
font-size: var(--font-size-heading-l-vnacx6, 20px);
|
|
313
316
|
line-height: var(--line-height-heading-l-mg5bx6, 24px);
|
|
@@ -316,7 +319,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
316
319
|
-webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
|
|
317
320
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
|
|
318
321
|
}
|
|
319
|
-
.awsui_help-
|
|
322
|
+
.awsui_help-panel_1d237_kjmc1_181 h3:not(#\9) {
|
|
320
323
|
font-family: var(--font-family-heading-ugphat, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
321
324
|
font-size: var(--font-size-heading-m-170yiy, 18px);
|
|
322
325
|
line-height: var(--line-height-heading-m-uoaqdh, 22px);
|
|
@@ -325,7 +328,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
325
328
|
-webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
|
|
326
329
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
|
|
327
330
|
}
|
|
328
|
-
.awsui_help-
|
|
331
|
+
.awsui_help-panel_1d237_kjmc1_181 h4:not(#\9) {
|
|
329
332
|
font-family: var(--font-family-heading-ugphat, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
330
333
|
font-size: var(--font-size-heading-s-zp08en, 16px);
|
|
331
334
|
line-height: var(--line-height-heading-s-hmi4vc, 20px);
|
|
@@ -334,7 +337,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
334
337
|
-webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
|
|
335
338
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
|
|
336
339
|
}
|
|
337
|
-
.awsui_help-
|
|
340
|
+
.awsui_help-panel_1d237_kjmc1_181 h5:not(#\9) {
|
|
338
341
|
font-family: var(--font-family-heading-ugphat, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
339
342
|
font-size: var(--font-size-heading-xs-j8yzxv, 14px);
|
|
340
343
|
line-height: var(--line-height-heading-xs-q9j004, 18px);
|
|
@@ -343,17 +346,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
343
346
|
-webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
|
|
344
347
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
|
|
345
348
|
}
|
|
346
|
-
.awsui_help-
|
|
347
|
-
.awsui_help-
|
|
349
|
+
.awsui_help-panel_1d237_kjmc1_181 b:not(#\9),
|
|
350
|
+
.awsui_help-panel_1d237_kjmc1_181 strong:not(#\9) {
|
|
348
351
|
font-weight: var(--font-weight-bold-fo1afg, 700);
|
|
349
352
|
}
|
|
350
353
|
|
|
351
|
-
.
|
|
354
|
+
.awsui_loading_1d237_kjmc1_354:not(#\9) {
|
|
352
355
|
padding-inline-start: var(--space-panel-side-left-u1m3s9, 28px);
|
|
353
356
|
padding-inline-end: var(--space-panel-side-right-8wwirc, 24px);
|
|
354
357
|
}
|
|
355
358
|
|
|
356
|
-
.
|
|
359
|
+
.awsui_header_1d237_kjmc1_359:not(#\9) {
|
|
357
360
|
font-size: var(--font-panel-header-size-33h9j8, 18px);
|
|
358
361
|
letter-spacing: var(--letter-spacing-heading-m-29ewnk, -0.01em);
|
|
359
362
|
line-height: var(--font-panel-header-line-height-8xb2qj, 22px);
|
|
@@ -371,15 +374,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
371
374
|
/* stylelint-disable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
372
375
|
/* stylelint-enable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
373
376
|
}
|
|
374
|
-
.awsui_with-
|
|
377
|
+
.awsui_with-toolbar_1d237_kjmc1_377 > .awsui_header_1d237_kjmc1_359:not(#\9) {
|
|
375
378
|
border-color: transparent;
|
|
376
379
|
margin-block-end: 0px;
|
|
377
380
|
}
|
|
378
|
-
.
|
|
379
|
-
.
|
|
380
|
-
.
|
|
381
|
-
.
|
|
382
|
-
.
|
|
381
|
+
.awsui_header_1d237_kjmc1_359 h2:not(#\9),
|
|
382
|
+
.awsui_header_1d237_kjmc1_359 h3:not(#\9),
|
|
383
|
+
.awsui_header_1d237_kjmc1_359 h4:not(#\9),
|
|
384
|
+
.awsui_header_1d237_kjmc1_359 h5:not(#\9),
|
|
385
|
+
.awsui_header_1d237_kjmc1_359 h6:not(#\9) {
|
|
383
386
|
font-size: var(--font-panel-header-size-33h9j8, 18px);
|
|
384
387
|
letter-spacing: var(--letter-spacing-heading-m-29ewnk, -0.01em);
|
|
385
388
|
line-height: var(--font-panel-header-line-height-8xb2qj, 22px);
|
|
@@ -390,22 +393,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
390
393
|
margin-block: 0;
|
|
391
394
|
}
|
|
392
395
|
|
|
393
|
-
.
|
|
396
|
+
.awsui_content_1d237_kjmc1_396:not(#\9) {
|
|
394
397
|
color: var(--color-text-body-secondary-yna5sb, #424650);
|
|
395
398
|
padding-inline-start: var(--space-panel-side-left-u1m3s9, 28px);
|
|
396
399
|
padding-inline-end: var(--space-panel-side-right-8wwirc, 24px);
|
|
397
400
|
/* stylelint-disable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
398
401
|
/* stylelint-enable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
399
402
|
}
|
|
400
|
-
.
|
|
401
|
-
.
|
|
402
|
-
.
|
|
403
|
-
.
|
|
404
|
-
.
|
|
405
|
-
.
|
|
403
|
+
.awsui_content_1d237_kjmc1_396 h2:not(#\9):first-child,
|
|
404
|
+
.awsui_content_1d237_kjmc1_396 h3:not(#\9):first-child,
|
|
405
|
+
.awsui_content_1d237_kjmc1_396 h4:not(#\9):first-child,
|
|
406
|
+
.awsui_content_1d237_kjmc1_396 h5:not(#\9):first-child,
|
|
407
|
+
.awsui_content_1d237_kjmc1_396 h6:not(#\9):first-child,
|
|
408
|
+
.awsui_content_1d237_kjmc1_396 p:not(#\9):first-child {
|
|
406
409
|
margin-block-start: 0;
|
|
407
410
|
}
|
|
408
|
-
.
|
|
411
|
+
.awsui_content_1d237_kjmc1_396 a:not(#\9) {
|
|
409
412
|
text-underline-offset: 0.25em;
|
|
410
413
|
text-decoration-thickness: var(--font-decoration-thickness-link-uesuo7, 1px);
|
|
411
414
|
text-decoration-style: var(--font-decoration-style-link-pk2xmp, solid);
|
|
@@ -420,31 +423,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
420
423
|
transition-duration: var(--motion-duration-refresh-only-medium-5rbn3k, 165ms);
|
|
421
424
|
}
|
|
422
425
|
@media (prefers-reduced-motion: reduce) {
|
|
423
|
-
.
|
|
426
|
+
.awsui_content_1d237_kjmc1_396 a:not(#\9) {
|
|
424
427
|
animation: none;
|
|
425
428
|
transition: none;
|
|
426
429
|
}
|
|
427
430
|
}
|
|
428
|
-
.awsui-motion-disabled .
|
|
431
|
+
.awsui-motion-disabled .awsui_content_1d237_kjmc1_396 a:not(#\9), .awsui-mode-entering .awsui_content_1d237_kjmc1_396 a:not(#\9) {
|
|
429
432
|
animation: none;
|
|
430
433
|
transition: none;
|
|
431
434
|
}
|
|
432
|
-
.
|
|
435
|
+
.awsui_content_1d237_kjmc1_396 a:not(#\9):hover {
|
|
433
436
|
cursor: pointer;
|
|
434
437
|
color: var(--awsui-style-color-hover-6b9ypa, var(--color-text-link-hover-2hfec2, #002b66));
|
|
435
438
|
}
|
|
436
|
-
.
|
|
439
|
+
.awsui_content_1d237_kjmc1_396 a:not(#\9):focus {
|
|
437
440
|
outline: none;
|
|
438
441
|
}
|
|
439
|
-
.
|
|
442
|
+
.awsui_content_1d237_kjmc1_396 a:not(#\9):active {
|
|
440
443
|
color: var(--awsui-style-color-active-6b9ypa, var(--color-text-link-hover-2hfec2, #002b66));
|
|
441
444
|
}
|
|
442
|
-
.
|
|
445
|
+
.awsui_content_1d237_kjmc1_396 a:not(#\9):active, .awsui_content_1d237_kjmc1_396 a:not(#\9):focus, .awsui_content_1d237_kjmc1_396 a:not(#\9):hover {
|
|
443
446
|
text-decoration-line: underline;
|
|
444
447
|
text-decoration-color: var(--color-text-link-decoration-hover-kui2t9, currentColor);
|
|
445
448
|
}
|
|
446
449
|
|
|
447
|
-
.
|
|
450
|
+
.awsui_footer_1d237_kjmc1_448:not(#\9) {
|
|
448
451
|
color: var(--color-text-body-secondary-yna5sb, #424650);
|
|
449
452
|
padding-block: 0;
|
|
450
453
|
padding-inline-start: var(--space-panel-side-left-u1m3s9, 28px);
|
|
@@ -452,11 +455,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
452
455
|
/* stylelint-disable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
453
456
|
/* stylelint-enable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
454
457
|
}
|
|
455
|
-
.
|
|
458
|
+
.awsui_footer_1d237_kjmc1_448 ul:not(#\9) {
|
|
456
459
|
list-style: none;
|
|
457
460
|
padding-inline-start: 0;
|
|
458
461
|
}
|
|
459
|
-
.
|
|
462
|
+
.awsui_footer_1d237_kjmc1_448 a:not(#\9) {
|
|
460
463
|
text-underline-offset: 0.25em;
|
|
461
464
|
text-decoration-thickness: var(--font-decoration-thickness-link-uesuo7, 1px);
|
|
462
465
|
text-decoration-style: var(--font-decoration-style-link-pk2xmp, solid);
|
|
@@ -471,37 +474,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
471
474
|
transition-duration: var(--motion-duration-refresh-only-medium-5rbn3k, 165ms);
|
|
472
475
|
}
|
|
473
476
|
@media (prefers-reduced-motion: reduce) {
|
|
474
|
-
.
|
|
477
|
+
.awsui_footer_1d237_kjmc1_448 a:not(#\9) {
|
|
475
478
|
animation: none;
|
|
476
479
|
transition: none;
|
|
477
480
|
}
|
|
478
481
|
}
|
|
479
|
-
.awsui-motion-disabled .
|
|
482
|
+
.awsui-motion-disabled .awsui_footer_1d237_kjmc1_448 a:not(#\9), .awsui-mode-entering .awsui_footer_1d237_kjmc1_448 a:not(#\9) {
|
|
480
483
|
animation: none;
|
|
481
484
|
transition: none;
|
|
482
485
|
}
|
|
483
|
-
.
|
|
486
|
+
.awsui_footer_1d237_kjmc1_448 a:not(#\9):hover {
|
|
484
487
|
cursor: pointer;
|
|
485
488
|
color: var(--awsui-style-color-hover-6b9ypa, var(--color-text-link-secondary-hover-0kzmc4, #002b66));
|
|
486
489
|
}
|
|
487
|
-
.
|
|
490
|
+
.awsui_footer_1d237_kjmc1_448 a:not(#\9):focus {
|
|
488
491
|
outline: none;
|
|
489
492
|
}
|
|
490
|
-
.
|
|
493
|
+
.awsui_footer_1d237_kjmc1_448 a:not(#\9):active {
|
|
491
494
|
color: var(--awsui-style-color-active-6b9ypa, var(--color-text-link-secondary-hover-0kzmc4, #002b66));
|
|
492
495
|
}
|
|
493
|
-
.
|
|
496
|
+
.awsui_footer_1d237_kjmc1_448 a:not(#\9):active, .awsui_footer_1d237_kjmc1_448 a:not(#\9):focus, .awsui_footer_1d237_kjmc1_448 a:not(#\9):hover {
|
|
494
497
|
text-decoration-line: underline;
|
|
495
498
|
text-decoration-color: var(--color-text-link-decoration-hover-kui2t9, currentColor);
|
|
496
499
|
}
|
|
497
500
|
|
|
498
|
-
.
|
|
499
|
-
.
|
|
501
|
+
.awsui_content_1d237_kjmc1_396:not(#\9),
|
|
502
|
+
.awsui_footer_1d237_kjmc1_448:not(#\9) {
|
|
500
503
|
/* stylelint-disable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
501
504
|
/* stylelint-enable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
502
505
|
}
|
|
503
|
-
.
|
|
504
|
-
.
|
|
506
|
+
.awsui_content_1d237_kjmc1_396 a:not(#\9):focus,
|
|
507
|
+
.awsui_footer_1d237_kjmc1_448 a:not(#\9):focus {
|
|
505
508
|
outline: thin dotted;
|
|
506
509
|
outline: var(--border-link-focus-ring-outline-1p0hnu, 0);
|
|
507
510
|
outline-offset: 2px;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"help-panel": "awsui_help-
|
|
6
|
-
"loading": "
|
|
7
|
-
"header": "
|
|
8
|
-
"with-toolbar": "awsui_with-
|
|
9
|
-
"content": "
|
|
10
|
-
"footer": "
|
|
5
|
+
"help-panel": "awsui_help-panel_1d237_kjmc1_181",
|
|
6
|
+
"loading": "awsui_loading_1d237_kjmc1_354",
|
|
7
|
+
"header": "awsui_header_1d237_kjmc1_359",
|
|
8
|
+
"with-toolbar": "awsui_with-toolbar_1d237_kjmc1_377",
|
|
9
|
+
"content": "awsui_content_1d237_kjmc1_396",
|
|
10
|
+
"footer": "awsui_footer_1d237_kjmc1_448"
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-options.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/components/option/utils/filter-options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"filter-options.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/components/option/utils/filter-options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO/C,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,SAAS,EAAE,YAAY,MAAM,EAAE,gBAAgB,OAAO,KAAG,OAMtG,CAAC;AAkBF,eAAO,MAAM,aAAa,GACxB,SAAS,aAAa,CAAC,cAAc,CAAC,EACtC,YAAY,MAAM,EAClB,wBAAsB,KACrB,aAAa,CAAC,cAAc,CAgC9B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,cAAc,YAA6D,CAAC;AAEnH,eAAO,MAAM,kBAAkB,GAAI,SAAS,cAAc,YAAiC,CAAC;AAE5F,eAAO,MAAM,OAAO,GAAI,SAAS,gBAAgB,GAAG,WAAW,KAAG,MAAM,IAAI,WAG3E,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
const searchableFields = ['value', 'label', 'description', 'labelTag'];
|
|
2
|
-
const searchableTagFieldsStrict = ['tags'];
|
|
3
|
-
const searchableTagFieldsNonStrict = ['tags', 'filteringTags'];
|
|
4
2
|
export const matchesString = (value, searchText, strictMatching) => {
|
|
5
3
|
if (!value) {
|
|
6
4
|
return false;
|
|
@@ -8,25 +6,28 @@ export const matchesString = (value, searchText, strictMatching) => {
|
|
|
8
6
|
const index = value.toLowerCase().indexOf(searchText);
|
|
9
7
|
return strictMatching ? index === 0 : index > -1;
|
|
10
8
|
};
|
|
11
|
-
const matchesSingleOption = (dropdownOption,
|
|
9
|
+
const matchesSingleOption = (dropdownOption, text, strictMatching) => {
|
|
10
|
+
const searchText = text.toLowerCase();
|
|
12
11
|
const option = dropdownOption.option;
|
|
13
12
|
const searchStrFields = (attr) => matchesString(option[attr], searchText, strictMatching);
|
|
14
13
|
const searchTagsFields = (attr) => { var _a; return (_a = option[attr]) === null || _a === void 0 ? void 0 : _a.some(value => matchesString(value, searchText, strictMatching)); };
|
|
15
|
-
const searchableTagFields =
|
|
14
|
+
const searchableTagFields = ['tags'];
|
|
15
|
+
if (!strictMatching) {
|
|
16
|
+
searchableTagFields.push('filteringTags');
|
|
17
|
+
}
|
|
16
18
|
return searchableFields.some(searchStrFields) || searchableTagFields.some(searchTagsFields);
|
|
17
19
|
};
|
|
18
20
|
export const filterOptions = (options, searchText, strictMatching = false) => {
|
|
19
21
|
if (searchText === '') {
|
|
20
22
|
return options;
|
|
21
23
|
}
|
|
22
|
-
const normalizedSearchText = searchText.toLowerCase();
|
|
23
24
|
let currentGroup = null;
|
|
24
25
|
let parentMatched = false;
|
|
25
26
|
return options.reduce((acc, option) => {
|
|
26
27
|
if (option.type === 'parent') {
|
|
27
28
|
parentMatched = false;
|
|
28
29
|
currentGroup = option;
|
|
29
|
-
if (matchesSingleOption(option,
|
|
30
|
+
if (matchesSingleOption(option, searchText, strictMatching)) {
|
|
30
31
|
parentMatched = true;
|
|
31
32
|
acc.push(currentGroup);
|
|
32
33
|
}
|
|
@@ -39,7 +40,7 @@ export const filterOptions = (options, searchText, strictMatching = false) => {
|
|
|
39
40
|
if (parentMatched) {
|
|
40
41
|
acc.push(option);
|
|
41
42
|
}
|
|
42
|
-
else if (matchesSingleOption(option,
|
|
43
|
+
else if (matchesSingleOption(option, searchText, strictMatching)) {
|
|
43
44
|
if (currentGroup) {
|
|
44
45
|
acc.push(currentGroup);
|
|
45
46
|
currentGroup = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-options.js","sourceRoot":"","sources":["../../../../../../src/internal/components/option/utils/filter-options.ts"],"names":[],"mappings":"AAQA,MAAM,gBAAgB,GAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"filter-options.js","sourceRoot":"","sources":["../../../../../../src/internal/components/option/utils/filter-options.ts"],"names":[],"mappings":"AAQA,MAAM,gBAAgB,GAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;AAE1F,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAE,UAAkB,EAAE,cAAuB,EAAW,EAAE;IAC/G,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACtD,OAAO,cAAc,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC;AA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AC;AACvD,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { OptionDefinition, OptionGroup } from '../../../../types/option';\nimport { DropdownOption } from '../interfaces';\n\ntype SearchableField = 'value' | 'label' | 'description' | 'labelTag';\ntype SearchableTagField = 'tags' | 'filteringTags';\n\nconst searchableFields: SearchableField[] = ['value', 'label', 'description', 'labelTag'];\n\nexport const matchesString = (value: string | undefined, searchText: string, strictMatching: boolean): boolean => {\n if (!value) {\n return false;\n }\n const index = value.toLowerCase().indexOf(searchText);\n return strictMatching ? index === 0 : index > -1;\n};\n\nconst matchesSingleOption = (dropdownOption: DropdownOption, text: string, strictMatching: boolean): boolean => {\n const searchText = text.toLowerCase();\n\n const option: OptionDefinition = dropdownOption.option;\n const searchStrFields = (attr: SearchableField) => matchesString(option[attr], searchText, strictMatching);\n const searchTagsFields = (attr: SearchableTagField) =>\n option[attr]?.some(value => matchesString(value, searchText, strictMatching));\n\n const searchableTagFields: SearchableTagField[] = ['tags'];\n if (!strictMatching) {\n searchableTagFields.push('filteringTags');\n }\n\n return searchableFields.some(searchStrFields) || searchableTagFields.some(searchTagsFields);\n};\n\nexport const filterOptions = (\n options: ReadonlyArray<DropdownOption>,\n searchText: string,\n strictMatching = false\n): ReadonlyArray<DropdownOption> => {\n if (searchText === '') {\n return options;\n }\n\n let currentGroup: DropdownOption | null = null;\n let parentMatched = false;\n return options.reduce<DropdownOption[]>((acc, option) => {\n if (option.type === 'parent') {\n parentMatched = false;\n currentGroup = option;\n if (matchesSingleOption(option, searchText, strictMatching)) {\n parentMatched = true;\n acc.push(currentGroup);\n }\n return acc;\n }\n if (option.type !== 'child') {\n currentGroup = null;\n parentMatched = false;\n }\n if (parentMatched) {\n acc.push(option);\n } else if (matchesSingleOption(option, searchText, strictMatching)) {\n if (currentGroup) {\n acc.push(currentGroup);\n currentGroup = null;\n }\n acc.push(option);\n }\n return acc;\n }, []);\n};\n\nexport const isInteractive = (option?: DropdownOption) => !!option && !option.disabled && option.type !== 'parent';\n\nexport const isGroupInteractive = (option?: DropdownOption) => !!option && !option.disabled;\n\nexport const isGroup = (option?: OptionDefinition | OptionGroup): option is OptionGroup => {\n const key: keyof OptionGroup = 'options';\n return !!option && key in option && !!option.options;\n};\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (3f01803d)";
|
|
3
|
+
export var GIT_SHA = "3f01803d";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
package/internal/manifest.json
CHANGED
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"./internal/base-component/index.js",
|
|
168
168
|
"./internal/base-component/styles.css.js"
|
|
169
169
|
],
|
|
170
|
-
"version": "3.0.
|
|
170
|
+
"version": "3.0.1328",
|
|
171
171
|
"repository": {
|
|
172
172
|
"type": "git",
|
|
173
173
|
"url": "https://github.com/cloudscape-design/components.git"
|
package/table/thead.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["../../../src/table/thead.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["../../../src/table/thead.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;A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AAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,kBAAkB,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,WAAW,CAAC;IAC/B,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACjC,wBAAwB,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5D,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,QAAA,MAAM,KAAK,wFA6XV,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/table/thead.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { findUpUntil } from '@cloudscape-design/component-toolkit/dom';
|
|
6
6
|
import { fireNonCancelableEvent } from '../internal/events';
|
|
@@ -15,10 +15,6 @@ import { getColumnKey } from './utils';
|
|
|
15
15
|
import styles from './styles.css.js';
|
|
16
16
|
const Thead = React.forwardRef(({ selectionType, getSelectAllProps, columnDefinitions, columnGroupsLayout, sortingColumn, sortingDisabled, sortingDescending, resizableColumns, variant, tableVariant, wrapLines, onFocusMove, onSortingChange, onResizeFinish, singleSelectionHeaderAriaLabel, stripedRows, sticky = false, hidden = false, stuck = false, stickyState, stickyColumnsFirst, stickyColumnsLast, selectionColumnId, focusedComponent, onFocusedComponentChange, tableRole, resizerRoleDescription, resizerTooltipText, isExpandable, setLastUserAction, }, outerRef) => {
|
|
17
17
|
const { getColumnStyles, columnWidths, updateColumn, updateGroup, setCell } = useColumnWidths();
|
|
18
|
-
// This guarantees the width reported via `onColumnWidthsChange` matches the final rendered width instead of a stale one.
|
|
19
|
-
// Without this, resetting/remounting a table right after a resize can restore an outdated width.
|
|
20
|
-
const columnWidthsRef = useRef(columnWidths);
|
|
21
|
-
columnWidthsRef.current = columnWidths;
|
|
22
18
|
const handleSplitGroupResize = (columnIds, newWidth) => {
|
|
23
19
|
const lastColumn = columnIds[columnIds.length - 1];
|
|
24
20
|
if (lastColumn) {
|
|
@@ -55,7 +51,7 @@ const Thead = React.forwardRef(({ selectionType, getSelectAllProps, columnDefini
|
|
|
55
51
|
selectionType ? (React.createElement(TableHeaderSelectionCell, { ...commonCellProps, focusedComponent: focusedComponent, columnId: selectionColumnId, cellRef: node => setCell(sticky, selectionColumnId, node), getSelectAllProps: getSelectAllProps, onFocusMove: onFocusMove, singleSelectionHeaderAriaLabel: singleSelectionHeaderAriaLabel })) : null,
|
|
56
52
|
columnDefinitions.map((column, colIndex) => {
|
|
57
53
|
const columnId = getColumnKey(column, colIndex);
|
|
58
|
-
return (React.createElement(TableHeaderCell, { ...commonCellProps, key: columnId, tabIndex: sticky ? -1 : 0, focusedComponent: focusedComponent, column: column, activeSortingColumn: sortingColumn, sortingDescending: sortingDescending, sortingDisabled: sortingDisabled, wrapLines: wrapLines, colIndex: selectionType ? colIndex + 1 : colIndex, columnId: columnId, updateColumn: updateColumn, onResizeFinish: () => onResizeFinish(
|
|
54
|
+
return (React.createElement(TableHeaderCell, { ...commonCellProps, key: columnId, tabIndex: sticky ? -1 : 0, focusedComponent: focusedComponent, column: column, activeSortingColumn: sortingColumn, sortingDescending: sortingDescending, sortingDisabled: sortingDisabled, wrapLines: wrapLines, colIndex: selectionType ? colIndex + 1 : colIndex, columnId: columnId, updateColumn: updateColumn, onResizeFinish: () => onResizeFinish(columnWidths), resizableColumns: resizableColumns, resizableStyle: getColumnStyles(sticky, columnId), onClick: detail => {
|
|
59
55
|
setLastUserAction('sorting');
|
|
60
56
|
fireNonCancelableEvent(onSortingChange, detail);
|
|
61
57
|
}, isEditable: !!column.editConfig, cellRef: node => setCell(sticky, columnId, node), tableRole: tableRole, resizerRoleDescription: resizerRoleDescription, resizerTooltipText: resizerTooltipText, isExpandable: colIndex === 0 && isExpandable, hasDynamicContent: hidden && !resizableColumns && column.hasDynamicContent, isLast: colIndex === columnDefinitions.length - 1 }));
|
|
@@ -99,7 +95,7 @@ const Thead = React.forwardRef(({ selectionType, getSelectAllProps, columnDefini
|
|
|
99
95
|
group: groupDefinition,
|
|
100
96
|
rowspan: col.rowSpan,
|
|
101
97
|
resizableColumns,
|
|
102
|
-
onResizeFinish: () => onResizeFinish(
|
|
98
|
+
onResizeFinish: () => onResizeFinish(columnWidths),
|
|
103
99
|
columnGroupId: col.parentGroupIds.length > 0 ? col.parentGroupIds[col.parentGroupIds.length - 1] : undefined,
|
|
104
100
|
};
|
|
105
101
|
const splitFirst = getGroupSplit({
|
|
@@ -164,7 +160,7 @@ const Thead = React.forwardRef(({ selectionType, getSelectAllProps, columnDefini
|
|
|
164
160
|
const column = col.columnDefinition;
|
|
165
161
|
const columnId = col.id;
|
|
166
162
|
const colIndex = col.colIndex;
|
|
167
|
-
return (React.createElement(TableHeaderCell, { ...commonCellProps, key: columnId, tabIndex: sticky ? -1 : 0, focusedComponent: focusedComponent, column: column, activeSortingColumn: sortingColumn, sortingDescending: sortingDescending, sortingDisabled: sortingDisabled, wrapLines: wrapLines, colIndex: selectionType ? colIndex + 1 : colIndex, columnId: columnId, updateColumn: updateColumn, onResizeFinish: () => onResizeFinish(
|
|
163
|
+
return (React.createElement(TableHeaderCell, { ...commonCellProps, key: columnId, tabIndex: sticky ? -1 : 0, focusedComponent: focusedComponent, column: column, activeSortingColumn: sortingColumn, sortingDescending: sortingDescending, sortingDisabled: sortingDisabled, wrapLines: wrapLines, colIndex: selectionType ? colIndex + 1 : colIndex, columnId: columnId, updateColumn: updateColumn, onResizeFinish: () => onResizeFinish(columnWidths), resizableColumns: resizableColumns, resizableStyle: getColumnStyles(sticky, columnId), onClick: detail => {
|
|
168
164
|
setLastUserAction('sorting');
|
|
169
165
|
fireNonCancelableEvent(onSortingChange, detail);
|
|
170
166
|
}, isEditable: !!column.editConfig, cellRef: node => {
|
package/table/thead.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thead.js","sourceRoot":"","sources":["../../../src/table/thead.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,0BAA0B,EAAa,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAoCrC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CACE,E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CACI,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { findUpUntil } from '@cloudscape-design/component-toolkit/dom';\n\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { NonCancelableEventHandler } from '../types/events';\nimport { getGroupColumnIds, getGroupSplit } from './column-groups/split-utils';\nimport { ColumnGroupsLayout } from './column-groups/utils';\nimport { TableHeaderCell } from './header-cell';\nimport { TableGroupHeaderCell } from './header-cell/group-header-cell';\nimport { TableProps } from './interfaces';\nimport { InternalSelectionType } from './internal-interfaces';\nimport { focusMarkers, ItemSelectionProps } from './selection';\nimport { TableHeaderSelectionCell } from './selection/selection-cell';\nimport { StickyColumnsModel } from './sticky-columns';\nimport { getTableHeaderRowRoleProps, TableRole } from './table-role';\nimport { DEFAULT_COLUMN_WIDTH, useColumnWidths } from './use-column-widths';\nimport { getColumnKey } from './utils';\n\nimport styles from './styles.css.js';\n\nexport interface TheadProps {\n selectionType: undefined | InternalSelectionType;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>;\n groupDefinitions?: ReadonlyArray<TableProps.GroupDefinition>;\n columnGroupsLayout?: ColumnGroupsLayout<any>;\n sortingColumn: TableProps.SortingColumn<any> | undefined;\n sortingDescending: boolean | undefined;\n sortingDisabled: boolean | undefined;\n variant: TableProps.Variant;\n tableVariant?: TableProps.Variant;\n wrapLines: boolean | undefined;\n resizableColumns: boolean | undefined;\n getSelectAllProps?: () => ItemSelectionProps;\n onFocusMove: ((sourceElement: HTMLElement, fromIndex: number, direction: -1 | 1) => void) | undefined;\n onResizeFinish: (newWidths: Map<PropertyKey, number>) => void;\n onSortingChange: NonCancelableEventHandler<TableProps.SortingState<any>> | undefined;\n sticky?: boolean;\n hidden?: boolean;\n stuck?: boolean;\n singleSelectionHeaderAriaLabel?: string;\n resizerRoleDescription?: string;\n resizerTooltipText?: string;\n stripedRows?: boolean;\n stickyState: StickyColumnsModel;\n stickyColumnsFirst: number;\n stickyColumnsLast: number;\n selectionColumnId: PropertyKey;\n focusedComponent?: null | string;\n onFocusedComponentChange?: (focusId: null | string) => void;\n tableRole: TableRole;\n isExpandable?: boolean;\n setLastUserAction: (name: string) => void;\n}\n\nconst Thead = React.forwardRef(\n (\n {\n selectionType,\n getSelectAllProps,\n columnDefinitions,\n columnGroupsLayout,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n resizableColumns,\n variant,\n tableVariant,\n wrapLines,\n onFocusMove,\n onSortingChange,\n onResizeFinish,\n singleSelectionHeaderAriaLabel,\n stripedRows,\n sticky = false,\n hidden = false,\n stuck = false,\n stickyState,\n stickyColumnsFirst,\n stickyColumnsLast,\n selectionColumnId,\n focusedComponent,\n onFocusedComponentChange,\n tableRole,\n resizerRoleDescription,\n resizerTooltipText,\n isExpandable,\n setLastUserAction,\n }: TheadProps,\n outerRef: React.Ref<HTMLTableRowElement>\n ) => {\n const { getColumnStyles, columnWidths, updateColumn, updateGroup, setCell } = useColumnWidths();\n\n // This guarantees the width reported via `onColumnWidthsChange` matches the final rendered width instead of a stale one.\n // Without this, resetting/remounting a table right after a resize can restore an outdated width.\n const columnWidthsRef = useRef(columnWidths);\n columnWidthsRef.current = columnWidths;\n\n const handleSplitGroupResize = (columnIds: string[], newWidth: number) => {\n const lastColumn = columnIds[columnIds.length - 1];\n if (lastColumn) {\n const currentGroupWidth = columnIds.reduce(\n (sum, id) => sum + (columnWidths.get(id) || DEFAULT_COLUMN_WIDTH),\n 0\n );\n const delta = newWidth - currentGroupWidth;\n const currentColumnWidth = columnWidths.get(lastColumn) || DEFAULT_COLUMN_WIDTH;\n updateColumn(lastColumn, currentColumnWidth + delta);\n }\n };\n\n const commonCellProps = {\n stuck,\n sticky,\n hidden,\n stripedRows,\n tableRole,\n variant,\n tableVariant,\n stickyState,\n wrapLines,\n };\n\n const sharedTrProps = {\n onFocus: (event: React.FocusEvent) => {\n const focusControlElement = findUpUntil(\n event.target as HTMLElement,\n element => !!element.getAttribute('data-focus-id')\n );\n const focusId = focusControlElement?.getAttribute('data-focus-id') ?? null;\n onFocusedComponentChange?.(focusId);\n },\n onBlur: () => onFocusedComponentChange?.(null),\n };\n\n // No grouping - render single row\n if (!columnGroupsLayout || columnGroupsLayout.rows.length <= 1) {\n return (\n <thead className={clsx(!hidden && styles['thead-active'])}>\n <tr\n {...focusMarkers.all}\n ref={outerRef}\n aria-rowindex={1}\n {...getTableHeaderRowRoleProps({ tableRole })}\n {...sharedTrProps}\n >\n {selectionType ? (\n <TableHeaderSelectionCell\n {...commonCellProps}\n focusedComponent={focusedComponent}\n columnId={selectionColumnId}\n cellRef={node => setCell(sticky, selectionColumnId, node)}\n getSelectAllProps={getSelectAllProps}\n onFocusMove={onFocusMove}\n singleSelectionHeaderAriaLabel={singleSelectionHeaderAriaLabel}\n />\n ) : null}\n\n {columnDefinitions.map((column, colIndex) => {\n const columnId = getColumnKey(column, colIndex);\n return (\n <TableHeaderCell\n {...commonCellProps}\n key={columnId}\n tabIndex={sticky ? -1 : 0}\n focusedComponent={focusedComponent}\n column={column}\n activeSortingColumn={sortingColumn}\n sortingDescending={sortingDescending}\n sortingDisabled={sortingDisabled}\n wrapLines={wrapLines}\n colIndex={selectionType ? colIndex + 1 : colIndex}\n columnId={columnId}\n updateColumn={updateColumn}\n onResizeFinish={() => onResizeFinish(columnWidthsRef.current)}\n resizableColumns={resizableColumns}\n resizableStyle={getColumnStyles(sticky, columnId)}\n onClick={detail => {\n setLastUserAction('sorting');\n fireNonCancelableEvent(onSortingChange, detail);\n }}\n isEditable={!!column.editConfig}\n cellRef={node => setCell(sticky, columnId, node)}\n tableRole={tableRole}\n resizerRoleDescription={resizerRoleDescription}\n resizerTooltipText={resizerTooltipText}\n isExpandable={colIndex === 0 && isExpandable}\n hasDynamicContent={hidden && !resizableColumns && column.hasDynamicContent}\n isLast={colIndex === columnDefinitions.length - 1}\n />\n );\n })}\n </tr>\n </thead>\n );\n }\n\n // Grouped columns\n const totalColumns = columnDefinitions.length;\n return (\n <thead className={clsx(!hidden && styles['thead-active'])}>\n {columnGroupsLayout.rows.map((row, rowIndex) => (\n <tr\n key={rowIndex}\n {...(rowIndex === 0 ? focusMarkers.all : {})}\n ref={rowIndex === 0 ? outerRef : undefined}\n aria-rowindex={rowIndex + 1}\n data-group-level={rowIndex}\n {...getTableHeaderRowRoleProps({ tableRole, rowIndex })}\n {...sharedTrProps}\n >\n {/* Selection column — render once in the first row with rowSpan covering all header rows */}\n {selectionType && rowIndex === 0 ? (\n <TableHeaderSelectionCell\n {...commonCellProps}\n focusedComponent={focusedComponent}\n columnId={selectionColumnId}\n cellRef={node => setCell(sticky, selectionColumnId, node)}\n getSelectAllProps={getSelectAllProps}\n onFocusMove={onFocusMove}\n singleSelectionHeaderAriaLabel={singleSelectionHeaderAriaLabel}\n rowSpan={columnGroupsLayout.rows.length}\n isGrouped={true}\n />\n ) : null}\n\n {row.columns.map((col, colIndexInRow) => {\n // A cell is the last child of its parent group when the next rendered cell\n // in the same row belongs to a different top-level parent, i.e. they don't\n // share the same immediate parent group.\n const nextCol = row.columns[colIndexInRow + 1];\n const thisParent = col.parentGroupIds[col.parentGroupIds.length - 1] ?? null;\n const nextParent = nextCol ? (nextCol.parentGroupIds[nextCol.parentGroupIds.length - 1] ?? null) : null;\n // A column is also considered last-child-of-group when the sticky boundary\n // bisects its parent group just after this column — visually it's the rightmost\n // column of the sticky half, so its resizer should span full-height like a\n // normal last-child-of-group.\n const isColumnAtStickyFirstBoundary =\n !col.isGroup &&\n thisParent !== null &&\n stickyColumnsFirst > 0 &&\n col.colIndex === stickyColumnsFirst - 1;\n const isColumnAtStickyLastBoundary =\n !col.isGroup &&\n thisParent !== null &&\n stickyColumnsLast > 0 &&\n col.colIndex === columnDefinitions.length - stickyColumnsLast - 1;\n const isLastChildOfGroup =\n (thisParent !== null && thisParent !== nextParent) ||\n isColumnAtStickyFirstBoundary ||\n isColumnAtStickyLastBoundary;\n\n if (col.isGroup) {\n // Group header cell\n const groupDefinition = col.groupDefinition!;\n const childIds = getGroupColumnIds(columnGroupsLayout!, col.id);\n const sharedGroupCellProps = {\n ...commonCellProps,\n tabIndex: sticky ? -1 : 0,\n focusedComponent,\n group: groupDefinition,\n rowspan: col.rowSpan,\n resizableColumns,\n onResizeFinish: () => onResizeFinish(columnWidthsRef.current),\n columnGroupId:\n col.parentGroupIds.length > 0 ? col.parentGroupIds[col.parentGroupIds.length - 1] : undefined,\n };\n const splitFirst = getGroupSplit({\n col,\n stickyCount: stickyColumnsFirst,\n side: 'first',\n totalColumns,\n });\n const splitLast = getGroupSplit({\n col,\n stickyCount: stickyColumnsLast,\n side: 'last',\n totalColumns,\n });\n const split = splitFirst.stickyColspan > 0 ? splitFirst : splitLast;\n const isSplit = split.stickyColspan > 0;\n\n if (isSplit) {\n // Group is bisected by the sticky boundary — render two <th> elements.\n // Both halves get resizers. Each resizes its own rightmost column child.\n const isSplitFirst = splitFirst.stickyColspan > 0;\n\n // Left half is sticky for 'first', non-sticky for 'last'\n const leftColspan = isSplitFirst ? split.stickyColspan : split.staticColspan;\n const leftColIndex = col.colIndex;\n const leftGroupId = isSplitFirst ? col.id : `${col.id}__split`;\n const leftChildIds = childIds.slice(0, leftColspan);\n\n // Right half is non-sticky for 'first', sticky for 'last'\n const rightColspan = isSplitFirst ? split.staticColspan : split.stickyColspan;\n const rightColIndex = col.colIndex + leftColspan;\n const rightGroupId = isSplitFirst ? `${col.id}__split` : col.id;\n const rightChildIds = childIds.slice(leftColspan);\n\n return (\n <React.Fragment key={col.id}>\n {/* Left half */}\n <TableGroupHeaderCell\n {...sharedGroupCellProps}\n colspan={leftColspan}\n colIndex={selectionType ? leftColIndex + 1 : leftColIndex}\n groupId={leftGroupId}\n resizableStyle={undefined}\n updateGroupWidth={(_, newWidth) => {\n handleSplitGroupResize(leftChildIds, newWidth);\n }}\n childColumnIds={leftChildIds}\n firstChildColumnId={leftChildIds[0]}\n lastChildColumnId={leftChildIds[leftChildIds.length - 1]}\n cellRef={isSplitFirst ? node => setCell(sticky, col.id, node) : () => {}}\n isLast={false}\n stickyColumnId={isSplitFirst ? childIds[0] : undefined}\n stickyBoundaryColumnId={isSplitFirst ? leftChildIds[leftChildIds.length - 1] : undefined}\n />\n\n {/* Right half */}\n <TableGroupHeaderCell\n {...sharedGroupCellProps}\n colspan={rightColspan}\n colIndex={selectionType ? rightColIndex + 1 : rightColIndex}\n groupId={rightGroupId}\n resizableStyle={getColumnStyles(sticky, col.id)}\n updateGroupWidth={(_, newWidth) => {\n handleSplitGroupResize(rightChildIds, newWidth);\n }}\n childColumnIds={rightChildIds}\n firstChildColumnId={rightChildIds[0]}\n lastChildColumnId={rightChildIds[rightChildIds.length - 1]}\n cellRef={!isSplitFirst ? node => setCell(sticky, col.id, node) : () => {}}\n resizerRoleDescription={resizerRoleDescription}\n resizerTooltipText={resizerTooltipText}\n isLast={rightColIndex + rightColspan === totalColumns}\n stickyColumnId={!isSplitFirst ? childIds[childIds.length - 1] : undefined}\n stickyBoundaryColumnId={!isSplitFirst ? rightChildIds[0] : undefined}\n />\n </React.Fragment>\n );\n }\n\n // Determine if the entire group is sticky (all children on one side)\n const isFullyStickyFirst =\n stickyColumnsFirst > 0 && col.colIndex + col.colSpan - 1 < stickyColumnsFirst;\n const isFullyStickyLast =\n stickyColumnsLast > 0 && col.colIndex >= columnDefinitions.length - stickyColumnsLast;\n const fullyStickyColumnId = isFullyStickyFirst\n ? childIds[0]\n : isFullyStickyLast\n ? childIds[childIds.length - 1]\n : undefined;\n\n // When the group's last child is the sticky-first boundary, the group\n // needs the shadow from that child (but offset from the first child).\n const isAtStickyFirstBoundary =\n isFullyStickyFirst && col.colIndex + col.colSpan - 1 === stickyColumnsFirst - 1;\n const isAtStickyLastBoundary =\n isFullyStickyLast && col.colIndex === columnDefinitions.length - stickyColumnsLast;\n const fullyStickyBoundaryColumnId = isAtStickyFirstBoundary\n ? childIds[childIds.length - 1]\n : isAtStickyLastBoundary\n ? childIds[0]\n : undefined;\n\n return (\n <TableGroupHeaderCell\n {...sharedGroupCellProps}\n key={col.id}\n colspan={col.colSpan}\n colIndex={selectionType ? col.colIndex + 1 : col.colIndex}\n groupId={col.id}\n resizableStyle={getColumnStyles(sticky, col.id)}\n updateGroupWidth={(groupId, newWidth) => {\n updateGroup(groupId, newWidth);\n }}\n childColumnIds={childIds}\n firstChildColumnId={childIds[0]}\n lastChildColumnId={childIds[childIds.length - 1]}\n cellRef={node => setCell(sticky, col.id, node)}\n resizerRoleDescription={resizerRoleDescription}\n resizerTooltipText={resizerTooltipText}\n isLast={col.colIndex + col.colSpan === totalColumns}\n stickyColumnId={fullyStickyColumnId}\n stickyBoundaryColumnId={fullyStickyBoundaryColumnId}\n />\n );\n } else {\n // Regular column cell\n const column = col.columnDefinition!;\n const columnId = col.id;\n const colIndex = col.colIndex;\n\n return (\n <TableHeaderCell\n {...commonCellProps}\n key={columnId}\n tabIndex={sticky ? -1 : 0}\n focusedComponent={focusedComponent}\n column={column}\n activeSortingColumn={sortingColumn}\n sortingDescending={sortingDescending}\n sortingDisabled={sortingDisabled}\n wrapLines={wrapLines}\n colIndex={selectionType ? colIndex + 1 : colIndex}\n columnId={columnId}\n updateColumn={updateColumn}\n onResizeFinish={() => onResizeFinish(columnWidthsRef.current)}\n resizableColumns={resizableColumns}\n resizableStyle={getColumnStyles(sticky, columnId)}\n onClick={detail => {\n setLastUserAction('sorting');\n fireNonCancelableEvent(onSortingChange, detail);\n }}\n isEditable={!!column.editConfig}\n cellRef={node => {\n setCell(sticky, columnId, node);\n }}\n tableRole={tableRole}\n resizerRoleDescription={resizerRoleDescription}\n resizerTooltipText={resizerTooltipText}\n isExpandable={colIndex === 0 && isExpandable}\n hasDynamicContent={hidden && !resizableColumns && column.hasDynamicContent}\n colSpan={col.colSpan}\n rowSpan={col.rowSpan}\n isLastChildOfGroup={isLastChildOfGroup}\n isLast={col.colIndex + col.colSpan === totalColumns}\n columnGroupId={\n col.parentGroupIds.length > 0 ? col.parentGroupIds[col.parentGroupIds.length - 1] : undefined\n }\n />\n );\n }\n })}\n </tr>\n ))}\n </thead>\n );\n }\n);\n\nexport default Thead;\n"]}
|
|
1
|
+
{"version":3,"file":"thead.js","sourceRoot":"","sources":["../../../src/table/thead.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,0BAA0B,EAAa,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAoCrC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CACE,EACE,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,EACf,cAAc,EACd,8BAA8B,EAC9B,WAAW,EACX,MAAM,GAAG,KAAK,EACd,MAAM,GAAG,KA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,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;oBAClD,CAAC,EACD,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,EAC/B,OAAO,EAAE,IAAI,CAAC,EAAE;wBACd,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;oBAClC,CAAC,EACD,SAAS,EAAE,SAAS,EACpB,sBAAsB,EAAE,sBAAsB,EAC9C,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,QAAQ,KAAK,CAAC,IAAI,YAAY,EAC5C,iBAAiB,EAAE,MAAM,IAAI,CAAC,gBAAgB,IAAI,MAAM,CAAC,iBAAiB,EAC1E,OAAO,EAAE,GAAG,CAAC,OAAO,EACpB,OAAO,EAAE,GAAG,CAAC,OAAO,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,MAAM,EAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,OAAO,KAAK,YAAY,EACnD,aAAa,EACX,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAE/F,CACH,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CACC,CACN,CAAC,CACI,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { findUpUntil } from '@cloudscape-design/component-toolkit/dom';\n\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { NonCancelableEventHandler } from '../types/events';\nimport { getGroupColumnIds, getGroupSplit } from './column-groups/split-utils';\nimport { ColumnGroupsLayout } from './column-groups/utils';\nimport { TableHeaderCell } from './header-cell';\nimport { TableGroupHeaderCell } from './header-cell/group-header-cell';\nimport { TableProps } from './interfaces';\nimport { InternalSelectionType } from './internal-interfaces';\nimport { focusMarkers, ItemSelectionProps } from './selection';\nimport { TableHeaderSelectionCell } from './selection/selection-cell';\nimport { StickyColumnsModel } from './sticky-columns';\nimport { getTableHeaderRowRoleProps, TableRole } from './table-role';\nimport { DEFAULT_COLUMN_WIDTH, useColumnWidths } from './use-column-widths';\nimport { getColumnKey } from './utils';\n\nimport styles from './styles.css.js';\n\nexport interface TheadProps {\n selectionType: undefined | InternalSelectionType;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>;\n groupDefinitions?: ReadonlyArray<TableProps.GroupDefinition>;\n columnGroupsLayout?: ColumnGroupsLayout<any>;\n sortingColumn: TableProps.SortingColumn<any> | undefined;\n sortingDescending: boolean | undefined;\n sortingDisabled: boolean | undefined;\n variant: TableProps.Variant;\n tableVariant?: TableProps.Variant;\n wrapLines: boolean | undefined;\n resizableColumns: boolean | undefined;\n getSelectAllProps?: () => ItemSelectionProps;\n onFocusMove: ((sourceElement: HTMLElement, fromIndex: number, direction: -1 | 1) => void) | undefined;\n onResizeFinish: (newWidths: Map<PropertyKey, number>) => void;\n onSortingChange: NonCancelableEventHandler<TableProps.SortingState<any>> | undefined;\n sticky?: boolean;\n hidden?: boolean;\n stuck?: boolean;\n singleSelectionHeaderAriaLabel?: string;\n resizerRoleDescription?: string;\n resizerTooltipText?: string;\n stripedRows?: boolean;\n stickyState: StickyColumnsModel;\n stickyColumnsFirst: number;\n stickyColumnsLast: number;\n selectionColumnId: PropertyKey;\n focusedComponent?: null | string;\n onFocusedComponentChange?: (focusId: null | string) => void;\n tableRole: TableRole;\n isExpandable?: boolean;\n setLastUserAction: (name: string) => void;\n}\n\nconst Thead = React.forwardRef(\n (\n {\n selectionType,\n getSelectAllProps,\n columnDefinitions,\n columnGroupsLayout,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n resizableColumns,\n variant,\n tableVariant,\n wrapLines,\n onFocusMove,\n onSortingChange,\n onResizeFinish,\n singleSelectionHeaderAriaLabel,\n stripedRows,\n sticky = false,\n hidden = false,\n stuck = false,\n stickyState,\n stickyColumnsFirst,\n stickyColumnsLast,\n selectionColumnId,\n focusedComponent,\n onFocusedComponentChange,\n tableRole,\n resizerRoleDescription,\n resizerTooltipText,\n isExpandable,\n setLastUserAction,\n }: TheadProps,\n outerRef: React.Ref<HTMLTableRowElement>\n ) => {\n const { getColumnStyles, columnWidths, updateColumn, updateGroup, setCell } = useColumnWidths();\n\n const handleSplitGroupResize = (columnIds: string[], newWidth: number) => {\n const lastColumn = columnIds[columnIds.length - 1];\n if (lastColumn) {\n const currentGroupWidth = columnIds.reduce(\n (sum, id) => sum + (columnWidths.get(id) || DEFAULT_COLUMN_WIDTH),\n 0\n );\n const delta = newWidth - currentGroupWidth;\n const currentColumnWidth = columnWidths.get(lastColumn) || DEFAULT_COLUMN_WIDTH;\n updateColumn(lastColumn, currentColumnWidth + delta);\n }\n };\n\n const commonCellProps = {\n stuck,\n sticky,\n hidden,\n stripedRows,\n tableRole,\n variant,\n tableVariant,\n stickyState,\n wrapLines,\n };\n\n const sharedTrProps = {\n onFocus: (event: React.FocusEvent) => {\n const focusControlElement = findUpUntil(\n event.target as HTMLElement,\n element => !!element.getAttribute('data-focus-id')\n );\n const focusId = focusControlElement?.getAttribute('data-focus-id') ?? null;\n onFocusedComponentChange?.(focusId);\n },\n onBlur: () => onFocusedComponentChange?.(null),\n };\n\n // No grouping - render single row\n if (!columnGroupsLayout || columnGroupsLayout.rows.length <= 1) {\n return (\n <thead className={clsx(!hidden && styles['thead-active'])}>\n <tr\n {...focusMarkers.all}\n ref={outerRef}\n aria-rowindex={1}\n {...getTableHeaderRowRoleProps({ tableRole })}\n {...sharedTrProps}\n >\n {selectionType ? (\n <TableHeaderSelectionCell\n {...commonCellProps}\n focusedComponent={focusedComponent}\n columnId={selectionColumnId}\n cellRef={node => setCell(sticky, selectionColumnId, node)}\n getSelectAllProps={getSelectAllProps}\n onFocusMove={onFocusMove}\n singleSelectionHeaderAriaLabel={singleSelectionHeaderAriaLabel}\n />\n ) : null}\n\n {columnDefinitions.map((column, colIndex) => {\n const columnId = getColumnKey(column, colIndex);\n return (\n <TableHeaderCell\n {...commonCellProps}\n key={columnId}\n tabIndex={sticky ? -1 : 0}\n focusedComponent={focusedComponent}\n column={column}\n activeSortingColumn={sortingColumn}\n sortingDescending={sortingDescending}\n sortingDisabled={sortingDisabled}\n wrapLines={wrapLines}\n colIndex={selectionType ? colIndex + 1 : colIndex}\n columnId={columnId}\n updateColumn={updateColumn}\n onResizeFinish={() => onResizeFinish(columnWidths)}\n resizableColumns={resizableColumns}\n resizableStyle={getColumnStyles(sticky, columnId)}\n onClick={detail => {\n setLastUserAction('sorting');\n fireNonCancelableEvent(onSortingChange, detail);\n }}\n isEditable={!!column.editConfig}\n cellRef={node => setCell(sticky, columnId, node)}\n tableRole={tableRole}\n resizerRoleDescription={resizerRoleDescription}\n resizerTooltipText={resizerTooltipText}\n isExpandable={colIndex === 0 && isExpandable}\n hasDynamicContent={hidden && !resizableColumns && column.hasDynamicContent}\n isLast={colIndex === columnDefinitions.length - 1}\n />\n );\n })}\n </tr>\n </thead>\n );\n }\n\n // Grouped columns\n const totalColumns = columnDefinitions.length;\n return (\n <thead className={clsx(!hidden && styles['thead-active'])}>\n {columnGroupsLayout.rows.map((row, rowIndex) => (\n <tr\n key={rowIndex}\n {...(rowIndex === 0 ? focusMarkers.all : {})}\n ref={rowIndex === 0 ? outerRef : undefined}\n aria-rowindex={rowIndex + 1}\n data-group-level={rowIndex}\n {...getTableHeaderRowRoleProps({ tableRole, rowIndex })}\n {...sharedTrProps}\n >\n {/* Selection column — render once in the first row with rowSpan covering all header rows */}\n {selectionType && rowIndex === 0 ? (\n <TableHeaderSelectionCell\n {...commonCellProps}\n focusedComponent={focusedComponent}\n columnId={selectionColumnId}\n cellRef={node => setCell(sticky, selectionColumnId, node)}\n getSelectAllProps={getSelectAllProps}\n onFocusMove={onFocusMove}\n singleSelectionHeaderAriaLabel={singleSelectionHeaderAriaLabel}\n rowSpan={columnGroupsLayout.rows.length}\n isGrouped={true}\n />\n ) : null}\n\n {row.columns.map((col, colIndexInRow) => {\n // A cell is the last child of its parent group when the next rendered cell\n // in the same row belongs to a different top-level parent, i.e. they don't\n // share the same immediate parent group.\n const nextCol = row.columns[colIndexInRow + 1];\n const thisParent = col.parentGroupIds[col.parentGroupIds.length - 1] ?? null;\n const nextParent = nextCol ? (nextCol.parentGroupIds[nextCol.parentGroupIds.length - 1] ?? null) : null;\n // A column is also considered last-child-of-group when the sticky boundary\n // bisects its parent group just after this column — visually it's the rightmost\n // column of the sticky half, so its resizer should span full-height like a\n // normal last-child-of-group.\n const isColumnAtStickyFirstBoundary =\n !col.isGroup &&\n thisParent !== null &&\n stickyColumnsFirst > 0 &&\n col.colIndex === stickyColumnsFirst - 1;\n const isColumnAtStickyLastBoundary =\n !col.isGroup &&\n thisParent !== null &&\n stickyColumnsLast > 0 &&\n col.colIndex === columnDefinitions.length - stickyColumnsLast - 1;\n const isLastChildOfGroup =\n (thisParent !== null && thisParent !== nextParent) ||\n isColumnAtStickyFirstBoundary ||\n isColumnAtStickyLastBoundary;\n\n if (col.isGroup) {\n // Group header cell\n const groupDefinition = col.groupDefinition!;\n const childIds = getGroupColumnIds(columnGroupsLayout!, col.id);\n const sharedGroupCellProps = {\n ...commonCellProps,\n tabIndex: sticky ? -1 : 0,\n focusedComponent,\n group: groupDefinition,\n rowspan: col.rowSpan,\n resizableColumns,\n onResizeFinish: () => onResizeFinish(columnWidths),\n columnGroupId:\n col.parentGroupIds.length > 0 ? col.parentGroupIds[col.parentGroupIds.length - 1] : undefined,\n };\n const splitFirst = getGroupSplit({\n col,\n stickyCount: stickyColumnsFirst,\n side: 'first',\n totalColumns,\n });\n const splitLast = getGroupSplit({\n col,\n stickyCount: stickyColumnsLast,\n side: 'last',\n totalColumns,\n });\n const split = splitFirst.stickyColspan > 0 ? splitFirst : splitLast;\n const isSplit = split.stickyColspan > 0;\n\n if (isSplit) {\n // Group is bisected by the sticky boundary — render two <th> elements.\n // Both halves get resizers. Each resizes its own rightmost column child.\n const isSplitFirst = splitFirst.stickyColspan > 0;\n\n // Left half is sticky for 'first', non-sticky for 'last'\n const leftColspan = isSplitFirst ? split.stickyColspan : split.staticColspan;\n const leftColIndex = col.colIndex;\n const leftGroupId = isSplitFirst ? col.id : `${col.id}__split`;\n const leftChildIds = childIds.slice(0, leftColspan);\n\n // Right half is non-sticky for 'first', sticky for 'last'\n const rightColspan = isSplitFirst ? split.staticColspan : split.stickyColspan;\n const rightColIndex = col.colIndex + leftColspan;\n const rightGroupId = isSplitFirst ? `${col.id}__split` : col.id;\n const rightChildIds = childIds.slice(leftColspan);\n\n return (\n <React.Fragment key={col.id}>\n {/* Left half */}\n <TableGroupHeaderCell\n {...sharedGroupCellProps}\n colspan={leftColspan}\n colIndex={selectionType ? leftColIndex + 1 : leftColIndex}\n groupId={leftGroupId}\n resizableStyle={undefined}\n updateGroupWidth={(_, newWidth) => {\n handleSplitGroupResize(leftChildIds, newWidth);\n }}\n childColumnIds={leftChildIds}\n firstChildColumnId={leftChildIds[0]}\n lastChildColumnId={leftChildIds[leftChildIds.length - 1]}\n cellRef={isSplitFirst ? node => setCell(sticky, col.id, node) : () => {}}\n isLast={false}\n stickyColumnId={isSplitFirst ? childIds[0] : undefined}\n stickyBoundaryColumnId={isSplitFirst ? leftChildIds[leftChildIds.length - 1] : undefined}\n />\n\n {/* Right half */}\n <TableGroupHeaderCell\n {...sharedGroupCellProps}\n colspan={rightColspan}\n colIndex={selectionType ? rightColIndex + 1 : rightColIndex}\n groupId={rightGroupId}\n resizableStyle={getColumnStyles(sticky, col.id)}\n updateGroupWidth={(_, newWidth) => {\n handleSplitGroupResize(rightChildIds, newWidth);\n }}\n childColumnIds={rightChildIds}\n firstChildColumnId={rightChildIds[0]}\n lastChildColumnId={rightChildIds[rightChildIds.length - 1]}\n cellRef={!isSplitFirst ? node => setCell(sticky, col.id, node) : () => {}}\n resizerRoleDescription={resizerRoleDescription}\n resizerTooltipText={resizerTooltipText}\n isLast={rightColIndex + rightColspan === totalColumns}\n stickyColumnId={!isSplitFirst ? childIds[childIds.length - 1] : undefined}\n stickyBoundaryColumnId={!isSplitFirst ? rightChildIds[0] : undefined}\n />\n </React.Fragment>\n );\n }\n\n // Determine if the entire group is sticky (all children on one side)\n const isFullyStickyFirst =\n stickyColumnsFirst > 0 && col.colIndex + col.colSpan - 1 < stickyColumnsFirst;\n const isFullyStickyLast =\n stickyColumnsLast > 0 && col.colIndex >= columnDefinitions.length - stickyColumnsLast;\n const fullyStickyColumnId = isFullyStickyFirst\n ? childIds[0]\n : isFullyStickyLast\n ? childIds[childIds.length - 1]\n : undefined;\n\n // When the group's last child is the sticky-first boundary, the group\n // needs the shadow from that child (but offset from the first child).\n const isAtStickyFirstBoundary =\n isFullyStickyFirst && col.colIndex + col.colSpan - 1 === stickyColumnsFirst - 1;\n const isAtStickyLastBoundary =\n isFullyStickyLast && col.colIndex === columnDefinitions.length - stickyColumnsLast;\n const fullyStickyBoundaryColumnId = isAtStickyFirstBoundary\n ? childIds[childIds.length - 1]\n : isAtStickyLastBoundary\n ? childIds[0]\n : undefined;\n\n return (\n <TableGroupHeaderCell\n {...sharedGroupCellProps}\n key={col.id}\n colspan={col.colSpan}\n colIndex={selectionType ? col.colIndex + 1 : col.colIndex}\n groupId={col.id}\n resizableStyle={getColumnStyles(sticky, col.id)}\n updateGroupWidth={(groupId, newWidth) => {\n updateGroup(groupId, newWidth);\n }}\n childColumnIds={childIds}\n firstChildColumnId={childIds[0]}\n lastChildColumnId={childIds[childIds.length - 1]}\n cellRef={node => setCell(sticky, col.id, node)}\n resizerRoleDescription={resizerRoleDescription}\n resizerTooltipText={resizerTooltipText}\n isLast={col.colIndex + col.colSpan === totalColumns}\n stickyColumnId={fullyStickyColumnId}\n stickyBoundaryColumnId={fullyStickyBoundaryColumnId}\n />\n );\n } else {\n // Regular column cell\n const column = col.columnDefinition!;\n const columnId = col.id;\n const colIndex = col.colIndex;\n\n return (\n <TableHeaderCell\n {...commonCellProps}\n key={columnId}\n tabIndex={sticky ? -1 : 0}\n focusedComponent={focusedComponent}\n column={column}\n activeSortingColumn={sortingColumn}\n sortingDescending={sortingDescending}\n sortingDisabled={sortingDisabled}\n wrapLines={wrapLines}\n colIndex={selectionType ? colIndex + 1 : colIndex}\n columnId={columnId}\n updateColumn={updateColumn}\n onResizeFinish={() => onResizeFinish(columnWidths)}\n resizableColumns={resizableColumns}\n resizableStyle={getColumnStyles(sticky, columnId)}\n onClick={detail => {\n setLastUserAction('sorting');\n fireNonCancelableEvent(onSortingChange, detail);\n }}\n isEditable={!!column.editConfig}\n cellRef={node => {\n setCell(sticky, columnId, node);\n }}\n tableRole={tableRole}\n resizerRoleDescription={resizerRoleDescription}\n resizerTooltipText={resizerTooltipText}\n isExpandable={colIndex === 0 && isExpandable}\n hasDynamicContent={hidden && !resizableColumns && column.hasDynamicContent}\n colSpan={col.colSpan}\n rowSpan={col.rowSpan}\n isLastChildOfGroup={isLastChildOfGroup}\n isLast={col.colIndex + col.colSpan === totalColumns}\n columnGroupId={\n col.parentGroupIds.length > 0 ? col.parentGroupIds[col.parentGroupIds.length - 1] : undefined\n }\n />\n );\n }\n })}\n </tr>\n ))}\n </thead>\n );\n }\n);\n\nexport default Thead;\n"]}
|