@cloudscape-design/components 3.0.1412 → 3.0.1414
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/alert/styles.css.js +27 -27
- package/alert/styles.scoped.css +49 -49
- package/alert/styles.selectors.js +27 -27
- package/annotation-context/annotation/styles.css.js +13 -13
- package/annotation-context/annotation/styles.scoped.css +21 -21
- package/annotation-context/annotation/styles.selectors.js +13 -13
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/visual-refresh/mobile-toolbar.d.ts.map +1 -1
- package/app-layout/visual-refresh/mobile-toolbar.js +1 -1
- package/app-layout/visual-refresh/mobile-toolbar.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +86 -86
- package/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +32 -32
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +89 -89
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +32 -32
- package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +6 -6
- package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +13 -13
- package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +6 -6
- package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +30 -30
- package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +68 -68
- package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +30 -30
- package/attribute-editor/styles.css.js +15 -15
- package/attribute-editor/styles.scoped.css +28 -28
- package/attribute-editor/styles.selectors.js +15 -15
- package/breadcrumb-group/item/styles.css.js +7 -7
- package/breadcrumb-group/item/styles.scoped.css +28 -28
- package/breadcrumb-group/item/styles.selectors.js +7 -7
- package/button/styles.css.js +24 -24
- package/button/styles.scoped.css +328 -328
- package/button/styles.selectors.js +24 -24
- package/button-dropdown/item-element/styles.css.js +21 -21
- package/button-dropdown/item-element/styles.scoped.css +37 -37
- package/button-dropdown/item-element/styles.selectors.js +21 -21
- package/cards/styles.css.js +39 -39
- package/cards/styles.scoped.css +41 -41
- package/cards/styles.selectors.js +39 -39
- package/checkbox/internal.d.ts +1 -1
- package/checkbox/internal.d.ts.map +1 -1
- package/checkbox/internal.js.map +1 -1
- package/checkbox/styles.css.js +3 -3
- package/checkbox/styles.scoped.css +10 -10
- package/checkbox/styles.selectors.js +3 -3
- package/container/styles.css.js +33 -33
- package/container/styles.scoped.css +106 -106
- package/container/styles.selectors.js +33 -33
- package/content-layout/interfaces.d.ts +4 -2
- package/content-layout/interfaces.d.ts.map +1 -1
- package/content-layout/interfaces.js.map +1 -1
- package/content-layout/styles.css.js +14 -14
- package/content-layout/styles.scoped.css +27 -27
- package/content-layout/styles.selectors.js +14 -14
- package/control-group/styles.css.js +27 -27
- package/control-group/styles.scoped.css +28 -28
- package/control-group/styles.selectors.js +27 -27
- package/dropdown/styles.css.js +20 -20
- package/dropdown/styles.scoped.css +45 -45
- package/dropdown/styles.selectors.js +20 -20
- package/expandable-section/expandable-section-header.js +1 -1
- package/expandable-section/expandable-section-header.js.map +1 -1
- package/file-token-group/styles.css.js +23 -23
- package/file-token-group/styles.scoped.css +36 -36
- package/file-token-group/styles.selectors.js +23 -23
- package/flashbar/styles.css.js +50 -50
- package/flashbar/styles.scoped.css +182 -182
- package/flashbar/styles.selectors.js +50 -50
- package/header/interfaces.d.ts +4 -0
- package/header/interfaces.d.ts.map +1 -1
- package/header/interfaces.js.map +1 -1
- package/header/internal.d.ts +1 -6
- package/header/internal.d.ts.map +1 -1
- package/header/internal.js +2 -2
- package/header/internal.js.map +1 -1
- package/header/styles.css.js +36 -36
- package/header/styles.scoped.css +55 -55
- package/header/styles.selectors.js +36 -36
- package/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +72 -72
- package/help-panel/styles.selectors.js +6 -6
- package/i18n/messages/all.all.js +1 -1
- package/i18n/messages/all.all.json +1 -1
- package/i18n/messages/all.de.js +1 -1
- package/i18n/messages/all.de.json +1 -1
- package/i18n/messages/all.en-GB.js +1 -1
- package/i18n/messages/all.en-GB.json +1 -1
- package/i18n/messages/all.en.js +1 -1
- package/i18n/messages/all.en.json +1 -1
- package/i18n/messages/all.es.js +1 -1
- package/i18n/messages/all.es.json +1 -1
- package/i18n/messages/all.fr.js +1 -1
- package/i18n/messages/all.fr.json +1 -1
- package/i18n/messages/all.id.js +1 -1
- package/i18n/messages/all.id.json +1 -1
- package/i18n/messages/all.it.js +1 -1
- package/i18n/messages/all.it.json +1 -1
- package/i18n/messages/all.ja.js +1 -1
- package/i18n/messages/all.ja.json +1 -1
- package/i18n/messages/all.ko.js +1 -1
- package/i18n/messages/all.ko.json +1 -1
- package/i18n/messages/all.pt-BR.js +1 -1
- package/i18n/messages/all.pt-BR.json +1 -1
- package/i18n/messages/all.tr.js +1 -1
- package/i18n/messages/all.tr.json +1 -1
- package/i18n/messages/all.zh-CN.js +1 -1
- package/i18n/messages/all.zh-CN.json +1 -1
- package/i18n/messages/all.zh-TW.js +1 -1
- package/i18n/messages/all.zh-TW.json +1 -1
- package/i18n/messages-types.d.ts +3 -0
- package/i18n/messages-types.d.ts.map +1 -1
- package/i18n/messages-types.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/input/styles.css.js +45 -45
- package/input/styles.scoped.css +145 -145
- package/input/styles.selectors.js +45 -45
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/drag-handle-wrapper/styles.css.js +30 -30
- package/internal/components/drag-handle-wrapper/styles.scoped.css +58 -58
- package/internal/components/drag-handle-wrapper/styles.selectors.js +30 -30
- package/internal/components/focus-lock/utils.d.ts +2 -0
- package/internal/components/focus-lock/utils.d.ts.map +1 -1
- package/internal/components/focus-lock/utils.js +5 -1
- package/internal/components/focus-lock/utils.js.map +1 -1
- package/internal/components/listbox/parts/item.d.ts +2 -0
- package/internal/components/listbox/parts/item.d.ts.map +1 -1
- package/internal/components/listbox/parts/item.js +3 -3
- package/internal/components/listbox/parts/item.js.map +1 -1
- package/internal/components/listbox/parts/plain-list.d.ts +6 -0
- package/internal/components/listbox/parts/plain-list.d.ts.map +1 -1
- package/internal/components/listbox/parts/plain-list.js +5 -4
- package/internal/components/listbox/parts/plain-list.js.map +1 -1
- package/internal/components/listbox/parts/scroll-to-index.d.ts +11 -0
- package/internal/components/listbox/parts/scroll-to-index.d.ts.map +1 -1
- package/internal/components/listbox/parts/scroll-to-index.js +16 -0
- package/internal/components/listbox/parts/scroll-to-index.js.map +1 -1
- package/internal/components/listbox/use-listbox.d.ts +2 -2
- package/internal/components/listbox/use-listbox.d.ts.map +1 -1
- package/internal/components/listbox/use-listbox.js.map +1 -1
- package/internal/components/option/styles.css.js +19 -19
- package/internal/components/option/styles.scoped.css +36 -36
- package/internal/components/option/styles.selectors.js +19 -19
- package/internal/components/options-list/index.d.ts +4 -1
- package/internal/components/options-list/index.d.ts.map +1 -1
- package/internal/components/options-list/index.js +1 -1
- package/internal/components/options-list/index.js.map +1 -1
- package/internal/components/options-list/utils/use-keyboard.d.ts +2 -1
- package/internal/components/options-list/utils/use-keyboard.d.ts.map +1 -1
- package/internal/components/options-list/utils/use-keyboard.js +4 -2
- package/internal/components/options-list/utils/use-keyboard.js.map +1 -1
- package/internal/components/radio-button/styles.css.js +7 -7
- package/internal/components/radio-button/styles.scoped.css +17 -17
- package/internal/components/radio-button/styles.selectors.js +7 -7
- package/internal/components/selectable-item/index.d.ts +1 -0
- package/internal/components/selectable-item/index.d.ts.map +1 -1
- package/internal/components/selectable-item/index.js +2 -1
- package/internal/components/selectable-item/index.js.map +1 -1
- package/internal/components/selectable-item/interfaces.d.ts +1 -0
- package/internal/components/selectable-item/interfaces.d.ts.map +1 -1
- package/internal/components/selectable-item/interfaces.js.map +1 -1
- package/internal/components/selectable-item/styles.css.js +23 -22
- package/internal/components/selectable-item/styles.scoped.css +60 -57
- package/internal/components/selectable-item/styles.selectors.js +23 -22
- package/internal/components/sticky-header/use-untabbable-descendants.d.ts +2 -0
- package/internal/components/sticky-header/use-untabbable-descendants.d.ts.map +1 -0
- package/internal/components/sticky-header/use-untabbable-descendants.js +16 -0
- package/internal/components/sticky-header/use-untabbable-descendants.js.map +1 -0
- package/internal/components/token-list/styles.css.js +10 -10
- package/internal/components/token-list/styles.scoped.css +25 -25
- package/internal/components/token-list/styles.selectors.js +10 -10
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/custom-css-properties/index.d.ts +1 -0
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +178 -177
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/item-card/styles.css.js +14 -14
- package/item-card/styles.scoped.css +73 -73
- package/item-card/styles.selectors.js +14 -14
- package/link/styles.css.js +21 -21
- package/link/styles.scoped.css +104 -104
- package/link/styles.selectors.js +21 -21
- package/manifest.json +2 -2
- package/modal/styles.css.js +32 -32
- package/modal/styles.scoped.css +49 -49
- package/modal/styles.selectors.js +32 -32
- package/multiselect/use-multiselect.d.ts +1 -1
- package/option-list/index.d.ts +5 -0
- package/option-list/index.d.ts.map +1 -0
- package/option-list/index.js +21 -0
- package/option-list/index.js.map +1 -0
- package/option-list/interfaces.d.ts +131 -0
- package/option-list/interfaces.d.ts.map +1 -0
- package/option-list/interfaces.js +2 -0
- package/option-list/interfaces.js.map +1 -0
- package/option-list/internal.d.ts +5 -0
- package/option-list/internal.d.ts.map +1 -0
- package/option-list/internal.js +138 -0
- package/option-list/internal.js.map +1 -0
- package/option-list/styles.css.js +6 -0
- package/option-list/styles.scoped.css +40 -0
- package/option-list/styles.selectors.js +7 -0
- package/option-list/test-classes/styles.css.js +8 -0
- package/option-list/test-classes/styles.scoped.css +9 -0
- package/option-list/test-classes/styles.selectors.js +9 -0
- package/option-list/use-option-list.d.ts +36 -0
- package/option-list/use-option-list.d.ts.map +1 -0
- package/option-list/use-option-list.js +69 -0
- package/option-list/use-option-list.js.map +1 -0
- package/package.json +4 -1
- package/popover/styles.css.js +58 -58
- package/popover/styles.scoped.css +94 -94
- package/popover/styles.selectors.js +58 -58
- package/progress-bar/styles.css.js +20 -20
- package/progress-bar/styles.scoped.css +59 -59
- package/progress-bar/styles.selectors.js +20 -20
- package/prompt-input/components/token-mode.d.ts +4 -0
- package/prompt-input/components/token-mode.d.ts.map +1 -1
- package/prompt-input/components/token-mode.js +2 -2
- package/prompt-input/components/token-mode.js.map +1 -1
- package/prompt-input/internal.d.ts +10 -1
- package/prompt-input/internal.d.ts.map +1 -1
- package/prompt-input/internal.js +35 -26
- package/prompt-input/internal.js.map +1 -1
- package/prompt-input/styles.css.js +26 -26
- package/prompt-input/styles.scoped.css +136 -107
- package/prompt-input/styles.selectors.js +26 -26
- package/prompt-input/tokens/use-token-mode.d.ts +4 -0
- package/prompt-input/tokens/use-token-mode.d.ts.map +1 -1
- package/prompt-input/tokens/use-token-mode.js +3 -3
- package/prompt-input/tokens/use-token-mode.js.map +1 -1
- package/property-filter/interfaces.d.ts +2 -0
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/property-filter/token-editor-inputs.d.ts.map +1 -1
- package/property-filter/token-editor-inputs.js +3 -3
- package/property-filter/token-editor-inputs.js.map +1 -1
- package/segmented-control/styles.css.js +31 -31
- package/segmented-control/styles.scoped.css +81 -81
- package/segmented-control/styles.selectors.js +31 -31
- package/select/parts/styles.css.js +22 -22
- package/select/parts/styles.scoped.css +25 -25
- package/select/parts/styles.selectors.js +22 -22
- package/side-navigation/styles.css.js +65 -65
- package/side-navigation/styles.scoped.css +114 -114
- package/side-navigation/styles.selectors.js +65 -65
- package/slider/styles.css.js +26 -26
- package/slider/styles.scoped.css +167 -167
- package/slider/styles.selectors.js +26 -26
- package/spinner/styles.css.js +14 -14
- package/spinner/styles.scoped.css +40 -40
- package/spinner/styles.selectors.js +14 -14
- package/styling/prompt-input.scss +76 -0
- package/styling/table.scss +102 -0
- package/styling/tabs.scss +128 -0
- package/table/body-cell/styles.css.js +47 -47
- package/table/body-cell/styles.scoped.css +426 -418
- package/table/body-cell/styles.selectors.js +47 -47
- package/table/body-cell/td-element.d.ts +1 -0
- package/table/body-cell/td-element.d.ts.map +1 -1
- package/table/body-cell/td-element.js +2 -2
- package/table/body-cell/td-element.js.map +1 -1
- package/table/clear-sort.d.ts +3 -1
- package/table/clear-sort.d.ts.map +1 -1
- package/table/clear-sort.js +2 -2
- package/table/clear-sort.js.map +1 -1
- package/table/header-cell/common-props.d.ts +2 -0
- package/table/header-cell/common-props.d.ts.map +1 -1
- package/table/header-cell/common-props.js.map +1 -1
- package/table/header-cell/group-header-cell.d.ts +2 -1
- package/table/header-cell/group-header-cell.d.ts.map +1 -1
- package/table/header-cell/group-header-cell.js +3 -2
- package/table/header-cell/group-header-cell.js.map +1 -1
- package/table/header-cell/index.d.ts +2 -1
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +12 -5
- package/table/header-cell/index.js.map +1 -1
- package/table/header-cell/sort-menu.d.ts +4 -1
- package/table/header-cell/sort-menu.d.ts.map +1 -1
- package/table/header-cell/sort-menu.js +2 -2
- package/table/header-cell/sort-menu.js.map +1 -1
- package/table/header-cell/styles.css.js +39 -39
- package/table/header-cell/styles.scoped.css +140 -125
- package/table/header-cell/styles.selectors.js +39 -39
- package/table/header-cell/th-element.d.ts +2 -0
- package/table/header-cell/th-element.d.ts.map +1 -1
- package/table/header-cell/th-element.js +2 -2
- package/table/header-cell/th-element.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +20 -7
- package/table/internal.js.map +1 -1
- package/table/resizer/index.d.ts.map +1 -1
- package/table/resizer/index.js +1 -1
- package/table/resizer/index.js.map +1 -1
- package/table/resizer/styles.css.js +17 -17
- package/table/resizer/styles.scoped.css +39 -35
- package/table/resizer/styles.selectors.js +17 -17
- package/table/selection/selection-cell.d.ts +5 -0
- package/table/selection/selection-cell.d.ts.map +1 -1
- package/table/selection/selection-cell.js +6 -5
- package/table/selection/selection-cell.js.map +1 -1
- package/table/selection/selection-control.d.ts +3 -0
- package/table/selection/selection-control.d.ts.map +1 -1
- package/table/selection/selection-control.js +2 -2
- package/table/selection/selection-control.js.map +1 -1
- package/table/style-api.d.ts +41 -0
- package/table/style-api.d.ts.map +1 -0
- package/table/style-api.js +4 -0
- package/table/style-api.js.map +1 -0
- package/table/styles.css.js +37 -37
- package/table/styles.scoped.css +119 -46
- package/table/styles.selectors.js +37 -37
- package/table/thead.d.ts +2 -0
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +2 -1
- package/table/thead.js.map +1 -1
- package/table-root/index.js +1 -1
- package/table-root/index.js.map +1 -1
- package/table-root/interfaces.d.ts +15 -1
- package/table-root/interfaces.d.ts.map +1 -1
- package/table-root/interfaces.js.map +1 -1
- package/table-root/internal.d.ts +2 -0
- package/table-root/internal.d.ts.map +1 -1
- package/table-root/internal.js +23 -11
- package/table-root/internal.js.map +1 -1
- package/table-root/sticky-header-slot.d.ts +24 -0
- package/table-root/sticky-header-slot.d.ts.map +1 -0
- package/table-root/sticky-header-slot.js +13 -0
- package/table-root/sticky-header-slot.js.map +1 -0
- package/table-root/styles.css.js +10 -5
- package/table-root/styles.scoped.css +52 -7
- package/table-root/styles.selectors.js +10 -5
- package/table-root/use-sticky-header.d.ts +33 -0
- package/table-root/use-sticky-header.d.ts.map +1 -0
- package/table-root/use-sticky-header.js +141 -0
- package/table-root/use-sticky-header.js.map +1 -0
- package/tabs/index.d.ts.map +1 -1
- package/tabs/index.js +3 -2
- package/tabs/index.js.map +1 -1
- package/tabs/styles.css.js +30 -30
- package/tabs/styles.scoped.css +137 -81
- package/tabs/styles.selectors.js +30 -30
- package/tabs/tab-header-bar.d.ts +12 -1
- package/tabs/tab-header-bar.d.ts.map +1 -1
- package/tabs/tab-header-bar.js +14 -7
- package/tabs/tab-header-bar.js.map +1 -1
- package/tag-editor/styles.css.js +3 -3
- package/tag-editor/styles.scoped.css +13 -13
- package/tag-editor/styles.selectors.js +3 -3
- package/test-utils/dom/header/index.d.ts +1 -0
- package/test-utils/dom/header/index.js +3 -0
- package/test-utils/dom/header/index.js.map +1 -1
- package/test-utils/dom/index.d.ts +28 -0
- package/test-utils/dom/index.js +21 -2
- package/test-utils/dom/index.js.map +1 -1
- package/test-utils/dom/option-list/index.d.ts +69 -0
- package/test-utils/dom/option-list/index.js +132 -0
- package/test-utils/dom/option-list/index.js.map +1 -0
- package/test-utils/selectors/header/index.d.ts +1 -0
- package/test-utils/selectors/header/index.js +3 -0
- package/test-utils/selectors/header/index.js.map +1 -1
- package/test-utils/selectors/index.d.ts +18 -0
- package/test-utils/selectors/index.js +16 -2
- package/test-utils/selectors/index.js.map +1 -1
- package/test-utils/selectors/option-list/index.d.ts +66 -0
- package/test-utils/selectors/option-list/index.js +108 -0
- package/test-utils/selectors/option-list/index.js.map +1 -0
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +66 -66
- package/text-content/styles.selectors.js +1 -1
- package/textarea/styles.css.js +9 -9
- package/textarea/styles.scoped.css +51 -51
- package/textarea/styles.selectors.js +9 -9
- package/toggle/styles.css.js +10 -10
- package/toggle/styles.scoped.css +25 -25
- package/toggle/styles.selectors.js +10 -10
- package/token/styles.css.js +14 -14
- package/token/styles.scoped.css +57 -57
- package/token/styles.selectors.js +14 -14
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,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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, { 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 multiColumnSort?: TableProps.MultiColumnSort<any>;\n i18nStrings?: TableProps.I18nStrings;\n ariaLabels?: TableProps.AriaLabels<any>;\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 multiColumnSort,\n i18nStrings,\n ariaLabels,\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 multiColumnSort={multiColumnSort}\n i18nStrings={i18nStrings}\n ariaLabels={ariaLabels}\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.cellKey}>\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.cellKey, 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.cellKey)}\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.cellKey, 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.cellKey}\n colspan={col.colSpan}\n colIndex={selectionType ? col.colIndex + 1 : col.colIndex}\n groupId={col.id}\n resizableStyle={getColumnStyles(sticky, col.cellKey)}\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.cellKey, 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 multiColumnSort={multiColumnSort}\n i18nStrings={i18nStrings}\n ariaLabels={ariaLabels}\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
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AAc,CAAC,eAAe,CAAC,OAAO,CAAC,EAC7D,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,EACjD,OAAO,EAAE,MAAM,CAAC,EAAE;wBAChB,iBAAiB,CAAC,SAAS,CAAC,CAAC;wBAC7B,sBAAsB,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, { 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 { StyleClassNames } from './style-api';\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 multiColumnSort?: TableProps.MultiColumnSort<any>;\n i18nStrings?: TableProps.I18nStrings;\n ariaLabels?: TableProps.AriaLabels<any>;\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 styleClassNames?: StyleClassNames;\n}\n\nconst Thead = React.forwardRef(\n (\n {\n selectionType,\n getSelectAllProps,\n columnDefinitions,\n columnGroupsLayout,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n multiColumnSort,\n i18nStrings,\n ariaLabels,\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 styleClassNames,\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 styleClassNames,\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 multiColumnSort={multiColumnSort}\n i18nStrings={i18nStrings}\n ariaLabels={ariaLabels}\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.cellKey}>\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.cellKey, 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.cellKey)}\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.cellKey, 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.cellKey}\n colspan={col.colSpan}\n colIndex={selectionType ? col.colIndex + 1 : col.colIndex}\n groupId={col.id}\n resizableStyle={getColumnStyles(sticky, col.cellKey)}\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.cellKey, 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 multiColumnSort={multiColumnSort}\n i18nStrings={i18nStrings}\n ariaLabels={ariaLabels}\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"]}
|
package/table-root/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import InternalTableRoot from './internal';
|
|
|
8
8
|
function TableRoot({ columnLayout = { type: 'auto' }, ...props }) {
|
|
9
9
|
const baseComponentProps = useBaseComponent('TableRoot', {
|
|
10
10
|
props: {},
|
|
11
|
-
metadata: { columnLayoutType: columnLayout.type },
|
|
11
|
+
metadata: { columnLayoutType: columnLayout.type, hasStickyHeader: !!props.stickyHeader },
|
|
12
12
|
});
|
|
13
13
|
return React.createElement(InternalTableRoot, { columnLayout: columnLayout, ...props, ...baseComponentProps });
|
|
14
14
|
}
|
package/table-root/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table-root/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,iBAAiB,MAAM,YAAY,CAAC;AAK3C,SAAS,SAAS,CAAC,EAAE,YAAY,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,KAAK,EAAkB;IAC9E,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,WAAW,EAAE;QACvD,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE,gBAAgB,EAAE,YAAY,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table-root/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,iBAAiB,MAAM,YAAY,CAAC;AAK3C,SAAS,SAAS,CAAC,EAAE,YAAY,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,KAAK,EAAkB;IAC9E,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,WAAW,EAAE;QACvD,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE,gBAAgB,EAAE,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,EAAE;KACzF,CAAC,CAAC;IACH,OAAO,oBAAC,iBAAiB,IAAC,YAAY,EAAE,YAAY,KAAM,KAAK,KAAM,kBAAkB,GAAI,CAAC;AAC9F,CAAC;AAED,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAEzC,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { TableRootProps } from './interfaces';\nimport InternalTableRoot from './internal';\n\n// Each part is its own top-level component (one default export + props type) so the documenter documents it separately.\nexport { TableRootProps };\n\nfunction TableRoot({ columnLayout = { type: 'auto' }, ...props }: TableRootProps) {\n const baseComponentProps = useBaseComponent('TableRoot', {\n props: {},\n metadata: { columnLayoutType: columnLayout.type, hasStickyHeader: !!props.stickyHeader },\n });\n return <InternalTableRoot columnLayout={columnLayout} {...props} {...baseComponentProps} />;\n}\n\napplyDisplayName(TableRoot, 'TableRoot');\n\nexport default TableRoot;\n"]}
|
|
@@ -6,7 +6,8 @@ import { BaseComponentProps } from '../types/base-component';
|
|
|
6
6
|
*/
|
|
7
7
|
export interface TableRootProps extends BaseComponentProps {
|
|
8
8
|
/**
|
|
9
|
-
* The table's content. Provide a `TableHead` followed by a `TableBody` that contains the rows.
|
|
9
|
+
* The table's content. Provide a `TableHead` followed by a `TableBody` that contains the rows. When you
|
|
10
|
+
* use `stickyHeader`, provide only the `TableBody` here.
|
|
10
11
|
*/
|
|
11
12
|
children: React.ReactNode;
|
|
12
13
|
/**
|
|
@@ -37,6 +38,19 @@ export interface TableRootProps extends BaseComponentProps {
|
|
|
37
38
|
* subset of rows, such as with virtualization; otherwise it is derived from the DOM.
|
|
38
39
|
*/
|
|
39
40
|
ariaRowcount?: number;
|
|
41
|
+
/**
|
|
42
|
+
* A `TableHead` that stays pinned to the top of its scroll container as the body scrolls. When you
|
|
43
|
+
* provide it, render only the `TableBody` as `children`.
|
|
44
|
+
*
|
|
45
|
+
* The header is rendered twice, as the real header and a pinned copy, so use controlled state for any
|
|
46
|
+
* controls in it.
|
|
47
|
+
*/
|
|
48
|
+
stickyHeader?: React.ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* Specifies a vertical offset (in pixels) for the sticky header. For example, use this if you
|
|
51
|
+
* need to position the sticky header below other fixed position elements on the page.
|
|
52
|
+
*/
|
|
53
|
+
stickyHeaderVerticalOffset?: number;
|
|
40
54
|
}
|
|
41
55
|
export declare namespace TableRootProps {
|
|
42
56
|
type ColumnLayout = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/table-root/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;GAGG;AACH,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E,KAAK,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/table-root/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../types/base-component';\n\n/**\n * A composable table. You render the head and rows as children, and TableRoot provides the column\n * layout and accessibility semantics.\n */\nexport interface TableRootProps extends BaseComponentProps {\n /**\n * The table's content. Provide a `TableHead` followed by a `TableBody` that contains the rows.\n */\n children: React.ReactNode;\n\n /**\n * Determines how column widths are calculated.\n * * `{ type: 'auto' }` - Renders a standard HTML table whose columns size to their content. No\n * column configuration is required.\n * * `{ type: 'grid'; columns: ColumnDefinition[] }` - Renders a CSS grid. The columns are then provided as\n * an array of objects with the following properties:\n * * `size` (number | { flex: number }) - A number sets a fixed pixel width; `{ flex }` gives the\n * column a weight that shares the remaining space in proportion. Omit it for a flexible column\n * with the default weight of 1.\n * * `minWidth` (number) - The minimum width in pixels for a flexible column. We recommend setting one;\n * without it the column can shrink until its content clips or overlaps at narrow widths.\n * * `maxWidth` (number) - Caps a flexible column's width in pixels (it grows up to the cap). A capped\n * column can't also carry a proportional `flex` weight, so weighting applies to the uncapped columns.\n *\n * Defaults to `{ type: 'auto' }`.\n */\n columnLayout?: TableRootProps.ColumnLayout;\n\n /** Provides an accessible name for the table. Use this or `ariaLabelledby` to label the table. */\n ariaLabel?: string;\n /** Sets the `aria-labelledby` attribute. Use the ID of a visible element that labels the table. */\n ariaLabelledby?: string;\n /** Sets the `aria-describedby` attribute. Use the ID of a visible element that describes the table. */\n ariaDescribedby?: string;\n\n /**\n * Sets the table's `aria-rowcount`, counting the header row. Provide it only when you render a\n * subset of rows, such as with virtualization; otherwise it is derived from the DOM.\n */\n ariaRowcount?: number;\n}\n\nexport namespace TableRootProps {\n export type ColumnLayout = { type: 'auto' } | { type: 'grid'; columns: ReadonlyArray<ColumnDefinition> };\n\n export type ColumnDefinition =\n | { size: number; minWidth?: never; maxWidth?: never }\n | { size: { flex: number }; minWidth?: number; maxWidth?: never }\n | { size?: never; minWidth?: number; maxWidth?: number };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/table-root/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../types/base-component';\n\n/**\n * A composable table. You render the head and rows as children, and TableRoot provides the column\n * layout and accessibility semantics.\n */\nexport interface TableRootProps extends BaseComponentProps {\n /**\n * The table's content. Provide a `TableHead` followed by a `TableBody` that contains the rows. When you\n * use `stickyHeader`, provide only the `TableBody` here.\n */\n children: React.ReactNode;\n\n /**\n * Determines how column widths are calculated.\n * * `{ type: 'auto' }` - Renders a standard HTML table whose columns size to their content. No\n * column configuration is required.\n * * `{ type: 'grid'; columns: ColumnDefinition[] }` - Renders a CSS grid. The columns are then provided as\n * an array of objects with the following properties:\n * * `size` (number | { flex: number }) - A number sets a fixed pixel width; `{ flex }` gives the\n * column a weight that shares the remaining space in proportion. Omit it for a flexible column\n * with the default weight of 1.\n * * `minWidth` (number) - The minimum width in pixels for a flexible column. We recommend setting one;\n * without it the column can shrink until its content clips or overlaps at narrow widths.\n * * `maxWidth` (number) - Caps a flexible column's width in pixels (it grows up to the cap). A capped\n * column can't also carry a proportional `flex` weight, so weighting applies to the uncapped columns.\n *\n * Defaults to `{ type: 'auto' }`.\n */\n columnLayout?: TableRootProps.ColumnLayout;\n\n /** Provides an accessible name for the table. Use this or `ariaLabelledby` to label the table. */\n ariaLabel?: string;\n /** Sets the `aria-labelledby` attribute. Use the ID of a visible element that labels the table. */\n ariaLabelledby?: string;\n /** Sets the `aria-describedby` attribute. Use the ID of a visible element that describes the table. */\n ariaDescribedby?: string;\n\n /**\n * Sets the table's `aria-rowcount`, counting the header row. Provide it only when you render a\n * subset of rows, such as with virtualization; otherwise it is derived from the DOM.\n */\n ariaRowcount?: number;\n\n /**\n * A `TableHead` that stays pinned to the top of its scroll container as the body scrolls. When you\n * provide it, render only the `TableBody` as `children`.\n *\n * The header is rendered twice, as the real header and a pinned copy, so use controlled state for any\n * controls in it.\n */\n stickyHeader?: React.ReactNode;\n\n /**\n * Specifies a vertical offset (in pixels) for the sticky header. For example, use this if you\n * need to position the sticky header below other fixed position elements on the page.\n */\n stickyHeaderVerticalOffset?: number;\n}\n\nexport namespace TableRootProps {\n export type ColumnLayout = { type: 'auto' } | { type: 'grid'; columns: ReadonlyArray<ColumnDefinition> };\n\n export type ColumnDefinition =\n | { size: number; minWidth?: never; maxWidth?: never }\n | { size: { flex: number }; minWidth?: number; maxWidth?: never }\n | { size?: never; minWidth?: number; maxWidth?: number };\n}\n"]}
|
package/table-root/internal.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/table-root/internal.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/table-root/internal.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAM9C,MAAM,WAAW,sBAAuB,SAAQ,cAAc,EAAE,0BAA0B;CAAG;AAW7F,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,YAA+B,EAC/B,YAAY,EACZ,SAAS,EACT,cAAc,EACd,eAAe,EACf,YAAY,EACZ,0BAA0B,EAC1B,QAAQ,EACR,iBAAiB,EACjB,GAAG,IAAI,EACR,EAAE,sBAAsB,eA2GxB"}
|
package/table-root/internal.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';
|
|
5
|
+
import { useMergeRefs, useResizeObserver } from '@cloudscape-design/component-toolkit/internal';
|
|
6
6
|
import { getBaseProps } from '../internal/base-component';
|
|
7
7
|
import { StickyScrollbar } from '../internal/components/sticky-scrollbar';
|
|
8
8
|
import { useScrollSync } from '../internal/hooks/use-scroll-sync';
|
|
9
9
|
import { TableContextProvider } from './context';
|
|
10
10
|
import { computeGridTemplateColumns } from './grid-template-columns';
|
|
11
|
+
import StickyHeaderSlot from './sticky-header-slot';
|
|
12
|
+
import { useTableRootStickyHeader } from './use-sticky-header';
|
|
11
13
|
import styles from './styles.css.js';
|
|
12
14
|
// In grid layout the rows overflow the table element, so the scroller, not the table, measures the
|
|
13
15
|
// scrollable width. scrollWidth is rounded to a whole pixel, so content that fits a fractional-width
|
|
@@ -17,7 +19,7 @@ function getScrollerContentInlineSize(_table, scroller) {
|
|
|
17
19
|
? scroller.scrollWidth
|
|
18
20
|
: scroller.getBoundingClientRect().width;
|
|
19
21
|
}
|
|
20
|
-
export default function InternalTableRoot({ columnLayout = { type: 'auto' }, ariaRowcount, ariaLabel, ariaLabelledby, ariaDescribedby, children, __internalRootRef, ...rest }) {
|
|
22
|
+
export default function InternalTableRoot({ columnLayout = { type: 'auto' }, ariaRowcount, ariaLabel, ariaLabelledby, ariaDescribedby, stickyHeader, stickyHeaderVerticalOffset, children, __internalRootRef, ...rest }) {
|
|
21
23
|
const isGrid = columnLayout.type === 'grid';
|
|
22
24
|
const gridTemplateColumns = computeGridTemplateColumns(columnLayout);
|
|
23
25
|
// Memoized because it is the TableContext value; a fresh object re-renders every cell. Both fields are
|
|
@@ -47,9 +49,17 @@ export default function InternalTableRoot({ columnLayout = { type: 'auto' }, ari
|
|
|
47
49
|
measureScrollable();
|
|
48
50
|
}
|
|
49
51
|
}, [isGrid, gridTemplateColumns, measureScrollable]);
|
|
50
|
-
const
|
|
52
|
+
const rootRef = useRef(null);
|
|
53
|
+
const mergedRootRef = useMergeRefs(rootRef, __internalRootRef);
|
|
54
|
+
const sticky = useTableRootStickyHeader({
|
|
55
|
+
enabled: !!stickyHeader,
|
|
56
|
+
verticalOffset: stickyHeaderVerticalOffset,
|
|
57
|
+
isGrid,
|
|
58
|
+
rootRef,
|
|
59
|
+
scrollerRef,
|
|
60
|
+
});
|
|
51
61
|
const scrollbarRef = useRef(null);
|
|
52
|
-
const handleScroll = useScrollSync([scrollerRef, scrollbarRef]);
|
|
62
|
+
const handleScroll = useScrollSync([scrollerRef, scrollbarRef, sticky.copyScrollerRef]);
|
|
53
63
|
// Set role="region" whenever scrollable (label passes through even if undefined), matching the
|
|
54
64
|
// existing Table's getTableWrapperRoleProps rather than gating the role on a label.
|
|
55
65
|
const scrollRegionProps = isScrollable
|
|
@@ -60,13 +70,15 @@ export default function InternalTableRoot({ columnLayout = { type: 'auto' }, ari
|
|
|
60
70
|
'aria-labelledby': ariaLabelledby,
|
|
61
71
|
}
|
|
62
72
|
: {};
|
|
63
|
-
return (React.createElement("div", { ...baseProps, className: clsx(baseProps.className, styles.root), ref:
|
|
73
|
+
return (React.createElement("div", { ...baseProps, className: clsx(baseProps.className, styles.root), ref: mergedRootRef },
|
|
64
74
|
React.createElement(TableContextProvider, { value: tableContext },
|
|
65
|
-
React.createElement(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
role:
|
|
70
|
-
|
|
75
|
+
sticky.isSticky && (React.createElement(StickyHeaderSlot, { slotRef: sticky.slotRef, copyScrollerRef: sticky.copyScrollerRef, copyTableRef: sticky.copyTableRef, onScroll: handleScroll, onFocus: sticky.onCopyFocus, isStuck: sticky.isStuck, isGrid: isGrid, style: sticky.stickyStyles.style }, stickyHeader)),
|
|
76
|
+
React.createElement("div", { className: styles['body-scroller'], ref: scrollerRef, onScroll: handleScroll, onFocus: sticky.onScrollerFocus, onBlur: sticky.onScrollerBlur, ...scrollRegionProps },
|
|
77
|
+
React.createElement("table", { ref: sticky.realTableRef,
|
|
78
|
+
// Without an explicit role, browsers guess whether a table holds data or is only for layout.
|
|
79
|
+
role: "table", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-rowcount": ariaRowcount, className: clsx(styles.table, isGrid ? styles['table-grid'] : styles['table-auto']) },
|
|
80
|
+
stickyHeader,
|
|
81
|
+
children)),
|
|
82
|
+
React.createElement(StickyScrollbar, { ref: scrollbarRef, wrapperRef: scrollerRef, tableRef: sticky.realTableRef, onScroll: handleScroll, getContentInlineSize: getScrollerContentInlineSize, contentKey: gridTemplateColumns }))));
|
|
71
83
|
}
|
|
72
84
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/table-root/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO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KAAM,iBAAiB;gBACtG,+BACE,GAAG,EAAE,QAAQ;oBACb,oFAAoF;oBACpF,4FAA4F;oBAC5F,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,gBACtB,SAAS,qBACJ,cAAc,sBACb,eAAe,mBAClB,YAAY,EAC3B,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAElF,QAAQ,CACH,CACJ;YACN,oBAAC,eAAe,IACd,GAAG,EAAE,YAAY,EACjB,UAAU,EAAE,WAAW,EACvB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,oBAAoB,EAAE,4BAA4B,EAClD,UAAU,EAAE,mBAAmB,GAC/B,CACmB,CACnB,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { StickyScrollbar } from '../internal/components/sticky-scrollbar';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useScrollSync } from '../internal/hooks/use-scroll-sync';\nimport { TableContextProvider } from './context';\nimport { computeGridTemplateColumns } from './grid-template-columns';\nimport { TableRootProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface InternalTableRootProps extends TableRootProps, InternalBaseComponentProps {}\n\n// In grid layout the rows overflow the table element, so the scroller, not the table, measures the\n// scrollable width. scrollWidth is rounded to a whole pixel, so content that fits a fractional-width\n// scroller reports the scroller's own width instead, using the same tolerance as measureScrollable.\nfunction getScrollerContentInlineSize(_table: HTMLElement, scroller: HTMLElement) {\n return scroller.scrollWidth - scroller.clientWidth > 1\n ? scroller.scrollWidth\n : scroller.getBoundingClientRect().width;\n}\n\nexport default function InternalTableRoot({\n columnLayout = { type: 'auto' },\n ariaRowcount,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n children,\n __internalRootRef,\n ...rest\n}: InternalTableRootProps) {\n const isGrid = columnLayout.type === 'grid';\n const gridTemplateColumns = computeGridTemplateColumns(columnLayout);\n // Memoized because it is the TableContext value; a fresh object re-renders every cell. Both fields are\n // primitives compared by value, so it stays stable even when the caller passes a fresh columnLayout.\n const tableContext = useMemo(() => ({ isGrid, gridTemplateColumns }), [isGrid, gridTemplateColumns]);\n const baseProps = getBaseProps(rest);\n\n // A wide table's horizontal scroller isn't keyboard-reachable on its own, so a read-only table with no\n // focusable cell content can't be scrolled by keyboard. When the content overflows, expose the scroller\n // as a focusable region so keyboard users can scroll it horizontally, matching the existing Table's\n // getTableWrapperRoleProps.\n const scrollerRef = useRef<HTMLDivElement>(null);\n const [isScrollable, setIsScrollable] = useState(false);\n const measureScrollable = useCallback(() => {\n const node = scrollerRef.current;\n if (node) {\n setIsScrollable(node.scrollWidth - node.clientWidth > 1);\n }\n }, []);\n // Observe the scroller and the table it wraps: a viewport resize changes the scroller box, and\n // auto-layout content growth changes the table box — either can start or stop the horizontal overflow.\n useResizeObserver(scrollerRef, measureScrollable);\n useResizeObserver(() => scrollerRef.current?.firstElementChild ?? null, measureScrollable);\n // Grid column templates change the tracks' overflow without resizing either observed box, so no observer\n // fires — re-measure when the template changes.\n useEffect(() => {\n if (isGrid) {\n measureScrollable();\n }\n }, [isGrid, gridTemplateColumns, measureScrollable]);\n\n const tableRef = useRef<HTMLTableElement>(null);\n const scrollbarRef = useRef<HTMLDivElement>(null);\n const handleScroll = useScrollSync([scrollerRef, scrollbarRef]);\n\n // Set role=\"region\" whenever scrollable (label passes through even if undefined), matching the\n // existing Table's getTableWrapperRoleProps rather than gating the role on a label.\n const scrollRegionProps = isScrollable\n ? {\n role: 'region' as const,\n tabIndex: 0,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n }\n : {};\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n {/* TableContext supplies this table's column layout to every part. */}\n <TableContextProvider value={tableContext}>\n {/* The page owns vertical scroll; this wrapper reintroduces an inline scroll viewport so a wide table scrolls horizontally instead of spilling out. */}\n <div className={styles['body-scroller']} ref={scrollerRef} onScroll={handleScroll} {...scrollRegionProps}>\n <table\n ref={tableRef}\n // Grid mode only: display:grid drops the table's implicit role. Auto mode keeps the\n // native role (an explicit role=\"table\" there is redundant and flagged by a11y validators).\n role={isGrid ? 'table' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-rowcount={ariaRowcount}\n className={clsx(styles.table, isGrid ? styles['table-grid'] : styles['table-auto'])}\n >\n {children}\n </table>\n </div>\n <StickyScrollbar\n ref={scrollbarRef}\n wrapperRef={scrollerRef}\n tableRef={tableRef}\n onScroll={handleScroll}\n getContentInlineSize={getScrollerContentInlineSize}\n contentKey={gridTemplateColumns}\n />\n </TableContextProvider>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/table-root/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAEhG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OA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U,EAAE,WAAW,EACvB,QAAQ,EAAE,MAAM,CAAC,YAAY,EAC7B,QAAQ,EAAE,YAAY,EACtB,oBAAoB,EAAE,4BAA4B,EAClD,UAAU,EAAE,mBAAmB,GAC/B,CACmB,CACnB,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { StickyScrollbar } from '../internal/components/sticky-scrollbar';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useScrollSync } from '../internal/hooks/use-scroll-sync';\nimport { TableContextProvider } from './context';\nimport { computeGridTemplateColumns } from './grid-template-columns';\nimport { TableRootProps } from './interfaces';\nimport StickyHeaderSlot from './sticky-header-slot';\nimport { useTableRootStickyHeader } from './use-sticky-header';\n\nimport styles from './styles.css.js';\n\nexport interface InternalTableRootProps extends TableRootProps, InternalBaseComponentProps {}\n\n// In grid layout the rows overflow the table element, so the scroller, not the table, measures the\n// scrollable width. scrollWidth is rounded to a whole pixel, so content that fits a fractional-width\n// scroller reports the scroller's own width instead, using the same tolerance as measureScrollable.\nfunction getScrollerContentInlineSize(_table: HTMLElement, scroller: HTMLElement) {\n return scroller.scrollWidth - scroller.clientWidth > 1\n ? scroller.scrollWidth\n : scroller.getBoundingClientRect().width;\n}\n\nexport default function InternalTableRoot({\n columnLayout = { type: 'auto' },\n ariaRowcount,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n stickyHeader,\n stickyHeaderVerticalOffset,\n children,\n __internalRootRef,\n ...rest\n}: InternalTableRootProps) {\n const isGrid = columnLayout.type === 'grid';\n const gridTemplateColumns = computeGridTemplateColumns(columnLayout);\n // Memoized because it is the TableContext value; a fresh object re-renders every cell. Both fields are\n // primitives compared by value, so it stays stable even when the caller passes a fresh columnLayout.\n const tableContext = useMemo(() => ({ isGrid, gridTemplateColumns }), [isGrid, gridTemplateColumns]);\n const baseProps = getBaseProps(rest);\n\n // A wide table's horizontal scroller isn't keyboard-reachable on its own, so a read-only table with no\n // focusable cell content can't be scrolled by keyboard. When the content overflows, expose the scroller\n // as a focusable region so keyboard users can scroll it horizontally, matching the existing Table's\n // getTableWrapperRoleProps.\n const scrollerRef = useRef<HTMLDivElement>(null);\n const [isScrollable, setIsScrollable] = useState(false);\n const measureScrollable = useCallback(() => {\n const node = scrollerRef.current;\n if (node) {\n setIsScrollable(node.scrollWidth - node.clientWidth > 1);\n }\n }, []);\n // Observe the scroller and the table it wraps: a viewport resize changes the scroller box, and\n // auto-layout content growth changes the table box — either can start or stop the horizontal overflow.\n useResizeObserver(scrollerRef, measureScrollable);\n useResizeObserver(() => scrollerRef.current?.firstElementChild ?? null, measureScrollable);\n // Grid column templates change the tracks' overflow without resizing either observed box, so no observer\n // fires — re-measure when the template changes.\n useEffect(() => {\n if (isGrid) {\n measureScrollable();\n }\n }, [isGrid, gridTemplateColumns, measureScrollable]);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const mergedRootRef = useMergeRefs(rootRef, __internalRootRef);\n const sticky = useTableRootStickyHeader({\n enabled: !!stickyHeader,\n verticalOffset: stickyHeaderVerticalOffset,\n isGrid,\n rootRef,\n scrollerRef,\n });\n const scrollbarRef = useRef<HTMLDivElement>(null);\n const handleScroll = useScrollSync([scrollerRef, scrollbarRef, sticky.copyScrollerRef]);\n\n // Set role=\"region\" whenever scrollable (label passes through even if undefined), matching the\n // existing Table's getTableWrapperRoleProps rather than gating the role on a label.\n const scrollRegionProps = isScrollable\n ? {\n role: 'region' as const,\n tabIndex: 0,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n }\n : {};\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={mergedRootRef}>\n {/* TableContext supplies this table's column layout to every part. */}\n <TableContextProvider value={tableContext}>\n {sticky.isSticky && (\n <StickyHeaderSlot\n slotRef={sticky.slotRef}\n copyScrollerRef={sticky.copyScrollerRef}\n copyTableRef={sticky.copyTableRef}\n onScroll={handleScroll}\n onFocus={sticky.onCopyFocus}\n isStuck={sticky.isStuck}\n isGrid={isGrid}\n style={sticky.stickyStyles.style}\n >\n {stickyHeader}\n </StickyHeaderSlot>\n )}\n {/* The page owns vertical scroll; this wrapper reintroduces an inline scroll viewport so a wide table scrolls horizontally instead of spilling out. */}\n <div\n className={styles['body-scroller']}\n ref={scrollerRef}\n onScroll={handleScroll}\n onFocus={sticky.onScrollerFocus}\n onBlur={sticky.onScrollerBlur}\n {...scrollRegionProps}\n >\n <table\n ref={sticky.realTableRef}\n // Without an explicit role, browsers guess whether a table holds data or is only for layout.\n role=\"table\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-rowcount={ariaRowcount}\n className={clsx(styles.table, isGrid ? styles['table-grid'] : styles['table-auto'])}\n >\n {stickyHeader}\n {children}\n </table>\n </div>\n <StickyScrollbar\n ref={scrollbarRef}\n wrapperRef={scrollerRef}\n tableRef={sticky.realTableRef}\n onScroll={handleScroll}\n getContentInlineSize={getScrollerContentInlineSize}\n contentKey={gridTemplateColumns}\n />\n </TableContextProvider>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface StickyHeaderSlotProps {
|
|
3
|
+
slotRef: React.Ref<HTMLDivElement>;
|
|
4
|
+
copyScrollerRef: React.Ref<HTMLDivElement>;
|
|
5
|
+
copyTableRef: React.Ref<HTMLTableElement>;
|
|
6
|
+
onScroll: React.UIEventHandler<HTMLDivElement>;
|
|
7
|
+
onFocus: React.FocusEventHandler<HTMLDivElement>;
|
|
8
|
+
isStuck: boolean;
|
|
9
|
+
isGrid: boolean;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export default function StickyHeaderSlot({
|
|
14
|
+
slotRef,
|
|
15
|
+
copyScrollerRef,
|
|
16
|
+
copyTableRef,
|
|
17
|
+
onScroll,
|
|
18
|
+
onFocus,
|
|
19
|
+
isStuck,
|
|
20
|
+
isGrid,
|
|
21
|
+
style,
|
|
22
|
+
children
|
|
23
|
+
}: StickyHeaderSlotProps): JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky-header-slot.d.ts","sourceRoot":"","sources":["../../../src/table-root/sticky-header-slot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,qBAAqB;IAC7B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACnC,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC3C,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC1C,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAID,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,QAAQ,GACT,EAAE,qBAAqB,eAoBvB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import styles from './styles.css.js';
|
|
6
|
+
// Hidden from assistive technology and the tab order, but clickable: it covers the real header. Focus that
|
|
7
|
+
// lands in it is moved to the real header.
|
|
8
|
+
export default function StickyHeaderSlot({ slotRef, copyScrollerRef, copyTableRef, onScroll, onFocus, isStuck, isGrid, style, children, }) {
|
|
9
|
+
return (React.createElement("div", { ref: slotRef, "aria-hidden": true, className: clsx(styles['sticky-slot'], isStuck && styles['sticky-slot-stuck']), style: style, onFocus: onFocus },
|
|
10
|
+
React.createElement("div", { className: styles['sticky-copy-scroller'], ref: copyScrollerRef, onScroll: onScroll, tabIndex: -1 },
|
|
11
|
+
React.createElement("table", { ref: copyTableRef, role: "table", className: clsx(styles.table, isGrid ? styles['table-grid'] : styles['table-copy-fixed']) }, children))));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=sticky-header-slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky-header-slot.js","sourceRoot":"","sources":["../../../src/table-root/sticky-header-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,2GAA2G;AAC3G,2CAA2C;AAC3C,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,QAAQ,GACc;IACtB,OAAO,CACL,6BACE,GAAG,EAAE,OAAO,iBACC,IAAI,EACjB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,OAAO,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC,EAC9E,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO;QAEhB,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;YACpG,+BACE,GAAG,EAAE,YAAY,EACjB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAExF,QAAQ,CACH,CACJ,CACF,CACP,CAAC;AACJ,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 styles from './styles.css.js';\n\ninterface StickyHeaderSlotProps {\n slotRef: React.Ref<HTMLDivElement>;\n copyScrollerRef: React.Ref<HTMLDivElement>;\n copyTableRef: React.Ref<HTMLTableElement>;\n onScroll: React.UIEventHandler<HTMLDivElement>;\n onFocus: React.FocusEventHandler<HTMLDivElement>;\n isStuck: boolean;\n isGrid: boolean;\n style?: React.CSSProperties;\n children: React.ReactNode;\n}\n\n// Hidden from assistive technology and the tab order, but clickable: it covers the real header. Focus that\n// lands in it is moved to the real header.\nexport default function StickyHeaderSlot({\n slotRef,\n copyScrollerRef,\n copyTableRef,\n onScroll,\n onFocus,\n isStuck,\n isGrid,\n style,\n children,\n}: StickyHeaderSlotProps) {\n return (\n <div\n ref={slotRef}\n aria-hidden={true}\n className={clsx(styles['sticky-slot'], isStuck && styles['sticky-slot-stuck'])}\n style={style}\n onFocus={onFocus}\n >\n <div className={styles['sticky-copy-scroller']} ref={copyScrollerRef} onScroll={onScroll} tabIndex={-1}>\n <table\n ref={copyTableRef}\n role=\"table\"\n className={clsx(styles.table, isGrid ? styles['table-grid'] : styles['table-copy-fixed'])}\n >\n {children}\n </table>\n </div>\n </div>\n );\n}\n"]}
|
package/table-root/styles.css.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"body-scroller": "awsui_body-
|
|
6
|
-
"table": "
|
|
7
|
-
"table-auto": "awsui_table-
|
|
8
|
-
"table-grid": "awsui_table-
|
|
4
|
+
"root": "awsui_root_1pkvc_fhcug_9",
|
|
5
|
+
"body-scroller": "awsui_body-scroller_1pkvc_fhcug_46",
|
|
6
|
+
"table": "awsui_table_1pkvc_fhcug_63",
|
|
7
|
+
"table-auto": "awsui_table-auto_1pkvc_fhcug_69",
|
|
8
|
+
"table-grid": "awsui_table-grid_1pkvc_fhcug_73",
|
|
9
|
+
"table-copy-fixed": "awsui_table-copy-fixed_1pkvc_fhcug_77",
|
|
10
|
+
"sticky-slot": "awsui_sticky-slot_1pkvc_fhcug_81",
|
|
11
|
+
"sticky-slot-stuck": "awsui_sticky-slot-stuck_1pkvc_fhcug_88",
|
|
12
|
+
"sticky-copy-scroller": "awsui_sticky-copy-scroller_1pkvc_fhcug_92",
|
|
13
|
+
"sticky-copy-focus": "awsui_sticky-copy-focus_1pkvc_fhcug_100"
|
|
9
14
|
};
|
|
10
15
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
7
7
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
8
8
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
9
|
-
.
|
|
9
|
+
.awsui_root_1pkvc_fhcug_9:not(#\9) {
|
|
10
10
|
border-collapse: separate;
|
|
11
11
|
border-spacing: 0;
|
|
12
12
|
box-sizing: border-box;
|
|
@@ -43,14 +43,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
43
43
|
background: var(--color-background-container-content-0odjoo, #ffffff);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.awsui_body-
|
|
46
|
+
.awsui_body-scroller_1pkvc_fhcug_46:not(#\9) {
|
|
47
47
|
overflow-x: auto;
|
|
48
48
|
scrollbar-width: none; /* Firefox */
|
|
49
49
|
}
|
|
50
|
-
.awsui_body-
|
|
50
|
+
.awsui_body-scroller_1pkvc_fhcug_46:not(#\9)::-webkit-scrollbar {
|
|
51
51
|
display: none; /* Safari and Chrome */
|
|
52
52
|
}
|
|
53
|
-
body[data-awsui-focus-visible=true] .awsui_body-
|
|
53
|
+
body[data-awsui-focus-visible=true] .awsui_body-scroller_1pkvc_fhcug_46:not(#\9):focus {
|
|
54
54
|
outline: 2px dotted transparent;
|
|
55
55
|
outline-offset: 2px;
|
|
56
56
|
border-start-start-radius: var(--border-radius-container-cjce5i, 16px);
|
|
@@ -60,16 +60,61 @@ body[data-awsui-focus-visible=true] .awsui_body-scroller_1pkvc_abtwi_46:not(#\9)
|
|
|
60
60
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-sb1fs0, #006ce0);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.
|
|
63
|
+
.awsui_table_1pkvc_fhcug_63:not(#\9) {
|
|
64
64
|
inline-size: 100%;
|
|
65
65
|
border-collapse: separate;
|
|
66
66
|
border-spacing: 0;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.awsui_table-
|
|
69
|
+
.awsui_table-auto_1pkvc_fhcug_69:not(#\9) {
|
|
70
70
|
table-layout: auto;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.awsui_table-
|
|
73
|
+
.awsui_table-grid_1pkvc_fhcug_73:not(#\9) {
|
|
74
74
|
display: block;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.awsui_table-copy-fixed_1pkvc_fhcug_77:not(#\9) {
|
|
78
|
+
table-layout: fixed;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.awsui_sticky-slot_1pkvc_fhcug_81:not(#\9) {
|
|
82
|
+
position: sticky;
|
|
83
|
+
inset-block-start: 0;
|
|
84
|
+
z-index: 800;
|
|
85
|
+
background: var(--color-background-table-header-dbczmh, #ffffff);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.awsui_sticky-slot-stuck_1pkvc_fhcug_88:not(#\9) {
|
|
89
|
+
box-shadow: var(--shadow-sticky-embedded-4e1jeb, 0px 2px 0px 0px #e9ebed, 0px 16px 16px -12px rgba(0, 7, 22, 0.1));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.awsui_sticky-copy-scroller_1pkvc_fhcug_92:not(#\9) {
|
|
93
|
+
overflow: auto;
|
|
94
|
+
scrollbar-width: none; /* Firefox */
|
|
95
|
+
}
|
|
96
|
+
.awsui_sticky-copy-scroller_1pkvc_fhcug_92:not(#\9)::-webkit-scrollbar {
|
|
97
|
+
display: none; /* Safari and Chrome */
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
body[data-awsui-focus-visible=true] .awsui_sticky-copy-focus_1pkvc_fhcug_100:not(#\9) {
|
|
101
|
+
position: relative;
|
|
102
|
+
}
|
|
103
|
+
body[data-awsui-focus-visible=true] .awsui_sticky-copy-focus_1pkvc_fhcug_100:not(#\9) {
|
|
104
|
+
outline: 2px dotted transparent;
|
|
105
|
+
outline-offset: calc(var(--space-none-9jj7fe, 0px) - 1px);
|
|
106
|
+
}
|
|
107
|
+
body[data-awsui-focus-visible=true] .awsui_sticky-copy-focus_1pkvc_fhcug_100:not(#\9)::before {
|
|
108
|
+
content: " ";
|
|
109
|
+
display: block;
|
|
110
|
+
position: absolute;
|
|
111
|
+
inset-inline-start: calc(-1 * var(--space-none-9jj7fe, 0px));
|
|
112
|
+
inset-block-start: calc(-1 * var(--space-none-9jj7fe, 0px));
|
|
113
|
+
inline-size: calc(100% + var(--space-none-9jj7fe, 0px) + var(--space-none-9jj7fe, 0px));
|
|
114
|
+
block-size: calc(100% + var(--space-none-9jj7fe, 0px) + var(--space-none-9jj7fe, 0px));
|
|
115
|
+
border-start-start-radius: var(--border-radius-control-default-focus-ring-hkazgq, 4px);
|
|
116
|
+
border-start-end-radius: var(--border-radius-control-default-focus-ring-hkazgq, 4px);
|
|
117
|
+
border-end-start-radius: var(--border-radius-control-default-focus-ring-hkazgq, 4px);
|
|
118
|
+
border-end-end-radius: var(--border-radius-control-default-focus-ring-hkazgq, 4px);
|
|
119
|
+
box-shadow: 0 0 0 2px var(--color-border-item-focused-sb1fs0, #006ce0);
|
|
75
120
|
}
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"body-scroller": "awsui_body-
|
|
7
|
-
"table": "
|
|
8
|
-
"table-auto": "awsui_table-
|
|
9
|
-
"table-grid": "awsui_table-
|
|
5
|
+
"root": "awsui_root_1pkvc_fhcug_9",
|
|
6
|
+
"body-scroller": "awsui_body-scroller_1pkvc_fhcug_46",
|
|
7
|
+
"table": "awsui_table_1pkvc_fhcug_63",
|
|
8
|
+
"table-auto": "awsui_table-auto_1pkvc_fhcug_69",
|
|
9
|
+
"table-grid": "awsui_table-grid_1pkvc_fhcug_73",
|
|
10
|
+
"table-copy-fixed": "awsui_table-copy-fixed_1pkvc_fhcug_77",
|
|
11
|
+
"sticky-slot": "awsui_sticky-slot_1pkvc_fhcug_81",
|
|
12
|
+
"sticky-slot-stuck": "awsui_sticky-slot-stuck_1pkvc_fhcug_88",
|
|
13
|
+
"sticky-copy-scroller": "awsui_sticky-copy-scroller_1pkvc_fhcug_92",
|
|
14
|
+
"sticky-copy-focus": "awsui_sticky-copy-focus_1pkvc_fhcug_100"
|
|
10
15
|
};
|
|
11
16
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
interface UseTableRootStickyHeaderProps {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
verticalOffset?: number;
|
|
5
|
+
isGrid: boolean;
|
|
6
|
+
rootRef: RefObject<HTMLElement>;
|
|
7
|
+
scrollerRef: RefObject<HTMLElement>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useTableRootStickyHeader({
|
|
10
|
+
enabled,
|
|
11
|
+
verticalOffset,
|
|
12
|
+
isGrid,
|
|
13
|
+
rootRef,
|
|
14
|
+
scrollerRef
|
|
15
|
+
}: UseTableRootStickyHeaderProps): {
|
|
16
|
+
isSticky: boolean;
|
|
17
|
+
isStuck: boolean;
|
|
18
|
+
stickyStyles: {
|
|
19
|
+
style: {
|
|
20
|
+
top: string;
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
style?: undefined;
|
|
24
|
+
};
|
|
25
|
+
slotRef: React.RefObject<HTMLDivElement>;
|
|
26
|
+
copyScrollerRef: React.RefObject<HTMLDivElement>;
|
|
27
|
+
realTableRef: React.RefObject<HTMLTableElement>;
|
|
28
|
+
copyTableRef: React.RefObject<HTMLTableElement>;
|
|
29
|
+
onCopyFocus: (event: React.FocusEvent) => void;
|
|
30
|
+
onScrollerFocus: (event: React.FocusEvent) => void;
|
|
31
|
+
onScrollerBlur: () => void;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-header.d.ts","sourceRoot":"","sources":["../../../src/table-root/use-sticky-header.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAkD,MAAM,OAAO,CAAC;AAYzF,UAAU,6BAA6B;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACrC;AAkBD,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,cAAc,EACd,MAAM,EACN,OAAO,EACP,WAAW,GACZ,EAAE,6BAA6B;;;;;;;;;;;;;;yBAiEF,KAAK,CAAC,UAAU;6BA8BZ,KAAK,CAAC,UAAU;;EA+BjD"}
|