xmlui 0.10.19 → 0.10.20

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 (109) hide show
  1. package/dist/lib/{apiInterceptorWorker-DPgtUtdA.mjs → apiInterceptorWorker-QiltRtq1.mjs} +1 -1
  2. package/dist/lib/{index-cuh97e2e.mjs → index-Ckhnrf1F.mjs} +848 -615
  3. package/dist/lib/index.css +1 -1
  4. package/dist/{metadata/initMock-C-cnv--V.mjs → lib/initMock-qnCFw6Zc.mjs} +25 -15
  5. package/dist/lib/language-server-web-worker.mjs +1 -1
  6. package/dist/lib/language-server.mjs +1 -1
  7. package/dist/lib/{metadata-utils-CtY0QcvH.mjs → metadata-utils-BTIt1_wE.mjs} +1 -1
  8. package/dist/lib/{server-common-Cine5nRR.mjs → server-common-DYZtsdM7.mjs} +51 -14
  9. package/dist/lib/{transform-bHBjkKSL.mjs → transform-Tooy42EB.mjs} +16 -18
  10. package/dist/lib/xmlui-parser.mjs +2 -2
  11. package/dist/lib/{xmlui-serializer-DB6BLiXK.mjs → xmlui-serializer-uCYa8_tZ.mjs} +1 -1
  12. package/dist/lib/xmlui.d.ts +11 -3
  13. package/dist/lib/xmlui.mjs +2 -2
  14. package/dist/metadata/{apiInterceptorWorker-BmKP8bnq.mjs → apiInterceptorWorker-Dql7QGw2.mjs} +1 -1
  15. package/dist/metadata/{collectedComponentMetadata-Cp-9lpnG.mjs → collectedComponentMetadata-Dg7P-zOz.mjs} +824 -600
  16. package/dist/{lib/initMock-BMxsanHc.mjs → metadata/initMock-ZyyFNOpL.mjs} +25 -15
  17. package/dist/metadata/style.css +1 -1
  18. package/dist/metadata/xmlui-metadata.mjs +1 -1
  19. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  20. package/dist/scripts/package.json +1 -1
  21. package/dist/scripts/src/components/Animation/AnimationNative.js +28 -28
  22. package/dist/scripts/src/components/App/App.spec.js +17 -17
  23. package/dist/scripts/src/components/AppState/AppState.js +3 -2
  24. package/dist/scripts/src/components/AppState/AppState.spec.js +26 -2
  25. package/dist/scripts/src/components/AppState/AppStateNative.js +3 -4
  26. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +15 -10
  27. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +4 -4
  28. package/dist/scripts/src/components/Carousel/Carousel.spec.js +214 -0
  29. package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
  30. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +2 -0
  31. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +193 -0
  32. package/dist/scripts/src/components/DateInput/DateInput.spec.js +6 -6
  33. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +3 -3
  34. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +4 -13
  35. package/dist/scripts/src/components/Form/Form.spec.js +25 -9
  36. package/dist/scripts/src/components/Form/FormNative.js +7 -4
  37. package/dist/scripts/src/components/FormItem/FormItem.js +3 -1
  38. package/dist/scripts/src/components/FormItem/FormItem.spec.js +5 -14
  39. package/dist/scripts/src/components/FormItem/FormItemNative.js +12 -8
  40. package/dist/scripts/src/components/FormItem/Validations.js +2 -2
  41. package/dist/scripts/src/components/IconRegistryContext.js +1 -1
  42. package/dist/scripts/src/components/List/ListNative.js +2 -2
  43. package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +3 -12
  44. package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
  45. package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +6 -3
  46. package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +1 -1
  47. package/dist/scripts/src/components/NestedApp/NestedAppNative.js +3 -3
  48. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +2 -2
  49. package/dist/scripts/src/components/Pagination/Pagination.spec.js +5 -0
  50. package/dist/scripts/src/components/Pagination/PaginationNative.js +1 -3
  51. package/dist/scripts/src/components/Queue/Queue.spec.js +45 -47
  52. package/dist/scripts/src/components/Queue/QueueNative.js +1 -1
  53. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +5 -5
  54. package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +1 -1
  55. package/dist/scripts/src/components/Select/MultiSelectOption.js +42 -0
  56. package/dist/scripts/src/components/Select/Select.js +3 -3
  57. package/dist/scripts/src/components/Select/SelectContext.js +8 -1
  58. package/dist/scripts/src/components/Select/SelectNative.js +134 -142
  59. package/dist/scripts/src/components/Select/SelectOption.js +34 -0
  60. package/dist/scripts/src/components/Select/SimpleSelect.js +57 -0
  61. package/dist/scripts/src/components/Spinner/Spinner.spec.js +1 -1
  62. package/dist/scripts/src/components/Table/useRowSelection.js +14 -23
  63. package/dist/scripts/src/components/TextArea/TextArea.spec.js +8 -8
  64. package/dist/scripts/src/components/Theme/Theme.js +2 -1
  65. package/dist/scripts/src/components/Theme/Theme.spec.js +266 -0
  66. package/dist/scripts/src/components/Theme/ThemeNative.js +8 -1
  67. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +3 -3
  68. package/dist/scripts/src/components/Tree/TreeNative.js +9 -11
  69. package/dist/scripts/src/components-core/InspectorContext.js +1 -1
  70. package/dist/scripts/src/components-core/StandaloneApp.js +6 -8
  71. package/dist/scripts/src/components-core/action/FileUploadAction.js +1 -1
  72. package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +50 -0
  73. package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +6 -1
  74. package/dist/scripts/src/components-core/interception/ApiInterceptor.js +9 -11
  75. package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +3 -3
  76. package/dist/scripts/src/components-core/interception/Backend.js +1 -1
  77. package/dist/scripts/src/components-core/interception/IndexedDb.js +64 -66
  78. package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +2 -2
  79. package/dist/scripts/src/components-core/loader/DataLoader.js +6 -14
  80. package/dist/scripts/src/components-core/loader/Loader.js +11 -11
  81. package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +4 -2
  82. package/dist/scripts/src/components-core/loader/PageableLoader.js +10 -9
  83. package/dist/scripts/src/components-core/rendering/AppContent.js +1 -7
  84. package/dist/scripts/src/components-core/rendering/ErrorBoundary.js +1 -1
  85. package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +1 -1
  86. package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +180 -186
  87. package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +6 -6
  88. package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +2 -2
  89. package/dist/scripts/src/components-core/utils/actionUtils.js +1 -1
  90. package/dist/scripts/src/components-core/utils/hooks.js +1 -1
  91. package/dist/scripts/src/components-core/utils/misc.js +4 -4
  92. package/dist/scripts/src/components-core/xmlui-parser.js +47 -31
  93. package/dist/scripts/src/language-server/server-common.js +25 -24
  94. package/dist/scripts/src/language-server/services/common/lsp-utils.js +2 -2
  95. package/dist/scripts/src/language-server/services/completion.js +20 -2
  96. package/dist/scripts/src/language-server/services/diagnostic.js +1 -1
  97. package/dist/scripts/src/language-server/services/hover.js +2 -2
  98. package/dist/scripts/src/parsers/common/utils.js +2 -2
  99. package/dist/scripts/src/parsers/scripting/Lexer.js +21 -15
  100. package/dist/scripts/src/parsers/scripting/Parser.js +8 -9
  101. package/dist/scripts/src/parsers/style-parser/StyleLexer.js +22 -22
  102. package/dist/scripts/src/parsers/style-parser/StyleParser.js +70 -68
  103. package/dist/scripts/src/testing/ComponentDrivers.js +20 -39
  104. package/dist/scripts/src/testing/component-test-helpers.js +34 -50
  105. package/dist/scripts/src/testing/fixtures.js +114 -113
  106. package/dist/scripts/src/testing/themed-app-test-helpers.js +7 -13
  107. package/dist/standalone/xmlui-standalone.es.d.ts +11 -3
  108. package/dist/standalone/xmlui-standalone.umd.js +12 -12
  109. package/package.json +1 -1
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  Object.defineProperty(exports, "__esModule", { value: true });
45
36
  exports.ConfirmationModalContextProvider = exports.useConfirm = void 0;
