@heartlandone/vega 1.16.0 → 1.17.1
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/cjs/{app-globals-b9723b6b.js → app-globals-cb59b473.js} +10 -3
- package/dist/cjs/{component-9c17467b.js → component-a52a29b6.js} +2 -0
- package/dist/cjs/index-0ca30e90.js +4 -0
- package/dist/cjs/index.cjs.js +5 -3
- package/dist/cjs/{requiredFieldRule-57bbf43a.js → injectFormFieldController-4aaae7a2.js} +4 -86
- package/dist/cjs/{keyboardManager-6209b24e.js → keyboardManager-eb2a098c.js} +23 -7
- package/dist/cjs/loader.cjs.js +7 -4
- package/dist/cjs/minNumberRule-686c22a7.js +138 -0
- package/dist/cjs/requiredFieldRule-84e0f9b1.js +83 -0
- package/dist/cjs/{ui-3391390f.js → ui-67d89fc1.js} +32 -0
- package/dist/cjs/vega-accordion.cjs.entry.js +2 -2
- package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
- package/dist/cjs/vega-app-header-button.cjs.entry.js +2 -2
- package/dist/cjs/vega-badge.cjs.entry.js +2 -2
- package/dist/cjs/vega-banner_26.cjs.entry.js +66 -282
- package/dist/cjs/vega-card.cjs.entry.js +2 -2
- package/dist/cjs/vega-checkbox-group.cjs.entry.js +8 -7
- package/dist/cjs/vega-chip.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-picker.cjs.entry.js +6 -5
- package/dist/cjs/vega-combo-box.cjs.entry.js +14 -11
- package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
- package/dist/cjs/vega-form.cjs.entry.js +2 -2
- package/dist/cjs/vega-header.cjs.entry.js +1 -1
- package/dist/cjs/vega-image-uploader.cjs.entry.js +5 -4
- package/dist/cjs/vega-item-toggle.cjs.entry.js +1 -1
- package/dist/cjs/vega-loading-indicator.cjs.entry.js +2 -2
- package/dist/cjs/vega-option.cjs.entry.js +1 -1
- package/dist/cjs/vega-page-notification.cjs.entry.js +79 -0
- package/dist/cjs/vega-radio-group.cjs.entry.js +5 -4
- package/dist/cjs/vega-radio.cjs.entry.js +1 -1
- package/dist/cjs/vega-stepper.cjs.entry.js +61 -31
- package/dist/cjs/vega-text.cjs.entry.js +101 -9
- package/dist/cjs/vega-textarea.cjs.entry.js +6 -5
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +1 -1
- package/dist/cjs/vega.cjs.js +7 -4
- package/dist/cjs/vegaNotifyController-d4c4bd42.js +166 -0
- package/dist/cjs/zIndexManager-92ab41c7.js +108 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/vega-carousel/vega-carousel.js +29 -3
- package/dist/collection/components/vega-chip/vega-chip.js +2 -1
- package/dist/collection/components/vega-color-picker/vega-color-picker.js +1 -1
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +5 -3
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +2 -2
- package/dist/collection/components/vega-page-notification/vega-page-notification.js +214 -0
- package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +1 -1
- package/dist/collection/components/vega-stepper/vega-stepper.js +76 -65
- package/dist/collection/components/vega-text/vega-text.css +5 -1
- package/dist/collection/components/vega-text/vega-text.js +103 -28
- package/dist/collection/components/vega-textarea/vega-textarea.js +1 -1
- package/dist/collection/components/vega-time-picker/vega-time-picker.js +4 -5
- package/dist/collection/global/scripts/beforeVegaLoad.js +9 -1
- package/dist/collection/helpers/notify/tests/vegaNotifyController.test.js +92 -0
- package/dist/collection/helpers/notify/vegaNotifyController.js +85 -0
- package/dist/collection/helpers/publicApi.js +1 -0
- package/dist/collection/helpers/touch-helper/touchListener.js +15 -7
- package/dist/collection/helpers/validator/formFieldController.js +3 -4
- package/dist/collection/utils/component.js +2 -0
- package/dist/collection/utils/keyboardManager.js +22 -6
- package/dist/collection/utils/test/keyboardManager.test.js +12 -8
- package/dist/collection/utils/test/ui.test.js +42 -1
- package/dist/collection/utils/ui.js +29 -0
- package/dist/esm/{app-globals-c7644419.js → app-globals-82552493.js} +9 -2
- package/dist/esm/{component-5d5dc181.js → component-328d28e4.js} +2 -0
- package/dist/esm/index-15c74515.js +4 -0
- package/dist/esm/index.js +3 -2
- package/dist/esm/{requiredFieldRule-a7bc07e4.js → injectFormFieldController-083f867c.js} +5 -86
- package/dist/esm/{keyboardManager-84fb365b.js → keyboardManager-9d0334ae.js} +23 -7
- package/dist/esm/loader.js +7 -4
- package/dist/esm/minNumberRule-9fdcf276.js +135 -0
- package/dist/esm/requiredFieldRule-3effaf8b.js +81 -0
- package/dist/esm/{ui-e1ffc577.js → ui-70e9d014.js} +31 -1
- package/dist/esm/vega-accordion.entry.js +2 -2
- package/dist/esm/vega-app-footer.entry.js +1 -1
- package/dist/esm/vega-app-header-button.entry.js +2 -2
- package/dist/esm/vega-badge.entry.js +2 -2
- package/dist/esm/vega-banner_26.entry.js +59 -275
- package/dist/esm/vega-card.entry.js +2 -2
- package/dist/esm/vega-checkbox-group.entry.js +7 -6
- package/dist/esm/vega-chip.entry.js +3 -3
- package/dist/esm/vega-color-picker.entry.js +5 -4
- package/dist/esm/vega-combo-box.entry.js +13 -10
- package/dist/esm/vega-counter-badge.entry.js +1 -1
- package/dist/esm/vega-form.entry.js +2 -2
- package/dist/esm/vega-header.entry.js +1 -1
- package/dist/esm/vega-image-uploader.entry.js +4 -3
- package/dist/esm/vega-item-toggle.entry.js +1 -1
- package/dist/esm/vega-loading-indicator.entry.js +2 -2
- package/dist/esm/vega-option.entry.js +1 -1
- package/dist/esm/vega-page-notification.entry.js +75 -0
- package/dist/esm/vega-radio-group.entry.js +4 -3
- package/dist/esm/vega-radio.entry.js +1 -1
- package/dist/esm/vega-stepper.entry.js +62 -32
- package/dist/esm/vega-text.entry.js +101 -9
- package/dist/esm/vega-textarea.entry.js +5 -4
- package/dist/esm/vega-toggle-switch.entry.js +1 -1
- package/dist/esm/vega.js +7 -4
- package/dist/esm/vegaNotifyController-aff65edf.js +163 -0
- package/dist/esm/zIndexManager-63427679.js +106 -0
- package/dist/types/components/vega-carousel/vega-carousel.d.ts +4 -1
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +1 -1
- package/dist/types/components/vega-page-notification/vega-page-notification.d.ts +35 -0
- package/dist/types/components/vega-stepper/vega-stepper.d.ts +15 -13
- package/dist/types/components/vega-text/vega-text.d.ts +40 -5
- package/dist/types/components.d.ts +87 -21
- package/dist/types/helpers/notify/tests/vegaNotifyController.test.d.ts +1 -0
- package/dist/types/helpers/notify/vegaNotify.d.ts +13 -0
- package/dist/types/helpers/notify/vegaNotifyController.d.ts +40 -0
- package/dist/types/helpers/publicApi.d.ts +1 -0
- package/dist/types/helpers/touch-helper/touchListener.d.ts +6 -1
- package/dist/types/types/publicApi.d.ts +1 -0
- package/dist/types/utils/keyboardManager.d.ts +11 -1
- package/dist/types/utils/ui.d.ts +17 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-0298ee11.js +1 -0
- package/dist/vega/p-1d93daa9.entry.js +1 -0
- package/dist/vega/{p-61a288d0.entry.js → p-23fa07fd.entry.js} +1 -1
- package/dist/vega/p-26fef51f.entry.js +1 -0
- package/dist/vega/p-278284a8.entry.js +13 -0
- package/dist/vega/p-2a1f3d3a.entry.js +1 -0
- package/dist/vega/p-2e16ed6b.js +1 -0
- package/dist/vega/{p-e0e75cb6.entry.js → p-38654f10.entry.js} +1 -1
- package/dist/vega/{p-e7fb9490.entry.js → p-3e2612a7.entry.js} +1 -1
- package/dist/vega/{p-286328d5.entry.js → p-3fb45a4c.entry.js} +1 -1
- package/dist/vega/p-45a7d22d.js +1 -0
- package/dist/vega/p-5a1e5d51.js +1 -0
- package/dist/vega/p-5de3ade6.entry.js +1 -0
- package/dist/vega/{p-0a24610e.entry.js → p-5de4bf41.entry.js} +1 -1
- package/dist/vega/{p-57b19a9a.entry.js → p-605d12c1.entry.js} +1 -1
- package/dist/vega/{p-57c09588.entry.js → p-6df61496.entry.js} +1 -1
- package/dist/vega/{p-d7df6266.entry.js → p-6f23e0d2.entry.js} +1 -1
- package/dist/vega/{p-f05c4b13.entry.js → p-89ebd511.entry.js} +1 -1
- package/dist/vega/p-8c10461b.js +1 -0
- package/dist/vega/{p-d2f14160.entry.js → p-8e276d48.entry.js} +1 -1
- package/dist/vega/{p-a7df72a5.entry.js → p-911f7a5f.entry.js} +1 -1
- package/dist/vega/{p-f0f4bf10.entry.js → p-a140ba18.entry.js} +1 -1
- package/dist/vega/p-bc46e61d.entry.js +1 -0
- package/dist/vega/p-bed3acfd.entry.js +1 -0
- package/dist/vega/p-d067445e.entry.js +1 -0
- package/dist/vega/p-d078752c.js +1 -0
- package/dist/vega/p-d84bea2d.entry.js +1 -0
- package/dist/vega/p-ef28ea41.js +1 -0
- package/dist/vega/p-f4514ddd.js +1 -0
- package/dist/vega/p-fa11da3d.entry.js +1 -0
- package/dist/vega/p-fb38e3bb.entry.js +1 -0
- package/dist/vega/{p-5c53df4f.entry.js → p-fb724b83.entry.js} +1 -1
- package/dist/vega/p-ffe6ced9.js +1 -0
- package/dist/vega/vega.css +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/style/vega.css +1 -1
- package/style/vega_min.css +1 -1
- package/dist/cjs/vegaLoaderController-7261a1dd.js +0 -82
- package/dist/esm/vegaLoaderController-b9f6dbdc.js +0 -80
- package/dist/vega/p-0e365ccb.entry.js +0 -1
- package/dist/vega/p-1df15e8d.entry.js +0 -1
- package/dist/vega/p-2e0b028f.entry.js +0 -1
- package/dist/vega/p-3b5e1a74.entry.js +0 -1
- package/dist/vega/p-3fad7b74.entry.js +0 -13
- package/dist/vega/p-69d5db02.entry.js +0 -1
- package/dist/vega/p-817c514f.js +0 -1
- package/dist/vega/p-aed03ee3.js +0 -1
- package/dist/vega/p-b8ebc54d.js +0 -1
- package/dist/vega/p-b923e0d9.entry.js +0 -1
- package/dist/vega/p-bf614b46.js +0 -1
- package/dist/vega/p-c4202112.js +0 -1
- package/dist/vega/p-d2092325.entry.js +0 -1
- package/dist/vega/p-d4a33d3b.entry.js +0 -1
- package/dist/vega/p-e0ef61f1.entry.js +0 -1
- package/dist/vega/p-eaef0646.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const featureFlagController = require('./featureFlagController-c6a26489.js');
|
|
4
|
-
const
|
|
4
|
+
const vegaNotifyController = require('./vegaNotifyController-d4c4bd42.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Default export function that will be used by stencil global script,
|
|
@@ -10,6 +10,7 @@ const vegaLoaderController = require('./vegaLoaderController-7261a1dd.js');
|
|
|
10
10
|
function appGlobalScript () {
|
|
11
11
|
disableFeatureFlagFromClientGlobal();
|
|
12
12
|
injectVegaLoaderIntoGlobal();
|
|
13
|
+
injectVegaNotifyIntoGlobal();
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Disable feature flags from the client global defined lists.
|
|
@@ -20,10 +21,16 @@ function disableFeatureFlagFromClientGlobal() {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Inject VegaLoader to global as a public api
|
|
24
25
|
*/
|
|
25
26
|
function injectVegaLoaderIntoGlobal() {
|
|
26
|
-
globalThis['VegaLoader'] =
|
|
27
|
+
globalThis['VegaLoader'] = vegaNotifyController.VegaLoader;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Inject VegaNotify to global as a public api
|
|
31
|
+
*/
|
|
32
|
+
function injectVegaNotifyIntoGlobal() {
|
|
33
|
+
globalThis.VegaNotify = vegaNotifyController.VegaNotify;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
const globalScripts = appGlobalScript;
|
|
@@ -9,12 +9,14 @@ const exemptionClasses = [
|
|
|
9
9
|
'vega-flex-grow-0',
|
|
10
10
|
'vega-flex-shrink-0',
|
|
11
11
|
'vega-flex-basis-0',
|
|
12
|
+
'v-flex-1',
|
|
12
13
|
'v-min-w-min',
|
|
13
14
|
'disabled',
|
|
14
15
|
'v-text-black',
|
|
15
16
|
'v-text-white',
|
|
16
17
|
'v-hidden',
|
|
17
18
|
'vega-loader-container-relative',
|
|
19
|
+
'vega-page-notification-fade-out',
|
|
18
20
|
];
|
|
19
21
|
/**
|
|
20
22
|
* Sanitize the vega component rendered output hostElement with the following procedures:
|
|
@@ -1837,6 +1837,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1837
1837
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1838
1838
|
/* webpackMode: "lazy" */
|
|
1839
1839
|
'./vega-option.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1840
|
+
case 'vega-page-notification.cjs':
|
|
1841
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1842
|
+
/* webpackMode: "lazy" */
|
|
1843
|
+
'./vega-page-notification.cjs.entry.js')); }).then(processMod, consoleError);
|
|
1840
1844
|
case 'vega-radio.cjs':
|
|
1841
1845
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1842
1846
|
/* webpackMode: "lazy" */
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -9,10 +9,11 @@ const typeGuard = require('./typeGuard-d61b0f4a.js');
|
|
|
9
9
|
const icons = require('./icons-d9a74346.js');
|
|
10
10
|
const ui = require('./ui-674b81d0.js');
|
|
11
11
|
const featureFlagController = require('./featureFlagController-c6a26489.js');
|
|
12
|
-
const
|
|
12
|
+
const vegaNotifyController = require('./vegaNotifyController-d4c4bd42.js');
|
|
13
13
|
require('./number-2eb7b8f3.js');
|
|
14
14
|
require('./misc-28c49157.js');
|
|
15
|
-
require('./ui-
|
|
15
|
+
require('./ui-67d89fc1.js');
|
|
16
|
+
require('./zIndexManager-92ab41c7.js');
|
|
16
17
|
|
|
17
18
|
/* This file is generated by vega-design 2.0.66 */
|
|
18
19
|
/* eslint-disable */
|
|
@@ -409,6 +410,7 @@ exports.Icons = icons.Icons;
|
|
|
409
410
|
exports.getIconFromToken = icons.getIconFromToken;
|
|
410
411
|
exports.BreakpointKeys = ui.BreakpointKeys;
|
|
411
412
|
exports.FeatureFlag = featureFlagController.FeatureFlag;
|
|
412
|
-
exports.VegaLoader =
|
|
413
|
+
exports.VegaLoader = vegaNotifyController.VegaLoader;
|
|
414
|
+
exports.VegaNotify = vegaNotifyController.VegaNotify;
|
|
413
415
|
exports.Rings = Rings;
|
|
414
416
|
exports.Typography = Typography;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const subject = require('./subject-7f9d42d8.js');
|
|
4
4
|
const observer = require('./observer-126f19d0.js');
|
|
5
|
-
const ui = require('./ui-
|
|
5
|
+
const ui = require('./ui-67d89fc1.js');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The FormFieldController class is a class that validates the value of an input elements
|
|
@@ -67,10 +67,7 @@ class FormFieldController {
|
|
|
67
67
|
case 'VEGA-CHECKBOX-GROUP':
|
|
68
68
|
return [];
|
|
69
69
|
case 'VEGA-INPUT':
|
|
70
|
-
|
|
71
|
-
return element.dataset['isVegaStepper']
|
|
72
|
-
? 0
|
|
73
|
-
: '';
|
|
70
|
+
return '';
|
|
74
71
|
case 'VEGA-DATE-PICKER':
|
|
75
72
|
return (element['mode'] === 'range' ? ['', ''] : '');
|
|
76
73
|
case 'VEGA-CHECKBOX':
|
|
@@ -85,6 +82,8 @@ class FormFieldController {
|
|
|
85
82
|
return '';
|
|
86
83
|
case 'VEGA-IMAGE-UPLOADER':
|
|
87
84
|
return null;
|
|
85
|
+
case 'VEGA-STEPPER':
|
|
86
|
+
return 0;
|
|
88
87
|
default:
|
|
89
88
|
throw new Error(`Unrecognized tagName ${tagName}`);
|
|
90
89
|
}
|
|
@@ -557,85 +556,4 @@ class InjectFormFieldHelper {
|
|
|
557
556
|
}
|
|
558
557
|
}
|
|
559
558
|
|
|
560
|
-
/**
|
|
561
|
-
* A rule that checks if a string is empty or not
|
|
562
|
-
*
|
|
563
|
-
* @implements {FormFieldValidationRule<string>}
|
|
564
|
-
*/
|
|
565
|
-
class RequiredFieldRule {
|
|
566
|
-
constructor() {
|
|
567
|
-
/**
|
|
568
|
-
* A function that checks if the item is a string, number, or boolean.
|
|
569
|
-
*
|
|
570
|
-
* @param {unknown} item - The item to be checked.
|
|
571
|
-
* @returns {boolean} The return value is a boolean that indicates whether the item is string, number or boolean.
|
|
572
|
-
*/
|
|
573
|
-
this.checkArrayItemType = (item) => typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean';
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* If the input is a number or a boolean, return true. If the input is a string, return true if the string is not empty
|
|
577
|
-
*
|
|
578
|
-
* @param {Primitive | Array<Primitive>} input - The input to be evaluated.
|
|
579
|
-
* @returns {EvaluateResult} An object with two properties: isValid and message.
|
|
580
|
-
*/
|
|
581
|
-
evaluate(input) {
|
|
582
|
-
if (!this.isAcceptedInputType(input)) {
|
|
583
|
-
throw new Error(`Unexpected type of input: ${typeof input}: ${input}`);
|
|
584
|
-
}
|
|
585
|
-
else if (typeof input === 'number' || typeof input === 'boolean') {
|
|
586
|
-
return {
|
|
587
|
-
isValid: true,
|
|
588
|
-
message: '',
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
else if (typeof input === 'string' || Array.isArray(input)) {
|
|
592
|
-
return {
|
|
593
|
-
isValid: input.length > 0,
|
|
594
|
-
message: input.length <= 0 ? 'This field is required' : '',
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
else if (input === null) {
|
|
598
|
-
return {
|
|
599
|
-
isValid: false,
|
|
600
|
-
message: 'This field is required',
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* If the input is accepted and the status is not disabled and visible, then return true
|
|
606
|
-
*
|
|
607
|
-
* @param {unknown} input - The input to be evaluated.
|
|
608
|
-
* @param {FormFieldStatusMeta} [status] - FormFieldStatusMeta
|
|
609
|
-
* @returns {boolean} The return value is a boolean that indicates whether the input can be evaluated.
|
|
610
|
-
*/
|
|
611
|
-
canEvaluate(input, status) {
|
|
612
|
-
return status
|
|
613
|
-
? this.isAcceptedInputType(input) && !status.disabled && status.visible
|
|
614
|
-
: this.isAcceptedInputType(input);
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* If the field is not disabled, visible, and has been touched or modified, then show the error
|
|
618
|
-
*
|
|
619
|
-
* @param {FormFieldStatusMeta} status - FormFieldStatusMeta
|
|
620
|
-
* @returns {boolean} A boolean value.
|
|
621
|
-
*/
|
|
622
|
-
shouldShowError(status) {
|
|
623
|
-
return !status.disabled && status.visible && (status.touched || status.modified);
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* If the input is a string, number, boolean, or null, return true, otherwise return false.
|
|
627
|
-
*
|
|
628
|
-
* @param {unknown} input - The input value to be validated.
|
|
629
|
-
* @returns {boolean} a boolean value.
|
|
630
|
-
*/
|
|
631
|
-
isAcceptedInputType(input) {
|
|
632
|
-
return (typeof input === 'string' ||
|
|
633
|
-
typeof input === 'number' ||
|
|
634
|
-
typeof input === 'boolean' ||
|
|
635
|
-
(Array.isArray(input) && input.every(this.checkArrayItemType)) ||
|
|
636
|
-
input === null);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
559
|
exports.InjectFormFieldController = InjectFormFieldController;
|
|
641
|
-
exports.RequiredFieldRule = RequiredFieldRule;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const ui = require('./ui-
|
|
3
|
+
const ui = require('./ui-67d89fc1.js');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* It listens to the keyup event on the window and calls the appropriate method on the registered elements
|
|
@@ -13,7 +13,7 @@ class KeyboardManager {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor() {
|
|
15
15
|
this.listeners = [];
|
|
16
|
-
this.
|
|
16
|
+
this.listenKeyPress();
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Add the given listener to the list of listeners.
|
|
@@ -22,6 +22,7 @@ class KeyboardManager {
|
|
|
22
22
|
* @returns {void}
|
|
23
23
|
*/
|
|
24
24
|
register(listeners) {
|
|
25
|
+
listeners.map((listener) => (listener.eventName || (listener.eventName = 'keyup')));
|
|
25
26
|
this.listeners = this.listeners.concat(listeners);
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
@@ -37,13 +38,28 @@ class KeyboardManager {
|
|
|
37
38
|
* > Listen for keyup events on the window, and if the code matches the keyCode of a listener,
|
|
38
39
|
* invoke the listener's callback
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
listenKeyPress() {
|
|
41
42
|
document.addEventListener('keydown', (e) => {
|
|
42
|
-
|
|
43
|
-
this.listeners
|
|
44
|
-
.filter((listener) => this.shouldInvokeListener(listener, keyCode))
|
|
45
|
-
.forEach((listener) => listener.callback());
|
|
43
|
+
this.invokeListeners('keydown', e);
|
|
46
44
|
});
|
|
45
|
+
// listen keyup is waiting activeElement changed.
|
|
46
|
+
document.addEventListener('keyup', (e) => {
|
|
47
|
+
this.invokeListeners('keyup', e);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* We filter the listeners by the event name, then filter them by whether the key code matches the
|
|
52
|
+
* listener's key code, and then invoke the callback function for each listener that matches
|
|
53
|
+
*
|
|
54
|
+
* @param {'keyup' | 'keydown'} eventName - The name of the event that was triggered.
|
|
55
|
+
* @param {KeyboardEvent} event - KeyboardEvent - this is the event that is passed to the event
|
|
56
|
+
* listener.
|
|
57
|
+
*/
|
|
58
|
+
invokeListeners(eventName, event) {
|
|
59
|
+
const keyCode = event.code;
|
|
60
|
+
this.listeners
|
|
61
|
+
.filter((listener) => listener.eventName === eventName && this.shouldInvokeListener(listener, keyCode))
|
|
62
|
+
.forEach((listener) => listener.callback());
|
|
47
63
|
}
|
|
48
64
|
/**
|
|
49
65
|
* > If the keyCode is accepted, and the activeElement is in the scope, and the activeElement is not
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0ca30e90.js');
|
|
6
|
-
const appGlobals = require('./app-globals-
|
|
6
|
+
const appGlobals = require('./app-globals-cb59b473.js');
|
|
7
7
|
require('./featureFlagController-c6a26489.js');
|
|
8
|
-
require('./
|
|
8
|
+
require('./vegaNotifyController-d4c4bd42.js');
|
|
9
9
|
require('./misc-28c49157.js');
|
|
10
|
-
require('./ui-
|
|
10
|
+
require('./ui-67d89fc1.js');
|
|
11
|
+
require('./log-7b0974fb.js');
|
|
12
|
+
require('./zIndexManager-92ab41c7.js');
|
|
13
|
+
require('./number-2eb7b8f3.js');
|
|
11
14
|
|
|
12
15
|
/*
|
|
13
16
|
Stencil Client Patch Esm v2.17.4 | MIT Licensed | https://stenciljs.com
|
|
@@ -20,7 +23,7 @@ const defineCustomElements = (win, options) => {
|
|
|
20
23
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
21
24
|
return patchEsm().then(() => {
|
|
22
25
|
appGlobals.globalScripts();
|
|
23
|
-
return index.bootstrapLazy(JSON.parse("[[\"vega-banner_26.cjs\",[[0,\"vega-tab-group\",{\"selectedTabDataTarget\":[1,\"selected-tab-data-target\"],\"gap\":[1],\"showCloseButton\":[4,\"show-close-button\"],\"tabItems\":[16],\"positionRelativeTo\":[1,\"position-relative-to\"],\"tabPages\":[32],\"tabWidthArray\":[32],\"currentPageIndex\":[32]},[[0,\"vegaPageUpdate\",\"onCarouselPageUpdate\"]]],[0,\"vega-banner\",{\"source\":[16],\"mode\":[1]},[[0,\"vegaPageUpdate\",\"onVegaPageUpdateHandler\"]]],[0,\"vega-input-select\",{\"label\":[1],\"required\":[516],\"source\":[1040],\"value\":[1537],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[4,\"auto-validation\"],\"formValidation\":[2,\"form-validation\"],\"validationRules\":[16],\"prefixIcon\":[1,\"prefix-icon\"],\"disabled\":[516],\"placeholder\":[1],\"hint\":[1],\"vegaDropdownProps\":[16],\"isDropdownShow\":[32],\"dropdownSource\":[32],\"doClose\":[64],\"doOpen\":[64],\"doChange\":[64],\"valid\":[64]}],[4,\"vega-table\",{\"columns\":[16],\"dataSource\":[16],\"rowSelection\":[1040],\"rowExpandable\":[4,\"row-expandable\"],\"rowClickable\":[4,\"row-clickable\"],\"rowDivider\":[4,\"row-divider\"],\"columnDivider\":[4,\"column-divider\"],\"striped\":[4],\"density\":[1],\"paddingX\":[16],\"showHeader\":[4,\"show-header\"],\"pagination\":[16],\"emptyDescription\":[1,\"empty-description\"],\"rowKey\":[1,\"row-key\"],\"selectedRowKeySet\":[32],\"expandedRowKeySet\":[32],\"currentBreakpoint\":[32],\"sortersMap\":[32],\"currentData\":[32],\"currentClickedRowIndex\":[32],\"currentPage\":[32],\"openExpandRow\":[64],\"closeExpandRow\":[64],\"closeAllExpandRow\":[64],\"toggleExpandRow\":[64],\"clearSelection\":[64],\"getSelection\":[64],\"setSelection\":[64]}],[0,\"vega-time-picker\",{\"label\":[1],\"required\":[516],\"placeholder\":[1],\"increments\":[2],\"timeFormat\":[1,\"time-format\"],\"value\":[1537],\"size\":[1],\"disabled\":[516],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"validationRules\":[16],\"positionRelativeTo\":[1,\"position-relative-to\"],\"dropdownSource\":[32],\"selectedTimeValue\":[32],\"valid\":[64]},[[0,\"vegaChange\",\"handleValueChange\"],[0,\"vegaFocus\",\"handleVegaInputFocus\"],[0,\"vegaBlur\",\"handleVegaInputBlur\"],[9,\"mousedown\",\"onMouseDown\"]]],[0,\"vega-date-picker\",{\"mode\":[1],\"value\":[1537],\"label\":[1],\"required\":[516],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"format\":[1],\"size\":[1],\"formValidation\":[2,\"form-validation\"],\"validationRules\":[16],\"minDate\":[513,\"min-date\"],\"maxDate\":[513,\"max-date\"],\"placeholder\":[1],\"clearButton\":[4,\"clear-button\"],\"readOnly\":[4,\"read-only\"],\"allowRepick\":[4,\"allow-repick\"],\"dropdownConfig\":[16],\"disabled\":[516],\"valid\":[64],\"doClose\":[64],\"doOpen\":[64]}],[0,\"vega-progress-tracker\",{\"current\":[2],\"direction\":[1],\"steps\":[16],\"completedStepArray\":[16],\"canClickStep\":[4,\"can-click-step\"],\"nextStep\":[64],\"prevStep\":[64],\"setCurrent\":[64],\"getCurrent\":[64]},[[0,\"vegaPageUpdate\",\"onVegaPageUpdateHandler\"]]],[4,\"vega-sidenav\",{\"source\":[16],\"footnote\":[1],\"headerConfig\":[16],\"openByDefault\":[1,\"open-by-default\"],\"openState\":[32],\"toggle\":[64]},[[0,\"vegaClick\",\"onVegaClickHandler\"],[10,\"click\",\"collapseSidenavByBackDropClick\"]]],[0,\"vega-button\",{\"size\":[1],\"variant\":[1],\"icon\":[1],\"iconAlign\":[1,\"icon-align\"],\"label\":[1025],\"disabled\":[4],\"danger\":[4],\"block\":[4],\"type\":[1]}],[4,\"vega-footer\",{\"tosUrl\":[1,\"tos-url\"],\"privacyUrl\":[1,\"privacy-url\"]}],[0,\"vega-pagination\",{\"current\":[1538],\"total\":[2],\"pageSize\":[2,\"page-size\"]}],[4,\"vega-checkbox\",{\"identifier\":[1],\"value\":[1032],\"checked\":[1028],\"disabled\":[516],\"size\":[1],\"required\":[516],\"isValid\":[1540,\"is-valid\"],\"valid\":[64],\"setValue\":[64]}],[4,\"vega-modal\",{\"backdrop\":[1],\"size\":[8],\"open\":[1028],\"animation\":[4],\"modalTitle\":[1,\"modal-title\"],\"backdropColor\":[1,\"backdrop-color\"],\"isVerticallyCenter\":[4,\"is-vertically-center\"],\"showCloseButton\":[4,\"show-close-button\"],\"padding\":[1],\"contentMaxHeight\":[2,\"content-max-height\"],\"currentBreakpoint\":[32],\"modal\":[64]},[[10,\"click\",\"listenDataTarget\"],[0,\"click\",\"listenDataDismiss\"]]],[4,\"vega-sidenav-group\",{\"icon\":[1],\"label\":[1]}],[4,\"vega-sidenav-link\",{\"icon\":[1],\"selected\":[1540],\"url\":[1],\"showSideBarOnClickLink\":[4,\"show-side-bar-on-click-link\"]}],[0,\"vega-button-link\",{\"link\":[1],\"size\":[1],\"icon\":[513],\"iconType\":[1,\"icon-type\"],\"iconAlign\":[1,\"icon-align\"],\"label\":[1025],\"disabled\":[4],\"danger\":[4],\"eventful\":[4]}],[4,\"vega-carousel\",{\"perPage\":[8,\"per-page\"],\"showSlider\":[4,\"show-slider\"],\"spacing\":[1],\"page\":[32],\"totalPages\":[32],\"nextPage\":[64],\"prevPage\":[64],\"goToPage\":[64]}],[4,\"vega-dropdown\",{\"size\":[8],\"trigger\":[1],\"translocation\":[16],\"source\":[1040],\"positionRelativeTo\":[1,\"position-relative-to\"],\"selectType\":[1,\"select-type\"],\"selectedSourceKey\":[1025,\"selected-source-key\"],\"maxHeight\":[2,\"max-height\"],\"searchable\":[4],\"matchTargetWidth\":[4,\"match-target-width\"],\"minWidth\":[8,\"min-width\"],\"maxWidth\":[8,\"max-width\"],\"itemDisplayRule\":[1,\"item-display-rule\"],\"matchContainerHeight\":[4,\"match-container-height\"],\"caseSensitive\":[4,\"case-sensitive\"],\"dynamicOption\":[4,\"dynamic-option\"],\"searchString\":[32],\"maxHeightOfItemsContainer\":[32],\"show\":[64],\"hide\":[64],\"search\":[64]},[[1,\"mouseenter\",\"onMouseEnter\"],[0,\"click\",\"onClick\"],[9,\"mousedown\",\"onMouseDown\"]]],[4,\"vega-grid\",{\"column\":[8],\"row\":[8],\"gap\":[1]}],[0,\"vega-virtual-scroll\",{\"source\":[16],\"approxItemHeight\":[2,\"approx-item-height\"],\"viewportMaxHeight\":[2,\"viewport-max-height\"],\"thresholdOfWork\":[2,\"threshold-of-work\"],\"renderItem\":[16],\"startIndex\":[32],\"endIndex\":[32],\"viewportStartIndex\":[32],\"totalHeight\":[32],\"transformY\":[32],\"scrollTop\":[32],\"scrollToIndex\":[64]}],[0,\"vega-button-circle\",{\"size\":[1],\"variant\":[1],\"icon\":[513],\"label\":[1],\"disabled\":[4],\"danger\":[4],\"type\":[1]}],[0,\"vega-input\",{\"label\":[1],\"value\":[1537],\"type\":[1],\"autocomplete\":[1],\"prefixIcon\":[1,\"prefix-icon\"],\"email\":[516],\"required\":[1540],\"min\":[514],\"max\":[514],\"minLength\":[514,\"min-length\"],\"maxLength\":[514,\"max-length\"],\"showClearIcon\":[4,\"show-clear-icon\"],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"formValidation\":[2,\"form-validation\"],\"validationRules\":[16],\"size\":[1],\"placeholder\":[1],\"disabled\":[516],\"hint\":[1],\"maskConfig\":[16],\"valid\":[64],\"doFocus\":[64],\"doBlur\":[64]},[[0,\"input\",\"handleValueInput\"]]],[0,\"vega-field-label\",{\"label\":[1025],\"isFieldRequired\":[4,\"is-field-required\"],\"disabled\":[4]}],[4,\"vega-tooltip\",{\"size\":[8],\"trigger\":[1],\"content\":[1],\"placement\":[1],\"positionRelativeTo\":[1,\"position-relative-to\"]},[[0,\"click\",\"onClick\"],[1,\"mouseenter\",\"onMouseEnter\"],[1,\"mouseleave\",\"onMouseLeave\"],[8,\"keyup\",\"onKeyDown\"],[9,\"mousedown\",\"onMouseDown\"]]],[0,\"vega-flex\",{\"gap\":[1],\"margin\":[1],\"breakpoint\":[1],\"direction\":[1],\"alignItem\":[1,\"align-item\"],\"justifyContent\":[1,\"justify-content\"],\"useNativeFlex\":[4,\"use-native-flex\"]}],[0,\"vega-icon\",{\"icon\":[513],\"size\":[1]}]]],[\"vega-combo-box.cjs\",[[0,\"vega-combo-box\",{\"label\":[1],\"required\":[516],\"source\":[1040],\"value\":[1040],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"validationRules\":[16],\"disabled\":[516],\"placeholder\":[1],\"hint\":[1],\"size\":[1],\"vegaDropdownProps\":[16],\"close\":[64],\"open\":[64],\"valid\":[64]}]]],[\"vega-app-header-button.cjs\",[[0,\"vega-app-header-button\",{\"dropdown\":[16],\"size\":[1],\"label\":[1],\"showLabel\":[4,\"show-label\"],\"avatar\":[16],\"avatarPosition\":[1,\"avatar-position\"],\"showBorder\":[4,\"show-border\"],\"showMenuArrowIcon\":[4,\"show-menu-arrow-icon\"],\"selected\":[4],\"isDropdownShow\":[32],\"currentBreakpoint\":[32]}]]],[\"vega-color-picker.cjs\",[[0,\"vega-color-picker\",{\"value\":[1537],\"hint\":[1],\"disabled\":[516],\"required\":[516],\"label\":[1],\"isValid\":[516,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"validationRules\":[16],\"colors\":[16],\"valid\":[64]}]]],[\"vega-stepper.cjs\",[[0,\"vega-stepper\",{\"stepperId\":[513,\"id\"],\"max\":[2],\"min\":[2],\"value\":[1538],\"label\":[1],\"inputEditable\":[4,\"input-editable\"],\"disabled\":[516],\"required\":[4],\"isValid\":[1028,\"is-valid\"],\"formValidation\":[2,\"form-validation\"],\"valid\":[64]},[[0,\"vegaChange\",\"handleValueChange\"],[0,\"vegaValidate\",\"handleVegaInputValidate\"]]]]],[\"vega-accordion.cjs\",[[4,\"vega-accordion\",{\"drawsBackground\":[4,\"draws-background\"],\"prefixIcon\":[1,\"prefix-icon\"],\"accordionTitle\":[1,\"accordion-title\"],\"expandIconAlign\":[1,\"expand-icon-align\"],\"expand\":[1028],\"iconPosition\":[1,\"icon-position\"],\"showExpandIcon\":[4,\"show-expand-icon\"],\"groupId\":[1,\"group-id\"]}]]],[\"vega-image-uploader.cjs\",[[0,\"vega-image-uploader\",{\"value\":[1040],\"accept\":[1],\"status\":[1537],\"showPreviewButton\":[4,\"show-preview-button\"],\"showRemoveButton\":[4,\"show-remove-button\"],\"disabled\":[516],\"required\":[516],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"validationRules\":[16],\"valid\":[64]}]]],[\"vega-item-toggle.cjs\",[[0,\"vega-item-toggle\",{\"itemToggleStatusMap\":[16],\"isToggled\":[1028,\"is-toggled\"],\"isError\":[4,\"is-error\"],\"toggleStatus\":[32]}]]],[\"vega-option.cjs\",[[4,\"vega-option\",{\"label\":[1],\"subLabel\":[1,\"sub-label\"],\"icon\":[1]},[[2,\"vegaFocus\",\"handleFocus\"],[2,\"vegaBlur\",\"handleBlur\"],[3,\"mousedown\",\"handleMousedown\"],[3,\"mouseup\",\"handleMouseup\"],[3,\"mouseout\",\"handleMouseout\"],[2,\"click\",\"handleClick\"]]]]],[\"vega-textarea.cjs\",[[0,\"vega-textarea\",{\"placeholder\":[1],\"hint\":[1],\"disabled\":[516],\"label\":[1],\"showCounter\":[4,\"show-counter\"],\"value\":[1537],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"required\":[1540],\"maxLength\":[514,\"max-length\"],\"minLength\":[514,\"min-length\"],\"validationRules\":[16],\"currentCharCount\":[32],\"valid\":[64]},[[0,\"input\",\"handleValueTextarea\"]]]]],[\"vega-checkbox-group.cjs\",[[4,\"vega-checkbox-group\",{\"label\":[1],\"value\":[1040],\"vegaFlexProp\":[16],\"disabled\":[516],\"required\":[516],\"hint\":[1],\"formValidation\":[2,\"form-validation\"],\"isValid\":[1540,\"is-valid\"],\"valid\":[64]}]]],[\"vega-header.cjs\",[[4,\"vega-header\",{\"menuShown\":[32]}]]],[\"vega-loading-indicator.cjs\",[[0,\"vega-loading-indicator\",{\"shape\":[1],\"size\":[1],\"mode\":[1],\"percent\":[2],\"label\":[1],\"hint\":[1],\"status\":[1],\"currentBreakpoint\":[32]}]]],[\"vega-radio-group.cjs\",[[4,\"vega-radio-group\",{\"label\":[1],\"value\":[1537],\"name\":[1],\"vegaFlexProp\":[16],\"required\":[516],\"hint\":[1],\"formValidation\":[2,\"form-validation\"],\"isValid\":[1540,\"is-valid\"],\"disabled\":[516],\"valid\":[64]}]]],[\"vega-toggle-switch.cjs\",[[0,\"vega-toggle-switch\",{\"checked\":[1540],\"size\":[1],\"label\":[1],\"disabled\":[4]}]]],[\"vega-app-footer.cjs\",[[0,\"vega-app-footer\",{\"content\":[1],\"termOfUseLabel\":[1,\"term-of-use-label\"],\"termOfUseUrl\":[1,\"term-of-use-url\"],\"privacyPolicyLabel\":[1,\"privacy-policy-label\"],\"privacyPolicyUrl\":[1,\"privacy-policy-url\"],\"additionalLinks\":[16],\"showDisclaimer\":[4,\"show-disclaimer\"]}]]],[\"vega-badge.cjs\",[[0,\"vega-badge\",{\"bgColor\":[1,\"bg-color\"],\"textColor\":[1,\"text-color\"],\"text\":[1],\"size\":[1],\"currentBreakpoint\":[32]}]]],[\"vega-counter-badge.cjs\",[[4,\"vega-counter-badge\",{\"dot\":[4],\"color\":[1],\"count\":[2],\"offset\":[16]}]]],[\"vega-form.cjs\",[[1,\"vega-form\",{\"isValid\":[1028,\"is-valid\"],\"isTouched\":[1028,\"is-touched\"],\"valid\":[64],\"getValue\":[64],\"setValue\":[64],\"reset\":[64]},[[0,\"vegaValidate\",\"vegaValidateEvent\"],[2,\"vegaValidate\",\"updateInternalValidStatus\"],[0,\"vegaChange\",\"updateInternalTouchedStatus\"]]]]],[\"vega-radio.cjs\",[[4,\"vega-radio\",{\"value\":[1],\"name\":[1],\"checked\":[4],\"disabled\":[4],\"size\":[1]}]]],[\"vega-chip.cjs\",[[0,\"vega-chip\",{\"text\":[1],\"clickable\":[4],\"variant\":[1],\"size\":[1],\"bgColor\":[1,\"bg-color\"],\"textColor\":[1,\"text-color\"],\"statusColor\":[1,\"status-color\"],\"chipType\":[1,\"chip-type\"],\"showCloseIcon\":[4,\"show-close-icon\"],\"icon\":[1],\"iconAlign\":[1,\"icon-align\"],\"currentBreakpoint\":[32],\"currentSize\":[32]}]]],[\"vega-card.cjs\",[[4,\"vega-card\",{\"padding\":[1],\"margin\":[1],\"shadow\":[1],\"backgroundColor\":[1,\"background-color\"]}]]],[\"vega-text.cjs\",[[0,\"vega-text\",{\"displayRule\":[1,\"display-rule\"],\"content\":[1]}]]]]"), options);
|
|
26
|
+
return index.bootstrapLazy(JSON.parse("[[\"vega-banner_26.cjs\",[[0,\"vega-tab-group\",{\"selectedTabDataTarget\":[1,\"selected-tab-data-target\"],\"gap\":[1],\"showCloseButton\":[4,\"show-close-button\"],\"tabItems\":[16],\"positionRelativeTo\":[1,\"position-relative-to\"],\"tabPages\":[32],\"tabWidthArray\":[32],\"currentPageIndex\":[32]},[[0,\"vegaPageUpdate\",\"onCarouselPageUpdate\"]]],[0,\"vega-banner\",{\"source\":[16],\"mode\":[1]},[[0,\"vegaPageUpdate\",\"onVegaPageUpdateHandler\"]]],[0,\"vega-input-select\",{\"label\":[1],\"required\":[516],\"source\":[1040],\"value\":[1537],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[4,\"auto-validation\"],\"formValidation\":[2,\"form-validation\"],\"validationRules\":[16],\"prefixIcon\":[1,\"prefix-icon\"],\"disabled\":[516],\"placeholder\":[1],\"hint\":[1],\"vegaDropdownProps\":[16],\"isDropdownShow\":[32],\"dropdownSource\":[32],\"doClose\":[64],\"doOpen\":[64],\"doChange\":[64],\"valid\":[64]}],[4,\"vega-table\",{\"columns\":[16],\"dataSource\":[16],\"rowSelection\":[1040],\"rowExpandable\":[4,\"row-expandable\"],\"rowClickable\":[4,\"row-clickable\"],\"rowDivider\":[4,\"row-divider\"],\"columnDivider\":[4,\"column-divider\"],\"striped\":[4],\"density\":[1],\"paddingX\":[16],\"showHeader\":[4,\"show-header\"],\"pagination\":[16],\"emptyDescription\":[1,\"empty-description\"],\"rowKey\":[1,\"row-key\"],\"selectedRowKeySet\":[32],\"expandedRowKeySet\":[32],\"currentBreakpoint\":[32],\"sortersMap\":[32],\"currentData\":[32],\"currentClickedRowIndex\":[32],\"currentPage\":[32],\"openExpandRow\":[64],\"closeExpandRow\":[64],\"closeAllExpandRow\":[64],\"toggleExpandRow\":[64],\"clearSelection\":[64],\"getSelection\":[64],\"setSelection\":[64]}],[0,\"vega-time-picker\",{\"label\":[1],\"required\":[516],\"placeholder\":[1],\"increments\":[2],\"timeFormat\":[1,\"time-format\"],\"value\":[1537],\"size\":[1],\"disabled\":[516],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"validationRules\":[16],\"positionRelativeTo\":[1,\"position-relative-to\"],\"dropdownSource\":[32],\"selectedTimeValue\":[32],\"valid\":[64]},[[0,\"vegaChange\",\"handleValueChange\"],[0,\"vegaFocus\",\"handleVegaInputFocus\"],[0,\"vegaBlur\",\"handleVegaInputBlur\"],[9,\"mousedown\",\"onMouseDown\"]]],[0,\"vega-date-picker\",{\"mode\":[1],\"value\":[1537],\"label\":[1],\"required\":[516],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"format\":[1],\"size\":[1],\"formValidation\":[2,\"form-validation\"],\"validationRules\":[16],\"minDate\":[513,\"min-date\"],\"maxDate\":[513,\"max-date\"],\"placeholder\":[1],\"clearButton\":[4,\"clear-button\"],\"readOnly\":[4,\"read-only\"],\"allowRepick\":[4,\"allow-repick\"],\"dropdownConfig\":[16],\"disabled\":[516],\"valid\":[64],\"doClose\":[64],\"doOpen\":[64]}],[0,\"vega-progress-tracker\",{\"current\":[2],\"direction\":[1],\"steps\":[16],\"completedStepArray\":[16],\"canClickStep\":[4,\"can-click-step\"],\"nextStep\":[64],\"prevStep\":[64],\"setCurrent\":[64],\"getCurrent\":[64]},[[0,\"vegaPageUpdate\",\"onVegaPageUpdateHandler\"]]],[4,\"vega-sidenav\",{\"source\":[16],\"footnote\":[1],\"headerConfig\":[16],\"openByDefault\":[1,\"open-by-default\"],\"openState\":[32],\"toggle\":[64]},[[0,\"vegaClick\",\"onVegaClickHandler\"],[10,\"click\",\"collapseSidenavByBackDropClick\"]]],[4,\"vega-footer\",{\"tosUrl\":[1,\"tos-url\"],\"privacyUrl\":[1,\"privacy-url\"]}],[0,\"vega-pagination\",{\"current\":[1538],\"total\":[2],\"pageSize\":[2,\"page-size\"]}],[0,\"vega-button\",{\"size\":[1],\"variant\":[1],\"icon\":[1],\"iconAlign\":[1,\"icon-align\"],\"label\":[1025],\"disabled\":[4],\"danger\":[4],\"block\":[4],\"type\":[1]}],[4,\"vega-checkbox\",{\"identifier\":[1],\"value\":[1032],\"checked\":[1028],\"disabled\":[516],\"size\":[1],\"required\":[516],\"isValid\":[1540,\"is-valid\"],\"valid\":[64],\"setValue\":[64]}],[4,\"vega-modal\",{\"backdrop\":[1],\"size\":[8],\"open\":[1028],\"animation\":[4],\"modalTitle\":[1,\"modal-title\"],\"backdropColor\":[1,\"backdrop-color\"],\"isVerticallyCenter\":[4,\"is-vertically-center\"],\"showCloseButton\":[4,\"show-close-button\"],\"padding\":[1],\"contentMaxHeight\":[2,\"content-max-height\"],\"currentBreakpoint\":[32],\"modal\":[64]},[[10,\"click\",\"listenDataTarget\"],[0,\"click\",\"listenDataDismiss\"]]],[4,\"vega-sidenav-group\",{\"icon\":[1],\"label\":[1]}],[4,\"vega-sidenav-link\",{\"icon\":[1],\"selected\":[1540],\"url\":[1],\"showSideBarOnClickLink\":[4,\"show-side-bar-on-click-link\"]}],[0,\"vega-button-link\",{\"link\":[1],\"size\":[1],\"icon\":[513],\"iconType\":[1,\"icon-type\"],\"iconAlign\":[1,\"icon-align\"],\"label\":[1025],\"disabled\":[4],\"danger\":[4],\"eventful\":[4]}],[4,\"vega-carousel\",{\"perPage\":[8,\"per-page\"],\"showSlider\":[4,\"show-slider\"],\"spacing\":[1],\"canSwipe\":[4,\"can-swipe\"],\"page\":[32],\"totalPages\":[32],\"nextPage\":[64],\"prevPage\":[64],\"goToPage\":[64]}],[4,\"vega-dropdown\",{\"size\":[8],\"trigger\":[1],\"translocation\":[16],\"source\":[1040],\"positionRelativeTo\":[1,\"position-relative-to\"],\"selectType\":[1,\"select-type\"],\"selectedSourceKey\":[1025,\"selected-source-key\"],\"maxHeight\":[2,\"max-height\"],\"searchable\":[4],\"matchTargetWidth\":[4,\"match-target-width\"],\"minWidth\":[8,\"min-width\"],\"maxWidth\":[8,\"max-width\"],\"itemDisplayRule\":[1,\"item-display-rule\"],\"matchContainerHeight\":[4,\"match-container-height\"],\"caseSensitive\":[4,\"case-sensitive\"],\"dynamicOption\":[4,\"dynamic-option\"],\"searchString\":[32],\"maxHeightOfItemsContainer\":[32],\"show\":[64],\"hide\":[64],\"search\":[64]},[[1,\"mouseenter\",\"onMouseEnter\"],[0,\"click\",\"onClick\"],[9,\"mousedown\",\"onMouseDown\"]]],[4,\"vega-grid\",{\"column\":[8],\"row\":[8],\"gap\":[1]}],[0,\"vega-virtual-scroll\",{\"source\":[16],\"approxItemHeight\":[2,\"approx-item-height\"],\"viewportMaxHeight\":[2,\"viewport-max-height\"],\"thresholdOfWork\":[2,\"threshold-of-work\"],\"renderItem\":[16],\"startIndex\":[32],\"endIndex\":[32],\"viewportStartIndex\":[32],\"totalHeight\":[32],\"transformY\":[32],\"scrollTop\":[32],\"scrollToIndex\":[64]}],[0,\"vega-button-circle\",{\"size\":[1],\"variant\":[1],\"icon\":[513],\"label\":[1],\"disabled\":[4],\"danger\":[4],\"type\":[1]}],[0,\"vega-input\",{\"label\":[1],\"value\":[1537],\"type\":[1],\"autocomplete\":[1],\"prefixIcon\":[1,\"prefix-icon\"],\"email\":[516],\"required\":[1540],\"min\":[514],\"max\":[514],\"minLength\":[514,\"min-length\"],\"maxLength\":[514,\"max-length\"],\"showClearIcon\":[4,\"show-clear-icon\"],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"formValidation\":[2,\"form-validation\"],\"validationRules\":[16],\"size\":[1],\"placeholder\":[1],\"disabled\":[516],\"hint\":[1],\"maskConfig\":[16],\"valid\":[64],\"doFocus\":[64],\"doBlur\":[64]},[[0,\"input\",\"handleValueInput\"]]],[0,\"vega-field-label\",{\"label\":[1025],\"isFieldRequired\":[4,\"is-field-required\"],\"disabled\":[4]}],[4,\"vega-tooltip\",{\"size\":[8],\"trigger\":[1],\"content\":[1],\"placement\":[1],\"positionRelativeTo\":[1,\"position-relative-to\"]},[[0,\"click\",\"onClick\"],[1,\"mouseenter\",\"onMouseEnter\"],[1,\"mouseleave\",\"onMouseLeave\"],[8,\"keyup\",\"onKeyDown\"],[9,\"mousedown\",\"onMouseDown\"]]],[0,\"vega-flex\",{\"gap\":[1],\"margin\":[1],\"breakpoint\":[1],\"direction\":[1],\"alignItem\":[1,\"align-item\"],\"justifyContent\":[1,\"justify-content\"],\"useNativeFlex\":[4,\"use-native-flex\"]}],[0,\"vega-icon\",{\"icon\":[513],\"size\":[1]}]]],[\"vega-combo-box.cjs\",[[0,\"vega-combo-box\",{\"label\":[1],\"required\":[516],\"source\":[1040],\"value\":[1040],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"validationRules\":[16],\"disabled\":[516],\"placeholder\":[1],\"hint\":[1],\"size\":[1],\"vegaDropdownProps\":[16],\"close\":[64],\"open\":[64],\"valid\":[64]}]]],[\"vega-app-header-button.cjs\",[[0,\"vega-app-header-button\",{\"dropdown\":[16],\"size\":[1],\"label\":[1],\"showLabel\":[4,\"show-label\"],\"avatar\":[16],\"avatarPosition\":[1,\"avatar-position\"],\"showBorder\":[4,\"show-border\"],\"showMenuArrowIcon\":[4,\"show-menu-arrow-icon\"],\"selected\":[4],\"isDropdownShow\":[32],\"currentBreakpoint\":[32]}]]],[\"vega-color-picker.cjs\",[[0,\"vega-color-picker\",{\"value\":[1537],\"hint\":[1],\"disabled\":[516],\"required\":[516],\"label\":[1],\"isValid\":[516,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"validationRules\":[16],\"colors\":[16],\"valid\":[64]}]]],[\"vega-stepper.cjs\",[[0,\"vega-stepper\",{\"stepperId\":[513,\"id\"],\"max\":[2],\"min\":[2],\"value\":[1538],\"label\":[1],\"inputEditable\":[4,\"input-editable\"],\"disabled\":[516],\"isValid\":[1540,\"is-valid\"],\"formValidation\":[2,\"form-validation\"],\"autoValidation\":[516,\"auto-validation\"],\"valid\":[64]}]]],[\"vega-accordion.cjs\",[[4,\"vega-accordion\",{\"drawsBackground\":[4,\"draws-background\"],\"prefixIcon\":[1,\"prefix-icon\"],\"accordionTitle\":[1,\"accordion-title\"],\"expandIconAlign\":[1,\"expand-icon-align\"],\"expand\":[1028],\"iconPosition\":[1,\"icon-position\"],\"showExpandIcon\":[4,\"show-expand-icon\"],\"groupId\":[1,\"group-id\"]}]]],[\"vega-image-uploader.cjs\",[[0,\"vega-image-uploader\",{\"value\":[1040],\"accept\":[1],\"status\":[1537],\"showPreviewButton\":[4,\"show-preview-button\"],\"showRemoveButton\":[4,\"show-remove-button\"],\"disabled\":[516],\"required\":[516],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"validationRules\":[16],\"valid\":[64]}]]],[\"vega-item-toggle.cjs\",[[0,\"vega-item-toggle\",{\"itemToggleStatusMap\":[16],\"isToggled\":[1028,\"is-toggled\"],\"isError\":[4,\"is-error\"],\"toggleStatus\":[32]}]]],[\"vega-option.cjs\",[[4,\"vega-option\",{\"label\":[1],\"subLabel\":[1,\"sub-label\"],\"icon\":[1]},[[2,\"vegaFocus\",\"handleFocus\"],[2,\"vegaBlur\",\"handleBlur\"],[3,\"mousedown\",\"handleMousedown\"],[3,\"mouseup\",\"handleMouseup\"],[3,\"mouseout\",\"handleMouseout\"],[2,\"click\",\"handleClick\"]]]]],[\"vega-page-notification.cjs\",[[0,\"vega-page-notification\",{\"notificationTitle\":[1,\"title\"],\"message\":[1],\"type\":[1],\"duration\":[2],\"showCloseButton\":[4,\"show-close-button\"],\"actionButtons\":[16],\"close\":[64]}]]],[\"vega-textarea.cjs\",[[0,\"vega-textarea\",{\"placeholder\":[1],\"hint\":[1],\"disabled\":[516],\"label\":[1],\"showCounter\":[4,\"show-counter\"],\"value\":[1537],\"isValid\":[1540,\"is-valid\"],\"autoValidation\":[516,\"auto-validation\"],\"required\":[1540],\"maxLength\":[514,\"max-length\"],\"minLength\":[514,\"min-length\"],\"validationRules\":[16],\"currentCharCount\":[32],\"valid\":[64]},[[0,\"input\",\"handleValueTextarea\"]]]]],[\"vega-checkbox-group.cjs\",[[4,\"vega-checkbox-group\",{\"label\":[1],\"value\":[1040],\"vegaFlexProp\":[16],\"disabled\":[516],\"required\":[516],\"hint\":[1],\"formValidation\":[2,\"form-validation\"],\"isValid\":[1540,\"is-valid\"],\"valid\":[64]}]]],[\"vega-header.cjs\",[[4,\"vega-header\",{\"menuShown\":[32]}]]],[\"vega-loading-indicator.cjs\",[[0,\"vega-loading-indicator\",{\"shape\":[1],\"size\":[1],\"mode\":[1],\"percent\":[2],\"label\":[1],\"hint\":[1],\"status\":[1],\"currentBreakpoint\":[32]}]]],[\"vega-radio-group.cjs\",[[4,\"vega-radio-group\",{\"label\":[1],\"value\":[1537],\"name\":[1],\"vegaFlexProp\":[16],\"required\":[516],\"hint\":[1],\"formValidation\":[2,\"form-validation\"],\"isValid\":[1540,\"is-valid\"],\"disabled\":[516],\"valid\":[64]}]]],[\"vega-toggle-switch.cjs\",[[0,\"vega-toggle-switch\",{\"checked\":[1540],\"size\":[1],\"label\":[1],\"disabled\":[4]}]]],[\"vega-app-footer.cjs\",[[0,\"vega-app-footer\",{\"content\":[1],\"termOfUseLabel\":[1,\"term-of-use-label\"],\"termOfUseUrl\":[1,\"term-of-use-url\"],\"privacyPolicyLabel\":[1,\"privacy-policy-label\"],\"privacyPolicyUrl\":[1,\"privacy-policy-url\"],\"additionalLinks\":[16],\"showDisclaimer\":[4,\"show-disclaimer\"]}]]],[\"vega-badge.cjs\",[[0,\"vega-badge\",{\"bgColor\":[1,\"bg-color\"],\"textColor\":[1,\"text-color\"],\"text\":[1],\"size\":[1],\"currentBreakpoint\":[32]}]]],[\"vega-counter-badge.cjs\",[[4,\"vega-counter-badge\",{\"dot\":[4],\"color\":[1],\"count\":[2],\"offset\":[16]}]]],[\"vega-form.cjs\",[[1,\"vega-form\",{\"isValid\":[1028,\"is-valid\"],\"isTouched\":[1028,\"is-touched\"],\"valid\":[64],\"getValue\":[64],\"setValue\":[64],\"reset\":[64]},[[0,\"vegaValidate\",\"vegaValidateEvent\"],[2,\"vegaValidate\",\"updateInternalValidStatus\"],[0,\"vegaChange\",\"updateInternalTouchedStatus\"]]]]],[\"vega-radio.cjs\",[[4,\"vega-radio\",{\"value\":[1],\"name\":[1],\"checked\":[4],\"disabled\":[4],\"size\":[1]}]]],[\"vega-chip.cjs\",[[0,\"vega-chip\",{\"text\":[1],\"clickable\":[4],\"variant\":[1],\"size\":[1],\"bgColor\":[1,\"bg-color\"],\"textColor\":[1,\"text-color\"],\"statusColor\":[1,\"status-color\"],\"chipType\":[1,\"chip-type\"],\"showCloseIcon\":[4,\"show-close-icon\"],\"icon\":[1],\"iconAlign\":[1,\"icon-align\"],\"currentBreakpoint\":[32],\"currentSize\":[32]}]]],[\"vega-card.cjs\",[[4,\"vega-card\",{\"padding\":[1],\"margin\":[1],\"shadow\":[1],\"backgroundColor\":[1,\"background-color\"]}]]],[\"vega-text.cjs\",[[4,\"vega-text\",{\"overflow\":[1]}]]]]"), options);
|
|
24
27
|
});
|
|
25
28
|
};
|
|
26
29
|
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const number = require('./number-2eb7b8f3.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A rule that checks if the input is less than or equal to a maximum value
|
|
7
|
+
*
|
|
8
|
+
* @implements {FormFieldValidationRule<string>}
|
|
9
|
+
* @property {{ maxValue: number }} config config including the maxValue limit for validation
|
|
10
|
+
*/
|
|
11
|
+
class MaxNumberRule {
|
|
12
|
+
/**
|
|
13
|
+
* It creates a new instance of the class with the given config.
|
|
14
|
+
*
|
|
15
|
+
* @param {{ maxValue: number }} config config including the maxValue limit for validation
|
|
16
|
+
* @param {number} config.maxValue number of the maxValue
|
|
17
|
+
*/
|
|
18
|
+
constructor(config) {
|
|
19
|
+
this.config = config;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* If the input is a number, return true if it's less than or equal to the maximum value, false otherwise
|
|
23
|
+
*
|
|
24
|
+
* @param {unknown} input - The input value to be evaluated.
|
|
25
|
+
* @returns {EvaluateResult} The result of the evaluation.
|
|
26
|
+
* @throws {Error} if input is unable to evaluate
|
|
27
|
+
*/
|
|
28
|
+
evaluate(input) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (!this.isAcceptedInputType(input)) {
|
|
31
|
+
throw new Error(`Unexpected type of input: ${typeof input}: ${input}`);
|
|
32
|
+
}
|
|
33
|
+
const maxValue = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.maxValue) || Number.MAX_VALUE;
|
|
34
|
+
return {
|
|
35
|
+
isValid: number.convertToNumber(input) <= maxValue,
|
|
36
|
+
message: number.convertToNumber(input) <= maxValue ? '' : `The maximum input value is ${maxValue}`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* If the input is accepted and the status is not disabled and visible, then return true
|
|
41
|
+
*
|
|
42
|
+
* @param {unknown} input - The input to be evaluated.
|
|
43
|
+
* @param {FormFieldStatusMeta} [status] - FormFieldStatusMeta
|
|
44
|
+
* @returns {boolean} A boolean value.
|
|
45
|
+
*/
|
|
46
|
+
canEvaluate(input, status) {
|
|
47
|
+
return status
|
|
48
|
+
? this.isAcceptedInputType(input) && !status.disabled && status.visible
|
|
49
|
+
: this.isAcceptedInputType(input);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* If the field is not disabled, visible, and has been touched or modified, then show the error
|
|
53
|
+
*
|
|
54
|
+
* @param {FormFieldStatusMeta} status - FormFieldStatusMeta
|
|
55
|
+
* @returns {boolean} A boolean value.
|
|
56
|
+
*/
|
|
57
|
+
shouldShowError(status) {
|
|
58
|
+
return !status.disabled && status.visible && (status.touched || status.modified);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* If the input is not a number, then return false, otherwise return true.
|
|
62
|
+
*
|
|
63
|
+
* @param {unknown} input - The input value to be converted.
|
|
64
|
+
* @returns {boolean} a boolean value.
|
|
65
|
+
*/
|
|
66
|
+
isAcceptedInputType(input) {
|
|
67
|
+
return !isNaN(number.convertToNumber(input));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* A rule that checks if the input is larger than or equal to a minimum value
|
|
73
|
+
*
|
|
74
|
+
* @implements {FormFieldValidationRule<string>}
|
|
75
|
+
* @property {{ minValue: number }} config config including the minValue limit for validation
|
|
76
|
+
*/
|
|
77
|
+
class MinNumberRule {
|
|
78
|
+
/**
|
|
79
|
+
* It creates a new instance of the class with the given config.
|
|
80
|
+
*
|
|
81
|
+
* @param {{ minValue: number }} config config including the minValue limit for validation
|
|
82
|
+
* @param {number} config.minValue number of the minValue
|
|
83
|
+
*/
|
|
84
|
+
constructor(config) {
|
|
85
|
+
this.config = config;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* If the input is a number, return true if it's more than or equal to the minimum value, false otherwise
|
|
89
|
+
*
|
|
90
|
+
* @param {unknown} input - The input value to be evaluated.
|
|
91
|
+
* @returns {EvaluateResult} The result of the evaluation.
|
|
92
|
+
* @throws {Error} if input is unable to evaluate
|
|
93
|
+
*/
|
|
94
|
+
evaluate(input) {
|
|
95
|
+
var _a;
|
|
96
|
+
if (!this.isAcceptedInputType(input)) {
|
|
97
|
+
throw new Error(`Unexpected type of input: ${typeof input}: ${input}`);
|
|
98
|
+
}
|
|
99
|
+
const minValue = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.minValue) || 0;
|
|
100
|
+
return {
|
|
101
|
+
isValid: number.convertToNumber(input) >= minValue,
|
|
102
|
+
message: number.convertToNumber(input) >= minValue ? '' : `The minimum input value is ${minValue}`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* If the input is accepted and the status is not disabled and visible, then return true
|
|
107
|
+
*
|
|
108
|
+
* @param {unknown} input - The input to be evaluated.
|
|
109
|
+
* @param {FormFieldStatusMeta} [status] - FormFieldStatusMeta
|
|
110
|
+
* @returns {boolean} A boolean value.
|
|
111
|
+
*/
|
|
112
|
+
canEvaluate(input, status) {
|
|
113
|
+
return status
|
|
114
|
+
? this.isAcceptedInputType(input) && !status.disabled && status.visible
|
|
115
|
+
: this.isAcceptedInputType(input);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* If the field is not disabled, visible, and has been touched or modified, then show the error
|
|
119
|
+
*
|
|
120
|
+
* @param {FormFieldStatusMeta} status - FormFieldStatusMeta
|
|
121
|
+
* @returns {boolean} A boolean value.
|
|
122
|
+
*/
|
|
123
|
+
shouldShowError(status) {
|
|
124
|
+
return !status.disabled && status.visible && (status.touched || status.modified);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* If the input is not a number, then return false, otherwise return true.
|
|
128
|
+
*
|
|
129
|
+
* @param {unknown} input - The input value to be converted.
|
|
130
|
+
* @returns {boolean} a boolean value.
|
|
131
|
+
*/
|
|
132
|
+
isAcceptedInputType(input) {
|
|
133
|
+
return !isNaN(number.convertToNumber(input));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
exports.MaxNumberRule = MaxNumberRule;
|
|
138
|
+
exports.MinNumberRule = MinNumberRule;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A rule that checks if a string is empty or not
|
|
5
|
+
*
|
|
6
|
+
* @implements {FormFieldValidationRule<string>}
|
|
7
|
+
*/
|
|
8
|
+
class RequiredFieldRule {
|
|
9
|
+
constructor() {
|
|
10
|
+
/**
|
|
11
|
+
* A function that checks if the item is a string, number, or boolean.
|
|
12
|
+
*
|
|
13
|
+
* @param {unknown} item - The item to be checked.
|
|
14
|
+
* @returns {boolean} The return value is a boolean that indicates whether the item is string, number or boolean.
|
|
15
|
+
*/
|
|
16
|
+
this.checkArrayItemType = (item) => typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* If the input is a number or a boolean, return true. If the input is a string, return true if the string is not empty
|
|
20
|
+
*
|
|
21
|
+
* @param {Primitive | Array<Primitive>} input - The input to be evaluated.
|
|
22
|
+
* @returns {EvaluateResult} An object with two properties: isValid and message.
|
|
23
|
+
*/
|
|
24
|
+
evaluate(input) {
|
|
25
|
+
if (!this.isAcceptedInputType(input)) {
|
|
26
|
+
throw new Error(`Unexpected type of input: ${typeof input}: ${input}`);
|
|
27
|
+
}
|
|
28
|
+
else if (typeof input === 'number' || typeof input === 'boolean') {
|
|
29
|
+
return {
|
|
30
|
+
isValid: true,
|
|
31
|
+
message: '',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
else if (typeof input === 'string' || Array.isArray(input)) {
|
|
35
|
+
return {
|
|
36
|
+
isValid: input.length > 0,
|
|
37
|
+
message: input.length <= 0 ? 'This field is required' : '',
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
else if (input === null) {
|
|
41
|
+
return {
|
|
42
|
+
isValid: false,
|
|
43
|
+
message: 'This field is required',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* If the input is accepted and the status is not disabled and visible, then return true
|
|
49
|
+
*
|
|
50
|
+
* @param {unknown} input - The input to be evaluated.
|
|
51
|
+
* @param {FormFieldStatusMeta} [status] - FormFieldStatusMeta
|
|
52
|
+
* @returns {boolean} The return value is a boolean that indicates whether the input can be evaluated.
|
|
53
|
+
*/
|
|
54
|
+
canEvaluate(input, status) {
|
|
55
|
+
return status
|
|
56
|
+
? this.isAcceptedInputType(input) && !status.disabled && status.visible
|
|
57
|
+
: this.isAcceptedInputType(input);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* If the field is not disabled, visible, and has been touched or modified, then show the error
|
|
61
|
+
*
|
|
62
|
+
* @param {FormFieldStatusMeta} status - FormFieldStatusMeta
|
|
63
|
+
* @returns {boolean} A boolean value.
|
|
64
|
+
*/
|
|
65
|
+
shouldShowError(status) {
|
|
66
|
+
return !status.disabled && status.visible && (status.touched || status.modified);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* If the input is a string, number, boolean, or null, return true, otherwise return false.
|
|
70
|
+
*
|
|
71
|
+
* @param {unknown} input - The input value to be validated.
|
|
72
|
+
* @returns {boolean} a boolean value.
|
|
73
|
+
*/
|
|
74
|
+
isAcceptedInputType(input) {
|
|
75
|
+
return (typeof input === 'string' ||
|
|
76
|
+
typeof input === 'number' ||
|
|
77
|
+
typeof input === 'boolean' ||
|
|
78
|
+
(Array.isArray(input) && input.every(this.checkArrayItemType)) ||
|
|
79
|
+
input === null);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
exports.RequiredFieldRule = RequiredFieldRule;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const log = require('./log-7b0974fb.js');
|
|
4
|
+
|
|
3
5
|
exports.DeviceType = void 0;
|
|
4
6
|
(function (DeviceType) {
|
|
5
7
|
DeviceType["TABLET"] = "tablet";
|
|
@@ -137,12 +139,42 @@ function hexToRGB(hex) {
|
|
|
137
139
|
}
|
|
138
140
|
: null;
|
|
139
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* It returns true if the text in the element is wrapped.
|
|
144
|
+
*
|
|
145
|
+
* @param {HTMLElement} element - The element to be judged.
|
|
146
|
+
* @returns {boolean} A boolean value.
|
|
147
|
+
*/
|
|
148
|
+
function isTextWrapped(element) {
|
|
149
|
+
const lineHeight = parseFloat(getElementComputedStyle(element, 'line-height'));
|
|
150
|
+
if (!isNaN(lineHeight)) {
|
|
151
|
+
return element.getBoundingClientRect().height > lineHeight;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
log.LogUtility.error('The line height of this element is not obtained');
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* "Get the computed style of an element."
|
|
160
|
+
* The first parameter is the element whose style we want to get. The second parameter is the name of
|
|
161
|
+
* the style we want to get
|
|
162
|
+
*
|
|
163
|
+
* @param {HTMLElement} element - The element whose style you want to get.
|
|
164
|
+
* @param {string} styleName - The name of the style you want to get.
|
|
165
|
+
* @returns {string} The computed style of the element.
|
|
166
|
+
*/
|
|
167
|
+
function getElementComputedStyle(element, styleName) {
|
|
168
|
+
return window.getComputedStyle(element).getPropertyValue(styleName);
|
|
169
|
+
}
|
|
140
170
|
|
|
141
171
|
exports.arrayToClassString = arrayToClassString;
|
|
142
172
|
exports.containerScrollToItem = containerScrollToItem;
|
|
143
173
|
exports.extractNumberFromString = extractNumberFromString;
|
|
144
174
|
exports.findParent = findParent;
|
|
145
175
|
exports.getDeviceType = getDeviceType;
|
|
176
|
+
exports.getElementComputedStyle = getElementComputedStyle;
|
|
146
177
|
exports.hexToRGB = hexToRGB;
|
|
147
178
|
exports.isElementVisible = isElementVisible;
|
|
148
179
|
exports.isParent = isParent;
|
|
180
|
+
exports.isTextWrapped = isTextWrapped;
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0ca30e90.js');
|
|
6
|
-
const component = require('./component-
|
|
6
|
+
const component = require('./component-a52a29b6.js');
|
|
7
7
|
const observer = require('./observer-126f19d0.js');
|
|
8
8
|
const typeGuard = require('./typeGuard-d61b0f4a.js');
|
|
9
9
|
const subject = require('./subject-7f9d42d8.js');
|
|
10
10
|
const designToken = require('./designToken-d6319bd0.js');
|
|
11
|
-
const ui = require('./ui-
|
|
11
|
+
const ui = require('./ui-67d89fc1.js');
|
|
12
12
|
require('./featureFlagController-c6a26489.js');
|
|
13
13
|
require('./log-7b0974fb.js');
|
|
14
14
|
require('./ui-674b81d0.js');
|