@aurodesignsystem/auro-formkit 2.0.0-beta.2 → 2.0.0-beta.4
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/02244170c798a2bd-meta.json +1 -0
- package/.turbo/cache/02244170c798a2bd.tar.zst +0 -0
- package/.turbo/cache/051ff97a20add0e2-meta.json +1 -0
- package/.turbo/cache/051ff97a20add0e2.tar.zst +0 -0
- package/.turbo/cache/07ca42419b9f050c-meta.json +1 -1
- package/.turbo/cache/0cea4c1f34f3683b-meta.json +1 -1
- package/.turbo/cache/0ea853339c064fa1-meta.json +1 -0
- package/.turbo/cache/0ea853339c064fa1.tar.zst +0 -0
- package/.turbo/cache/16658beec9f4a809-meta.json +1 -0
- package/.turbo/cache/16658beec9f4a809.tar.zst +0 -0
- package/.turbo/cache/17259cf94d8f8925-meta.json +1 -1
- package/.turbo/cache/1b9818717e4bdf9f-meta.json +1 -0
- package/.turbo/cache/1b9818717e4bdf9f.tar.zst +0 -0
- package/.turbo/cache/1c0f580d37370ba2-meta.json +1 -0
- package/.turbo/cache/1c0f580d37370ba2.tar.zst +0 -0
- package/.turbo/cache/1c99a949ec63ab35-meta.json +1 -1
- package/.turbo/cache/1df4710eef8ed00d-meta.json +1 -0
- package/.turbo/cache/1df4710eef8ed00d.tar.zst +0 -0
- package/.turbo/cache/204b66d1b253e9cc-meta.json +1 -0
- package/.turbo/cache/204b66d1b253e9cc.tar.zst +0 -0
- package/.turbo/cache/257a7a26ea72dbc5-meta.json +1 -1
- package/.turbo/cache/2a5d0939d6fc1052-meta.json +1 -0
- package/.turbo/cache/2a5d0939d6fc1052.tar.zst +0 -0
- package/.turbo/cache/2e3b829fcf75c836-meta.json +1 -0
- package/.turbo/cache/2e3b829fcf75c836.tar.zst +0 -0
- package/.turbo/cache/3bf45120d0cc9bd8-meta.json +1 -1
- package/.turbo/cache/3d380d0d40404cac-meta.json +1 -0
- package/.turbo/cache/3d380d0d40404cac.tar.zst +0 -0
- package/.turbo/cache/3e12285c614db539-meta.json +1 -0
- package/.turbo/cache/3e12285c614db539.tar.zst +0 -0
- package/.turbo/cache/45035bf5c4147ccd-meta.json +1 -1
- package/.turbo/cache/5bf2d3f7ba5891e0-meta.json +1 -0
- package/.turbo/cache/5bf2d3f7ba5891e0.tar.zst +0 -0
- package/.turbo/cache/5f304c0f37ef25f3-meta.json +1 -1
- 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/6dd67d179191bda8-meta.json +1 -0
- package/.turbo/cache/6dd67d179191bda8.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/7e1043cffa69f327-meta.json +1 -0
- package/.turbo/cache/7e1043cffa69f327.tar.zst +0 -0
- package/.turbo/cache/7ffd501e81790676-meta.json +1 -0
- package/.turbo/cache/7ffd501e81790676.tar.zst +0 -0
- package/.turbo/cache/80a13352066a9801-meta.json +1 -0
- package/.turbo/cache/80a13352066a9801.tar.zst +0 -0
- package/.turbo/cache/80b5d974184a01df-meta.json +1 -1
- package/.turbo/cache/8954c6073396fadd-meta.json +1 -1
- package/.turbo/cache/8e79bd5c3a16a72e-meta.json +1 -0
- package/.turbo/cache/8e9ebc3df0e18de0-meta.json +1 -0
- package/.turbo/cache/8e9ebc3df0e18de0.tar.zst +0 -0
- package/.turbo/cache/92daa6d7c389d548-meta.json +1 -1
- package/.turbo/cache/973d0eea26083f4b-meta.json +1 -0
- package/.turbo/cache/973d0eea26083f4b.tar.zst +0 -0
- package/.turbo/cache/9c6ad42729c7b2d8-meta.json +1 -0
- package/.turbo/cache/9c6ad42729c7b2d8.tar.zst +0 -0
- package/.turbo/cache/a77bc920ea508bb8-meta.json +1 -1
- package/.turbo/cache/a77bc920ea508bb8.tar.zst +0 -0
- package/.turbo/cache/a9a9d012c83882d8-meta.json +1 -0
- package/.turbo/cache/a9a9d012c83882d8.tar.zst +0 -0
- package/.turbo/cache/b54fc4f664a7a5a0-meta.json +1 -1
- package/.turbo/cache/ba4418918621fbcd-meta.json +1 -1
- package/.turbo/cache/be7c23c37b8ec74b-meta.json +1 -1
- package/.turbo/cache/be7c23c37b8ec74b.tar.zst +0 -0
- package/.turbo/cache/bffc7582905c2a5e-meta.json +1 -0
- package/.turbo/cache/bffc7582905c2a5e.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/d572ebb3c833e8f4-meta.json +1 -0
- package/.turbo/cache/d572ebb3c833e8f4.tar.zst +0 -0
- package/.turbo/cache/d61543843c932504-meta.json +1 -0
- package/.turbo/cache/d61543843c932504.tar.zst +0 -0
- package/.turbo/cache/dad1301ac69bcb85-meta.json +1 -1
- package/.turbo/cache/db361cb6578dca84-meta.json +1 -0
- package/.turbo/cache/db361cb6578dca84.tar.zst +0 -0
- package/.turbo/cache/dea5945f55c6aba5-meta.json +1 -0
- package/.turbo/cache/dea5945f55c6aba5.tar.zst +0 -0
- package/.turbo/cache/e992dab20aeefbaf-meta.json +1 -1
- package/.turbo/cache/e992dab20aeefbaf.tar.zst +0 -0
- package/.turbo/cache/f3ff9040a2196834-meta.json +1 -0
- package/.turbo/cache/f3ff9040a2196834.tar.zst +0 -0
- package/.turbo/cache/f817d89688cefca8-meta.json +1 -0
- package/.turbo/cache/f817d89688cefca8.tar.zst +0 -0
- package/.turbo/cache/fa132b5b5f0e75f8-meta.json +1 -1
- package/.turbo/cache/fc57c17867dcac3d-meta.json +1 -0
- package/.turbo/cache/fc57c17867dcac3d.tar.zst +0 -0
- package/CHANGELOG.md +44 -0
- package/components/checkbox/.turbo/turbo-build.log +3 -3
- package/components/checkbox/.turbo/turbo-bundler.log +3 -3
- package/components/checkbox/demo/api.md +4 -2
- package/components/checkbox/demo/api.min.js +31 -36
- package/components/checkbox/demo/index.min.js +31 -36
- package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
- package/components/checkbox/dist/index.js +31 -36
- package/components/checkbox/src/auro-checkbox-group.js +2 -2
- package/components/combobox/.turbo/turbo-build.log +3 -3
- package/components/combobox/demo/api.md +17 -15
- package/components/combobox/demo/api.min.js +500 -218
- package/components/combobox/demo/index.min.js +500 -218
- package/components/combobox/dist/auro-combobox.d.ts +11 -4
- package/components/combobox/dist/auro-combobox.d.ts.map +1 -1
- package/components/combobox/dist/index.js +499 -217
- package/components/combobox/src/auro-combobox.js +22 -20
- 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 +9 -8
- package/components/datepicker/demo/api.md +107 -87
- package/components/datepicker/demo/api.min.js +492 -232
- package/components/datepicker/demo/index.min.js +492 -232
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -13
- package/components/datepicker/dist/auro-datepicker.d.ts.map +1 -1
- package/components/datepicker/dist/index.js +492 -232
- package/components/datepicker/src/auro-datepicker.js +15 -35
- package/components/dropdown/.turbo/turbo-build.log +3 -3
- package/components/dropdown/.turbo/turbo-bundler.log +2 -2
- package/components/dropdown/demo/api.md +4 -4
- package/components/dropdown/demo/api.min.js +166 -42
- package/components/dropdown/demo/index.min.js +166 -42
- package/components/dropdown/dist/auro-dropdown.d.ts +93 -34
- package/components/dropdown/dist/auro-dropdown.d.ts.map +1 -1
- package/components/dropdown/dist/auro-dropdownBib.d.ts +9 -3
- package/components/dropdown/dist/auro-dropdownBib.d.ts.map +1 -1
- package/components/dropdown/dist/index.js +166 -42
- package/components/dropdown/src/auro-dropdown.js +154 -39
- package/components/dropdown/src/auro-dropdownBib.js +12 -3
- package/components/dropdown/src/styles/style-css.js +1 -1
- package/components/dropdown/src/styles/style.css +4 -0
- package/components/dropdown/src/styles/style.scss +5 -0
- 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 +51 -1
- package/components/input/.turbo/turbo-build.log +56 -6
- package/components/input/.turbo/turbo-bundler.log +3 -3
- package/components/input/.turbo/turbo-sass$colon$render.log +6 -0
- package/components/input/demo/api.md +83 -81
- package/components/input/demo/api.min.js +282 -121
- package/components/input/demo/index.md +6 -6
- package/components/input/demo/index.min.js +282 -121
- package/components/input/dist/auro-input.d.ts.map +1 -1
- package/components/input/dist/base-input.d.ts +155 -84
- package/components/input/dist/base-input.d.ts.map +1 -1
- package/components/input/dist/index.js +282 -121
- package/components/input/dist/styles/mixins-css.d.ts +3 -0
- package/components/input/dist/styles/mixins-css.d.ts.map +1 -0
- package/components/input/src/auro-input.js +0 -1
- package/components/input/src/base-input.js +252 -85
- package/components/input/src/styles/borders.scss +3 -19
- package/components/input/src/styles/color.css +1 -2
- package/components/input/src/styles/color.scss +3 -10
- package/components/input/src/styles/input-css.js +1 -1
- package/components/input/src/styles/input.css +1 -1
- package/components/input/src/styles/input.scss +4 -1
- package/components/input/src/styles/label-css.js +1 -1
- package/components/input/src/styles/label.css +1 -1
- package/components/input/src/styles/label.scss +4 -7
- package/components/input/src/styles/mixins-css.js +2 -0
- package/components/input/src/styles/mixins.css +1 -0
- package/components/input/src/styles/mixins.scss +45 -0
- package/components/input/src/styles/notificationIcons-css.js +1 -1
- package/components/input/src/styles/notificationIcons.css +13 -12
- package/components/input/src/styles/notificationIcons.scss +17 -25
- package/components/input/src/styles/style-css.js +1 -1
- package/components/input/src/styles/style.css +15 -17
- package/components/input/src/styles/style.scss +0 -4
- 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 -1
- package/components/menu/demo/index.min.js +1 -1
- package/components/menu/dist/auro-menu.d.ts +1 -1
- package/components/menu/dist/index.js +1 -1
- package/components/menu/src/auro-menu.js +1 -1
- package/components/radio/.turbo/turbo-build.log +3 -3
- package/components/radio/.turbo/turbo-bundler.log +3 -3
- package/components/radio/demo/api.md +3 -1
- package/components/radio/demo/api.min.js +30 -35
- package/components/radio/demo/index.min.js +30 -35
- package/components/radio/dist/index.js +30 -35
- package/components/radio/src/auro-radio-group.js +1 -1
- package/components/select/.turbo/turbo-build.log +7 -9
- package/components/select/demo/api.md +45 -110
- package/components/select/demo/api.min.js +320 -224
- package/components/select/demo/index.md +100 -43
- package/components/select/demo/index.min.js +320 -220
- package/components/select/dist/auro-select.d.ts +64 -51
- package/components/select/dist/auro-select.d.ts.map +1 -1
- package/components/select/dist/index.js +314 -201
- package/components/select/src/auro-select.js +100 -118
- package/components/select/src/styles/style-css.js +1 -1
- package/components/select/src/styles/style.css +7 -0
- package/components/select/src/styles/style.scss +11 -1
- package/package.json +1 -1
- package/packages/form-validation/src/validation.js +29 -34
- package/.turbo/cache/0663fcbb1d711029-meta.json +0 -1
- package/.turbo/cache/0663fcbb1d711029.tar.zst +0 -0
- package/.turbo/cache/0a2b0a4df8a0443f-meta.json +0 -1
- package/.turbo/cache/120c8e207aa1ba35-meta.json +0 -1
- package/.turbo/cache/120c8e207aa1ba35.tar.zst +0 -0
- package/.turbo/cache/17dd4bdef6550a07-meta.json +0 -1
- package/.turbo/cache/17dd4bdef6550a07.tar.zst +0 -0
- package/.turbo/cache/1de15d89eed2d760-meta.json +0 -1
- package/.turbo/cache/1de15d89eed2d760.tar.zst +0 -0
- package/.turbo/cache/2990aaa7ebc5b967-meta.json +0 -1
- package/.turbo/cache/2990aaa7ebc5b967.tar.zst +0 -0
- package/.turbo/cache/32c0b9995fb5f8dd-meta.json +0 -1
- package/.turbo/cache/32c0b9995fb5f8dd.tar.zst +0 -0
- package/.turbo/cache/47ba2b5ebdb579e9-meta.json +0 -1
- package/.turbo/cache/47ba2b5ebdb579e9.tar.zst +0 -0
- package/.turbo/cache/4f92cea2d8c63de2-meta.json +0 -1
- package/.turbo/cache/4f92cea2d8c63de2.tar.zst +0 -0
- package/.turbo/cache/56cb35d4c7473a23-meta.json +0 -1
- package/.turbo/cache/56cb35d4c7473a23.tar.zst +0 -0
- package/.turbo/cache/5c16ce3cff5c9dff-meta.json +0 -1
- package/.turbo/cache/5c16ce3cff5c9dff.tar.zst +0 -0
- package/.turbo/cache/626afdc67e0cb540-meta.json +0 -1
- package/.turbo/cache/626afdc67e0cb540.tar.zst +0 -0
- package/.turbo/cache/6ef81cf9a66f982a-meta.json +0 -1
- package/.turbo/cache/6ef81cf9a66f982a.tar.zst +0 -0
- package/.turbo/cache/784c03fe9fd5ac05-meta.json +0 -1
- package/.turbo/cache/784c03fe9fd5ac05.tar.zst +0 -0
- package/.turbo/cache/87219c41a4ace9cd-meta.json +0 -1
- package/.turbo/cache/87219c41a4ace9cd.tar.zst +0 -0
- package/.turbo/cache/8b735250fa5a62bf-meta.json +0 -1
- package/.turbo/cache/8b735250fa5a62bf.tar.zst +0 -0
- package/.turbo/cache/9154e8fe6ab767ea-meta.json +0 -1
- package/.turbo/cache/9154e8fe6ab767ea.tar.zst +0 -0
- package/.turbo/cache/993dff2edb7b6766-meta.json +0 -1
- package/.turbo/cache/993dff2edb7b6766.tar.zst +0 -0
- package/.turbo/cache/9a097d6576dadd64-meta.json +0 -1
- package/.turbo/cache/9a097d6576dadd64.tar.zst +0 -0
- package/.turbo/cache/a49cc58242467fdc-meta.json +0 -1
- package/.turbo/cache/a49cc58242467fdc.tar.zst +0 -0
- package/.turbo/cache/a6a56bb802e1c20f-meta.json +0 -1
- package/.turbo/cache/a6a56bb802e1c20f.tar.zst +0 -0
- package/.turbo/cache/af061e7a077a9ba5-meta.json +0 -1
- package/.turbo/cache/af061e7a077a9ba5.tar.zst +0 -0
- package/.turbo/cache/b50f1b283b4b81cd-meta.json +0 -1
- package/.turbo/cache/b50f1b283b4b81cd.tar.zst +0 -0
- package/.turbo/cache/bf85bc040b7e64db-meta.json +0 -1
- package/.turbo/cache/bf85bc040b7e64db.tar.zst +0 -0
- package/.turbo/cache/cd5f6987783fb56d-meta.json +0 -1
- package/.turbo/cache/cd5f6987783fb56d.tar.zst +0 -0
- package/.turbo/cache/ce67b6522dd09e64-meta.json +0 -1
- package/.turbo/cache/ce67b6522dd09e64.tar.zst +0 -0
- package/.turbo/cache/d716cb7a08152beb-meta.json +0 -1
- package/.turbo/cache/d716cb7a08152beb.tar.zst +0 -0
- package/.turbo/cache/d7a47b77deb3d9a4-meta.json +0 -1
- package/.turbo/cache/d7a47b77deb3d9a4.tar.zst +0 -0
- package/.turbo/cache/fbbe2704bf9cb90b-meta.json +0 -1
- package/.turbo/cache/fbbe2704bf9cb90b.tar.zst +0 -0
- package/.turbo/cache/ff58f630c9d69af4-meta.json +0 -1
- package/.turbo/cache/ff58f630c9d69af4.tar.zst +0 -0
- /package/.turbo/cache/{0a2b0a4df8a0443f.tar.zst → 8e79bd5c3a16a72e.tar.zst} +0 -0
|
@@ -411,20 +411,20 @@ class AuroFormValidation {
|
|
|
411
411
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
412
412
|
|
|
413
413
|
if (!pattern.test(elem.value)) {
|
|
414
|
-
elem.validity = '
|
|
415
|
-
elem.
|
|
414
|
+
elem.validity = 'patternMismatch';
|
|
415
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
420
420
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
421
421
|
elem.validity = 'tooShort';
|
|
422
|
-
elem.
|
|
422
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
if (elem.value?.length > elem.maxLength) {
|
|
426
426
|
elem.validity = 'tooLong';
|
|
427
|
-
elem.
|
|
427
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
|
|
@@ -440,33 +440,32 @@ class AuroFormValidation {
|
|
|
440
440
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
441
441
|
|
|
442
442
|
if (!elem.value.match(emailRegex)) {
|
|
443
|
-
elem.validity = '
|
|
444
|
-
elem.
|
|
443
|
+
elem.validity = 'patternMismatch';
|
|
444
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
445
445
|
}
|
|
446
446
|
} else if (elem.type === 'credit-card') {
|
|
447
447
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
448
448
|
elem.validity = 'tooShort';
|
|
449
|
-
elem.
|
|
449
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
450
450
|
}
|
|
451
451
|
} else if (elem.type === 'number') {
|
|
452
452
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
453
453
|
elem.validity = 'rangeOverflow';
|
|
454
|
-
elem.
|
|
454
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
457
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
458
458
|
elem.validity = 'rangeUnderflow';
|
|
459
|
-
elem.
|
|
459
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
460
460
|
}
|
|
461
|
-
|
|
462
461
|
} else if (elem.type === 'month-day-year' ||
|
|
463
462
|
elem.type === 'month-year' ||
|
|
464
463
|
elem.type === 'month-fullYear' ||
|
|
465
464
|
elem.type === 'year-month-day'
|
|
466
465
|
) {
|
|
467
|
-
if (elem.value
|
|
466
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
468
467
|
elem.validity = 'tooShort';
|
|
469
|
-
elem.
|
|
468
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
470
469
|
} else {
|
|
471
470
|
const valueDate = new Date(elem.value);
|
|
472
471
|
|
|
@@ -476,7 +475,7 @@ class AuroFormValidation {
|
|
|
476
475
|
|
|
477
476
|
if (valueDate > maxDate) {
|
|
478
477
|
elem.validity = 'rangeOverflow';
|
|
479
|
-
elem.
|
|
478
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
480
479
|
}
|
|
481
480
|
}
|
|
482
481
|
|
|
@@ -486,7 +485,7 @@ class AuroFormValidation {
|
|
|
486
485
|
|
|
487
486
|
if (valueDate < minDate) {
|
|
488
487
|
elem.validity = 'rangeUnderflow';
|
|
489
|
-
elem.
|
|
488
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
490
489
|
}
|
|
491
490
|
}
|
|
492
491
|
}
|
|
@@ -509,10 +508,10 @@ class AuroFormValidation {
|
|
|
509
508
|
|
|
510
509
|
if (elem.hasAttribute('error')) {
|
|
511
510
|
elem.validity = 'customError';
|
|
512
|
-
elem.
|
|
511
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
513
512
|
} else if (validationShouldRun) {
|
|
514
513
|
elem.validity = 'valid';
|
|
515
|
-
elem.
|
|
514
|
+
elem.errorMessage = '';
|
|
516
515
|
|
|
517
516
|
/**
|
|
518
517
|
* Only validate once we interact with the datepicker
|
|
@@ -524,7 +523,7 @@ class AuroFormValidation {
|
|
|
524
523
|
let hasValue = elem.value && elem.value.length > 0;
|
|
525
524
|
|
|
526
525
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
527
|
-
if (this.auroInputElements
|
|
526
|
+
if (this.auroInputElements?.length === 2) {
|
|
528
527
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
529
528
|
hasValue = false;
|
|
530
529
|
}
|
|
@@ -532,31 +531,27 @@ class AuroFormValidation {
|
|
|
532
531
|
|
|
533
532
|
if (!hasValue && elem.required) {
|
|
534
533
|
elem.validity = 'valueMissing';
|
|
535
|
-
elem.
|
|
534
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
536
535
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
537
536
|
this.validateType(elem);
|
|
538
537
|
this.validateAttributes(elem);
|
|
539
538
|
}
|
|
540
539
|
}
|
|
541
540
|
|
|
542
|
-
if (this.auroInputElements
|
|
541
|
+
if (this.auroInputElements?.length > 0) {
|
|
543
542
|
elem.validity = this.auroInputElements[0].validity;
|
|
544
|
-
elem.
|
|
543
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
545
544
|
|
|
546
|
-
if (elem.validity === 'valid') {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
550
|
-
}
|
|
545
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
546
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
547
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
551
548
|
}
|
|
552
549
|
}
|
|
553
550
|
|
|
554
551
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
559
|
-
}
|
|
552
|
+
// Use the validity message override if it is declared
|
|
553
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
554
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
560
555
|
}
|
|
561
556
|
|
|
562
557
|
this.getErrorMessage(elem);
|
|
@@ -602,18 +597,18 @@ class AuroFormValidation {
|
|
|
602
597
|
if (elem.validity !== 'valid') {
|
|
603
598
|
if (elem.setCustomValidity) {
|
|
604
599
|
elem.errorMessage = elem.setCustomValidity;
|
|
605
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
600
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
606
601
|
const input = elem.renderRoot.querySelector('input');
|
|
607
602
|
|
|
608
603
|
if (input.validationMessage.length > 0) {
|
|
609
604
|
elem.errorMessage = input.validationMessage;
|
|
610
605
|
}
|
|
611
|
-
} else if (this.inputElements &&
|
|
606
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
612
607
|
const firstInput = this.inputElements[0];
|
|
613
608
|
|
|
614
609
|
if (firstInput.validationMessage.length > 0) {
|
|
615
610
|
elem.errorMessage = firstInput.validationMessage;
|
|
616
|
-
} else if (this.inputElements
|
|
611
|
+
} else if (this.inputElements?.length === 2) {
|
|
617
612
|
const secondInput = this.inputElements[1];
|
|
618
613
|
|
|
619
614
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -1036,7 +1031,7 @@ class AuroRadioGroup extends r {
|
|
|
1036
1031
|
</p>`
|
|
1037
1032
|
: x`
|
|
1038
1033
|
<p class="radioGroupElement-helpText" role="alert" aria-live="assertive" part="helpText">
|
|
1039
|
-
${this.
|
|
1034
|
+
${this.errorMessage}
|
|
1040
1035
|
</p>`
|
|
1041
1036
|
}
|
|
1042
1037
|
`;
|
|
@@ -411,20 +411,20 @@ class AuroFormValidation {
|
|
|
411
411
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
412
412
|
|
|
413
413
|
if (!pattern.test(elem.value)) {
|
|
414
|
-
elem.validity = '
|
|
415
|
-
elem.
|
|
414
|
+
elem.validity = 'patternMismatch';
|
|
415
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
420
420
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
421
421
|
elem.validity = 'tooShort';
|
|
422
|
-
elem.
|
|
422
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
if (elem.value?.length > elem.maxLength) {
|
|
426
426
|
elem.validity = 'tooLong';
|
|
427
|
-
elem.
|
|
427
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
|
|
@@ -440,33 +440,32 @@ class AuroFormValidation {
|
|
|
440
440
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
441
441
|
|
|
442
442
|
if (!elem.value.match(emailRegex)) {
|
|
443
|
-
elem.validity = '
|
|
444
|
-
elem.
|
|
443
|
+
elem.validity = 'patternMismatch';
|
|
444
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
445
445
|
}
|
|
446
446
|
} else if (elem.type === 'credit-card') {
|
|
447
447
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
448
448
|
elem.validity = 'tooShort';
|
|
449
|
-
elem.
|
|
449
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
450
450
|
}
|
|
451
451
|
} else if (elem.type === 'number') {
|
|
452
452
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
453
453
|
elem.validity = 'rangeOverflow';
|
|
454
|
-
elem.
|
|
454
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
457
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
458
458
|
elem.validity = 'rangeUnderflow';
|
|
459
|
-
elem.
|
|
459
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
460
460
|
}
|
|
461
|
-
|
|
462
461
|
} else if (elem.type === 'month-day-year' ||
|
|
463
462
|
elem.type === 'month-year' ||
|
|
464
463
|
elem.type === 'month-fullYear' ||
|
|
465
464
|
elem.type === 'year-month-day'
|
|
466
465
|
) {
|
|
467
|
-
if (elem.value
|
|
466
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
468
467
|
elem.validity = 'tooShort';
|
|
469
|
-
elem.
|
|
468
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
470
469
|
} else {
|
|
471
470
|
const valueDate = new Date(elem.value);
|
|
472
471
|
|
|
@@ -476,7 +475,7 @@ class AuroFormValidation {
|
|
|
476
475
|
|
|
477
476
|
if (valueDate > maxDate) {
|
|
478
477
|
elem.validity = 'rangeOverflow';
|
|
479
|
-
elem.
|
|
478
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
480
479
|
}
|
|
481
480
|
}
|
|
482
481
|
|
|
@@ -486,7 +485,7 @@ class AuroFormValidation {
|
|
|
486
485
|
|
|
487
486
|
if (valueDate < minDate) {
|
|
488
487
|
elem.validity = 'rangeUnderflow';
|
|
489
|
-
elem.
|
|
488
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
490
489
|
}
|
|
491
490
|
}
|
|
492
491
|
}
|
|
@@ -509,10 +508,10 @@ class AuroFormValidation {
|
|
|
509
508
|
|
|
510
509
|
if (elem.hasAttribute('error')) {
|
|
511
510
|
elem.validity = 'customError';
|
|
512
|
-
elem.
|
|
511
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
513
512
|
} else if (validationShouldRun) {
|
|
514
513
|
elem.validity = 'valid';
|
|
515
|
-
elem.
|
|
514
|
+
elem.errorMessage = '';
|
|
516
515
|
|
|
517
516
|
/**
|
|
518
517
|
* Only validate once we interact with the datepicker
|
|
@@ -524,7 +523,7 @@ class AuroFormValidation {
|
|
|
524
523
|
let hasValue = elem.value && elem.value.length > 0;
|
|
525
524
|
|
|
526
525
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
527
|
-
if (this.auroInputElements
|
|
526
|
+
if (this.auroInputElements?.length === 2) {
|
|
528
527
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
529
528
|
hasValue = false;
|
|
530
529
|
}
|
|
@@ -532,31 +531,27 @@ class AuroFormValidation {
|
|
|
532
531
|
|
|
533
532
|
if (!hasValue && elem.required) {
|
|
534
533
|
elem.validity = 'valueMissing';
|
|
535
|
-
elem.
|
|
534
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
536
535
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
537
536
|
this.validateType(elem);
|
|
538
537
|
this.validateAttributes(elem);
|
|
539
538
|
}
|
|
540
539
|
}
|
|
541
540
|
|
|
542
|
-
if (this.auroInputElements
|
|
541
|
+
if (this.auroInputElements?.length > 0) {
|
|
543
542
|
elem.validity = this.auroInputElements[0].validity;
|
|
544
|
-
elem.
|
|
543
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
545
544
|
|
|
546
|
-
if (elem.validity === 'valid') {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
550
|
-
}
|
|
545
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
546
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
547
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
551
548
|
}
|
|
552
549
|
}
|
|
553
550
|
|
|
554
551
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
559
|
-
}
|
|
552
|
+
// Use the validity message override if it is declared
|
|
553
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
554
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
560
555
|
}
|
|
561
556
|
|
|
562
557
|
this.getErrorMessage(elem);
|
|
@@ -602,18 +597,18 @@ class AuroFormValidation {
|
|
|
602
597
|
if (elem.validity !== 'valid') {
|
|
603
598
|
if (elem.setCustomValidity) {
|
|
604
599
|
elem.errorMessage = elem.setCustomValidity;
|
|
605
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
600
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
606
601
|
const input = elem.renderRoot.querySelector('input');
|
|
607
602
|
|
|
608
603
|
if (input.validationMessage.length > 0) {
|
|
609
604
|
elem.errorMessage = input.validationMessage;
|
|
610
605
|
}
|
|
611
|
-
} else if (this.inputElements &&
|
|
606
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
612
607
|
const firstInput = this.inputElements[0];
|
|
613
608
|
|
|
614
609
|
if (firstInput.validationMessage.length > 0) {
|
|
615
610
|
elem.errorMessage = firstInput.validationMessage;
|
|
616
|
-
} else if (this.inputElements
|
|
611
|
+
} else if (this.inputElements?.length === 2) {
|
|
617
612
|
const secondInput = this.inputElements[1];
|
|
618
613
|
|
|
619
614
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -1036,7 +1031,7 @@ class AuroRadioGroup extends r {
|
|
|
1036
1031
|
</p>`
|
|
1037
1032
|
: x`
|
|
1038
1033
|
<p class="radioGroupElement-helpText" role="alert" aria-live="assertive" part="helpText">
|
|
1039
|
-
${this.
|
|
1034
|
+
${this.errorMessage}
|
|
1040
1035
|
</p>`
|
|
1041
1036
|
}
|
|
1042
1037
|
`;
|
|
@@ -137,13 +137,13 @@ More info and automated migrator: https://sass-lang.com/d/import
|
|
|
137
137
|
|
|
138
138
|
[36m
|
|
139
139
|
[1m./src/index.js[22m → [1mdist[22m...[39m
|
|
140
|
-
[32mcreated [1mdist[22m in [
|
|
140
|
+
[32mcreated [1mdist[22m in [1m584ms[22m[39m
|
|
141
141
|
[36m
|
|
142
142
|
[1m./demo/index.js[22m → [1m./demo/[22m...[39m
|
|
143
|
-
[32mcreated [1m./demo/[22m in [
|
|
143
|
+
[32mcreated [1m./demo/[22m in [1m480ms[22m[39m
|
|
144
144
|
[36m
|
|
145
145
|
[1m./demo/api.js[22m → [1m./demo/[22m...[39m
|
|
146
|
-
[32mcreated [1m./demo/[22m in [
|
|
146
|
+
[32mcreated [1m./demo/[22m in [1m459ms[22m[39m
|
|
147
147
|
|
|
148
148
|
> @auro-formkit/auro-select@3.3.0 build:docs
|
|
149
149
|
> wca analyze 'scripts/wca/*.js' --outFiles docs/api.md; node ../../packages/build-tools/src/docProcessor.mjs --component select
|
|
@@ -174,20 +174,22 @@ Retrieving latest "/home/runner/work/auro-formkit/auro-formkit/components/select
|
|
|
174
174
|
Transforms run
|
|
175
175
|
⁕ FILE:src=./../docs/partials/description.md
|
|
176
176
|
⁕ FILE:src=./../apiExamples/basic.html
|
|
177
|
+
⁕ FILE:src=./../apiExamples/customPlaceholder.html
|
|
178
|
+
⁕ FILE:src=./../apiExamples/slots.html
|
|
177
179
|
⁕ FILE:src=./../apiExamples/withIcons.html
|
|
178
180
|
⁕ FILE:src=./../apiExamples/withSubmenus.html
|
|
179
181
|
⁕ FILE:src=./../apiExamples/noCheckmark.html
|
|
180
182
|
⁕ FILE:src=../apiExamples/customBibHeight.html
|
|
181
|
-
⁕ FILE:src=./../apiExamples/slots.html
|
|
182
183
|
⁕ FILE:src=./../apiExamples/error.html
|
|
183
184
|
⁕ FILE:src=./../apiExamples/disabled.html
|
|
184
185
|
⁕ FILE:src=./../apiExamples/custom.html
|
|
185
186
|
⁕ CODE:src=./../apiExamples/basic.html
|
|
187
|
+
⁕ CODE:src=./../apiExamples/customPlaceholder.html
|
|
188
|
+
⁕ CODE:src=./../apiExamples/slots.html
|
|
186
189
|
⁕ CODE:src=./../apiExamples/withIcons.html
|
|
187
190
|
⁕ CODE:src=./../apiExamples/withSubmenus.html
|
|
188
191
|
⁕ CODE:src=./../apiExamples/noCheckmark.html
|
|
189
192
|
⁕ CODE:src=../apiExamples/customBibHeight.html
|
|
190
|
-
⁕ CODE:src=./../apiExamples/slots.html
|
|
191
193
|
⁕ CODE:src=./../apiExamples/error.html
|
|
192
194
|
⁕ CODE:src=./../apiExamples/disabled.html
|
|
193
195
|
⁕ CODE:src=./../apiExamples/custom.html
|
|
@@ -197,13 +199,11 @@ Retrieving latest "/home/runner/work/auro-formkit/auro-formkit/components/select
|
|
|
197
199
|
⁕ FILE:src=./../docs/api.md
|
|
198
200
|
⁕ FILE:src=./../apiExamples/basic.html
|
|
199
201
|
⁕ FILE:src=./../apiExamples/value.html
|
|
200
|
-
⁕ FILE:src=./../apiExamples/customPlaceholder.html
|
|
201
202
|
⁕ FILE:src=./../apiExamples/required.html
|
|
202
203
|
⁕ FILE:src=./../apiExamples/errorApi.html
|
|
203
204
|
⁕ FILE:src=./../apiExamples/disabled.html
|
|
204
205
|
⁕ FILE:src=../apiExamples/flexMenuWidth.html
|
|
205
206
|
⁕ FILE:src=./../apiExamples/label.html
|
|
206
|
-
⁕ FILE:src=./../apiExamples/labelWithPlaceholder.html
|
|
207
207
|
⁕ FILE:src=./../apiExamples/helpText.html
|
|
208
208
|
⁕ FILE:src=./../apiExamples/resetState.html
|
|
209
209
|
⁕ FILE:src=./../apiExamples/valueExtraction.html
|
|
@@ -214,13 +214,11 @@ Retrieving latest "/home/runner/work/auro-formkit/auro-formkit/components/select
|
|
|
214
214
|
⁕ CODE:src=./../apiExamples/basic.html
|
|
215
215
|
⁕ CODE:src=./../apiExamples/value.html
|
|
216
216
|
⁕ CODE:src=./../apiExamples/value.js
|
|
217
|
-
⁕ CODE:src=./../apiExamples/customPlaceholder.html
|
|
218
217
|
⁕ CODE:src=./../apiExamples/required.html
|
|
219
218
|
⁕ CODE:src=./../apiExamples/errorApi.html
|
|
220
219
|
⁕ CODE:src=./../apiExamples/disabled.html
|
|
221
220
|
⁕ CODE:src=../apiExamples/flexMenuWidth.html
|
|
222
221
|
⁕ CODE:src=./../apiExamples/label.html
|
|
223
|
-
⁕ CODE:src=./../apiExamples/labelWithPlaceholder.html
|
|
224
222
|
⁕ CODE:src=./../apiExamples/helpText.html
|
|
225
223
|
⁕ CODE:src=./../apiExamples/resetState.html
|
|
226
224
|
⁕ CODE:src=./../apiExamples/resetState.js
|