@cloudscape-design/components-themeable 3.0.960 → 3.0.962

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.
Files changed (55) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/key-value-pairs/styles.scss +1 -0
  3. package/lib/internal/template/attribute-editor/index.d.ts.map +1 -1
  4. package/lib/internal/template/attribute-editor/index.js +13 -3
  5. package/lib/internal/template/attribute-editor/index.js.map +1 -1
  6. package/lib/internal/template/attribute-editor/internal.d.ts.map +1 -1
  7. package/lib/internal/template/attribute-editor/internal.js +1 -1
  8. package/lib/internal/template/attribute-editor/internal.js.map +1 -1
  9. package/lib/internal/template/breadcrumb-group/analytics-metadata/interfaces.d.ts +12 -0
  10. package/lib/internal/template/breadcrumb-group/analytics-metadata/interfaces.d.ts.map +1 -1
  11. package/lib/internal/template/breadcrumb-group/analytics-metadata/interfaces.js.map +1 -1
  12. package/lib/internal/template/button-dropdown/analytics-metadata/interfaces.d.ts +8 -1
  13. package/lib/internal/template/button-dropdown/analytics-metadata/interfaces.d.ts.map +1 -1
  14. package/lib/internal/template/button-dropdown/analytics-metadata/interfaces.js.map +1 -1
  15. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.d.ts.map +1 -1
  16. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js +1 -2
  17. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
  18. package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
  19. package/lib/internal/template/button-dropdown/internal.js +2 -3
  20. package/lib/internal/template/button-dropdown/internal.js.map +1 -1
  21. package/lib/internal/template/expandable-section/analytics-metadata/interfaces.d.ts +7 -2
  22. package/lib/internal/template/expandable-section/analytics-metadata/interfaces.d.ts.map +1 -1
  23. package/lib/internal/template/expandable-section/analytics-metadata/interfaces.js.map +1 -1
  24. package/lib/internal/template/expandable-section/expandable-section-header.d.ts.map +1 -1
  25. package/lib/internal/template/expandable-section/expandable-section-header.js +1 -2
  26. package/lib/internal/template/expandable-section/expandable-section-header.js.map +1 -1
  27. package/lib/internal/template/internal/environment.js +1 -1
  28. package/lib/internal/template/internal/environment.json +1 -1
  29. package/lib/internal/template/internal/hooks/use-performance-marks/index.d.ts.map +1 -1
  30. package/lib/internal/template/internal/hooks/use-performance-marks/index.js +15 -6
  31. package/lib/internal/template/internal/hooks/use-performance-marks/index.js.map +1 -1
  32. package/lib/internal/template/internal/hooks/use-performance-marks/is-in-viewport.d.ts +9 -0
  33. package/lib/internal/template/internal/hooks/use-performance-marks/is-in-viewport.d.ts.map +1 -0
  34. package/lib/internal/template/internal/hooks/use-performance-marks/is-in-viewport.js +48 -0
  35. package/lib/internal/template/internal/hooks/use-performance-marks/is-in-viewport.js.map +1 -0
  36. package/lib/internal/template/key-value-pairs/interfaces.d.ts +1 -1
  37. package/lib/internal/template/key-value-pairs/interfaces.d.ts.map +1 -1
  38. package/lib/internal/template/key-value-pairs/interfaces.js.map +1 -1
  39. package/lib/internal/template/key-value-pairs/styles.css.js +8 -8
  40. package/lib/internal/template/key-value-pairs/styles.scoped.css +10 -9
  41. package/lib/internal/template/key-value-pairs/styles.selectors.js +8 -8
  42. package/lib/internal/template/multiselect/index.d.ts.map +1 -1
  43. package/lib/internal/template/multiselect/index.js +1 -0
  44. package/lib/internal/template/multiselect/index.js.map +1 -1
  45. package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
  46. package/lib/internal/template/multiselect/internal.js +2 -1
  47. package/lib/internal/template/multiselect/internal.js.map +1 -1
  48. package/lib/internal/template/side-navigation/analytics-metadata/interfaces.d.ts +3 -0
  49. package/lib/internal/template/side-navigation/analytics-metadata/interfaces.d.ts.map +1 -1
  50. package/lib/internal/template/side-navigation/analytics-metadata/interfaces.js.map +1 -1
  51. package/lib/internal/template/tag-editor/index.d.ts.map +1 -1
  52. package/lib/internal/template/tag-editor/index.js +1 -1
  53. package/lib/internal/template/tag-editor/index.js.map +1 -1
  54. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-performance-marks/index.ts"],"names":[],"mappings":";AAoCA;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,OAAO,EACtB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EACxC,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,EACvE,YAAY,EAAE,KAAK,CAAC,cAAc;;EAsDnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-performance-marks/index.ts"],"names":[],"mappings":";AAqCA;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,OAAO,EACtB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EACxC,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,EACvE,YAAY,EAAE,KAAK,CAAC,cAAc;;EAuEnC"}