46
37
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -49,7 +40,7 @@ const ButtonNative_1 = require("../Button/ButtonNative");
49
40
  const StackNative_1 = require("../Stack/StackNative");
50
41
  const Dialog_1 = require("./Dialog");
51
42
  const ConfirmationModalContext = react_1.default.createContext({
52
- confirm: (title, message, actionLabel) => __awaiter(void 0, void 0, void 0, function* () { return false; }),
43
+ confirm: (title, message, actionLabel) => Promise.resolve(false),
53
44
  });
54
45
  const useConfirm = () => (0, react_1.useContext)(ConfirmationModalContext);
55
46
  exports.useConfirm = useConfirm;
@@ -73,7 +64,7 @@ const ConfirmationModalContextProvider = ({ children }) => {
73
64
  }, 0);
74
65
  }
75
66
  }, [showConfirmationModal]);
76
- const handleShow = (0, react_1.useCallback)((title, message, actionLabel) => __awaiter(void 0, void 0, void 0, function* () {
67
+ const handleShow = (0, react_1.useCallback)((title, message, actionLabel) => {
77
68
  if (typeof title === "string") {
78
69
  setTitle(title);
79
70
  setButtons([
@@ -93,7 +84,7 @@ const ConfirmationModalContextProvider = ({ children }) => {
93
84
  return new Promise(function (resolve) {
94
85
  resolver.current = resolve;
95
86
  });
96
- }), []);
87
+ }, []);
97
88
  const handleOk = (0, react_1.useCallback)((value) => {
98
89
  if (resolver.current) {
99
90
  resolver.current(value);
@@ -25,7 +25,7 @@ exports.ModalDialogMd = (0, metadata_helpers_1.createMetadata)({
25
25
  },
26
26
  title: {
27
27
  description: "The title area of the modal dialog.",
28
- }
28
+ },
29
29
  },
30
30
  props: {
31
31
  fullScreen: {
@@ -81,5 +81,5 @@ exports.modalViewComponentRenderer = (0, renderers_1.createComponentRenderer)(CO
81
81
  return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node, renderChild: renderChild, layoutContext: { _insideModalFrame: true }, contextVars: { $param: openParams === null || openParams === void 0 ? void 0 : openParams[0], $params: openParams } }));
82
82
  } }));
83
83
  }
84
- return ((0, jsx_runtime_1.jsx)(ModalDialogNative_1.ModalDialog, { className: className, fullScreen: extractValue.asOptionalBoolean((_a = node.props) === null || _a === void 0 ? void 0 : _a.fullScreen), title: extractValue((_b = node.props) === null || _b === void 0 ? void 0 : _b.title), closeButtonVisible: extractValue.asOptionalBoolean(node.props.closeButtonVisible), children: renderChild(node.children, { type: "Stack" }) }));
84
+ return ((0, jsx_runtime_1.jsx)(ModalDialogNative_1.ModalDialog, { className: className, fullScreen: extractValue.asOptionalBoolean((_a = node.props) === null || _a === void 0 ? void 0 : _a.fullScreen), title: extractValue((_b = node.props) === null || _b === void 0 ? void 0 : _b.title), closeButtonVisible: extractValue.asOptionalBoolean(node.props.closeButtonVisible), externalAnimation: extractValue.asOptionalBoolean(node.props.externalAnimation), children: renderChild(node.children, { type: "Stack" }) }));
85
85
  });
@@ -130,7 +130,7 @@ function useModalOpenState(isInitiallyOpen = true, onOpen, onClose) {
130
130
  return modalStateContext || modalLocalOpenState;
131
131
  }
