@cloudscape-design/components-themeable 3.0.1125 → 3.0.1126

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 (30) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/internal/components/selectable-item/styles.scss +54 -0
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/template/code-editor/index.d.ts.map +1 -1
  5. package/lib/internal/template/code-editor/index.js +9 -1
  6. package/lib/internal/template/code-editor/index.js.map +1 -1
  7. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  8. package/lib/internal/template/internal/components/selectable-item/styles.css.js +22 -22
  9. package/lib/internal/template/internal/components/selectable-item/styles.scoped.css +74 -42
  10. package/lib/internal/template/internal/components/selectable-item/styles.selectors.js +22 -22
  11. package/lib/internal/template/internal/environment.js +2 -2
  12. package/lib/internal/template/internal/environment.json +2 -2
  13. package/lib/internal/template/internal/hooks/use-base-component/styles-check.d.ts.map +1 -1
  14. package/lib/internal/template/internal/hooks/use-base-component/styles-check.js +4 -0
  15. package/lib/internal/template/internal/hooks/use-base-component/styles-check.js.map +1 -1
  16. package/lib/internal/template/internal/plugins/controllers/action-buttons.d.ts +1 -0
  17. package/lib/internal/template/internal/plugins/controllers/action-buttons.d.ts.map +1 -1
  18. package/lib/internal/template/internal/plugins/controllers/action-buttons.js.map +1 -1
  19. package/lib/internal/template/internal/plugins/helpers/use-discovered-action.d.ts.map +1 -1
  20. package/lib/internal/template/internal/plugins/helpers/use-discovered-action.js +16 -11
  21. package/lib/internal/template/internal/plugins/helpers/use-discovered-action.js.map +1 -1
  22. package/lib/internal/template/select/parts/virtual-list.d.ts.map +1 -1
  23. package/lib/internal/template/select/parts/virtual-list.js +4 -1
  24. package/lib/internal/template/select/parts/virtual-list.js.map +1 -1
  25. package/lib/internal/template/select/utils/render-options.d.ts.map +1 -1
  26. package/lib/internal/template/select/utils/render-options.js +4 -1
  27. package/lib/internal/template/select/utils/render-options.js.map +1 -1
  28. package/lib/internal/template/table/internal.js +1 -1
  29. package/lib/internal/template/table/internal.js.map +1 -1
  30. package/package.json +1 -1
@@ -2,27 +2,27 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "selectable-item": "awsui_selectable-item_15o6u_k1eqb_145",
6
- "pad-bottom": "awsui_pad-bottom_15o6u_k1eqb_167",
7
- "virtual": "awsui_virtual_15o6u_k1eqb_171",
8
- "has-background": "awsui_has-background_15o6u_k1eqb_174",
9
- "highlighted": "awsui_highlighted_15o6u_k1eqb_177",
10
- "selected": "awsui_selected_15o6u_k1eqb_177",
11
- "disabled": "awsui_disabled_15o6u_k1eqb_195",
12
- "is-keyboard": "awsui_is-keyboard_15o6u_k1eqb_200",
13
- "visual-refresh": "awsui_visual-refresh_15o6u_k1eqb_203",
14
- "next-item-selected": "awsui_next-item-selected_15o6u_k1eqb_211",
15
- "previous-item-selected": "awsui_previous-item-selected_15o6u_k1eqb_232",
16
- "parent": "awsui_parent_15o6u_k1eqb_236",
17
- "interactiveGroups": "awsui_interactiveGroups_15o6u_k1eqb_240",
18
- "child": "awsui_child_15o6u_k1eqb_256",
19
- "sticky": "awsui_sticky_15o6u_k1eqb_262",
20
- "with-scrollbar": "awsui_with-scrollbar_15o6u_k1eqb_274",
21
- "after-header": "awsui_after-header_15o6u_k1eqb_280",
22
- "measure-strut": "awsui_measure-strut_15o6u_k1eqb_315",
23
- "measure-strut-first": "awsui_measure-strut-first_15o6u_k1eqb_324",
24
- "screenreader-content": "awsui_screenreader-content_15o6u_k1eqb_328",
25
- "option-content": "awsui_option-content_15o6u_k1eqb_334",
26
- "select-all": "awsui_select-all_15o6u_k1eqb_338"
5
+ "selectable-item": "awsui_selectable-item_15o6u_1uxuj_145",
6
+ "pad-bottom": "awsui_pad-bottom_15o6u_1uxuj_167",
7
+ "virtual": "awsui_virtual_15o6u_1uxuj_171",
8
+ "has-background": "awsui_has-background_15o6u_1uxuj_174",
9
+ "highlighted": "awsui_highlighted_15o6u_1uxuj_177",
10
+ "selected": "awsui_selected_15o6u_1uxuj_177",
11
+ "disabled": "awsui_disabled_15o6u_1uxuj_195",
12
+ "is-keyboard": "awsui_is-keyboard_15o6u_1uxuj_200",
13
+ "visual-refresh": "awsui_visual-refresh_15o6u_1uxuj_203",
14
+ "next-item-selected": "awsui_next-item-selected_15o6u_1uxuj_211",
15
+ "previous-item-selected": "awsui_previous-item-selected_15o6u_1uxuj_232",
16
+ "parent": "awsui_parent_15o6u_1uxuj_236",
17
+ "interactiveGroups": "awsui_interactiveGroups_15o6u_1uxuj_240",
18
+ "child": "awsui_child_15o6u_1uxuj_256",
19
+ "sticky": "awsui_sticky_15o6u_1uxuj_262",
20
+ "with-scrollbar": "awsui_with-scrollbar_15o6u_1uxuj_274",
21
+ "after-header": "awsui_after-header_15o6u_1uxuj_280",
22
+ "measure-strut": "awsui_measure-strut_15o6u_1uxuj_347",
23
+ "measure-strut-first": "awsui_measure-strut-first_15o6u_1uxuj_356",
24
+ "screenreader-content": "awsui_screenreader-content_15o6u_1uxuj_360",
25
+ "option-content": "awsui_option-content_15o6u_1uxuj_366",
26
+ "select-all": "awsui_select-all_15o6u_1uxuj_370"
27
27
  };
28
28
 
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (4806683f)";
3
- export var GIT_SHA = "4806683f";
2
+ export var PACKAGE_VERSION = "3.0.0 (bba65ebf)";
3
+ export var GIT_SHA = "bba65ebf";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "console";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (4806683f)",
4
- "GIT_SHA": "4806683f",
3
+ "PACKAGE_VERSION": "3.0.0 (bba65ebf)",
4
+ "GIT_SHA": "bba65ebf",
5
5
  "THEME": "default",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": false
