xmlui 0.10.19 → 0.10.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{apiInterceptorWorker-DPgtUtdA.mjs → apiInterceptorWorker-QiltRtq1.mjs} +1 -1
- package/dist/lib/{index-cuh97e2e.mjs → index-BiS4wEuu.mjs} +1486 -1211
- package/dist/lib/index.css +1 -1
- package/dist/{metadata/initMock-C-cnv--V.mjs → lib/initMock-CB_cMi6U.mjs} +25 -15
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-CtY0QcvH.mjs → metadata-utils-BTIt1_wE.mjs} +1 -1
- package/dist/lib/{server-common-Cine5nRR.mjs → server-common-DYZtsdM7.mjs} +51 -14
- package/dist/lib/{transform-bHBjkKSL.mjs → transform-Tooy42EB.mjs} +16 -18
- package/dist/lib/xmlui-parser.mjs +2 -2
- package/dist/lib/{xmlui-serializer-DB6BLiXK.mjs → xmlui-serializer-uCYa8_tZ.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +11 -3
- package/dist/lib/xmlui.mjs +2 -2
- package/dist/metadata/{apiInterceptorWorker-BmKP8bnq.mjs → apiInterceptorWorker-Dql7QGw2.mjs} +1 -1
- package/dist/metadata/{collectedComponentMetadata-Cp-9lpnG.mjs → collectedComponentMetadata-MFUg6aSX.mjs} +1655 -1390
- package/dist/{lib/initMock-BMxsanHc.mjs → metadata/initMock-Dw9wrVkQ.mjs} +25 -15
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +3 -3
- package/dist/scripts/package.json +3 -6
- package/dist/scripts/src/components/Animation/AnimationNative.js +28 -28
- package/dist/scripts/src/components/App/App.js +4 -4
- package/dist/scripts/src/components/App/App.spec.js +17 -17
- package/dist/scripts/src/components/App/AppNative.js +1 -1
- package/dist/scripts/src/components/AppState/AppState.js +3 -2
- package/dist/scripts/src/components/AppState/AppState.spec.js +26 -2
- package/dist/scripts/src/components/AppState/AppStateNative.js +3 -4
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +15 -10
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +4 -4
- package/dist/scripts/src/components/Carousel/Carousel.spec.js +214 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +2 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +193 -0
- package/dist/scripts/src/components/DateInput/DateInput.spec.js +6 -6
- package/dist/scripts/src/components/DateInput/DateInputNative.js +0 -1
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +3 -3
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +4 -13
- package/dist/scripts/src/components/Form/Form.spec.js +25 -9
- package/dist/scripts/src/components/Form/FormNative.js +7 -5
- package/dist/scripts/src/components/FormItem/FormItem.js +3 -1
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +5 -14
- package/dist/scripts/src/components/FormItem/FormItemNative.js +12 -8
- package/dist/scripts/src/components/FormItem/Validations.js +2 -2
- package/dist/scripts/src/components/IFrame/IFrameNative.js +0 -2
- package/dist/scripts/src/components/IconRegistryContext.js +1 -1
- package/dist/scripts/src/components/List/ListNative.js +2 -2
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +3 -12
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +6 -3
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +1 -1
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +3 -3
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +2 -2
- package/dist/scripts/src/components/Pagination/Pagination.spec.js +5 -0
- package/dist/scripts/src/components/Pagination/PaginationNative.js +1 -3
- package/dist/scripts/src/components/Queue/Queue.spec.js +45 -47
- package/dist/scripts/src/components/Queue/QueueNative.js +1 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +5 -5
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +1 -1
- package/dist/scripts/src/components/Select/MultiSelectOption.js +42 -0
- package/dist/scripts/src/components/Select/Select.js +3 -3
- package/dist/scripts/src/components/Select/SelectContext.js +8 -1
- package/dist/scripts/src/components/Select/SelectNative.js +134 -142
- package/dist/scripts/src/components/Select/SelectOption.js +34 -0
- package/dist/scripts/src/components/Select/SimpleSelect.js +57 -0
- package/dist/scripts/src/components/Spinner/Spinner.spec.js +1 -1
- package/dist/scripts/src/components/Table/useRowSelection.js +14 -23
- package/dist/scripts/src/components/Text/Text.js +5 -1
- package/dist/scripts/src/components/Text/Text.spec.js +317 -0
- package/dist/scripts/src/components/Text/TextNative.js +112 -1
- package/dist/scripts/src/components/TextArea/TextArea.spec.js +8 -8
- package/dist/scripts/src/components/Theme/Theme.js +2 -1
- package/dist/scripts/src/components/Theme/Theme.spec.js +266 -0
- package/dist/scripts/src/components/Theme/ThemeNative.js +8 -1
- package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +3 -3
- package/dist/scripts/src/components/TimeInput/TimeInputNative.js +0 -1
- package/dist/scripts/src/components/Timer/TimerNative.js +0 -1
- package/dist/scripts/src/components/Tree/TreeNative.js +16 -23
- package/dist/scripts/src/components-core/InspectorContext.js +1 -1
- package/dist/scripts/src/components-core/StandaloneApp.js +6 -8
- package/dist/scripts/src/components-core/action/FileUploadAction.js +1 -1
- package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +50 -0
- package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +6 -1
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +9 -11
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +3 -3
- package/dist/scripts/src/components-core/interception/Backend.js +1 -1
- package/dist/scripts/src/components-core/interception/IndexedDb.js +64 -66
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +2 -2
- package/dist/scripts/src/components-core/loader/DataLoader.js +6 -14
- package/dist/scripts/src/components-core/loader/Loader.js +11 -11
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +4 -2
- package/dist/scripts/src/components-core/loader/PageableLoader.js +10 -9
- package/dist/scripts/src/components-core/rendering/AppContent.js +1 -7
- package/dist/scripts/src/components-core/rendering/ErrorBoundary.js +1 -1
- package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +180 -186
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +6 -6
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +2 -2
- package/dist/scripts/src/components-core/utils/actionUtils.js +1 -1
- package/dist/scripts/src/components-core/utils/hooks.js +1 -1
- package/dist/scripts/src/components-core/utils/misc.js +4 -4
- package/dist/scripts/src/components-core/xmlui-parser.js +47 -31
- package/dist/scripts/src/language-server/server-common.js +25 -24
- package/dist/scripts/src/language-server/services/common/lsp-utils.js +2 -2
- package/dist/scripts/src/language-server/services/completion.js +20 -2
- package/dist/scripts/src/language-server/services/diagnostic.js +1 -1
- package/dist/scripts/src/language-server/services/hover.js +2 -2
- package/dist/scripts/src/parsers/common/utils.js +2 -2
- package/dist/scripts/src/parsers/scripting/Lexer.js +21 -15
- package/dist/scripts/src/parsers/scripting/Parser.js +8 -9
- package/dist/scripts/src/parsers/style-parser/StyleLexer.js +22 -22
- package/dist/scripts/src/parsers/style-parser/StyleParser.js +70 -68
- package/dist/scripts/src/testing/ComponentDrivers.js +20 -39
- package/dist/scripts/src/testing/component-test-helpers.js +34 -50
- package/dist/scripts/src/testing/fixtures.js +114 -113
- package/dist/scripts/src/testing/themed-app-test-helpers.js +7 -13
- package/dist/standalone/xmlui-standalone.es.d.ts +11 -3
- package/dist/standalone/xmlui-standalone.umd.js +35 -35
- package/package.json +3 -6
|
@@ -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
|
-
|
|
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
|
|
516
|
-
|
|
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("
|
|
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",
|
|
@@ -3,7 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SelectContext = void 0;
|
|
4
4
|
exports.useSelect = useSelect;
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
exports.SelectContext = (0, react_1.createContext)(
|
|
6
|
+
exports.SelectContext = (0, react_1.createContext)({
|
|
7
|
+
value: null,
|
|
8
|
+
onChange: (selectedValue) => { },
|
|
9
|
+
setOpen: (open) => { },
|
|
10
|
+
setSelectedIndex: (index) => { },
|
|
11
|
+
options: new Set(),
|
|
12
|
+
optionRenderer: undefined,
|
|
13
|
+
});
|
|
7
14
|
function useSelect() {
|
|
8
15
|
return (0, react_1.useContext)(exports.SelectContext);
|
|
9
16
|
}
|