@cloudscape-design/components 3.0.274 → 3.0.276

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.
Files changed (41) hide show
  1. package/collection-preferences/content-display/content-display-option.d.ts +13 -0
  2. package/collection-preferences/content-display/content-display-option.d.ts.map +1 -0
  3. package/collection-preferences/content-display/content-display-option.js +23 -0
  4. package/collection-preferences/content-display/content-display-option.js.map +1 -0
  5. package/collection-preferences/content-display/{sortable-item.d.ts → draggable-option.d.ts} +2 -2
  6. package/collection-preferences/content-display/draggable-option.d.ts.map +1 -0
  7. package/collection-preferences/content-display/draggable-option.js +27 -0
  8. package/collection-preferences/content-display/draggable-option.js.map +1 -0
  9. package/collection-preferences/content-display/index.d.ts.map +1 -1
  10. package/collection-preferences/content-display/index.js +10 -3
  11. package/collection-preferences/content-display/index.js.map +1 -1
  12. package/collection-preferences/content-display/styles.css.js +11 -15
  13. package/collection-preferences/content-display/styles.scoped.css +80 -62
  14. package/collection-preferences/content-display/styles.selectors.js +11 -15
  15. package/collection-preferences/styles.css.js +32 -36
  16. package/collection-preferences/styles.scoped.css +102 -84
  17. package/collection-preferences/styles.selectors.js +32 -36
  18. package/internal/components/options-list/index.d.ts.map +1 -1
  19. package/internal/components/options-list/index.js +4 -3
  20. package/internal/components/options-list/index.js.map +1 -1
  21. package/internal/environment.js +1 -1
  22. package/internal/hooks/use-scroll-sync/index.d.ts +1 -1
  23. package/internal/hooks/use-scroll-sync/index.d.ts.map +1 -1
  24. package/internal/hooks/use-scroll-sync/index.js +3 -2
  25. package/internal/hooks/use-scroll-sync/index.js.map +1 -1
  26. package/internal/manifest.json +1 -1
  27. package/package.json +1 -1
  28. package/table/internal.d.ts.map +1 -1
  29. package/table/internal.js +1 -1
  30. package/table/internal.js.map +1 -1
  31. package/table/use-sticky-scrollbar.d.ts.map +1 -1
  32. package/table/use-sticky-scrollbar.js +8 -3
  33. package/table/use-sticky-scrollbar.js.map +1 -1
  34. package/test-utils/dom/collection-preferences/content-display-preference.js +2 -2
  35. package/test-utils/dom/collection-preferences/content-display-preference.js.map +1 -1
  36. package/test-utils/selectors/collection-preferences/content-display-preference.js +2 -2
  37. package/test-utils/selectors/collection-preferences/content-display-preference.js.map +1 -1
  38. package/test-utils/tsconfig.tsbuildinfo +1 -1
  39. package/collection-preferences/content-display/sortable-item.d.ts.map +0 -1
  40. package/collection-preferences/content-display/sortable-item.js +0 -52
  41. package/collection-preferences/content-display/sortable-item.js.map +0 -1
@@ -182,14 +182,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
182
182
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
183
183
  SPDX-License-Identifier: Apache-2.0
184
184
  */
