@globalpayments/vega 2.39.0 → 2.40.0
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-dd3e7925.js → app-globals-cdd0972c.js} +12 -1
- package/dist/cjs/check-box-required-rule-1ee54b9a.js +70 -0
- package/dist/cjs/date-required-rule-4e1f84fd.js +92 -0
- package/dist/cjs/{element-appender-slimmer-c6e0f4ca.js → element-appender-slimmer-4f0dc8c6.js} +9 -5
- package/dist/cjs/file-uploader-required-rule-313ec9e3.js +21 -0
- package/dist/cjs/{form-field-controller-slimmer-48c0ad0b.js → form-field-controller-slimmer-d92e8212.js} +28 -1
- package/dist/cjs/index.cjs.js +22 -1
- package/dist/cjs/input-phone-number-required-rule-2668fdf1.js +65 -0
- package/dist/cjs/input-range-required-rule-5b9c2a95.js +63 -0
- package/dist/cjs/internal-form-field-validation-rule.abstract-07cdff46.js +15 -0
- package/dist/cjs/loader.cjs.js +3 -2
- package/dist/cjs/{min-number-rule-115c5a3b.js → min-number-rule-5bcccc8f.js} +7 -4
- package/dist/cjs/{min-string-length-rule-75f24a48.js → min-string-length-rule-af215976.js} +8 -4
- package/dist/cjs/public-rules-90b972e5.js +42 -0
- package/dist/cjs/{required-field-rule-7f9945fa.js → required-field-rule-d73c1d8c.js} +6 -3
- package/dist/cjs/rich-text-editor-required-rule-cacc5fe0.js +64 -0
- package/dist/cjs/time-required-rule-ccf178e7.js +141 -0
- package/dist/cjs/toggle-switch-required-rule-88a51b36.js +66 -0
- package/dist/cjs/{valid-credit-card-number-rule-4a9ae5d9.js → valid-credit-card-number-rule-4a1b00b8.js} +3 -2
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +11 -79
- package/dist/cjs/vega-color-picker.cjs.entry.js +3 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +3 -2
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +8 -90
- package/dist/cjs/vega-dialog_2.cjs.entry.js +29 -1
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +1 -1
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +5 -19
- package/dist/cjs/vega-form.cjs.entry.js +2 -1
- package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -2
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +4 -3
- package/dist/cjs/vega-input-numeric.cjs.entry.js +3 -2
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +7 -63
- package/dist/cjs/vega-input-range.cjs.entry.js +6 -61
- package/dist/cjs/vega-input-select.cjs.entry.js +3 -2
- package/dist/cjs/vega-input.cjs.entry.js +7 -6
- package/dist/cjs/vega-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-radio_2.cjs.entry.js +3 -2
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +4 -60
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +3 -2
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +3 -2
- package/dist/cjs/vega-signature-capture.cjs.entry.js +3 -2
- package/dist/cjs/vega-stepper.cjs.entry.js +3 -2
- package/dist/cjs/vega-textarea.cjs.entry.js +4 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +11 -140
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +4 -63
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +53 -12
- package/dist/cjs/vega.cjs.js +3 -2
- package/dist/collection/components/vega-checkbox/vega-checkbox.css +82 -33
- package/dist/collection/components/vega-checkbox/vega-checkbox.js +8 -13
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +2 -2
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-layout-controller.js +9 -0
- package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-scroll-controller.js +16 -0
- package/dist/collection/components/vega-modal/vega-modal.js +6 -0
- package/dist/collection/components/vega-tooltip/slimmers/controllers/vega-tooltip-element-appender-controller.js +45 -11
- package/dist/collection/components/vega-tooltip/vega-tooltip.js +12 -0
- package/dist/collection/global/scripts/before-vega-load.js +11 -0
- package/dist/collection/helpers/slimmers/element-appender-slimmer.js +8 -5
- package/dist/collection/helpers/slimmers/test/element-appender-slimmer.test.js +2 -0
- package/dist/collection/helpers/ui/element-appender.js +1 -0
- package/dist/collection/helpers/ui/test/element-appender.test.js +1 -0
- package/dist/collection/helpers/validator/form-field-controller.js +28 -1
- package/dist/collection/helpers/validator/public-rules.js +10 -0
- package/dist/collection/helpers/validator/rules/check-box-required-rule.js +4 -3
- package/dist/collection/helpers/validator/rules/date-range-rule.js +2 -1
- package/dist/collection/helpers/validator/rules/date-required-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/email-field-rule.js +3 -2
- package/dist/collection/helpers/validator/rules/{object-array-required-rule.js → file-uploader-required-rule.js} +1 -1
- package/dist/collection/helpers/validator/rules/input-phone-number-required-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/input-range-min-and-max-rule.js +3 -1
- package/dist/collection/helpers/validator/rules/input-range-required-rule.js +5 -4
- package/dist/collection/helpers/validator/rules/internal-form-field-validation-rule.abstract.js +11 -0
- package/dist/collection/helpers/validator/rules/max-number-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/max-string-length-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/min-and-max-date-rule.js +3 -1
- package/dist/collection/helpers/validator/rules/min-number-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/min-string-length-rule.js +4 -2
- package/dist/collection/helpers/validator/rules/required-field-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/rich-text-editor-required-rule.js +4 -3
- package/dist/collection/helpers/validator/rules/time-range-required-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/time-range-rule.js +3 -1
- package/dist/collection/helpers/validator/rules/time-required-rule.js +5 -3
- package/dist/collection/helpers/validator/rules/toggle-switch-required-rule.js +4 -3
- package/dist/collection/helpers/validator/rules/valid-credit-card-number-rule.js +3 -2
- package/dist/collection/helpers/validator/rules/valid-phone-number-rule.js +4 -2
- package/dist/collection/helpers/validator/test/rules/file-uploader-required-rule.test.js +7 -0
- package/dist/collection/helpers/validator/test/rules/public-rules.test.js +80 -0
- package/dist/collection/index.js +1 -0
- package/dist/esm/{app-globals-c954167a.js → app-globals-88fa3549.js} +12 -1
- package/dist/esm/check-box-required-rule-cb0aa339.js +68 -0
- package/dist/esm/{date-732bc749.js → date-c55b97f0.js} +1 -1
- package/dist/esm/date-required-rule-8944f3bf.js +90 -0
- package/dist/esm/{element-appender-slimmer-f5e703f3.js → element-appender-slimmer-d9155ee0.js} +9 -5
- package/dist/esm/file-uploader-required-rule-ad886d01.js +19 -0
- package/dist/esm/{form-field-controller-slimmer-7a9f2b2e.js → form-field-controller-slimmer-bb64dec7.js} +28 -1
- package/dist/esm/index.js +12 -1
- package/dist/esm/input-phone-number-required-rule-be6a5572.js +63 -0
- package/dist/esm/input-range-required-rule-3ad74776.js +61 -0
- package/dist/esm/internal-form-field-validation-rule.abstract-f5b6bdbf.js +13 -0
- package/dist/esm/loader.js +3 -2
- package/dist/esm/{min-number-rule-31d48b22.js → min-number-rule-a6082418.js} +7 -4
- package/dist/esm/{min-string-length-rule-c6a69eeb.js → min-string-length-rule-c31c89f4.js} +8 -4
- package/dist/esm/public-rules-413f6a17.js +27 -0
- package/dist/esm/{required-field-rule-368b31fa.js → required-field-rule-ab4bdc47.js} +6 -3
- package/dist/esm/rich-text-editor-required-rule-75cc2db0.js +62 -0
- package/dist/esm/time-required-rule-a01163b5.js +138 -0
- package/dist/esm/toggle-switch-required-rule-b3cf4302.js +64 -0
- package/dist/esm/{valid-credit-card-number-rule-2aef3ad5.js → valid-credit-card-number-rule-cc497bec.js} +3 -2
- package/dist/esm/vega-calendar_3.entry.js +1 -1
- package/dist/esm/vega-checkbox_2.entry.js +11 -79
- package/dist/esm/vega-color-picker.entry.js +3 -2
- package/dist/esm/vega-combo-box.entry.js +3 -2
- package/dist/esm/vega-date-picker_2.entry.js +8 -90
- package/dist/esm/vega-dialog_2.entry.js +29 -1
- package/dist/esm/vega-dropdown_5.entry.js +1 -1
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +5 -19
- package/dist/esm/vega-form.entry.js +2 -1
- package/dist/esm/vega-image-uploader.entry.js +3 -2
- package/dist/esm/vega-input-credit-card.entry.js +4 -3
- package/dist/esm/vega-input-numeric.entry.js +3 -2
- package/dist/esm/vega-input-phone-number.entry.js +6 -62
- package/dist/esm/vega-input-range.entry.js +5 -60
- package/dist/esm/vega-input-select.entry.js +3 -2
- package/dist/esm/vega-input.entry.js +7 -6
- package/dist/esm/vega-popover_2.entry.js +1 -1
- package/dist/esm/vega-radio_2.entry.js +3 -2
- package/dist/esm/vega-rich-text-editor_4.entry.js +3 -59
- package/dist/esm/vega-selection-chip_2.entry.js +3 -2
- package/dist/esm/vega-selection-tile_2.entry.js +3 -2
- package/dist/esm/vega-signature-capture.entry.js +3 -2
- package/dist/esm/vega-stepper.entry.js +3 -2
- package/dist/esm/vega-textarea.entry.js +4 -3
- package/dist/esm/vega-time-picker_2.entry.js +7 -136
- package/dist/esm/vega-toggle-switch.entry.js +3 -62
- package/dist/esm/vega-tooltip_2.entry.js +53 -12
- package/dist/esm/vega.js +3 -2
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-layout-controller.d.ts +4 -0
- package/dist/types/components/vega-modal/slimmers/controllers/vega-modal-scroll-controller.d.ts +5 -0
- package/dist/types/components/vega-modal/vega-modal.d.ts +1 -0
- package/dist/types/components/vega-tooltip/slimmers/controllers/vega-tooltip-element-appender-controller.d.ts +18 -0
- package/dist/types/components/vega-tooltip/vega-tooltip.d.ts +4 -0
- package/dist/types/helpers/slimmers/element-appender-slimmer.d.ts +1 -0
- package/dist/types/helpers/slimmers/form-field-controller-slimmer.d.ts +2 -1
- package/dist/types/helpers/validator/form-field-controller.d.ts +10 -0
- package/dist/types/helpers/validator/public-rules.d.ts +10 -0
- package/dist/types/helpers/validator/rules/check-box-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/date-range-rule.d.ts +3 -2
- package/dist/types/helpers/validator/rules/date-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/email-field-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/{object-array-required-rule.d.ts → file-uploader-required-rule.d.ts} +1 -1
- package/dist/types/helpers/validator/rules/input-phone-number-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/input-range-min-and-max-rule.d.ts +3 -2
- package/dist/types/helpers/validator/rules/input-range-required-rule.d.ts +8 -7
- package/dist/types/helpers/validator/rules/internal-form-field-validation-rule.abstract.d.ts +19 -0
- package/dist/types/helpers/validator/rules/max-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/max-string-length-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/min-and-max-date-rule.d.ts +3 -2
- package/dist/types/helpers/validator/rules/min-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/min-string-length-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/required-field-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/rich-text-editor-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/time-range-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/time-range-rule.d.ts +3 -2
- package/dist/types/helpers/validator/rules/time-required-rule.d.ts +7 -6
- package/dist/types/helpers/validator/rules/toggle-switch-required-rule.d.ts +5 -4
- package/dist/types/helpers/validator/rules/valid-credit-card-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/rules/valid-phone-number-rule.d.ts +4 -3
- package/dist/types/helpers/validator/test/rules/public-rules.test.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/public-api.d.ts +1 -1
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-04c72f30.entry.js +1 -0
- package/dist/vega/p-07c2725a.js +1 -0
- package/dist/vega/{p-b5990090.js → p-08835909.js} +1 -1
- package/dist/vega/p-0b6d4561.entry.js +1 -0
- package/dist/vega/p-0bb860cc.js +1 -0
- package/dist/vega/p-113cd659.entry.js +1 -0
- package/dist/vega/{p-64e49394.entry.js → p-154d262e.entry.js} +1 -1
- package/dist/vega/p-17598aac.entry.js +1 -0
- package/dist/vega/p-23130825.entry.js +1 -0
- package/dist/vega/p-280cbcdb.js +1 -0
- package/dist/vega/{p-4b19706c.entry.js → p-3299c30b.entry.js} +1 -1
- package/dist/vega/p-3fd9d39f.entry.js +1 -0
- package/dist/vega/p-42a949f5.entry.js +1 -0
- package/dist/vega/p-4bd1b877.entry.js +1 -0
- package/dist/vega/p-590fd123.js +1 -0
- package/dist/vega/{p-d2e6090a.js → p-5a7eabcc.js} +1 -1
- package/dist/vega/p-5e56f3bd.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-612c9374.entry.js +1 -0
- package/dist/vega/{p-9ee23f34.entry.js → p-6585bddc.entry.js} +2 -2
- package/dist/vega/p-6603081a.entry.js +1 -0
- package/dist/vega/p-6f90d444.js +1 -0
- package/dist/vega/p-7303fff2.entry.js +1 -0
- package/dist/vega/p-7b648a05.entry.js +1 -0
- package/dist/vega/p-7c0b4c36.js +1 -0
- package/dist/vega/p-81b21503.entry.js +1 -0
- package/dist/vega/p-8fae8f9e.js +1 -0
- package/dist/vega/p-924b4e24.js +1 -0
- package/dist/vega/{p-ea78ddfa.entry.js → p-94459733.entry.js} +1 -1
- package/dist/vega/p-a05ca459.entry.js +1 -0
- package/dist/vega/p-a3e80fb2.entry.js +1 -0
- package/dist/vega/p-a7a46358.entry.js +1 -0
- package/dist/vega/p-abd7aeaa.js +1 -0
- package/dist/vega/p-b24da503.entry.js +1 -0
- package/dist/vega/p-b44f3309.js +1 -0
- package/dist/vega/p-b9051ad2.js +1 -0
- package/dist/vega/{p-4ab0d645.js → p-c253d09c.js} +1 -1
- package/dist/vega/p-c56acdd5.entry.js +1 -0
- package/dist/vega/p-cdbbdcc2.js +1 -0
- package/dist/vega/p-d1a06058.entry.js +1 -0
- package/dist/vega/p-d51b04ce.entry.js +1 -0
- package/dist/vega/p-e0446879.js +1 -0
- package/dist/vega/p-e08b6542.entry.js +1 -0
- package/dist/vega/p-f396c69a.js +1 -0
- package/dist/vega/p-fda6c178.entry.js +1 -0
- package/dist/vega/p-ffac4b8c.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/collection/helpers/validator/test/rules/object-array-required-rule.test.js +0 -7
- package/dist/vega/p-0b697841.entry.js +0 -1
- package/dist/vega/p-257b1bc2.entry.js +0 -1
- package/dist/vega/p-3152031c.js +0 -1
- package/dist/vega/p-3c85a11b.entry.js +0 -1
- package/dist/vega/p-49bf2b3a.js +0 -1
- package/dist/vega/p-4a8db510.entry.js +0 -1
- package/dist/vega/p-4e436842.entry.js +0 -1
- package/dist/vega/p-59834ea4.entry.js +0 -1
- package/dist/vega/p-59cfed37.entry.js +0 -1
- package/dist/vega/p-60e1ebe1.entry.js +0 -1
- package/dist/vega/p-629bd266.entry.js +0 -1
- package/dist/vega/p-64e0c944.entry.js +0 -1
- package/dist/vega/p-66b9e86d.entry.js +0 -1
- package/dist/vega/p-74958b1a.js +0 -1
- package/dist/vega/p-74ff73d6.entry.js +0 -1
- package/dist/vega/p-8120e7a1.entry.js +0 -1
- package/dist/vega/p-894c067a.entry.js +0 -1
- package/dist/vega/p-989b36a2.entry.js +0 -1
- package/dist/vega/p-a8a809e1.entry.js +0 -1
- package/dist/vega/p-b6bffdf3.entry.js +0 -1
- package/dist/vega/p-bf6d3c00.entry.js +0 -1
- package/dist/vega/p-c00fde35.entry.js +0 -1
- package/dist/vega/p-c2e96537.entry.js +0 -1
- package/dist/vega/p-ce94a9c5.entry.js +0 -1
- package/dist/vega/p-d03945cb.entry.js +0 -1
- package/dist/vega/p-f41102cd.js +0 -1
- package/dist/vega/p-f5b0ce61.js +0 -1
- package/dist/vega/p-fc49a98e.entry.js +0 -1
- /package/dist/types/helpers/validator/test/rules/{object-array-required-rule.test.d.ts → file-uploader-required-rule.test.d.ts} +0 -0
package/dist/cjs/vega.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index-09acd3c9.js');
|
|
4
|
-
const appGlobals = require('./app-globals-
|
|
4
|
+
const appGlobals = require('./app-globals-cdd0972c.js');
|
|
5
5
|
require('./feature-flag-controller-7b22e598.js');
|
|
6
6
|
require('./global-slimmer-registry-b3bce7e0.js');
|
|
7
7
|
require('./index-8b247c17.js');
|
|
@@ -31,7 +31,8 @@ require('./vega-env-manager-23b8b23c.js');
|
|
|
31
31
|
require('./icon-manager-edc2400b.js');
|
|
32
32
|
require('./index-0546e2ea.js');
|
|
33
33
|
require('./translation-6848c389.js');
|
|
34
|
-
require('./valid-credit-card-number-rule-
|
|
34
|
+
require('./valid-credit-card-number-rule-4a1b00b8.js');
|
|
35
|
+
require('./internal-form-field-validation-rule.abstract-07cdff46.js');
|
|
35
36
|
|
|
36
37
|
/*
|
|
37
38
|
Stencil Client Patch Browser v2.17.4 | MIT Licensed | https://stenciljs.com
|
|
@@ -42,13 +42,6 @@
|
|
|
42
42
|
color: rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.vega-checkbox-container > .vega-checkbox-icon.vega-checkbox-small {
|
|
46
|
-
width: 16px;
|
|
47
|
-
height: 16px;
|
|
48
|
-
min-width: 16px;
|
|
49
|
-
border-radius: 2px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
45
|
.vega-checkbox-container > .vega-checkbox-icon:hover {
|
|
53
46
|
border: 1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));
|
|
54
47
|
}
|
|
@@ -182,84 +175,140 @@
|
|
|
182
175
|
}
|
|
183
176
|
}
|
|
184
177
|
|
|
185
|
-
.vega-checkbox-container > .vega-checkbox-label-container
|
|
186
|
-
|
|
178
|
+
:host(.disabled) .vega-checkbox-container > .vega-checkbox-label-container {
|
|
179
|
+
color: rgba(var(--v-text-disabled, 176, 180, 181, 1));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.vega-error {
|
|
183
|
+
display: block;
|
|
184
|
+
margin-top: 12px;
|
|
187
185
|
font-family: "Inter", sans-serif;
|
|
188
186
|
font-size: 14px;
|
|
189
187
|
font-weight: 400;
|
|
190
188
|
line-height: 18px;
|
|
189
|
+
letter-spacing: 0px;
|
|
190
|
+
color: rgba(var(--v-text-error, 189, 41, 71, 1));
|
|
191
191
|
}
|
|
192
192
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
193
|
-
.vega-
|
|
193
|
+
.vega-error {
|
|
194
194
|
font-family: "Inter", sans-serif;
|
|
195
195
|
font-size: 14px;
|
|
196
196
|
font-weight: 400;
|
|
197
197
|
line-height: 18px;
|
|
198
|
+
letter-spacing: 0px;
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
201
|
@media screen and (min-width: 1024px) and (max-width: 1439px) {
|
|
201
|
-
.vega-
|
|
202
|
+
.vega-error {
|
|
202
203
|
font-family: "Inter", sans-serif;
|
|
203
204
|
font-size: 14px;
|
|
204
205
|
font-weight: 400;
|
|
205
206
|
line-height: 18px;
|
|
207
|
+
letter-spacing: 0px;
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
210
|
@media screen and (min-width: 1440px) and (max-width: 9999px) {
|
|
209
|
-
.vega-
|
|
211
|
+
.vega-error {
|
|
210
212
|
font-family: "Inter", sans-serif;
|
|
211
213
|
font-size: 14px;
|
|
212
214
|
font-weight: 400;
|
|
213
215
|
line-height: 18px;
|
|
216
|
+
letter-spacing: 0px;
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
219
|
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
.vega-checkbox-label-container.vega-hidden {
|
|
221
|
+
display: none;
|
|
219
222
|
}
|
|
220
223
|
|
|
221
|
-
.vega-
|
|
222
|
-
display:
|
|
223
|
-
|
|
224
|
+
.vega-hidden {
|
|
225
|
+
display: none;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.size-default input[type=checkbox] {
|
|
229
|
+
width: 24px;
|
|
230
|
+
height: 24px;
|
|
231
|
+
}
|
|
232
|
+
.size-default .vega-checkbox-icon {
|
|
233
|
+
width: 24px;
|
|
234
|
+
height: 24px;
|
|
235
|
+
min-width: 24px;
|
|
236
|
+
border-radius: 4px;
|
|
237
|
+
}
|
|
238
|
+
.size-default .vega-checkbox-label-container {
|
|
239
|
+
margin-left: 12px;
|
|
240
|
+
font-family: "Inter", sans-serif;
|
|
241
|
+
font-size: 16px;
|
|
242
|
+
font-weight: 400;
|
|
243
|
+
line-height: 24px;
|
|
244
|
+
letter-spacing: 0px;
|
|
245
|
+
}
|
|
246
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
247
|
+
.size-default .vega-checkbox-label-container {
|
|
248
|
+
font-family: "Inter", sans-serif;
|
|
249
|
+
font-size: 16px;
|
|
250
|
+
font-weight: 400;
|
|
251
|
+
line-height: 24px;
|
|
252
|
+
letter-spacing: 0px;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
@media screen and (min-width: 1024px) and (max-width: 1439px) {
|
|
256
|
+
.size-default .vega-checkbox-label-container {
|
|
257
|
+
font-family: "Inter", sans-serif;
|
|
258
|
+
font-size: 16px;
|
|
259
|
+
font-weight: 400;
|
|
260
|
+
line-height: 24px;
|
|
261
|
+
letter-spacing: 0px;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
@media screen and (min-width: 1440px) and (max-width: 9999px) {
|
|
265
|
+
.size-default .vega-checkbox-label-container {
|
|
266
|
+
font-family: "Inter", sans-serif;
|
|
267
|
+
font-size: 16px;
|
|
268
|
+
font-weight: 400;
|
|
269
|
+
line-height: 24px;
|
|
270
|
+
letter-spacing: 0px;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.size-small input[type=checkbox] {
|
|
275
|
+
width: 16px;
|
|
276
|
+
height: 16px;
|
|
277
|
+
}
|
|
278
|
+
.size-small .vega-checkbox-icon {
|
|
279
|
+
width: 16px;
|
|
280
|
+
height: 16px;
|
|
281
|
+
min-width: 16px;
|
|
282
|
+
border-radius: 2px;
|
|
283
|
+
}
|
|
284
|
+
.size-small .vega-checkbox-label-container {
|
|
285
|
+
margin-left: 8px;
|
|
224
286
|
font-family: "Inter", sans-serif;
|
|
225
287
|
font-size: 14px;
|
|
226
288
|
font-weight: 400;
|
|
227
289
|
line-height: 18px;
|
|
228
|
-
letter-spacing: 0px;
|
|
229
|
-
color: rgba(var(--v-text-error, 189, 41, 71, 1));
|
|
230
290
|
}
|
|
231
291
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
232
|
-
.vega-
|
|
292
|
+
.size-small .vega-checkbox-label-container {
|
|
233
293
|
font-family: "Inter", sans-serif;
|
|
234
294
|
font-size: 14px;
|
|
235
295
|
font-weight: 400;
|
|
236
296
|
line-height: 18px;
|
|
237
|
-
letter-spacing: 0px;
|
|
238
297
|
}
|
|
239
298
|
}
|
|
240
299
|
@media screen and (min-width: 1024px) and (max-width: 1439px) {
|
|
241
|
-
.vega-
|
|
300
|
+
.size-small .vega-checkbox-label-container {
|
|
242
301
|
font-family: "Inter", sans-serif;
|
|
243
302
|
font-size: 14px;
|
|
244
303
|
font-weight: 400;
|
|
245
304
|
line-height: 18px;
|
|
246
|
-
letter-spacing: 0px;
|
|
247
305
|
}
|
|
248
306
|
}
|
|
249
307
|
@media screen and (min-width: 1440px) and (max-width: 9999px) {
|
|
250
|
-
.vega-
|
|
308
|
+
.size-small .vega-checkbox-label-container {
|
|
251
309
|
font-family: "Inter", sans-serif;
|
|
252
310
|
font-size: 14px;
|
|
253
311
|
font-weight: 400;
|
|
254
312
|
line-height: 18px;
|
|
255
|
-
letter-spacing: 0px;
|
|
256
313
|
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.vega-checkbox-label-container.vega-hidden {
|
|
260
|
-
display: none;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.vega-hidden {
|
|
264
|
-
display: none;
|
|
265
314
|
}
|
|
@@ -11,7 +11,7 @@ import { CheckBoxRequiredRule } from '../../helpers/validator/rules/check-box-re
|
|
|
11
11
|
import ChangeManager from '../../helpers/change-manager/change-manager';
|
|
12
12
|
import { CHECKBOX_GROUP_DISABLED_CHANGE, CHECKBOX_VALUE_CHANGE, FORM_ELEMENT_VALUE_CHANGE, } from '../../helpers/change-manager/subject/static-subject/static-subject-title';
|
|
13
13
|
import { Observer } from '../../helpers/change-manager/observer/observer';
|
|
14
|
-
import { findParent } from '../../utils/ui';
|
|
14
|
+
import { arrayToClassString, findParent } from '../../utils/ui';
|
|
15
15
|
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer } from 'vega-slimmer/core';
|
|
16
16
|
import { FormFieldControllerSlimmer } from '../../helpers/slimmers/form-field-controller-slimmer';
|
|
17
17
|
import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/event-emit-slimmer';
|
|
@@ -162,19 +162,14 @@ export class VegaCheckbox {
|
|
|
162
162
|
'checked': this.checked,
|
|
163
163
|
'disabled': this.isDisabled(),
|
|
164
164
|
} },
|
|
165
|
-
h("label", { class:
|
|
166
|
-
'vega-checkbox-container'
|
|
167
|
-
'error'
|
|
168
|
-
|
|
165
|
+
h("label", { class: arrayToClassString([
|
|
166
|
+
'vega-checkbox-container',
|
|
167
|
+
this.showError && 'error',
|
|
168
|
+
this.size && `size-${this.size}`,
|
|
169
|
+
]), ref: (e) => (this.inputContainerRef = e) },
|
|
169
170
|
h("input", { ref: (e) => (this.inputRef = e), type: "checkbox", checked: this.checked, value: this.identifier, onChange: this.onCheckBoxChange, "aria-label": this.identifier || 'No label defined', disabled: this.isDisabled(), role: 'button', tabIndex: 0, onKeyDown: createEnterKeyHandlerToTriggerClick() }),
|
|
170
|
-
h("span", { class:
|
|
171
|
-
|
|
172
|
-
'vega-checkbox-small': this.size === 'small',
|
|
173
|
-
}, onClick: this.onSelectedIconClick, tabIndex: -1 }, this.renderIconDom()),
|
|
174
|
-
h("div", { class: {
|
|
175
|
-
'vega-checkbox-label-container': true,
|
|
176
|
-
'vega-checkbox-label-small': this.size === 'small',
|
|
177
|
-
}, ref: (el) => (this.labelElement = el) },
|
|
171
|
+
h("span", { class: "vega-checkbox-icon", onClick: this.onSelectedIconClick, tabIndex: -1 }, this.renderIconDom()),
|
|
172
|
+
h("div", { class: "vega-checkbox-label-container", ref: (el) => (this.labelElement = el) },
|
|
178
173
|
this.renderLabelDom(),
|
|
179
174
|
this.renderRequireDom()))), this.host);
|
|
180
175
|
}
|
|
@@ -16,7 +16,7 @@ import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/ev
|
|
|
16
16
|
import { VegaChange, VegaPreview, VegaRemove, VegaRetry, VegaSelectFileChange, } from '../../helpers/event-manager/event-id/vega-event-id';
|
|
17
17
|
import { VegaFileUploaderValueController } from './slimmers/controllers/vega-file-uploader-value-controller';
|
|
18
18
|
import { FormFieldControllerSlimmer } from '../../helpers/slimmers/form-field-controller-slimmer';
|
|
19
|
-
import {
|
|
19
|
+
import { FileUploaderRequiredRule } from '../../helpers/validator/rules/file-uploader-required-rule';
|
|
20
20
|
import { VegaFileUploaderDropFileFilterController } from './slimmers/controllers/vega-file-uploader-drop-file-filter-controller';
|
|
21
21
|
import { TranslationSlimmer } from '../../helpers/slimmers/translation';
|
|
22
22
|
import { VegaFileUploaderFileLimitController } from './slimmers/controllers/vega-file-uploader-file-limit-controller';
|
|
@@ -32,7 +32,7 @@ export class VegaFileUploader {
|
|
|
32
32
|
propertyRules: [
|
|
33
33
|
{
|
|
34
34
|
propertyName: 'required',
|
|
35
|
-
ruleFactory: (isRequired) =>
|
|
35
|
+
ruleFactory: (isRequired) => isRequired ? new FileUploaderRequiredRule() : null,
|
|
36
36
|
},
|
|
37
37
|
],
|
|
38
38
|
validationRulesName: 'validationRules',
|
package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-layout-controller.js
CHANGED
|
@@ -48,6 +48,12 @@ export class VegaModalLayoutController extends VegaSlimmer {
|
|
|
48
48
|
watchSize() {
|
|
49
49
|
this.setModalWidth('update');
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Listen watchContentMaxHeight method to be called
|
|
53
|
+
*/
|
|
54
|
+
watchContentMaxHeight() {
|
|
55
|
+
this.setContentMaxHeight();
|
|
56
|
+
}
|
|
51
57
|
/*
|
|
52
58
|
* The below method is e2e-test covered in
|
|
53
59
|
* @see{module:vega-modal-default-e2e}
|
|
@@ -134,3 +140,6 @@ __decorate([
|
|
|
134
140
|
__decorate([
|
|
135
141
|
MapToComponentMethod('watchSize')
|
|
136
142
|
], VegaModalLayoutController.prototype, "watchSize", null);
|
|
143
|
+
__decorate([
|
|
144
|
+
MapToComponentMethod('watchContentMaxHeight')
|
|
145
|
+
], VegaModalLayoutController.prototype, "watchContentMaxHeight", null);
|
package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-scroll-controller.js
CHANGED
|
@@ -11,6 +11,10 @@ import { SHADOW_ROOT_ELEMENT_SCROLLING } from '../../../../helpers/change-manage
|
|
|
11
11
|
* Modal scroll controller
|
|
12
12
|
*/
|
|
13
13
|
export class VegaModalScrollController extends VegaSlimmer {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.scrollEventListenerAdded = false;
|
|
17
|
+
}
|
|
14
18
|
/**
|
|
15
19
|
* Component lifecycle - [connectedCallback]
|
|
16
20
|
*/
|
|
@@ -19,6 +23,14 @@ export class VegaModalScrollController extends VegaSlimmer {
|
|
|
19
23
|
this.listenContentScroll();
|
|
20
24
|
}
|
|
21
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Listen watchContentMaxHeight method to be called
|
|
28
|
+
*/
|
|
29
|
+
watchContentMaxHeight() {
|
|
30
|
+
if (!this.scrollEventListenerAdded && this.isContentScrollable()) {
|
|
31
|
+
this.listenContentScroll();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
22
34
|
/**
|
|
23
35
|
* Is modal content scrollable.
|
|
24
36
|
*
|
|
@@ -47,6 +59,7 @@ export class VegaModalScrollController extends VegaSlimmer {
|
|
|
47
59
|
}
|
|
48
60
|
this.notifyContentScrolling();
|
|
49
61
|
});
|
|
62
|
+
this.scrollEventListenerAdded = true;
|
|
50
63
|
}
|
|
51
64
|
/*
|
|
52
65
|
* The below method is e2e-test covered in
|
|
@@ -74,3 +87,6 @@ __decorate([
|
|
|
74
87
|
__decorate([
|
|
75
88
|
MapToComponentMethod('componentDidLoad')
|
|
76
89
|
], VegaModalScrollController.prototype, "componentDidLoad", null);
|
|
90
|
+
__decorate([
|
|
91
|
+
MapToComponentMethod('watchContentMaxHeight')
|
|
92
|
+
], VegaModalScrollController.prototype, "watchContentMaxHeight", null);
|
|
@@ -143,6 +143,9 @@ export class VegaModal {
|
|
|
143
143
|
watchOpen() {
|
|
144
144
|
methodPlaceholder();
|
|
145
145
|
}
|
|
146
|
+
watchContentMaxHeight() {
|
|
147
|
+
methodPlaceholder();
|
|
148
|
+
}
|
|
146
149
|
disconnectedCallback() {
|
|
147
150
|
this.open = false;
|
|
148
151
|
}
|
|
@@ -596,6 +599,9 @@ export class VegaModal {
|
|
|
596
599
|
}, {
|
|
597
600
|
"propName": "open",
|
|
598
601
|
"methodName": "watchOpen"
|
|
602
|
+
}, {
|
|
603
|
+
"propName": "contentMaxHeight",
|
|
604
|
+
"methodName": "watchContentMaxHeight"
|
|
599
605
|
}]; }
|
|
600
606
|
static get listeners() { return [{
|
|
601
607
|
"name": "click",
|
|
@@ -14,17 +14,25 @@ export class VegaTooltipElementAppenderController extends ElementAppenderSlimmer
|
|
|
14
14
|
* This constructor of the tooltip element appender controller.
|
|
15
15
|
*/
|
|
16
16
|
constructor() {
|
|
17
|
-
super(() => (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
super(() => this.getShowConfig(), () => this.trigger, 'isTooltipShow', () => this.disableInteractive);
|
|
18
|
+
/**
|
|
19
|
+
* Generate the element appender show config object.
|
|
20
|
+
*
|
|
21
|
+
* @returns {ElementAppenderShowConfig} - Show config object.
|
|
22
|
+
*/
|
|
23
|
+
this.getShowConfig = () => {
|
|
24
|
+
return {
|
|
25
|
+
target: this.host,
|
|
26
|
+
appendableElement: this.vegaTooltipContentBoxRenderer.getTooltipContentBoxRef(),
|
|
27
|
+
positionRelativeTo: this.positionRelativeTo,
|
|
28
|
+
matchTargetWidth: false,
|
|
29
|
+
size: this.size,
|
|
30
|
+
minWidth: this.minWidth,
|
|
31
|
+
maxWidth: this.maxWidth,
|
|
32
|
+
placement: this.placement,
|
|
33
|
+
alignment: this.alignment,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
30
38
|
* The `watchTrigger` function hides an element if the trigger is set to 'none'.
|
|
@@ -42,6 +50,26 @@ export class VegaTooltipElementAppenderController extends ElementAppenderSlimmer
|
|
|
42
50
|
this.show();
|
|
43
51
|
}
|
|
44
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Hide the tooltip if the content change to empty.
|
|
55
|
+
*
|
|
56
|
+
* @param {string} newText - The property text or content new value.
|
|
57
|
+
* @param {string} oldText - The property text or content old value.
|
|
58
|
+
*/
|
|
59
|
+
watchTextChange(newText, oldText) {
|
|
60
|
+
if (!newText && oldText && this.isTooltipShow) {
|
|
61
|
+
this.hide();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Override the parent class `ElementAppenderSlimmer` show method to control the tooltip show according to the tooltip content.
|
|
66
|
+
*/
|
|
67
|
+
show() {
|
|
68
|
+
const text = this.deprecatedPropertySlimmer.getValue();
|
|
69
|
+
if (text) {
|
|
70
|
+
super.show();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
45
73
|
}
|
|
46
74
|
__decorate([
|
|
47
75
|
MapToComponentField()
|
|
@@ -70,6 +98,9 @@ __decorate([
|
|
|
70
98
|
__decorate([
|
|
71
99
|
MapToComponentField()
|
|
72
100
|
], VegaTooltipElementAppenderController.prototype, "disableInteractive", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
MapToComponentField()
|
|
103
|
+
], VegaTooltipElementAppenderController.prototype, "deprecatedPropertySlimmer", void 0);
|
|
73
104
|
__decorate([
|
|
74
105
|
MapToComponentField({ writable: true })
|
|
75
106
|
], VegaTooltipElementAppenderController.prototype, "isTooltipShow", void 0);
|
|
@@ -82,3 +113,6 @@ __decorate([
|
|
|
82
113
|
__decorate([
|
|
83
114
|
MapToComponentMethod('watchToShowTooltip')
|
|
84
115
|
], VegaTooltipElementAppenderController.prototype, "watchToShowTooltip", null);
|
|
116
|
+
__decorate([
|
|
117
|
+
MapToComponentMethod('watchTextChange')
|
|
118
|
+
], VegaTooltipElementAppenderController.prototype, "watchTextChange", null);
|
|
@@ -64,6 +64,12 @@ export class VegaTooltip {
|
|
|
64
64
|
watchTrigger() {
|
|
65
65
|
methodPlaceholder();
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Monitor the property text updates.
|
|
69
|
+
*/
|
|
70
|
+
watchTextChange() {
|
|
71
|
+
methodPlaceholder();
|
|
72
|
+
}
|
|
67
73
|
watchToShowTooltip() {
|
|
68
74
|
methodPlaceholder();
|
|
69
75
|
}
|
|
@@ -333,6 +339,12 @@ export class VegaTooltip {
|
|
|
333
339
|
static get watchers() { return [{
|
|
334
340
|
"propName": "trigger",
|
|
335
341
|
"methodName": "watchTrigger"
|
|
342
|
+
}, {
|
|
343
|
+
"propName": "content",
|
|
344
|
+
"methodName": "watchTextChange"
|
|
345
|
+
}, {
|
|
346
|
+
"propName": "text",
|
|
347
|
+
"methodName": "watchTextChange"
|
|
336
348
|
}, {
|
|
337
349
|
"propName": "size",
|
|
338
350
|
"methodName": "watchToShowTooltip"
|
|
@@ -40,6 +40,7 @@ export default function () {
|
|
|
40
40
|
injectVegaSkeletonLoaderIntoGlobal();
|
|
41
41
|
injectVegaTranslationIntoGlobal();
|
|
42
42
|
injectVegaRichTextEditorClassIntoGlobal();
|
|
43
|
+
injectVegaPublicValidationRules();
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* Disable feature flags from the client global defined lists.
|
|
@@ -172,3 +173,13 @@ function injectVegaTranslationIntoGlobal() {
|
|
|
172
173
|
function injectVegaRichTextEditorClassIntoGlobal() {
|
|
173
174
|
globalThis.VegaRTEContent = VegaRTEContent;
|
|
174
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Inject VegaPublicValidationRules to global as a public api
|
|
178
|
+
*/
|
|
179
|
+
function injectVegaPublicValidationRules() {
|
|
180
|
+
void import('../../helpers/validator/public-rules').then((module) => {
|
|
181
|
+
Object.entries(module).forEach(([name, value]) => {
|
|
182
|
+
globalThis[name] = value;
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
}
|
|
@@ -137,10 +137,7 @@ export class ElementAppenderSlimmer extends VegaSlimmer {
|
|
|
137
137
|
}
|
|
138
138
|
disconnectedCallback() {
|
|
139
139
|
this.unRegisterElementAppenderListener();
|
|
140
|
-
|
|
141
|
-
this.elementAppender.destroy();
|
|
142
|
-
this.elementAppender = null;
|
|
143
|
-
}
|
|
140
|
+
this.destroyElementAppender();
|
|
144
141
|
}
|
|
145
142
|
componentDidLoad() {
|
|
146
143
|
this.initElementAppender();
|
|
@@ -157,13 +154,19 @@ export class ElementAppenderSlimmer extends VegaSlimmer {
|
|
|
157
154
|
this[this.isDropdownShowName] = false;
|
|
158
155
|
}
|
|
159
156
|
destroy() {
|
|
160
|
-
this.
|
|
157
|
+
this.destroyElementAppender();
|
|
161
158
|
this[this.isDropdownShowName] = false;
|
|
162
159
|
}
|
|
163
160
|
updateShowConfigFactory(showConfigFactory) {
|
|
164
161
|
this.showConfigFactory = showConfigFactory;
|
|
165
162
|
this.initElementAppender();
|
|
166
163
|
}
|
|
164
|
+
destroyElementAppender() {
|
|
165
|
+
if (this.elementAppender) {
|
|
166
|
+
this.elementAppender.destroy();
|
|
167
|
+
this.elementAppender = null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
167
170
|
initElementAppender() {
|
|
168
171
|
this.setShowConfig();
|
|
169
172
|
this.setElementAppender();
|
|
@@ -107,9 +107,11 @@ describe('ElementAppender slimmer test suite', () => {
|
|
|
107
107
|
expect(mockedComponent.isDropdownShow).toBeFalsy();
|
|
108
108
|
expect(mockedComponent.getElementAppender()['undefinedAttribute']).toEqual(undefined);
|
|
109
109
|
expect(mockedComponent.appendableElement).toHaveClass('vega-force-hidden');
|
|
110
|
+
spyOn(element, 'remove').and.callThrough();
|
|
110
111
|
mockedComponent.destroy();
|
|
111
112
|
expect(mockedComponent.getElementAppender()).toBeNull();
|
|
112
113
|
expect(mockedComponent.isDropdownShow).toBeFalsy();
|
|
114
|
+
expect(element.remove).toBeCalledTimes(1);
|
|
113
115
|
});
|
|
114
116
|
test('should listen event proper while trigger is click', () => {
|
|
115
117
|
const mockedComponent = new MockedComponent();
|
|
@@ -118,6 +118,7 @@ export class ElementAppender {
|
|
|
118
118
|
if (!this.showConfig)
|
|
119
119
|
return;
|
|
120
120
|
this.removeVisibleAppendElement(this.showConfig.appendableElement);
|
|
121
|
+
this.resetContainerPosition();
|
|
121
122
|
InternalVegaZIndexManager.removeZIndex(this.showConfig.appendableElement, 'base');
|
|
122
123
|
this.showConfig.appendableElement.remove();
|
|
123
124
|
this.disconnectResizeObserver();
|
|
@@ -151,6 +151,7 @@ test('return result as expect when call destroy', () => {
|
|
|
151
151
|
expect(document.body).toEqualHtml(`
|
|
152
152
|
<div class="test-parent-host"><div class="test-host"></div></div>
|
|
153
153
|
`);
|
|
154
|
+
expect(document.body.style.position).toEqual('static');
|
|
154
155
|
});
|
|
155
156
|
test('content should append to body while not in modal', () => {
|
|
156
157
|
const target = document.createElement('vega-input-select');
|
|
@@ -13,6 +13,7 @@ import { InjectVegaSlimmer, createDynamicSlimmer, methodPlaceholder } from 'vega
|
|
|
13
13
|
import { FieldErrorUIControllerSlimmer } from '../slimmers/field-error-ui-controller-slimmer';
|
|
14
14
|
import { PageResizeObserverSlimmer } from '../slimmers/page-resize-observer-slimmer';
|
|
15
15
|
import { FormFieldMessageTranslatorSlimmer } from '../slimmers/form-field-message-translator';
|
|
16
|
+
import { InternalFormFieldValidationRule } from './rules/internal-form-field-validation-rule.abstract';
|
|
16
17
|
/**
|
|
17
18
|
* The FormFieldController class is a class that validates the value of an input elements
|
|
18
19
|
*
|
|
@@ -152,7 +153,11 @@ export class FormFieldController {
|
|
|
152
153
|
* @returns {FormFieldValidationRule<number | string | boolean>[]} An array of FormFieldValidationRule<T>
|
|
153
154
|
*/
|
|
154
155
|
getRules() {
|
|
155
|
-
|
|
156
|
+
const additionalRules = [...this.additionalRules];
|
|
157
|
+
const overriddenDefaultRules = this.defaultRules.map((rule) => {
|
|
158
|
+
return this.overrideDefaultRuleByAdditionalRule(rule, additionalRules);
|
|
159
|
+
});
|
|
160
|
+
return [...overriddenDefaultRules, ...additionalRules];
|
|
156
161
|
}
|
|
157
162
|
/**
|
|
158
163
|
* Set the default rules for the form field.
|
|
@@ -441,6 +446,28 @@ export class FormFieldController {
|
|
|
441
446
|
return isEnterKey;
|
|
442
447
|
}
|
|
443
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* It overrides the default rule by checking if the additional rules contain a custom rule that overrides.
|
|
451
|
+
* If it does, it returns that additional rule, and the rule will be removed from the additional rules array.
|
|
452
|
+
* otherwise, it returns the default rule.
|
|
453
|
+
*
|
|
454
|
+
* @param {InternalFormFieldValidationRule} defaultRule - The rule to be overridden.
|
|
455
|
+
* @param {FormFieldValidationRule[]} additionalRules - The additional rules to be applied.
|
|
456
|
+
* @returns {FormFieldValidationRule} The overridden rule.
|
|
457
|
+
*/
|
|
458
|
+
overrideDefaultRuleByAdditionalRule(defaultRule, additionalRules) {
|
|
459
|
+
if (defaultRule && additionalRules) {
|
|
460
|
+
const customRuleIndex = additionalRules.findIndex((customRule) => {
|
|
461
|
+
return (customRule instanceof InternalFormFieldValidationRule &&
|
|
462
|
+
customRule instanceof defaultRule.constructor &&
|
|
463
|
+
customRule.overrideDefault);
|
|
464
|
+
});
|
|
465
|
+
if (customRuleIndex > -1) {
|
|
466
|
+
return additionalRules.splice(customRuleIndex, 1)[0];
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
return defaultRule;
|
|
470
|
+
}
|
|
444
471
|
}
|
|
445
472
|
__decorate([
|
|
446
473
|
InjectVegaSlimmer()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { CheckBoxRequiredRule } from './rules/check-box-required-rule';
|
|
2
|
+
export { DateRequiredRule } from './rules/date-required-rule';
|
|
3
|
+
export { InputPhoneNumberRequiredRule } from './rules/input-phone-number-required-rule';
|
|
4
|
+
export { InputRangeRequiredRule } from './rules/input-range-required-rule';
|
|
5
|
+
export { RequiredFieldRule } from './rules/required-field-rule';
|
|
6
|
+
export { RichTextEditorRequiredRule } from './rules/rich-text-editor-required-rule';
|
|
7
|
+
export { TimeRangeRequiredRule } from './rules/time-range-required-rule';
|
|
8
|
+
export { TimeRequiredRule } from './rules/time-required-rule';
|
|
9
|
+
export { ToggleSwitchRequiredRule } from './rules/toggle-switch-required-rule';
|
|
10
|
+
export { FileUploaderRequiredRule } from './rules/file-uploader-required-rule';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { InternalFormFieldValidationRule } from './internal-form-field-validation-rule.abstract';
|
|
1
2
|
/**
|
|
2
3
|
* A rule that checks if a string is empty or not
|
|
3
4
|
*
|
|
4
|
-
* @
|
|
5
|
+
* @augments {InternalFormFieldValidationRule<string>}
|
|
5
6
|
*/
|
|
6
|
-
export class CheckBoxRequiredRule {
|
|
7
|
+
export class CheckBoxRequiredRule extends InternalFormFieldValidationRule {
|
|
7
8
|
/**
|
|
8
9
|
* If the input is a boolean, return a boolean. If the input is a string, return a boolean. If the
|
|
9
10
|
* input is anything else, return false
|
|
10
11
|
*
|
|
11
12
|
* @param {string | boolean} input - The input to be evaluated.
|
|
12
|
-
* @returns {
|
|
13
|
+
* @returns {EvaluateResult} - An object with two properties: isValid and message.
|
|
13
14
|
*/
|
|
14
15
|
evaluate(input) {
|
|
15
16
|
if (typeof input === 'boolean') {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { isDateStr, compareIsSameOrBefore } from '../../../utils/date';
|
|
2
|
+
import { InternalFormFieldValidationRule } from './internal-form-field-validation-rule.abstract';
|
|
2
3
|
/**
|
|
3
4
|
* A rule that checks if start date is before than end date
|
|
4
5
|
*/
|
|
5
|
-
export class DateRangeRule {
|
|
6
|
+
export class DateRangeRule extends InternalFormFieldValidationRule {
|
|
6
7
|
/**
|
|
7
8
|
* If the input is accepted and the status is not disabled and visible, then return true
|
|
8
9
|
*
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isDateStr } from '../../../utils/date';
|
|
2
|
+
import { InternalFormFieldValidationRule } from './internal-form-field-validation-rule.abstract';
|
|
2
3
|
/**
|
|
3
4
|
* A rule that checks if date is empty or not
|
|
4
5
|
*
|
|
5
|
-
* @
|
|
6
|
+
* @augments {InternalFormFieldValidationRule<string | string[]>}
|
|
6
7
|
*/
|
|
7
|
-
export class DateRequiredRule {
|
|
8
|
+
export class DateRequiredRule extends InternalFormFieldValidationRule {
|
|
8
9
|
/**
|
|
9
10
|
* It creates a new instance of the class with the given config.
|
|
10
11
|
*
|
|
@@ -12,6 +13,7 @@ export class DateRequiredRule {
|
|
|
12
13
|
* @param {'single' | 'range'} config.mode - The mode for date value
|
|
13
14
|
*/
|
|
14
15
|
constructor(config) {
|
|
16
|
+
super();
|
|
15
17
|
this.config = config;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
@@ -19,7 +21,7 @@ export class DateRequiredRule {
|
|
|
19
21
|
* Otherwise, return an object with a boolean indicating whether the input is valid and a message to display to the user
|
|
20
22
|
*
|
|
21
23
|
* @param {string | string[]} input - The value of the input field.
|
|
22
|
-
* @returns {
|
|
24
|
+
* @returns {EvaluateResult} An object with two properties: isValid and message.
|
|
23
25
|
*/
|
|
24
26
|
evaluate(input) {
|
|
25
27
|
if (!this.isAcceptedInputType(input)) {
|