@cloudscape-design/components 3.0.1409 → 3.0.1410
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/autosuggest/index.d.ts.map +1 -1
- package/autosuggest/index.js +1 -1
- package/autosuggest/index.js.map +1 -1
- package/autosuggest/internal.d.ts +8 -1
- package/autosuggest/internal.d.ts.map +1 -1
- package/autosuggest/internal.js +2 -2
- package/autosuggest/internal.js.map +1 -1
- package/autosuggest/styles.css.js +3 -3
- package/autosuggest/styles.scoped.css +5 -3
- package/autosuggest/styles.selectors.js +3 -3
- package/cards/index.js +1 -1
- package/cards/index.js.map +1 -1
- package/container/internal.d.ts +3 -2
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +2 -2
- package/container/internal.js.map +1 -1
- package/container/use-sticky-header.d.ts +0 -14
- package/container/use-sticky-header.d.ts.map +1 -1
- package/container/use-sticky-header.js +9 -92
- package/container/use-sticky-header.js.map +1 -1
- package/copy-to-clipboard/internal.d.ts.map +1 -1
- package/copy-to-clipboard/internal.js +2 -16
- package/copy-to-clipboard/internal.js.map +1 -1
- package/copy-to-clipboard/styles.css.js +10 -10
- package/copy-to-clipboard/styles.scoped.css +19 -19
- package/copy-to-clipboard/styles.selectors.js +10 -10
- package/flashbar/collapsible-flashbar.d.ts +1 -0
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js +10 -4
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/flash.d.ts +6 -0
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +6 -6
- package/flashbar/flash.js.map +1 -1
- package/flashbar/internal-interfaces.d.ts +11 -1
- package/flashbar/internal-interfaces.d.ts.map +1 -1
- package/flashbar/internal-interfaces.js.map +1 -1
- package/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/non-collapsible-flashbar.js +8 -1
- package/flashbar/non-collapsible-flashbar.js.map +1 -1
- package/flashbar/styles.css.js +50 -50
- package/flashbar/styles.scoped.css +184 -161
- package/flashbar/styles.selectors.js +50 -50
- package/icon/generated/icons.d.ts +4 -0
- package/icon/generated/icons.d.ts.map +1 -1
- package/icon/generated/icons.js +14 -0
- package/icon/generated/icons.js.map +1 -1
- package/icon/styles.css.js +44 -43
- package/icon/styles.scoped.css +109 -107
- package/icon/styles.selectors.js +44 -43
- package/icon-provider/interfaces.d.ts +1 -1
- package/icon-provider/interfaces.d.ts.map +1 -1
- package/icon-provider/interfaces.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/autosuggest-input/index.d.ts +5 -0
- package/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/internal/components/autosuggest-input/index.js +2 -2
- package/internal/components/autosuggest-input/index.js.map +1 -1
- package/internal/components/option/index.d.ts.map +1 -1
- package/internal/components/option/index.js +2 -2
- package/internal/components/option/index.js.map +1 -1
- package/internal/components/option/styles.css.js +19 -18
- package/internal/components/option/styles.scoped.css +39 -33
- package/internal/components/option/styles.selectors.js +19 -18
- package/internal/components/radio-button/index.d.ts +1 -1
- package/internal/components/radio-button/index.d.ts.map +1 -1
- package/internal/components/radio-button/index.js.map +1 -1
- package/internal/components/radio-button/styles.css.js +7 -7
- package/internal/components/radio-button/styles.scoped.css +36 -12
- package/internal/components/radio-button/styles.selectors.js +7 -7
- package/internal/components/sortable-area/index.d.ts.map +1 -1
- package/internal/components/sortable-area/index.js +34 -4
- package/internal/components/sortable-area/index.js.map +1 -1
- package/internal/components/sortable-area/keyboard-sensor/index.js +1 -1
- package/internal/components/sortable-area/keyboard-sensor/index.js.map +1 -1
- package/{table → internal/components/sticky-header}/sticky-scrolling.d.ts +1 -6
- package/internal/components/sticky-header/sticky-scrolling.d.ts.map +1 -0
- package/{table → internal/components/sticky-header}/sticky-scrolling.js +2 -7
- package/internal/components/sticky-header/sticky-scrolling.js.map +1 -0
- package/internal/components/sticky-header/use-cells-resize-observer.d.ts +1 -0
- package/internal/components/sticky-header/use-cells-resize-observer.d.ts.map +1 -0
- package/internal/components/sticky-header/use-cells-resize-observer.js +39 -0
- package/internal/components/sticky-header/use-cells-resize-observer.js.map +1 -0
- package/internal/components/sticky-header/use-header-stuck.d.ts +7 -0
- package/internal/components/sticky-header/use-header-stuck.d.ts.map +1 -0
- package/internal/components/sticky-header/use-header-stuck.js +35 -0
- package/internal/components/sticky-header/use-header-stuck.js.map +1 -0
- package/internal/components/sticky-header/use-sticky-header-copy.d.ts +19 -0
- package/internal/components/sticky-header/use-sticky-header-copy.d.ts.map +1 -0
- package/{table/use-sticky-header.js → internal/components/sticky-header/use-sticky-header-copy.js} +7 -8
- package/internal/components/sticky-header/use-sticky-header-copy.js.map +1 -0
- package/internal/components/sticky-header/use-sticky-position.d.ts +27 -0
- package/internal/components/sticky-header/use-sticky-position.d.ts.map +1 -0
- package/internal/components/sticky-header/use-sticky-position.js +57 -0
- package/internal/components/sticky-header/use-sticky-position.js.map +1 -0
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/manifest.json +2 -2
- package/multiselect/index.d.ts.map +1 -1
- package/multiselect/index.js +1 -1
- package/multiselect/index.js.map +1 -1
- package/multiselect/internal.d.ts +12 -1
- package/multiselect/internal.d.ts.map +1 -1
- package/multiselect/internal.js +9 -5
- package/multiselect/internal.js.map +1 -1
- package/multiselect/styles.css.js +5 -5
- package/multiselect/styles.scoped.css +17 -5
- package/multiselect/styles.selectors.js +5 -5
- package/package.json +1 -1
- package/radio-button/styles.css.js +1 -1
- package/radio-button/styles.scoped.css +1 -25
- package/radio-button/styles.selectors.js +1 -1
- package/radio-group/internal.d.ts +7 -1
- package/radio-group/internal.d.ts.map +1 -1
- package/radio-group/internal.js +2 -2
- package/radio-group/internal.js.map +1 -1
- package/radio-group/styles.css.js +5 -5
- package/radio-group/styles.scoped.css +7 -6
- package/radio-group/styles.selectors.js +5 -5
- package/segmented-control/internal-segmented-control.d.ts +4 -1
- package/segmented-control/internal-segmented-control.d.ts.map +1 -1
- package/segmented-control/internal-segmented-control.js +3 -3
- package/segmented-control/internal-segmented-control.js.map +1 -1
- package/segmented-control/internal.d.ts +11 -1
- package/segmented-control/internal.d.ts.map +1 -1
- package/segmented-control/internal.js +3 -2
- package/segmented-control/internal.js.map +1 -1
- package/segmented-control/segment.d.ts +2 -0
- package/segmented-control/segment.d.ts.map +1 -1
- package/segmented-control/segment.js +4 -2
- package/segmented-control/segment.js.map +1 -1
- package/segmented-control/styles.css.js +31 -31
- package/segmented-control/styles.scoped.css +119 -82
- package/segmented-control/styles.selectors.js +31 -31
- package/select/index.d.ts.map +1 -1
- package/select/index.js +1 -1
- package/select/index.js.map +1 -1
- package/select/internal.d.ts +8 -0
- package/select/internal.d.ts.map +1 -1
- package/select/internal.js +4 -4
- package/select/internal.js.map +1 -1
- package/select/parts/styles.css.js +22 -21
- package/select/parts/styles.scoped.css +28 -24
- package/select/parts/styles.selectors.js +22 -21
- package/select/parts/trigger.d.ts +6 -0
- package/select/parts/trigger.d.ts.map +1 -1
- package/select/parts/trigger.js +4 -4
- package/select/parts/trigger.js.map +1 -1
- package/select/styles.css.js +3 -3
- package/select/styles.scoped.css +14 -3
- package/select/styles.selectors.js +3 -3
- package/styling/autosuggest.scss +1 -0
- package/styling/flashbar.scss +127 -0
- package/styling/multiselect.scss +80 -0
- package/styling/radio-group.scss +1 -0
- package/styling/segmented-control.scss +111 -0
- package/styling/select.scss +80 -0
- package/table/resizer/styles.css.js +17 -17
- package/table/resizer/styles.scoped.css +30 -29
- package/table/resizer/styles.selectors.js +17 -17
- package/table/sticky-header.d.ts.map +1 -1
- package/table/sticky-header.js +8 -2
- package/table/sticky-header.js.map +1 -1
- package/table/styles.css.js +37 -37
- package/table/styles.scoped.css +47 -47
- package/table/styles.selectors.js +37 -37
- package/table/use-column-widths.d.ts.map +1 -1
- package/table/use-column-widths.js +4 -16
- package/table/use-column-widths.js.map +1 -1
- package/toggle/internal.d.ts.map +1 -1
- package/toggle/internal.js +1 -1
- package/toggle/internal.js.map +1 -1
- package/token-group/internal.d.ts +5 -0
- package/token-group/internal.d.ts.map +1 -1
- package/token-group/internal.js +2 -2
- package/token-group/internal.js.map +1 -1
- package/table/sticky-scrolling.d.ts.map +0 -1
- package/table/sticky-scrolling.js.map +0 -1
- package/table/use-sticky-header.d.ts +0 -5
- package/table/use-sticky-header.d.ts.map +0 -1
- package/table/use-sticky-header.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface StickyHeaderCopyProps {
|
|
3
|
+
tableRef: RefObject<HTMLElement>;
|
|
4
|
+
theadRef: RefObject<HTMLElement>;
|
|
5
|
+
secondaryTheadRef: RefObject<HTMLElement>;
|
|
6
|
+
secondaryTableRef: RefObject<HTMLElement>;
|
|
7
|
+
tableWrapperRef: RefObject<HTMLElement>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useStickyHeaderCopy({
|
|
10
|
+
tableRef,
|
|
11
|
+
theadRef,
|
|
12
|
+
secondaryTheadRef,
|
|
13
|
+
secondaryTableRef,
|
|
14
|
+
tableWrapperRef
|
|
15
|
+
}: StickyHeaderCopyProps): {
|
|
16
|
+
scrollToRow: (itemNode: HTMLElement | null) => void;
|
|
17
|
+
scrollToTop: () => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-header-copy.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/sticky-header/use-sticky-header-copy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAgC,MAAM,OAAO,CAAC;AAOhE,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACjC,QAAQ,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACjC,iBAAiB,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAC1C,iBAAiB,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAC1C,eAAe,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACzC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,EAAE,qBAAqB;4BA4BS,WAAW,GAAG,IAAI;;EAMlD"}
|
package/{table/use-sticky-header.js → internal/components/sticky-header/use-sticky-header-copy.js}
RENAMED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { useCallback, useLayoutEffect } from 'react';
|
|
4
4
|
import { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';
|
|
5
|
-
import { useMobile } from '
|
|
5
|
+
import { useMobile } from '../../hooks/use-mobile';
|
|
6
6
|
import stickyScrolling, { calculateScrollingOffset, scrollUpBy } from './sticky-scrolling';
|
|
7
|
-
export
|
|
7
|
+
export function useStickyHeaderCopy({ tableRef, theadRef, secondaryTheadRef, secondaryTableRef, tableWrapperRef, }) {
|
|
8
8
|
const isMobile = useMobile();
|
|
9
|
-
|
|
10
|
-
const syncColumnHeaderWidths = useCallback(() => {
|
|
9
|
+
const hideHeaderUnderCopy = useCallback(() => {
|
|
11
10
|
var _a;
|
|
12
11
|
if (tableRef.current &&
|
|
13
12
|
theadRef.current &&
|
|
@@ -20,9 +19,9 @@ export const useStickyHeader = (tableRef, theadRef, secondaryTheadRef, secondary
|
|
|
20
19
|
}
|
|
21
20
|
}, [theadRef, secondaryTheadRef, secondaryTableRef, tableWrapperRef, tableRef]);
|
|
22
21
|
useLayoutEffect(() => {
|
|
23
|
-
|
|
22
|
+
hideHeaderUnderCopy();
|
|
24
23
|
});
|
|
25
|
-
useResizeObserver(theadRef,
|
|
24
|
+
useResizeObserver(theadRef, hideHeaderUnderCopy);
|
|
26
25
|
const scrollToTop = () => {
|
|
27
26
|
if (!isMobile && theadRef.current && secondaryTheadRef.current && tableWrapperRef.current) {
|
|
28
27
|
const scrollDist = calculateScrollingOffset(theadRef.current, secondaryTheadRef.current);
|
|
@@ -38,5 +37,5 @@ export const useStickyHeader = (tableRef, theadRef, secondaryTheadRef, secondary
|
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
39
|
return { scrollToRow, scrollToTop };
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=use-sticky-header.js.map
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=use-sticky-header-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-header-copy.js","sourceRoot":"","sources":["../../../../../src/internal/components/sticky-header/use-sticky-header-copy.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,WAAW,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,eAAe,EAAE,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAU3F,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GACO;IACtB,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC;IAC7B,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE;;QAC3C,IACE,QAAQ,CAAC,OAAO;YAChB,QAAQ,CAAC,OAAO;YAChB,iBAAiB,CAAC,OAAO;YACzB,iBAAiB,CAAC,OAAO;YACzB,eAAe,CAAC,OAAO,EACvB,CAAC;YACD,gFAAgF;YAChF,MAAM,KAAK,GAAG,MAAA,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,mCAAI,QAAQ,CAAC,OAAO,CAAC;YACpE,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,GAAG,IAAI,KAAK,CAAC,qBAAqB,EAAE,CAAC,MAAM,IAAI,CAAC;QAChG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChF,eAAe,CAAC,GAAG,EAAE;QACnB,mBAAmB,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,IAAI,iBAAiB,CAAC,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,CAAC;YAC1F,MAAM,UAAU,GAAG,wBAAwB,CAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;YACzF,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;gBACnB,UAAU,CAAC,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IACF,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;IAC7E,MAAM,WAAW,GAAG,CAAC,QAA4B,EAAE,EAAE;QACnD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,YAAY,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,CAAC;IACF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;AACtC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useCallback, useLayoutEffect } from 'react';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useMobile } from '../../hooks/use-mobile';\nimport stickyScrolling, { calculateScrollingOffset, scrollUpBy } from './sticky-scrolling';\n\ninterface StickyHeaderCopyProps {\n tableRef: RefObject<HTMLElement>;\n theadRef: RefObject<HTMLElement>;\n secondaryTheadRef: RefObject<HTMLElement>;\n secondaryTableRef: RefObject<HTMLElement>;\n tableWrapperRef: RefObject<HTMLElement>;\n}\n\nexport function useStickyHeaderCopy({\n tableRef,\n theadRef,\n secondaryTheadRef,\n secondaryTableRef,\n tableWrapperRef,\n}: StickyHeaderCopyProps) {\n const isMobile = useMobile();\n const hideHeaderUnderCopy = useCallback(() => {\n if (\n tableRef.current &&\n theadRef.current &&\n secondaryTheadRef.current &&\n secondaryTableRef.current &&\n tableWrapperRef.current\n ) {\n // Use the full thead height to account for multi-row headers (grouped columns).\n const thead = theadRef.current.closest('thead') ?? theadRef.current;\n tableWrapperRef.current.style.marginBlockStart = `-${thead.getBoundingClientRect().height}px`;\n }\n }, [theadRef, secondaryTheadRef, secondaryTableRef, tableWrapperRef, tableRef]);\n useLayoutEffect(() => {\n hideHeaderUnderCopy();\n });\n useResizeObserver(theadRef, hideHeaderUnderCopy);\n const scrollToTop = () => {\n if (!isMobile && theadRef.current && secondaryTheadRef.current && tableWrapperRef.current) {\n const scrollDist = calculateScrollingOffset(theadRef.current, secondaryTheadRef.current);\n if (scrollDist > 0) {\n scrollUpBy(scrollDist, tableWrapperRef.current);\n }\n }\n };\n const { scrollToItem } = stickyScrolling(tableWrapperRef, secondaryTheadRef);\n const scrollToRow = (itemNode: HTMLElement | null) => {\n if (!isMobile) {\n scrollToItem(itemNode);\n }\n };\n return { scrollToRow, scrollToTop };\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface StickyPositionOptions {
|
|
3
|
+
sticky?: boolean;
|
|
4
|
+
offset?: number;
|
|
5
|
+
mobileOffset?: number;
|
|
6
|
+
disableMobile?: boolean;
|
|
7
|
+
additionalOffset?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function useStickyPosition(rootRef: RefObject<HTMLElement>, headerRef: RefObject<HTMLElement>, {
|
|
10
|
+
sticky,
|
|
11
|
+
offset,
|
|
12
|
+
mobileOffset,
|
|
13
|
+
disableMobile,
|
|
14
|
+
additionalOffset
|
|
15
|
+
}: StickyPositionOptions): {
|
|
16
|
+
isSticky: boolean;
|
|
17
|
+
isStuck: boolean;
|
|
18
|
+
isStuckAtBottom: boolean;
|
|
19
|
+
stickyStyles: {
|
|
20
|
+
style: {
|
|
21
|
+
top: string;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
style?: undefined;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-position.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/sticky-header/use-sticky-position.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAA6B,MAAM,OAAO,CAAC;AAkC7D,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,EAC/B,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,EACjC,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAwB,EAAE,EAAE,qBAAqB;;;;;;;;;;;EA8CjG"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { useLayoutEffect, useState } from 'react';
|
|
4
|
+
import { findUpUntil } from '@cloudscape-design/component-toolkit/dom';
|
|
5
|
+
import * as tokens from '../../generated/styles/tokens';
|
|
6
|
+
import { useMobile } from '../../hooks/use-mobile';
|
|
7
|
+
import globalVars from '../../styles/global-vars';
|
|
8
|
+
import { getOverflowParents } from '../../utils/scrollable-containers';
|
|
9
|
+
import { useHeaderStuck } from './use-header-stuck';
|
|
10
|
+
function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, __additionalOffset, }) {
|
|
11
|
+
const localOffset = isMobile ? (__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0) : (__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0);
|
|
12
|
+
if (hasInnerOverflowParents || __stickyOffset !== undefined) {
|
|
13
|
+
return `${localOffset}px`;
|
|
14
|
+
}
|
|
15
|
+
const globalOffset = `var(${globalVars.stickyVerticalTopOffset}, 0px)`;
|
|
16
|
+
return `calc(${globalOffset} + ${localOffset}px + ${__additionalOffset ? tokens.spaceScaledS : '0px'})`;
|
|
17
|
+
}
|
|
18
|
+
export function useStickyPosition(rootRef, headerRef, { sticky, offset, mobileOffset, disableMobile, additionalOffset = false }) {
|
|
19
|
+
const isMobile = useMobile();
|
|
20
|
+
const disableSticky = isMobile && disableMobile;
|
|
21
|
+
const isSticky = !disableSticky && !!sticky;
|
|
22
|
+
// If it has overflow parents inside the app layout, we shouldn't apply a sticky offset.
|
|
23
|
+
const [hasInnerOverflowParents, setHasInnerOverflowParents] = useState(false);
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
if (rootRef.current) {
|
|
26
|
+
const overflowParents = getOverflowParents(rootRef.current);
|
|
27
|
+
const mainElement = findUpUntil(rootRef.current, elem => elem.tagName === 'MAIN');
|
|
28
|
+
// In both versions of the app layout, the scrolling element for disableBodyScroll
|
|
29
|
+
// is the <main>. If the closest overflow parent is also the closest <main> and we have
|
|
30
|
+
// offset values, it's safe to assume that it's the app layout scroll root and we
|
|
31
|
+
// should stop there.
|
|
32
|
+
setHasInnerOverflowParents(overflowParents.length > 0 && overflowParents[0] !== mainElement);
|
|
33
|
+
}
|
|
34
|
+
}, [rootRef]);
|
|
35
|
+
const computedOffset = computeOffset({
|
|
36
|
+
isMobile,
|
|
37
|
+
__stickyOffset: offset,
|
|
38
|
+
__mobileStickyOffset: mobileOffset,
|
|
39
|
+
hasInnerOverflowParents,
|
|
40
|
+
__additionalOffset: additionalOffset,
|
|
41
|
+
});
|
|
42
|
+
const stickyStyles = isSticky
|
|
43
|
+
? {
|
|
44
|
+
style: {
|
|
45
|
+
top: computedOffset,
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
: {};
|
|
49
|
+
const { isStuck, isStuckAtBottom } = useHeaderStuck(rootRef, headerRef, isSticky);
|
|
50
|
+
return {
|
|
51
|
+
isSticky,
|
|
52
|
+
isStuck,
|
|
53
|
+
isStuckAtBottom,
|
|
54
|
+
stickyStyles,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=use-sticky-position.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-position.js","sourceRoot":"","sources":["../../../../../src/internal/components/sticky-header/use-sticky-position.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAUpD,SAAS,aAAa,CAAC,EACrB,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GACC;IACnB,MAAM,WAA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;YAClF,uFAAuF;YACvF,iFAAiF;YACjF,qBAAqB;YACrB,0BAA0B,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC;QAC/F,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,MAAM,cAAc,GAAG,aAAa,CAAC;QACnC,QAAQ;QACR,cAAc,EAAE,MAAM;QACtB,oBAAoB,EAAE,YAAY;QAClC,uBAAuB;QACvB,kBAAkB,EAAE,gBAAgB;KACrC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,QAAQ;QAC3B,CAAC,CAAC;YACE,KAAK,EAAE;gBACL,GAAG,EAAE,cAAc;aACpB;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAElF,OAAO;QACL,QAAQ;QACR,OAAO;QACP,eAAe;QACf,YAAY;KACb,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useLayoutEffect, useState } from 'react';\n\nimport { findUpUntil } from '@cloudscape-design/component-toolkit/dom';\n\nimport * as tokens from '../../generated/styles/tokens';\nimport { useMobile } from '../../hooks/use-mobile';\nimport globalVars from '../../styles/global-vars';\nimport { getOverflowParents } from '../../utils/scrollable-containers';\nimport { useHeaderStuck } from './use-header-stuck';\n\ninterface ComputeOffsetProps {\n isMobile: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n hasInnerOverflowParents: boolean;\n __additionalOffset?: boolean;\n}\n\nfunction computeOffset({\n isMobile,\n __stickyOffset,\n __mobileStickyOffset,\n hasInnerOverflowParents,\n __additionalOffset,\n}: ComputeOffsetProps): string {\n const localOffset = isMobile ? (__stickyOffset ?? 0) - (__mobileStickyOffset ?? 0) : (__stickyOffset ?? 0);\n if (hasInnerOverflowParents || __stickyOffset !== undefined) {\n return `${localOffset}px`;\n }\n const globalOffset = `var(${globalVars.stickyVerticalTopOffset}, 0px)`;\n\n return `calc(${globalOffset} + ${localOffset}px + ${__additionalOffset ? tokens.spaceScaledS : '0px'})`;\n}\n\ninterface StickyPositionOptions {\n sticky?: boolean;\n offset?: number;\n mobileOffset?: number;\n disableMobile?: boolean;\n additionalOffset?: boolean;\n}\n\nexport function useStickyPosition(\n rootRef: RefObject<HTMLElement>,\n headerRef: RefObject<HTMLElement>,\n { sticky, offset, mobileOffset, disableMobile, additionalOffset = false }: StickyPositionOptions\n) {\n const isMobile = useMobile();\n const disableSticky = isMobile && disableMobile;\n const isSticky = !disableSticky && !!sticky;\n\n // If it has overflow parents inside the app layout, we shouldn't apply a sticky offset.\n const [hasInnerOverflowParents, setHasInnerOverflowParents] = useState(false);\n\n useLayoutEffect(() => {\n if (rootRef.current) {\n const overflowParents = getOverflowParents(rootRef.current);\n const mainElement = findUpUntil(rootRef.current, elem => elem.tagName === 'MAIN');\n\n // In both versions of the app layout, the scrolling element for disableBodyScroll\n // is the <main>. If the closest overflow parent is also the closest <main> and we have\n // offset values, it's safe to assume that it's the app layout scroll root and we\n // should stop there.\n setHasInnerOverflowParents(overflowParents.length > 0 && overflowParents[0] !== mainElement);\n }\n }, [rootRef]);\n\n const computedOffset = computeOffset({\n isMobile,\n __stickyOffset: offset,\n __mobileStickyOffset: mobileOffset,\n hasInnerOverflowParents,\n __additionalOffset: additionalOffset,\n });\n\n const stickyStyles = isSticky\n ? {\n style: {\n top: computedOffset,\n },\n }\n : {};\n\n const { isStuck, isStuckAtBottom } = useHeaderStuck(rootRef, headerRef, isSticky);\n\n return {\n isSticky,\n isStuck,\n isStuckAtBottom,\n stickyStyles,\n };\n}\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (1a6b6c2b)";
|
|
3
|
+
export var GIT_SHA = "1a6b6c2b";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
package/internal/manifest.json
CHANGED
package/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAuEhB,CAAC;AAGF,eAAe,WAAW,CAAC"}
|
package/multiselect/index.js
CHANGED
|
@@ -46,7 +46,7 @@ const Multiselect = React.forwardRef(({ options = [], filteringType = 'none', st
|
|
|
46
46
|
.map(option => { var _a; return `${(_a = option.label) !== null && _a !== void 0 ? _a : option.value}`; }),
|
|
47
47
|
},
|
|
48
48
|
};
|
|
49
|
-
return (React.createElement(InternalMultiselect, { renderOption: renderOption, options: options, filteringType: filteringType, statusType: statusType, selectedOptions: selectedOptions, keepOpen: keepOpen, hideTokens: hideTokens, ...restProps, ...baseComponentProps, ref: ref, ...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }) }));
|
|
49
|
+
return (React.createElement(InternalMultiselect, { renderOption: renderOption, options: options, filteringType: filteringType, statusType: statusType, selectedOptions: selectedOptions, keepOpen: keepOpen, hideTokens: hideTokens, ...restProps, ...baseComponentProps, styleClassNames: restProps.styleClassNames, ref: ref, ...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }) }));
|
|
50
50
|
});
|
|
51
51
|
applyDisplayName(Multiselect, 'Multiselect');
|
|
52
52
|
export default Multiselect;
|
package/multiselect/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,mBAAwC,MAAM,YAAY,CAAC;AAElE,OAAO,+BAA+B,MAAM,wEAAwE,CAAC;AAIrH,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,OAAO,GAAG,EAAE,EACZ,aAAa,GAAG,MAAM,EACtB,UAAU,GAAG,UAAU,EACvB,eAAe,GAAG,EAAE,EACpB,QAAQ,GAAG,IAAI,EACf,UAAU,GAAG,KAAK,EAClB,YAAY,EACZ,GAA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,MAAM,CAAC,KAAK,EAAE,CAAC;YACnC,eAAe,EAAE,eAAe;iBAC7B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC;gBAC7C,uFAAuF;gBACvF,2BAA2B;iBAC1B,GAAG,CAAC,MAAM,CAAC,EAAE,WAAC,OAAA,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,MAAM,CAAC,KAAK,EAAE,CAAA,EAAA,CAAC;SACpD;KACF,CAAC;IAEF,OAAO,CACL,oBAAC,mBAAmB,IAClB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,KAClB,SAAS,KACT,kBAAkB,EACtB,eAAe,EAAG,SAAmD,CAAC,eAAe,EACrF,GAAG,EAAE,GAAG,KACJ,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,GAC5E,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC7C,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataMultiselectComponent } from './analytics-metadata/interfaces';\nimport { MultiselectProps } from './interfaces';\nimport InternalMultiselect, { StyleClassNames } from './internal';\n\nimport buttonTriggerAnalyticsSelectors from '../internal/components/button-trigger/analytics-metadata/styles.css.js';\n\nexport { MultiselectProps };\n\nconst Multiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n statusType = 'finished',\n selectedOptions = [],\n keepOpen = true,\n hideTokens = false,\n renderOption,\n ...restProps\n }: MultiselectProps,\n ref: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Multiselect', {\n props: {\n inlineTokens: restProps.inlineTokens,\n autoFocus: restProps.autoFocus,\n expandToViewport: restProps.expandToViewport,\n filteringType,\n hideTokens,\n keepOpen,\n tokenLimit: restProps.tokenLimit,\n virtualScroll: restProps.virtualScroll,\n readOnly: restProps.readOnly,\n enableSelectAll: restProps.enableSelectAll,\n dropdownRole: restProps.dropdownRole,\n },\n metadata: {\n hasInlineLabel: Boolean(restProps.inlineLabelText),\n hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),\n hasDropdownHeader: Boolean(restProps.renderDropdownHeader),\n hasDropdownFooter: Boolean(restProps.renderDropdownFooter),\n hasDropdownAriaDescribedby: Boolean(restProps.dropdownAriaDescribedby),\n },\n });\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataMultiselectComponent = {\n name: 'awsui.Multiselect',\n label: `.${buttonTriggerAnalyticsSelectors['button-trigger']}`,\n properties: {\n disabled: `${!!restProps.disabled}`,\n selectedOptionsCount: `${selectedOptions.length}`,\n selectedOptionsValues: selectedOptions\n .filter(option => option.value !== undefined)\n .map(option => `${option.value}`),\n selectedOptions: selectedOptions\n .filter(option => option.value !== undefined)\n // fallback on value when label's undefined because in the dropdown if there's no label\n // the value will be shown.\n .map(option => `${option.label ?? option.value}`),\n },\n };\n\n return (\n <InternalMultiselect\n renderOption={renderOption}\n options={options}\n filteringType={filteringType}\n statusType={statusType}\n selectedOptions={selectedOptions}\n keepOpen={keepOpen}\n hideTokens={hideTokens}\n {...restProps}\n {...baseComponentProps}\n styleClassNames={(restProps as { styleClassNames?: StyleClassNames }).styleClassNames}\n ref={ref}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Multiselect, 'Multiselect');\nexport default Multiselect;\n"]}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StyleClassNames as InputStyleClassNames } from '../input/internal';
|
|
2
3
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';
|
|
4
|
+
import { StyleClassNames as TokenStyleClassNames } from '../token/internal';
|
|
3
5
|
import { MultiselectProps } from './interfaces';
|
|
6
|
+
export interface StyleClassNames {
|
|
7
|
+
trigger?: string;
|
|
8
|
+
inlineLabel?: string;
|
|
9
|
+
filter?: InputStyleClassNames;
|
|
10
|
+
dropdown?: string;
|
|
11
|
+
token?: TokenStyleClassNames;
|
|
12
|
+
}
|
|
4
13
|
declare const InternalMultiselect: React.ForwardRefExoticComponent<MultiselectProps & {
|
|
5
14
|
filteringType: import("../dropdown/interfaces").OptionsFilteringType;
|
|
6
15
|
statusType: import("../types/dropdown-status").DropdownStatusProps.StatusType;
|
|
@@ -8,5 +17,7 @@ declare const InternalMultiselect: React.ForwardRefExoticComponent<MultiselectPr
|
|
|
8
17
|
selectedOptions: ReadonlyArray<MultiselectProps.Option>;
|
|
9
18
|
keepOpen: boolean;
|
|
10
19
|
hideTokens: boolean;
|
|
11
|
-
} & InternalBaseComponentProps &
|
|
20
|
+
} & InternalBaseComponentProps & {
|
|
21
|
+
styleClassNames?: StyleClassNames;
|
|
22
|
+
} & React.RefAttributes<MultiselectProps.Ref>>;
|
|
12
23
|
export default InternalMultiselect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAOhD,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAQ5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAS3F,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAchD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAID,QAAA,MAAM,mBAAmB;;;;;;;;sBAdH,eAAe;8CA8QpC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/multiselect/internal.js
CHANGED
|
@@ -22,7 +22,7 @@ import { composeDropdownContent } from '../select/utils/dropdown-customization';
|
|
|
22
22
|
import InternalTokenGroup from '../token-group/internal';
|
|
23
23
|
import { useMultiselect } from './use-multiselect';
|
|
24
24
|
import styles from './styles.css.js';
|
|
25
|
-
const InternalMultiselect = React.forwardRef(({ options, filteringType, filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, ariaRequired, placeholder, disabled, readOnly, ariaLabel, inlineLabelText, selectedOptions, deselectAriaLabel, tokenLimit, i18nStrings, virtualScroll, inlineTokens, hideTokens, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, __internalRootRef, autoFocus, enableSelectAll, renderOption, renderDropdownHeader, renderDropdownFooter, dropdownRole, dropdownAriaDescribedby, ...restProps }, externalRef) => {
|
|
25
|
+
const InternalMultiselect = React.forwardRef(({ options, filteringType, filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, ariaRequired, placeholder, disabled, readOnly, ariaLabel, inlineLabelText, selectedOptions, deselectAriaLabel, tokenLimit, i18nStrings, virtualScroll, inlineTokens, hideTokens, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, __internalRootRef, autoFocus, enableSelectAll, renderOption, renderDropdownHeader, renderDropdownFooter, dropdownRole, dropdownAriaDescribedby, styleClassNames, ...restProps }, externalRef) => {
|
|
26
26
|
var _a;
|
|
27
27
|
const baseProps = getBaseProps(restProps);
|
|
28
28
|
const formFieldContext = useFormFieldContext(restProps);
|
|
@@ -75,11 +75,15 @@ const InternalMultiselect = React.forwardRef(({ options, filteringType, filterin
|
|
|
75
75
|
};
|
|
76
76
|
const customDropdownHeader = renderDropdownHeader === null || renderDropdownHeader === void 0 ? void 0 : renderDropdownHeader(dropdownContentProps);
|
|
77
77
|
const customDropdownFooter = renderDropdownFooter === null || renderDropdownFooter === void 0 ? void 0 : renderDropdownFooter(dropdownContentProps);
|
|
78
|
-
const filter = (React.createElement(Filter, { clearAriaLabel: filteringClearAriaLabel, filteringType: filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired: ariaRequired, value: filteringValue, ...multiselectProps.getFilterProps() }));
|
|
78
|
+
const filter = (React.createElement(Filter, { clearAriaLabel: filteringClearAriaLabel, filteringType: filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired: ariaRequired, value: filteringValue, styleClassNames: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.filter, ...multiselectProps.getFilterProps() }));
|
|
79
79
|
const triggerRef = useRef(null);
|
|
80
80
|
const [triggerWidth, setTriggerWidth] = useState(null);
|
|
81
81
|
useResizeObserver(() => triggerRef.current, entry => setTriggerWidth(entry.borderBoxWidth));
|
|
82
|
-
const trigger = (React.createElement(Trigger, { ref: triggerRef, placeholder: placeholder, disabled: disabled, readOnly: readOnly, triggerProps: multiselectProps.getTriggerProps(disabled, autoFocus), selectedOption: null, selectedOptions: selectedOptions, triggerVariant: showTokensInline ? 'tokens' : 'placeholder', isOpen: multiselectProps.isOpen, groupedControlProps: groupedControlProps, inlineLabelText: inlineLabelText,
|
|
82
|
+
const trigger = (React.createElement(Trigger, { ref: triggerRef, placeholder: placeholder, disabled: disabled, readOnly: readOnly, triggerProps: multiselectProps.getTriggerProps(disabled, autoFocus), selectedOption: null, selectedOptions: selectedOptions, triggerVariant: showTokensInline ? 'tokens' : 'placeholder', isOpen: multiselectProps.isOpen, groupedControlProps: groupedControlProps, inlineLabelText: inlineLabelText, styleClassNames: {
|
|
83
|
+
trigger: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.trigger,
|
|
84
|
+
inlineLabel: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.inlineLabel,
|
|
85
|
+
token: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.token,
|
|
86
|
+
}, ...formFieldContext, controlId: controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, ariaLabelId) }));
|
|
83
87
|
const tokens = selectedOptions.map(option => ({
|
|
84
88
|
label: option.label,
|
|
85
89
|
disabled,
|
|
@@ -115,12 +119,12 @@ const InternalMultiselect = React.forwardRef(({ options, filteringType, filterin
|
|
|
115
119
|
hasOptions.current = hasOptions.current || options.length > 0;
|
|
116
120
|
return (React.createElement(ResetGroupedControlContext, null,
|
|
117
121
|
React.createElement("div", { ...baseProps, ref: __internalRootRef, className: clsx(styles.root, baseProps.className), ...multiselectProps.getWrapperProps() },
|
|
118
|
-
React.createElement(Dropdown, { ...dropdownProps, ariaLabelledby: dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.ariaRole
|
|
122
|
+
React.createElement(Dropdown, { ...dropdownProps, styleClassNames: { container: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.dropdown }, ariaLabelledby: dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.ariaRole
|
|
119
123
|
? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)
|
|
120
124
|
: undefined, open: multiselectProps.isOpen, minWidth: getDropdownMinWidth({ expandToViewport: effectiveExpandToViewport, triggerWidth }), maxWidth: getBreakpointValue('xxs'), trigger: trigger, header: dropdownHeader, footer: dropdownFooter, expandToViewport: effectiveExpandToViewport,
|
|
121
125
|
// Forces dropdown position recalculation when new options are loaded
|
|
122
126
|
contentKey: hasOptions.current.toString(), content: React.createElement(ListComponent, { renderOption: renderOption, listBottom: !dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: multiselectProps.isOpen ? dropdownStatus.content : null, id: footerId })) : null, menuProps: { ...multiselectProps.getMenuProps(), ariaRequired }, getOptionProps: multiselectProps.getOptionProps, filteredOptions: multiselectProps.filteredOptions, filteringValue: filteringValue, ref: multiselectProps.scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, checkboxes: true, useInteractiveGroups: true, screenReaderContent: multiselectProps.announcement, highlightType: multiselectProps.highlightType, firstOptionSticky: hasFilteredOptions && enableSelectAll, isMultiSelect: true }) }),
|
|
123
|
-
showTokens && (React.createElement(InternalTokenGroup, { ...multiselectProps.getTokenProps(), className: styles.tokens, alignment: "horizontal", limit: tokenLimit, items: tokens, i18nStrings: tokenGroupI18nStrings, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, disableOuterPadding: true, readOnly: readOnly, isItemReadOnly: item => item._readOnly })),
|
|
127
|
+
showTokens && (React.createElement(InternalTokenGroup, { ...multiselectProps.getTokenProps(), className: styles.tokens, alignment: "horizontal", limit: tokenLimit, items: tokens, i18nStrings: tokenGroupI18nStrings, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, disableOuterPadding: true, readOnly: readOnly, isItemReadOnly: item => item._readOnly, styleClassNames: { token: styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.token } })),
|
|
124
128
|
React.createElement(ScreenreaderOnly, { id: ariaLabelId }, ariaLabel || inlineLabelText))));
|
|
125
129
|
});
|
|
126
130
|
export default In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,gBAAgB,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,EAC/D,cAAc,EAAE,gBAAgB,CAAC,cAAc,EAC/C,eAAe,EAAE,gBAAgB,CAAC,eAAe,EACjD,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,gBAAgB,CAAC,aAAa,EACnC,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,UAAU,EAAE,IAAI,EAChB,oBAAoB,EAAE,IAAI,EAC1B,mBAAmB,EAAE,gBAAgB,CAAC,YAAY,EAClD,aAAa,EAAE,gBAAgB,CAAC,aAAa,EAC7C,iBAAiB,EAAE,kBAAkB,IAAI,eAAe,EACxD,aAAa,EAAE,IAAI,GACnB,GAEJ;YAED,UAAU,IAAI,CACb,oBAAC,kBAAkB,OACb,gBAAgB,CAAC,aAAa,EAAE,EACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,qBAAqB,EAClC,sBAAsB,EAAE,2BAA2B,EACnD,uBAAuB,EAAE,4BAA4B,EACrD,mBAAmB,EAAE,IAAI,EACzB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,IAAI,CAAC,EAAE,CAAE,IAAsB,CAAC,SAAS,GACzD,CACH;YAED,oBAAC,gBAAgB,IAAC,EAAE,EAAE,WAAW,IAAG,SAAS,IAAI,eAAe,CAAoB,CAChF,CACqB,CAC9B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { ResetGroupedControlContext, useGroupedControlContext } from '../internal/context/control-group-context';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { warnOnUnsupportedGroupedControlProps } from '../internal/grouped-control/dev-warnings';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings';\nimport Filter from '../select/parts/filter';\nimport PlainList from '../select/parts/plain-list';\nimport Trigger from '../select/parts/trigger';\nimport VirtualList from '../select/parts/virtual-list';\nimport { composeDropdownContent } from '../select/utils/dropdown-customization';\nimport { TokenGroupProps } from '../token-group/interfaces';\nimport InternalTokenGroup from '../token-group/internal';\nimport { MultiselectProps } from './interfaces';\nimport { useMultiselect } from './use-multiselect';\n\nimport styles from './styles.css.js';\n\ntype InternalMultiselectProps = SomeRequired<\n MultiselectProps,\n 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen' | 'hideTokens'\n> &\n InternalBaseComponentProps;\n\ntype ExtendedToken = TokenGroupProps.Item & { _readOnly: boolean };\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options,\n filteringType,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n inlineLabelText,\n selectedOptions,\n deselectAriaLabel,\n tokenLimit,\n i18nStrings,\n virtualScroll,\n inlineTokens,\n hideTokens,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef,\n autoFocus,\n enableSelectAll,\n renderOption,\n renderDropdownHeader,\n renderDropdownFooter,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const groupedControlProps = useGroupedControlContext();\n const i18n = useInternalI18n('multiselect');\n\n const isGrouped = !!groupedControlProps.position;\n\n warnOnUnsupportedGroupedControlProps({\n isGrouped,\n componentName: 'Multiselect',\n invalid: formFieldContext.invalid,\n warning: formFieldContext.warning,\n readOnly,\n inlineTokens,\n expandToViewport,\n });\n\n // When rendered inside a control group, tokens are always shown inline in the\n // trigger regardless of the `inlineTokens` prop, since there is no room to\n // display tokens below the control within a group.\n const showTokensInline = inlineTokens || isGrouped;\n\n // When grouped, the dropdown is portaled regardless of the public\n // `expandToViewport` prop so it escapes the control slot's stacking context\n // and paints over the group's inline label (which the focus ring stays under).\n const effectiveExpandToViewport = expandToViewport || isGrouped;\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const ariaLabelId = useUniqueId('multiselect-ariaLabel-');\n const footerId = useUniqueId('multiselect-footer-');\n\n const [filteringValue, setFilteringValue] = useState('');\n const multiselectProps = useMultiselect({\n options,\n selectedOptions,\n filteringType,\n disabled,\n deselectAriaLabel,\n controlId,\n ariaLabelId,\n footerId,\n filteringValue,\n setFilteringValue,\n externalRef,\n enableSelectAll,\n i18nStrings,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps,\n });\n\n const dropdownContentProps: MultiselectProps.DropdownContentProps = {\n filterText: filteringValue,\n closeDropdown: multiselectProps.closeDropdown,\n };\n const customDropdownHeader = renderDropdownHeader?.(dropdownContentProps);\n const customDropdownFooter = renderDropdownFooter?.(dropdownContentProps);\n\n const filter = (\n <Filter\n clearAriaLabel={filteringClearAriaLabel}\n filteringType={filteringType}\n placeholder={filteringPlaceholder}\n ariaLabel={filteringAriaLabel}\n ariaRequired={ariaRequired}\n value={filteringValue}\n {...multiselectProps.getFilterProps()}\n />\n );\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => setTriggerWidth(entry.borderBoxWidth)\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerProps={multiselectProps.getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n selectedOptions={selectedOptions}\n triggerVariant={showTokensInline ? 'tokens' : 'placeholder'}\n isOpen={multiselectProps.isOpen}\n groupedControlProps={groupedControlProps}\n inlineLabelText={inlineLabelText}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, ariaLabelId)}\n />\n );\n\n const tokens: Array<ExtendedToken> = selectedOptions.map(option => ({\n label: option.label,\n disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n _readOnly: !!option.disabled,\n }));\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const showTokens = !hideTokens && !showTokensInline && tokens.length > 0;\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const dropdownStatus = multiselectProps.dropdownStatus;\n const dropdownProps = multiselectProps.getDropdownProps();\n const hasFilteredOptions = multiselectProps.filteredOptions.length > 0;\n\n const statusFooter = dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null;\n const { header: dropdownHeader, footer: dropdownFooter } = composeDropdownContent({\n filter,\n customDropdownHeader,\n customDropdownFooter,\n statusFooter,\n dropdownHeaderClass: styles['dropdown-header'],\n dropdownFooterClass: styles['dropdown-footer'],\n });\n\n const hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <ResetGroupedControlContext>\n <div\n {...baseProps}\n ref={__internalRootRef}\n className={clsx(styles.root, baseProps.className)}\n {...multiselectProps.getWrapperProps()}\n >\n <Dropdown\n {...dropdownProps}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.ariaRole\n ? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)\n : undefined\n }\n open={multiselectProps.isOpen}\n minWidth={getDropdownMinWidth({ expandToViewport: effectiveExpandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={dropdownHeader}\n footer={dropdownFooter}\n expandToViewport={effectiveExpandToViewport}\n // Forces dropdown position recalculation when new options are loaded\n contentKey={hasOptions.current.toString()}\n content={\n <ListComponent\n renderOption={renderOption}\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={{ ...multiselectProps.getMenuProps(), ariaRequired }}\n getOptionProps={multiselectProps.getOptionProps}\n filteredOptions={multiselectProps.filteredOptions}\n filteringValue={filteringValue}\n ref={multiselectProps.scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={true}\n screenReaderContent={multiselectProps.announcement}\n highlightType={multiselectProps.highlightType}\n firstOptionSticky={hasFilteredOptions && enableSelectAll}\n isMultiSelect={true}\n />\n }\n />\n\n {showTokens && (\n <InternalTokenGroup\n {...multiselectProps.getTokenProps()}\n className={styles.tokens}\n alignment=\"horizontal\"\n limit={tokenLimit}\n items={tokens}\n i18nStrings={tokenGroupI18nStrings}\n limitShowMoreAriaLabel={tokenLimitShowMoreAriaLabel}\n limitShowFewerAriaLabel={tokenLimitShowFewerAriaLabel}\n disableOuterPadding={true}\n readOnly={readOnly}\n isItemReadOnly={item => (item as ExtendedToken)._readOnly}\n />\n )}\n\n <ScreenreaderOnly id={ariaLabelId}>{ariaLabel || inlineLabelText}</ScreenreaderOnly>\n </div>\n </ResetGroupedControlContext>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,oCAAoC,EAAE,MAAM,0CAA0C,CAAC;AAGhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAGhF,OAAO,kBA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EACzB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,IAAI,CAAC,EAAE,CAAE,IAAsB,CAAC,SAAS,EACzD,eAAe,EAAE,EAAE,KAAK,EAAE,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,EAAE,GAClD,CACH;YAED,oBAAC,gBAAgB,IAAC,EAAE,EAAE,WAAW,IAAG,SAAS,IAAI,eAAe,CAAoB,CAChF,CACqB,CAC9B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport Dropdown from '../dropdown/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { StyleClassNames as InputStyleClassNames } from '../input/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { getBreakpointValue } from '../internal/breakpoints';\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { ResetGroupedControlContext, useGroupedControlContext } from '../internal/context/control-group-context';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { warnOnUnsupportedGroupedControlProps } from '../internal/grouped-control/dev-warnings';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { SomeRequired } from '../internal/types';\nimport { getDropdownMinWidth } from '../internal/utils/get-dropdown-min-width';\nimport { joinStrings } from '../internal/utils/strings';\nimport Filter from '../select/parts/filter';\nimport PlainList from '../select/parts/plain-list';\nimport Trigger from '../select/parts/trigger';\nimport VirtualList from '../select/parts/virtual-list';\nimport { composeDropdownContent } from '../select/utils/dropdown-customization';\nimport { StyleClassNames as TokenStyleClassNames } from '../token/internal';\nimport { TokenGroupProps } from '../token-group/interfaces';\nimport InternalTokenGroup from '../token-group/internal';\nimport { MultiselectProps } from './interfaces';\nimport { useMultiselect } from './use-multiselect';\n\nimport styles from './styles.css.js';\n\ntype InternalMultiselectProps = SomeRequired<\n MultiselectProps,\n 'options' | 'selectedOptions' | 'filteringType' | 'statusType' | 'keepOpen' | 'hideTokens'\n> &\n InternalBaseComponentProps & {\n styleClassNames?: StyleClassNames;\n };\n\n// Style API v2\nexport interface StyleClassNames {\n trigger?: string;\n inlineLabel?: string;\n filter?: InputStyleClassNames;\n dropdown?: string;\n token?: TokenStyleClassNames;\n}\n\ntype ExtendedToken = TokenGroupProps.Item & { _readOnly: boolean };\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options,\n filteringType,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n ariaRequired,\n placeholder,\n disabled,\n readOnly,\n ariaLabel,\n inlineLabelText,\n selectedOptions,\n deselectAriaLabel,\n tokenLimit,\n i18nStrings,\n virtualScroll,\n inlineTokens,\n hideTokens,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef,\n autoFocus,\n enableSelectAll,\n renderOption,\n renderDropdownHeader,\n renderDropdownFooter,\n dropdownRole,\n dropdownAriaDescribedby,\n styleClassNames,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const groupedControlProps = useGroupedControlContext();\n const i18n = useInternalI18n('multiselect');\n\n const isGrouped = !!groupedControlProps.position;\n\n warnOnUnsupportedGroupedControlProps({\n isGrouped,\n componentName: 'Multiselect',\n invalid: formFieldContext.invalid,\n warning: formFieldContext.warning,\n readOnly,\n inlineTokens,\n expandToViewport,\n });\n\n // When rendered inside a control group, tokens are always shown inline in the\n // trigger regardless of the `inlineTokens` prop, since there is no room to\n // display tokens below the control within a group.\n const showTokensInline = inlineTokens || isGrouped;\n\n // When grouped, the dropdown is portaled regardless of the public\n // `expandToViewport` prop so it escapes the control slot's stacking context\n // and paints over the group's inline label (which the focus ring stays under).\n const effectiveExpandToViewport = expandToViewport || isGrouped;\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const ariaLabelId = useUniqueId('multiselect-ariaLabel-');\n const footerId = useUniqueId('multiselect-footer-');\n\n const [filteringValue, setFilteringValue] = useState('');\n const multiselectProps = useMultiselect({\n options,\n selectedOptions,\n filteringType,\n disabled,\n deselectAriaLabel,\n controlId,\n ariaLabelId,\n footerId,\n filteringValue,\n setFilteringValue,\n externalRef,\n enableSelectAll,\n i18nStrings,\n dropdownRole,\n dropdownAriaDescribedby,\n ...restProps,\n });\n\n const dropdownContentProps: MultiselectProps.DropdownContentProps = {\n filterText: filteringValue,\n closeDropdown: multiselectProps.closeDropdown,\n };\n const customDropdownHeader = renderDropdownHeader?.(dropdownContentProps);\n const customDropdownFooter = renderDropdownFooter?.(dropdownContentProps);\n\n const filter = (\n <Filter\n clearAriaLabel={filteringClearAriaLabel}\n filteringType={filteringType}\n placeholder={filteringPlaceholder}\n ariaLabel={filteringAriaLabel}\n ariaRequired={ariaRequired}\n value={filteringValue}\n styleClassNames={styleClassNames?.filter}\n {...multiselectProps.getFilterProps()}\n />\n );\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n useResizeObserver(\n () => triggerRef.current,\n entry => setTriggerWidth(entry.borderBoxWidth)\n );\n\n const trigger = (\n <Trigger\n ref={triggerRef}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerProps={multiselectProps.getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n selectedOptions={selectedOptions}\n triggerVariant={showTokensInline ? 'tokens' : 'placeholder'}\n isOpen={multiselectProps.isOpen}\n groupedControlProps={groupedControlProps}\n inlineLabelText={inlineLabelText}\n styleClassNames={{\n trigger: styleClassNames?.trigger,\n inlineLabel: styleClassNames?.inlineLabel,\n token: styleClassNames?.token,\n }}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, ariaLabelId)}\n />\n );\n\n const tokens: Array<ExtendedToken> = selectedOptions.map(option => ({\n label: option.label,\n disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n _readOnly: !!option.disabled,\n }));\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const showTokens = !hideTokens && !showTokensInline && tokens.length > 0;\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const dropdownStatus = multiselectProps.dropdownStatus;\n const dropdownProps = multiselectProps.getDropdownProps();\n const hasFilteredOptions = multiselectProps.filteredOptions.length > 0;\n\n const statusFooter = dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null;\n const { header: dropdownHeader, footer: dropdownFooter } = composeDropdownContent({\n filter,\n customDropdownHeader,\n customDropdownFooter,\n statusFooter,\n dropdownHeaderClass: styles['dropdown-header'],\n dropdownFooterClass: styles['dropdown-footer'],\n });\n\n const hasOptions = useRef(options.length > 0);\n hasOptions.current = hasOptions.current || options.length > 0;\n\n return (\n <ResetGroupedControlContext>\n <div\n {...baseProps}\n ref={__internalRootRef}\n className={clsx(styles.root, baseProps.className)}\n {...multiselectProps.getWrapperProps()}\n >\n <Dropdown\n {...dropdownProps}\n styleClassNames={{ container: styleClassNames?.dropdown }}\n ariaLabelledby={dropdownProps.ariaRole ? joinStrings(ariaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.ariaRole\n ? joinStrings(dropdownStatus.content ? footerId : undefined, dropdownAriaDescribedby)\n : undefined\n }\n open={multiselectProps.isOpen}\n minWidth={getDropdownMinWidth({ expandToViewport: effectiveExpandToViewport, triggerWidth })}\n maxWidth={getBreakpointValue('xxs')} // AWSUI-19898\n trigger={trigger}\n header={dropdownHeader}\n footer={dropdownFooter}\n expandToViewport={effectiveExpandToViewport}\n // Forces dropdown position recalculation when new options are loaded\n contentKey={hasOptions.current.toString()}\n content={\n <ListComponent\n renderOption={renderOption}\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={{ ...multiselectProps.getMenuProps(), ariaRequired }}\n getOptionProps={multiselectProps.getOptionProps}\n filteredOptions={multiselectProps.filteredOptions}\n filteringValue={filteringValue}\n ref={multiselectProps.scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={true}\n screenReaderContent={multiselectProps.announcement}\n highlightType={multiselectProps.highlightType}\n firstOptionSticky={hasFilteredOptions && enableSelectAll}\n isMultiSelect={true}\n />\n }\n />\n\n {showTokens && (\n <InternalTokenGroup\n {...multiselectProps.getTokenProps()}\n className={styles.tokens}\n alignment=\"horizontal\"\n limit={tokenLimit}\n items={tokens}\n i18nStrings={tokenGroupI18nStrings}\n limitShowMoreAriaLabel={tokenLimitShowMoreAriaLabel}\n limitShowFewerAriaLabel={tokenLimitShowFewerAriaLabel}\n disableOuterPadding={true}\n readOnly={readOnly}\n isItemReadOnly={item => (item as ExtendedToken)._readOnly}\n styleClassNames={{ token: styleClassNames?.token }}\n />\n )}\n\n <ScreenreaderOnly id={ariaLabelId}>{ariaLabel || inlineLabelText}</ScreenreaderOnly>\n </div>\n </ResetGroupedControlContext>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"embedded": "
|
|
6
|
-
"tokens": "
|
|
7
|
-
"dropdown-header": "awsui_dropdown-
|
|
8
|
-
"dropdown-footer": "awsui_dropdown-
|
|
4
|
+
"root": "awsui_root_f8g6q_avh76_21",
|
|
5
|
+
"embedded": "awsui_embedded_f8g6q_avh76_53",
|
|
6
|
+
"tokens": "awsui_tokens_f8g6q_avh76_86",
|
|
7
|
+
"dropdown-header": "awsui_dropdown-header_f8g6q_avh76_90",
|
|
8
|
+
"dropdown-footer": "awsui_dropdown-footer_f8g6q_avh76_96"
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -6,7 +6,19 @@
|
|
|
6
6
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
7
7
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
8
8
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
9
|
-
|
|
9
|
+
@property --awsui-style-placeholder-color {
|
|
10
|
+
syntax: "*";
|
|
11
|
+
inherits: false;
|
|
12
|
+
}
|
|
13
|
+
/* awsui:style-api-slot name=trigger tokens=placeholder-color properties=color, background, border, border-radius, box-shadow, padding, font-family, font-size, font-weight */
|
|
14
|
+
/* awsui:style-api-description slot=trigger kind=slot name=trigger text=The trigger button, which is also the field box. Pass a different class for the states you control (`invalid`, `warning`, `disabled`, `readOnly`); use `:hover` and `:focus` for interaction states. */
|
|
15
|
+
/* awsui:style-api-description slot=trigger kind=property name=color text=The placeholder is styled with `--awsui-style-placeholder-color`. */
|
|
16
|
+
/* awsui:style-api-description slot=trigger kind=property name=box-shadow text=Also draws the focus ring under `:focus`. */
|
|
17
|
+
/* awsui:style-api-slot name=inlineLabel tokens= properties=color, background, font-family, font-size, font-weight */
|
|
18
|
+
/* awsui:style-api-slot name=filter component=input */
|
|
19
|
+
/* awsui:style-api-slot name=dropdown component=dropdown slot=container */
|
|
20
|
+
/* awsui:style-api-slot name=token component=token */
|
|
21
|
+
.awsui_root_f8g6q_avh76_21:not(#\9) {
|
|
10
22
|
border-collapse: separate;
|
|
11
23
|
border-spacing: 0;
|
|
12
24
|
box-sizing: border-box;
|
|
@@ -38,7 +50,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
38
50
|
-moz-osx-font-smoothing: auto;
|
|
39
51
|
}
|
|
40
52
|
|
|
41
|
-
.
|
|
53
|
+
.awsui_embedded_f8g6q_avh76_53:not(#\9) {
|
|
42
54
|
border-collapse: separate;
|
|
43
55
|
border-spacing: 0;
|
|
44
56
|
box-sizing: border-box;
|
|
@@ -71,16 +83,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
71
83
|
display: contents;
|
|
72
84
|
}
|
|
73
85
|
|
|
74
|
-
.
|
|
86
|
+
.awsui_tokens_f8g6q_avh76_86:not(#\9) {
|
|
75
87
|
margin-block-start: var(--space-scaled-xs-65ylh6, 8px);
|
|
76
88
|
}
|
|
77
89
|
|
|
78
|
-
.awsui_dropdown-
|
|
90
|
+
.awsui_dropdown-header_f8g6q_avh76_90:not(#\9) {
|
|
79
91
|
inline-size: 100%;
|
|
80
92
|
position: relative;
|
|
81
93
|
z-index: 4;
|
|
82
94
|
}
|
|
83
95
|
|
|
84
|
-
.awsui_dropdown-
|
|
96
|
+
.awsui_dropdown-footer_f8g6q_avh76_96:not(#\9) {
|
|
85
97
|
inline-size: 100%;
|
|
86
98
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"embedded": "
|
|
7
|
-
"tokens": "
|
|
8
|
-
"dropdown-header": "awsui_dropdown-
|
|
9
|
-
"dropdown-footer": "awsui_dropdown-
|
|
5
|
+
"root": "awsui_root_f8g6q_avh76_21",
|
|
6
|
+
"embedded": "awsui_embedded_f8g6q_avh76_53",
|
|
7
|
+
"tokens": "awsui_tokens_f8g6q_avh76_86",
|
|
8
|
+
"dropdown-header": "awsui_dropdown-header_f8g6q_avh76_90",
|
|
9
|
+
"dropdown-footer": "awsui_dropdown-footer_f8g6q_avh76_96"
|
|
10
10
|
};
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
"./internal/base-theme/styles.css.js",
|
|
381
381
|
"./internal/base-component/styles.css.js"
|
|
382
382
|
],
|
|
383
|
-
"version": "3.0.
|
|
383
|
+
"version": "3.0.1410",
|
|
384
384
|
"repository": {
|
|
385
385
|
"type": "git",
|
|
386
386
|
"url": "https://github.com/cloudscape-design/components.git"
|
|
@@ -6,32 +6,8 @@
|
|
|
6
6
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
7
7
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
8
8
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
9
|
-
@property --awsui-style-fill-color {
|
|
10
|
-
syntax: "*";
|
|
11
|
-
inherits: false;
|
|
12
|
-
}
|
|
13
|
-
@property --awsui-style-border-color {
|
|
14
|
-
syntax: "*";
|
|
15
|
-
inherits: false;
|
|
16
|
-
}
|
|
17
|
-
@property --awsui-style-indicator-color {
|
|
18
|
-
syntax: "*";
|
|
19
|
-
inherits: false;
|
|
20
|
-
}
|
|
21
|
-
@property --awsui-style-focus-ring-color {
|
|
22
|
-
syntax: "*";
|
|
23
|
-
inherits: false;
|
|
24
|
-
}
|
|
25
|
-
@property --awsui-style-focus-ring-width {
|
|
26
|
-
syntax: "*";
|
|
27
|
-
inherits: false;
|
|
28
|
-
}
|
|
29
|
-
@property --awsui-style-focus-ring-radius {
|
|
30
|
-
syntax: "*";
|
|
31
|
-
inherits: false;
|
|
32
|
-
}
|
|
33
9
|
/* awsui:style-api-slot name=control tokens=fill-color, border-color, indicator-color, focus-ring-color, focus-ring-width, focus-ring-radius properties= */
|
|
34
|
-
.awsui_radio-
|
|
10
|
+
.awsui_radio-button_zdbjz_p13zo_10:not(#\9) {
|
|
35
11
|
border-collapse: separate;
|
|
36
12
|
border-spacing: 0;
|
|
37
13
|
box-sizing: border-box;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StyleClassNames as RadioButtonStyleClassNames } from '../internal/components/radio-button';
|
|
2
3
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
3
4
|
import { RadioGroupProps } from './interfaces';
|
|
4
|
-
|
|
5
|
+
export interface StyleClassNames {
|
|
6
|
+
radioButton?: RadioButtonStyleClassNames;
|
|
7
|
+
}
|
|
8
|
+
declare const InternalRadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & InternalBaseComponentProps & {
|
|
9
|
+
styleClassNames?: StyleClassNames;
|
|
10
|
+
} & React.RefAttributes<RadioGroupProps.Ref>>;
|
|
5
11
|
export default InternalRadioGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAoB,EAAE,eAAe,IAAI,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAIjH,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAY/C,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,0BAA0B,CAAC;CAC1C;AAED,QAAA,MAAM,kBAAkB;sBARF,eAAe;6CAyFpC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|