185
- .awsui_visible-content_tc96w_1m6re_185:not(#\9),
186
- .awsui_visible-content-toggle_tc96w_1m6re_186:not(#\9),
187
- .awsui_visible-content-groups_tc96w_1m6re_187:not(#\9),
188
- .awsui_visible-content-group_tc96w_1m6re_187:not(#\9) {
185
+ .awsui_visible-content_tc96w_rxrhz_185:not(#\9),
186
+ .awsui_visible-content-toggle_tc96w_rxrhz_186:not(#\9),
187
+ .awsui_visible-content-groups_tc96w_rxrhz_187:not(#\9),
188
+ .awsui_visible-content-group_tc96w_rxrhz_187:not(#\9) {
189
189
  /* used in test-utils */
190
190
  }
191
191
 
192
- .awsui_visible-content-title_tc96w_1m6re_192:not(#\9) {
192
+ .awsui_visible-content-title_tc96w_rxrhz_192:not(#\9) {
193
193
  font-size: var(--font-body-m-size-sregvd, 14px);
194
194
  line-height: var(--font-body-m-line-height-i7xxvv, 22px);
195
195
  font-weight: var(--font-display-label-weight-m18hjh, 700);
@@ -198,24 +198,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
198
198
  margin-bottom: var(--space-scaled-l-t03y3z, 20px);
199
199
  }
200
200
 
201
- .awsui_visible-content-group-label_tc96w_1m6re_201:not(#\9) {
201
+ .awsui_visible-content-group-label_tc96w_rxrhz_201:not(#\9) {
202
202
  color: var(--color-text-group-label-w9to2i, #414d5c);
203
203
  padding-bottom: var(--space-xs-rsr2qu, 8px);
204
204
  border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
205
205
  }
206
206
 
207
- .awsui_visible-content-option_tc96w_1m6re_207:not(#\9) {
207
+ .awsui_visible-content-option_tc96w_rxrhz_207:not(#\9) {
208
208
  display: flex;
209
209
  flex-wrap: nowrap;
210
210
  justify-content: space-between;
211
211
  padding: var(--space-xs-rsr2qu, 8px) 0px var(--space-xs-rsr2qu, 8px) var(--space-scaled-l-t03y3z, 20px);
212
212
  border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
213
213
  }
214
- .awsui_visible-content-option_tc96w_1m6re_207:not(#\9):last-child {
214
+ .awsui_visible-content-option_tc96w_rxrhz_207:not(#\9):last-child {
215
215
  border-bottom: none;
216
216
  }
217
217
 
218
- .awsui_visible-content-option-label_tc96w_1m6re_218:not(#\9) {
218
+ .awsui_visible-content-option-label_tc96w_rxrhz_218:not(#\9) {
219
219
  overflow: hidden;
220
220
  text-overflow: ellipsis;
221
221
  padding-right: var(--space-l-4vl6xu, 20px);
@@ -406,81 +406,107 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
406
406
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
407
407
  SPDX-License-Identifier: Apache-2.0
408
408
  */
409
- .awsui_sortable-item-toggle_tc96w_1m6re_409:not(#\9) {
409
+ .awsui_content-display-option-toggle_tc96w_rxrhz_409:not(#\9) {
410
410
  /* used in test-utils */
411
411
  }
412
412
 
413
- .awsui_sortable-item_tc96w_1m6re_409:not(#\9) {
414
- position: relative;
415
- }
416
-
417
- .awsui_sortable-item-placeholder_tc96w_1m6re_417:not(#\9) {
418
- position: absolute;
419
- top: 0;
420
- bottom: 0;
421
- left: 0;
422
- right: 0;
423
- background: var(--color-drag-placeholder-hover-3ohnz1, #d3e7f9);
424
- border-radius: var(--border-radius-item-u2ibpi, 8px);
425
- }
426
-
427
- .awsui_sortable-item-content_tc96w_1m6re_427:not(#\9) {
428
- border-top: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
413
+ .awsui_content-display-option-content_tc96w_rxrhz_413:not(#\9) {
414
+ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
415
+ border-collapse: separate;
416
+ border-spacing: 0;
417
+ caption-side: top;
418
+ cursor: auto;
419
+ direction: ltr;
420
+ empty-cells: show;
421
+ font-family: serif;
422
+ font-size: medium;
423
+ font-style: normal;
424
+ font-variant: normal;
425
+ font-weight: normal;
426
+ font-stretch: normal;
427
+ line-height: normal;
428
+ -webkit-hyphens: none;
429
+ hyphens: none;
430
+ letter-spacing: normal;
431
+ list-style: disc outside none;
432
+ tab-size: 8;
433
+ text-align: left;
434
+ text-align-last: auto;
435
+ text-indent: 0;
436
+ text-shadow: none;
437
+ text-transform: none;
438
+ visibility: visible;
439
+ white-space: normal;
440
+ widows: 2;
441
+ word-spacing: normal;
442
+ box-sizing: border-box;
443
+ font-size: var(--font-body-m-size-sregvd, 14px);
444
+ line-height: var(--font-body-m-line-height-i7xxvv, 22px);
445
+ color: var(--color-text-body-default-ajf1h5, #000716);
446
+ font-weight: 400;
447
+ font-family: var(--font-family-base-qnistn, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
448
+ -webkit-font-smoothing: auto;
449
+ -moz-osx-font-smoothing: auto;
429
450
  display: flex;
430
- flex-wrap: nowrap;
431
- justify-content: space-between;
432
451
  align-items: flex-start;
433
- padding-top: var(--space-xs-rsr2qu, 8px);
434
- padding-bottom: var(--space-xs-rsr2qu, 8px);
435
- padding-right: 0;
436
- }
437
- .awsui_sortable-item-content_tc96w_1m6re_427:not(#\9):not(.awsui_draggable_tc96w_1m6re_437) {
438
- padding-left: var(--space-scaled-l-t03y3z, 20px);
439
- }
440
- .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437:not(#\9) {
441
- padding-left: 0;
442
- padding-right: var(--space-scaled-xs-6859qs, 8px);
452
+ padding: var(--space-xs-rsr2qu, 8px) var(--space-scaled-xs-6859qs, 8px) var(--space-xs-rsr2qu, 8px) 0;
443
453
  background-color: var(--color-background-container-content-i8i4a0, #ffffff);
444
- z-index: 1;
454
+ border-radius: var(--border-radius-item-u2ibpi, 8px);
445
455
  }
446
- .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437.awsui_active_tc96w_1m6re_446:not(#\9) {
456
+
457
+ .awsui_content-display-option_tc96w_rxrhz_409:not(#\9) {
458
+ list-style: none;
447
459
  position: relative;
448
- z-index: 2;
449
- box-shadow: var(--shadow-container-active-l4kuxc, 0px 1px 1px 1px #e9ebed, 0px 6px 36px rgba(0, 7, 22, 0.1019607843));
450
- border-radius: var(--border-radius-item-u2ibpi, 8px);
460
+ border-top: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
451
461
  }
452
- .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437:not(#\9):not(.awsui_active_tc96w_1m6re_446).awsui_sorting_tc96w_1m6re_452 {
462
+ .awsui_content-display-option_tc96w_rxrhz_409:not(#\9):not(.awsui_placeholder_tc96w_rxrhz_436).awsui_sorting_tc96w_rxrhz_436 {
453
463
  transition: transform var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
464
+ z-index: 1;
454
465
  }
455
466
  @media (prefers-reduced-motion: reduce) {
456
- .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437:not(#\9):not(.awsui_active_tc96w_1m6re_446).awsui_sorting_tc96w_1m6re_452 {
467
+ .awsui_content-display-option_tc96w_rxrhz_409:not(#\9):not(.awsui_placeholder_tc96w_rxrhz_436).awsui_sorting_tc96w_rxrhz_436 {
457
468
  animation: none;
458
469
  transition: none;
459
470
  }
460
471
  }
461
- .awsui-motion-disabled .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437:not(#\9):not(.awsui_active_tc96w_1m6re_446).awsui_sorting_tc96w_1m6re_452, .awsui-mode-entering .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437:not(#\9):not(.awsui_active_tc96w_1m6re_446).awsui_sorting_tc96w_1m6re_452 {
472
+ .awsui-motion-disabled .awsui_content-display-option_tc96w_rxrhz_409:not(#\9):not(.awsui_placeholder_tc96w_rxrhz_436).awsui_sorting_tc96w_rxrhz_436, .awsui-mode-entering .awsui_content-display-option_tc96w_rxrhz_409:not(#\9):not(.awsui_placeholder_tc96w_rxrhz_436).awsui_sorting_tc96w_rxrhz_436 {
462
473
  animation: none;
463
474
  transition: none;
464
475
  }
465
- body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437.awsui_active_tc96w_1m6re_446:not(#\9) {
466
- transition: transform var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
476
+ .awsui_content-display-option_tc96w_rxrhz_409.awsui_placeholder_tc96w_rxrhz_436 > .awsui_content-display-option-content_tc96w_rxrhz_413:not(#\9) {
467
477
  position: relative;
468
478
  }
469
- @media (prefers-reduced-motion: reduce) {
470
- body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437.awsui_active_tc96w_1m6re_446:not(#\9) {
471
- animation: none;
472
- transition: none;
473
- }
479
+ .awsui_content-display-option_tc96w_rxrhz_409.awsui_placeholder_tc96w_rxrhz_436 > .awsui_content-display-option-content_tc96w_rxrhz_413:not(#\9):after {
480
+ content: " ";
481
+ position: absolute;
482
+ top: 0;
483
+ bottom: 0;
484
+ left: 0;
485
+ right: 0;
486
+ background: var(--color-drag-placeholder-hover-3ohnz1, #d3e7f9);
487
+ border-radius: var(--border-radius-item-u2ibpi, 8px);
474
488
  }
475
- .awsui-motion-disabled body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437.awsui_active_tc96w_1m6re_446:not(#\9), .awsui-mode-entering body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437.awsui_active_tc96w_1m6re_446:not(#\9) {
476
- animation: none;
477
- transition: none;
489
+
490
+ .awsui_content-display-option-label_tc96w_rxrhz_464:not(#\9) {
491
+ flex-grow: 1;
492
+ min-width: 0;
493
+ -ms-word-break: break-all;
494
+ word-break: break-word;
495
+ padding-right: var(--space-l-4vl6xu, 20px);
496
+ }
497
+
498
+ .awsui_drag-overlay_tc96w_rxrhz_472:not(#\9) {
499
+ box-shadow: var(--shadow-container-active-l4kuxc, 0px 1px 1px 1px #e9ebed, 0px 6px 36px rgba(0, 7, 22, 0.1019607843));
500
+ border-radius: var(--border-radius-item-u2ibpi, 8px);
478
501
  }
479
- body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437.awsui_active_tc96w_1m6re_446:not(#\9) {
502
+ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_rxrhz_472:not(#\9) {
503
+ position: relative;
504
+ }
505
+ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_rxrhz_472:not(#\9) {
480
506
  outline: 2px dotted transparent;
481
507
  outline-offset: calc(0px - 1px);
482
508
  }
483
- body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427.awsui_draggable_tc96w_1m6re_437.awsui_active_tc96w_1m6re_446:not(#\9)::before {
509
+ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_rxrhz_472:not(#\9)::before {
484
510
  content: " ";
485
511
  display: block;
486
512
  position: absolute;
@@ -488,23 +514,15 @@ body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427
488
514
  top: calc(-1 * 0px);
489
515
  width: calc(100% + 2 * 0px);
490
516
  height: calc(100% + 2 * 0px);
491
- border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
517
+ border-radius: var(--border-radius-item-u2ibpi, 8px);
492
518
  box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
493
519
  }
494
520
 
495
- .awsui_sortable-item-label_tc96w_1m6re_495:not(#\9) {
496
- padding-right: var(--space-l-4vl6xu, 20px);
497
- flex-grow: 1;
498
- }
499
-
500
- .awsui_content-display_tc96w_1m6re_500:not(#\9),
501
- .awsui_content-display-groups_tc96w_1m6re_501:not(#\9),
502
- .awsui_content-display-group_tc96w_1m6re_501:not(#\9),
503
- .awsui_content-display-option_tc96w_1m6re_503:not(#\9) {
521
+ .awsui_content-display_tc96w_rxrhz_409:not(#\9) {
504
522
  /* used in test-utils */
505
523
  }
506
524
 
507
- .awsui_content-display-title_tc96w_1m6re_507:not(#\9) {
525
+ .awsui_content-display-title_tc96w_rxrhz_499:not(#\9) {
508
526
  font-size: var(--font-body-m-size-sregvd, 14px);
509
527
  line-height: var(--font-body-m-line-height-i7xxvv, 22px);
510
528
  font-weight: var(--font-display-label-weight-m18hjh, 700);
@@ -512,7 +530,7 @@ body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427
512
530
  margin: 0;
513
531
  }
514
532
 
515
- .awsui_content-display-description_tc96w_1m6re_515:not(#\9) {
533
+ .awsui_content-display-description_tc96w_rxrhz_507:not(#\9) {
516
534
  color: var(--color-text-form-secondary-ih9x7l, #5f6b7a);
517
535
  font-size: var(--font-body-s-size-ukw2p9, 12px);
518
536
  line-height: var(--font-body-s-line-height-kdsbrl, 16px);
@@ -520,30 +538,30 @@ body[data-awsui-focus-visible=true] .awsui_sortable-item-content_tc96w_1m6re_427
520
538
  margin-top: var(--space-scaled-xxxs-lo883m, 2px);
521
539
  }
522
540
 
523
- .awsui_content-display-option-list_tc96w_1m6re_523:not(#\9) {
541
+ .awsui_content-display-option-list_tc96w_rxrhz_515:not(#\9) {
524
542
  position: relative;
525
543
  list-style: none;
526
544
  padding: 0;
527
545
  }
528
546
 
529
- .awsui_root_tc96w_1m6re_529:not(#\9),
530
- .awsui_modal-root_tc96w_1m6re_530:not(#\9),
531
- .awsui_trigger-button_tc96w_1m6re_531:not(#\9),
532
- .awsui_cancel-button_tc96w_1m6re_532:not(#\9),
533
- .awsui_confirm-button_tc96w_1m6re_533:not(#\9),
534
- .awsui_custom_tc96w_1m6re_534:not(#\9) {
547
+ .awsui_root_tc96w_rxrhz_521:not(#\9),
548
+ .awsui_modal-root_tc96w_rxrhz_522:not(#\9),
549
+ .awsui_trigger-button_tc96w_rxrhz_523:not(#\9),
550
+ .awsui_cancel-button_tc96w_rxrhz_524:not(#\9),
551
+ .awsui_confirm-button_tc96w_rxrhz_525:not(#\9),
552
+ .awsui_custom_tc96w_rxrhz_526:not(#\9) {
535
553
  /* used in test-utils */
536
554
  }
537
555
 
538
- .awsui_second-column-small_tc96w_1m6re_538:not(#\9) {
556
+ .awsui_second-column-small_tc96w_rxrhz_530:not(#\9) {
539
557
  padding-top: calc(2 * var(--space-scaled-l-t03y3z, 20px));
540
558
  }
541
559
 
542
- .awsui_wrap-lines_tc96w_1m6re_542:not(#\9),
543
- .awsui_striped-rows_tc96w_1m6re_543:not(#\9),
544
- .awsui_content-density_tc96w_1m6re_544:not(#\9),
545
- .awsui_page-size_tc96w_1m6re_545:not(#\9),
546
- .awsui_page-size-form-field_tc96w_1m6re_546:not(#\9),
547
- .awsui_page-size-radio-group_tc96w_1m6re_547:not(#\9) {
560
+ .awsui_wrap-lines_tc96w_rxrhz_534:not(#\9),
561
+ .awsui_striped-rows_tc96w_rxrhz_535:not(#\9),
562
+ .awsui_content-density_tc96w_rxrhz_536:not(#\9),
563
+ .awsui_page-size_tc96w_rxrhz_537:not(#\9),
564
+ .awsui_page-size-form-field_tc96w_rxrhz_538:not(#\9),
565
+ .awsui_page-size-radio-group_tc96w_rxrhz_539:not(#\9) {
548
566
  /* used in test-utils */
549
567
  }
@@ -2,41 +2,37 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "visible-content": "awsui_visible-content_tc96w_1m6re_185",
6
- "visible-content-toggle": "awsui_visible-content-toggle_tc96w_1m6re_186",
7
- "visible-content-groups": "awsui_visible-content-groups_tc96w_1m6re_187",
8
- "visible-content-group": "awsui_visible-content-group_tc96w_1m6re_187",
9
- "visible-content-title": "awsui_visible-content-title_tc96w_1m6re_192",
10
- "visible-content-group-label": "awsui_visible-content-group-label_tc96w_1m6re_201",
11
- "visible-content-option": "awsui_visible-content-option_tc96w_1m6re_207",
12
- "visible-content-option-label": "awsui_visible-content-option-label_tc96w_1m6re_218",
13
- "sortable-item-toggle": "awsui_sortable-item-toggle_tc96w_1m6re_409",
14
- "sortable-item": "awsui_sortable-item_tc96w_1m6re_409",
15
- "sortable-item-placeholder": "awsui_sortable-item-placeholder_tc96w_1m6re_417",
16
- "sortable-item-content": "awsui_sortable-item-content_tc96w_1m6re_427",
17
- "draggable": "awsui_draggable_tc96w_1m6re_437",
18
- "active": "awsui_active_tc96w_1m6re_446",
19
- "sorting": "awsui_sorting_tc96w_1m6re_452",
20
- "sortable-item-label": "awsui_sortable-item-label_tc96w_1m6re_495",
21
- "content-display": "awsui_content-display_tc96w_1m6re_500",
22
- "content-display-groups": "awsui_content-display-groups_tc96w_1m6re_501",
23
- "content-display-group": "awsui_content-display-group_tc96w_1m6re_501",
24
- "content-display-option": "awsui_content-display-option_tc96w_1m6re_503",
25
- "content-display-title": "awsui_content-display-title_tc96w_1m6re_507",
26
- "content-display-description": "awsui_content-display-description_tc96w_1m6re_515",
27
- "content-display-option-list": "awsui_content-display-option-list_tc96w_1m6re_523",
28
- "root": "awsui_root_tc96w_1m6re_529",
29
- "modal-root": "awsui_modal-root_tc96w_1m6re_530",
30
- "trigger-button": "awsui_trigger-button_tc96w_1m6re_531",
31
- "cancel-button": "awsui_cancel-button_tc96w_1m6re_532",
32
- "confirm-button": "awsui_confirm-button_tc96w_1m6re_533",
33
- "custom": "awsui_custom_tc96w_1m6re_534",
34
- "second-column-small": "awsui_second-column-small_tc96w_1m6re_538",
35
- "wrap-lines": "awsui_wrap-lines_tc96w_1m6re_542",
36
- "striped-rows": "awsui_striped-rows_tc96w_1m6re_543",
37
- "content-density": "awsui_content-density_tc96w_1m6re_544",
38
- "page-size": "awsui_page-size_tc96w_1m6re_545",
39
- "page-size-form-field": "awsui_page-size-form-field_tc96w_1m6re_546",
40
- "page-size-radio-group": "awsui_page-size-radio-group_tc96w_1m6re_547"
5
+ "visible-content": "awsui_visible-content_tc96w_rxrhz_185",
6
+ "visible-content-toggle": "awsui_visible-content-toggle_tc96w_rxrhz_186",
7
+ "visible-content-groups": "awsui_visible-content-groups_tc96w_rxrhz_187",
8
+ "visible-content-group": "awsui_visible-content-group_tc96w_rxrhz_187",
9
+ "visible-content-title": "awsui_visible-content-title_tc96w_rxrhz_192",
10
+ "visible-content-group-label": "awsui_visible-content-group-label_tc96w_rxrhz_201",
11
+ "visible-content-option": "awsui_visible-content-option_tc96w_rxrhz_207",
12
+ "visible-content-option-label": "awsui_visible-content-option-label_tc96w_rxrhz_218",
13
+ "content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_rxrhz_409",
14
+ "content-display-option-content": "awsui_content-display-option-content_tc96w_rxrhz_413",
15
+ "content-display-option": "awsui_content-display-option_tc96w_rxrhz_409",
16
+ "placeholder": "awsui_placeholder_tc96w_rxrhz_436",
17
+ "sorting": "awsui_sorting_tc96w_rxrhz_436",
18
+ "content-display-option-label": "awsui_content-display-option-label_tc96w_rxrhz_464",
19
+ "drag-overlay": "awsui_drag-overlay_tc96w_rxrhz_472",
20
+ "content-display": "awsui_content-display_tc96w_rxrhz_409",
21
+ "content-display-title": "awsui_content-display-title_tc96w_rxrhz_499",
22
+ "content-display-description": "awsui_content-display-description_tc96w_rxrhz_507",
23
+ "content-display-option-list": "awsui_content-display-option-list_tc96w_rxrhz_515",
24
+ "root": "awsui_root_tc96w_rxrhz_521",
25
+ "modal-root": "awsui_modal-root_tc96w_rxrhz_522",
26
+ "trigger-button": "awsui_trigger-button_tc96w_rxrhz_523",
27
+ "cancel-button": "awsui_cancel-button_tc96w_rxrhz_524",
28
+ "confirm-button": "awsui_confirm-button_tc96w_rxrhz_525",
29
+ "custom": "awsui_custom_tc96w_rxrhz_526",
30
+ "second-column-small": "awsui_second-column-small_tc96w_rxrhz_530",
31
+ "wrap-lines": "awsui_wrap-lines_tc96w_rxrhz_534",
32
+ "striped-rows": "awsui_striped-rows_tc96w_rxrhz_535",
33
+ "content-density": "awsui_content-density_tc96w_rxrhz_536",
34
+ "page-size": "awsui_page-size_tc96w_rxrhz_537",
35
+ "page-size-form-field": "awsui_page-size-form-field_tc96w_rxrhz_538",
36
+ "page-size-radio-group": "awsui_page-size-radio-group_tc96w_rxrhz_539"
41
37
  };
42
38
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/options-list/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAgB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAEL,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EAEd,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC;;OAEG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,SAAS,CAAC,EAAE,sBAAsB,CAAC,aAAa,CAAC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B,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;;AAmFD,wBAA6C"}
@@ -8,6 +8,7 @@ import { getBaseProps } from '../../base-component';
8
8
  import { fireNonCancelableEvent, fireKeyboardEvent, } from '../../events';
9
9
  import { findUpUntil } from '../../utils/dom';
10
10
  import styles from './styles.css.js';
11
+ import { useStableEventHandler } from '../../hooks/use-stable-event-handler';
11
12
  const BOTTOM_TRIGGER_OFFSET = 80;
12
13
  const getItemIndex = (containerRef, event) => {
13
14
  const target = findUpUntil(event.target, element => element === containerRef.current || !!element.dataset.mouseTarget);
@@ -18,7 +19,7 @@ const OptionsList = (_a, ref) => {
18
19
  var { open, children, nativeAttributes = {}, onKeyDown, onBlur, onFocus, onLoadMore, onMouseUp, onMouseMove, position = 'relative', role = 'listbox', decreaseTopMargin = false, ariaLabelledby, ariaDescribedby } = _a, restProps = __rest(_a, ["open", "children", "nativeAttributes", "onKeyDown", "onBlur", "onFocus", "onLoadMore", "onMouseUp", "onMouseMove", "position", "role", "decreaseTopMargin", "ariaLabelledby", "ariaDescribedby"]);
19
20
  const baseProps = getBaseProps(restProps);
20
21
  const menuRef = useRef(null);
21
- const handleScroll = () => {
22
+ const handleScroll = useStableEventHandler(() => {
22
23
  const scrollContainer = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current;
23
24
  if (scrollContainer) {
24
25
  const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight;
@@ -27,13 +28,13 @@ const OptionsList = (_a, ref) => {
27
28
  fireNonCancelableEvent(onLoadMore);
28
29
  }
29
30
  }
30
- };
31
+ });
31
32
  useEffect(() => {
32
33
  if (!open) {
33
34
  return;
34
35
  }
35
36
  handleScroll();
36
- });
37
+ }, [open, handleScroll]);
37
38
  const className = clsx(styles['options-list'], {
38
39
  [styles['decrease-top-margin']]: decreaseTopMargin,
39
40
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/options-list/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,sBAAsB,EAItB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAyBrC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,YAAY,GAAG,CAAC,YAA0C,EAAE,KAAuB,EAAE,EAAE;IAC3F,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,CAAC,MAAqB,EAC3B,OAAO,CAAC,EAAE,CAAC,OAAO,KAAK,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAC7E,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,WAAW,CAAC;IAChD,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC;AAE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EACd,KAAK,EAAE,EAAE,QAAQ,EAAE,EACnB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,EACpE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EACjE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAC7D,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,EACvF,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAC9C,QAAQ,EAAE,CAAC,CAAC,qBACK,cAAc,sBACb,eAAe,KAEhC,IAAI,IAAI,QAAQ,CACd,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useRef } from 'react';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport {\n fireNonCancelableEvent,\n NonCancelableEventHandler,\n CancelableEventHandler,\n BaseKeyDetail,\n fireKeyboardEvent,\n} from '../../events';\nimport { findUpUntil } from '../../utils/dom';\nimport styles from './styles.css.js';\n\nexport interface OptionsListProps extends BaseComponentProps {\n open?: boolean;\n /**\n * Options list\n */\n children: React.ReactNode;\n nativeAttributes?: Record<string, any>;\n /**\n * Called when more items need to be loaded.\n */\n onLoadMore?: NonCancelableEventHandler;\n onKeyDown?: CancelableEventHandler<BaseKeyDetail>;\n onBlur?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n onFocus?: NonCancelableEventHandler;\n onMouseUp?: (itemIndex: number) => void;\n onMouseMove?: (itemIndex: number) => void;\n position?: React.CSSProperties['position'];\n role?: 'listbox' | 'list' | 'menu';\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n decreaseTopMargin?: boolean;\n}\n\nconst BOTTOM_TRIGGER_OFFSET = 80;\n\nconst getItemIndex = (containerRef: React.RefObject<HTMLElement>, event: React.MouseEvent) => {\n const target = findUpUntil(\n event.target as HTMLElement,\n element => element === containerRef.current || !!element.dataset.mouseTarget\n );\n const mouseTarget = target?.dataset.mouseTarget;\n return mouseTarget ? parseInt(mouseTarget) : -1;\n};\n\nconst OptionsList = (\n {\n open,\n children,\n nativeAttributes = {},\n onKeyDown,\n onBlur,\n onFocus,\n onLoadMore,\n onMouseUp,\n onMouseMove,\n position = 'relative',\n role = 'listbox',\n decreaseTopMargin = false,\n ariaLabelledby,\n ariaDescribedby,\n ...restProps\n }: OptionsListProps,\n ref: React.Ref<HTMLUListElement>\n) => {\n const baseProps = getBaseProps(restProps);\n const menuRef = useRef<HTMLUListElement>(null);\n\n const handleScroll = () => {\n const scrollContainer = menuRef?.current;\n if (scrollContainer) {\n const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight;\n const remainingScrollHeight = scrollContainer.scrollHeight - bottomEdgePosition;\n if (remainingScrollHeight < BOTTOM_TRIGGER_OFFSET) {\n fireNonCancelableEvent(onLoadMore);\n }\n }\n };\n\n useEffect(() => {\n if (!open) {\n return;\n }\n handleScroll();\n });\n\n const className = clsx(styles['options-list'], {\n [styles['decrease-top-margin']]: decreaseTopMargin,\n });\n\n const mergedRef = useMergeRefs(ref, menuRef);\n\n return (\n <ul\n {...baseProps}\n {...nativeAttributes}\n className={className}\n ref={mergedRef}\n style={{ position }}\n role={role}\n onScroll={handleScroll}\n onKeyDown={event => onKeyDown && fireKeyboardEvent(onKeyDown, event)}\n onMouseMove={event => onMouseMove?.(getItemIndex(menuRef, event))}\n onMouseUp={event => onMouseUp?.(getItemIndex(menuRef, event))}\n onBlur={event => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget })}\n onFocus={() => fireNonCancelableEvent(onFocus)}\n tabIndex={-1}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {open && children}\n </ul>\n );\n};\n\nexport default React.forwardRef(OptionsList);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/components/options-list/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,sBAAsB,EAItB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAyB7E,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,MAAM,YAAY,GAAG,CAAC,YAA0C,EAAE,KAAuB,EAAE,EAAE;IAC3F,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,CAAC,MAAqB,EAC3B,OAAO,CAAC,EAAE,CAAC,OAAO,KAAK,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAC7E,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,WAAW,CAAC;IAChD,OAAO,W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,CAAC;IAEH,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE7C,OAAO,CACL,4CACM,SAAS,EACT,gBAAgB,IACpB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,EAAE,QAAQ,EAAE,EACnB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,EACpE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EACjE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAC7D,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,EACvF,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAC9C,QAAQ,EAAE,CAAC,CAAC,qBACK,cAAc,sBACb,eAAe,KAEhC,IAAI,IAAI,QAAQ,CACd,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useRef } from 'react';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport {\n fireNonCancelableEvent,\n NonCancelableEventHandler,\n CancelableEventHandler,\n BaseKeyDetail,\n fireKeyboardEvent,\n} from '../../events';\nimport { findUpUntil } from '../../utils/dom';\nimport styles from './styles.css.js';\nimport { useStableEventHandler } from '../../hooks/use-stable-event-handler';\n\nexport interface OptionsListProps extends BaseComponentProps {\n open?: boolean;\n /**\n * Options list\n */\n children: React.ReactNode;\n nativeAttributes?: Record<string, any>;\n /**\n * Called when more items need to be loaded.\n */\n onLoadMore?: NonCancelableEventHandler;\n onKeyDown?: CancelableEventHandler<BaseKeyDetail>;\n onBlur?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n onFocus?: NonCancelableEventHandler;\n onMouseUp?: (itemIndex: number) => void;\n onMouseMove?: (itemIndex: number) => void;\n position?: React.CSSProperties['position'];\n role?: 'listbox' | 'list' | 'menu';\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n decreaseTopMargin?: boolean;\n}\n\nconst BOTTOM_TRIGGER_OFFSET = 80;\n\nconst getItemIndex = (containerRef: React.RefObject<HTMLElement>, event: React.MouseEvent) => {\n const target = findUpUntil(\n event.target as HTMLElement,\n element => element === containerRef.current || !!element.dataset.mouseTarget\n );\n const mouseTarget = target?.dataset.mouseTarget;\n return mouseTarget ? parseInt(mouseTarget) : -1;\n};\n\nconst OptionsList = (\n {\n open,\n children,\n nativeAttributes = {},\n onKeyDown,\n onBlur,\n onFocus,\n onLoadMore,\n onMouseUp,\n onMouseMove,\n position = 'relative',\n role = 'listbox',\n decreaseTopMargin = false,\n ariaLabelledby,\n ariaDescribedby,\n ...restProps\n }: OptionsListProps,\n ref: React.Ref<HTMLUListElement>\n) => {\n const baseProps = getBaseProps(restProps);\n const menuRef = useRef<HTMLUListElement>(null);\n\n const handleScroll = useStableEventHandler(() => {\n const scrollContainer = menuRef?.current;\n if (scrollContainer) {\n const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight;\n const remainingScrollHeight = scrollContainer.scrollHeight - bottomEdgePosition;\n if (remainingScrollHeight < BOTTOM_TRIGGER_OFFSET) {\n fireNonCancelableEvent(onLoadMore);\n }\n }\n });\n\n useEffect(() => {\n if (!open) {\n return;\n }\n handleScroll();\n }, [open, handleScroll]);\n\n const className = clsx(styles['options-list'], {\n [styles['decrease-top-margin']]: decreaseTopMargin,\n });\n\n const mergedRef = useMergeRefs(ref, menuRef);\n\n return (\n <ul\n {...baseProps}\n {...nativeAttributes}\n className={className}\n ref={mergedRef}\n style={{ position }}\n role={role}\n onScroll={handleScroll}\n onKeyDown={event => onKeyDown && fireKeyboardEvent(onKeyDown, event)}\n onMouseMove={event => onMouseMove?.(getItemIndex(menuRef, event))}\n onMouseUp={event => onMouseUp?.(getItemIndex(menuRef, event))}\n onBlur={event => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget })}\n onFocus={() => fireNonCancelableEvent(onFocus)}\n tabIndex={-1}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {open && children}\n </ul>\n );\n};\n\nexport default React.forwardRef(OptionsList);\n"]}
@@ -1,6 +1,6 @@
1
1
 
2
2
  export var PACKAGE_SOURCE = 'components';
3
- export var PACKAGE_VERSION = '3.0.0 (78d0b88)';
3
+ export var PACKAGE_VERSION = '3.0.0 (d8d70af)';
4
4
  export var THEME = 'open-source-visual-refresh';
5
5
  export var ALWAYS_VISUAL_REFRESH = true;
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React, { RefObject } from 'react';
2
2
  /**
3
- * useScrollSync returns scroll event handler to be attached to synchronised scroll elements.
3
+ * useScrollSync returns scroll event handler to be attached to synchronized scroll elements.
4
4
  *
5
5
  * For example
6
6
  * const handleScroll = useScrollSync([ref1, ref2]);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/hooks/use-scroll-sync/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAU,MAAM,OAAO,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,UAAQ,YAEhD,aAAa,uBAqBvC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/hooks/use-scroll-sync/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAU,MAAM,OAAO,CAAC;AAGjD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,UAA4B,YAEpE,aAAa,uBAqBvC"}
@@ -1,15 +1,16 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { useRef } from 'react';
4
+ import { supportsStickyPosition } from '../../utils/dom';
4
5
  /**
5
- * useScrollSync returns scroll event handler to be attached to synchronised scroll elements.
6
+ * useScrollSync returns scroll event handler to be attached to synchronized scroll elements.
6
7
  *
7
8
  * For example
8
9
  * const handleScroll = useScrollSync([ref1, ref2]);
9
10
  * <div ref={ref1} onScroll={handleScroll}/>
10
11
  * <div ref={ref2} onScroll={handleScroll}/>
11
12
  */
12
- export function useScrollSync(refs, disabled = false) {
13
+ export function useScrollSync(refs, disabled = !supportsStickyPosition()) {
13
14
  const activeElement = useRef(null);
14
15
  const onScroll = (event) => {
15
16
  const targetElement = event.target;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/use-scroll-sync/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAa,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,IAA2B,EAAE,QAAQ,GAAG,KAAK;IACzE,MAAM,aAAa,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;QACxC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAqB,CAAC;QAClD,0FAA0F;QAC1F,IAAI,aAAa,IAAI,CAAC,aAAa,CAAC,OAAO,KAAK,IAAI,IAAI,aAAa,CAAC,OAAO,KAAK,aAAa,CAAC,EAAE;YAChG,qBAAqB,CAAC,GAAG,EAAE;gBACzB,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC;gBACtC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;oBACjB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;oBAC5B,IAAI,OAAO,IAAI,OAAO,KAAK,aAAa,EAAE;wBACxC,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;qBAC/C;gBACH,CAAC,CAAC,CAAC;gBACH,oDAAoD;gBACpD,qBAAqB,CAAC,GAAG,EAAE;oBACzB,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC/B,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { RefObject, useRef } from 'react';\n\n/**\n * useScrollSync returns scroll event handler to be attached to synchronised scroll elements.\n *\n * For example\n * const handleScroll = useScrollSync([ref1, ref2]);\n * <div ref={ref1} onScroll={handleScroll}/>\n * <div ref={ref2} onScroll={handleScroll}/>\n */\nexport function useScrollSync(refs: Array<RefObject<any>>, disabled = false) {\n const activeElement = useRef<HTMLElement | null>(null);\n const onScroll = (event: React.UIEvent) => {\n const targetElement = event.target as HTMLElement;\n // remembers the first element that fires onscroll to align with other elements against it\n if (targetElement && (activeElement.current === null || activeElement.current === targetElement)) {\n requestAnimationFrame(() => {\n activeElement.current = targetElement;\n refs.forEach(ref => {\n const element = ref.current;\n if (element && element !== targetElement) {\n element.scrollLeft = targetElement.scrollLeft;\n }\n });\n // unblock the ability to scroll the synced elements\n requestAnimationFrame(() => {\n activeElement.current = null;\n });\n });\n }\n };\n\n return !disabled ? onScroll : undefined;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["internal/hooks/use-scroll-sync/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAa,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,IAA2B,EAAE,QAAQ,GAAG,CAAC,sBAAsB,EAAE;IAC7F,MAAM,aAAa,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;QACxC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAqB,CAAC;QAClD,0FAA0F;QAC1F,IAAI,aAAa,IAAI,CAAC,aAAa,CAAC,OAAO,KAAK,IAAI,IAAI,aAAa,CAAC,OAAO,KAAK,aAAa,CAAC,EAAE;YAChG,qBAAqB,CAAC,GAAG,EAAE;gBACzB,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC;gBACtC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;oBACjB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;oBAC5B,IAAI,OAAO,IAAI,OAAO,KAAK,aAAa,EAAE;wBACxC,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;qBAC/C;gBACH,CAAC,CAAC,CAAC;gBACH,oDAAoD;gBACpD,qBAAqB,CAAC,GAAG,EAAE;oBACzB,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC/B,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { RefObject, useRef } from 'react';\nimport { supportsStickyPosition } from '../../utils/dom';\n\n/**\n * useScrollSync returns scroll event handler to be attached to synchronized scroll elements.\n *\n * For example\n * const handleScroll = useScrollSync([ref1, ref2]);\n * <div ref={ref1} onScroll={handleScroll}/>\n * <div ref={ref2} onScroll={handleScroll}/>\n */\nexport function useScrollSync(refs: Array<RefObject<any>>, disabled = !supportsStickyPosition()) {\n const activeElement = useRef<HTMLElement | null>(null);\n const onScroll = (event: React.UIEvent) => {\n const targetElement = event.target as HTMLElement;\n // remembers the first element that fires onscroll to align with other elements against it\n if (targetElement && (activeElement.current === null || activeElement.current === targetElement)) {\n requestAnimationFrame(() => {\n activeElement.current = targetElement;\n refs.forEach(ref => {\n const element = ref.current;\n if (element && element !== targetElement) {\n element.scrollLeft = targetElement.scrollLeft;\n }\n });\n // unblock the ability to scroll the synced elements\n requestAnimationFrame(() => {\n activeElement.current = null;\n });\n });\n }\n };\n\n return !disabled ? onScroll : undefined;\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "78d0b886f9223de8848764a977321d74bb072d16"
2
+ "commit": "d8d70af91b9365e695cf3efa5541d7a881abeb2c"
3
3
  }
package/package.json CHANGED
@@ -109,7 +109,7 @@
109
109
  "./internal/base-component/index.js",
110
110
  "./internal/base-component/styles.css.js"
111
111
  ],
112
- "version": "3.0.274",
112
+ "version": "3.0.276",
113
113
  "repository": {
114
114
  "type": "git",
115
115
  "url": "https://github.com/cloudscape-design/components.git"
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAoC/D,QAAA,MAAM,aAAa,qBA4ZK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAoC/D,QAAA,MAAM,aAAa,qBAyZK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
package/table/internal.js CHANGED
@@ -58,7 +58,7 @@ const InternalTable = React.forwardRef((_a, ref) => {
58
58
  cancelEdit: () => setCurrentEditCell(null),
59
59
  });
60
60
  }, []);
61
- const handleScroll = useScrollSync([wrapperRefObject, scrollbarRef, secondaryWrapperRef], !supportsStickyPosition());
61
+ const handleScroll = useScrollSync([wrapperRefObject, scrollbarRef, secondaryWrapperRef]);
62
62
  const { moveFocusDown, moveFocusUp, moveFocus } = useFocusMove(selectionType, items.length);
63
63
  const { onRowClickHandler, onRowContextMenuHandler } = useRowEvents({ onRowClick, onRowContextMenu });
64
64
  const visibleColumnDefinitions = getVisibleColumnDefinitions({