@aurodesignsystem/auro-formkit 1.6.0-beta.10 → 1.6.0-beta.12
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/.turbo/cache/013a48308b893dac-meta.json +1 -1
- package/.turbo/cache/0593477832b1052b-meta.json +1 -0
- package/.turbo/cache/0593477832b1052b.tar.zst +0 -0
- package/.turbo/cache/07ca42419b9f050c-meta.json +1 -1
- package/.turbo/cache/0a2b0a4df8a0443f-meta.json +1 -0
- package/.turbo/cache/0a2b0a4df8a0443f.tar.zst +0 -0
- package/.turbo/cache/0cea4c1f34f3683b-meta.json +1 -1
- package/.turbo/cache/141bb7d9a95e288b-meta.json +1 -0
- package/.turbo/cache/141bb7d9a95e288b.tar.zst +0 -0
- package/.turbo/cache/15b611d69353176d-meta.json +1 -0
- package/.turbo/cache/17259cf94d8f8925-meta.json +1 -1
- package/.turbo/cache/1c99a949ec63ab35-meta.json +1 -1
- package/.turbo/cache/1de15d89eed2d760-meta.json +1 -0
- package/.turbo/cache/1de15d89eed2d760.tar.zst +0 -0
- package/.turbo/cache/257a7a26ea72dbc5-meta.json +1 -1
- package/.turbo/cache/28b3bf750d6c5738-meta.json +1 -0
- package/.turbo/cache/28b3bf750d6c5738.tar.zst +0 -0
- package/.turbo/cache/32c0b9995fb5f8dd-meta.json +1 -0
- package/.turbo/cache/32c0b9995fb5f8dd.tar.zst +0 -0
- package/.turbo/cache/3bf45120d0cc9bd8-meta.json +1 -1
- package/.turbo/cache/45035bf5c4147ccd-meta.json +1 -1
- package/.turbo/cache/4ceca20b1e98dbd7-meta.json +1 -0
- package/.turbo/cache/4ceca20b1e98dbd7.tar.zst +0 -0
- package/.turbo/cache/4e8c9ab436c836bc-meta.json +1 -0
- package/.turbo/cache/4e8c9ab436c836bc.tar.zst +0 -0
- package/.turbo/cache/4f92cea2d8c63de2-meta.json +1 -0
- package/.turbo/cache/4f92cea2d8c63de2.tar.zst +0 -0
- package/.turbo/cache/5bfa30d06f8727c7-meta.json +1 -0
- package/.turbo/cache/5bfa30d06f8727c7.tar.zst +0 -0
- package/.turbo/cache/5c16ce3cff5c9dff-meta.json +1 -1
- package/.turbo/cache/5f304c0f37ef25f3-meta.json +1 -1
- package/.turbo/cache/626afdc67e0cb540-meta.json +1 -0
- package/.turbo/cache/626afdc67e0cb540.tar.zst +0 -0
- package/.turbo/cache/64de7a53e02db647-meta.json +1 -1
- package/.turbo/cache/691a74627ec57993-meta.json +1 -1
- package/.turbo/cache/69aae513b7ec6c7d-meta.json +1 -1
- package/.turbo/cache/69f7eb632e38f934-meta.json +1 -0
- package/.turbo/cache/69f7eb632e38f934.tar.zst +0 -0
- package/.turbo/cache/6dd7058e6703cb35-meta.json +1 -1
- package/.turbo/cache/73e9073a5274616d-meta.json +1 -1
- package/.turbo/cache/773edc0f83c8c5a5-meta.json +1 -1
- package/.turbo/cache/786a822763403879-meta.json +1 -1
- package/.turbo/cache/7f01d2fe1c245278-meta.json +1 -0
- package/.turbo/cache/80b5d974184a01df-meta.json +1 -1
- package/.turbo/cache/8954c6073396fadd-meta.json +1 -1
- package/.turbo/cache/8ca4e3f31520b797-meta.json +1 -0
- package/.turbo/cache/8ca4e3f31520b797.tar.zst +0 -0
- package/.turbo/cache/92daa6d7c389d548-meta.json +1 -1
- package/.turbo/cache/9a097d6576dadd64-meta.json +1 -1
- package/.turbo/cache/a6a56bb802e1c20f-meta.json +1 -0
- package/.turbo/cache/a6a56bb802e1c20f.tar.zst +0 -0
- package/.turbo/cache/a77bc920ea508bb8-meta.json +1 -1
- package/.turbo/cache/a77bc920ea508bb8.tar.zst +0 -0
- package/.turbo/cache/b54fc4f664a7a5a0-meta.json +1 -1
- package/.turbo/cache/b8b1814a990c06f8-meta.json +1 -0
- package/.turbo/cache/b8b1814a990c06f8.tar.zst +0 -0
- package/.turbo/cache/ba4418918621fbcd-meta.json +1 -1
- package/.turbo/cache/bb8b41cd0ade3986-meta.json +1 -0
- package/.turbo/cache/bb8b41cd0ade3986.tar.zst +0 -0
- package/.turbo/cache/bb8ec1d0fe0a761f-meta.json +1 -0
- package/.turbo/cache/bb8ec1d0fe0a761f.tar.zst +0 -0
- package/.turbo/cache/be7c23c37b8ec74b-meta.json +1 -1
- package/.turbo/cache/be7c23c37b8ec74b.tar.zst +0 -0
- package/.turbo/cache/bf85bc040b7e64db-meta.json +1 -0
- package/.turbo/cache/bf85bc040b7e64db.tar.zst +0 -0
- package/.turbo/cache/caa0b4ac8d2a04dd-meta.json +1 -1
- package/.turbo/cache/caa0b4ac8d2a04dd.tar.zst +0 -0
- package/.turbo/cache/cc81de9c0b452a7c-meta.json +1 -1
- package/.turbo/cache/cd845bb6102c589a-meta.json +1 -0
- package/.turbo/cache/cd845bb6102c589a.tar.zst +0 -0
- package/.turbo/cache/d65801fd9a8c1a75-meta.json +1 -0
- package/.turbo/cache/d65801fd9a8c1a75.tar.zst +0 -0
- package/.turbo/cache/d7a47b77deb3d9a4-meta.json +1 -0
- package/.turbo/cache/d7a47b77deb3d9a4.tar.zst +0 -0
- package/.turbo/cache/dad1301ac69bcb85-meta.json +1 -1
- package/.turbo/cache/e44f36589cdc0bbc-meta.json +1 -0
- package/.turbo/cache/e44f36589cdc0bbc.tar.zst +0 -0
- package/.turbo/cache/e992dab20aeefbaf-meta.json +1 -1
- package/.turbo/cache/e992dab20aeefbaf.tar.zst +0 -0
- package/.turbo/cache/f5db6f7110f4ae32-meta.json +1 -0
- package/.turbo/cache/f5db6f7110f4ae32.tar.zst +0 -0
- package/.turbo/cache/fa132b5b5f0e75f8-meta.json +1 -1
- package/.turbo/cache/fa6b53275a3b4dc5-meta.json +1 -0
- package/.turbo/cache/fa6b53275a3b4dc5.tar.zst +0 -0
- package/.turbo/cache/fbbe2704bf9cb90b-meta.json +1 -1
- package/.turbo/cache/ff58f630c9d69af4-meta.json +1 -0
- package/.turbo/cache/ff58f630c9d69af4.tar.zst +0 -0
- package/CHANGELOG.md +39 -0
- package/components/checkbox/.turbo/turbo-build.log +6 -3
- package/components/checkbox/.turbo/turbo-bundler.log +3 -3
- package/components/checkbox/demo/api.html +6 -1
- package/components/checkbox/demo/api.js +16 -0
- package/components/checkbox/demo/api.md +63 -4
- package/components/checkbox/demo/api.min.js +84 -13
- package/components/checkbox/demo/index.min.js +59 -13
- package/components/checkbox/dist/auro-checkbox-group.d.ts +6 -1
- package/components/checkbox/dist/auro-checkbox-group.d.ts.map +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +5 -0
- package/components/checkbox/dist/auro-checkbox.d.ts.map +1 -1
- package/components/checkbox/dist/index.js +59 -13
- package/components/checkbox/src/auro-checkbox-group.js +18 -6
- package/components/checkbox/src/auro-checkbox.js +9 -0
- package/components/combobox/.turbo/turbo-build.log +6 -3
- package/components/combobox/demo/api.js +4 -2
- package/components/combobox/demo/api.md +60 -1
- package/components/combobox/demo/api.min.js +101 -31
- package/components/combobox/demo/index.min.js +92 -31
- package/components/combobox/dist/auro-combobox.d.ts +5 -1
- package/components/combobox/dist/auro-combobox.d.ts.map +1 -1
- package/components/combobox/dist/index.js +91 -29
- package/components/combobox/src/auro-combobox.js +14 -3
- package/components/counter/.turbo/turbo-build.log +3 -3
- package/components/counter/.turbo/turbo-bundler.log +3 -3
- package/components/datepicker/.turbo/turbo-build.log +6 -3
- package/components/datepicker/demo/api.js +2 -0
- package/components/datepicker/demo/api.md +46 -1
- package/components/datepicker/demo/api.min.js +100 -30
- package/components/datepicker/demo/index.min.js +91 -30
- package/components/datepicker/dist/auro-datepicker.d.ts +5 -2
- package/components/datepicker/dist/auro-datepicker.d.ts.map +1 -1
- package/components/datepicker/dist/index.js +91 -30
- package/components/datepicker/src/auro-datepicker.js +14 -4
- package/components/dropdown/.turbo/turbo-build.log +3 -3
- package/components/dropdown/.turbo/turbo-bundler.log +3 -3
- package/components/dropdown/demo/api.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/src/styles/bibStyles-css.js +1 -1
- package/components/dropdown/src/styles/bibStyles.css +0 -5
- package/components/dropdown/src/styles/bibStyles.scss +0 -7
- package/components/form/.turbo/turbo-build.log +3 -3
- package/components/form/.turbo/turbo-bundler.log +3 -3
- package/components/input/.turbo/turbo-build$colon$sass.log +2 -2
- package/components/input/.turbo/turbo-build.log +16 -13
- package/components/input/.turbo/turbo-bundler.log +3 -3
- package/components/input/demo/api.js +2 -0
- package/components/input/demo/api.md +148 -98
- package/components/input/demo/api.min.js +56 -21
- package/components/input/demo/index.min.js +44 -18
- package/components/input/dist/base-input.d.ts +7 -8
- package/components/input/dist/base-input.d.ts.map +1 -1
- package/components/input/dist/index.js +44 -18
- package/components/input/src/base-input.js +11 -10
- package/components/input/src/styles/input-css.js +1 -1
- package/components/input/src/styles/input.css +13 -0
- package/components/input/src/styles/input.scss +21 -0
- package/components/input/src/styles/label-css.js +1 -1
- package/components/input/src/styles/label.css +3 -3
- package/components/input/src/styles/label.scss +1 -2
- package/components/input/src/styles/notificationIcons-css.js +1 -1
- package/components/input/src/styles/notificationIcons.css +7 -0
- package/components/input/src/styles/notificationIcons.scss +14 -0
- package/components/input/src/styles/style-css.js +1 -1
- package/components/input/src/styles/style.css +23 -3
- package/components/menu/.turbo/turbo-build.log +3 -3
- package/components/menu/.turbo/turbo-bundler.log +3 -3
- package/components/menu/demo/api.min.js +1 -2
- package/components/menu/demo/index.min.js +1 -2
- package/components/menu/dist/auro-menuoption.d.ts +0 -1
- package/components/menu/dist/auro-menuoption.d.ts.map +1 -1
- package/components/menu/dist/index.js +1 -2
- package/components/menu/src/auro-menuoption.js +1 -2
- package/components/radio/.turbo/turbo-build.log +6 -3
- package/components/radio/.turbo/turbo-bundler.log +3 -3
- package/components/radio/demo/api.html +1 -0
- package/components/radio/demo/api.js +2 -0
- package/components/radio/demo/api.md +57 -3
- package/components/radio/demo/api.min.js +55 -12
- package/components/radio/demo/index.min.js +46 -12
- package/components/radio/dist/auro-radio-group.d.ts +1 -1
- package/components/radio/dist/auro-radio.d.ts +5 -0
- package/components/radio/dist/auro-radio.d.ts.map +1 -1
- package/components/radio/dist/index.js +46 -12
- package/components/radio/src/auro-radio-group.js +5 -5
- package/components/radio/src/auro-radio.js +9 -0
- package/components/select/.turbo/turbo-build.log +7 -4
- package/components/select/demo/api.js +4 -2
- package/components/select/demo/api.md +81 -17
- package/components/select/demo/api.min.js +52 -12
- package/components/select/demo/index.min.js +43 -12
- package/components/select/dist/auro-select.d.ts +5 -1
- package/components/select/dist/auro-select.d.ts.map +1 -1
- package/components/select/dist/index.js +42 -10
- package/components/select/src/auro-select.js +9 -2
- package/package.json +1 -1
- package/packages/form-validation/src/validation.js +32 -7
- package/.turbo/cache/049b9083252d38be-meta.json +0 -1
- package/.turbo/cache/049b9083252d38be.tar.zst +0 -0
- package/.turbo/cache/0a1dd4481355cb0b-meta.json +0 -1
- package/.turbo/cache/0a1dd4481355cb0b.tar.zst +0 -0
- package/.turbo/cache/13cf37c850bd8cf4-meta.json +0 -1
- package/.turbo/cache/3323eb841acb9c4e-meta.json +0 -1
- package/.turbo/cache/3323eb841acb9c4e.tar.zst +0 -0
- package/.turbo/cache/34ba23e2e2d652ad-meta.json +0 -1
- package/.turbo/cache/34ba23e2e2d652ad.tar.zst +0 -0
- package/.turbo/cache/368cd6fed7975ad2-meta.json +0 -1
- package/.turbo/cache/368cd6fed7975ad2.tar.zst +0 -0
- package/.turbo/cache/3924bce8e51f0ffa-meta.json +0 -1
- package/.turbo/cache/3924bce8e51f0ffa.tar.zst +0 -0
- package/.turbo/cache/4567487084a055b7-meta.json +0 -1
- package/.turbo/cache/4567487084a055b7.tar.zst +0 -0
- package/.turbo/cache/4763278a7d3dbc16-meta.json +0 -1
- package/.turbo/cache/4763278a7d3dbc16.tar.zst +0 -0
- package/.turbo/cache/549e6ef9f9ffd9a8-meta.json +0 -1
- package/.turbo/cache/549e6ef9f9ffd9a8.tar.zst +0 -0
- package/.turbo/cache/59ccd8430174883c-meta.json +0 -1
- package/.turbo/cache/59ccd8430174883c.tar.zst +0 -0
- package/.turbo/cache/683d4c0e20c077a9-meta.json +0 -1
- package/.turbo/cache/683d4c0e20c077a9.tar.zst +0 -0
- package/.turbo/cache/8f8ffe35cc79d1a9-meta.json +0 -1
- package/.turbo/cache/8f8ffe35cc79d1a9.tar.zst +0 -0
- package/.turbo/cache/926d632729ca6536-meta.json +0 -1
- package/.turbo/cache/926d632729ca6536.tar.zst +0 -0
- package/.turbo/cache/9e7be41cc3a7ef43-meta.json +0 -1
- package/.turbo/cache/9e7be41cc3a7ef43.tar.zst +0 -0
- package/.turbo/cache/9ee793063ea89126-meta.json +0 -1
- package/.turbo/cache/9ee793063ea89126.tar.zst +0 -0
- package/.turbo/cache/a1558cef51c034da-meta.json +0 -1
- package/.turbo/cache/a1558cef51c034da.tar.zst +0 -0
- package/.turbo/cache/a24f2ff8e94e56e8-meta.json +0 -1
- package/.turbo/cache/a24f2ff8e94e56e8.tar.zst +0 -0
- package/.turbo/cache/a2705cf095a2ceb0-meta.json +0 -1
- package/.turbo/cache/a2705cf095a2ceb0.tar.zst +0 -0
- package/.turbo/cache/a33c0749886a41b5-meta.json +0 -1
- package/.turbo/cache/a33c0749886a41b5.tar.zst +0 -0
- package/.turbo/cache/a66b465385a30a2b-meta.json +0 -1
- package/.turbo/cache/a66b465385a30a2b.tar.zst +0 -0
- package/.turbo/cache/c1b72a92dec4fe37-meta.json +0 -1
- package/.turbo/cache/e25ac25a8a0ad126-meta.json +0 -1
- package/.turbo/cache/e25ac25a8a0ad126.tar.zst +0 -0
- package/.turbo/cache/e671573e4ef02c47-meta.json +0 -1
- package/.turbo/cache/e671573e4ef02c47.tar.zst +0 -0
- package/.turbo/cache/e86cee22dff5e281-meta.json +0 -1
- package/.turbo/cache/e86cee22dff5e281.tar.zst +0 -0
- package/.turbo/cache/f680556a8e954eac-meta.json +0 -1
- package/.turbo/cache/f680556a8e954eac.tar.zst +0 -0
- package/.turbo/cache/ffec4500b911b85a-meta.json +0 -1
- package/.turbo/cache/ffec4500b911b85a.tar.zst +0 -0
- /package/.turbo/cache/{c1b72a92dec4fe37.tar.zst → 15b611d69353176d.tar.zst} +0 -0
- /package/.turbo/cache/{13cf37c850bd8cf4.tar.zst → 7f01d2fe1c245278.tar.zst} +0 -0
|
@@ -57,6 +57,14 @@ function inDialogExample() {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
function resetStateExample() {
|
|
61
|
+
const elem = document.querySelector('#resetStateExample');
|
|
62
|
+
|
|
63
|
+
document.querySelector('#resetStateBtn').addEventListener('click', () => {
|
|
64
|
+
elem.reset();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
60
68
|
function auroMenuLoadingExample() {
|
|
61
69
|
const select = document.querySelector("#loadingExample");
|
|
62
70
|
const menu = document.querySelector("#loadingExampleSelectMenu");
|
|
@@ -200,6 +208,30 @@ class AuroFormValidation {
|
|
|
200
208
|
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
201
209
|
}
|
|
202
210
|
|
|
211
|
+
/**
|
|
212
|
+
* Resets the element to its initial state.
|
|
213
|
+
* @private
|
|
214
|
+
* @param {object} elem - HTML element to reset.
|
|
215
|
+
* @returns {void}
|
|
216
|
+
*/
|
|
217
|
+
reset(elem) {
|
|
218
|
+
elem.validity = undefined;
|
|
219
|
+
elem.value = undefined;
|
|
220
|
+
|
|
221
|
+
// Resets the second value of the datepicker in range state
|
|
222
|
+
if (elem.valueEnd) {
|
|
223
|
+
elem.valueEnd = undefined;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Resets selected option of element
|
|
227
|
+
if (elem.optionSelected) {
|
|
228
|
+
elem.optionSelected = undefined;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Runs validation to handle error attribute
|
|
232
|
+
this.validate(elem);
|
|
233
|
+
}
|
|
234
|
+
|
|
203
235
|
/**
|
|
204
236
|
* Determines the validity state of the element based on the common attribute restrictions (pattern).
|
|
205
237
|
* @private
|
|
@@ -214,10 +246,15 @@ class AuroFormValidation {
|
|
|
214
246
|
elem.validity = 'badInput';
|
|
215
247
|
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
|
|
216
248
|
}
|
|
217
|
-
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
252
|
+
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
218
253
|
elem.validity = 'tooShort';
|
|
219
254
|
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
|
|
220
|
-
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (elem.value?.length > elem.maxLength) {
|
|
221
258
|
elem.validity = 'tooLong';
|
|
222
259
|
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
|
|
223
260
|
}
|
|
@@ -243,7 +280,7 @@ class AuroFormValidation {
|
|
|
243
280
|
elem.validity = 'tooShort';
|
|
244
281
|
elem.setCustomValidity = elem.setCustomValidityForType || '';
|
|
245
282
|
}
|
|
246
|
-
} else if (elem.type === 'number'
|
|
283
|
+
} else if (elem.type === 'number') {
|
|
247
284
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
248
285
|
elem.validity = 'rangeOverflow';
|
|
249
286
|
elem.setCustomValidity = elem.getAttribute('setCustomValidityRangeOverflow') || '';
|
|
@@ -348,14 +385,10 @@ class AuroFormValidation {
|
|
|
348
385
|
|
|
349
386
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
350
387
|
if (elem.validity && elem.validity !== 'valid') {
|
|
351
|
-
elem.isValid = false;
|
|
352
|
-
|
|
353
388
|
// Use the validity message override if it is declared
|
|
354
389
|
if (elem.ValidityMessageOverride) {
|
|
355
390
|
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
356
391
|
}
|
|
357
|
-
} else {
|
|
358
|
-
elem.isValid = true;
|
|
359
392
|
}
|
|
360
393
|
|
|
361
394
|
this.getErrorMessage(elem);
|
|
@@ -2876,7 +2909,7 @@ var colorCss$1$1 = i$3`.label{color:var(--ds-auro-dropdown-label-text-color)}.tr
|
|
|
2876
2909
|
|
|
2877
2910
|
var tokensCss$3 = i$3`:host{--ds-auro-dropdown-help-text-color: var(--ds-color-text-secondary-default, #525252);--ds-auro-dropdown-label-text-color: var(--ds-color-text-secondary-default, #525252);--ds-auro-dropdown-popover-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdown-popover-border-color: transparent;--ds-auro-dropdown-popover-text-color: var(--ds-color-text-primary-default, #2a2a2a);--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdown-trigger-border-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-primary-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-color-text-primary-default, #2a2a2a)}`;
|
|
2878
2911
|
|
|
2879
|
-
var styleCss$4 = i$3`:host{position:absolute;z-index:var(--depth-tooltip, 400);display:none}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common]
|
|
2912
|
+
var styleCss$4 = i$3`:host{position:absolute;z-index:var(--depth-tooltip, 400);display:none}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}`;
|
|
2880
2913
|
|
|
2881
2914
|
var colorCss$4 = i$3`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2882
2915
|
|
|
@@ -3409,8 +3442,7 @@ class AuroSelect extends r$4 {
|
|
|
3409
3442
|
type: Object
|
|
3410
3443
|
},
|
|
3411
3444
|
value: {
|
|
3412
|
-
type: String
|
|
3413
|
-
reflect: true
|
|
3445
|
+
type: String
|
|
3414
3446
|
},
|
|
3415
3447
|
noValidate: {
|
|
3416
3448
|
type: Boolean,
|
|
@@ -3771,6 +3803,14 @@ class AuroSelect extends r$4 {
|
|
|
3771
3803
|
}
|
|
3772
3804
|
}
|
|
3773
3805
|
|
|
3806
|
+
/**
|
|
3807
|
+
* Resets component to initial state.
|
|
3808
|
+
* @returns {void}
|
|
3809
|
+
*/
|
|
3810
|
+
reset() {
|
|
3811
|
+
this.validation.reset(this);
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3774
3814
|
/**
|
|
3775
3815
|
* Handles reading of auro-select by screen readers.
|
|
3776
3816
|
* @private
|
|
@@ -4873,8 +4913,7 @@ class AuroMenuOption extends r$4 {
|
|
|
4873
4913
|
reflect: true
|
|
4874
4914
|
},
|
|
4875
4915
|
value: {
|
|
4876
|
-
type: String
|
|
4877
|
-
reflect: true
|
|
4916
|
+
type: String
|
|
4878
4917
|
},
|
|
4879
4918
|
tabIndex: {
|
|
4880
4919
|
type: Number,
|
|
@@ -4966,6 +5005,7 @@ function initExamples(initCount) {
|
|
|
4966
5005
|
valueExample();
|
|
4967
5006
|
valueExtractionExample();
|
|
4968
5007
|
inDialogExample();
|
|
5008
|
+
resetStateExample();
|
|
4969
5009
|
auroMenuLoadingExample();
|
|
4970
5010
|
} catch (err) {
|
|
4971
5011
|
if (initCount <= 20) {
|
|
@@ -110,6 +110,30 @@ class AuroFormValidation {
|
|
|
110
110
|
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Resets the element to its initial state.
|
|
115
|
+
* @private
|
|
116
|
+
* @param {object} elem - HTML element to reset.
|
|
117
|
+
* @returns {void}
|
|
118
|
+
*/
|
|
119
|
+
reset(elem) {
|
|
120
|
+
elem.validity = undefined;
|
|
121
|
+
elem.value = undefined;
|
|
122
|
+
|
|
123
|
+
// Resets the second value of the datepicker in range state
|
|
124
|
+
if (elem.valueEnd) {
|
|
125
|
+
elem.valueEnd = undefined;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Resets selected option of element
|
|
129
|
+
if (elem.optionSelected) {
|
|
130
|
+
elem.optionSelected = undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Runs validation to handle error attribute
|
|
134
|
+
this.validate(elem);
|
|
135
|
+
}
|
|
136
|
+
|
|
113
137
|
/**
|
|
114
138
|
* Determines the validity state of the element based on the common attribute restrictions (pattern).
|
|
115
139
|
* @private
|
|
@@ -124,10 +148,15 @@ class AuroFormValidation {
|
|
|
124
148
|
elem.validity = 'badInput';
|
|
125
149
|
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
|
|
126
150
|
}
|
|
127
|
-
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
154
|
+
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
128
155
|
elem.validity = 'tooShort';
|
|
129
156
|
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
|
|
130
|
-
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (elem.value?.length > elem.maxLength) {
|
|
131
160
|
elem.validity = 'tooLong';
|
|
132
161
|
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
|
|
133
162
|
}
|
|
@@ -153,7 +182,7 @@ class AuroFormValidation {
|
|
|
153
182
|
elem.validity = 'tooShort';
|
|
154
183
|
elem.setCustomValidity = elem.setCustomValidityForType || '';
|
|
155
184
|
}
|
|
156
|
-
} else if (elem.type === 'number'
|
|
185
|
+
} else if (elem.type === 'number') {
|
|
157
186
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
158
187
|
elem.validity = 'rangeOverflow';
|
|
159
188
|
elem.setCustomValidity = elem.getAttribute('setCustomValidityRangeOverflow') || '';
|
|
@@ -258,14 +287,10 @@ class AuroFormValidation {
|
|
|
258
287
|
|
|
259
288
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
260
289
|
if (elem.validity && elem.validity !== 'valid') {
|
|
261
|
-
elem.isValid = false;
|
|
262
|
-
|
|
263
290
|
// Use the validity message override if it is declared
|
|
264
291
|
if (elem.ValidityMessageOverride) {
|
|
265
292
|
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
266
293
|
}
|
|
267
|
-
} else {
|
|
268
|
-
elem.isValid = true;
|
|
269
294
|
}
|
|
270
295
|
|
|
271
296
|
this.getErrorMessage(elem);
|
|
@@ -2786,7 +2811,7 @@ var colorCss$1$1 = i$3`.label{color:var(--ds-auro-dropdown-label-text-color)}.tr
|
|
|
2786
2811
|
|
|
2787
2812
|
var tokensCss$3 = i$3`:host{--ds-auro-dropdown-help-text-color: var(--ds-color-text-secondary-default, #525252);--ds-auro-dropdown-label-text-color: var(--ds-color-text-secondary-default, #525252);--ds-auro-dropdown-popover-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdown-popover-border-color: transparent;--ds-auro-dropdown-popover-text-color: var(--ds-color-text-primary-default, #2a2a2a);--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdown-trigger-border-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-primary-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-color-text-primary-default, #2a2a2a)}`;
|
|
2788
2813
|
|
|
2789
|
-
var styleCss$4 = i$3`:host{position:absolute;z-index:var(--depth-tooltip, 400);display:none}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common]
|
|
2814
|
+
var styleCss$4 = i$3`:host{position:absolute;z-index:var(--depth-tooltip, 400);display:none}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}`;
|
|
2790
2815
|
|
|
2791
2816
|
var colorCss$4 = i$3`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2792
2817
|
|
|
@@ -3319,8 +3344,7 @@ class AuroSelect extends r$4 {
|
|
|
3319
3344
|
type: Object
|
|
3320
3345
|
},
|
|
3321
3346
|
value: {
|
|
3322
|
-
type: String
|
|
3323
|
-
reflect: true
|
|
3347
|
+
type: String
|
|
3324
3348
|
},
|
|
3325
3349
|
noValidate: {
|
|
3326
3350
|
type: Boolean,
|
|
@@ -3681,6 +3705,14 @@ class AuroSelect extends r$4 {
|
|
|
3681
3705
|
}
|
|
3682
3706
|
}
|
|
3683
3707
|
|
|
3708
|
+
/**
|
|
3709
|
+
* Resets component to initial state.
|
|
3710
|
+
* @returns {void}
|
|
3711
|
+
*/
|
|
3712
|
+
reset() {
|
|
3713
|
+
this.validation.reset(this);
|
|
3714
|
+
}
|
|
3715
|
+
|
|
3684
3716
|
/**
|
|
3685
3717
|
* Handles reading of auro-select by screen readers.
|
|
3686
3718
|
* @private
|
|
@@ -4783,8 +4815,7 @@ class AuroMenuOption extends r$4 {
|
|
|
4783
4815
|
reflect: true
|
|
4784
4816
|
},
|
|
4785
4817
|
value: {
|
|
4786
|
-
type: String
|
|
4787
|
-
reflect: true
|
|
4818
|
+
type: String
|
|
4788
4819
|
},
|
|
4789
4820
|
tabIndex: {
|
|
4790
4821
|
type: Number,
|
|
@@ -28,7 +28,6 @@ export class AuroSelect extends LitElement {
|
|
|
28
28
|
};
|
|
29
29
|
value: {
|
|
30
30
|
type: StringConstructor;
|
|
31
|
-
reflect: boolean;
|
|
32
31
|
};
|
|
33
32
|
noValidate: {
|
|
34
33
|
type: BooleanConstructor;
|
|
@@ -181,6 +180,11 @@ export class AuroSelect extends LitElement {
|
|
|
181
180
|
private generateOptionsArray;
|
|
182
181
|
firstUpdated(): void;
|
|
183
182
|
updated(changedProperties: any): void;
|
|
183
|
+
/**
|
|
184
|
+
* Resets component to initial state.
|
|
185
|
+
* @returns {void}
|
|
186
|
+
*/
|
|
187
|
+
reset(): void;
|
|
184
188
|
/**
|
|
185
189
|
* Handles reading of auro-select by screen readers.
|
|
186
190
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auro-select.d.ts","sourceRoot":"","sources":["../src/auro-select.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH;IAyDE
|
|
1
|
+
{"version":3,"file":"auro-select.d.ts","sourceRoot":"","sources":["../src/auro-select.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH;IAyDE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAgDI;;WAEG;;;;QAGH;;WAEG;;;;MAGN;IAED,+CAMC;IAmBD;;;;;;;OAOG;IACH,uBANW,MAAM,QAQhB;IApJC,oBAAyC;IACzC,oBAA+B;IAC/B,iBAAyB;IAMzB;;OAEG;IACH,iBAEuC;IAEvC;;OAEG;IACH,mBAA0C;IAE1C;;OAEG;IACH,qBAAiD;IAOjD;;OAEG;IACH,oBAAyF;IAEzF;;OAEG;IACH,6BAAiC;IAGnC;;;OAGG;IACH,wBAGC;IAFC,2BAAiB;IACjB,kBAAwB;IA0E1B;;;;OAIG;IACH,0BAUC;IATC,cAA4E;IAC5E,iBAA8D;IAsBhE;;;;;OAKG;IACH,6BAyBC;IAED;;;;OAIG;IACH,sBA2DC;IA1DC,cAAwD;IAoBtD,WAAsC;IAwC1C;;;;OAIG;IACH,wBA4CC;IAED;;;;;;;;;;;;;OAaG;IACH,gCAUC;IAED;;;;OAIG;IACH,sBAYC;IAED;;;;OAIG;IACH,6BAMC;IA4BD,qBAYC;IAED,sCAqBC;IAED;;;OAGG;IACH,SAFa,IAAI,CAIhB;IAED;;;;OAIG;IACH,mBAkCC;IAMD,4CAgDC;CACF;2BAxjB0B,KAAK"}
|
|
@@ -110,6 +110,30 @@ class AuroFormValidation {
|
|
|
110
110
|
this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Resets the element to its initial state.
|
|
115
|
+
* @private
|
|
116
|
+
* @param {object} elem - HTML element to reset.
|
|
117
|
+
* @returns {void}
|
|
118
|
+
*/
|
|
119
|
+
reset(elem) {
|
|
120
|
+
elem.validity = undefined;
|
|
121
|
+
elem.value = undefined;
|
|
122
|
+
|
|
123
|
+
// Resets the second value of the datepicker in range state
|
|
124
|
+
if (elem.valueEnd) {
|
|
125
|
+
elem.valueEnd = undefined;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Resets selected option of element
|
|
129
|
+
if (elem.optionSelected) {
|
|
130
|
+
elem.optionSelected = undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Runs validation to handle error attribute
|
|
134
|
+
this.validate(elem);
|
|
135
|
+
}
|
|
136
|
+
|
|
113
137
|
/**
|
|
114
138
|
* Determines the validity state of the element based on the common attribute restrictions (pattern).
|
|
115
139
|
* @private
|
|
@@ -124,10 +148,15 @@ class AuroFormValidation {
|
|
|
124
148
|
elem.validity = 'badInput';
|
|
125
149
|
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
|
|
126
150
|
}
|
|
127
|
-
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
154
|
+
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
128
155
|
elem.validity = 'tooShort';
|
|
129
156
|
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
|
|
130
|
-
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (elem.value?.length > elem.maxLength) {
|
|
131
160
|
elem.validity = 'tooLong';
|
|
132
161
|
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
|
|
133
162
|
}
|
|
@@ -153,7 +182,7 @@ class AuroFormValidation {
|
|
|
153
182
|
elem.validity = 'tooShort';
|
|
154
183
|
elem.setCustomValidity = elem.setCustomValidityForType || '';
|
|
155
184
|
}
|
|
156
|
-
} else if (elem.type === 'number'
|
|
185
|
+
} else if (elem.type === 'number') {
|
|
157
186
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
158
187
|
elem.validity = 'rangeOverflow';
|
|
159
188
|
elem.setCustomValidity = elem.getAttribute('setCustomValidityRangeOverflow') || '';
|
|
@@ -258,14 +287,10 @@ class AuroFormValidation {
|
|
|
258
287
|
|
|
259
288
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
260
289
|
if (elem.validity && elem.validity !== 'valid') {
|
|
261
|
-
elem.isValid = false;
|
|
262
|
-
|
|
263
290
|
// Use the validity message override if it is declared
|
|
264
291
|
if (elem.ValidityMessageOverride) {
|
|
265
292
|
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
266
293
|
}
|
|
267
|
-
} else {
|
|
268
|
-
elem.isValid = true;
|
|
269
294
|
}
|
|
270
295
|
|
|
271
296
|
this.getErrorMessage(elem);
|
|
@@ -2786,7 +2811,7 @@ var colorCss$1 = i$3`.label{color:var(--ds-auro-dropdown-label-text-color)}.trig
|
|
|
2786
2811
|
|
|
2787
2812
|
var tokensCss$2 = i$3`:host{--ds-auro-dropdown-help-text-color: var(--ds-color-text-secondary-default, #525252);--ds-auro-dropdown-label-text-color: var(--ds-color-text-secondary-default, #525252);--ds-auro-dropdown-popover-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdown-popover-border-color: transparent;--ds-auro-dropdown-popover-text-color: var(--ds-color-text-primary-default, #2a2a2a);--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdown-trigger-border-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-primary-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-color-container-primary-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-color-text-primary-default, #2a2a2a)}`;
|
|
2788
2813
|
|
|
2789
|
-
var styleCss$3 = i$3`:host{position:absolute;z-index:var(--depth-tooltip, 400);display:none}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common]
|
|
2814
|
+
var styleCss$3 = i$3`:host{position:absolute;z-index:var(--depth-tooltip, 400);display:none}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}`;
|
|
2790
2815
|
|
|
2791
2816
|
var colorCss$3 = i$3`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2792
2817
|
|
|
@@ -3319,8 +3344,7 @@ class AuroSelect extends r$4 {
|
|
|
3319
3344
|
type: Object
|
|
3320
3345
|
},
|
|
3321
3346
|
value: {
|
|
3322
|
-
type: String
|
|
3323
|
-
reflect: true
|
|
3347
|
+
type: String
|
|
3324
3348
|
},
|
|
3325
3349
|
noValidate: {
|
|
3326
3350
|
type: Boolean,
|
|
@@ -3681,6 +3705,14 @@ class AuroSelect extends r$4 {
|
|
|
3681
3705
|
}
|
|
3682
3706
|
}
|
|
3683
3707
|
|
|
3708
|
+
/**
|
|
3709
|
+
* Resets component to initial state.
|
|
3710
|
+
* @returns {void}
|
|
3711
|
+
*/
|
|
3712
|
+
reset() {
|
|
3713
|
+
this.validation.reset(this);
|
|
3714
|
+
}
|
|
3715
|
+
|
|
3684
3716
|
/**
|
|
3685
3717
|
* Handles reading of auro-select by screen readers.
|
|
3686
3718
|
* @private
|
|
@@ -111,8 +111,7 @@ export class AuroSelect extends LitElement {
|
|
|
111
111
|
type: Object
|
|
112
112
|
},
|
|
113
113
|
value: {
|
|
114
|
-
type: String
|
|
115
|
-
reflect: true
|
|
114
|
+
type: String
|
|
116
115
|
},
|
|
117
116
|
noValidate: {
|
|
118
117
|
type: Boolean,
|
|
@@ -473,6 +472,14 @@ export class AuroSelect extends LitElement {
|
|
|
473
472
|
}
|
|
474
473
|
}
|
|
475
474
|
|
|
475
|
+
/**
|
|
476
|
+
* Resets component to initial state.
|
|
477
|
+
* @returns {void}
|
|
478
|
+
*/
|
|
479
|
+
reset() {
|
|
480
|
+
this.validation.reset(this);
|
|
481
|
+
}
|
|
482
|
+
|
|
476
483
|
/**
|
|
477
484
|
* Handles reading of auro-select by screen readers.
|
|
478
485
|
* @private
|
package/package.json
CHANGED
|
@@ -12,6 +12,30 @@ export default class AuroFormValidation {
|
|
|
12
12
|
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Resets the element to its initial state.
|
|
17
|
+
* @private
|
|
18
|
+
* @param {object} elem - HTML element to reset.
|
|
19
|
+
* @returns {void}
|
|
20
|
+
*/
|
|
21
|
+
reset(elem) {
|
|
22
|
+
elem.validity = undefined;
|
|
23
|
+
elem.value = undefined;
|
|
24
|
+
|
|
25
|
+
// Resets the second value of the datepicker in range state
|
|
26
|
+
if (elem.valueEnd) {
|
|
27
|
+
elem.valueEnd = undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Resets selected option of element
|
|
31
|
+
if (elem.optionSelected) {
|
|
32
|
+
elem.optionSelected = undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Runs validation to handle error attribute
|
|
36
|
+
this.validate(elem);
|
|
37
|
+
}
|
|
38
|
+
|
|
15
39
|
/**
|
|
16
40
|
* Determines the validity state of the element based on the common attribute restrictions (pattern).
|
|
17
41
|
* @private
|
|
@@ -26,10 +50,15 @@ export default class AuroFormValidation {
|
|
|
26
50
|
elem.validity = 'badInput';
|
|
27
51
|
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
|
|
28
52
|
}
|
|
29
|
-
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
56
|
+
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
30
57
|
elem.validity = 'tooShort';
|
|
31
58
|
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
|
|
32
|
-
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (elem.value?.length > elem.maxLength) {
|
|
33
62
|
elem.validity = 'tooLong';
|
|
34
63
|
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
|
|
35
64
|
}
|
|
@@ -55,7 +84,7 @@ export default class AuroFormValidation {
|
|
|
55
84
|
elem.validity = 'tooShort';
|
|
56
85
|
elem.setCustomValidity = elem.setCustomValidityForType || '';
|
|
57
86
|
}
|
|
58
|
-
} else if (elem.type === 'number'
|
|
87
|
+
} else if (elem.type === 'number') {
|
|
59
88
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
60
89
|
elem.validity = 'rangeOverflow';
|
|
61
90
|
elem.setCustomValidity = elem.getAttribute('setCustomValidityRangeOverflow') || '';
|
|
@@ -160,14 +189,10 @@ export default class AuroFormValidation {
|
|
|
160
189
|
|
|
161
190
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
162
191
|
if (elem.validity && elem.validity !== 'valid') {
|
|
163
|
-
elem.isValid = false;
|
|
164
|
-
|
|
165
192
|
// Use the validity message override if it is declared
|
|
166
193
|
if (elem.ValidityMessageOverride) {
|
|
167
194
|
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
168
195
|
}
|
|
169
|
-
} else {
|
|
170
|
-
elem.isValid = true;
|
|
171
196
|
}
|
|
172
197
|
|
|
173
198
|
this.getErrorMessage(elem);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"049b9083252d38be","duration":9861}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"0a1dd4481355cb0b","duration":3090}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"13cf37c850bd8cf4","duration":1554}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"3323eb841acb9c4e","duration":2974}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"34ba23e2e2d652ad","duration":19488}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"368cd6fed7975ad2","duration":3003}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"3924bce8e51f0ffa","duration":1476}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"4567487084a055b7","duration":3312}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"4763278a7d3dbc16","duration":3516}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"549e6ef9f9ffd9a8","duration":738}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"59ccd8430174883c","duration":2673}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"683d4c0e20c077a9","duration":10159}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"8f8ffe35cc79d1a9","duration":4504}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"926d632729ca6536","duration":6169}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"9e7be41cc3a7ef43","duration":1810}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"9ee793063ea89126","duration":5572}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"a1558cef51c034da","duration":1671}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"a24f2ff8e94e56e8","duration":18961}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"a2705cf095a2ceb0","duration":18976}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"a33c0749886a41b5","duration":6457}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"a66b465385a30a2b","duration":21344}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"c1b72a92dec4fe37","duration":6044}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"e25ac25a8a0ad126","duration":2500}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"e671573e4ef02c47","duration":18924}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"e86cee22dff5e281","duration":2379}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"hash":"f680556a8e954eac","duration":18230}
|
|
Binary file
|