132
132
  exports.ModalDialog = react_1.default.forwardRef((_a, ref) => {
133
- var { children, style, isInitiallyOpen, fullScreen = exports.defaultProps.fullScreen, title, closeButtonVisible = exports.defaultProps.closeButtonVisible, className, onOpen, onClose } = _a, rest = __rest(_a, ["children", "style", "isInitiallyOpen", "fullScreen", "title", "closeButtonVisible", "className", "onOpen", "onClose"]);
133
+ var { children, style, isInitiallyOpen, fullScreen = exports.defaultProps.fullScreen, title, closeButtonVisible = exports.defaultProps.closeButtonVisible, className, onOpen, onClose, externalAnimation = true } = _a, rest = __rest(_a, ["children", "style", "isInitiallyOpen", "fullScreen", "title", "closeButtonVisible", "className", "onOpen", "onClose", "externalAnimation"]);
134
134
  const { root } = (0, ThemeContext_1.useTheme)();
135
135
  // NOTE: at this point, we can't use useAppContext here,
136
136
  // since the ModalDialog context provider (via ConfirmationModalContextProvider) is mounted outside of the AppContext,
@@ -180,9 +180,12 @@ exports.ModalDialog = react_1.default.forwardRef((_a, ref) => {
180
180
  if (!root) {
181
181
  return null;
182
182
  }
183
- const Content = ((0, jsx_runtime_1.jsxs)(Dialog.Content, Object.assign({}, rest, { "data-part-id": PART_CONTENT, className: (0, classnames_1.default)(ModalDialog_module_scss_1.default.content, className), onPointerDownOutside: (event) => {
183
+ const Content = ((0, jsx_runtime_1.jsxs)(Dialog.Content, Object.assign({}, rest, { "data-part-id": PART_CONTENT, className: (0, classnames_1.default)({
184
+ [ModalDialog_module_scss_1.default.contentAnimation]: !externalAnimation,
185
+ }, ModalDialog_module_scss_1.default.content, className), onPointerDownOutside: (event) => {
184
186
  if (event.target instanceof Element &&
185
- (event.target.closest("._debug-inspect-button") !== null || event.target.localName === "com-1password-button")) {
187
+ (event.target.closest("._debug-inspect-button") !== null ||
188
+ event.target.localName === "com-1password-button")) {
186
189
  //we prevent the auto modal close on clicking the inspect button
187
190
  event.preventDefault();
188
191
  }
@@ -70,7 +70,7 @@ function AppWithCodeViewNative({ markdown, splitView, withFrame = true, noHeader
70
70
  [NestedApp_module_scss_1.default.show]: !showCode,
71
71
  [NestedApp_module_scss_1.default.hide]: showCode,
72
72
  }), children: "UI" })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.wrapper, style: { width: controlsWidth }, children: [allowPlaygroundPopup && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { trigger: (0, jsx_runtime_1.jsx)("button", { className: NestedApp_module_scss_1.default.headerButton, onClick: () => {
73
- openPlayground();
73
+ void openPlayground();
74
74
  }, children: (0, jsx_runtime_1.jsx)(rx_1.RxOpenInNewWindow, {}) }), label: "View and edit in new full-width window" })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { trigger: (0, jsx_runtime_1.jsx)("button", { className: NestedApp_module_scss_1.default.headerButton, onClick: () => {
75
75
  setShowCode(false);
76
76
  setRefreshVersion(refreshVersion + 1);
@@ -137,7 +137,7 @@ function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, act
137
137
  return null;
138
138
  }));
139
139
  // When your component mounts and the shadow root is available...
140
- Promise.all(sheetPromises).then((sheets) => {
140
+ void Promise.all(sheetPromises).then((sheets) => {
141
141
  // Filter out any sheets that failed to load
142
142
  const validSheets = sheets.filter(Boolean);
143
143
  // Apply the array of constructed stylesheets to the shadow root
@@ -217,7 +217,7 @@ function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, act
217
217
  [NestedApp_module_scss_1.default.initialized]: initialized,
218
218
  }) })] }));
219
219
  }
220
- function NestedAppRoot({ children, themeStylesToReset }) {
220
+ function NestedAppRoot({ children, themeStylesToReset, }) {
221
221
  // css variables are leaking into to shadow dom, so we reset them here
222
222
  const themeVarReset = (0, react_1.useMemo)(() => {
223
223
  const vars = {};
@@ -227,5 +227,5 @@ function NestedAppRoot({ children, themeStylesToReset }) {
227
227
  return vars;
228
228
  }, [themeStylesToReset]);
229
229
  const resetClassName = (0, StyleContext_1.useStyles)(themeVarReset, { prepend: true });
230
- return (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(resetClassName, NestedApp_module_scss_1.default.shadowRoot), id: "nested-app-root", children: (0, jsx_runtime_1.jsx)("div", { className: NestedApp_module_scss_1.default.content, children: children }) });
230
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(resetClassName, NestedApp_module_scss_1.default.shadowRoot), id: "nested-app-root", children: (0, jsx_runtime_1.jsx)("div", { className: NestedApp_module_scss_1.default.content, children: children }) }));
231
231
  }
@@ -201,9 +201,9 @@ fixtures_1.test.describe("Basic Functionality", () => {
201
201
  yield initTestBed(`<NumberBox zeroOrPositive="true" initialValue="1" />`);
202
202
  const driver = yield createNumberBoxDriver();
203
203
  yield driver.decrement();
204
- (0, fixtures_1.expect)(driver.input).toHaveValue("0");
204
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("0");
205
205
  yield driver.decrement();
206
- (0, fixtures_1.expect)(driver.input).toHaveValue("0");
206
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("0");
207
207
  }));
208
208
  // --- Range validation (min/max)
209
209
  (0, fixtures_1.test)("minValue prevents values below minimum spinner button", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createNumberBoxDriver, }) {
@@ -634,6 +634,11 @@ fixtures_1.test.describe("Accessibility", () => {
634
634
  yield page.keyboard.press("Tab");
635
635
  yield (0, fixtures_1.expect)(page.getByRole("button", { name: "Page 2" })).toBeFocused();
636
636
  }));
637
+ (0, fixtures_1.test)("page size selector is focused when label is clicked", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
638
+ yield initTestBed(`<Pagination itemCount="50" pageSize="10" pageSizeOptions="{[5, 10, 20]}"/>`);
639
+ yield page.getByText("Items per page").click();
640
+ yield (0, fixtures_1.expect)(page.locator("select")).toBeFocused();
641
+ }));
637
642
  });
