@cloudscape-design/components-themeable 3.0.959 → 3.0.961
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/copy-to-clipboard/test-classes/styles.scss +3 -0
- package/lib/internal/scss/key-value-pairs/styles.scss +1 -0
- package/lib/internal/template/annotation-context/annotation/annotation-popover.d.ts.map +1 -1
- package/lib/internal/template/annotation-context/annotation/annotation-popover.js +1 -1
- package/lib/internal/template/annotation-context/annotation/annotation-popover.js.map +1 -1
- package/lib/internal/template/annotation-context/annotation/open-annotation.d.ts.map +1 -1
- package/lib/internal/template/annotation-context/annotation/open-annotation.js +3 -1
- package/lib/internal/template/annotation-context/annotation/open-annotation.js.map +1 -1
- package/lib/internal/template/button-dropdown/internal.js +1 -1
- package/lib/internal/template/button-dropdown/internal.js.map +1 -1
- package/lib/internal/template/copy-to-clipboard/interfaces.d.ts +5 -1
- package/lib/internal/template/copy-to-clipboard/interfaces.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/interfaces.js.map +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.d.ts +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.js +2 -2
- package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
- package/lib/internal/template/copy-to-clipboard/test-classes/styles.css.js +3 -2
- package/lib/internal/template/copy-to-clipboard/test-classes/styles.scoped.css +6 -2
- package/lib/internal/template/copy-to-clipboard/test-classes/styles.selectors.js +3 -2
- package/lib/internal/template/internal/components/drag-handle/button.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/button.js +2 -2
- package/lib/internal/template/internal/components/drag-handle/button.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.js +2 -2
- package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +1 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/internal/hooks/use-performance-marks/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-performance-marks/index.js +15 -6
- package/lib/internal/template/internal/hooks/use-performance-marks/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-performance-marks/is-in-viewport.d.ts +9 -0
- package/lib/internal/template/internal/hooks/use-performance-marks/is-in-viewport.d.ts.map +1 -0
- package/lib/internal/template/internal/hooks/use-performance-marks/is-in-viewport.js +48 -0
- package/lib/internal/template/internal/hooks/use-performance-marks/is-in-viewport.js.map +1 -0
- package/lib/internal/template/key-value-pairs/interfaces.d.ts +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.d.ts.map +1 -1
- package/lib/internal/template/key-value-pairs/interfaces.js.map +1 -1
- package/lib/internal/template/key-value-pairs/styles.css.js +8 -8
- package/lib/internal/template/key-value-pairs/styles.scoped.css +10 -9
- package/lib/internal/template/key-value-pairs/styles.selectors.js +8 -8
- package/lib/internal/template/multiselect/index.d.ts.map +1 -1
- package/lib/internal/template/multiselect/index.js +1 -0
- package/lib/internal/template/multiselect/index.js.map +1 -1
- package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +2 -1
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.d.ts +8 -0
- package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.js +10 -0
- package/lib/internal/template/test-utils/dom/copy-to-clipboard/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/hotspot/index.js +2 -1
- package/lib/internal/template/test-utils/dom/hotspot/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.d.ts +8 -0
- package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.js +10 -0
- package/lib/internal/template/test-utils/selectors/copy-to-clipboard/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/hotspot/index.js +2 -1
- package/lib/internal/template/test-utils/selectors/hotspot/index.js.map +1 -1
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { useModalContext } from '../../context/modal-context';
|
|
|
5
5
|
import { useDOMAttribute } from '../use-dom-attribute';
|
|
6
6
|
import { useEffectOnUpdate } from '../use-effect-on-update';
|
|
7
7
|
import { useRandomId } from '../use-unique-id';
|
|
8
|
+
import { isInViewport } from './is-in-viewport';
|
|
8
9
|
const EVALUATE_COMPONENT_VISIBILITY_EVENT = 'awsui-evaluate-component-visibility';
|
|
9
10
|
/**
|
|
10
11
|
* This hook manages a boolean state (`evaluateComponentVisibility`) that toggles
|
|
@@ -45,10 +46,14 @@ export function usePerformanceMarks(name, enabled, elementRef, getDetails, depen
|
|
|
45
46
|
if (!elementVisible) {
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const timestamp = performance.now();
|
|
50
|
+
const cleanup = isInViewport(elementRef.current, inViewport => {
|
|
51
|
+
performance.mark(`${name}Rendered`, {
|
|
52
|
+
startTime: timestamp,
|
|
53
|
+
detail: Object.assign({ source: 'awsui', instanceIdentifier: id, inViewport }, getDetails()),
|
|
54
|
+
});
|
|
51
55
|
});
|
|
56
|
+
return cleanup;
|
|
52
57
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
58
|
}, []);
|
|
54
59
|
useEffectOnUpdate(() => {
|
|
@@ -61,10 +66,14 @@ export function usePerformanceMarks(name, enabled, elementRef, getDetails, depen
|
|
|
61
66
|
if (!elementVisible) {
|
|
62
67
|
return;
|
|
63
68
|
}
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
const timestamp = performance.now();
|
|
70
|
+
const cleanup = isInViewport(elementRef.current, inViewport => {
|
|
71
|
+
performance.mark(`${name}Updated`, {
|
|
72
|
+
startTime: timestamp,
|
|
73
|
+
detail: Object.assign({ source: 'awsui', instanceIdentifier: id, inViewport }, getDetails()),
|
|
74
|
+
});
|
|
67
75
|
});
|
|
76
|
+
return cleanup;
|
|
68
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
78
|
}, [evaluateComponentVisibility, ...dependencies]);
|
|
70
79
|
return attributes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-performance-marks/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-performance-marks/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,mCAAmC,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AAC,2BAA2B,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC;IAEnD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect, useState } from 'react';\n\nimport { useModalContext } from '../../context/modal-context';\nimport { useDOMAttribute } from '../use-dom-attribute';\nimport { useEffectOnUpdate } from '../use-effect-on-update';\nimport { useRandomId } from '../use-unique-id';\nimport { isInViewport } from './is-in-viewport';\n\nconst EVALUATE_COMPONENT_VISIBILITY_EVENT = 'awsui-evaluate-component-visibility';\n\n/**\n * This hook manages a boolean state (`evaluateComponentVisibility`) that toggles\n * whenever a custom DOM event (`EVALUATE_COMPONENT_VISIBILITY_EVENT`) is triggered.\n *\n * @returns\n */\nconst useEvaluateComponentVisibility = () => {\n const [evaluateComponentVisibility, setEvaluateComponentVisibility] = useState(false);\n\n useEffect(() => {\n const handleEvaluateComponentVisibility = () => {\n setEvaluateComponentVisibility(prev => !prev);\n };\n\n document.addEventListener(EVALUATE_COMPONENT_VISIBILITY_EVENT, handleEvaluateComponentVisibility);\n\n return () => {\n document.removeEventListener(EVALUATE_COMPONENT_VISIBILITY_EVENT, handleEvaluateComponentVisibility);\n };\n }, []);\n\n return evaluateComponentVisibility;\n};\n\n/**\n * This function returns an object that needs to be spread onto the same\n * element as the `elementRef`, so that the data attribute is applied\n * correctly.\n */\nexport function usePerformanceMarks(\n name: string,\n enabled: () => boolean,\n elementRef: React.RefObject<HTMLElement>,\n getDetails: () => Record<string, string | boolean | number | undefined>,\n dependencies: React.DependencyList\n) {\n const id = useRandomId();\n const { isInModal } = useModalContext();\n const attributes = useDOMAttribute(elementRef, 'data-analytics-performance-mark', id);\n const evaluateComponentVisibility = useEvaluateComponentVisibility();\n\n useEffect(() => {\n if (!enabled() || !elementRef.current || isInModal) {\n return;\n }\n const elementVisible =\n elementRef.current.offsetWidth > 0 &&\n elementRef.current.offsetHeight > 0 &&\n getComputedStyle(elementRef.current).visibility !== 'hidden';\n\n if (!elementVisible) {\n return;\n }\n\n const timestamp = performance.now();\n\n const cleanup = isInViewport(elementRef.current, inViewport => {\n performance.mark(`${name}Rendered`, {\n startTime: timestamp,\n detail: {\n source: 'awsui',\n instanceIdentifier: id,\n inViewport,\n ...getDetails(),\n },\n });\n });\n\n return cleanup;\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectOnUpdate(() => {\n if (!enabled() || !elementRef.current || isInModal) {\n return;\n }\n const elementVisible =\n elementRef.current.offsetWidth > 0 &&\n elementRef.current.offsetHeight > 0 &&\n getComputedStyle(elementRef.current).visibility !== 'hidden';\n\n if (!elementVisible) {\n return;\n }\n\n const timestamp = performance.now();\n\n const cleanup = isInViewport(elementRef.current, inViewport => {\n performance.mark(`${name}Updated`, {\n startTime: timestamp,\n detail: {\n source: 'awsui',\n instanceIdentifier: id,\n inViewport,\n ...getDetails(),\n },\n });\n });\n return cleanup;\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [evaluateComponentVisibility, ...dependencies]);\n\n return attributes;\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Callback = (inViewport: boolean) => void;
|
|
2
|
+
/**
|
|
3
|
+
* This function determines whether an element is in the viewport. The callback
|
|
4
|
+
* is batched with other elements that also use this function, in order to improve
|
|
5
|
+
* performance.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isInViewport(element: Element, callback: Callback): () => void;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=is-in-viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-in-viewport.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-performance-marks/is-in-viewport.ts"],"names":[],"mappings":"AAGA,KAAK,QAAQ,GAAG,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;AAK9C;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,cAuBhE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const map = new WeakMap();
|
|
4
|
+
const MANUAL_TRIGGER_DELAY = 150;
|
|
5
|
+
/**
|
|
6
|
+
* This function determines whether an element is in the viewport. The callback
|
|
7
|
+
* is batched with other elements that also use this function, in order to improve
|
|
8
|
+
* performance.
|
|
9
|
+
*/
|
|
10
|
+
export function isInViewport(element, callback) {
|
|
11
|
+
let resolve = (value) => {
|
|
12
|
+
resolve = () => { }; // Prevent multiple execution
|
|
13
|
+
callback(value);
|
|
14
|
+
};
|
|
15
|
+
map.set(element, inViewport => resolve(inViewport));
|
|
16
|
+
observer.observe(element);
|
|
17
|
+
/*
|
|
18
|
+
If the IntersectionObserver does not fire in reasonable time (for example
|
|
19
|
+
in a background page in Chrome), we need to call the callback manually.
|
|
20
|
+
|
|
21
|
+
See https://issues.chromium.org/issues/41383759
|
|
22
|
+
*/
|
|
23
|
+
const timeoutHandle = setTimeout(() => resolve(false), MANUAL_TRIGGER_DELAY);
|
|
24
|
+
// Cleanup
|
|
25
|
+
return () => {
|
|
26
|
+
clearTimeout(timeoutHandle);
|
|
27
|
+
map.delete(element);
|
|
28
|
+
observer.unobserve(element);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function createIntersectionObserver(callback) {
|
|
32
|
+
if (typeof IntersectionObserver === 'undefined') {
|
|
33
|
+
return {
|
|
34
|
+
observe: () => { },
|
|
35
|
+
unobserve: () => { },
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return new IntersectionObserver(callback);
|
|
39
|
+
}
|
|
40
|
+
const observer = createIntersectionObserver(function isInViewportObserver(entries) {
|
|
41
|
+
var _a;
|
|
42
|
+
for (const entry of entries) {
|
|
43
|
+
observer.unobserve(entry.target); // We only want the first run of the observer for each element.
|
|
44
|
+
(_a = map.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry.isIntersecting);
|
|
45
|
+
map.delete(entry.target);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=is-in-viewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-in-viewport.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-performance-marks/is-in-viewport.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,MAAM,GAAG,GAAG,IAAI,OAAO,EAAqB,CAAC;AAE7C,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAgB,EAAE,QAAkB;IAC/D,IAAI,OAAO,GAAG,CAAC,KAAc,EAAE,EAAE;QAC/B,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,6BAA6B;QACjD,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1B;;;;;SAKE;IACF,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAE7E,UAAU;IACV,OAAO,GAAG,EAAE;QACV,YAAY,CAAC,aAAa,CAAC,CAAC;QAC5B,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpB,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CAAC,QAAsC;IACxE,IAAI,OAAO,oBAAoB,KAAK,WAAW,EAAE;QAC/C,OAAO;YACL,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;YACjB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;SACpB,CAAC;KACH;IACD,OAAO,IAAI,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,QAAQ,GAAG,0BAA0B,CAAC,SAAS,oBAAoB,CAAC,OAAO;;IAC/E,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;QAC3B,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,+DAA+D;QACjG,MAAA,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAG,KAAK,CAAC,cAAc,CAAC,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAC1B;AACH,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\ntype Callback = (inViewport: boolean) => void;\nconst map = new WeakMap<Element, Callback>();\n\nconst MANUAL_TRIGGER_DELAY = 150;\n\n/**\n * This function determines whether an element is in the viewport. The callback\n * is batched with other elements that also use this function, in order to improve\n * performance.\n */\nexport function isInViewport(element: Element, callback: Callback) {\n let resolve = (value: boolean) => {\n resolve = () => {}; // Prevent multiple execution\n callback(value);\n };\n\n map.set(element, inViewport => resolve(inViewport));\n observer.observe(element);\n\n /*\n\t If the IntersectionObserver does not fire in reasonable time (for example\n\t in a background page in Chrome), we need to call the callback manually.\n \n\t See https://issues.chromium.org/issues/41383759\n\t */\n const timeoutHandle = setTimeout(() => resolve(false), MANUAL_TRIGGER_DELAY);\n\n // Cleanup\n return () => {\n clearTimeout(timeoutHandle);\n map.delete(element);\n observer.unobserve(element);\n };\n}\n\nfunction createIntersectionObserver(callback: IntersectionObserverCallback) {\n if (typeof IntersectionObserver === 'undefined') {\n return {\n observe: () => {},\n unobserve: () => {},\n };\n }\n return new IntersectionObserver(callback);\n}\n\nconst observer = createIntersectionObserver(function isInViewportObserver(entries) {\n for (const entry of entries) {\n observer.unobserve(entry.target); // We only want the first run of the observer for each element.\n map.get(entry.target)?.(entry.isIntersecting);\n map.delete(entry.target);\n }\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/key-value-pairs/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC9C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,yBAAiB,kBAAkB,CAAC;IAClC,KAAY,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC;IAEhC,UAAiB,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;KAC5B;IAED,UAAiB,IAAK,SAAQ,kBAAkB;QAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/key-value-pairs/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC9C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,yBAAiB,kBAAkB,CAAC;IAClC,KAAY,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC;IAEhC,UAAiB,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;KAC5B;IAED,UAAiB,IAAK,SAAQ,kBAAkB;QAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KACxB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/key-value-pairs/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface KeyValuePairsProps extends BaseComponentProps {\n /**\n * Specifies the number of columns in each grid row.\n * Valid values are any integer between 1 and 4. It defaults to 1.\n */\n columns?: number;\n /**\n * An array of either key-value pairs individual items or groups.\n * They could be combined.\n * Each item has `type` prop, which might be either `group` or `pair`. Defaults to `pair` if not specified.\n *\n * Each key-value pair definition has the following properties:\n * * `type` (string) - (Optional) Item type (pair).\n * * `label` (string) - The key label.\n * * `info` (React.ReactNode) - (Optional) Area next to the key to display an info link.\n * * `value` (React.ReactNode) - The corresponding value for the key.\n *\n * Each group definition has the following properties:\n * * `type` (string) - Item type (group).\n * * `title` (string) - (Optional) An optional title for this column.\n * * `items` (ReadonlyArray<KeyValuePairProps.KeyValuePair>) - An array of\n * key-value pair items.\n */\n items: ReadonlyArray<KeyValuePairsProps.Item>;\n /**\n * Provides an `aria-label` to the Key-value pairs container.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n /**\n * Sets the `aria-labelledby` property on the Key-value pairs container.\n * If there's a visible label element that you can reference, use this instead of `ariaLabel`.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * Use to specify the desired minimum width for each column in pixels.\n *\n * The number of columns is determined by the value of this property, the available space,\n * and the maximum number of columns as defined by the `columns` property.\n * If not set, defaults to 150.\n */\n minColumnWidth?: number;\n}\n\nexport namespace KeyValuePairsProps {\n export type Item = Group | Pair;\n\n export interface Group {\n type: 'group';\n title?: string;\n items: ReadonlyArray<Pair>;\n }\n\n export interface Pair extends BaseComponentProps {\n type?: 'pair';\n label:
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/key-value-pairs/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface KeyValuePairsProps extends BaseComponentProps {\n /**\n * Specifies the number of columns in each grid row.\n * Valid values are any integer between 1 and 4. It defaults to 1.\n */\n columns?: number;\n /**\n * An array of either key-value pairs individual items or groups.\n * They could be combined.\n * Each item has `type` prop, which might be either `group` or `pair`. Defaults to `pair` if not specified.\n *\n * Each key-value pair definition has the following properties:\n * * `type` (string) - (Optional) Item type (pair).\n * * `label` (string) - The key label.\n * * `info` (React.ReactNode) - (Optional) Area next to the key to display an info link.\n * * `value` (React.ReactNode) - The corresponding value for the key.\n *\n * Each group definition has the following properties:\n * * `type` (string) - Item type (group).\n * * `title` (string) - (Optional) An optional title for this column.\n * * `items` (ReadonlyArray<KeyValuePairProps.KeyValuePair>) - An array of\n * key-value pair items.\n */\n items: ReadonlyArray<KeyValuePairsProps.Item>;\n /**\n * Provides an `aria-label` to the Key-value pairs container.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n /**\n * Sets the `aria-labelledby` property on the Key-value pairs container.\n * If there's a visible label element that you can reference, use this instead of `ariaLabel`.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * Use to specify the desired minimum width for each column in pixels.\n *\n * The number of columns is determined by the value of this property, the available space,\n * and the maximum number of columns as defined by the `columns` property.\n * If not set, defaults to 150.\n */\n minColumnWidth?: number;\n}\n\nexport namespace KeyValuePairsProps {\n export type Item = Group | Pair;\n\n export interface Group {\n type: 'group';\n title?: string;\n items: ReadonlyArray<Pair>;\n }\n\n export interface Pair extends BaseComponentProps {\n type?: 'pair';\n label: React.ReactNode;\n value: React.ReactNode;\n info?: React.ReactNode;\n }\n}\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"key-value-pairs": "awsui_key-value-
|
|
5
|
-
"group-title": "awsui_group-
|
|
6
|
-
"group-list": "awsui_group-
|
|
7
|
-
"group-list-item": "awsui_group-list-
|
|
8
|
-
"term": "
|
|
9
|
-
"key-label": "awsui_key-
|
|
10
|
-
"detail": "
|
|
11
|
-
"info": "
|
|
4
|
+
"key-value-pairs": "awsui_key-value-pairs_1y9fy_gscxd_145",
|
|
5
|
+
"group-title": "awsui_group-title_1y9fy_gscxd_177",
|
|
6
|
+
"group-list": "awsui_group-list_1y9fy_gscxd_181",
|
|
7
|
+
"group-list-item": "awsui_group-list-item_1y9fy_gscxd_191",
|
|
8
|
+
"term": "awsui_term_1y9fy_gscxd_195",
|
|
9
|
+
"key-label": "awsui_key-label_1y9fy_gscxd_203",
|
|
10
|
+
"detail": "awsui_detail_1y9fy_gscxd_212",
|
|
11
|
+
"info": "awsui_info_1y9fy_gscxd_247"
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.awsui_key-value-
|
|
145
|
+
.awsui_key-value-pairs_1y9fy_gscxd_145:not(#\9) {
|
|
146
146
|
border-collapse: separate;
|
|
147
147
|
border-spacing: 0;
|
|
148
148
|
box-sizing: border-box;
|
|
@@ -175,11 +175,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
175
175
|
-moz-osx-font-smoothing: auto;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
.awsui_group-
|
|
178
|
+
.awsui_group-title_1y9fy_gscxd_177:not(#\9) {
|
|
179
179
|
padding-block-end: var(--space-scaled-m-3uxq9h, 16px);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
.awsui_group-
|
|
182
|
+
.awsui_group-list_1y9fy_gscxd_181:not(#\9) {
|
|
183
183
|
margin-block-start: 0;
|
|
184
184
|
margin-block-end: 0;
|
|
185
185
|
margin-inline-start: 0;
|
|
@@ -189,11 +189,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
189
189
|
row-gap: var(--space-scaled-m-3uxq9h, 16px);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.awsui_group-list-
|
|
192
|
+
.awsui_group-list-item_1y9fy_gscxd_191:not(#\9) {
|
|
193
193
|
/* used in test-utils */
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
.
|
|
196
|
+
.awsui_term_1y9fy_gscxd_195:not(#\9) {
|
|
197
197
|
font-size: var(--font-size-body-m-6wxxs5, 14px);
|
|
198
198
|
line-height: var(--line-height-body-m-gw0130, 22px);
|
|
199
199
|
font-weight: var(--font-display-label-weight-5p8eav, 400);
|
|
@@ -201,15 +201,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
201
201
|
margin-block-end: var(--space-key-value-gap-v0snfq, 2px);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
.awsui_key-
|
|
204
|
+
.awsui_key-label_1y9fy_gscxd_203:not(#\9) {
|
|
205
|
+
display: inline-flex;
|
|
205
206
|
margin-inline-end: var(--space-xs-6dgkww, 8px);
|
|
206
207
|
}
|
|
207
|
-
.awsui_key-
|
|
208
|
+
.awsui_key-label_1y9fy_gscxd_203:not(#\9):only-child {
|
|
208
209
|
margin-block: 0;
|
|
209
210
|
margin-inline: 0;
|
|
210
211
|
}
|
|
211
212
|
|
|
212
|
-
.
|
|
213
|
+
.awsui_detail_1y9fy_gscxd_212:not(#\9) {
|
|
213
214
|
border-collapse: separate;
|
|
214
215
|
border-spacing: 0;
|
|
215
216
|
box-sizing: border-box;
|
|
@@ -245,7 +246,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
245
246
|
margin-block-end: 0;
|
|
246
247
|
}
|
|
247
248
|
|
|
248
|
-
.
|
|
249
|
+
.awsui_info_1y9fy_gscxd_247:not(#\9) {
|
|
249
250
|
display: inline-flex;
|
|
250
251
|
padding-inline-start: var(--space-xs-6dgkww, 8px);
|
|
251
252
|
border-inline-start: var(--border-divider-section-width-iueskx, 1px) solid var(--color-border-divider-default-u5ytia, #eaeded);
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"key-value-pairs": "awsui_key-value-
|
|
6
|
-
"group-title": "awsui_group-
|
|
7
|
-
"group-list": "awsui_group-
|
|
8
|
-
"group-list-item": "awsui_group-list-
|
|
9
|
-
"term": "
|
|
10
|
-
"key-label": "awsui_key-
|
|
11
|
-
"detail": "
|
|
12
|
-
"info": "
|
|
5
|
+
"key-value-pairs": "awsui_key-value-pairs_1y9fy_gscxd_145",
|
|
6
|
+
"group-title": "awsui_group-title_1y9fy_gscxd_177",
|
|
7
|
+
"group-list": "awsui_group-list_1y9fy_gscxd_181",
|
|
8
|
+
"group-list-item": "awsui_group-list-item_1y9fy_gscxd_191",
|
|
9
|
+
"term": "awsui_term_1y9fy_gscxd_195",
|
|
10
|
+
"key-label": "awsui_key-label_1y9fy_gscxd_203",
|
|
11
|
+
"detail": "awsui_detail_1y9fy_gscxd_212",
|
|
12
|
+
"info": "awsui_info_1y9fy_gscxd_247"
|
|
13
13
|
};
|
|
14
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAEA,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":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAuDhB,CAAC;AAGF,eAAe,WAAW,CAAC"}
|
|
@@ -20,6 +20,7 @@ const Multiselect = React.forwardRef((_a, ref) => {
|
|
|
20
20
|
tokenLimit: restProps.tokenLimit,
|
|
21
21
|
virtualScroll: restProps.virtualScroll,
|
|
22
22
|
readOnly: restProps.readOnly,
|
|
23
|
+
enableSelectAll: restProps.enableSelectAll,
|
|
23
24
|
},
|
|
24
25
|
metadata: {
|
|
25
26
|
hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,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,mBAAmB,MAAM,YAAY,CAAC;AAE7C,OAAO,+BAA+B,MAAM,wEAAwE,CAAC;AAIrH,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EAQmB,EACnB,GAAoC,EACpC,EAAE;QAVF,EACE,OAAO,GAAG,EAAE,EACZ,aAAa,GAAG,MAAM,EACtB,UAAU,GAAG,UAAU,EACvB,eAAe,GAAG,EAAE,EACpB,QAAQ,GAAG,IAAI,EACf,UAAU,GAAG,KAAK,OAED,EADd,SAAS,cAPd,uFAQC,CADa;IAId,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,aAAa,EAAE;QACzD,KAAK,EAAE;YACL,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,SAAS,EAAE,SAAS,CAAC,SAAS;YAC9B,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;YAC5C,aAAa;YACb,UAAU;YACV,QAAQ;YACR,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,aAAa,EAAE,SAAS,CAAC,aAAa;YACtC,QAAQ,EAAE,SAAS,CAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.ts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,EAAE;YACV,QAAQ,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE;YACnC,oBAAoB,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE;SAClD;KACF,CAAC;IAEF,OAAO,CACL,oBAAC,mBAAmB,kBAClB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,IAClB,SAAS,EACT,kBAAkB,IACtB,GAAG,EAAE,GAAG,IACJ,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,EAC5E,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\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 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 ...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 },\n metadata: {\n hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),\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 },\n };\n\n return (\n <InternalMultiselect\n options={options}\n filteringType={filteringType}\n statusType={statusType}\n selectedOptions={selectedOptions}\n keepOpen={keepOpen}\n hideTokens={hideTokens}\n {...restProps}\n {...baseComponentProps}\n ref={ref}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Multiselect, 'Multiselect');\nexport default Multiselect;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAU3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAWhD,QAAA,MAAM,mBAAmB;;;;;;;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAU3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAWhD,QAAA,MAAM,mBAAmB;;;;;;;gFAgLxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -64,9 +64,10 @@ const InternalMultiselect = React.forwardRef((_a, externalRef) => {
|
|
|
64
64
|
};
|
|
65
65
|
const dropdownStatus = multiselectProps.dropdownStatus;
|
|
66
66
|
const dropdownProps = multiselectProps.getDropdownProps();
|
|
67
|
+
const hasFilteredOptions = multiselectProps.filteredOptions.length > 0;
|
|
67
68
|
return (React.createElement("div", Object.assign({}, baseProps, { ref: __internalRootRef, className: clsx(styles.root, baseProps.className) }, multiselectProps.getWrapperProps()),
|
|
68
69
|
React.createElement(Dropdown, Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(ariaLabelId, controlId) : undefined, ariaDescribedby: dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined, open: multiselectProps.isOpen, trigger: trigger, header: filter, footer: dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: multiselectProps.isOpen ? dropdownStatus.content : null, id: footerId })) : null, expandToViewport: expandToViewport, stretchBeyondTriggerWidth: true }),
|
|
69
|
-
React.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: multiselectProps.isOpen ? dropdownStatus.content : null, id: footerId })) : null, menuProps: multiselectProps.getMenuProps(), 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: enableSelectAll })),
|
|
70
|
+
React.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? (React.createElement(DropdownFooter, { content: multiselectProps.isOpen ? dropdownStatus.content : null, id: footerId })) : null, menuProps: multiselectProps.getMenuProps(), 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 })),
|
|
70
71
|
showTokens && (React.createElement(InternalTokenGroup, Object.assign({}, multiselectProps.getTokenProps(), { className: styles.tokens, alignment: "horizontal", limit: tokenLimit, items: tokens, i18nStrings: tokenGroupI18nStrings, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, disableOuterPadding: true, readOnly: readOnly }))),
|
|
71
72
|
React.createElement(ScreenreaderOnly, { id: ariaLabelId }, ariaLabel)));
|
|
72
73
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/multiselect/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,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;AAEvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,MAAM,MA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AW,IAAG,SAAS,CAAoB,CAC7D,CACP,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, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SomeRequired } from '../internal/types';\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 { 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\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 selectedOptions,\n deselectAriaLabel,\n tokenLimit,\n i18nStrings,\n virtualScroll,\n inlineTokens = false,\n hideTokens,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef = null,\n autoFocus,\n enableSelectAll,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const i18n = useInternalI18n('multiselect');\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 ...restProps,\n });\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 trigger = (\n <Trigger\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerProps={multiselectProps.getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n selectedOptions={selectedOptions}\n triggerVariant={inlineTokens ? 'tokens' : 'placeholder'}\n isOpen={multiselectProps.isOpen}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, ariaLabelId)}\n />\n );\n\n const tokens: TokenGroupProps['items'] = selectedOptions.map(option => ({\n label: option.label,\n disabled: disabled || option.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 }));\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const showTokens = !hideTokens && !inlineTokens && 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\n return (\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.dropdownContentRole ? joinStrings(ariaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined\n }\n open={multiselectProps.isOpen}\n trigger={trigger}\n header={filter}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={true}\n >\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={multiselectProps.getMenuProps()}\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={enableSelectAll}\n />\n </Dropdown>\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 />\n )}\n\n <ScreenreaderOnly id={ariaLabelId}>{ariaLabel}</ScreenreaderOnly>\n </div>\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,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,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;AAEvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAQrC,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EAyB2B,EAC3B,WAA4C,EAC5C,EAAE;;QA3BF,EACE,OAAO,EACP,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,GAAG,KAAK,EACpB,UAAU,E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,CAAC,CAAC,CAAC,CACzB,oBAAC,cAAc,IAAC,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,GAAI,CACnG,CAAC,CAAC,CAAC,IAAI,EAEV,SAAS,EAAE,gBAAgB,CAAC,YAAY,EAAE,EAC1C,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,GACxD,CACO;QAEV,UAAU,IAAI,CACb,oBAAC,kBAAkB,oBACb,gBAAgB,CAAC,aAAa,EAAE,IACpC,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,IAClB,CACH;QAED,oBAAC,gBAAgB,IAAC,EAAE,EAAE,WAAW,IAAG,SAAS,CAAoB,CAC7D,CACP,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, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SomeRequired } from '../internal/types';\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 { 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\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 selectedOptions,\n deselectAriaLabel,\n tokenLimit,\n i18nStrings,\n virtualScroll,\n inlineTokens = false,\n hideTokens,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef = null,\n autoFocus,\n enableSelectAll,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const i18n = useInternalI18n('multiselect');\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 ...restProps,\n });\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 trigger = (\n <Trigger\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n triggerProps={multiselectProps.getTriggerProps(disabled, autoFocus)}\n selectedOption={null}\n selectedOptions={selectedOptions}\n triggerVariant={inlineTokens ? 'tokens' : 'placeholder'}\n isOpen={multiselectProps.isOpen}\n {...formFieldContext}\n controlId={controlId}\n ariaLabelledby={joinStrings(formFieldContext.ariaLabelledby, ariaLabelId)}\n />\n );\n\n const tokens: TokenGroupProps['items'] = selectedOptions.map(option => ({\n label: option.label,\n disabled: disabled || option.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 }));\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const showTokens = !hideTokens && !inlineTokens && 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 return (\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.dropdownContentRole ? joinStrings(ariaLabelId, controlId) : undefined}\n ariaDescribedby={\n dropdownProps.dropdownContentRole ? (dropdownStatus.content ? footerId : undefined) : undefined\n }\n open={multiselectProps.isOpen}\n trigger={trigger}\n header={filter}\n footer={\n dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={true}\n >\n <ListComponent\n listBottom={\n !dropdownStatus.isSticky ? (\n <DropdownFooter content={multiselectProps.isOpen ? dropdownStatus.content : null} id={footerId} />\n ) : null\n }\n menuProps={multiselectProps.getMenuProps()}\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 />\n </Dropdown>\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 />\n )}\n\n <ScreenreaderOnly id={ariaLabelId}>{ariaLabel}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalMultiselect;\n"]}
|
|
@@ -6,5 +6,13 @@ export default class CopyToClipboardWrapper extends ComponentWrapper {
|
|
|
6
6
|
findStatusText(options?: {
|
|
7
7
|
popoverRenderWithPortal: boolean;
|
|
8
8
|
}): null | ElementWrapper;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `findDisplayedText` instead.
|
|
11
|
+
*/
|
|
9
12
|
findTextToCopy(): null | ElementWrapper;
|
|
13
|
+
/**
|
|
14
|
+
* Used to get the text displayed next to the copy icon button when `variant='inline'`.
|
|
15
|
+
* Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
|
|
16
|
+
*/
|
|
17
|
+
findDisplayedText(): null | ElementWrapper;
|
|
10
18
|
}
|
|
@@ -15,9 +15,19 @@ class CopyToClipboardWrapper extends dom_1.ComponentWrapper {
|
|
|
15
15
|
renderWithPortal: options.popoverRenderWithPortal,
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `findDisplayedText` instead.
|
|
20
|
+
*/
|
|
18
21
|
findTextToCopy() {
|
|
19
22
|
return this.findByClassName(styles_selectors_js_1.default['text-to-copy']);
|
|
20
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Used to get the text displayed next to the copy icon button when `variant='inline'`.
|
|
26
|
+
* Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
|
|
27
|
+
*/
|
|
28
|
+
findDisplayedText() {
|
|
29
|
+
return this.findByClassName(styles_selectors_js_1.default['text-to-display']);
|
|
30
|
+
}
|
|
21
31
|
}
|
|
22
32
|
exports.default = CopyToClipboardWrapper;
|
|
23
33
|
CopyToClipboardWrapper.rootSelector = styles_selectors_js_1.default.root;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;AACtC,wCAAwC;AAExC,qGAAqF;AAErF,MAAqB,sBAAuB,SAAQ,sBAAgB;IAGlE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9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@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
const dom_1 = require("@cloudscape-design/test-utils-core/dom");
|
|
6
|
+
const index_1 = require("../index");
|
|
6
7
|
const index_js_1 = require("../index.js");
|
|
7
8
|
const styles_selectors_js_1 = require("../../../annotation-context/annotation/styles.selectors.js");
|
|
8
9
|
const styles_selectors_js_2 = require("../../../hotspot/styles.selectors.js");
|
|
@@ -11,7 +12,7 @@ class HotspotWrapper extends dom_1.ComponentWrapper {
|
|
|
11
12
|
return this.findByClassName(styles_selectors_js_1.default.hotspot);
|
|
12
13
|
}
|
|
13
14
|
findAnnotation() {
|
|
14
|
-
return
|
|
15
|
+
return (0, index_1.default)().findComponent(`.${styles_selectors_js_1.default.annotation}`, index_js_1.AnnotationWrapper);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
exports.default = HotspotWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,0CAAgD;AAEhD,oGAA0F;AAC1F,8EAAiE;AAEjE,MAAqB,cAAe,SAAQ,sBAAgB;IAG1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IAED,cAAc;QACZ,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,oCAAqC;AACrC,0CAAgD;AAEhD,oGAA0F;AAC1F,8EAAiE;AAEjE,MAAqB,cAAe,SAAQ,sBAAgB;IAG1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IAED,cAAc;QACZ,OAAO,IAAA,eAAa,GAAE,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,UAAU,EAAE,EAAE,4BAAiB,CAAE,CAAC;IAC9F,CAAC;;AATH,iCAUC;AATQ,2BAAY,GAAW,6BAAa,CAAC,IAAI,CAAC"}
|
|
@@ -6,5 +6,13 @@ export default class CopyToClipboardWrapper extends ComponentWrapper {
|
|
|
6
6
|
findStatusText(options?: {
|
|
7
7
|
popoverRenderWithPortal: boolean;
|
|
8
8
|
}): ElementWrapper;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `findDisplayedText` instead.
|
|
11
|
+
*/
|
|
9
12
|
findTextToCopy(): ElementWrapper;
|
|
13
|
+
/**
|
|
14
|
+
* Used to get the text displayed next to the copy icon button when `variant='inline'`.
|
|
15
|
+
* Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
|
|
16
|
+
*/
|
|
17
|
+
findDisplayedText(): ElementWrapper;
|
|
10
18
|
}
|
|
@@ -17,9 +17,19 @@ class CopyToClipboardWrapper extends selectors_1.ComponentWrapper {
|
|
|
17
17
|
renderWithPortal: options.popoverRenderWithPortal
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use `findDisplayedText` instead.
|
|
22
|
+
*/
|
|
20
23
|
findTextToCopy() {
|
|
21
24
|
return this.findByClassName(styles_selectors_js_1.default['text-to-copy']);
|
|
22
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Used to get the text displayed next to the copy icon button when `variant='inline'`.
|
|
28
|
+
* Returns either the `textToCopy` value or the `textToDisplay` value if it has been set.
|
|
29
|
+
*/
|
|
30
|
+
findDisplayedText() {
|
|
31
|
+
return this.findByClassName(styles_selectors_js_1.default['text-to-display']);
|
|
32
|
+
}
|
|
23
33
|
}
|
|
24
34
|
exports.default = CopyToClipboardWrapper;
|
|
25
35
|
CopyToClipboardWrapper.rootSelector = styles_selectors_js_1.default.root;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,sCAAsC;AACtC,wCAAwC;AACxC,qGAAqF;AACrF,MAAqB,sBAAuB,SAAQ,4BAAgB;IAElE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IACD,cAAc,CAAC,OAAO,GAAG;QACvB,uBAAuB,EAAE,KAAK;KAC/B;QACC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAc,CAAC,YAAY,EAAE,EAAE,iBAAc,CAAE,CAAC,WAAW,CAAC;YACxF,gBAAgB,EAAE,OAAO,CAAC,uBAAuB;SAClD,CAAC,CAAC;IACL,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/copy-to-clipboard/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,sCAAsC;AACtC,wCAAwC;AACxC,qGAAqF;AACrF,MAAqB,sBAAuB,SAAQ,4BAAgB;IAElE,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,gBAAa,CAAC,YAAY,EAAE,EAAE,gBAAa,CAAE,CAAC;IAC9E,CAAC;IACD,cAAc,CAAC,OAAO,GAAG;QACvB,uBAAuB,EAAE,KAAK;KAC/B;QACC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAc,CAAC,YAAY,EAAE,EAAE,iBAAc,CAAE,CAAC,WAAW,CAAC;YACxF,gBAAgB,EAAE,OAAO,CAAC,uBAAuB;SAClD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC7D,CAAC;;AA1BH,yCA2BC;AA1BQ,mCAAY,GAAW,6BAAU,CAAC,IAAI,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
|
|
6
|
+
const index_1 = require("../index");
|
|
6
7
|
const index_js_1 = require("../index.js");
|
|
7
8
|
const styles_selectors_js_1 = require("../../../annotation-context/annotation/styles.selectors.js");
|
|
8
9
|
const styles_selectors_js_2 = require("../../../hotspot/styles.selectors.js");
|
|
@@ -11,7 +12,7 @@ class HotspotWrapper extends selectors_1.ComponentWrapper {
|
|
|
11
12
|
return this.findByClassName(styles_selectors_js_1.default.hotspot);
|
|
12
13
|
}
|
|
13
14
|
findAnnotation() {
|
|
14
|
-
return
|
|
15
|
+
return (0, index_1.default)().findComponent(`.${styles_selectors_js_1.default.annotation}`, index_js_1.AnnotationWrapper);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
exports.default = HotspotWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,0CAAgD;AAChD,oGAA0F;AAC1F,8EAAiE;AACjE,MAAqB,cAAe,SAAQ,4BAAgB;IAE1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IACD,cAAc;QACZ,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/hotspot/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,oCAAqC;AACrC,0CAAgD;AAChD,oGAA0F;AAC1F,8EAAiE;AACjE,MAAqB,cAAe,SAAQ,4BAAgB;IAE1D,WAAW;QACT,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAgB,CAAC,OAAO,CAAE,CAAC;IACzD,CAAC;IACD,cAAc;QACZ,OAAO,IAAA,eAAa,GAAE,CAAC,aAAa,CAAC,IAAI,6BAAgB,CAAC,UAAU,EAAE,EAAE,4BAAiB,CAAE,CAAC;IAC9F,CAAC;;AAPH,iCAQC;AAPQ,2BAAY,GAAW,6BAAa,CAAC,IAAI,CAAC"}
|