@cloudscape-design/components-themeable 3.0.327 → 3.0.329
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/app-layout/styles.scss +26 -0
- package/lib/internal/scss/app-layout/visual-refresh/drawers.scss +17 -13
- package/lib/internal/scss/expandable-section/styles.scss +14 -9
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +39 -39
- package/lib/internal/scss/split-panel/styles.scss +0 -18
- package/lib/internal/scss/table/sticky-scrollbar/styles.scss +26 -0
- package/lib/internal/scss/table/styles.scss +0 -22
- package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +30 -30
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
- package/lib/internal/template/app-layout/drawer/interfaces.d.ts +0 -7
- package/lib/internal/template/app-layout/drawer/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/resizable-drawer.js +3 -3
- package/lib/internal/template/app-layout/drawer/resizable-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/index.js +19 -2
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
- package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/runtime-api.d.ts +8 -0
- package/lib/internal/template/app-layout/runtime-api.d.ts.map +1 -0
- package/lib/internal/template/app-layout/runtime-api.js +35 -0
- package/lib/internal/template/app-layout/runtime-api.js.map +1 -0
- package/lib/internal/template/app-layout/styles.css.js +17 -13
- package/lib/internal/template/app-layout/styles.scoped.css +44 -13
- package/lib/internal/template/app-layout/styles.selectors.js +17 -13
- package/lib/internal/template/app-layout/utils/interfaces.d.ts +10 -0
- package/lib/internal/template/app-layout/utils/interfaces.d.ts.map +1 -0
- package/lib/internal/template/app-layout/utils/interfaces.js +2 -0
- package/lib/internal/template/app-layout/utils/interfaces.js.map +1 -0
- package/lib/internal/template/app-layout/utils/use-drawer-focus-control.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-drawer-focus-control.js +8 -3
- package/lib/internal/template/app-layout/utils/use-drawer-focus-control.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-keyboard-events.d.ts +4 -0
- package/lib/internal/template/app-layout/utils/use-keyboard-events.d.ts.map +1 -0
- package/lib/internal/template/{split-panel → app-layout}/utils/use-keyboard-events.js +10 -11
- package/lib/internal/template/app-layout/utils/use-keyboard-events.js.map +1 -0
- package/lib/internal/template/app-layout/utils/use-pointer-events.d.ts +3 -0
- package/lib/internal/template/app-layout/utils/use-pointer-events.d.ts.map +1 -0
- package/lib/internal/template/{split-panel → app-layout}/utils/use-pointer-events.js +15 -8
- package/lib/internal/template/app-layout/utils/use-pointer-events.js.map +1 -0
- package/lib/internal/template/app-layout/utils/use-resize.d.ts +16 -0
- package/lib/internal/template/app-layout/utils/use-resize.d.ts.map +1 -0
- package/lib/internal/template/app-layout/utils/use-resize.js +84 -0
- package/lib/internal/template/app-layout/utils/use-resize.js.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh/context.d.ts +11 -6
- package/lib/internal/template/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/context.js +26 -7
- package/lib/internal/template/app-layout/visual-refresh/context.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts +1 -33
- package/lib/internal/template/app-layout/visual-refresh/drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/drawers.js +14 -7
- package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +69 -68
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +294 -298
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +69 -68
- package/lib/internal/template/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/trigger-button.js +1 -2
- package/lib/internal/template/app-layout/visual-refresh/trigger-button.js.map +1 -1
- package/lib/internal/template/area-chart/{model/async-store.d.ts → async-store/index.d.ts} +1 -1
- package/lib/internal/template/area-chart/async-store/index.d.ts.map +1 -0
- package/lib/internal/template/area-chart/{model/async-store.js → async-store/index.js} +1 -1
- package/lib/internal/template/area-chart/async-store/index.js.map +1 -0
- package/lib/internal/template/area-chart/elements/area-chart-legend.d.ts.map +1 -1
- package/lib/internal/template/area-chart/elements/area-chart-legend.js +1 -1
- package/lib/internal/template/area-chart/elements/area-chart-legend.js.map +1 -1
- package/lib/internal/template/area-chart/elements/data-series.js +1 -1
- package/lib/internal/template/area-chart/elements/data-series.js.map +1 -1
- package/lib/internal/template/area-chart/elements/highlighted-point.js +1 -1
- package/lib/internal/template/area-chart/elements/highlighted-point.js.map +1 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.d.ts.map +1 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.js +3 -1
- package/lib/internal/template/area-chart/elements/use-highlight-details.js.map +1 -1
- package/lib/internal/template/area-chart/elements/vertical-marker.js +1 -1
- package/lib/internal/template/area-chart/elements/vertical-marker.js.map +1 -1
- package/lib/internal/template/area-chart/model/index.d.ts +1 -1
- package/lib/internal/template/area-chart/model/index.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/index.js.map +1 -1
- package/lib/internal/template/area-chart/model/interactions-store.d.ts +1 -1
- package/lib/internal/template/area-chart/model/interactions-store.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/interactions-store.js +1 -1
- package/lib/internal/template/area-chart/model/interactions-store.js.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.js +1 -1
- package/lib/internal/template/area-chart/model/use-chart-model.js.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.d.ts +1 -1
- package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
- package/lib/internal/template/content-layout/styles.css.js +7 -7
- package/lib/internal/template/content-layout/styles.scoped.css +13 -13
- package/lib/internal/template/content-layout/styles.selectors.js +7 -7
- package/lib/internal/template/expandable-section/expandable-section-header.d.ts.map +1 -1
- package/lib/internal/template/expandable-section/expandable-section-header.js +10 -10
- package/lib/internal/template/expandable-section/expandable-section-header.js.map +1 -1
- package/lib/internal/template/expandable-section/interfaces.d.ts +1 -1
- package/lib/internal/template/expandable-section/interfaces.js.map +1 -1
- package/lib/internal/template/expandable-section/styles.css.js +31 -29
- package/lib/internal/template/expandable-section/styles.scoped.css +56 -51
- package/lib/internal/template/expandable-section/styles.selectors.js +31 -29
- package/lib/internal/template/expandable-section/utils.js +1 -1
- package/lib/internal/template/expandable-section/utils.js.map +1 -1
- package/lib/internal/template/flashbar/styles.css.js +45 -45
- package/lib/internal/template/flashbar/styles.scoped.css +169 -169
- package/lib/internal/template/flashbar/styles.selectors.js +45 -45
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/generated/custom-css-properties/index.js +39 -39
- package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
- package/lib/internal/template/internal/plugins/api.d.ts +15 -0
- package/lib/internal/template/internal/plugins/api.d.ts.map +1 -0
- package/lib/internal/template/internal/plugins/api.js +50 -0
- package/lib/internal/template/internal/plugins/api.js.map +1 -0
- package/lib/internal/template/internal/plugins/drawers-controller.d.ts +22 -0
- package/lib/internal/template/internal/plugins/drawers-controller.d.ts.map +1 -0
- package/lib/internal/template/internal/plugins/drawers-controller.js +34 -0
- package/lib/internal/template/internal/plugins/drawers-controller.js.map +1 -0
- package/lib/internal/template/internal/plugins/index.d.ts +2 -0
- package/lib/internal/template/internal/plugins/index.d.ts.map +1 -0
- package/lib/internal/template/internal/plugins/index.js +4 -0
- package/lib/internal/template/internal/plugins/index.js.map +1 -0
- package/lib/internal/template/mixed-line-bar-chart/data-series.d.ts.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/data-series.js +8 -2
- package/lib/internal/template/mixed-line-bar-chart/data-series.js.map +1 -1
- package/lib/internal/template/split-panel/index.d.ts.map +1 -1
- package/lib/internal/template/split-panel/index.js +3 -3
- package/lib/internal/template/split-panel/index.js.map +1 -1
- package/lib/internal/template/split-panel/interfaces.d.ts +0 -7
- package/lib/internal/template/split-panel/interfaces.d.ts.map +1 -1
- package/lib/internal/template/split-panel/interfaces.js.map +1 -1
- package/lib/internal/template/split-panel/styles.css.js +56 -59
- package/lib/internal/template/split-panel/styles.scoped.css +77 -93
- package/lib/internal/template/split-panel/styles.selectors.js +56 -59
- package/lib/internal/template/table/body-cell/td-element.d.ts +2 -2
- package/lib/internal/template/table/body-cell/td-element.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/td-element.js +2 -2
- package/lib/internal/template/table/body-cell/td-element.js.map +1 -1
- package/lib/internal/template/table/column-widths-utils.d.ts +3 -0
- package/lib/internal/template/table/column-widths-utils.d.ts.map +1 -0
- package/lib/internal/template/table/column-widths-utils.js +16 -0
- package/lib/internal/template/table/column-widths-utils.js.map +1 -0
- package/lib/internal/template/table/header-cell/index.d.ts +3 -3
- package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/index.js +2 -2
- package/lib/internal/template/table/header-cell/index.js.map +1 -1
- package/lib/internal/template/table/internal.d.ts.map +1 -1
- package/lib/internal/template/table/internal.js +15 -10
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/table/resizer/index.d.ts.map +1 -1
- package/lib/internal/template/table/resizer/index.js +2 -2
- package/lib/internal/template/table/resizer/index.js.map +1 -1
- package/lib/internal/template/table/sticky-columns/index.d.ts +2 -0
- package/lib/internal/template/table/sticky-columns/index.d.ts.map +1 -0
- package/lib/internal/template/table/sticky-columns/index.js +4 -0
- package/lib/internal/template/table/sticky-columns/index.js.map +1 -0
- package/lib/internal/template/table/{use-sticky-columns.d.ts → sticky-columns/use-sticky-columns.d.ts} +7 -9
- package/lib/internal/template/table/sticky-columns/use-sticky-columns.d.ts.map +1 -0
- package/lib/internal/template/table/{use-sticky-columns.js → sticky-columns/use-sticky-columns.js} +3 -4
- package/lib/internal/template/table/sticky-columns/use-sticky-columns.js.map +1 -0
- package/lib/internal/template/table/sticky-scrollbar/index.d.ts +2 -0
- package/lib/internal/template/table/sticky-scrollbar/index.d.ts.map +1 -0
- package/lib/internal/template/table/sticky-scrollbar/index.js +4 -0
- package/lib/internal/template/table/sticky-scrollbar/index.js.map +1 -0
- package/lib/internal/template/table/sticky-scrollbar/sticky-scrollbar.d.ts.map +1 -0
- package/lib/internal/template/table/{sticky-scrollbar.js → sticky-scrollbar/sticky-scrollbar.js} +2 -2
- package/lib/internal/template/table/sticky-scrollbar/sticky-scrollbar.js.map +1 -0
- package/lib/internal/template/table/sticky-scrollbar/styles.css.js +9 -0
- package/lib/internal/template/table/sticky-scrollbar/styles.scoped.css +22 -0
- package/lib/internal/template/table/sticky-scrollbar/styles.selectors.js +10 -0
- package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +1 -0
- package/lib/internal/template/table/{use-sticky-scrollbar.js → sticky-scrollbar/use-sticky-scrollbar.js} +3 -3
- package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.js.map +1 -0
- package/lib/internal/template/table/styles.css.js +32 -36
- package/lib/internal/template/table/styles.scoped.css +40 -59
- package/lib/internal/template/table/styles.selectors.js +32 -36
- package/lib/internal/template/table/thead.d.ts +2 -1
- package/lib/internal/template/table/thead.d.ts.map +1 -1
- package/lib/internal/template/table/thead.js +4 -4
- package/lib/internal/template/table/thead.js.map +1 -1
- package/lib/internal/template/table/use-column-widths.d.ts +10 -8
- package/lib/internal/template/table/use-column-widths.d.ts.map +1 -1
- package/lib/internal/template/table/use-column-widths.js +30 -47
- package/lib/internal/template/table/use-column-widths.js.map +1 -1
- package/lib/internal/template/table/utils.d.ts +1 -1
- package/lib/internal/template/table/utils.d.ts.map +1 -1
- package/lib/internal/template/table/utils.js.map +1 -1
- package/lib/internal/template/test-utils/dom/app-layout/index.d.ts +1 -1
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/lib/internal/template/wizard/styles.css.js +31 -31
- package/lib/internal/template/wizard/styles.scoped.css +63 -63
- package/lib/internal/template/wizard/styles.selectors.js +31 -31
- package/lib/internal/template-tokens/package.json +9 -0
- package/lib/theming.d.ts +9 -0
- package/lib/theming.d.ts.map +1 -0
- package/lib/theming.js +26 -0
- package/lib/theming.js.map +1 -0
- package/package.json +1 -1
- package/lib/internal/template/area-chart/model/async-store.d.ts.map +0 -1
- package/lib/internal/template/area-chart/model/async-store.js.map +0 -1
- package/lib/internal/template/split-panel/utils/use-keyboard-events.d.ts +0 -4
- package/lib/internal/template/split-panel/utils/use-keyboard-events.d.ts.map +0 -1
- package/lib/internal/template/split-panel/utils/use-keyboard-events.js.map +0 -1
- package/lib/internal/template/split-panel/utils/use-pointer-events.d.ts +0 -3
- package/lib/internal/template/split-panel/utils/use-pointer-events.d.ts.map +0 -1
- package/lib/internal/template/split-panel/utils/use-pointer-events.js.map +0 -1
- package/lib/internal/template/table/sticky-scrollbar.d.ts.map +0 -1
- package/lib/internal/template/table/sticky-scrollbar.js.map +0 -1
- package/lib/internal/template/table/use-sticky-columns.d.ts.map +0 -1
- package/lib/internal/template/table/use-sticky-columns.js.map +0 -1
- package/lib/internal/template/table/use-sticky-scrollbar.d.ts.map +0 -1
- package/lib/internal/template/table/use-sticky-scrollbar.js.map +0 -1
- /package/lib/internal/template/table/{sticky-scrollbar.d.ts → sticky-scrollbar/sticky-scrollbar.d.ts} +0 -0
- /package/lib/internal/template/table/{use-sticky-scrollbar.d.ts → sticky-scrollbar/use-sticky-scrollbar.d.ts} +0 -0
|
@@ -2,64 +2,61 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"drawer": "
|
|
6
|
-
"refresh": "
|
|
7
|
-
"animating": "
|
|
8
|
-
"preference-icon--layout-border": "awsui_preference-icon--layout-
|
|
9
|
-
"preference-icon--layout-background": "awsui_preference-icon--layout-
|
|
10
|
-
"preference-icon--layout-header": "awsui_preference-icon--layout-
|
|
11
|
-
"preference-icon--border": "awsui_preference-icon--
|
|
12
|
-
"preference-icon--primary-button": "awsui_preference-icon--primary-
|
|
13
|
-
"preference-icon--secondary": "awsui_preference-icon--
|
|
14
|
-
"preference-icon--disabled-element": "awsui_preference-icon--disabled-
|
|
15
|
-
"preference-icon--separator": "awsui_preference-icon--
|
|
16
|
-
"preference-icon--focus-text": "awsui_preference-icon--focus-
|
|
17
|
-
"preference-icon-refresh--layout-top": "awsui_preference-icon-refresh--layout-
|
|
18
|
-
"preference-icon-refresh--layout-main": "awsui_preference-icon-refresh--layout-
|
|
19
|
-
"preference-icon-refresh--primary": "awsui_preference-icon-refresh--
|
|
20
|
-
"preference-icon-refresh--disabled": "awsui_preference-icon-refresh--
|
|
21
|
-
"preference-icon-refresh--column-header": "awsui_preference-icon-refresh--column-
|
|
22
|
-
"preference-icon-refresh--window": "awsui_preference-icon-refresh--
|
|
23
|
-
"preference-icon-refresh--secondary": "awsui_preference-icon-refresh--
|
|
24
|
-
"preference-icon-refresh--default": "awsui_preference-icon-refresh--
|
|
25
|
-
"preference-icon-refresh--separator": "awsui_preference-icon-refresh--
|
|
26
|
-
"preference-icon-refresh--input-default": "awsui_preference-icon-refresh--input-
|
|
27
|
-
"preference-icon-refresh--heading": "awsui_preference-icon-refresh--
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"slider": "
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"slider-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"content-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"pane-
|
|
55
|
-
"content-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"header": "
|
|
60
|
-
"
|
|
61
|
-
"header-divider": "awsui_header-divider_1r9lg_1di9l_571",
|
|
62
|
-
"header-actions": "awsui_header-actions_1r9lg_1di9l_577",
|
|
63
|
-
"divider": "awsui_divider_1r9lg_1di9l_585"
|
|
5
|
+
"drawer": "awsui_drawer_1r9lg_1xljr_189",
|
|
6
|
+
"refresh": "awsui_refresh_1r9lg_1xljr_189",
|
|
7
|
+
"animating": "awsui_animating_1r9lg_1xljr_203",
|
|
8
|
+
"preference-icon--layout-border": "awsui_preference-icon--layout-border_1r9lg_1xljr_226",
|
|
9
|
+
"preference-icon--layout-background": "awsui_preference-icon--layout-background_1r9lg_1xljr_230",
|
|
10
|
+
"preference-icon--layout-header": "awsui_preference-icon--layout-header_1r9lg_1xljr_233",
|
|
11
|
+
"preference-icon--border": "awsui_preference-icon--border_1r9lg_1xljr_236",
|
|
12
|
+
"preference-icon--primary-button": "awsui_preference-icon--primary-button_1r9lg_1xljr_240",
|
|
13
|
+
"preference-icon--secondary": "awsui_preference-icon--secondary_1r9lg_1xljr_243",
|
|
14
|
+
"preference-icon--disabled-element": "awsui_preference-icon--disabled-element_1r9lg_1xljr_246",
|
|
15
|
+
"preference-icon--separator": "awsui_preference-icon--separator_1r9lg_1xljr_249",
|
|
16
|
+
"preference-icon--focus-text": "awsui_preference-icon--focus-text_1r9lg_1xljr_252",
|
|
17
|
+
"preference-icon-refresh--layout-top": "awsui_preference-icon-refresh--layout-top_1r9lg_1xljr_256",
|
|
18
|
+
"preference-icon-refresh--layout-main": "awsui_preference-icon-refresh--layout-main_1r9lg_1xljr_259",
|
|
19
|
+
"preference-icon-refresh--primary": "awsui_preference-icon-refresh--primary_1r9lg_1xljr_262",
|
|
20
|
+
"preference-icon-refresh--disabled": "awsui_preference-icon-refresh--disabled_1r9lg_1xljr_265",
|
|
21
|
+
"preference-icon-refresh--column-header": "awsui_preference-icon-refresh--column-header_1r9lg_1xljr_268",
|
|
22
|
+
"preference-icon-refresh--window": "awsui_preference-icon-refresh--window_1r9lg_1xljr_271",
|
|
23
|
+
"preference-icon-refresh--secondary": "awsui_preference-icon-refresh--secondary_1r9lg_1xljr_275",
|
|
24
|
+
"preference-icon-refresh--default": "awsui_preference-icon-refresh--default_1r9lg_1xljr_278",
|
|
25
|
+
"preference-icon-refresh--separator": "awsui_preference-icon-refresh--separator_1r9lg_1xljr_281",
|
|
26
|
+
"preference-icon-refresh--input-default": "awsui_preference-icon-refresh--input-default_1r9lg_1xljr_284",
|
|
27
|
+
"preference-icon-refresh--heading": "awsui_preference-icon-refresh--heading_1r9lg_1xljr_287",
|
|
28
|
+
"root": "awsui_root_1r9lg_1xljr_291",
|
|
29
|
+
"preferences-button": "awsui_preferences-button_1r9lg_1xljr_304",
|
|
30
|
+
"close-button": "awsui_close-button_1r9lg_1xljr_308",
|
|
31
|
+
"drawer-closed": "awsui_drawer-closed_1r9lg_1xljr_319",
|
|
32
|
+
"drawer-content-side": "awsui_drawer-content-side_1r9lg_1xljr_324",
|
|
33
|
+
"drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_1xljr_344",
|
|
34
|
+
"position-bottom": "awsui_position-bottom_1r9lg_1xljr_353",
|
|
35
|
+
"position-side": "awsui_position-side_1r9lg_1xljr_380",
|
|
36
|
+
"slider": "awsui_slider_1r9lg_1xljr_386",
|
|
37
|
+
"slider-side": "awsui_slider-side_1r9lg_1xljr_415",
|
|
38
|
+
"slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_1xljr_420",
|
|
39
|
+
"slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_1xljr_431",
|
|
40
|
+
"open-button": "awsui_open-button_1r9lg_1xljr_442",
|
|
41
|
+
"open-button-side": "awsui_open-button-side_1r9lg_1xljr_446",
|
|
42
|
+
"slider-icon": "awsui_slider-icon_1r9lg_1xljr_453",
|
|
43
|
+
"slider-icon-bottom": "awsui_slider-icon-bottom_1r9lg_1xljr_459",
|
|
44
|
+
"slider-icon-side": "awsui_slider-icon-side_1r9lg_1xljr_462",
|
|
45
|
+
"pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_1xljr_466",
|
|
46
|
+
"drawer-mobile": "awsui_drawer-mobile_1r9lg_1xljr_476",
|
|
47
|
+
"drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_1xljr_479",
|
|
48
|
+
"content-bottom": "awsui_content-bottom_1r9lg_1xljr_487",
|
|
49
|
+
"pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_1xljr_500",
|
|
50
|
+
"pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_1xljr_505",
|
|
51
|
+
"pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_1xljr_509",
|
|
52
|
+
"content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_1xljr_513",
|
|
53
|
+
"content-side": "awsui_content-side_1r9lg_1xljr_518",
|
|
54
|
+
"pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_1xljr_529",
|
|
55
|
+
"pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_1xljr_532",
|
|
56
|
+
"header": "awsui_header_1r9lg_1xljr_537",
|
|
57
|
+
"header-text": "awsui_header-text_1r9lg_1xljr_546",
|
|
58
|
+
"header-divider": "awsui_header-divider_1r9lg_1xljr_556",
|
|
59
|
+
"header-actions": "awsui_header-actions_1r9lg_1xljr_562",
|
|
60
|
+
"divider": "awsui_divider_1r9lg_1xljr_570"
|
|
64
61
|
};
|
|
65
62
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StickyColumnsModel } from '../use-sticky-columns';
|
|
2
|
+
import { StickyColumnsModel } from '../sticky-columns/use-sticky-columns.js';
|
|
3
3
|
export interface TableTdElementProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
@@ -19,7 +19,7 @@ export interface TableTdElementProps {
|
|
|
19
19
|
stripedRows?: boolean;
|
|
20
20
|
hasSelection?: boolean;
|
|
21
21
|
hasFooter?: boolean;
|
|
22
|
-
columnId:
|
|
22
|
+
columnId: PropertyKey;
|
|
23
23
|
stickyState: StickyColumnsModel;
|
|
24
24
|
isVisualRefresh?: boolean;
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"td-element.d.ts","sourceRoot":"lib/default/","sources":["table/body-cell/td-element.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"td-element.d.ts","sourceRoot":"lib/default/","sources":["table/body-cell/td-element.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAuB,MAAM,yCAAyC,CAAC;AAElG,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,IAAI,CACrB,KAAK,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,EAC3F,OAAO,GAAG,WAAW,GAAG,SAAS,CAClC,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,kBAAkB,CAAC;IAChC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,kGA6E1B,CAAC"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import styles from './styles.css.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { getStickyClassNames } from '../utils';
|
|
7
|
+
import { useStickyCellStyles } from '../sticky-columns/use-sticky-columns.js';
|
|
8
8
|
export const TableTdElement = React.forwardRef(({ className, style, children, wrapLines, isRowHeader, isFirstRow, isLastRow, isSelected, isNextSelected, isPrevSelected, nativeAttributes, onClick, onMouseEnter, onMouseLeave, isEvenRow, stripedRows, isVisualRefresh, hasSelection, hasFooter, columnId, stickyState, }, ref) => {
|
|
9
9
|
let Element = 'td';
|
|
10
10
|
if (isRowHeader) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"td-element.js","sourceRoot":"lib/default/","sources":["table/body-cell/td-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"td-element.js","sourceRoot":"lib/default/","sources":["table/body-cell/td-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAsB,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AA6BlG,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAC5C,CACE,EACE,SAAS,EACT,KAAK,EACL,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,EACf,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,WAAW,GACZ,EACD,GAAG,EACH,EAAE;IACF,IAAI,OAAO,GAAgB,IAAI,CAAC;IAChC,IAAI,WAAW,EAAE;QACf,OAAO,GAAG,IAAI,CAAC;QACf,gBAAgB,mCACX,gBAAgB,KACnB,KAAK,EAAE,KAAK,GACb,CAAC;KACH;IAED,MAAM,YAAY,GAAG,mBAAmB,CAAC;QACvC,aAAa,EAAE,WAAW;QAC1B,QAAQ;QACR,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC;KAC1D,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,OAAO,kBACN,KAAK,kCAAO,KAAK,GAAK,YAAY,CAAC,KAAK,GACxC,SAAS,EAAE,IAAI,CACb,SAAS,EACT,MAAM,CAAC,WAAW,CAAC,EACnB,SAAS,IAAI,MAAM,CAAC,gBAAgB,CAAC,EACrC,UAAU,IAAI,MAAM,CAAC,qBAAqB,CAAC,EAC3C,SAAS,IAAI,MAAM,CAAC,oBAAoB,CAAC,EACzC,UAAU,IAAI,MAAM,CAAC,oBAAoB,CAAC,EAC1C,cAAc,IAAI,MAAM,CAAC,yBAAyB,CAAC,EACnD,cAAc,IAAI,MAAM,CAAC,yBAAyB,CAAC,EACnD,CAAC,SAAS,IAAI,WAAW,IAAI,MAAM,CAAC,kBAAkB,CAAC,EACvD,WAAW,IAAI,MAAM,CAAC,kBAAkB,CAAC,EACzC,eAAe,IAAI,MAAM,CAAC,mBAAmB,CAAC,EAC9C,YAAY,IAAI,MAAM,CAAC,eAAe,CAAC,EACvC,SAAS,IAAI,MAAM,CAAC,YAAY,CAAC,EACjC,YAAY,CAAC,SAAS,CACvB,EACD,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,IAAI,CAAC,EAAE;YACV,IAAI,IAAI,EAAE;gBACR,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACvB,IAAI,GAAG,EAAE;oBACN,GAAoD,CAAC,OAAO,GAAG,IAAI,CAAC;iBACtE;aACF;QACH,CAAC,IACG,gBAAgB,GAEnB,QAAQ,CACD,CACX,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\nimport { getStickyClassNames } from '../utils';\nimport { StickyColumnsModel, useStickyCellStyles } from '../sticky-columns/use-sticky-columns.js';\n\nexport interface TableTdElementProps {\n className?: string;\n style?: React.CSSProperties;\n wrapLines: boolean | undefined;\n isRowHeader?: boolean;\n isFirstRow: boolean;\n isLastRow: boolean;\n isSelected: boolean;\n isNextSelected: boolean;\n isPrevSelected: boolean;\n nativeAttributes?: Omit<\n React.TdHTMLAttributes<HTMLTableCellElement> | React.ThHTMLAttributes<HTMLTableCellElement>,\n 'style' | 'className' | 'onClick'\n >;\n onClick?: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n children?: React.ReactNode;\n isEvenRow?: boolean;\n stripedRows?: boolean;\n hasSelection?: boolean;\n hasFooter?: boolean;\n columnId: PropertyKey;\n stickyState: StickyColumnsModel;\n isVisualRefresh?: boolean;\n}\n\nexport const TableTdElement = React.forwardRef<HTMLTableCellElement, TableTdElementProps>(\n (\n {\n className,\n style,\n children,\n wrapLines,\n isRowHeader,\n isFirstRow,\n isLastRow,\n isSelected,\n isNextSelected,\n isPrevSelected,\n nativeAttributes,\n onClick,\n onMouseEnter,\n onMouseLeave,\n isEvenRow,\n stripedRows,\n isVisualRefresh,\n hasSelection,\n hasFooter,\n columnId,\n stickyState,\n },\n ref\n ) => {\n let Element: 'th' | 'td' = 'td';\n if (isRowHeader) {\n Element = 'th';\n nativeAttributes = {\n ...nativeAttributes,\n scope: 'row',\n };\n }\n\n const stickyStyles = useStickyCellStyles({\n stickyColumns: stickyState,\n columnId,\n getClassName: props => getStickyClassNames(styles, props),\n });\n return (\n <Element\n style={{ ...style, ...stickyStyles.style }}\n className={clsx(\n className,\n styles['body-cell'],\n wrapLines && styles['body-cell-wrap'],\n isFirstRow && styles['body-cell-first-row'],\n isLastRow && styles['body-cell-last-row'],\n isSelected && styles['body-cell-selected'],\n isNextSelected && styles['body-cell-next-selected'],\n isPrevSelected && styles['body-cell-prev-selected'],\n !isEvenRow && stripedRows && styles['body-cell-shaded'],\n stripedRows && styles['has-striped-rows'],\n isVisualRefresh && styles['is-visual-refresh'],\n hasSelection && styles['has-selection'],\n hasFooter && styles['has-footer'],\n stickyStyles.className\n )}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n ref={node => {\n if (node) {\n stickyStyles.ref(node);\n if (ref) {\n (ref as React.MutableRefObject<HTMLTableCellElement>).current = node;\n }\n }\n }}\n {...nativeAttributes}\n >\n {children}\n </Element>\n );\n }\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-widths-utils.d.ts","sourceRoot":"lib/default/","sources":["table/column-widths-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAKnG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
4
|
+
export function checkColumnWidths(columnDefinitions) {
|
|
5
|
+
for (const column of columnDefinitions) {
|
|
6
|
+
checkProperty(column, 'minWidth');
|
|
7
|
+
checkProperty(column, 'width');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function checkProperty(column, name) {
|
|
11
|
+
const value = column[name];
|
|
12
|
+
if (typeof value !== 'number' && typeof value !== 'undefined') {
|
|
13
|
+
warnOnce('Table', `resizableColumns feature requires ${name} property to be a number, got ${value}. The component may work incorrectly.`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=column-widths-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-widths-utils.js","sourceRoot":"lib/default/","sources":["table/column-widths-utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGzE,MAAM,UAAU,iBAAiB,CAAC,iBAAkE;IAClG,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE;QACtC,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,MAAwC,EAAE,IAA0B;IACzF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAC7D,QAAQ,CACN,OAAO,EACP,qCAAqC,IAAI,iCAAiC,KAAK,uCAAuC,CACvH,CAAC;KACH;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { TableProps } from './interfaces';\n\nexport function checkColumnWidths(columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>) {\n for (const column of columnDefinitions) {\n checkProperty(column, 'minWidth');\n checkProperty(column, 'width');\n }\n}\n\nfunction checkProperty(column: TableProps.ColumnDefinition<any>, name: 'width' | 'minWidth') {\n const value = column[name];\n if (typeof value !== 'number' && typeof value !== 'undefined') {\n warnOnce(\n 'Table',\n `resizableColumns feature requires ${name} property to be a number, got ${value}. The component may work incorrectly.`\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TableProps } from '../interfaces';
|
|
3
3
|
import { InteractiveComponent } from '../thead';
|
|
4
|
-
import { StickyColumnsModel } from '../
|
|
4
|
+
import { StickyColumnsModel } from '../sticky-columns';
|
|
5
5
|
interface TableHeaderCellProps<ItemType> {
|
|
6
6
|
className?: string;
|
|
7
7
|
style?: React.CSSProperties;
|
|
@@ -15,12 +15,12 @@ interface TableHeaderCellProps<ItemType> {
|
|
|
15
15
|
onClick(detail: TableProps.SortingState<any>): void;
|
|
16
16
|
onResizeFinish: () => void;
|
|
17
17
|
colIndex: number;
|
|
18
|
-
updateColumn: (
|
|
18
|
+
updateColumn: (columnId: PropertyKey, newWidth: number) => void;
|
|
19
19
|
onFocus?: () => void;
|
|
20
20
|
onBlur?: () => void;
|
|
21
21
|
resizableColumns?: boolean;
|
|
22
22
|
isEditable?: boolean;
|
|
23
|
-
columnId:
|
|
23
|
+
columnId: PropertyKey;
|
|
24
24
|
stickyState: StickyColumnsModel;
|
|
25
25
|
focusedComponent?: InteractiveComponent | null;
|
|
26
26
|
onFocusedComponentChange?: (element: InteractiveComponent | null) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["table/header-cell/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["table/header-cell/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAuB,MAAM,mBAAmB,CAAC;AAE5E,UAAU,oBAAoB,CAAC,QAAQ;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,mBAAmB,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACpD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAChE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,kBAAkB,CAAC;IAEhC,gBAAgB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC/C,wBAAwB,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3E;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,EACxC,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,wBAAwB,EACxB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,WAAW,GACZ,EAAE,oBAAoB,CAAC,QAAQ,CAAC,eA4GhC"}
|
|
@@ -8,9 +8,9 @@ import { getAriaSort, getSortingIconName, getSortingStatus, isSorted } from './u
|
|
|
8
8
|
import styles from './styles.css.js';
|
|
9
9
|
import { Resizer } from '../resizer';
|
|
10
10
|
import { useUniqueId } from '../../internal/hooks/use-unique-id';
|
|
11
|
-
import { useStickyCellStyles } from '../use-sticky-columns';
|
|
12
11
|
import { getStickyClassNames } from '../utils';
|
|
13
12
|
import { useInternalI18n } from '../../internal/i18n/context';
|
|
13
|
+
import { useStickyCellStyles } from '../sticky-columns';
|
|
14
14
|
export function TableHeaderCell({ className, style, tabIndex, column, activeSortingColumn, sortingDescending, sortingDisabled, wrapLines, focusedComponent, onFocusedComponentChange, hidden, onClick, colIndex, updateColumn, resizableColumns, onResizeFinish, isEditable, columnId, stickyState, }) {
|
|
15
15
|
var _a;
|
|
16
16
|
const i18n = useInternalI18n('table');
|
|
@@ -71,6 +71,6 @@ export function TableHeaderCell({ className, style, tabIndex, column, activeSort
|
|
|
71
71
|
sortingStatus && (React.createElement("span", { className: styles['sorting-icon'] },
|
|
72
72
|
React.createElement(InternalIcon, { name: getSortingIconName(sortingStatus) })))),
|
|
73
73
|
resizableColumns && (React.createElement(React.Fragment, null,
|
|
74
|
-
React.createElement(Resizer, { tabIndex: tabIndex, showFocusRing: (focusedComponent === null || focusedComponent === void 0 ? void 0 : focusedComponent.type) === 'resizer' && focusedComponent.col === colIndex, onDragMove: newWidth => updateColumn(
|
|
74
|
+
React.createElement(Resizer, { tabIndex: tabIndex, showFocusRing: (focusedComponent === null || focusedComponent === void 0 ? void 0 : focusedComponent.type) === 'resizer' && focusedComponent.col === colIndex, onDragMove: newWidth => updateColumn(columnId, newWidth), onFinish: onResizeFinish, ariaLabelledby: headerId, onFocus: () => onFocusedComponentChange === null || onFocusedComponentChange === void 0 ? void 0 : onFocusedComponentChange({ type: 'resizer', col: colIndex }), onBlur: () => onFocusedComponentChange === null || onFocusedComponentChange === void 0 ? void 0 : onFocusedComponentChange(null), minWidth: typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth })))));
|
|
75
75
|
}
|
|
76
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["table/header-cell/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AAC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right Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport InternalIcon from '../../icon/internal';\nimport { KeyCode } from '../../internal/keycode';\nimport { TableProps } from '../interfaces';\nimport { getAriaSort, getSortingIconName, getSortingStatus, isSorted } from './utils';\nimport styles from './styles.css.js';\nimport { Resizer } from '../resizer';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { InteractiveComponent } from '../thead';\nimport { StickyColumnsModel, useStickyCellStyles } from '../use-sticky-columns';\nimport { getStickyClassNames } from '../utils';\nimport { useInternalI18n } from '../../internal/i18n/context';\n\ninterface TableHeaderCellProps<ItemType> {\n className?: string;\n style?: React.CSSProperties;\n tabIndex: number;\n column: TableProps.ColumnDefinition<ItemType>;\n activeSortingColumn?: TableProps.SortingColumn<ItemType>;\n sortingDescending?: boolean;\n sortingDisabled?: boolean;\n wrapLines?: boolean;\n hidden?: boolean;\n onClick(detail: TableProps.SortingState<any>): void;\n onResizeFinish: () => void;\n colIndex: number;\n updateColumn: (colIndex: number, newWidth: number) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n resizableColumns?: boolean;\n isEditable?: boolean;\n columnId: string;\n stickyState: StickyColumnsModel;\n\n focusedComponent?: InteractiveComponent | null;\n onFocusedComponentChange?: (element: InteractiveComponent | null) => void;\n}\n\nexport function TableHeaderCell<ItemType>({\n className,\n style,\n tabIndex,\n column,\n activeSortingColumn,\n sortingDescending,\n sortingDisabled,\n wrapLines,\n focusedComponent,\n onFocusedComponentChange,\n hidden,\n onClick,\n colIndex,\n updateColumn,\n resizableColumns,\n onResizeFinish,\n isEditable,\n columnId,\n stickyState,\n}: TableHeaderCellProps<ItemType>) {\n const i18n = useInternalI18n('table');\n const sortable = !!column.sortingComparator || !!column.sortingField;\n const sorted = !!activeSortingColumn && isSorted(column, activeSortingColumn);\n const sortingStatus = getSortingStatus(sortable, sorted, !!sortingDescending, !!sortingDisabled);\n const handleClick = () =>\n onClick({\n sortingColumn: column,\n isDescending: sorted ? !sortingDescending : false,\n });\n\n // Elements with role=\"button\" do not have the default behavior of <button>, where pressing\n // Enter or Space will trigger a click event. Therefore we need to add this ourselves.\n // The native <button> element cannot be used due to a misaligned implementation in Firefox:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=843003\n const handleKeyPress = ({ nativeEvent: e }: React.KeyboardEvent) => {\n if (e.keyCode === KeyCode.enter || e.keyCode === KeyCode.space) {\n e.preventDefault();\n handleClick();\n }\n };\n\n const headerId = useUniqueId('table-header-');\n\n const stickyStyles = useStickyCellStyles({\n stickyColumns: stickyState,\n columnId,\n getClassName: props => getStickyClassNames(styles, props),\n });\n\n return (\n <th\n className={clsx(\n className,\n {\n [styles['header-cell-resizable']]: !!resizableColumns,\n [styles['header-cell-sortable']]: sortingStatus,\n [styles['header-cell-sorted']]: sortingStatus === 'ascending' || sortingStatus === 'descending',\n [styles['header-cell-disabled']]: sortingDisabled,\n [styles['header-cell-ascending']]: sortingStatus === 'ascending',\n [styles['header-cell-descending']]: sortingStatus === 'descending',\n [styles['header-cell-hidden']]: hidden,\n },\n stickyStyles.className\n )}\n aria-sort={sortingStatus && getAriaSort(sortingStatus)}\n style={{ ...style, ...stickyStyles.style }}\n scope=\"col\"\n ref={stickyStyles.ref}\n >\n <div\n className={clsx(styles['header-cell-content'], {\n [styles['header-cell-fake-focus']]: focusedComponent?.type === 'column' && focusedComponent.col === colIndex,\n })}\n aria-label={\n column.ariaLabel\n ? column.ariaLabel({\n sorted: sorted,\n descending: sorted && !!sortingDescending,\n disabled: !!sortingDisabled,\n })\n : undefined\n }\n {...(sortingStatus && !sortingDisabled\n ? {\n onKeyPress: handleKeyPress,\n tabIndex: tabIndex,\n role: 'button',\n onClick: handleClick,\n onFocus: () => onFocusedComponentChange?.({ type: 'column', col: colIndex }),\n onBlur: () => onFocusedComponentChange?.(null),\n }\n : {})}\n >\n <div className={clsx(styles['header-cell-text'], wrapLines && styles['header-cell-text-wrap'])} id={headerId}>\n {column.header}\n {isEditable ? (\n <span\n className={styles['edit-icon']}\n role=\"img\"\n aria-label={i18n('columnDefinitions.editConfig.editIconAriaLabel', column.editConfig?.editIconAriaLabel)}\n >\n <InternalIcon name=\"edit\" />\n </span>\n ) : null}\n </div>\n {sortingStatus && (\n <span className={styles['sorting-icon']}>\n <InternalIcon name={getSortingIconName(sortingStatus)} />\n </span>\n )}\n </div>\n {resizableColumns && (\n <>\n <Resizer\n tabIndex={tabIndex}\n showFocusRing={focusedComponent?.type === 'resizer' && focusedComponent.col === colIndex}\n onDragMove={newWidth => updateColumn(colIndex, newWidth)}\n onFinish={onResizeFinish}\n ariaLabelledby={headerId}\n onFocus={() => onFocusedComponentChange?.({ type: 'resizer', col: colIndex })}\n onBlur={() => onFocusedComponentChange?.(null)}\n minWidth={typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth}\n />\n </>\n )}\n </th>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["table/header-cell/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAsB,mBAAmB,EAAE,MAAM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gB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,IAAI,MAAK,SAAS,IAAI,gBAAgB,CAAC,GAAG,KAAK,QAAQ,EACxF,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACxD,QAAQ,EAAE,cAAc,EACxB,cAAc,EAAE,QAAQ,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,CAAG,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAC7E,MAAM,EAAE,GAAG,EAAE,CAAC,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,CAAG,IAAI,CAAC,EAC9C,QAAQ,EAAE,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,GAC3F,CACD,CACJ,CACE,CACN,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport InternalIcon from '../../icon/internal';\nimport { KeyCode } from '../../internal/keycode';\nimport { TableProps } from '../interfaces';\nimport { getAriaSort, getSortingIconName, getSortingStatus, isSorted } from './utils';\nimport styles from './styles.css.js';\nimport { Resizer } from '../resizer';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { InteractiveComponent } from '../thead';\nimport { getStickyClassNames } from '../utils';\nimport { useInternalI18n } from '../../internal/i18n/context';\nimport { StickyColumnsModel, useStickyCellStyles } from '../sticky-columns';\n\ninterface TableHeaderCellProps<ItemType> {\n className?: string;\n style?: React.CSSProperties;\n tabIndex: number;\n column: TableProps.ColumnDefinition<ItemType>;\n activeSortingColumn?: TableProps.SortingColumn<ItemType>;\n sortingDescending?: boolean;\n sortingDisabled?: boolean;\n wrapLines?: boolean;\n hidden?: boolean;\n onClick(detail: TableProps.SortingState<any>): void;\n onResizeFinish: () => void;\n colIndex: number;\n updateColumn: (columnId: PropertyKey, newWidth: number) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n resizableColumns?: boolean;\n isEditable?: boolean;\n columnId: PropertyKey;\n stickyState: StickyColumnsModel;\n\n focusedComponent?: InteractiveComponent | null;\n onFocusedComponentChange?: (element: InteractiveComponent | null) => void;\n}\n\nexport function TableHeaderCell<ItemType>({\n className,\n style,\n tabIndex,\n column,\n activeSortingColumn,\n sortingDescending,\n sortingDisabled,\n wrapLines,\n focusedComponent,\n onFocusedComponentChange,\n hidden,\n onClick,\n colIndex,\n updateColumn,\n resizableColumns,\n onResizeFinish,\n isEditable,\n columnId,\n stickyState,\n}: TableHeaderCellProps<ItemType>) {\n const i18n = useInternalI18n('table');\n const sortable = !!column.sortingComparator || !!column.sortingField;\n const sorted = !!activeSortingColumn && isSorted(column, activeSortingColumn);\n const sortingStatus = getSortingStatus(sortable, sorted, !!sortingDescending, !!sortingDisabled);\n const handleClick = () =>\n onClick({\n sortingColumn: column,\n isDescending: sorted ? !sortingDescending : false,\n });\n\n // Elements with role=\"button\" do not have the default behavior of <button>, where pressing\n // Enter or Space will trigger a click event. Therefore we need to add this ourselves.\n // The native <button> element cannot be used due to a misaligned implementation in Firefox:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=843003\n const handleKeyPress = ({ nativeEvent: e }: React.KeyboardEvent) => {\n if (e.keyCode === KeyCode.enter || e.keyCode === KeyCode.space) {\n e.preventDefault();\n handleClick();\n }\n };\n\n const headerId = useUniqueId('table-header-');\n\n const stickyStyles = useStickyCellStyles({\n stickyColumns: stickyState,\n columnId,\n getClassName: props => getStickyClassNames(styles, props),\n });\n\n return (\n <th\n className={clsx(\n className,\n {\n [styles['header-cell-resizable']]: !!resizableColumns,\n [styles['header-cell-sortable']]: sortingStatus,\n [styles['header-cell-sorted']]: sortingStatus === 'ascending' || sortingStatus === 'descending',\n [styles['header-cell-disabled']]: sortingDisabled,\n [styles['header-cell-ascending']]: sortingStatus === 'ascending',\n [styles['header-cell-descending']]: sortingStatus === 'descending',\n [styles['header-cell-hidden']]: hidden,\n },\n stickyStyles.className\n )}\n aria-sort={sortingStatus && getAriaSort(sortingStatus)}\n style={{ ...style, ...stickyStyles.style }}\n scope=\"col\"\n ref={stickyStyles.ref}\n >\n <div\n className={clsx(styles['header-cell-content'], {\n [styles['header-cell-fake-focus']]: focusedComponent?.type === 'column' && focusedComponent.col === colIndex,\n })}\n aria-label={\n column.ariaLabel\n ? column.ariaLabel({\n sorted: sorted,\n descending: sorted && !!sortingDescending,\n disabled: !!sortingDisabled,\n })\n : undefined\n }\n {...(sortingStatus && !sortingDisabled\n ? {\n onKeyPress: handleKeyPress,\n tabIndex: tabIndex,\n role: 'button',\n onClick: handleClick,\n onFocus: () => onFocusedComponentChange?.({ type: 'column', col: colIndex }),\n onBlur: () => onFocusedComponentChange?.(null),\n }\n : {})}\n >\n <div className={clsx(styles['header-cell-text'], wrapLines && styles['header-cell-text-wrap'])} id={headerId}>\n {column.header}\n {isEditable ? (\n <span\n className={styles['edit-icon']}\n role=\"img\"\n aria-label={i18n('columnDefinitions.editConfig.editIconAriaLabel', column.editConfig?.editIconAriaLabel)}\n >\n <InternalIcon name=\"edit\" />\n </span>\n ) : null}\n </div>\n {sortingStatus && (\n <span className={styles['sorting-icon']}>\n <InternalIcon name={getSortingIconName(sortingStatus)} />\n </span>\n )}\n </div>\n {resizableColumns && (\n <>\n <Resizer\n tabIndex={tabIndex}\n showFocusRing={focusedComponent?.type === 'resizer' && focusedComponent.col === colIndex}\n onDragMove={newWidth => updateColumn(columnId, newWidth)}\n onFinish={onResizeFinish}\n ariaLabelledby={headerId}\n onFocus={() => onFocusedComponentChange?.({ type: 'resizer', col: colIndex })}\n onBlur={() => onFocusedComponentChange?.(null)}\n minWidth={typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth}\n />\n </>\n )}\n </th>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAwC/D,QAAA,MAAM,aAAa,qBAibK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
|
|
@@ -18,20 +18,23 @@ import { useRowEvents } from './use-row-events';
|
|
|
18
18
|
import { focusMarkers, useFocusMove, useSelection } from './use-selection';
|
|
19
19
|
import { fireCancelableEvent, fireNonCancelableEvent } from '../internal/events';
|
|
20
20
|
import { isDevelopment } from '../internal/is-development';
|
|
21
|
-
import {
|
|
21
|
+
import { ColumnWidthsProvider, DEFAULT_COLUMN_WIDTH } from './use-column-widths';
|
|
22
22
|
import { useScrollSync } from '../internal/hooks/use-scroll-sync';
|
|
23
23
|
import { ResizeTracker } from './resizer';
|
|
24
24
|
import styles from './styles.css.js';
|
|
25
25
|
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
26
26
|
import StickyHeader from './sticky-header';
|
|
27
|
-
import StickyScrollbar from './sticky-scrollbar';
|
|
28
27
|
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
29
28
|
import useMouseDownTarget from '../internal/hooks/use-mouse-down-target';
|
|
30
29
|
import { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';
|
|
31
30
|
import LiveRegion from '../internal/components/live-region';
|
|
32
31
|
import useTableFocusNavigation from './use-table-focus-navigation';
|
|
33
32
|
import { TableTdElement } from './body-cell/td-element';
|
|
34
|
-
import { useStickyColumns
|
|
33
|
+
import { useStickyColumns } from './sticky-columns';
|
|
34
|
+
import { StickyScrollbar } from './sticky-scrollbar';
|
|
35
|
+
import { checkColumnWidths } from './column-widths-utils';
|
|
36
|
+
const SELECTION_COLUMN_WIDTH = 54;
|
|
37
|
+
const selectionColumnId = Symbol('selection-column-id');
|
|
35
38
|
const InternalTable = React.forwardRef((_a, ref) => {
|
|
36
39
|
var _b, _c, _d;
|
|
37
40
|
var { header, footer, empty, filter, pagination, preferences, items, columnDefinitions, trackBy, loading, loadingText, selectionType, selectedItems, isItemDisabled, ariaLabels, onSelectionChange, onSortingChange, sortingColumn, sortingDescending, sortingDisabled, visibleColumns, stickyHeader, stickyHeaderVerticalOffset, onRowClick, onRowContextMenu, wrapLines, stripedRows, contentDensity, submitEdit, onEditCancel, resizableColumns, onColumnWidthsChange, variant, __internalRootRef, totalItemsCount, firstIndex, renderAriaLive, stickyColumns, columnDisplay } = _a, rest = __rest(_a, ["header", "footer", "empty", "filter", "pagination", "preferences", "items", "columnDefinitions", "trackBy", "loading", "loadingText", "selectionType", "selectedItems", "isItemDisabled", "ariaLabels", "onSelectionChange", "onSortingChange", "sortingColumn", "sortingDescending", "sortingDisabled", "visibleColumns", "stickyHeader", "stickyHeaderVerticalOffset", "onRowClick", "onRowContextMenu", "wrapLines", "stripedRows", "contentDensity", "submitEdit", "onEditCancel", "resizableColumns", "onColumnWidthsChange", "variant", "__internalRootRef", "totalItemsCount", "firstIndex", "renderAriaLive", "stickyColumns", "columnDisplay"]);
|
|
@@ -91,11 +94,12 @@ const InternalTable = React.forwardRef((_a, ref) => {
|
|
|
91
94
|
const hasSelection = !!selectionType;
|
|
92
95
|
const hasFooter = !!footer;
|
|
93
96
|
const visibleColumnsWithSelection = useMemo(() => {
|
|
94
|
-
const
|
|
95
|
-
return hasSelection ? [selectionColumnId
|
|
97
|
+
const visible = visibleColumnDefinitions.map((column, columnIndex) => (Object.assign(Object.assign({}, column), { id: getColumnKey(column, columnIndex) })));
|
|
98
|
+
return hasSelection ? [{ id: selectionColumnId, width: SELECTION_COLUMN_WIDTH }, ...visible] : visible;
|
|
96
99
|
}, [visibleColumnDefinitions, hasSelection]);
|
|
100
|
+
const visibleColumnIdsWithSelection = useMemo(() => visibleColumnsWithSelection.map(c => c.id), [visibleColumnsWithSelection]);
|
|
97
101
|
const stickyState = useStickyColumns({
|
|
98
|
-
visibleColumns:
|
|
102
|
+
visibleColumns: visibleColumnIdsWithSelection,
|
|
99
103
|
stickyColumnsFirst: ((_b = stickyColumns === null || stickyColumns === void 0 ? void 0 : stickyColumns.first) !== null && _b !== void 0 ? _b : 0) + ((stickyColumns === null || stickyColumns === void 0 ? void 0 : stickyColumns.first) && hasSelection ? 1 : 0),
|
|
100
104
|
stickyColumnsLast: (stickyColumns === null || stickyColumns === void 0 ? void 0 : stickyColumns.last) || 0,
|
|
101
105
|
});
|
|
@@ -113,7 +117,7 @@ const InternalTable = React.forwardRef((_a, ref) => {
|
|
|
113
117
|
onSortingChange,
|
|
114
118
|
onFocusMove: moveFocus,
|
|
115
119
|
onResizeFinish(newWidth) {
|
|
116
|
-
const widthsDetail = columnDefinitions.map((column, index) => newWidth[getColumnKey(column, index)] || column.width ||
|
|
120
|
+
const widthsDetail = columnDefinitions.map((column, index) => newWidth[getColumnKey(column, index)] || column.width || DEFAULT_COLUMN_WIDTH);
|
|
117
121
|
const widthsChanged = widthsDetail.some((width, index) => columnDefinitions[index].width !== width);
|
|
118
122
|
if (widthsChanged) {
|
|
119
123
|
fireNonCancelableEvent(onColumnWidthsChange, { widths: widthsDetail });
|
|
@@ -122,6 +126,7 @@ const InternalTable = React.forwardRef((_a, ref) => {
|
|
|
122
126
|
singleSelectionHeaderAriaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.selectionGroupLabel,
|
|
123
127
|
stripedRows,
|
|
124
128
|
stickyState,
|
|
129
|
+
selectionColumnId,
|
|
125
130
|
};
|
|
126
131
|
const wrapperRef = useMergeRefs(wrapperMeasureRef, wrapperRefObject, stickyState.refs.wrapper);
|
|
127
132
|
const tableRef = useMergeRefs(tableMeasureRef, tableRefObject, stickyState.refs.table);
|
|
@@ -151,7 +156,7 @@ const InternalTable = React.forwardRef((_a, ref) => {
|
|
|
151
156
|
const toolsHeaderWrapper = useRef(null);
|
|
152
157
|
// If is mobile, we take into consideration the AppLayout's mobile bar and we subtract the tools wrapper height so only the table header is sticky
|
|
153
158
|
const toolsHeaderHeight = (_d = (_c = toolsHeaderWrapper === null || toolsHeaderWrapper === void 0 ? void 0 : toolsHeaderWrapper.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().height) !== null && _d !== void 0 ? _d : 0;
|
|
154
|
-
return (React.createElement(ColumnWidthsProvider, { tableRef: tableRefObject,
|
|
159
|
+
return (React.createElement(ColumnWidthsProvider, { tableRef: tableRefObject, visibleColumns: visibleColumnsWithSelection, resizableColumns: resizableColumns },
|
|
155
160
|
React.createElement(InternalContainer, Object.assign({}, baseProps, { __internalRootRef: __internalRootRef, className: clsx(baseProps.className, styles.root), header: React.createElement(React.Fragment, null,
|
|
156
161
|
hasHeader && (React.createElement("div", { ref: overlapElement, className: clsx(hasDynamicHeight && [styles['dark-header'], 'awsui-context-content-header']) },
|
|
157
162
|
React.createElement("div", { ref: toolsHeaderWrapper, className: clsx(styles['header-controls'], styles[`variant-${computedVariant}`]) },
|
|
@@ -190,7 +195,7 @@ const InternalTable = React.forwardRef((_a, ref) => {
|
|
|
190
195
|
(_a = stickyHeaderRef.current) === null || _a === void 0 ? void 0 : _a.scrollToRow(currentTarget);
|
|
191
196
|
}
|
|
192
197
|
} }, focusMarkers.item, { onClick: onRowClickHandler && onRowClickHandler.bind(null, rowIndex, item), onContextMenu: onRowContextMenuHandler && onRowContextMenuHandler.bind(null, rowIndex, item), "aria-rowindex": firstIndex ? firstIndex + rowIndex + 1 : undefined }),
|
|
193
|
-
selectionType !== undefined && (React.createElement(TableTdElement, { className: clsx(styles['selection-control']), isVisualRefresh: isVisualRefresh, isFirstRow: firstVisible, isLastRow: lastVisible, isSelected: isSelected, isNextSelected: isNextSelected, isPrevSelected: isPrevSelected, wrapLines: false, isEvenRow: isEven, stripedRows: stripedRows, hasSelection: hasSelection, hasFooter: hasFooter, stickyState: stickyState, columnId: selectionColumnId
|
|
198
|
+
selectionType !== undefined && (React.createElement(TableTdElement, { className: clsx(styles['selection-control']), isVisualRefresh: isVisualRefresh, isFirstRow: firstVisible, isLastRow: lastVisible, isSelected: isSelected, isNextSelected: isNextSelected, isPrevSelected: isPrevSelected, wrapLines: false, isEvenRow: isEven, stripedRows: stripedRows, hasSelection: hasSelection, hasFooter: hasFooter, stickyState: stickyState, columnId: selectionColumnId },
|
|
194
199
|
React.createElement(SelectionControl, Object.assign({ onFocusDown: moveFocusDown, onFocusUp: moveFocusUp, onShiftToggle: updateShiftToggle }, getItemSelectionProps(item))))),
|
|
195
200
|
visibleColumnDefinitions.map((column, colIndex) => {
|
|
196
201
|
var _a;
|
|
@@ -216,7 +221,7 @@ const InternalTable = React.forwardRef((_a, ref) => {
|
|
|
216
221
|
setLastSuccessfulEditCell([rowIndex, colIndex]);
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
|
-
}, submitEdit: wrapWithInlineLoadingState(submitEdit), hasFooter: hasFooter, stripedRows: stripedRows, isEvenRow: isEven, columnId: (_a = column.id) !== null && _a !== void 0 ? _a : colIndex
|
|
224
|
+
}, submitEdit: wrapWithInlineLoadingState(submitEdit), hasFooter: hasFooter, stripedRows: stripedRows, isEvenRow: isEven, columnId: (_a = column.id) !== null && _a !== void 0 ? _a : colIndex, stickyState: stickyState, isVisualRefresh: isVisualRefresh }));
|
|
220
225
|
})));
|
|
221
226
|
})))),
|
|
222
227
|
resizableColumns && React.createElement(ResizeTracker, null)),
|