638
643
  // =============================================================================
639
644
  // INTERACTION TESTS
@@ -140,9 +140,7 @@ exports.PaginationNative = (0, react_1.forwardRef)(function PaginationNative(_a,
140
140
  visiblePages.map((pageNum) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: pageNum === currentPageNumber ? "solid" : "ghost", disabled: !enabled, size: "sm", onClick: () => handlePageChange(pageNum - 1), contextualLabel: `Page ${pageNum}`, "aria-current": pageNum === currentPageNumber || undefined, "aria-label": `Page ${pageNum}${pageNum === currentPageNumber ? " (current)" : ""}`, children: pageNum }) }, `page-${pageNum}`))), visiblePages.length <= 2 && ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "sm", disabled: !enabled || isLastPage, onClick: () => handlePageChange(currentPage + 1), contextualLabel: "Next page", style: { minHeight: "36px", padding: "8px" }, "aria-label": "Next page", children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: `next:Pagination`, fallback: orientation === "vertical" ? "chevrondown" : "chevronright", size: "sm" }) }) })), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", size: "sm", disabled: !enabled || isLastPage, onClick: () => handlePageChange(totalPages - 1), contextualLabel: "Last page", style: { minHeight: "36px", padding: "8px" }, "aria-label": "Last page", children: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: `last:Pagination`, fallback: orientation === "vertical" ? "doublechevrondown" : "doublechevronright", size: "sm" }) }) })] }));
141
141
  const pageSizeSelector = showPageSizeSelector &&
142
142
  pageSizeOptions &&
143
- pageSizeOptions.length > 1 && ((0, jsx_runtime_1.jsx)("div", { "data-component": `page-size-selector-container`, className: (0, classnames_1.default)(Pagination_module_scss_1.default.selectorContainer), children: (0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { id: `${id}-page-size-selector`, label: "Items per page", enabled: enabled, style: style, className: className, labelPosition: orientation === "vertical" ? "top" : "start",
144
- // NOTE: This is a band-aid solution to handle the multiple IDs issue - remove after resolving focus bug
145
- isInputTemplateUsed: true, children: (0, jsx_runtime_1.jsx)("select", { id: `${id}-page-size-selector`, value: pageSize, onChange: (e) => handlePageSizeChange(Number(e.target.value)), disabled: !enabled, className: Pagination_module_scss_1.default.pageSizeSelect, children: pageSizeOptions.map((size) => ((0, jsx_runtime_1.jsx)("option", { value: size, children: size }, size))) }) }) }));
143
+ pageSizeOptions.length > 1 && ((0, jsx_runtime_1.jsx)("div", { "data-component": `page-size-selector-container`, className: (0, classnames_1.default)(Pagination_module_scss_1.default.selectorContainer), children: (0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { id: `${id}-page-size-selector`, label: "Items per page", enabled: enabled, style: style, className: className, labelPosition: orientation === "vertical" ? "top" : "start", children: (0, jsx_runtime_1.jsx)("select", { id: `${id}-page-size-selector`, value: pageSize, onChange: (e) => handlePageSizeChange(Number(e.target.value)), disabled: !enabled, className: Pagination_module_scss_1.default.pageSizeSelect, children: pageSizeOptions.map((size) => ((0, jsx_runtime_1.jsx)("option", { value: size, children: size }, size))) }) }) }));
146
144
  const pageInfo = showPageInfo && ((0, jsx_runtime_1.jsx)("div", { "data-component": `page-info`, className: (0, classnames_1.default)(Pagination_module_scss_1.default.pageInfo), children: (0, jsx_runtime_1.jsxs)(TextNative_1.Text, { variant: "secondary", children: ["Page ", currentPageNumber, " of ", totalPages, " (", itemCount, " items)"] }) }));
147
145
  // Used the following resource to provide a11y:
148
146
  // https://a11ymatters.com/pattern/pagination/
@@ -14,7 +14,7 @@ const fixtures_1 = require("../../testing/fixtures");
14
14
  // BASIC FUNCTIONALITY TESTS
15
15
  // =============================================================================
