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
|
@@ -145,77 +145,36 @@ class StyleParser {
|
|
|
145
145
|
const themeIdNode = this.tryThemeId();
|
|
146
146
|
if (themeIdNode)
|
|
147
147
|
return themeIdNode;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return this.createNode("Color", {
|
|
153
|
-
value: startToken.text.toLowerCase(),
|
|
154
|
-
}, startToken);
|
|
155
|
-
case tokens_1.StyleTokenType.HexaColor:
|
|
156
|
-
this._lexer.get();
|
|
157
|
-
return this.createNode("Color", {
|
|
158
|
-
value: startToken.text,
|
|
159
|
-
}, startToken);
|
|
160
|
-
case tokens_1.StyleTokenType.ColorFunc:
|
|
161
|
-
let success = false;
|
|
162
|
-
switch (startToken.text) {
|
|
163
|
-
case "rgb":
|
|
164
|
-
success = parseColorParameters(["V%", "V%", "V%"]);
|
|
165
|
-
break;
|
|
166
|
-
case "rgba":
|
|
167
|
-
success = parseColorParameters(["V%", "V%", "V%", "alpha"]);
|
|
168
|
-
break;
|
|
169
|
-
case "hsl":
|
|
170
|
-
success = parseColorParameters(["angle", "%", "%"]);
|
|
171
|
-
break;
|
|
172
|
-
case "hsla":
|
|
173
|
-
success = parseColorParameters(["angle", "%", "%", "alpha"]);
|
|
174
|
-
break;
|
|
175
|
-
default:
|
|
176
|
-
this.reportError("S006", startToken, startToken.text);
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
if (success) {
|
|
180
|
-
return {
|
|
181
|
-
type: "Color",
|
|
182
|
-
startPosition: startToken.start,
|
|
183
|
-
endPosition: this._lexer.peek().start,
|
|
184
|
-
value: this.getSource(startToken, this._lexer.peek()),
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
return null;
|
|
188
|
-
default:
|
|
189
|
-
this.reportError("S005", startToken);
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
function parseColorParameters(pars) {
|
|
148
|
+
/**
|
|
149
|
+
* Parses color function parameters
|
|
150
|
+
*/
|
|
151
|
+
const parseColorParameters = (pars) => {
|
|
193
152
|
// --- Skip the color function name token
|
|
194
|
-
|
|
153
|
+
this._lexer.get();
|
|
195
154
|
// --- Expect "("
|
|
196
|
-
|
|
155
|
+
this.expectToken(tokens_1.StyleTokenType.LParent, "S007");
|
|
197
156
|
// --- Iterate through pars
|
|
198
157
|
for (let i = 0; i < pars.length; i++) {
|
|
199
158
|
// --- Get the parameter value
|
|
200
|
-
const value =
|
|
159
|
+
const value = this.getNumber();
|
|
201
160
|
if (value === null)
|
|
202
161
|
return false;
|
|
203
162
|
// --- Get optional parameter unit
|
|
204
|
-
const unit =
|
|
163
|
+
const unit = this._lexer.peek(true);
|
|
205
164
|
// --- Process the value & unit
|
|
206
165
|
switch (pars[i]) {
|
|
207
166
|
// 0-255 or 0%-100%
|
|
208
167
|
case "V%":
|
|
209
168
|
if (unit.type === tokens_1.StyleTokenType.Percentage) {
|
|
210
169
|
if (value < 0 || value > 100) {
|
|
211
|
-
|
|
170
|
+
this.reportError("S008");
|
|
212
171
|
return false;
|
|
213
172
|
}
|
|
214
|
-
|
|
173
|
+
this._lexer.get();
|
|
215
174
|
}
|
|
216
175
|
else {
|
|
217
176
|
if (value < 0 || value > 255) {
|
|
218
|
-
|
|
177
|
+
this.reportError("S009");
|
|
219
178
|
return false;
|
|
220
179
|
}
|
|
221
180
|
}
|
|
@@ -223,28 +182,28 @@ class StyleParser {
|
|
|
223
182
|
// 0%-100%
|
|
224
183
|
case "%":
|
|
225
184
|
if (unit.type !== tokens_1.StyleTokenType.Percentage || value < 0 || value > 100) {
|
|
226
|
-
|
|
185
|
+
this.reportError("S008");
|
|
227
186
|
return false;
|
|
228
187
|
}
|
|
229
|
-
|
|
188
|
+
this._lexer.get();
|
|
230
189
|
break;
|
|
231
190
|
case "angle":
|
|
232
191
|
if (unit.type === tokens_1.StyleTokenType.Angle) {
|
|
233
|
-
|
|
192
|
+
this._lexer.get();
|
|
234
193
|
}
|
|
235
194
|
break;
|
|
236
195
|
// alpha with units
|
|
237
196
|
case "alpha":
|
|
238
197
|
if (unit.type === tokens_1.StyleTokenType.Percentage) {
|
|
239
198
|
if (value < 0 || value > 100) {
|
|
240
|
-
|
|
199
|
+
this.reportError("S008");
|
|
241
200
|
return false;
|
|
242
201
|
}
|
|
243
|
-
|
|
202
|
+
this._lexer.get();
|
|
244
203
|
}
|
|
245
204
|
else {
|
|
246
205
|
if (value < 0 || value > 1) {
|
|
247
|
-
|
|
206
|
+
this.reportError("S011");
|
|
248
207
|
return false;
|
|
249
208
|
}
|
|
250
209
|
}
|
|
@@ -254,30 +213,73 @@ class StyleParser {
|
|
|
254
213
|
if (i === pars.length - 1)
|
|
255
214
|
continue;
|
|
256
215
|
// --- Process the separator
|
|
257
|
-
let sepToken =
|
|
216
|
+
let sepToken = this._lexer.peek(true);
|
|
258
217
|
if (sepToken.type === tokens_1.StyleTokenType.Ws) {
|
|
259
|
-
|
|
260
|
-
sepToken =
|
|
218
|
+
this._lexer.get();
|
|
219
|
+
sepToken = this._lexer.peek(true);
|
|
261
220
|
if (sepToken.type === tokens_1.StyleTokenType.Comma) {
|
|
262
|
-
|
|
221
|
+
this._lexer.get();
|
|
263
222
|
}
|
|
264
223
|
}
|
|
265
224
|
else {
|
|
266
|
-
|
|
225
|
+
this.expectToken(tokens_1.StyleTokenType.Comma);
|
|
267
226
|
}
|
|
268
|
-
sepToken =
|
|
227
|
+
sepToken = this._lexer.peek();
|
|
269
228
|
if (sepToken.type === tokens_1.StyleTokenType.Ws) {
|
|
270
|
-
|
|
229
|
+
this._lexer.get();
|
|
271
230
|
}
|
|
272
231
|
}
|
|
273
232
|
// --- Process the optional separator
|
|
274
|
-
let aSepToken =
|
|
233
|
+
let aSepToken = this._lexer.peek();
|
|
275
234
|
if (aSepToken.type === tokens_1.StyleTokenType.Ws) {
|
|
276
|
-
|
|
235
|
+
this._lexer.get();
|
|
277
236
|
}
|
|
278
237
|
// --- Expect ")"
|
|
279
|
-
|
|
238
|
+
this.expectToken(tokens_1.StyleTokenType.RParent, "S010");
|
|
280
239
|
return true;
|
|
240
|
+
};
|
|
241
|
+
switch (startToken.type) {
|
|
242
|
+
case tokens_1.StyleTokenType.ColorName:
|
|
243
|
+
this._lexer.get();
|
|
244
|
+
return this.createNode("Color", {
|
|
245
|
+
value: startToken.text.toLowerCase(),
|
|
246
|
+
}, startToken);
|
|
247
|
+
case tokens_1.StyleTokenType.HexaColor:
|
|
248
|
+
this._lexer.get();
|
|
249
|
+
return this.createNode("Color", {
|
|
250
|
+
value: startToken.text,
|
|
251
|
+
}, startToken);
|
|
252
|
+
case tokens_1.StyleTokenType.ColorFunc:
|
|
253
|
+
let success = false;
|
|
254
|
+
switch (startToken.text) {
|
|
255
|
+
case "rgb":
|
|
256
|
+
success = parseColorParameters(["V%", "V%", "V%"]);
|
|
257
|
+
break;
|
|
258
|
+
case "rgba":
|
|
259
|
+
success = parseColorParameters(["V%", "V%", "V%", "alpha"]);
|
|
260
|
+
break;
|
|
261
|
+
case "hsl":
|
|
262
|
+
success = parseColorParameters(["angle", "%", "%"]);
|
|
263
|
+
break;
|
|
264
|
+
case "hsla":
|
|
265
|
+
success = parseColorParameters(["angle", "%", "%", "alpha"]);
|
|
266
|
+
break;
|
|
267
|
+
default:
|
|
268
|
+
this.reportError("S006", startToken, startToken.text);
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
if (success) {
|
|
272
|
+
return {
|
|
273
|
+
type: "Color",
|
|
274
|
+
startPosition: startToken.start,
|
|
275
|
+
endPosition: this._lexer.peek().start,
|
|
276
|
+
value: this.getSource(startToken, this._lexer.peek()),
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
return null;
|
|
280
|
+
default:
|
|
281
|
+
this.reportError("S005", startToken);
|
|
282
|
+
return null;
|
|
281
283
|
}
|
|
282
284
|
}
|
|
283
285
|
getNumber() {
|
|
@@ -55,9 +55,7 @@ class ComponentDriver {
|
|
|
55
55
|
* Gets the html tag name of the final rendered component
|
|
56
56
|
*/
|
|
57
57
|
getComponentTagName() {
|
|
58
|
-
return
|
|
59
|
-
return this.component.evaluate((el) => el.tagName.toLowerCase());
|
|
60
|
-
});
|
|
58
|
+
return this.component.evaluate((el) => el.tagName.toLowerCase());
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
exports.ComponentDriver = ComponentDriver;
|
|
@@ -269,17 +267,13 @@ class SplitterDriver extends ComponentDriver {
|
|
|
269
267
|
* Gets the primary panel element
|
|
270
268
|
*/
|
|
271
269
|
getPrimaryPanel() {
|
|
272
|
-
return
|
|
273
|
-
return this.locator.locator('[class*="primaryPanel"]').first();
|
|
274
|
-
});
|
|
270
|
+
return this.locator.locator('[class*="primaryPanel"]').first();
|
|
275
271
|
}
|
|
276
272
|
/**
|
|
277
273
|
* Gets the secondary panel element
|
|
278
274
|
*/
|
|
279
275
|
getSecondaryPanel() {
|
|
280
|
-
return
|
|
281
|
-
return this.locator.locator('[class*="secondaryPanel"]').first();
|
|
282
|
-
});
|
|
276
|
+
return this.locator.locator('[class*="secondaryPanel"]').first();
|
|
283
277
|
}
|
|
284
278
|
}
|
|
285
279
|
exports.SplitterDriver = SplitterDriver;
|
|
@@ -553,20 +547,16 @@ class FormDriver extends ComponentDriver {
|
|
|
553
547
|
return requestPromise;
|
|
554
548
|
});
|
|
555
549
|
}
|
|
556
|
-
getSubmitResponse() {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
return responsePromise;
|
|
560
|
-
});
|
|
550
|
+
getSubmitResponse(endpoint = "/entities", responseStatus = 200, timeout = 5000) {
|
|
551
|
+
const responsePromise = this.page.waitForResponse((response) => response.url().includes(endpoint) && response.status() === responseStatus, { timeout });
|
|
552
|
+
return responsePromise;
|
|
561
553
|
}
|
|
562
554
|
/**
|
|
563
555
|
* Gets the validation summary component inside the Form.
|
|
564
556
|
* Uses the 'data-validation-summary' attribute to find the component
|
|
565
557
|
*/
|
|
566
558
|
getValidationSummary() {
|
|
567
|
-
return
|
|
568
|
-
return this.component.locator("[data-validation-summary='true']");
|
|
569
|
-
});
|
|
559
|
+
return this.component.locator("[data-validation-summary='true']");
|
|
570
560
|
}
|
|
571
561
|
/**
|
|
572
562
|
* Gets the validation display components inside the Form.
|
|
@@ -574,18 +564,14 @@ class FormDriver extends ComponentDriver {
|
|
|
574
564
|
* The attribute contains the severity of the validation.
|
|
575
565
|
*/
|
|
576
566
|
getValidationDisplays() {
|
|
577
|
-
return
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
.locator("[data-validation-display-severity]");
|
|
581
|
-
});
|
|
567
|
+
return this.component
|
|
568
|
+
.locator("[data-validation-summary='true']")
|
|
569
|
+
.locator("[data-validation-display-severity]");
|
|
582
570
|
}
|
|
583
571
|
getValidationDisplaysBySeverity(severity) {
|
|
584
|
-
return
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
.locator(`[data-validation-display-severity="${severity}"]`);
|
|
588
|
-
});
|
|
572
|
+
return this.component
|
|
573
|
+
.locator("[data-validation-summary='true']")
|
|
574
|
+
.locator(`[data-validation-display-severity="${severity}"]`);
|
|
589
575
|
}
|
|
590
576
|
}
|
|
591
577
|
exports.FormDriver = FormDriver;
|
|
@@ -597,25 +583,19 @@ class ValidationSummaryDriver extends ComponentDriver {
|
|
|
597
583
|
* The attribute contains the severity of the validation.
|
|
598
584
|
*/
|
|
599
585
|
getValidationDisplays() {
|
|
600
|
-
return
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
.locator("[data-validation-display-severity]");
|
|
604
|
-
});
|
|
586
|
+
return this.component
|
|
587
|
+
.locator("[data-validation-summary='true']")
|
|
588
|
+
.locator("[data-validation-display-severity]");
|
|
605
589
|
}
|
|
606
590
|
}
|
|
607
591
|
exports.ValidationSummaryDriver = ValidationSummaryDriver;
|
|
608
592
|
// --- ValidationDisplay
|
|
609
593
|
class ValidationDisplayDriver extends ComponentDriver {
|
|
610
594
|
getSeverity() {
|
|
611
|
-
return
|
|
612
|
-
return this.component.getAttribute("data-validation-display-severity");
|
|
613
|
-
});
|
|
595
|
+
return this.component.getAttribute("data-validation-display-severity");
|
|
614
596
|
}
|
|
615
597
|
getText() {
|
|
616
|
-
return
|
|
617
|
-
return this.component.locator("li").textContent();
|
|
618
|
-
});
|
|
598
|
+
return this.component.locator("li").textContent();
|
|
619
599
|
}
|
|
620
600
|
}
|
|
621
601
|
exports.ValidationDisplayDriver = ValidationDisplayDriver;
|
|
@@ -1376,7 +1356,8 @@ class SliderDriver extends ComponentDriver {
|
|
|
1376
1356
|
else if (location === "end") {
|
|
1377
1357
|
targetX = trackBox.x + trackBox.width;
|
|
1378
1358
|
}
|
|
1379
|
-
else {
|
|
1359
|
+
else {
|
|
1360
|
+
// middle
|
|
1380
1361
|
targetX = trackBox.x + trackBox.width / 2;
|
|
1381
1362
|
}
|
|
1382
1363
|
const targetY = trackBox.y + trackBox.height / 2;
|
|
@@ -50,9 +50,7 @@ function mapObject(obj, valFn = ((val) => val), keyFn = ((val) => val)) {
|
|
|
50
50
|
return newObject;
|
|
51
51
|
}
|
|
52
52
|
function getComponentTagName(locator) {
|
|
53
|
-
return
|
|
54
|
-
return locator.evaluate((el) => el.tagName.toLowerCase());
|
|
55
|
-
});
|
|
53
|
+
return locator.evaluate((el) => el.tagName.toLowerCase());
|
|
56
54
|
}
|
|
57
55
|
function parseComponentIfNecessary(rawComponent) {
|
|
58
56
|
if (typeof rawComponent === "string") {
|
|
@@ -78,33 +76,25 @@ function scaleByPercent(scalarOf100Percent, percentage) {
|
|
|
78
76
|
return (scalarOf100Percent / 100) * parsed.value;
|
|
79
77
|
}
|
|
80
78
|
function getBoundingRect(locator) {
|
|
81
|
-
return
|
|
82
|
-
return locator.evaluate((element) => element.getBoundingClientRect());
|
|
83
|
-
});
|
|
79
|
+
return locator.evaluate((element) => element.getBoundingClientRect());
|
|
84
80
|
}
|
|
85
81
|
function getElementStyle(specifier, style) {
|
|
86
|
-
return
|
|
87
|
-
return specifier.evaluate((element, style) => window.getComputedStyle(element).getPropertyValue(style), style);
|
|
88
|
-
});
|
|
82
|
+
return specifier.evaluate((element, style) => window.getComputedStyle(element).getPropertyValue(style), style);
|
|
89
83
|
}
|
|
90
84
|
/**
|
|
91
85
|
* Retreives all the provided style properties from the locator
|
|
92
86
|
* @returns an object with the keys being the elements of the styles argument
|
|
93
87
|
*/
|
|
94
|
-
function getElementStyles(
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
])), styles);
|
|
100
|
-
});
|
|
88
|
+
function getElementStyles(locator, styles = []) {
|
|
89
|
+
return locator.evaluate((element, styles) => Object.fromEntries(styles.map((styleName) => [
|
|
90
|
+
styleName,
|
|
91
|
+
window.getComputedStyle(element).getPropertyValue(styleName),
|
|
92
|
+
])), styles);
|
|
101
93
|
}
|
|
102
94
|
function isIndeterminate(specifier) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return specifier.evaluate((el) => el.indeterminate);
|
|
107
|
-
});
|
|
95
|
+
if (specifier instanceof ComponentDrivers_1.ComponentDriver)
|
|
96
|
+
specifier = specifier.component;
|
|
97
|
+
return specifier.evaluate((el) => el.indeterminate);
|
|
108
98
|
}
|
|
109
99
|
function overflows(locator_1) {
|
|
110
100
|
return __awaiter(this, arguments, void 0, function* (locator, direction = "both") {
|
|
@@ -125,34 +115,30 @@ function overflows(locator_1) {
|
|
|
125
115
|
// ComponentDriver style helpers
|
|
126
116
|
// ----------------------------------
|
|
127
117
|
function getStyles(specifier, style) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
])), style);
|
|
140
|
-
});
|
|
118
|
+
if (specifier instanceof ComponentDrivers_1.ComponentDriver)
|
|
119
|
+
specifier = specifier.component;
|
|
120
|
+
style = Array.isArray(style) ? style : [style];
|
|
121
|
+
return specifier.evaluate((element, styles) => Object.fromEntries(styles.map((styleName) => [
|
|
122
|
+
styleName
|
|
123
|
+
.trim()
|
|
124
|
+
.split("-")
|
|
125
|
+
.map((n, idx) => (idx === 0 ? n : n[0].toUpperCase() + n.slice(1)))
|
|
126
|
+
.join(""),
|
|
127
|
+
window.getComputedStyle(element).getPropertyValue(styleName),
|
|
128
|
+
])), style);
|
|
141
129
|
}
|
|
142
130
|
function getPseudoStyles(specifier, pseudoElement, style) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
])), { style, pseudoElement });
|
|
155
|
-
});
|
|
131
|
+
if (specifier instanceof ComponentDrivers_1.ComponentDriver)
|
|
132
|
+
specifier = specifier.component;
|
|
133
|
+
style = Array.isArray(style) ? style : [style];
|
|
134
|
+
return specifier.evaluate((element, obj) => Object.fromEntries(obj.style.map((styleName) => [
|
|
135
|
+
styleName
|
|
136
|
+
.trim()
|
|
137
|
+
.split("-")
|
|
138
|
+
.map((n, idx) => (idx === 0 ? n : n[0].toUpperCase() + n.slice(1)))
|
|
139
|
+
.join(""),
|
|
140
|
+
window.getComputedStyle(element, obj.pseudoElement).getPropertyValue(styleName),
|
|
141
|
+
])), { style, pseudoElement });
|
|
156
142
|
}
|
|
157
143
|
function getHtmlAttributes(specifier, attributes) {
|
|
158
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -188,9 +174,7 @@ function getBorders(specifier) {
|
|
|
188
174
|
});
|
|
189
175
|
}
|
|
190
176
|
function getMargins(specifier) {
|
|
191
|
-
return
|
|
192
|
-
return getStyles(specifier, ["margin-left", "margin-right", "margin-top", "margin-bottom"]);
|
|
193
|
-
});
|
|
177
|
+
return getStyles(specifier, ["margin-left", "margin-right", "margin-top", "margin-bottom"]);
|
|
194
178
|
}
|
|
195
179
|
/**
|
|
196
180
|
* Retrieves the bounding rectangle of the component including **margins** and **padding**
|