@cloudscape-design/components-themeable 3.0.152 → 3.0.154
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/table/body-cell/styles.scss +47 -4
- package/lib/internal/scss/table/header-cell/styles.scss +35 -3
- package/lib/internal/scss/table/selection-control/styles.scss +0 -2
- package/lib/internal/scss/table/styles.scss +17 -11
- package/lib/internal/template/app-layout/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/index.js +15 -25
- package/lib/internal/template/app-layout/index.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-observed-element.d.ts +1 -1
- package/lib/internal/template/app-layout/utils/use-observed-element.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-observed-element.js +3 -12
- package/lib/internal/template/app-layout/utils/use-observed-element.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/context.d.ts +2 -1
- package/lib/internal/template/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/context.js +33 -27
- package/lib/internal/template/app-layout/visual-refresh/context.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/layout.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/layout.js +2 -30
- package/lib/internal/template/app-layout/visual-refresh/layout.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/split-panel.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/split-panel.js +6 -14
- package/lib/internal/template/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +3 -4
- package/lib/internal/template/internal/context/split-panel-context.d.ts +1 -3
- package/lib/internal/template/internal/context/split-panel-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/split-panel-context.js +2 -4
- package/lib/internal/template/internal/context/split-panel-context.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/generated/styles/tokens.js +1 -1
- package/lib/internal/template/internal/generated/theming/index.cjs +13 -6
- package/lib/internal/template/internal/generated/theming/index.js +13 -6
- package/lib/internal/template/split-panel/bottom.d.ts.map +1 -1
- package/lib/internal/template/split-panel/bottom.js +11 -3
- package/lib/internal/template/split-panel/bottom.js.map +1 -1
- package/lib/internal/template/split-panel/index.d.ts.map +1 -1
- package/lib/internal/template/split-panel/index.js +2 -2
- package/lib/internal/template/split-panel/index.js.map +1 -1
- package/lib/internal/template/table/body-cell/index.d.ts +3 -1
- package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/index.js +4 -2
- package/lib/internal/template/table/body-cell/index.js.map +1 -1
- package/lib/internal/template/table/body-cell/styles.css.js +12 -8
- package/lib/internal/template/table/body-cell/styles.scoped.css +56 -20
- package/lib/internal/template/table/body-cell/styles.selectors.js +12 -8
- package/lib/internal/template/table/header-cell/styles.css.js +18 -16
- package/lib/internal/template/table/header-cell/styles.scoped.css +54 -27
- package/lib/internal/template/table/header-cell/styles.selectors.js +18 -16
- package/lib/internal/template/table/internal.d.ts.map +1 -1
- package/lib/internal/template/table/internal.js +11 -9
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/table/selection-control/styles.css.js +3 -3
- package/lib/internal/template/table/selection-control/styles.scoped.css +3 -5
- package/lib/internal/template/table/selection-control/styles.selectors.js +3 -3
- package/lib/internal/template/table/styles.css.js +33 -34
- package/lib/internal/template/table/styles.scoped.css +54 -49
- package/lib/internal/template/table/styles.selectors.js +33 -34
- package/lib/internal/template/table/thead.d.ts +1 -0
- package/lib/internal/template/table/thead.d.ts.map +1 -1
- package/lib/internal/template/table/thead.js +5 -3
- package/lib/internal/template/table/thead.js.map +1 -1
- package/lib/internal/template/table/use-sticky-header.d.ts.map +1 -1
- package/lib/internal/template/table/use-sticky-header.js +0 -13
- package/lib/internal/template/table/use-sticky-header.js.map +1 -1
- package/package.json +1 -1
|
@@ -475,6 +475,7 @@
|
|
|
475
475
|
--size-icon-large-9vh494:48px;
|
|
476
476
|
--size-icon-medium-yynucr:16px;
|
|
477
477
|
--size-icon-normal-j1z5fn:16px;
|
|
478
|
+
--size-table-selection-horizontal-bjirww:54px;
|
|
478
479
|
--size-vertical-input-ikahdk:32px;
|
|
479
480
|
--size-vertical-panel-icon-offset-ti40n4:15px;
|
|
480
481
|
--space-alert-action-left-ovi85g:20px;
|
|
@@ -1396,6 +1397,7 @@
|
|
|
1396
1397
|
--size-calendar-grid-width-luenzs:238px;
|
|
1397
1398
|
--size-control-eyly4k:16px;
|
|
1398
1399
|
--size-icon-medium-yynucr:20px;
|
|
1400
|
+
--size-table-selection-horizontal-bjirww:40px;
|
|
1399
1401
|
--size-vertical-input-ikahdk:34px;
|
|
1400
1402
|
--space-alert-action-left-ovi85g:12px;
|
|
1401
1403
|
--space-alert-horizontal-dvwbh6:16px;
|
|
@@ -1408,10 +1410,8 @@
|
|
|
1408
1410
|
--space-button-modal-dismiss-vertical-zj7c79:0px;
|
|
1409
1411
|
--space-calendar-grid-focus-outline-gutter-lbmex4:-5px;
|
|
1410
1412
|
--space-calendar-grid-selected-focus-outline-gutter-s5ollf:-5px;
|
|
1411
|
-
--space-card-horizontal-di7llb:24px;
|
|
1412
1413
|
--space-code-editor-status-focus-outline-gutter-hxg2um:-7px;
|
|
1413
1414
|
--space-container-content-top-u412x3:0px;
|
|
1414
|
-
--space-container-horizontal-tlw03i:24px;
|
|
1415
1415
|
--space-content-header-padding-bottom-m7tdoi:24px;
|
|
1416
1416
|
--space-dark-header-overlap-distance-ync2s3:36px;
|
|
1417
1417
|
--space-expandable-section-icon-offset-top-jo3eu8:4px;
|
|
@@ -1424,14 +1424,13 @@
|
|
|
1424
1424
|
--space-flashbar-horizontal-klv28o:16px;
|
|
1425
1425
|
--space-layout-content-bottom-ebez2l:40px;
|
|
1426
1426
|
--space-modal-content-bottom-2tkcs5:16px;
|
|
1427
|
-
--space-modal-horizontal-ah0xld:24px;
|
|
1428
1427
|
--space-panel-nav-left-hwf0ky:28px;
|
|
1429
1428
|
--space-panel-side-left-o3fm3s:28px;
|
|
1430
1429
|
--space-panel-side-right-oktwq8:24px;
|
|
1431
1430
|
--space-panel-split-top-mpmkyz:20px;
|
|
1432
1431
|
--space-segmented-control-focus-outline-gutter-82bijn:4px;
|
|
1433
1432
|
--space-tabs-content-top-c5lrql:12px;
|
|
1434
|
-
--space-table-horizontal-njdbej:
|
|
1433
|
+
--space-table-horizontal-njdbej:20px;
|
|
1435
1434
|
--space-table-header-horizontal-4u689g:0px;
|
|
1436
1435
|
--space-table-content-bottom-2l75ve:4px;
|
|
1437
1436
|
--space-table-content-top-su9ka6:12px;
|
|
@@ -15,7 +15,6 @@ export interface SplitPanelContextProps {
|
|
|
15
15
|
size: number;
|
|
16
16
|
getMaxWidth: () => number;
|
|
17
17
|
getMaxHeight: () => number;
|
|
18
|
-
getHeader: () => HTMLElement | null;
|
|
19
18
|
disableContentPaddings?: boolean;
|
|
20
19
|
contentWidthStyles?: React.CSSProperties;
|
|
21
20
|
contentWrapperPaddings?: {
|
|
@@ -26,8 +25,6 @@ export interface SplitPanelContextProps {
|
|
|
26
25
|
isMobile: boolean;
|
|
27
26
|
isForcedPosition: boolean;
|
|
28
27
|
lastInteraction?: SplitPanelLastInteraction;
|
|
29
|
-
splitPanelRef?: React.Ref<any>;
|
|
30
|
-
splitPanelHeaderRef?: React.Ref<any>;
|
|
31
28
|
onResize: (detail: {
|
|
32
29
|
size: number;
|
|
33
30
|
}) => void;
|
|
@@ -36,6 +33,7 @@ export interface SplitPanelContextProps {
|
|
|
36
33
|
position: 'side' | 'bottom';
|
|
37
34
|
}) => void;
|
|
38
35
|
reportSize: (pixels: number) => void;
|
|
36
|
+
reportHeaderHeight: (pixels: number) => void;
|
|
39
37
|
openButtonAriaLabel?: string;
|
|
40
38
|
setOpenButtonAriaLabel?: (value: string) => void;
|
|
41
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-panel-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/split-panel-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,MAAM,MAAM,yBAAyB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEpG,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,
|
|
1
|
+
{"version":3,"file":"split-panel-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/split-panel-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,MAAM,MAAM,yBAAyB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEpG,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACzC,sBAAsB,CAAC,EAAE;QACvB,SAAS,EAAE,OAAO,CAAC;QACnB,WAAW,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAG1B,eAAe,CAAC,EAAE,yBAAyB,CAAC;IAC5C,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,iBAAiB,uCAkB5B,CAAC;AAEH,wBAAgB,oBAAoB,2BAEnC"}
|
|
@@ -10,17 +10,15 @@ export var SplitPanelContext = createContext({
|
|
|
10
10
|
size: 0,
|
|
11
11
|
getMaxWidth: function () { return 0; },
|
|
12
12
|
getMaxHeight: function () { return 0; },
|
|
13
|
-
getHeader: function () { return null; },
|
|
14
13
|
isOpen: true,
|
|
15
14
|
isMobile: false,
|
|
16
15
|
isForcedPosition: false,
|
|
17
16
|
lastInteraction: undefined,
|
|
18
|
-
splitPanelRef: undefined,
|
|
19
|
-
splitPanelHeaderRef: undefined,
|
|
20
17
|
onResize: function () { },
|
|
21
18
|
onToggle: function () { },
|
|
22
19
|
onPreferencesChange: function () { },
|
|
23
|
-
reportSize: function () { }
|
|
20
|
+
reportSize: function () { },
|
|
21
|
+
reportHeaderHeight: function () { }
|
|
24
22
|
});
|
|
25
23
|
export function useSplitPanelContext() {
|
|
26
24
|
return useContext(SplitPanelContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-panel-context.js","sourceRoot":"","sources":["../../../../src/internal/context/split-panel-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"split-panel-context.js","sourceRoot":"","sources":["../../../../src/internal/context/split-panel-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAkCzD,MAAM,CAAC,IAAM,iBAAiB,GAAG,aAAa,CAAyB;IACrE,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,cAAM,OAAA,CAAC,EAAD,CAAC;IACpB,YAAY,EAAE,cAAM,OAAA,CAAC,EAAD,CAAC;IACrB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,gBAAgB,EAAE,KAAK;IACvB,eAAe,EAAE,SAAS;IAC1B,QAAQ,EAAE,cAAO,CAAC;IAClB,QAAQ,EAAE,cAAO,CAAC;IAClB,mBAAmB,EAAE,cAAO,CAAC;IAC7B,UAAU,EAAE,cAAO,CAAC;IACpB,kBAAkB,EAAE,cAAO,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,UAAU,oBAAoB;IAClC,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, createContext } from 'react';\n\nexport type SplitPanelLastInteraction = { type: 'open' } | { type: 'close' } | { type: 'position' };\n\nexport interface SplitPanelContextProps {\n topOffset: number;\n bottomOffset: number;\n leftOffset: number;\n rightOffset: number;\n position: 'side' | 'bottom';\n size: number;\n getMaxWidth: () => number;\n getMaxHeight: () => number;\n disableContentPaddings?: boolean;\n contentWidthStyles?: React.CSSProperties;\n contentWrapperPaddings?: {\n closedNav: boolean;\n closedTools: boolean;\n };\n isOpen?: boolean;\n isMobile: boolean;\n isForcedPosition: boolean;\n // The lastInteraction property indicates last meaningful state transition used to trigger split-panel effects.\n // We can't observe properties in a regular way because split-panel is being mounted in several places at once.\n lastInteraction?: SplitPanelLastInteraction;\n onResize: (detail: { size: number }) => void;\n onToggle: () => void;\n onPreferencesChange: (detail: { position: 'side' | 'bottom' }) => void;\n reportSize: (pixels: number) => void;\n reportHeaderHeight: (pixels: number) => void;\n openButtonAriaLabel?: string;\n setOpenButtonAriaLabel?: (value: string) => void;\n}\n\nexport const SplitPanelContext = createContext<SplitPanelContextProps>({\n topOffset: 0,\n bottomOffset: 0,\n leftOffset: 0,\n rightOffset: 0,\n position: 'bottom',\n size: 0,\n getMaxWidth: () => 0,\n getMaxHeight: () => 0,\n isOpen: true,\n isMobile: false,\n isForcedPosition: false,\n lastInteraction: undefined,\n onResize: () => {},\n onToggle: () => {},\n onPreferencesChange: () => {},\n reportSize: () => {},\n reportHeaderHeight: () => {},\n});\n\nexport function useSplitPanelContext() {\n return useContext(SplitPanelContext);\n}\n"]}
|
|
@@ -258,7 +258,7 @@ export var motionKeyframesFadeIn = "var(--motion-keyframes-fade-in-9ud20b, awsui
|
|
|
258
258
|
export var motionKeyframesFadeOut = "var(--motion-keyframes-fade-out-1ayoyt, awsui-fade-out-35003c)";
|
|
259
259
|
export var motionKeyframesStatusIconError = "var(--motion-keyframes-status-icon-error-ti988k, awsui-status-icon-error-35003c)";
|
|
260
260
|
export var motionKeyframesScalePopup = "var(--motion-keyframes-scale-popup-3oea16, awsui-scale-popup-35003c)";
|
|
261
|
-
export var spaceContainerHorizontal = "var(--space-container-horizontal-
|
|
261
|
+
export var spaceContainerHorizontal = "var(--space-container-horizontal-tlw03i, 20px)";
|
|
262
262
|
export var spaceFieldHorizontal = "var(--space-field-horizontal-89h2yr, 12px)";
|
|
263
263
|
export var spaceScaledXxxs = "var(--space-scaled-xxxs-b6dm8t, 2px)";
|
|
264
264
|
export var spaceScaledXxs = "var(--space-scaled-xxs-95dhkm, 4px)";
|
|
@@ -1813,6 +1813,10 @@ module.exports.preset = {
|
|
|
1813
1813
|
"comfortable": "16px",
|
|
1814
1814
|
"compact": "16px"
|
|
1815
1815
|
},
|
|
1816
|
+
"sizeTableSelectionHorizontal": {
|
|
1817
|
+
"comfortable": "40px",
|
|
1818
|
+
"compact": "40px"
|
|
1819
|
+
},
|
|
1816
1820
|
"sizeVerticalInput": {
|
|
1817
1821
|
"comfortable": "34px",
|
|
1818
1822
|
"compact": "30px"
|
|
@@ -1882,8 +1886,8 @@ module.exports.preset = {
|
|
|
1882
1886
|
"compact": "{spaceS}"
|
|
1883
1887
|
},
|
|
1884
1888
|
"spaceContainerHorizontal": {
|
|
1885
|
-
"comfortable": "{
|
|
1886
|
-
"compact": "{
|
|
1889
|
+
"comfortable": "{spaceL}",
|
|
1890
|
+
"compact": "{spaceL}"
|
|
1887
1891
|
},
|
|
1888
1892
|
"spaceContentHeaderPaddingBottom": {
|
|
1889
1893
|
"comfortable": "{spaceXl}",
|
|
@@ -6120,6 +6124,7 @@ module.exports.preset = {
|
|
|
6120
6124
|
"sizeIconLarge": "density",
|
|
6121
6125
|
"sizeIconMedium": "density",
|
|
6122
6126
|
"sizeIconNormal": "density",
|
|
6127
|
+
"sizeTableSelectionHorizontal": "density",
|
|
6123
6128
|
"sizeVerticalInput": "density",
|
|
6124
6129
|
"sizeVerticalPanelIconOffset": "density",
|
|
6125
6130
|
"spaceAlertActionLeft": "density",
|
|
@@ -7212,6 +7217,7 @@ module.exports.preset = {
|
|
|
7212
7217
|
"sizeIconLarge": "size-icon-large",
|
|
7213
7218
|
"sizeIconMedium": "size-icon-medium",
|
|
7214
7219
|
"sizeIconNormal": "size-icon-normal",
|
|
7220
|
+
"sizeTableSelectionHorizontal": "size-table-selection-horizontal",
|
|
7215
7221
|
"sizeVerticalInput": "size-vertical-input",
|
|
7216
7222
|
"sizeVerticalPanelIconOffset": "size-vertical-panel-icon-offset",
|
|
7217
7223
|
"spaceAlertActionLeft": "space-alert-action-left",
|
|
@@ -7858,6 +7864,7 @@ module.exports.preset = {
|
|
|
7858
7864
|
"sizeIconLarge": "--size-icon-large-9vh494",
|
|
7859
7865
|
"sizeIconMedium": "--size-icon-medium-fvz0oi",
|
|
7860
7866
|
"sizeIconNormal": "--size-icon-normal-j1z5fn",
|
|
7867
|
+
"sizeTableSelectionHorizontal": "--size-table-selection-horizontal-o8c8gs",
|
|
7861
7868
|
"sizeVerticalInput": "--size-vertical-input-js5hfh",
|
|
7862
7869
|
"sizeVerticalPanelIconOffset": "--size-vertical-panel-icon-offset-ti40n4",
|
|
7863
7870
|
"spaceAlertActionLeft": "--space-alert-action-left-hi50rw",
|
|
@@ -7871,11 +7878,11 @@ module.exports.preset = {
|
|
|
7871
7878
|
"spaceButtonModalDismissVertical": "--space-button-modal-dismiss-vertical-r4lx2k",
|
|
7872
7879
|
"spaceCalendarGridFocusOutlineGutter": "--space-calendar-grid-focus-outline-gutter-v3dwvl",
|
|
7873
7880
|
"spaceCalendarGridSelectedFocusOutlineGutter": "--space-calendar-grid-selected-focus-outline-gutter-gqgjqz",
|
|
7874
|
-
"spaceCardHorizontal": "--space-card-horizontal-
|
|
7881
|
+
"spaceCardHorizontal": "--space-card-horizontal-di7llb",
|
|
7875
7882
|
"spaceCodeEditorStatusFocusOutlineGutter": "--space-code-editor-status-focus-outline-gutter-eivtla",
|
|
7876
7883
|
"spaceContainerContentTop": "--space-container-content-top-fsd8nr",
|
|
7877
7884
|
"spaceContainerHeaderVertical": "--space-container-header-vertical-zsjhel",
|
|
7878
|
-
"spaceContainerHorizontal": "--space-container-horizontal-
|
|
7885
|
+
"spaceContainerHorizontal": "--space-container-horizontal-tlw03i",
|
|
7879
7886
|
"spaceContentHeaderPaddingBottom": "--space-content-header-padding-bottom-nvqytg",
|
|
7880
7887
|
"spaceDarkHeaderOverlapDistance": "--space-dark-header-overlap-distance-hfejul",
|
|
7881
7888
|
"spaceExpandableSectionIconOffsetTop": "--space-expandable-section-icon-offset-top-svbirl",
|
|
@@ -7891,7 +7898,7 @@ module.exports.preset = {
|
|
|
7891
7898
|
"spaceLayoutToggleDiameter": "--space-layout-toggle-diameter-hzvqtj",
|
|
7892
7899
|
"spaceLayoutTogglePadding": "--space-layout-toggle-padding-axl9jr",
|
|
7893
7900
|
"spaceModalContentBottom": "--space-modal-content-bottom-cecclv",
|
|
7894
|
-
"spaceModalHorizontal": "--space-modal-horizontal-
|
|
7901
|
+
"spaceModalHorizontal": "--space-modal-horizontal-ah0xld",
|
|
7895
7902
|
"spacePanelNavLeft": "--space-panel-nav-left-o5fvw3",
|
|
7896
7903
|
"spacePanelSideLeft": "--space-panel-side-left-8ozqve",
|
|
7897
7904
|
"spacePanelSideRight": "--space-panel-side-right-kev4k9",
|
|
@@ -7899,7 +7906,7 @@ module.exports.preset = {
|
|
|
7899
7906
|
"spaceSegmentedControlFocusOutlineGutter": "--space-segmented-control-focus-outline-gutter-99x5b9",
|
|
7900
7907
|
"spaceTableHeaderFocusOutlineGutter": "--space-table-header-focus-outline-gutter-rbx7m7",
|
|
7901
7908
|
"spaceTabsContentTop": "--space-tabs-content-top-mn4c9x",
|
|
7902
|
-
"spaceTableHorizontal": "--space-table-horizontal-
|
|
7909
|
+
"spaceTableHorizontal": "--space-table-horizontal-mj7h0h",
|
|
7903
7910
|
"spaceTableHeaderHorizontal": "--space-table-header-horizontal-et2ko8",
|
|
7904
7911
|
"spaceTableContentBottom": "--space-table-content-bottom-pg6yvn",
|
|
7905
7912
|
"spaceTableContentTop": "--space-table-content-top-t15dd1",
|
|
@@ -1813,6 +1813,10 @@ export var preset = {
|
|
|
1813
1813
|
"comfortable": "16px",
|
|
1814
1814
|
"compact": "16px"
|
|
1815
1815
|
},
|
|
1816
|
+
"sizeTableSelectionHorizontal": {
|
|
1817
|
+
"comfortable": "40px",
|
|
1818
|
+
"compact": "40px"
|
|
1819
|
+
},
|
|
1816
1820
|
"sizeVerticalInput": {
|
|
1817
1821
|
"comfortable": "34px",
|
|
1818
1822
|
"compact": "30px"
|
|
@@ -1882,8 +1886,8 @@ export var preset = {
|
|
|
1882
1886
|
"compact": "{spaceS}"
|
|
1883
1887
|
},
|
|
1884
1888
|
"spaceContainerHorizontal": {
|
|
1885
|
-
"comfortable": "{
|
|
1886
|
-
"compact": "{
|
|
1889
|
+
"comfortable": "{spaceL}",
|
|
1890
|
+
"compact": "{spaceL}"
|
|
1887
1891
|
},
|
|
1888
1892
|
"spaceContentHeaderPaddingBottom": {
|
|
1889
1893
|
"comfortable": "{spaceXl}",
|
|
@@ -6120,6 +6124,7 @@ export var preset = {
|
|
|
6120
6124
|
"sizeIconLarge": "density",
|
|
6121
6125
|
"sizeIconMedium": "density",
|
|
6122
6126
|
"sizeIconNormal": "density",
|
|
6127
|
+
"sizeTableSelectionHorizontal": "density",
|
|
6123
6128
|
"sizeVerticalInput": "density",
|
|
6124
6129
|
"sizeVerticalPanelIconOffset": "density",
|
|
6125
6130
|
"spaceAlertActionLeft": "density",
|
|
@@ -7212,6 +7217,7 @@ export var preset = {
|
|
|
7212
7217
|
"sizeIconLarge": "size-icon-large",
|
|
7213
7218
|
"sizeIconMedium": "size-icon-medium",
|
|
7214
7219
|
"sizeIconNormal": "size-icon-normal",
|
|
7220
|
+
"sizeTableSelectionHorizontal": "size-table-selection-horizontal",
|
|
7215
7221
|
"sizeVerticalInput": "size-vertical-input",
|
|
7216
7222
|
"sizeVerticalPanelIconOffset": "size-vertical-panel-icon-offset",
|
|
7217
7223
|
"spaceAlertActionLeft": "space-alert-action-left",
|
|
@@ -7858,6 +7864,7 @@ export var preset = {
|
|
|
7858
7864
|
"sizeIconLarge": "--size-icon-large-9vh494",
|
|
7859
7865
|
"sizeIconMedium": "--size-icon-medium-fvz0oi",
|
|
7860
7866
|
"sizeIconNormal": "--size-icon-normal-j1z5fn",
|
|
7867
|
+
"sizeTableSelectionHorizontal": "--size-table-selection-horizontal-o8c8gs",
|
|
7861
7868
|
"sizeVerticalInput": "--size-vertical-input-js5hfh",
|
|
7862
7869
|
"sizeVerticalPanelIconOffset": "--size-vertical-panel-icon-offset-ti40n4",
|
|
7863
7870
|
"spaceAlertActionLeft": "--space-alert-action-left-hi50rw",
|
|
@@ -7871,11 +7878,11 @@ export var preset = {
|
|
|
7871
7878
|
"spaceButtonModalDismissVertical": "--space-button-modal-dismiss-vertical-r4lx2k",
|
|
7872
7879
|
"spaceCalendarGridFocusOutlineGutter": "--space-calendar-grid-focus-outline-gutter-v3dwvl",
|
|
7873
7880
|
"spaceCalendarGridSelectedFocusOutlineGutter": "--space-calendar-grid-selected-focus-outline-gutter-gqgjqz",
|
|
7874
|
-
"spaceCardHorizontal": "--space-card-horizontal-
|
|
7881
|
+
"spaceCardHorizontal": "--space-card-horizontal-di7llb",
|
|
7875
7882
|
"spaceCodeEditorStatusFocusOutlineGutter": "--space-code-editor-status-focus-outline-gutter-eivtla",
|
|
7876
7883
|
"spaceContainerContentTop": "--space-container-content-top-fsd8nr",
|
|
7877
7884
|
"spaceContainerHeaderVertical": "--space-container-header-vertical-zsjhel",
|
|
7878
|
-
"spaceContainerHorizontal": "--space-container-horizontal-
|
|
7885
|
+
"spaceContainerHorizontal": "--space-container-horizontal-tlw03i",
|
|
7879
7886
|
"spaceContentHeaderPaddingBottom": "--space-content-header-padding-bottom-nvqytg",
|
|
7880
7887
|
"spaceDarkHeaderOverlapDistance": "--space-dark-header-overlap-distance-hfejul",
|
|
7881
7888
|
"spaceExpandableSectionIconOffsetTop": "--space-expandable-section-icon-offset-top-svbirl",
|
|
@@ -7891,7 +7898,7 @@ export var preset = {
|
|
|
7891
7898
|
"spaceLayoutToggleDiameter": "--space-layout-toggle-diameter-hzvqtj",
|
|
7892
7899
|
"spaceLayoutTogglePadding": "--space-layout-toggle-padding-axl9jr",
|
|
7893
7900
|
"spaceModalContentBottom": "--space-modal-content-bottom-cecclv",
|
|
7894
|
-
"spaceModalHorizontal": "--space-modal-horizontal-
|
|
7901
|
+
"spaceModalHorizontal": "--space-modal-horizontal-ah0xld",
|
|
7895
7902
|
"spacePanelNavLeft": "--space-panel-nav-left-o5fvw3",
|
|
7896
7903
|
"spacePanelSideLeft": "--space-panel-side-left-8ozqve",
|
|
7897
7904
|
"spacePanelSideRight": "--space-panel-side-right-kev4k9",
|
|
@@ -7899,7 +7906,7 @@ export var preset = {
|
|
|
7899
7906
|
"spaceSegmentedControlFocusOutlineGutter": "--space-segmented-control-focus-outline-gutter-99x5b9",
|
|
7900
7907
|
"spaceTableHeaderFocusOutlineGutter": "--space-table-header-focus-outline-gutter-rbx7m7",
|
|
7901
7908
|
"spaceTabsContentTop": "--space-tabs-content-top-mn4c9x",
|
|
7902
|
-
"spaceTableHorizontal": "--space-table-horizontal-
|
|
7909
|
+
"spaceTableHorizontal": "--space-table-horizontal-mj7h0h",
|
|
7903
7910
|
"spaceTableHeaderHorizontal": "--space-table-header-horizontal-et2ko8",
|
|
7904
7911
|
"spaceTableContentBottom": "--space-table-content-bottom-pg6yvn",
|
|
7905
7912
|
"spaceTableContentTop": "--space-table-content-top-t15dd1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom.d.ts","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"bottom.d.ts","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAMtD,UAAU,4BAA6B,SAAQ,sBAAsB;IACnE,KAAK,EAAE,gBAAgB,CAAC;IACxB,uBAAuB,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,iBAAiB,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;CACpD;AAED,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,MAAM,EACN,KAAK,EACL,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,QAAQ,GACT,EAAE,4BAA4B,eA2D9B"}
|
|
@@ -2,17 +2,25 @@ import { __assign } from "tslib";
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useEffect, useRef } from 'react';
|
|
6
6
|
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
7
7
|
import styles from './styles.css.js';
|
|
8
8
|
import { useSplitPanelContext } from '../internal/context/split-panel-context';
|
|
9
9
|
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
10
|
+
import { useResizeObserver } from '../internal/hooks/container-queries';
|
|
10
11
|
export function SplitPanelContentBottom(_a) {
|
|
11
12
|
var _b, _c, _d;
|
|
12
13
|
var baseProps = _a.baseProps, isOpen = _a.isOpen, state = _a.state, transitioningElementRef = _a.transitioningElementRef, splitPanelRef = _a.splitPanelRef, cappedSize = _a.cappedSize, header = _a.header, resizeHandle = _a.resizeHandle, children = _a.children, appLayoutMaxWidth = _a.appLayoutMaxWidth, panelHeaderId = _a.panelHeaderId, onToggle = _a.onToggle;
|
|
13
14
|
var isRefresh = useVisualRefresh();
|
|
14
|
-
var _e = useSplitPanelContext(), bottomOffset = _e.bottomOffset, leftOffset = _e.leftOffset, rightOffset = _e.rightOffset, disableContentPaddings = _e.disableContentPaddings, contentWrapperPaddings = _e.contentWrapperPaddings, isMobile = _e.isMobile,
|
|
15
|
+
var _e = useSplitPanelContext(), bottomOffset = _e.bottomOffset, leftOffset = _e.leftOffset, rightOffset = _e.rightOffset, disableContentPaddings = _e.disableContentPaddings, contentWrapperPaddings = _e.contentWrapperPaddings, isMobile = _e.isMobile, reportHeaderHeight = _e.reportHeaderHeight;
|
|
15
16
|
var transitionContentBottomRef = useMergeRefs(splitPanelRef || null, transitioningElementRef);
|
|
17
|
+
var headerRef = useRef(null);
|
|
18
|
+
useResizeObserver(headerRef, function (entry) { return reportHeaderHeight(entry.borderBoxHeight); });
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
// report empty height when unmounting the panel
|
|
21
|
+
return function () { return reportHeaderHeight(0); };
|
|
22
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
|
+
}, []);
|
|
16
24
|
var centeredMaxWidthClasses = clsx((_b = {},
|
|
17
25
|
_b[styles['pane-bottom-center-align']] = isRefresh,
|
|
18
26
|
_b[styles['pane-bottom-content-nav-padding']] = contentWrapperPaddings === null || contentWrapperPaddings === void 0 ? void 0 : contentWrapperPaddings.closedNav,
|
|
@@ -32,7 +40,7 @@ export function SplitPanelContentBottom(_a) {
|
|
|
32
40
|
}, ref: transitionContentBottomRef }),
|
|
33
41
|
isOpen && React.createElement("div", { className: styles['slider-wrapper-bottom'] }, resizeHandle),
|
|
34
42
|
React.createElement("div", { className: styles['drawer-content-bottom'], "aria-labelledby": panelHeaderId, role: "region" },
|
|
35
|
-
React.createElement("div", { className: clsx(styles['pane-header-wrapper-bottom'], centeredMaxWidthClasses), ref:
|
|
43
|
+
React.createElement("div", { className: clsx(styles['pane-header-wrapper-bottom'], centeredMaxWidthClasses), ref: headerRef }, header),
|
|
36
44
|
React.createElement("div", { className: clsx(styles['content-bottom'], centeredMaxWidthClasses), "aria-hidden": !isOpen },
|
|
37
45
|
React.createElement("div", { className: clsx((_d = {}, _d[styles['content-bottom-max-width']] = isRefresh, _d)), style: appLayoutMaxWidth }, children)))));
|
|
38
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom.js","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bottom.js","sourceRoot":"","sources":["../../../src/split-panel/bottom.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAQxE,MAAM,UAAU,uBAAuB,CAAC,EAaT;;QAZ7B,SAAS,eAAA,EACT,MAAM,YAAA,EACN,KAAK,WAAA,EACL,uBAAuB,6BAAA,EACvB,aAAa,mBAAA,EACb,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,iBAAiB,uBAAA,EACjB,aAAa,mBAAA,EACb,QAAQ,cAAA;IAER,IAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IAC/B,IAAA,KAQF,oBAAoB,EAAE,EAPxB,YAAY,kBAAA,EACZ,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,sBAAsB,4BAAA,EACtB,sBAAsB,4BAAA,EAC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,cAAM,OAAA,CAAC,MAAM,IAAI,QAAQ,EAAE,EAArB,CAAqB,EACpC,KAAK,EAAE;YACL,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;SACxC,EACD,GAAG,EAAE,0BAA0B;QAE9B,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,YAAY,CAAO;QAChF,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,qBAAmB,aAAa,EAAE,IAAI,EAAC,QAAQ;YAC5F,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,EAAE,uBAAuB,CAAC,EAAE,GAAG,EAAE,SAAS,IAChG,MAAM,CACH;YACN,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,iBAAe,CAAC,MAAM;gBAC3F,6BAAK,SAAS,EAAE,IAAI,WAAG,GAAC,MAAM,CAAC,0BAA0B,CAAC,IAAG,SAAS,MAAG,EAAE,KAAK,EAAE,iBAAiB,IAChG,QAAQ,CACL,CACF,CACF,CACF,CACP,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, { useEffect, useRef } from 'react';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { TransitionStatus } from '../internal/components/transition';\nimport { SplitPanelContentProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useResizeObserver } from '../internal/hooks/container-queries';\n\ninterface SplitPanelContentBottomProps extends SplitPanelContentProps {\n state: TransitionStatus;\n transitioningElementRef: React.Ref<any>;\n appLayoutMaxWidth: React.CSSProperties | undefined;\n}\n\nexport function SplitPanelContentBottom({\n baseProps,\n isOpen,\n state,\n transitioningElementRef,\n splitPanelRef,\n cappedSize,\n header,\n resizeHandle,\n children,\n appLayoutMaxWidth,\n panelHeaderId,\n onToggle,\n}: SplitPanelContentBottomProps) {\n const isRefresh = useVisualRefresh();\n const {\n bottomOffset,\n leftOffset,\n rightOffset,\n disableContentPaddings,\n contentWrapperPaddings,\n isMobile,\n reportHeaderHeight,\n } = useSplitPanelContext();\n const transitionContentBottomRef = useMergeRefs(splitPanelRef || null, transitioningElementRef);\n\n const headerRef = useRef<HTMLDivElement>(null);\n useResizeObserver(headerRef, entry => reportHeaderHeight(entry.borderBoxHeight));\n useEffect(() => {\n // report empty height when unmounting the panel\n return () => reportHeaderHeight(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const centeredMaxWidthClasses = clsx({\n [styles['pane-bottom-center-align']]: isRefresh,\n [styles['pane-bottom-content-nav-padding']]: contentWrapperPaddings?.closedNav,\n [styles['pane-bottom-content-tools-padding']]: contentWrapperPaddings?.closedTools,\n });\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.root, styles.drawer, styles['position-bottom'], {\n [styles['drawer-closed']]: !isOpen,\n [styles['drawer-mobile']]: isMobile,\n [styles['drawer-disable-content-paddings']]: disableContentPaddings,\n [styles.animating]: isRefresh && (state === 'entering' || state === 'exiting'),\n [styles.refresh]: isRefresh,\n })}\n onClick={() => !isOpen && onToggle()}\n style={{\n bottom: bottomOffset,\n left: leftOffset,\n right: rightOffset,\n height: isOpen ? cappedSize : undefined,\n }}\n ref={transitionContentBottomRef}\n >\n {isOpen && <div className={styles['slider-wrapper-bottom']}>{resizeHandle}</div>}\n <div className={styles['drawer-content-bottom']} aria-labelledby={panelHeaderId} role=\"region\">\n <div className={clsx(styles['pane-header-wrapper-bottom'], centeredMaxWidthClasses)} ref={headerRef}>\n {header}\n </div>\n <div className={clsx(styles['content-bottom'], centeredMaxWidthClasses)} aria-hidden={!isOpen}>\n <div className={clsx({ [styles['content-bottom-max-width']]: isRefresh })} style={appLayoutMaxWidth}>\n {children}\n </div>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AAmBjE,OAAO,EAAE,eAAe,EAAE,CAAC;AAK3B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,qBAA6B,EAC7B,WAAW,EACX,GAAG,SAAS,EACb,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AAmBjE,OAAO,EAAE,eAAe,EAAE,CAAC;AAK3B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,qBAA6B,EAC7B,WAAW,EACX,GAAG,SAAS,EACb,EAAE,eAAe,eA4RjB"}
|
|
@@ -29,7 +29,7 @@ export default function SplitPanel(_a) {
|
|
|
29
29
|
var header = _a.header, children = _a.children, _b = _a.hidePreferencesButton, hidePreferencesButton = _b === void 0 ? false : _b, i18nStrings = _a.i18nStrings, restProps = __rest(_a, ["header", "children", "hidePreferencesButton", "i18nStrings"]);
|
|
30
30
|
var isRefresh = useVisualRefresh();
|
|
31
31
|
var __internalRootRef = useBaseComponent('SplitPanel').__internalRootRef;
|
|
32
|
-
var _c = useSplitPanelContext(), size = _c.size, getMaxWidth = _c.getMaxWidth, getMaxHeight = _c.getMaxHeight, position = _c.position, topOffset = _c.topOffset, bottomOffset = _c.bottomOffset, rightOffset = _c.rightOffset, contentWidthStyles = _c.contentWidthStyles, isOpen = _c.isOpen, isForcedPosition = _c.isForcedPosition,
|
|
32
|
+
var _c = useSplitPanelContext(), size = _c.size, getMaxWidth = _c.getMaxWidth, getMaxHeight = _c.getMaxHeight, position = _c.position, topOffset = _c.topOffset, bottomOffset = _c.bottomOffset, rightOffset = _c.rightOffset, contentWidthStyles = _c.contentWidthStyles, isOpen = _c.isOpen, isForcedPosition = _c.isForcedPosition, lastInteraction = _c.lastInteraction, onPreferencesChange = _c.onPreferencesChange, onResize = _c.onResize, onToggle = _c.onToggle, reportSize = _c.reportSize, setOpenButtonAriaLabel = _c.setOpenButtonAriaLabel;
|
|
33
33
|
var baseProps = getBaseProps(restProps);
|
|
34
34
|
var focusVisible = useFocusVisible();
|
|
35
35
|
var _d = useState(false), isPreferencesOpen = _d[0], setPreferencesOpen = _d[1];
|
|
@@ -134,7 +134,7 @@ export default function SplitPanel(_a) {
|
|
|
134
134
|
root.style[property] = valueBefore;
|
|
135
135
|
}
|
|
136
136
|
}, [rightOffset, __internalRootRef]);
|
|
137
|
-
var mergedRef = useMergeRefs(
|
|
137
|
+
var mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);
|
|
138
138
|
/**
|
|
139
139
|
* The AppLayout factor moved the circular buttons out of the
|
|
140
140
|
* SplitPanel and into the Tools component. This conditional
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/split-panel/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,eAAe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AAE,QAAQ,KAAK,QAAQ,IAAI,gBAAgB,EAC/D,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE;gBACX,MAAM,EAAE,WAAW,CAAC,gBAAgB;gBACpC,OAAO,EAAE,WAAW,CAAC,kBAAkB;gBACvC,MAAM,EAAE,WAAW,CAAC,iBAAiB;gBACrC,aAAa,EAAE,WAAW,CAAC,wBAAwB;gBACnD,mBAAmB,EAAE,WAAW,CAAC,8BAA8B;gBAC/D,cAAc,EAAE,WAAW,CAAC,yBAAyB;gBACrD,YAAY,EAAE,WAAW,CAAC,uBAAuB;aAClD,EACD,SAAS,EAAE,UAAA,WAAW;gBACpB,mBAAmB,cAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE;gBACT,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,EA7DoC,CA6DpC,CACU,CACd,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport useFocusVisible from '../internal/hooks/focus-visible';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\n\nimport { SplitPanelProps, SizeControlProps } from './interfaces';\nimport ResizeHandler from './icons/resize-handler';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from './utils/use-pointer-events';\nimport { useKeyboardEvents } from './utils/use-keyboard-events';\n\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { getLimitedValue } from './utils/size-utils';\nimport { Transition } from '../internal/components/transition';\nimport { ButtonProps } from '../button/interfaces';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\n\nexport { SplitPanelProps };\n\nconst MIN_HEIGHT = 160;\nconst MIN_WIDTH = 280;\n\nexport default function SplitPanel({\n header,\n children,\n hidePreferencesButton = false,\n i18nStrings,\n ...restProps\n}: SplitPanelProps) {\n const isRefresh = useVisualRefresh();\n const { __internalRootRef } = useBaseComponent('SplitPanel');\n const {\n size,\n getMaxWidth,\n getMaxHeight,\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n splitPanelRef,\n lastInteraction,\n onPreferencesChange,\n onResize,\n onToggle,\n reportSize,\n setOpenButtonAriaLabel,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const focusVisible = useFocusVisible();\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n const [relativeSize, setRelativeSize] = useState(0);\n const [maxSize, setMaxSize] = useState(size);\n const minSize = position === 'bottom' ? MIN_HEIGHT : MIN_WIDTH;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n useEffect(() => {\n setOpenButtonAriaLabel?.(i18nStrings.openButtonAriaLabel);\n }, [setOpenButtonAriaLabel, i18nStrings.openButtonAriaLabel]);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = position === 'bottom' ? getMaxHeight() : getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n setMaxSize(maxSize);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, position, getMaxHeight, getMaxWidth]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n const handler = () => setMaxSize(position === 'bottom' ? getMaxHeight() : getMaxWidth());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxWidth, getMaxHeight]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(MIN_WIDTH, width, maxWidth);\n\n if (isOpen && maxWidth >= MIN_WIDTH) {\n onResize({ size });\n }\n };\n\n const setBottomPanelHeight = (height: number) => {\n const maxHeight = getMaxHeight();\n const size = getLimitedValue(MIN_HEIGHT, height, maxHeight);\n\n if (isOpen && maxHeight >= MIN_HEIGHT) {\n onResize({ size });\n }\n };\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n const handleRef = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n splitPanelRef: splitPanelRefObject,\n handleRef,\n setSidePanelWidth,\n setBottomPanelHeight,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const toggleRef = useRef<ButtonProps.Ref>(null);\n const closeRef = useRef<ButtonProps.Ref>(null);\n const preferencesRef = useRef<ButtonProps.Ref>(null);\n\n useEffectOnUpdate(() => {\n switch (lastInteraction?.type) {\n case 'open':\n return handleRef.current?.focus();\n case 'close':\n return toggleRef.current?.focus();\n case 'position':\n return preferencesRef.current?.focus();\n default:\n return;\n }\n }, [lastInteraction]);\n\n const wrappedChildren = (\n <AppLayoutContext.Provider\n value={{\n stickyOffsetTop: topOffset,\n stickyOffsetBottom: bottomOffset,\n }}\n >\n {children}\n </AppLayoutContext.Provider>\n );\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={styles.header} style={appLayoutMaxWidth}>\n <h2 className={styles['header-text']} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={styles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18nStrings.preferencesTitle}\n ref={preferencesRef}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={styles['close-button']}\n iconName={isRefresh && position === 'side' ? 'angle-right' : isRefresh ? 'angle-down' : 'close'}\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18nStrings.closeButtonAriaLabel}\n ref={closeRef}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' ? null : (\n <InternalButton\n className={styles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18nStrings.openButtonAriaLabel}\n ref={toggleRef}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <div\n ref={handleRef}\n role=\"slider\"\n tabIndex={0}\n aria-label={i18nStrings.resizeHandleAriaLabel}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(styles.slider, styles[`slider-${position}`])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n {...focusVisible}\n >\n <ResizeHandler className={clsx(styles['slider-icon'], styles[`slider-icon-${position}`])} />\n </div>\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = __internalRootRef.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRef, splitPanelRefObject, __internalRootRef);\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <Transition in={isOpen ?? false}>\n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={cappedSize}\n onToggle={onToggle}\n i18nStrings={i18nStrings}\n toggleRef={toggleRef}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n >\n {wrappedChildren}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={cappedSize}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n state={state}\n transitioningElementRef={transitioningElementRef}\n appLayoutMaxWidth={appLayoutMaxWidth}\n >\n {wrappedChildren}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18nStrings.preferencesTitle,\n confirm: i18nStrings.preferencesConfirm,\n cancel: i18nStrings.preferencesCancel,\n positionLabel: i18nStrings.preferencesPositionLabel,\n positionDescription: i18nStrings.preferencesPositionDescription,\n positionBottom: i18nStrings.preferencesPositionBottom,\n positionSide: i18nStrings.preferencesPositionSide,\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n )}\n </Transition>\n );\n}\n\napplyDisplayName(SplitPanel, 'SplitPanel');\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["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AAE,SAAS,EACxB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,EACZ,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,EAAE,iBAAiB,IAEnC,eAAe,CACQ,CAC3B;QACA,iBAAiB,IAAI,CACpB,oBAAC,gBAAgB,IACf,OAAO,EAAE,IAAI,EACb,WAAW,EAAE,EAAE,QAAQ,UAAA,EAAE,EACzB,oBAAoB,EAAE,QAAQ,KAAK,QAAQ,IAAI,gBAAgB,EAC/D,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE;gBACX,MAAM,EAAE,WAAW,CAAC,gBAAgB;gBACpC,OAAO,EAAE,WAAW,CAAC,kBAAkB;gBACvC,MAAM,EAAE,WAAW,CAAC,iBAAiB;gBACrC,aAAa,EAAE,WAAW,CAAC,wBAAwB;gBACnD,mBAAmB,EAAE,WAAW,CAAC,8BAA8B;gBAC/D,cAAc,EAAE,WAAW,CAAC,yBAAyB;gBACrD,YAAY,EAAE,WAAW,CAAC,uBAAuB;aAClD,EACD,SAAS,EAAE,UAAA,WAAW;gBACpB,mBAAmB,cAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE;gBACT,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,EA7DoC,CA6DpC,CACU,CACd,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport useFocusVisible from '../internal/hooks/focus-visible';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\n\nimport { SplitPanelProps, SizeControlProps } from './interfaces';\nimport ResizeHandler from './icons/resize-handler';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from './utils/use-pointer-events';\nimport { useKeyboardEvents } from './utils/use-keyboard-events';\n\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { getLimitedValue } from './utils/size-utils';\nimport { Transition } from '../internal/components/transition';\nimport { ButtonProps } from '../button/interfaces';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\n\nexport { SplitPanelProps };\n\nconst MIN_HEIGHT = 160;\nconst MIN_WIDTH = 280;\n\nexport default function SplitPanel({\n header,\n children,\n hidePreferencesButton = false,\n i18nStrings,\n ...restProps\n}: SplitPanelProps) {\n const isRefresh = useVisualRefresh();\n const { __internalRootRef } = useBaseComponent('SplitPanel');\n const {\n size,\n getMaxWidth,\n getMaxHeight,\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n lastInteraction,\n onPreferencesChange,\n onResize,\n onToggle,\n reportSize,\n setOpenButtonAriaLabel,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const focusVisible = useFocusVisible();\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n const [relativeSize, setRelativeSize] = useState(0);\n const [maxSize, setMaxSize] = useState(size);\n const minSize = position === 'bottom' ? MIN_HEIGHT : MIN_WIDTH;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n useEffect(() => {\n setOpenButtonAriaLabel?.(i18nStrings.openButtonAriaLabel);\n }, [setOpenButtonAriaLabel, i18nStrings.openButtonAriaLabel]);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = position === 'bottom' ? getMaxHeight() : getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n setMaxSize(maxSize);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, position, getMaxHeight, getMaxWidth]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n const handler = () => setMaxSize(position === 'bottom' ? getMaxHeight() : getMaxWidth());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxWidth, getMaxHeight]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(MIN_WIDTH, width, maxWidth);\n\n if (isOpen && maxWidth >= MIN_WIDTH) {\n onResize({ size });\n }\n };\n\n const setBottomPanelHeight = (height: number) => {\n const maxHeight = getMaxHeight();\n const size = getLimitedValue(MIN_HEIGHT, height, maxHeight);\n\n if (isOpen && maxHeight >= MIN_HEIGHT) {\n onResize({ size });\n }\n };\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n const handleRef = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n splitPanelRef: splitPanelRefObject,\n handleRef,\n setSidePanelWidth,\n setBottomPanelHeight,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const toggleRef = useRef<ButtonProps.Ref>(null);\n const closeRef = useRef<ButtonProps.Ref>(null);\n const preferencesRef = useRef<ButtonProps.Ref>(null);\n\n useEffectOnUpdate(() => {\n switch (lastInteraction?.type) {\n case 'open':\n return handleRef.current?.focus();\n case 'close':\n return toggleRef.current?.focus();\n case 'position':\n return preferencesRef.current?.focus();\n default:\n return;\n }\n }, [lastInteraction]);\n\n const wrappedChildren = (\n <AppLayoutContext.Provider\n value={{\n stickyOffsetTop: topOffset,\n stickyOffsetBottom: bottomOffset,\n }}\n >\n {children}\n </AppLayoutContext.Provider>\n );\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={styles.header} style={appLayoutMaxWidth}>\n <h2 className={styles['header-text']} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={styles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18nStrings.preferencesTitle}\n ref={preferencesRef}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={styles['close-button']}\n iconName={isRefresh && position === 'side' ? 'angle-right' : isRefresh ? 'angle-down' : 'close'}\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18nStrings.closeButtonAriaLabel}\n ref={closeRef}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' ? null : (\n <InternalButton\n className={styles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18nStrings.openButtonAriaLabel}\n ref={toggleRef}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <div\n ref={handleRef}\n role=\"slider\"\n tabIndex={0}\n aria-label={i18nStrings.resizeHandleAriaLabel}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(styles.slider, styles[`slider-${position}`])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n {...focusVisible}\n >\n <ResizeHandler className={clsx(styles['slider-icon'], styles[`slider-icon-${position}`])} />\n </div>\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = __internalRootRef.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <Transition in={isOpen ?? false}>\n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={cappedSize}\n onToggle={onToggle}\n i18nStrings={i18nStrings}\n toggleRef={toggleRef}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n >\n {wrappedChildren}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={cappedSize}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n state={state}\n transitioningElementRef={transitioningElementRef}\n appLayoutMaxWidth={appLayoutMaxWidth}\n >\n {wrappedChildren}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18nStrings.preferencesTitle,\n confirm: i18nStrings.preferencesConfirm,\n cancel: i18nStrings.preferencesCancel,\n positionLabel: i18nStrings.preferencesPositionLabel,\n positionDescription: i18nStrings.preferencesPositionDescription,\n positionBottom: i18nStrings.preferencesPositionBottom,\n positionSide: i18nStrings.preferencesPositionSide,\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n )}\n </Transition>\n );\n}\n\napplyDisplayName(SplitPanel, 'SplitPanel');\n"]}
|
|
@@ -12,8 +12,10 @@ interface TableBodyCellProps {
|
|
|
12
12
|
isNextSelected: boolean;
|
|
13
13
|
isPrevSelected: boolean;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
+
hasSelection?: boolean;
|
|
16
|
+
hasFooter?: boolean;
|
|
15
17
|
}
|
|
16
|
-
export declare function TableBodyCell({ className, style, children, wrapLines, isFirstRow, isLastRow, isSelected, isNextSelected, isPrevSelected, isEvenRow, stripedRows, }: TableBodyCellProps): JSX.Element;
|
|
18
|
+
export declare function TableBodyCell({ className, style, children, wrapLines, isFirstRow, isLastRow, isSelected, isNextSelected, isPrevSelected, isEvenRow, stripedRows, hasSelection, hasFooter, }: TableBodyCellProps): JSX.Element;
|
|
17
19
|
interface TableBodyCellContentProps<ItemType> extends TableBodyCellProps {
|
|
18
20
|
column: TableProps.ColumnDefinition<ItemType>;
|
|
19
21
|
item: ItemType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,cAAc,EACd,cAAc,EACd,SAAS,EACT,WAAW,EACX,YAAY,EACZ,SAAS,GACV,EAAE,kBAAkB,eAyBpB;AAED,UAAU,yBAAyB,CAAC,QAAQ,CAAE,SAAQ,kBAAkB;IACtE,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,yBAAyB,CAAC,QAAQ,CAAC,eAE5G"}
|
|
@@ -4,9 +4,11 @@ import { __assign, __rest } from "tslib";
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import styles from './styles.css.js';
|
|
6
6
|
import React from 'react';
|
|
7
|
+
import { useVisualRefresh } from '../../internal/hooks/use-visual-mode';
|
|
7
8
|
export function TableBodyCell(_a) {
|
|
8
|
-
var className = _a.className, style = _a.style, children = _a.children, wrapLines = _a.wrapLines, isFirstRow = _a.isFirstRow, isLastRow = _a.isLastRow, isSelected = _a.isSelected, isNextSelected = _a.isNextSelected, isPrevSelected = _a.isPrevSelected, isEvenRow = _a.isEvenRow, stripedRows = _a.stripedRows;
|
|
9
|
-
|
|
9
|
+
var className = _a.className, style = _a.style, children = _a.children, wrapLines = _a.wrapLines, isFirstRow = _a.isFirstRow, isLastRow = _a.isLastRow, isSelected = _a.isSelected, isNextSelected = _a.isNextSelected, isPrevSelected = _a.isPrevSelected, isEvenRow = _a.isEvenRow, stripedRows = _a.stripedRows, hasSelection = _a.hasSelection, hasFooter = _a.hasFooter;
|
|
10
|
+
var isVisualRefresh = useVisualRefresh();
|
|
11
|
+
return (React.createElement("td", { style: style, className: clsx(className, styles['body-cell'], wrapLines && styles['body-cell-wrap'], isFirstRow && styles['body-cell-first-row'], isLastRow && styles['body-cell-last-row'], isSelected && styles['body-cell-selected'], isNextSelected && styles['body-cell-next-selected'], isPrevSelected && styles['body-cell-prev-selected'], !isEvenRow && stripedRows && styles['body-cell-shaded'], stripedRows && styles['has-striped-rows'], isVisualRefresh && styles['is-visual-refresh'], hasSelection && styles['has-selection'], hasFooter && styles['has-footer']) }, children));
|
|
10
12
|
}
|
|
11
13
|
export function TableBodyCellContent(_a) {
|
|
12
14
|
var item = _a.item, column = _a.column, rest = __rest(_a, ["item", "column"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/body-cell/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/body-cell/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,i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AG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAiB,CAAC;AACtE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport React from 'react';\nimport { TableProps } from '../interfaces';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\n\ninterface TableBodyCellProps {\n className?: string;\n style?: React.CSSProperties;\n wrapLines: boolean | undefined;\n isFirstRow: boolean;\n isLastRow: boolean;\n isEvenRow?: boolean;\n stripedRows?: boolean;\n isSelected: boolean;\n isNextSelected: boolean;\n isPrevSelected: boolean;\n children?: React.ReactNode;\n hasSelection?: boolean;\n hasFooter?: boolean;\n}\n\nexport function TableBodyCell({\n className,\n style,\n children,\n wrapLines,\n isFirstRow,\n isLastRow,\n isSelected,\n isNextSelected,\n isPrevSelected,\n isEvenRow,\n stripedRows,\n hasSelection,\n hasFooter,\n}: TableBodyCellProps) {\n const isVisualRefresh = useVisualRefresh();\n\n return (\n <td\n style={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 )}\n >\n {children}\n </td>\n );\n}\n\ninterface TableBodyCellContentProps<ItemType> extends TableBodyCellProps {\n column: TableProps.ColumnDefinition<ItemType>;\n item: ItemType;\n}\n\nexport function TableBodyCellContent<ItemType>({ item, column, ...rest }: TableBodyCellContentProps<ItemType>) {\n return <TableBodyCell {...rest}>{column.cell(item)}</TableBodyCell>;\n}\n"]}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"body-cell": "awsui_body-
|
|
5
|
-
"body-cell-wrap": "awsui_body-cell-
|
|
6
|
-
"body-cell-first-row": "awsui_body-cell-first-
|
|
7
|
-
"body-cell-last-row": "awsui_body-cell-last-
|
|
8
|
-
"body-cell-
|
|
9
|
-
"
|
|
10
|
-
"body-cell-
|
|
11
|
-
"body-cell-
|
|
4
|
+
"body-cell": "awsui_body-cell_c6tup_nv0er_9",
|
|
5
|
+
"body-cell-wrap": "awsui_body-cell-wrap_c6tup_nv0er_18",
|
|
6
|
+
"body-cell-first-row": "awsui_body-cell-first-row_c6tup_nv0er_30",
|
|
7
|
+
"body-cell-last-row": "awsui_body-cell-last-row_c6tup_nv0er_33",
|
|
8
|
+
"body-cell-selected": "awsui_body-cell-selected_c6tup_nv0er_33",
|
|
9
|
+
"has-footer": "awsui_has-footer_c6tup_nv0er_33",
|
|
10
|
+
"body-cell-shaded": "awsui_body-cell-shaded_c6tup_nv0er_43",
|
|
11
|
+
"body-cell-next-selected": "awsui_body-cell-next-selected_c6tup_nv0er_65",
|
|
12
|
+
"body-cell-prev-selected": "awsui_body-cell-prev-selected_c6tup_nv0er_69",
|
|
13
|
+
"is-visual-refresh": "awsui_is-visual-refresh_c6tup_nv0er_98",
|
|
14
|
+
"has-selection": "awsui_has-selection_c6tup_nv0er_114",
|
|
15
|
+
"has-striped-rows": "awsui_has-striped-rows_c6tup_nv0er_117"
|
|
12
16
|
};
|
|
13
17
|
|