@@ -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 renderedMarkName = `${name}Rendered`;
49
- performance.mark(renderedMarkName, {
50
- detail: Object.assign({ source: 'awsui', instanceIdentifier: id }, getDetails()),
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 updatedMarkName = `${name}Updated`;
65
- performance.mark(updatedMarkName, {
66
- detail: Object.assign({ source: 'awsui', instanceIdentifier: id }, getDetails()),
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;AAE/C,MAAM,mCAAmC,GAAG,qCAAqC,CAAC;AAElF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AO;SACR;QAED,MAAM,gBAAgB,GAAG,GAAG,IAAI,UAAU,CAAC;QAC3C,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACjC,MAAM,kBACJ,MAAM,EAAE,OAAO,EACf,kBAAkB,EAAE,EAAE,IACnB,UAAU,EAAE,CAChB;SACF,CAAC,CAAC;QACH,uDAAuD;IACzD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,iBAAiB,CAAC,GAAG,EAAE;QACrB,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,SAAS,EAAE;YAClD,OAAO;SACR;QACD,MAAM,cAAc,GAClB,UAAU,CAAC,OAAO,CAAC,WAAW,GAAG,CAAC;YAClC,UAAU,CAAC,OAAO,CAAC,YAAY,GAAG,CAAC;YACnC,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,CAAC;QAE/D,IAAI,CAAC,cAAc,EAAE;YACnB,OAAO;SACR;QACD,MAAM,eAAe,GAAG,GAAG,IAAI,SAAS,CAAC;QACzC,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE;YAChC,MAAM,kBACJ,MAAM,EAAE,OAAO,EACf,kBAAkB,EAAE,EAAE,IACnB,UAAU,EAAE,CAChB;SACF,CAAC,CAAC;QACH,uDAAuD;IACzD,CAAC,EAAE,CAAC,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';\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 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 renderedMarkName = `${name}Rendered`;\n performance.mark(renderedMarkName, {\n detail: {\n source: 'awsui',\n instanceIdentifier: id,\n ...getDetails(),\n },\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 const updatedMarkName = `${name}Updated`;\n performance.mark(updatedMarkName, {\n detail: {\n source: 'awsui',\n instanceIdentifier: id,\n ...getDetails(),\n },\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [evaluateComponentVisibility, ...dependencies]);\n\n return attributes;\n}\n"]}
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,GAAG,qCAAqC,CAAC;AAElF;;;;;GAKG;AACH,MAAM,8BAA8B,GAAG,GAAG,EAAE;IAC1C,MAAM,CAAC,2BAA2B,EAAE,8BAA8B,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,iCAAiC,GAAG,GAAG,EAAE;YAC7C,8BAA8B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,mCAAmC,EAAE,iCAAiC,CAAC,CAAC;QAElG,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,mCAAmC,EAAE,iCAAiC,CAAC,CAAC;QACvG,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,2BAA2B,CAAC;AACrC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC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,OAAO,CAAC,WAAW,GAAG,CAAC;YAClC,UAAU,CAAC,OAAO,CAAC,YAAY,GAAG,CAAC;YACnC,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,CAAC;QAE/D,IAAI,CAAC,cAAc,EAAE;YACnB,OAAO;SACR;QAED,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAEpC,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YAC5D,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,SAAS,EAAE;gBACjC,SAAS,EAAE,SAAS;gBACpB,MAAM,kBACJ,MAAM,EAAE,OAAO,EACf,kBAAkB,EAAE,EAAE,EACtB,UAAU,IACP,UAAU,EAAE,CAChB;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;QAEf,uDAAuD;IACzD,CAAC,EAAE,CAAC,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"]}
@@ -53,7 +53,7 @@ export declare namespace KeyValuePairsProps {
53
53
  }
54
54
  interface Pair extends BaseComponentProps {
55
55
  type?: 'pair';
56
- label: string;
56
+ label: React.ReactNode;
57
57
  value: React.ReactNode;
58
58
  info?: React.ReactNode;
59
59
  }
@@ -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,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KACxB;CACF"}
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: string;\n value: React.ReactNode;\n info?: React.ReactNode;\n }\n}\n"]}
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-pairs_1y9fy_z8tgn_145",
5
- "group-title": "awsui_group-title_1y9fy_z8tgn_177",
6
- "group-list": "awsui_group-list_1y9fy_z8tgn_181",
7
- "group-list-item": "awsui_group-list-item_1y9fy_z8tgn_191",
8
- "term": "awsui_term_1y9fy_z8tgn_195",
9
- "key-label": "awsui_key-label_1y9fy_z8tgn_203",
10
- "detail": "awsui_detail_1y9fy_z8tgn_211",
11
- "info": "awsui_info_1y9fy_z8tgn_246"
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-pairs_1y9fy_z8tgn_145:not(#\9) {
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-title_1y9fy_z8tgn_177:not(#\9) {
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-list_1y9fy_z8tgn_181:not(#\9) {
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-item_1y9fy_z8tgn_191:not(#\9) {
192
+ .awsui_group-list-item_1y9fy_gscxd_191:not(#\9) {
193
193
  /* used in test-utils */
194
194
  }
195
195
 
196
- .awsui_term_1y9fy_z8tgn_195:not(#\9) {
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-label_1y9fy_z8tgn_203:not(#\9) {
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-label_1y9fy_z8tgn_203:not(#\9):only-child {
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
- .awsui_detail_1y9fy_z8tgn_211:not(#\9) {
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
- .awsui_info_1y9fy_z8tgn_246:not(#\9) {
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-pairs_1y9fy_z8tgn_145",
6
- "group-title": "awsui_group-title_1y9fy_z8tgn_177",
7
- "group-list": "awsui_group-list_1y9fy_z8tgn_181",
8
- "group-list-item": "awsui_group-list-item_1y9fy_z8tgn_191",
9
- "term": "awsui_term_1y9fy_z8tgn_195",
10
- "key-label": "awsui_key-label_1y9fy_z8tgn_203",
11
- "detail": "awsui_detail_1y9fy_z8tgn_211",
12
- "info": "awsui_info_1y9fy_z8tgn_246"
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,+FAsDhB,CAAC;AAGF,eAAe,WAAW,CAAC"}
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;SAC7B;QACD,QAAQ,EAAE;YACR,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;SAC3E;KACF,CAAC,CAAC;IAEH,MAAM,0BAA0B,GAAmD;QACjF,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,IAAI,+BAA+B,CAAC,gBAAgB,CAAC,EAAE;QAC9D,UAAU,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 },\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
+ {"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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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;;;;;;;gFA+KxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
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,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,E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,UAAU,EACR,CAAC,cAAc,CAAC,QAAQ,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,eAAe,GAClC,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\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,MA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C,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"]}
@@ -1,3 +1,4 @@
1
+ import { GeneratedAnalyticsMetadataExpandableSectionCollapse, GeneratedAnalyticsMetadataExpandableSectionExpand } from '../../expandable-section/analytics-metadata/interfaces';
1
2
  export interface GeneratedAnalyticsMetadataSideNavigationClick {
2
3
  action: 'click';
3
4
  detail: {
@@ -7,6 +8,8 @@ export interface GeneratedAnalyticsMetadataSideNavigationClick {
7
8
  external: string;
8
9
  };
9
10
  }
11
+ export type GeneratedAnalyticsMetadataSideNavigationExpand = GeneratedAnalyticsMetadataExpandableSectionExpand;
12
+ export type GeneratedAnalyticsMetadataSideNavigationCollapse = GeneratedAnalyticsMetadataExpandableSectionCollapse;
10
13
  export interface GeneratedAnalyticsMetadataSideNavigationComponent {
11
14
  name: 'awsui.SideNavigation';
12
15
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/side-navigation/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,6CAA6C;IAC5D,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,iDAAiD;IAChE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/side-navigation/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mDAAmD,EACnD,iDAAiD,EAClD,MAAM,wDAAwD,CAAC;AAEhE,MAAM,WAAW,6CAA6C;IAC5D,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,MAAM,MAAM,8CAA8C,GAAG,iDAAiD,CAAC;AAC/G,MAAM,MAAM,gDAAgD,GAAG,mDAAmD,CAAC;AAEnH,MAAM,WAAW,iDAAiD;IAChE,IAAI,EAAE,sBAAsB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/side-navigation/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport interface GeneratedAnalyticsMetadataSideNavigationClick {\n action: 'click';\n detail: {\n label: string;\n position?: string;\n href?: string;\n external: string;\n };\n}\n\nexport interface GeneratedAnalyticsMetadataSideNavigationComponent {\n name: 'awsui.SideNavigation';\n label: string;\n properties: {\n activeHref: string;\n };\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/side-navigation/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n GeneratedAnalyticsMetadataExpandableSectionCollapse,\n GeneratedAnalyticsMetadataExpandableSectionExpand,\n} from '../../expandable-section/analytics-metadata/interfaces';\n\nexport interface GeneratedAnalyticsMetadataSideNavigationClick {\n action: 'click';\n detail: {\n label: string;\n position?: string;\n href?: string;\n external: string;\n };\n}\n\nexport type GeneratedAnalyticsMetadataSideNavigationExpand = GeneratedAnalyticsMetadataExpandableSectionExpand;\nexport type GeneratedAnalyticsMetadataSideNavigationCollapse = GeneratedAnalyticsMetadataExpandableSectionCollapse;\n\nexport interface GeneratedAnalyticsMetadataSideNavigationComponent {\n name: 'awsui.SideNavigation';\n label: string;\n properties: {\n activeHref: string;\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tag-editor/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAkBlG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKtC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC;AASvC,QAAA,MAAM,SAAS,2FAoSd,CAAC;AAGF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tag-editor/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAkBlG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKtC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC;AASvC,QAAA,MAAM,SAAS,2FAqSd,CAAC;AAGF,eAAe,SAAS,CAAC"}
@@ -170,7 +170,7 @@ const TagEditor = React.forwardRef((_a, ref) => {
170
170
  React.createElement(InternalLiveRegion, { tagName: "span" }, i18n('i18nStrings.loading', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loading)))));
171
171
  }
172
172
  const baseProps = getBaseProps(restProps);
173
- return (React.createElement(InternalAttributeEditor, Object.assign({}, baseProps, baseComponentProps, { ref: attributeEditorRef, className: clsx(styles.root, baseProps.className), items: internalTags, isItemRemovable: isItemRemovable, onAddButtonClick: onAddButtonClick, onRemoveButtonClick: onRemoveButtonClick, addButtonText: (_b = i18n('i18nStrings.addButton', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.addButton)) !== null && _b !== void 0 ? _b : '', removeButtonText: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeButton, disableAddButton: remainingTags <= 0, empty: i18n('i18nStrings.emptyTags', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.emptyTags), additionalInfo: remainingTags < 0 ? (React.createElement(FormFieldError, { errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel }, (_d = i18n('i18nStrings.tagLimitExceeded', (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimitExceeded) === null || _c === void 0 ? void 0 : _c.call(i18nStrings, tagLimit), format => format({ tagLimit }))) !== null && _d !== void 0 ? _d : '')) : remainingTags === 0 ? ((_f = i18n('i18nStrings.tagLimitReached', (_e = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimitReached) === null || _e === void 0 ? void 0 : _e.call(i18nStrings, tagLimit), format => format({ tagLimit }))) !== null && _f !== void 0 ? _f : '') : (i18n('i18nStrings.tagLimit', (_g = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimit) === null || _g === void 0 ? void 0 : _g.call(i18nStrings, remainingTags, tagLimit), format => format({ tagLimitAvailable: `${remainingTags === tagLimit}`, availableTags: remainingTags, tagLimit }))), definition: definition, i18nStrings: forwardedI18nStrings })));
173
+ return (React.createElement(InternalAttributeEditor, Object.assign({}, baseProps, baseComponentProps, { ref: attributeEditorRef, className: clsx(styles.root, baseProps.className), items: internalTags, isItemRemovable: isItemRemovable, onAddButtonClick: onAddButtonClick, onRemoveButtonClick: onRemoveButtonClick, addButtonText: (_b = i18n('i18nStrings.addButton', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.addButton)) !== null && _b !== void 0 ? _b : '', removeButtonText: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeButton, disableAddButton: remainingTags <= 0, empty: i18n('i18nStrings.emptyTags', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.emptyTags), addButtonVariant: "normal", additionalInfo: remainingTags < 0 ? (React.createElement(FormFieldError, { errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel }, (_d = i18n('i18nStrings.tagLimitExceeded', (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimitExceeded) === null || _c === void 0 ? void 0 : _c.call(i18nStrings, tagLimit), format => format({ tagLimit }))) !== null && _d !== void 0 ? _d : '')) : remainingTags === 0 ? ((_f = i18n('i18nStrings.tagLimitReached', (_e = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimitReached) === null || _e === void 0 ? void 0 : _e.call(i18nStrings, tagLimit), format => format({ tagLimit }))) !== null && _f !== void 0 ? _f : '') : (i18n('i18nStrings.tagLimit', (_g = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimit) === null || _g === void 0 ? void 0 : _g.call(i18nStrings, remainingTags, tagLimit), format => format({ tagLimitAvailable: `${remainingTags === tagLimit}`, availableTags: remainingTags, tagLimit }))), definition: definition, i18nStrings: forwardedI18nStrings })));
174
174
  });
175
175
  applyDisplayName(TagEditor, 'TagEditor');
176
176
  export default TagEditor;