16
16
  fixtures_1.test.describe("Basic Functionality", () => {
17
- (0, fixtures_1.test)("component initializes and provides API methods", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
17
+ (0, fixtures_1.test)("component initializes and provides API methods", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
18
18
  const { testStateDriver } = yield initTestBed(`
19
19
  <Fragment>
20
20
  <Queue id="testQueue" />
@@ -27,8 +27,8 @@ fixtures_1.test.describe("Basic Functionality", () => {
27
27
  }" />
28
28
  </Fragment>
29
29
  `);
30
- const buttonDriver = createButtonDriver("checkApi");
31
- (yield buttonDriver).component.click();
30
+ const buttonDriver = yield createButtonDriver("checkApi");
31
+ yield buttonDriver.component.click();
32
32
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual({
33
33
  hasEnqueueItem: true,
34
34
  hasEnqueueItems: true,
@@ -41,7 +41,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
41
41
  // ENQUEUE ITEM API TESTS
42
42
  // =============================================================================
43
43
  fixtures_1.test.describe("enqueueItem API", () => {
44
- (0, fixtures_1.test)("enqueueItem adds item to queue and returns ID", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
44
+ (0, fixtures_1.test)("enqueueItem adds item to queue and returns ID", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
45
45
  const { testStateDriver } = yield initTestBed(`
46
46
  <Fragment>
47
47
  <Queue id="testQueue" />
@@ -61,7 +61,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
61
61
  hasValidId: true,
62
62
  });
63
63
  }));
64
- (0, fixtures_1.test)("enqueueItem handles different data types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
64
+ (0, fixtures_1.test)("enqueueItem handles different data types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
65
65
  const { testStateDriver } = yield initTestBed(`
66
66
  <Fragment>
67
67
  <Queue id="testQueue" />
@@ -107,7 +107,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
107
107
  // ENQUEUE ITEMS API TESTS
108
108
  // =============================================================================
109
109
  fixtures_1.test.describe("enqueueItems API", () => {
110
- (0, fixtures_1.test)("enqueueItems adds multiple items and returns array of IDs", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
110
+ (0, fixtures_1.test)("enqueueItems adds multiple items and returns array of IDs", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
111
111
  const { testStateDriver } = yield initTestBed(`
112
112
  <Fragment>
113
113
  <Queue id="testQueue" />
@@ -156,7 +156,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
156
156
  // GET QUEUE LENGTH API TESTS
157
157
  // =============================================================================
158
158
  fixtures_1.test.describe("getQueueLength API", () => {
159
- (0, fixtures_1.test)("getQueueLength returns 0 for empty queue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
159
+ (0, fixtures_1.test)("getQueueLength returns 0 for empty queue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
160
160
  const { testStateDriver } = yield initTestBed(`
161
161
  <Fragment>
162
162
  <Queue id="testQueue" />
@@ -167,7 +167,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
167
167
  yield buttonDriver.component.click();
168
168
  yield fixtures_1.expect.poll(testStateDriver.testState).toBe(0);
169
169
  }));
170
- (0, fixtures_1.test)("getQueueLength updates after adding items", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
170
+ (0, fixtures_1.test)("getQueueLength updates after adding items", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
171
171
  const { testStateDriver } = yield initTestBed(`
172
172
  <Fragment>
173
173
  <Queue id="testQueue" />
@@ -177,9 +177,9 @@ fixtures_1.test.describe("Basic Functionality", () => {
177
177
  const afterOne = testQueue.getQueueLength();
178
178
  const ids = testQueue.enqueueItems(['item2', 'item3']);
179
179
  const afterThree = testQueue.getQueueLength();
180
- testState = {
181
- initial,
182
- afterOne,
180
+ testState = {
181
+ initial,
182
+ afterOne,
183
183
  afterThree,
184
184
  hasId1: !!id1,
185
185
  hasIds: ids.length === 2
@@ -194,7 +194,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
194
194
  afterOne: 0,
195
195
  afterThree: 0,
196
196
  hasId1: true,
197
- hasIds: true
197
+ hasIds: true,
198
198
  });
199
199
  }));
200
200
  });
@@ -202,7 +202,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
202
202
  // GET QUEUED ITEMS API TESTS
203
203
  // =============================================================================
204
204
  fixtures_1.test.describe("getQueuedItems API", () => {
205
- (0, fixtures_1.test)("getQueuedItems returns empty array for empty queue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
205
+ (0, fixtures_1.test)("getQueuedItems returns empty array for empty queue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
206
206
  const { testStateDriver } = yield initTestBed(`
207
207
  <Fragment>
208
208
  <Queue id="testQueue" />
@@ -213,7 +213,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
213
213
  yield buttonDriver.component.click();
214
214
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual([]);
215
215
  }));
216
- (0, fixtures_1.test)("getQueuedItems returns items with correct structure", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
216
+ (0, fixtures_1.test)("getQueuedItems returns items with correct structure", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
217
217
  const { testStateDriver } = yield initTestBed(`
218
218
  <Fragment>
219
219
  <Queue id="testQueue" />
@@ -233,7 +233,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
233
233
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual({
234
234
  hasItemId: true,
235
235
  itemsLength: 0,
236
- isArray: true
236
+ isArray: true,
237
237
  });
238
238
  }));
239
239
  });
@@ -266,7 +266,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
266
266
  lengthBefore: 0,
267
267
  lengthAfter: 0,
268
268
  hasItemId: true,
269
- hasKeepId: true
269
+ hasKeepId: true,
270
270
  });
271
271
  }));
272
272
  (0, fixtures_1.test)("remove handles invalid ID gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
@@ -278,8 +278,8 @@ fixtures_1.test.describe("Basic Functionality", () => {
278
278
  const lengthBefore = testQueue.getQueueLength();
279
279
  testQueue.remove('invalid-id');
280
280
  const lengthAfter = testQueue.getQueueLength();
281
- testState = {
282
- lengthBefore,
281
+ testState = {
282
+ lengthBefore,
283
283
  lengthAfter,
284
284
  hasItemId: !!itemId
285
285
  };
@@ -291,7 +291,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
291
291
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual({
292
292
  lengthBefore: 0,
293
293
  lengthAfter: 0,
294
- hasItemId: true
294
+ hasItemId: true,
295
295
  });
296
296
  }));
297
297
  });
@@ -310,10 +310,10 @@ fixtures_1.test.describe("Basic Functionality", () => {
310
310
  yield buttonDriver.component.click();
311
311
  yield fixtures_1.expect.poll(testStateDriver.testState).toBe("processed");
312
312
  }));
313
- (0, fixtures_1.test)("clearAfterFinish=true removes completed items", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
313
+ (0, fixtures_1.test)("clearAfterFinish=true removes completed items", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
314
314
  const { testStateDriver } = yield initTestBed(`
315
315
  <Fragment>
316
- <Queue id="testQueue" clearAfterFinish="true"
316
+ <Queue id="testQueue" clearAfterFinish="true"
317
317
  onProcess="processing => {}"
318
318
  onComplete="() => testState = testQueue.getQueuedItems().length" />
319
319
  <Button id="enqueueBtn" label="Enqueue" onClick="testQueue.enqueueItem('test');" />
@@ -339,10 +339,10 @@ fixtures_1.test.describe("Basic Functionality", () => {
339
339
  yield buttonDriver.component.click();
340
340
  yield fixtures_1.expect.poll(testStateDriver.testState).toBe("test-data");
341
341
  }));
342
- (0, fixtures_1.test)("onWillProcess event can skip items by returning false", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
342
+ (0, fixtures_1.test)("onWillProcess event can skip items by returning false", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
343
343
  const { testStateDriver } = yield initTestBed(`
344
344
  <Fragment>
345
- <Queue id="testQueue"
345
+ <Queue id="testQueue"
346
346
  onWillProcess="processing => processing.item !== 'skip' ? true : (testState = 'skipped', false)"
347
347
  onProcess="processing => testState = 'processed'" />
348
348
  <Button id="enqueueBtn" label="Enqueue" onClick="
@@ -355,11 +355,11 @@ fixtures_1.test.describe("Basic Functionality", () => {
355
355
  yield buttonDriver.component.click();
356
356
  yield fixtures_1.expect.poll(testStateDriver.testState).toBe("processed");
357
357
  }));
358
- (0, fixtures_1.test)("onDidProcess event fires after processing", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
358
+ (0, fixtures_1.test)("onDidProcess event fires after processing", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
359
359
  const { testStateDriver } = yield initTestBed(`
360
360
  <Fragment>
361
361
  <Queue id="testQueue"
362
- onProcess="processing => {}"
362
+ onProcess="processing => {}"
363
363
  onDidProcess="processing => testState = 'did-process-' + processing.item" />
364
364
  <Button id="enqueueBtn" label="Enqueue" onClick="testQueue.enqueueItem('test');" />
365
365
  </Fragment>
@@ -368,7 +368,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
368
368
  yield buttonDriver.component.click();
369
369
  yield fixtures_1.expect.poll(testStateDriver.testState).toBe("did-process-test");
370
370
  }));
371
- (0, fixtures_1.test)("onProcessError event fires when processing throws", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
371
+ (0, fixtures_1.test)("onProcessError event fires when processing throws", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
372
372
  const { testStateDriver } = yield initTestBed(`
373
373
  <Fragment>
374
374
  <Queue id="testQueue"
@@ -381,7 +381,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
381
381
  yield buttonDriver.component.click();
382
382
  yield fixtures_1.expect.poll(testStateDriver.testState).toBe("error-test");
383
383
  }));
384
- (0, fixtures_1.test)("onComplete event fires when queue becomes empty", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
384
+ (0, fixtures_1.test)("onComplete event fires when queue becomes empty", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
385
385
  const { testStateDriver } = yield initTestBed(`
386
386
  <Fragment>
387
387
  <Queue id="testQueue" clearAfterFinish="true"
@@ -399,7 +399,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
399
399
  // TEMPLATE PROPERTY TESTS
400
400
  // =============================================================================
401
401
  fixtures_1.test.describe("Template Properties", () => {
402
- (0, fixtures_1.test)("progressFeedback renders during processing", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createButtonDriver }) {
402
+ (0, fixtures_1.test)("progressFeedback renders during processing", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createButtonDriver, }) {
403
403
  yield initTestBed(`
404
404
  <Fragment>
405
405
  <Queue id="testQueue" onProcess="processing => { processing.reportProgress('50%'); }">
@@ -414,7 +414,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
414
414
  yield buttonDriver.component.click();
415
415
  yield (0, fixtures_1.expect)(page.getByText("Progress: 0 of 1")).toBeVisible();
416
416
  }));
417
- (0, fixtures_1.test)("resultFeedback renders when queue completes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createButtonDriver }) {
417
+ (0, fixtures_1.test)("resultFeedback renders when queue completes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createButtonDriver, }) {
418
418
  yield initTestBed(`
419
419
  <Fragment>
420
420
  <Queue id="testQueue" clearAfterFinish="true" onProcess="processing => {}">
@@ -429,7 +429,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
429
429
  yield buttonDriver.component.click();
430
430
  yield (0, fixtures_1.expect)(page.getByText("All 1 items processed")).toBeVisible();
431
431
  }));
432
- (0, fixtures_1.test)("progressFeedback handles null gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
432
+ (0, fixtures_1.test)("progressFeedback handles null gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
433
433
  const { testStateDriver } = yield initTestBed(`
434
434
  <Fragment>
435
435
  <Queue id="testQueue" progressFeedback="{null}" onProcess="processing => testState = 'processed'" />
@@ -443,7 +443,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
443
443
  (0, fixtures_1.test)("resultFeedback handles null gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
444
444
  const { testStateDriver } = yield initTestBed(`
445
445
  <Fragment>
446
- <Queue id="testQueue" resultFeedback="{null}" clearAfterFinish="true"
446
+ <Queue id="testQueue" resultFeedback="{null}" clearAfterFinish="true"
447
447
  onProcess="processing => {}"
448
448
  onComplete="() => testState = 'complete'" />
449
449
  <Button id="enqueueBtn" label="Enqueue" onClick="testQueue.enqueueItem('test');" />
@@ -468,12 +468,12 @@ fixtures_1.test.describe("Other Edge Cases", () => {
468
468
  const id1 = testQueue.enqueueItem('item1');
469
469
  const id2 = testQueue.enqueueItem('item2');
470
470
  const ids = testQueue.enqueueItems(['item3', 'item4', 'item5']);
471
-
471
+
472
472
  // Mix operations
473
473
  testQueue.remove(id1);
474
474
  const finalLength = testQueue.getQueueLength();
475
475
  const items = testQueue.getQueuedItems();
476
-
476
+
477
477
  testState = {
478
478
  finalLength,
479
479
  itemCount: items.length,
@@ -491,10 +491,10 @@ fixtures_1.test.describe("Other Edge Cases", () => {
491
491
  itemCount: 0,
492
492
  hasId1: true,
493
493
  hasId2: true,
494
- idsLength: 3
494
+ idsLength: 3,
495
495
  });
496
496
  }));
497
- (0, fixtures_1.test)("handles processing with errors and recovery", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
497
+ (0, fixtures_1.test)("handles processing with errors and recovery", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
498
498
  const { testStateDriver } = yield initTestBed(`
499
499
  <Fragment>
500
500
  <Queue id="testQueue"
@@ -512,11 +512,9 @@ fixtures_1.test.describe("Other Edge Cases", () => {
512
512
  `);
513
513
  const buttonDriver = yield createButtonDriver("enqueueBtn");
514
514
  yield buttonDriver.component.click();
515
- yield fixtures_1.expect.poll(testStateDriver.testState).toEqual([
516
- "processed-good1",
517
- "error-error",
518
- "processed-good2"
519
- ]);
515
+ yield fixtures_1.expect
516
+ .poll(testStateDriver.testState)
517
+ .toEqual(["processed-good1", "error-error", "processed-good2"]);
520
518
  }));
521
519
  (0, fixtures_1.test)("handles very large queue operations", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
522
520
  const { testStateDriver } = yield initTestBed(`
@@ -528,7 +526,7 @@ fixtures_1.test.describe("Other Edge Cases", () => {
528
526
  for (let i = 0; i < 100; i++) {
529
527
  largeArray.push('item-' + i);
530
528
  }
531
-
529
+
532
530
  const itemIds = testQueue.enqueueItems(largeArray);
533
531
  // Check uniqueness without Set
534
532
  const uniqueCheck = {};
@@ -556,7 +554,7 @@ fixtures_1.test.describe("Other Edge Cases", () => {
556
554
  allUniqueIds: true,
557
555
  });
558
556
  }));
559
- (0, fixtures_1.test)("handles nested object and complex data types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
557
+ (0, fixtures_1.test)("handles nested object and complex data types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
560
558
  const { testStateDriver } = yield initTestBed(`
561
559
  <Fragment>
562
560
  <Queue id="testQueue" onProcess="processing => testState = processing.item" />
@@ -577,7 +575,7 @@ fixtures_1.test.describe("Other Edge Cases", () => {
577
575
  (0, fixtures_1.expect)(result.nested.deep.value).toBe("test");
578
576
  (0, fixtures_1.expect)(result.array).toEqual([1, 2, { key: "value" }]);
579
577
  }));
580
- (0, fixtures_1.test)("handles rapid state changes during processing", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
578
+ (0, fixtures_1.test)("handles rapid state changes during processing", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
581
579
  const { testStateDriver } = yield initTestBed(`
582
580
  <Fragment>
583
581
  <Queue id="testQueue"
@@ -594,12 +592,12 @@ fixtures_1.test.describe("Other Edge Cases", () => {
594
592
  yield buttonDriver.component.click();
595
593
  yield fixtures_1.expect.poll(testStateDriver.testState).toBe(5);
596
594
  }));
597
- (0, fixtures_1.test)("handles context variables in templates correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
595
+ (0, fixtures_1.test)("handles context variables in templates correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver, }) {
598
596
  const { testStateDriver } = yield initTestBed(`
599
597
  <Fragment>
600
598
  <Queue id="testQueue" clearAfterFinish="false"
601
- onProcess="processing => {
602
- processing.reportProgress(processing.item);
599
+ onProcess="processing => {
600
+ processing.reportProgress(processing.item);
603
601
  testState = {
604
602
  queuedItems: testQueue.getQueuedItems().length,
605
603
  item: processing.item
@@ -620,7 +618,7 @@ fixtures_1.test.describe("Other Edge Cases", () => {
620
618
  // Verify that the queue processing works with template properties defined
621
619
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual({
622
620
  queuedItems: fixtures_1.expect.any(Number),
623
- item: fixtures_1.expect.any(String)
621
+ item: fixtures_1.expect.any(String),
624
622
  });
625
623
  }));
626
624
  });
@@ -276,7 +276,7 @@ renderProgressFeedback, renderResultFeedback, clearAfterFinish = exports.default
276
276
  return;
277
277
  }
278
278
  let queueItem = queue[0];
279
- (() => __awaiter(this, void 0, void 0, function* () {
279
+ void (() => __awaiter(this, void 0, void 0, function* () {
280
280
  yield doSingle(queueItem);
281
281
  }))();
282
282
  }, [doComplete, doSingle, prevQueue, queue]);
@@ -411,7 +411,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
411
411
  </RadioGroup>
412
412
  `);
413
413
  const labels = page.locator("label");
414
- (0, fixtures_1.expect)(labels).toHaveCount(3);
414
+ yield (0, fixtures_1.expect)(labels).toHaveCount(3);
415
415
  const { left: optionLeft } = yield (0, component_test_helpers_1.getBounds)(labels.nth(1));
416
416
  const { right: labelRight } = yield (0, component_test_helpers_1.getBounds)(labels.nth(0));
417
417
  (0, fixtures_1.expect)(labelRight).toBeLessThan(optionLeft);
@@ -424,7 +424,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
424
424
  </RadioGroup>
425
425
  `);
426
426
  const labels = page.locator("label");
427
- (0, fixtures_1.expect)(labels).toHaveCount(3);
427
+ yield (0, fixtures_1.expect)(labels).toHaveCount(3);
428
428
  const { left: optionLeft } = yield (0, component_test_helpers_1.getBounds)(labels.nth(0));
429
429
  const { right: labelRight } = yield (0, component_test_helpers_1.getBounds)(labels.nth(2));
430
430
  (0, fixtures_1.expect)(labelRight).toBeLessThan(optionLeft);
@@ -437,7 +437,7 @@ fixtures_1.test.describe("Basic Functionality", () => {
437
437
  </RadioGroup>
438
438
  `);
439
439
  const labels = page.locator("label");
440
- (0, fixtures_1.expect)(labels).toHaveCount(3);
440
+ yield (0, fixtures_1.expect)(labels).toHaveCount(3);
441
441
  const { left: optionLeft } = yield (0, component_test_helpers_1.getBounds)(labels.nth(0));
442
442
  const { right: labelRight } = yield (0, component_test_helpers_1.getBounds)(labels.nth(1));
443
443
  (0, fixtures_1.expect)(labelRight).toBeLessThan(optionLeft);
@@ -450,8 +450,8 @@ fixtures_1.test.describe("Basic Functionality", () => {
450
450
  </RadioGroup>
451
451
  `);
452
452
  const labels = page.locator("label");
453
- (0, fixtures_1.expect)(labels).toHaveCount(3);
454
- (0, fixtures_1.expect)(labels.nth(2)).toHaveText("Option 2");
453
+ yield (0, fixtures_1.expect)(labels).toHaveCount(3);
454
+ yield (0, fixtures_1.expect)(labels.nth(2)).toHaveText("Option 2");
455
455
  const { left: optionLeft } = yield (0, component_test_helpers_1.getBounds)(labels.nth(0));
456
456
  const { right: labelRight } = yield (0, component_test_helpers_1.getBounds)(labels.nth(2));
457
457
  (0, fixtures_1.expect)(optionLeft).toBeLessThan(labelRight);
@@ -76,7 +76,7 @@ class PollClient {
76
76
  this.tries = 0;
77
77
  this.abortController = new AbortController();
78
78
  // console.log("poll client: start polling", this.handlers);
79
- this.poll(this.abortController.signal);
79
+ void this.poll(this.abortController.signal);
80
80
  }
81
81
  stopPoll() {
82
82
  this.polling = false;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MultiSelectOption = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const SelectContext_1 = require("./SelectContext");
10
+ const classnames_1 = __importDefault(require("classnames"));
11
+ const Select_module_scss_1 = __importDefault(require("./Select.module.scss"));
12
+ const IconNative_1 = __importDefault(require("../Icon/IconNative"));
13
+ exports.MultiSelectOption = (0, react_1.forwardRef)(function MultiSelectOption(option, forwardedRef) {
14
+ const id = (0, react_1.useId)();
15
+ const { label, value, enabled = true, keywords, readOnly, children, isHighlighted = false, itemIndex, } = option;
16
+ const { value: selectedValue, onChange, multiSelect, setOpen, setSelectedIndex, optionRenderer, } = (0, SelectContext_1.useSelect)();
17
+ const selected = (0, react_1.useMemo)(() => {
18
+ return Array.isArray(selectedValue) && multiSelect
19
+ ? selectedValue.map((v) => String(v)).includes(value)
20
+ : String(selectedValue) === String(value);
21
+ }, [selectedValue, value, multiSelect]);
22
+ const handleClick = () => {
23
+ if (readOnly) {
24
+ setOpen(false);
25
+ return;
26
+ }
27
+ if (enabled) {
28
+ onChange(value);
29
+ }
30
+ };
31
+ return ((0, jsx_runtime_1.jsx)("div", { id: id, ref: forwardedRef, role: "option", "aria-disabled": !enabled, "aria-selected": selected, className: (0, classnames_1.default)(Select_module_scss_1.default.multiSelectOption, {
32
+ [Select_module_scss_1.default.disabledOption]: !enabled,
33
+ [Select_module_scss_1.default.highlighted]: isHighlighted,
34
+ }), onMouseDown: (e) => {
35
+ e.preventDefault();
36
+ e.stopPropagation();
37
+ }, onMouseEnter: () => {
38
+ if (itemIndex !== undefined && setSelectedIndex && enabled) {
39
+ setSelectedIndex(itemIndex);
40
+ }
41
+ }, onClick: handleClick, "data-state": selected ? "checked" : undefined, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.multiSelectOptionContent, children: optionRenderer ? (optionRenderer({ label, value, enabled, keywords }, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [children || label, selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] })) }) }));
42
+ });
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.selectComponentRenderer = exports.SelectMd = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const Select_module_scss_1 = __importDefault(require("../Select/Select.module.scss"));
8
+ const Select_module_scss_1 = __importDefault(require("./Select.module.scss"));
9
9
  const renderers_1 = require("../../components-core/renderers");
10
10
  const themeVars_1 = require("../../components-core/theming/themeVars");
11
11
  const metadata_helpers_1 = require("../metadata-helpers");
@@ -24,7 +24,7 @@ exports.SelectMd = (0, metadata_helpers_1.createMetadata)({
24
24
  initialValue: (0, metadata_helpers_1.dInitialValue)(),
25
25
  value: {
26
26
  description: "This property sets the current value of the component.",
27
- isInternal: true //TODO illesg temp
27
+ isInternal: true, //TODO illesg temp
28
28
  },
29
29
  autoFocus: Object.assign(Object.assign({}, (0, metadata_helpers_1.dAutoFocus)()), { defaultValue: SelectNative_1.defaultProps.autoFocus }),
30
30
  required: Object.assign(Object.assign({}, (0, metadata_helpers_1.dRequired)()), { defaultValue: SelectNative_1.defaultProps.required }),
@@ -103,7 +103,7 @@ exports.SelectMd = (0, metadata_helpers_1.createMetadata)({
103
103
  [`backgroundColor-${COMP}-badge--hover`]: "$color-primary-400",
104
104
  [`backgroundColor-${COMP}-badge--active`]: "$color-primary-500",
105
105
  [`textColor-item-${COMP}--disabled`]: "$color-surface-200",
106
- [`textColor-${COMP}-badge`]: "$color-surface-50",
106
+ [`textColor-${COMP}-badge`]: "$const-color-surface-50",
107
107
  [`backgroundColor-item-${COMP}`]: "$backgroundColor-dropdown-item",
108
108
  [`backgroundColor-item-${COMP}--hover`]: "$backgroundColor-dropdown-item--hover",
109
109
  [`backgroundColor-item-${COMP}--active`]: "$backgroundColor-dropdown-item--active",