@@ -1 +1 @@
1
- {"version":3,"file":"styles-check.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/styles-check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAKzC,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,QAAQ,QAMzD;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,IAAI,4BAsB3C;AAYD,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,QAI7E"}
1
+ {"version":3,"file":"styles-check.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/styles-check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAKzC,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,QAAQ,QAUzD;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,IAAI,4BAsB3C;AAYD,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,QAI7E"}
@@ -4,6 +4,10 @@ import { useEffect } from 'react';
4
4
  import { GIT_SHA, PACKAGE_VERSION, THEME } from '../../environment';
5
5
  import { metrics } from '../../metrics';
6
6
  export function checkMissingStyles(ownerDocument) {
7
+ if (!ownerDocument.defaultView) {
8
+ // skip the check if this iframe is detached
9
+ return;
10
+ }
7
11
  const result = getComputedStyle(ownerDocument.body).getPropertyValue(`--awsui-version-info-${GIT_SHA}`);
8
12
  if (!result) {
9
13
  console.error(`Missing AWS-UI CSS for theme "${THEME}", version "${PACKAGE_VERSION}", and git sha "${GIT_SHA}".`);
@@ -1 +1 @@
1
- {"version":3,"file":"styles-check.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/styles-check.ts"],"names":[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WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE;QACZ,kBAAkB,CAAC,aAAa,CAAC,CAAC;QAClC,WAAW,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;KACtC;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,UAAwC;IAC5E,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,CAAC;IACjE,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\n\nimport { GIT_SHA, PACKAGE_VERSION, THEME } from '../../environment';\nimport { metrics } from '../../metrics';\n\nexport function checkMissingStyles(ownerDocument: Document) {\n const result = getComputedStyle(ownerDocument.body).getPropertyValue(`--awsui-version-info-${GIT_SHA}`);\n if (!result) {\n console.error(`Missing AWS-UI CSS for theme \"${THEME}\", version \"${PACKAGE_VERSION}\", and git sha \"${GIT_SHA}\".`);\n metrics.sendOpsMetricObject('awsui-missing-css-asset', {});\n }\n}\n\nexport function idleWithDelay(cb: () => void) {\n // if idle callbacks not supported, we simply do not collect the metric\n if (typeof requestIdleCallback !== 'function') {\n return;\n }\n let aborted = false;\n\n setTimeout(() => {\n if (aborted) {\n return;\n }\n requestIdleCallback(() => {\n if (aborted) {\n return;\n }\n cb();\n });\n }, 1000);\n\n return () => {\n aborted = true;\n };\n}\n\nconst checkedDocs = new WeakMap<Document, boolean>();\nconst checkMissingStylesOnce = (elementRef: React.RefObject<HTMLElement>) => {\n const ownerDocument = elementRef.current?.ownerDocument ?? document;\n const checked = checkedDocs.get(ownerDocument);\n if (!checked) {\n checkMissingStyles(ownerDocument);\n checkedDocs.set(ownerDocument, true);\n }\n};\n\nexport function useMissingStylesCheck(elementRef: React.RefObject<HTMLElement>) {\n useEffect(() => {\n return idleWithDelay(() => checkMissingStylesOnce(elementRef));\n }, [elementRef]);\n}\n"]}
1
+ {"version":3,"file":"styles-check.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-base-component/styles-check.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,kBAAkB,CAAC,aAAuB;IACxD,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE;QAC9B,4CAA4C;QAC5C,OAAO;KACR;IACD,MAAM,MAAM,GAAG,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACxG,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,CAAC,KAAK,CAAC,iCAAiC,KAAK,eAAe,eAAe,mBAAmB,OAAO,IAAI,CAAC,CAAC;QAClH,OAAO,CAAC,mBAAmB,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;KAC5D;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAc;IAC1C,uEAAuE;IACvE,IAAI,OAAO,mBAAmB,KAAK,UAAU,EAAE;QAC7C,OAAO;KACR;IACD,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,OAAO,EAAE;YACX,OAAO;SACR;QACD,mBAAmB,CAAC,GAAG,EAAE;YACvB,IAAI,OAAO,EAAE;gBACX,OAAO;aACR;YACD,EAAE,EAAE,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,IAAI,OAAO,EAAqB,CAAC;AACrD,MAAM,sBAAsB,GAAG,CAAC,UAAwC,EAAE,EAAE;;IAC1E,MAAM,aAAa,GAAG,MAAA,MAAA,UAAU,CAAC,OAAO,0CAAE,aAAa,mCAAI,QAAQ,CAAC;IACpE,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE;QACZ,kBAAkB,CAAC,aAAa,CAAC,CAAC;QAClC,WAAW,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;KACtC;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,UAAwC;IAC5E,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,CAAC;IACjE,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\n\nimport { GIT_SHA, PACKAGE_VERSION, THEME } from '../../environment';\nimport { metrics } from '../../metrics';\n\nexport function checkMissingStyles(ownerDocument: Document) {\n if (!ownerDocument.defaultView) {\n // skip the check if this iframe is detached\n return;\n }\n const result = getComputedStyle(ownerDocument.body).getPropertyValue(`--awsui-version-info-${GIT_SHA}`);\n if (!result) {\n console.error(`Missing AWS-UI CSS for theme \"${THEME}\", version \"${PACKAGE_VERSION}\", and git sha \"${GIT_SHA}\".`);\n metrics.sendOpsMetricObject('awsui-missing-css-asset', {});\n }\n}\n\nexport function idleWithDelay(cb: () => void) {\n // if idle callbacks not supported, we simply do not collect the metric\n if (typeof requestIdleCallback !== 'function') {\n return;\n }\n let aborted = false;\n\n setTimeout(() => {\n if (aborted) {\n return;\n }\n requestIdleCallback(() => {\n if (aborted) {\n return;\n }\n cb();\n });\n }, 1000);\n\n return () => {\n aborted = true;\n };\n}\n\nconst checkedDocs = new WeakMap<Document, boolean>();\nconst checkMissingStylesOnce = (elementRef: React.RefObject<HTMLElement>) => {\n const ownerDocument = elementRef.current?.ownerDocument ?? document;\n const checked = checkedDocs.get(ownerDocument);\n if (!checked) {\n checkMissingStyles(ownerDocument);\n checkedDocs.set(ownerDocument, true);\n }\n};\n\nexport function useMissingStylesCheck(elementRef: React.RefObject<HTMLElement>) {\n useEffect(() => {\n return idleWithDelay(() => checkMissingStylesOnce(elementRef));\n }, [elementRef]);\n}\n"]}
@@ -10,6 +10,7 @@ export interface ActionConfig {
10
10
  id: string;
11
11
  orderPriority?: number;
12
12
  mountContent: (container: HTMLElement, context: ActionContext) => void;
13
+ updateContent?: (container: HTMLElement, context: ActionContext) => void;
13
14
  unmountContent: (container: HTMLElement) => void;
14
15
  }
15
16
  type ActionRegistrationListener = (action: Array<ActionConfig>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"action-buttons.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/action-buttons.ts"],"names":[],"mappings":"AAMA,UAAU,OAAO,CAAC,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,cAAc,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD;AAED,KAAK,0BAA0B,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AAExE,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,kBAAkB;IACjC,sBAAsB,IAAI,IAAI,CAAC;IAC/B,kBAAkB,CAAC,QAAQ,EAAE,0BAA0B,GAAG,MAAM,IAAI,CAAC;CACtE;AAED,qBAAa,uBAAuB;IAClC,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,cAAc,CAEhB;IAEN,cAAc,WAAY,YAAY,UAIpC;IAEF,sBAAsB,aAEpB;IAEF,kBAAkB,aAAc,0BAA0B,gBAMxD;IAEF,aAAa,CAAC,GAAG,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB;IAKpE,eAAe,CAAC,WAAW,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAAG,kBAAkB;CAKnF"}
1
+ {"version":3,"file":"action-buttons.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/action-buttons.ts"],"names":[],"mappings":"AAMA,UAAU,OAAO,CAAC,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,KAAK,IA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,EAAE,CAAC,CAAC,CAAC;QAEN,mBAAc,GAAG,CAAC,MAAoB,EAAE,EAAE;YACxC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC1B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,CAAC,CAAC;QAEF,2BAAsB,GAAG,GAAG,EAAE;YAC5B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QACpB,CAAC,CAAC;QAEF,uBAAkB,GAAG,CAAC,QAAoC,EAAE,EAAE;YAC5D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC9B,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;YACpE,CAAC,CAAC;QACJ,CAAC,CAAC;IAYJ,CAAC;IAVC,aAAa,CAAC,MAAiC,EAAE;;QAC/C,MAAA,GAAG,CAAC,cAAc,oCAAlB,GAAG,CAAC,cAAc,GAAK,IAAI,CAAC,cAAc,EAAC;QAC3C,OAAO,GAAuB,CAAC;IACjC,CAAC;IAED,eAAe,CAAC,cAA2C,EAAE;;QAC3D,MAAA,WAAW,CAAC,sBAAsB,oCAAlC,WAAW,CAAC,sBAAsB,GAAK,IAAI,CAAC,sBAAsB,EAAC;QACnE,MAAA,WAAW,CAAC,kBAAkB,oCAA9B,WAAW,CAAC,kBAAkB,GAAK,IAAI,CAAC,kBAAkB,EAAC;QAC3D,OAAO,WAAiC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\nimport { sortByPriority } from '../helpers/utils';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim<T> {\n current: T | null;\n}\n\nexport interface ActionContext {\n type: string;\n headerRef: RefShim<HTMLElement>;\n contentRef: RefShim<HTMLElement>;\n}\n\nexport interface ActionConfig {\n id: string;\n orderPriority?: number;\n mountContent: (container: HTMLElement, context: ActionContext) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\ntype ActionRegistrationListener = (action: Array<ActionConfig>) => void;\n\nexport interface ActionsApiPublic {\n registerAction(config: ActionConfig): void;\n}\n\nexport interface ActionsApiInternal {\n clearRegisteredActions(): void;\n onActionRegistered(listener: ActionRegistrationListener): () => void;\n}\n\nexport class ActionButtonsController {\n private listeners: Array<ActionRegistrationListener> = [];\n private actions: Array<ActionConfig> = [];\n\n private scheduleUpdate = debounce(() => {\n this.listeners.forEach(listener => listener(this.actions));\n }, 0);\n\n registerAction = (action: ActionConfig) => {\n this.actions.push(action);\n this.actions = sortByPriority(this.actions);\n this.scheduleUpdate();\n };\n\n clearRegisteredActions = () => {\n this.actions = [];\n };\n\n onActionRegistered = (listener: ActionRegistrationListener) => {\n this.listeners.push(listener);\n this.scheduleUpdate();\n return () => {\n this.listeners = this.listeners.filter(item => item !== listener);\n };\n };\n\n installPublic(api: Partial<ActionsApiPublic> = {}): ActionsApiPublic {\n api.registerAction ??= this.registerAction;\n return api as ActionsApiPublic;\n }\n\n installInternal(internalApi: Partial<ActionsApiInternal> = {}): ActionsApiInternal {\n internalApi.clearRegisteredActions ??= this.clearRegisteredActions;\n internalApi.onActionRegistered ??= this.onActionRegistered;\n return internalApi as ActionsApiInternal;\n }\n}\n"]}
1
+ {"version":3,"file":"action-buttons.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/action-buttons.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgClD,MAAM,O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QACnE,MAAA,WAAW,CAAC,kBAAkB,oCAA9B,WAAW,CAAC,kBAAkB,GAAK,IAAI,CAAC,kBAAkB,EAAC;QAC3D,OAAO,WAAiC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\nimport { sortByPriority } from '../helpers/utils';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim<T> {\n current: T | null;\n}\n\nexport interface ActionContext {\n type: string;\n headerRef: RefShim<HTMLElement>;\n contentRef: RefShim<HTMLElement>;\n}\n\nexport interface ActionConfig {\n id: string;\n orderPriority?: number;\n mountContent: (container: HTMLElement, context: ActionContext) => void;\n updateContent?: (container: HTMLElement, context: ActionContext) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\ntype ActionRegistrationListener = (action: Array<ActionConfig>) => void;\n\nexport interface ActionsApiPublic {\n registerAction(config: ActionConfig): void;\n}\n\nexport interface ActionsApiInternal {\n clearRegisteredActions(): void;\n onActionRegistered(listener: ActionRegistrationListener): () => void;\n}\n\nexport class ActionButtonsController {\n private listeners: Array<ActionRegistrationListener> = [];\n private actions: Array<ActionConfig> = [];\n\n private scheduleUpdate = debounce(() => {\n this.listeners.forEach(listener => listener(this.actions));\n }, 0);\n\n registerAction = (action: ActionConfig) => {\n this.actions.push(action);\n this.actions = sortByPriority(this.actions);\n this.scheduleUpdate();\n };\n\n clearRegisteredActions = () => {\n this.actions = [];\n };\n\n onActionRegistered = (listener: ActionRegistrationListener) => {\n this.listeners.push(listener);\n this.scheduleUpdate();\n return () => {\n this.listeners = this.listeners.filter(item => item !== listener);\n };\n };\n\n installPublic(api: Partial<ActionsApiPublic> = {}): ActionsApiPublic {\n api.registerAction ??= this.registerAction;\n return api as ActionsApiPublic;\n }\n\n installInternal(internalApi: Partial<ActionsApiInternal> = {}): ActionsApiInternal {\n internalApi.clearRegisteredActions ??= this.clearRegisteredActions;\n internalApi.onActionRegistered ??= this.onActionRegistered;\n return internalApi as ActionsApiInternal;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-discovered-action.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-action.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAA+B,MAAM,+BAA+B,CAAC;AAqCrG,wBAAgB,yBAAyB,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,UAC/D,MAAM;uBAC3B,MAAM,SAAS,EAAE;eACzB,MAAM,GAAG,CAAC,cAAc,CAAC;gBACxB,MAAM,GAAG,CAAC,cAAc,CAAC;EAcxC"}
1
+ {"version":3,"file":"use-discovered-action.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-action.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAA+B,MAAM,+BAA+B,CAAC;AAiCrG,wBAAgB,yBAAyB,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,UAC/D,MAAM;uBAC3B,MAAM,SAAS,EAAE;eACzB,MAAM,GAAG,CAAC,cAAc,CAAC;gBACxB,MAAM,GAAG,CAAC,cAAc,CAAC;EA0BxC"}
@@ -1,34 +1,39 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { useEffect, useRef, useState } from 'react';
4
- function RuntimeActionWrapper({ mountContent, unmountContent, context }) {
4
+ function RuntimeActionWrapper({ mountContent, updateContent, unmountContent, context }) {
5
5
  const ref = useRef(null);
6
+ const mountedRef = useRef(false);
7
+ useEffect(() => {
8
+ if (mountedRef.current && ref.current) {
9
+ updateContent === null || updateContent === void 0 ? void 0 : updateContent(ref.current, context);
10
+ }
11
+ });
6
12
  useEffect(() => {
7
13
  const container = ref.current;
8
14
  mountContent(container, context);
15
+ mountedRef.current = true;
9
16
  return () => {
17
+ mountedRef.current = false;
10
18
  unmountContent(container);
11
19
  };
12
20
  // eslint-disable-next-line react-hooks/exhaustive-deps
13
21
  }, []);
14
22
  return React.createElement("div", { ref: ref });
15
23
  }
16
- function convertRuntimeAction(action, context) {
17
- if (!action) {
18
- return null;
19
- }
20
- return (React.createElement(RuntimeActionWrapper, { key: action.id + '-' + context.type, context: context, mountContent: action.mountContent, unmountContent: action.unmountContent }));
21
- }
22
24
  export function createUseDiscoveredAction(onActionRegistered) {
23
25
  return function useDiscoveredAction(type) {
24
- const [discoveredActions, setDiscoveredActions] = useState([]);
26
+ const [actionConfigs, setActionConfigs] = useState([]);
25
27
  const headerRef = useRef(null);
26
28
  const contentRef = useRef(null);
27
29
  useEffect(() => {
28
- return onActionRegistered(actions => {
29
- setDiscoveredActions(actions.map(action => convertRuntimeAction(action, { type, headerRef, contentRef })));
30
- });
30
+ return onActionRegistered(actions => setActionConfigs(actions));
31
31
  }, [type]);
32
+ const discoveredActions = actionConfigs.map(action => (React.createElement(RuntimeActionWrapper, { key: action.id + '-' + type, context: {
33
+ type,
34
+ headerRef,
35
+ contentRef,
36
+ }, mountContent: action.mountContent, updateContent: action.updateContent, unmountContent: action.unmountContent })));
32
37
  return { discoveredActions, headerRef, contentRef };
33
38
  };
34
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-discovered-action.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-action.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAU3D,SAAS,oBAAoB,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,EAA6B;IAChG,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzC,SAAS,CAAC,GA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AE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { ActionButtonsController, ActionConfig, ActionContext } from '../controllers/action-buttons';\n\ninterface RuntimeActionWrapperProps {\n context: ActionContext;\n mountContent: ActionConfig['mountContent'];\n unmountContent: ActionConfig['unmountContent'];\n}\n\nfunction RuntimeActionWrapper({ mountContent, unmountContent, context }: RuntimeActionWrapperProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container, context);\n return () => {\n unmountContent(container);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return <div ref={ref}></div>;\n}\n\nfunction convertRuntimeAction(action: ActionConfig | null, context: ActionContext) {\n if (!action) {\n return null;\n }\n return (\n <RuntimeActionWrapper\n key={action.id + '-' + context.type}\n context={context}\n mountContent={action.mountContent}\n unmountContent={action.unmountContent}\n />\n );\n}\n\nexport function createUseDiscoveredAction(onActionRegistered: ActionButtonsController['onActionRegistered']) {\n return function useDiscoveredAction(type: string): {\n discoveredActions: React.ReactNode[];\n headerRef: React.Ref<HTMLDivElement>;\n contentRef: React.Ref<HTMLDivElement>;\n } {\n const [discoveredActions, setDiscoveredActions] = useState<Array<React.ReactNode>>([]);\n const headerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n return onActionRegistered(actions => {\n setDiscoveredActions(actions.map(action => convertRuntimeAction(action, { type, headerRef, contentRef })));\n });\n }, [type]);\n\n return { discoveredActions, headerRef, contentRef };\n };\n}\n"]}
1
+ {"version":3,"file":"use-discovered-action.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-action.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC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E,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;QAClE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAEX,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACpD,oBAAC,oBAAoB,IACnB,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,IAAI,EAC3B,OAAO,EAAE;gBACP,IAAI;gBACJ,SAAS;gBACT,UAAU;aACX,EACD,YAAY,EAAE,MAAM,CAAC,YAAY,EACjC,aAAa,EAAE,MAAM,CAAC,aAAa,EACnC,cAAc,EAAE,MAAM,CAAC,cAAc,GACrC,CACH,CAAC,CAAC;QAEH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { ActionButtonsController, ActionConfig, ActionContext } from '../controllers/action-buttons';\n\ninterface RuntimeActionWrapperProps {\n context: ActionContext;\n mountContent: ActionConfig['mountContent'];\n updateContent: ActionConfig['updateContent'];\n unmountContent: ActionConfig['unmountContent'];\n}\n\nfunction RuntimeActionWrapper({ mountContent, updateContent, unmountContent, context }: RuntimeActionWrapperProps) {\n const ref = useRef<HTMLDivElement>(null);\n const mountedRef = useRef(false);\n\n useEffect(() => {\n if (mountedRef.current && ref.current) {\n updateContent?.(ref.current, context);\n }\n });\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container, context);\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n unmountContent(container);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return <div ref={ref}></div>;\n}\n\nexport function createUseDiscoveredAction(onActionRegistered: ActionButtonsController['onActionRegistered']) {\n return function useDiscoveredAction(type: string): {\n discoveredActions: React.ReactNode[];\n headerRef: React.Ref<HTMLDivElement>;\n contentRef: React.Ref<HTMLDivElement>;\n } {\n const [actionConfigs, setActionConfigs] = useState<Array<ActionConfig>>([]);\n const headerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n return onActionRegistered(actions => setActionConfigs(actions));\n }, [type]);\n\n const discoveredActions = actionConfigs.map(action => (\n <RuntimeActionWrapper\n key={action.id + '-' + type}\n context={{\n type,\n headerRef,\n contentRef,\n }}\n mountContent={action.mountContent}\n updateContent={action.updateContent}\n unmountContent={action.unmountContent}\n />\n ));\n\n return { discoveredActions, headerRef, contentRef };\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/virtual-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAUpF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;;AA4H/C,wBAAuC"}
1
+ {"version":3,"file":"virtual-list.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/virtual-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAUpF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;;AAgI/C,wBAAuC"}
@@ -67,9 +67,12 @@ const VirtualListOpen = forwardRef(({ menuProps, getOptionProps, filteredOptions
67
67
  firstOptionSticky,
68
68
  withScrollbar,
69
69
  });
70
+ // Adjust totalSize to account for 1px overlap per item (matching the position adjustment in renderOptions)
71
+ const overlapAdjustment = filteredOptions.length;
72
+ const adjustedTotalSize = totalSize - overlapAdjustment;
70
73
  return (React.createElement(OptionsList, Object.assign({}, menuProps, { stickyItemBlockSize: stickySize, ref: menuRef }),
71
74
  finalOptions,
72
- React.createElement("div", { "aria-hidden": "true", key: "total-size", className: styles['layout-strut'], style: { height: totalSize - stickySize } }),
75
+ React.createElement("div", { "aria-hidden": "true", key: "total-size", className: styles['layout-strut'], style: { height: adjustedTotalSize - stickySize } }),
73
76
  listBottom ? (React.createElement("div", { role: "option", className: styles['list-bottom'] }, listBottom)) : null));
74
77
  });
75
78
  const VirtualListClosed = forwardRef(({ menuProps, listBottom }, ref) => {
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-list.js","sourceRoot":"","sources":["../../../../src/select/parts/virtual-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE1F,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,WAAW,GAAG,CAAC,KAAsB,EAAE,GAA6C,EAAE,EAAE;IAC5F,OAAO,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,eAAe,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,oBAAC,iBAAiB,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtH,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,UAAU,CAChC,CACE,EACE,SAAS,EACT,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,GACD,EA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,CAAC,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,iBAAiB,GAAG,UAAU,CAClC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAmB,EAAE,GAA6C,EAAE,EAAE;IAC5F,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7C,OAAO,CACL,oBAAC,WAAW,oBAAK,SAAS,IAAE,GAAG,EAAE,SAAS,CAAC,GAAG,KAC3C,UAAU,CAAC,CAAC,CAAC,CACZ,6BAAK,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAChD,UAAU,CACP,CACP,CAAC,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC,WAAW,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport OptionsList from '../../internal/components/options-list';\nimport { useVirtual } from '../../internal/hooks/use-virtual';\nimport { renderOptions } from '../utils/render-options';\nimport customScrollToIndex from '../utils/scroll-to-index';\nimport { fallbackItemHeight } from './common';\nimport { SelectListProps } from './plain-list';\n\nimport styles from './styles.css.js';\n\nconst VirtualList = (props: SelectListProps, ref: React.Ref<SelectListProps.SelectListRef>) => {\n return props.menuProps.open ? <VirtualListOpen {...props} ref={ref} /> : <VirtualListClosed {...props} ref={ref} />;\n};\n\nconst VirtualListOpen = forwardRef(\n (\n {\n menuProps,\n getOptionProps,\n filteredOptions,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n listBottom,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n }: SelectListProps,\n ref: React.Ref<SelectListProps.SelectListRef>\n ) => {\n // update component, when it gets wider or narrower to reposition items\n const [width, menuMeasureRef] = useContainerQuery(\n rect => ({ inner: rect.contentBoxWidth, outer: rect.borderBoxWidth }),\n []\n );\n const menuRefObject = useRef(null);\n const menuRef = useMergeRefs(menuMeasureRef, menuRefObject, menuProps.ref);\n const previousHighlightedIndex = useRef<number>();\n const { virtualItems, totalSize, scrollToIndex } = useVirtual({\n items: filteredOptions,\n parentRef: menuRefObject,\n // estimateSize is a dependency of measurements memo. We update it to force full recalculation\n // when the height of any option could have changed:\n // 1: because the component got resized (width property got updated)\n // 2: because the option changed its content (filteringValue property controls the highlight and the visibility of hidden tags)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n estimateSize: useCallback(() => fallbackItemHeight, [width?.inner, filteringValue]),\n firstItemSticky: firstOptionSticky,\n });\n\n useImperativeHandle(\n ref,\n () => (index: number) => {\n if (highlightType.moveFocus) {\n const movingUp = previousHighlightedIndex.current !== undefined && index < previousHighlightedIndex.current;\n if (firstOptionSticky && movingUp && index !== 0 && menuRefObject.current) {\n // React-Virtual v2 does not offer a proper way to handle sticky elements when scrolling,\n // so until we upgrade to v3, use our own scroll implementation\n // to prevent newly highlighted element from being covered by the sticky element\n // when moving the highlight upwards in the list.\n\n // Scrolling behavior is covered by integration tests.\n // istanbul ignore next\n customScrollToIndex({\n index,\n menuEl: menuRefObject?.current,\n });\n } else {\n scrollToIndex(index);\n }\n }\n previousHighlightedIndex.current = index;\n },\n [firstOptionSticky, highlightType.moveFocus, scrollToIndex]\n );\n\n const stickySize = firstOptionSticky ? virtualItems[0].size : 0;\n const withScrollbar = !!width && width.inner < width.outer;\n\n const idPrefix = useUniqueId('select-list-');\n const finalOptions = renderOptions({\n options: virtualItems.map(({ index }) => filteredOptions[index]),\n getOptionProps,\n filteringValue,\n highlightType,\n idPrefix,\n checkboxes,\n hasDropdownStatus,\n virtualItems,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n withScrollbar,\n });\n\n return (\n <OptionsList {...menuProps} stickyItemBlockSize={stickySize} ref={menuRef}>\n {finalOptions}\n <div\n aria-hidden=\"true\"\n key=\"total-size\"\n className={styles['layout-strut']}\n style={{ height: totalSize - stickySize }}\n />\n {listBottom ? (\n <div role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </div>\n ) : null}\n </OptionsList>\n );\n }\n);\n\nconst VirtualListClosed = forwardRef(\n ({ menuProps, listBottom }: SelectListProps, ref: React.Ref<SelectListProps.SelectListRef>) => {\n useImperativeHandle(ref, () => () => {}, []);\n return (\n <OptionsList {...menuProps} ref={menuProps.ref}>\n {listBottom ? (\n <div role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </div>\n ) : null}\n </OptionsList>\n );\n }\n);\n\nexport default forwardRef(VirtualList);\n"]}
1
+ {"version":3,"file":"virtual-list.js","sourceRoot":"","sources":["../../../../src/select/parts/virtual-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE1F,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,WAAW,GAAG,CAAC,KAAsB,EAAE,GAA6C,EAAE,EAAE;IAC5F,OAAO,KAAK,CAAC,SA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GAA2G;IAC3G,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,CAAC;IACjD,MAAM,iBAAiB,GAAG,SAAS,GAAG,iBAAiB,CAAC;IAExD,OAAO,CACL,oBAAC,WAAW,oBAAK,SAAS,IAAE,mBAAmB,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO;QACtE,YAAY;QACb,4CACc,MAAM,EAClB,GAAG,EAAC,YAAY,EAChB,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,EACjC,KAAK,EAAE,EAAE,MAAM,EAAE,iBAAiB,GAAG,UAAU,EAAE,GACjD;QACD,UAAU,CAAC,CAAC,CAAC,CACZ,6BAAK,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAChD,UAAU,CACP,CACP,CAAC,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,iBAAiB,GAAG,UAAU,CAClC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAmB,EAAE,GAA6C,EAAE,EAAE;IAC5F,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7C,OAAO,CACL,oBAAC,WAAW,oBAAK,SAAS,IAAE,GAAG,EAAE,SAAS,CAAC,GAAG,KAC3C,UAAU,CAAC,CAAC,CAAC,CACZ,6BAAK,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,IAChD,UAAU,CACP,CACP,CAAC,CAAC,CAAC,IAAI,CACI,CACf,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC,WAAW,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport OptionsList from '../../internal/components/options-list';\nimport { useVirtual } from '../../internal/hooks/use-virtual';\nimport { renderOptions } from '../utils/render-options';\nimport customScrollToIndex from '../utils/scroll-to-index';\nimport { fallbackItemHeight } from './common';\nimport { SelectListProps } from './plain-list';\n\nimport styles from './styles.css.js';\n\nconst VirtualList = (props: SelectListProps, ref: React.Ref<SelectListProps.SelectListRef>) => {\n return props.menuProps.open ? <VirtualListOpen {...props} ref={ref} /> : <VirtualListClosed {...props} ref={ref} />;\n};\n\nconst VirtualListOpen = forwardRef(\n (\n {\n menuProps,\n getOptionProps,\n filteredOptions,\n filteringValue,\n highlightType,\n checkboxes,\n hasDropdownStatus,\n listBottom,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n }: SelectListProps,\n ref: React.Ref<SelectListProps.SelectListRef>\n ) => {\n // update component, when it gets wider or narrower to reposition items\n const [width, menuMeasureRef] = useContainerQuery(\n rect => ({ inner: rect.contentBoxWidth, outer: rect.borderBoxWidth }),\n []\n );\n const menuRefObject = useRef(null);\n const menuRef = useMergeRefs(menuMeasureRef, menuRefObject, menuProps.ref);\n const previousHighlightedIndex = useRef<number>();\n const { virtualItems, totalSize, scrollToIndex } = useVirtual({\n items: filteredOptions,\n parentRef: menuRefObject,\n // estimateSize is a dependency of measurements memo. We update it to force full recalculation\n // when the height of any option could have changed:\n // 1: because the component got resized (width property got updated)\n // 2: because the option changed its content (filteringValue property controls the highlight and the visibility of hidden tags)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n estimateSize: useCallback(() => fallbackItemHeight, [width?.inner, filteringValue]),\n firstItemSticky: firstOptionSticky,\n });\n\n useImperativeHandle(\n ref,\n () => (index: number) => {\n if (highlightType.moveFocus) {\n const movingUp = previousHighlightedIndex.current !== undefined && index < previousHighlightedIndex.current;\n if (firstOptionSticky && movingUp && index !== 0 && menuRefObject.current) {\n // React-Virtual v2 does not offer a proper way to handle sticky elements when scrolling,\n // so until we upgrade to v3, use our own scroll implementation\n // to prevent newly highlighted element from being covered by the sticky element\n // when moving the highlight upwards in the list.\n\n // Scrolling behavior is covered by integration tests.\n // istanbul ignore next\n customScrollToIndex({\n index,\n menuEl: menuRefObject?.current,\n });\n } else {\n scrollToIndex(index);\n }\n }\n previousHighlightedIndex.current = index;\n },\n [firstOptionSticky, highlightType.moveFocus, scrollToIndex]\n );\n\n const stickySize = firstOptionSticky ? virtualItems[0].size : 0;\n const withScrollbar = !!width && width.inner < width.outer;\n\n const idPrefix = useUniqueId('select-list-');\n const finalOptions = renderOptions({\n options: virtualItems.map(({ index }) => filteredOptions[index]),\n getOptionProps,\n filteringValue,\n highlightType,\n idPrefix,\n checkboxes,\n hasDropdownStatus,\n virtualItems,\n useInteractiveGroups,\n screenReaderContent,\n firstOptionSticky,\n withScrollbar,\n });\n\n // Adjust totalSize to account for 1px overlap per item (matching the position adjustment in renderOptions)\n const overlapAdjustment = filteredOptions.length;\n const adjustedTotalSize = totalSize - overlapAdjustment;\n\n return (\n <OptionsList {...menuProps} stickyItemBlockSize={stickySize} ref={menuRef}>\n {finalOptions}\n <div\n aria-hidden=\"true\"\n key=\"total-size\"\n className={styles['layout-strut']}\n style={{ height: adjustedTotalSize - stickySize }}\n />\n {listBottom ? (\n <div role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </div>\n ) : null}\n </OptionsList>\n );\n }\n);\n\nconst VirtualListClosed = forwardRef(\n ({ menuProps, listBottom }: SelectListProps, ref: React.Ref<SelectListProps.SelectListRef>) => {\n useImperativeHandle(ref, () => () => {}, []);\n return (\n <OptionsList {...menuProps} ref={menuProps.ref}>\n {listBottom ? (\n <div role=\"option\" className={styles['list-bottom']}>\n {listBottom}\n </div>\n ) : null}\n </OptionsList>\n );\n }\n);\n\nexport default forwardRef(VirtualList);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"render-options.d.ts","sourceRoot":"","sources":["../../../../src/select/utils/render-options.tsx"],"names":[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aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CAC7C;AAED,eAAO,MAAM,aAAa,kOAevB,iBAAiB,kBAoEnB,CAAC"}
@@ -25,7 +25,10 @@ export const renderOptions = ({ options, getOptionProps, filteringValue, highlig
25
25
  const padBottom = !hasDropdownStatus && isLastItem;
26
26
  const ListItem = useInteractiveGroups ? MultiselectItem : Item;
27
27
  const isSticky = firstOptionSticky && globalIndex === 0;
28
- return (React.createElement(ListItem, Object.assign({ key: globalIndex }, props, { virtualPosition: virtualItem && virtualItem.start, ref: isSticky && stickyOptionRef ? stickyOptionRef : virtualItem && virtualItem.measureRef, padBottom: padBottom, screenReaderContent: screenReaderContent, ariaPosinset: globalIndex + 1, ariaSetsize: ariaSetsize, highlightType: highlightType.type, withScrollbar: withScrollbar, sticky: isSticky })));
28
+ // Adjust virtual position to create 1px overlap between items (matching non-virtual behavior)
29
+ // Subtract globalIndex to shift each item up by 1px per item
30
+ const adjustedVirtualPosition = virtualItem ? virtualItem.start - globalIndex : undefined;
31
+ return (React.createElement(ListItem, Object.assign({ key: globalIndex }, props, { virtualPosition: adjustedVirtualPosition, ref: isSticky && stickyOptionRef ? stickyOptionRef : virtualItem && virtualItem.measureRef, padBottom: padBottom, screenReaderContent: screenReaderContent, ariaPosinset: globalIndex + 1, ariaSetsize: ariaSetsize, highlightType: highlightType.type, withScrollbar: withScrollbar, sticky: isSticky })));
29
32
  };
30
33
  const unflattenedOptions = unflattenOptions(options);
31
34
  return unflattenedOptions.map(nestedDropdownOption => {
@@ -1 +1 @@
1
- {"version":3,"file":"render-options.js","sourceRoot":"","sources":["../../../../src/select/utils/render-options.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAwB,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAGlH,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAmBhD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,OAAO,EACP,cAAc,EACd,cAAc,EACd,aAAa,EACb,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,eAAe,GACG,EAAE,EAAE;IACtB,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAwB,EAAE,EAAE;QACrE,MAAM,WAAW,GAAG,YAAY,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;QACxD,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAC5D,OAAO,YAAY,CAAC;YAClB,MAAM;YACN,KAAK,EAAE,WAAW;YAClB,cAAc;YACd,cAAc,EAAE,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc;YAClE,UAAU;SACX,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,KAAU,EAAE,KAAa,EAAE,EAAE;Q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,CAAC;YAC1C,MAAM,QAAQ,GAAG,MAAA,KAAK,CAAC,EAAE,mCAAI,GAAG,QAAQ,WAAW,KAAK,EAAE,CAAC;YAC3D,OAAO,CACL,oBAAC,WAAW,IACV,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,KAAK,CAAC,MAAK,SAAS,EAC5C,cAAc,EAAE,QAAQ,EACxB,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;gBAEnC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5B,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACrB,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,CAAC,KAAK,IAAG,cAAc,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAkB,CAC5G,CAAC,CACU,CACf,CAAC;SACH;QAED,OAAO,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,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 { DropdownOption } from '../../internal/components/option/interfaces';\nimport { NestedDropdownOption, unflattenOptions } from '../../internal/components/option/utils/unflatten-options';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { VirtualItem } from '../../internal/vendor/react-virtual';\nimport Item from '../parts/item';\nimport MultiselectItem from '../parts/multiselect-item';\nimport OptionGroup from '../parts/option-group';\nimport { getItemProps } from './get-item-props';\n\ninterface RenderOptionProps {\n options: ReadonlyArray<DropdownOption>;\n getOptionProps: any;\n filteringValue: string;\n highlightType: HighlightType;\n idPrefix: string;\n checkboxes?: boolean;\n hasDropdownStatus?: boolean;\n virtualItems?: VirtualItem[];\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n ariaSetsize?: number;\n withScrollbar: boolean;\n firstOptionSticky?: boolean;\n stickyOptionRef?: React.Ref<HTMLDivElement>;\n}\n\nexport const renderOptions = ({\n options,\n getOptionProps,\n filteringValue,\n highlightType,\n idPrefix,\n checkboxes = false,\n hasDropdownStatus,\n virtualItems,\n useInteractiveGroups,\n screenReaderContent,\n ariaSetsize,\n withScrollbar,\n firstOptionSticky,\n stickyOptionRef,\n}: RenderOptionProps) => {\n const getNestedItemProps = ({ index, option }: NestedDropdownOption) => {\n const virtualItem = virtualItems && virtualItems[index];\n const globalIndex = virtualItem ? virtualItem.index : index;\n return getItemProps({\n option,\n index: globalIndex,\n getOptionProps,\n filteringValue: option.type === 'select-all' ? '' : filteringValue,\n checkboxes,\n });\n };\n\n const renderListItem = (props: any, index: number) => {\n const virtualItem = virtualItems && virtualItems[index];\n const globalIndex = virtualItem ? virtualItem.index : index;\n\n const isLastItem = index === options.length - 1;\n const padBottom = !hasDropdownStatus && isLastItem;\n const ListItem = useInteractiveGroups ? MultiselectItem : Item;\n const isSticky = firstOptionSticky && globalIndex === 0;\n\n return (\n <ListItem\n key={globalIndex}\n {...props}\n virtualPosition={virtualItem && virtualItem.start}\n ref={isSticky && stickyOptionRef ? stickyOptionRef : virtualItem && virtualItem.measureRef}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={globalIndex + 1}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType.type}\n withScrollbar={withScrollbar}\n sticky={isSticky}\n />\n );\n };\n\n const unflattenedOptions = unflattenOptions(options);\n return unflattenedOptions.map(nestedDropdownOption => {\n const index = nestedDropdownOption.index;\n const props = getNestedItemProps(nestedDropdownOption);\n\n if (nestedDropdownOption.type === 'parent') {\n const { children } = nestedDropdownOption;\n const optionId = props.id ?? `${idPrefix}-option-${index}`;\n return (\n <OptionGroup\n key={index}\n virtual={virtualItems?.[index] !== undefined}\n ariaLabelledby={optionId}\n ariaDisabled={props['aria-disabled']}\n >\n {renderListItem(props, index)}\n {children.map(child => (\n <React.Fragment key={child.index}>{renderListItem(getNestedItemProps(child), child.index)}</React.Fragment>\n ))}\n </OptionGroup>\n );\n }\n\n return renderListItem(props, index);\n });\n};\n"]}
1
+ {"version":3,"file":"render-options.js","sourceRoot":"","sources":["../../../../src/select/utils/render-options.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAwB,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAGlH,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAmBhD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,OAAO,EACP,cAAc,EACd,cAAc,EACd,aAAa,EACb,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,eAAe,GACG,EAAE,EAAE;IACtB,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAwB,EAAE,EAAE;QACrE,MAAM,WAAW,GAAG,YAAY,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;QACxD,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAC5D,OAAO,YAAY,CAAC;YAClB,MAAM;YACN,KAAK,EAAE,WAAW;YAClB,cAAc;YACd,cAAc,EAAE,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc;YAClE,UAAU;SACX,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,KAAU,EAAE,KAAa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G,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;QAEvD,IAAI,oBAAoB,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC1C,MAAM,EAAE,QAAQ,EAAE,GAAG,oBAAoB,CAAC;YAC1C,MAAM,QAAQ,GAAG,MAAA,KAAK,CAAC,EAAE,mCAAI,GAAG,QAAQ,WAAW,KAAK,EAAE,CAAC;YAC3D,OAAO,CACL,oBAAC,WAAW,IACV,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,KAAK,CAAC,MAAK,SAAS,EAC5C,cAAc,EAAE,QAAQ,EACxB,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;gBAEnC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5B,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACrB,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,CAAC,KAAK,IAAG,cAAc,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAkB,CAC5G,CAAC,CACU,CACf,CAAC;SACH;QAED,OAAO,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,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 { DropdownOption } from '../../internal/components/option/interfaces';\nimport { NestedDropdownOption, unflattenOptions } from '../../internal/components/option/utils/unflatten-options';\nimport { HighlightType } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { VirtualItem } from '../../internal/vendor/react-virtual';\nimport Item from '../parts/item';\nimport MultiselectItem from '../parts/multiselect-item';\nimport OptionGroup from '../parts/option-group';\nimport { getItemProps } from './get-item-props';\n\ninterface RenderOptionProps {\n options: ReadonlyArray<DropdownOption>;\n getOptionProps: any;\n filteringValue: string;\n highlightType: HighlightType;\n idPrefix: string;\n checkboxes?: boolean;\n hasDropdownStatus?: boolean;\n virtualItems?: VirtualItem[];\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n ariaSetsize?: number;\n withScrollbar: boolean;\n firstOptionSticky?: boolean;\n stickyOptionRef?: React.Ref<HTMLDivElement>;\n}\n\nexport const renderOptions = ({\n options,\n getOptionProps,\n filteringValue,\n highlightType,\n idPrefix,\n checkboxes = false,\n hasDropdownStatus,\n virtualItems,\n useInteractiveGroups,\n screenReaderContent,\n ariaSetsize,\n withScrollbar,\n firstOptionSticky,\n stickyOptionRef,\n}: RenderOptionProps) => {\n const getNestedItemProps = ({ index, option }: NestedDropdownOption) => {\n const virtualItem = virtualItems && virtualItems[index];\n const globalIndex = virtualItem ? virtualItem.index : index;\n return getItemProps({\n option,\n index: globalIndex,\n getOptionProps,\n filteringValue: option.type === 'select-all' ? '' : filteringValue,\n checkboxes,\n });\n };\n\n const renderListItem = (props: any, index: number) => {\n const virtualItem = virtualItems && virtualItems[index];\n const globalIndex = virtualItem ? virtualItem.index : index;\n\n const isLastItem = index === options.length - 1;\n const padBottom = !hasDropdownStatus && isLastItem;\n const ListItem = useInteractiveGroups ? MultiselectItem : Item;\n const isSticky = firstOptionSticky && globalIndex === 0;\n\n // Adjust virtual position to create 1px overlap between items (matching non-virtual behavior)\n // Subtract globalIndex to shift each item up by 1px per item\n const adjustedVirtualPosition = virtualItem ? virtualItem.start - globalIndex : undefined;\n\n return (\n <ListItem\n key={globalIndex}\n {...props}\n virtualPosition={adjustedVirtualPosition}\n ref={isSticky && stickyOptionRef ? stickyOptionRef : virtualItem && virtualItem.measureRef}\n padBottom={padBottom}\n screenReaderContent={screenReaderContent}\n ariaPosinset={globalIndex + 1}\n ariaSetsize={ariaSetsize}\n highlightType={highlightType.type}\n withScrollbar={withScrollbar}\n sticky={isSticky}\n />\n );\n };\n\n const unflattenedOptions = unflattenOptions(options);\n return unflattenedOptions.map(nestedDropdownOption => {\n const index = nestedDropdownOption.index;\n const props = getNestedItemProps(nestedDropdownOption);\n\n if (nestedDropdownOption.type === 'parent') {\n const { children } = nestedDropdownOption;\n const optionId = props.id ?? `${idPrefix}-option-${index}`;\n return (\n <OptionGroup\n key={index}\n virtual={virtualItems?.[index] !== undefined}\n ariaLabelledby={optionId}\n ariaDisabled={props['aria-disabled']}\n >\n {renderListItem(props, index)}\n {children.map(child => (\n <React.Fragment key={child.index}>{renderListItem(getNestedItemProps(child), child.index)}</React.Fragment>\n ))}\n </OptionGroup>\n );\n }\n\n return renderListItem(props, index);\n });\n};\n"]}
@@ -318,7 +318,7 @@ const InternalTable = React.forwardRef((_a, ref) => {
318
318
  [styles['has-header']]: hasHeader,
319
319
  }), style: stickyState.style.wrapper, onScroll: handleScroll }, wrapperProps),
320
320
  React.createElement("div", { className: styles['wrapper-content-measure'], ref: wrapperMeasureMergedRef }),
321
- !!renderAriaLive && !!firstIndex && (React.createElement(InternalLiveRegion, { hidden: true, tagName: "span" },
321
+ !!renderAriaLive && !!firstIndex && !loading && (React.createElement(InternalLiveRegion, { hidden: true, tagName: "span" },
322
322
  React.createElement("span", null, renderAriaLive({
323
323
  firstIndex,
324
324
  lastIndex: firstIndex + items.length - 1,