@aurodesignsystem/auro-formkit 2.0.0-beta.2 → 2.0.0-beta.3
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/07ca42419b9f050c-meta.json +1 -1
- package/.turbo/cache/0cea4c1f34f3683b-meta.json +1 -1
- package/.turbo/cache/17259cf94d8f8925-meta.json +1 -1
- package/.turbo/cache/1ab37ce15d9be440-meta.json +1 -0
- package/.turbo/cache/1ab37ce15d9be440.tar.zst +0 -0
- 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/1de15d89eed2d760-meta.json +1 -1
- package/.turbo/cache/2110a4d14e0d11b2-meta.json +1 -0
- package/.turbo/cache/2110a4d14e0d11b2.tar.zst +0 -0
- package/.turbo/cache/257a7a26ea72dbc5-meta.json +1 -1
- package/.turbo/cache/2990aaa7ebc5b967-meta.json +1 -1
- package/.turbo/cache/2990aaa7ebc5b967.tar.zst +0 -0
- package/.turbo/cache/2fd056afdf4eb39d-meta.json +1 -0
- package/.turbo/cache/2fd056afdf4eb39d.tar.zst +0 -0
- package/.turbo/cache/3bf45120d0cc9bd8-meta.json +1 -1
- 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/4f92cea2d8c63de2-meta.json +1 -1
- package/.turbo/cache/5bf2d3f7ba5891e0-meta.json +1 -0
- package/.turbo/cache/5bf2d3f7ba5891e0.tar.zst +0 -0
- package/.turbo/cache/5c16ce3cff5c9dff-meta.json +1 -1
- 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/784c03fe9fd5ac05-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/80a13352066a9801-meta.json +1 -0
- package/.turbo/cache/80a13352066a9801.tar.zst +0 -0
- package/.turbo/cache/80b5d974184a01df-meta.json +1 -1
- package/.turbo/cache/87219c41a4ace9cd-meta.json +1 -1
- package/.turbo/cache/87219c41a4ace9cd.tar.zst +0 -0
- package/.turbo/cache/8954c6073396fadd-meta.json +1 -1
- package/.turbo/cache/8e79bd5c3a16a72e-meta.json +1 -0
- package/.turbo/cache/92daa6d7c389d548-meta.json +1 -1
- package/.turbo/cache/993dff2edb7b6766-meta.json +1 -1
- package/.turbo/cache/9a097d6576dadd64-meta.json +1 -1
- package/.turbo/cache/a63cbfecf0f78586-meta.json +1 -0
- package/.turbo/cache/{ce67b6522dd09e64.tar.zst → a63cbfecf0f78586.tar.zst} +0 -0
- package/.turbo/cache/a6a56bb802e1c20f-meta.json +1 -1
- package/.turbo/cache/a77bc920ea508bb8-meta.json +1 -1
- package/.turbo/cache/a77bc920ea508bb8.tar.zst +0 -0
- package/.turbo/cache/b2c66328fdd78093-meta.json +1 -0
- package/.turbo/cache/b2c66328fdd78093.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/d39e6ef95ebc4cc0-meta.json +1 -0
- package/.turbo/cache/d39e6ef95ebc4cc0.tar.zst +0 -0
- 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/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/f411e2deb0676959-meta.json +1 -0
- package/.turbo/cache/f411e2deb0676959.tar.zst +0 -0
- package/.turbo/cache/fa132b5b5f0e75f8-meta.json +1 -1
- package/.turbo/cache/fbbe2704bf9cb90b-meta.json +1 -1
- package/CHANGELOG.md +26 -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 +104 -116
- package/components/combobox/demo/index.min.js +104 -116
- 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 +103 -115
- 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 +96 -130
- package/components/datepicker/demo/index.min.js +96 -130
- 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 +96 -130
- 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/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 -83
- package/components/input/demo/api.min.js +52 -61
- package/components/input/demo/index.md +6 -6
- package/components/input/demo/index.min.js +52 -61
- package/components/input/dist/auro-input.d.ts.map +1 -1
- package/components/input/dist/base-input.d.ts +5 -12
- package/components/input/dist/base-input.d.ts.map +1 -1
- package/components/input/dist/index.js +52 -61
- 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 +22 -25
- 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 +3 -3
- package/components/select/demo/api.md +7 -11
- package/components/select/demo/api.min.js +33 -60
- package/components/select/demo/index.min.js +33 -56
- package/components/select/dist/auro-select.d.ts +2 -2
- package/components/select/dist/auro-select.d.ts.map +1 -1
- package/components/select/dist/index.js +32 -55
- package/components/select/src/auro-select.js +3 -21
- 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/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/56cb35d4c7473a23-meta.json +0 -1
- package/.turbo/cache/56cb35d4c7473a23.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/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/a49cc58242467fdc-meta.json +0 -1
- package/.turbo/cache/a49cc58242467fdc.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/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/ff58f630c9d69af4-meta.json +0 -1
- package/.turbo/cache/ff58f630c9d69af4.tar.zst +0 -0
- /package/.turbo/cache/{0a2b0a4df8a0443f.tar.zst → 8e79bd5c3a16a72e.tar.zst} +0 -0
|
@@ -405,20 +405,20 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
405
405
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
406
406
|
|
|
407
407
|
if (!pattern.test(elem.value)) {
|
|
408
|
-
elem.validity = '
|
|
409
|
-
elem.
|
|
408
|
+
elem.validity = 'patternMismatch';
|
|
409
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
414
414
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
415
415
|
elem.validity = 'tooShort';
|
|
416
|
-
elem.
|
|
416
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
if (elem.value?.length > elem.maxLength) {
|
|
420
420
|
elem.validity = 'tooLong';
|
|
421
|
-
elem.
|
|
421
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
|
|
@@ -434,33 +434,32 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
434
434
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
435
435
|
|
|
436
436
|
if (!elem.value.match(emailRegex)) {
|
|
437
|
-
elem.validity = '
|
|
438
|
-
elem.
|
|
437
|
+
elem.validity = 'patternMismatch';
|
|
438
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
439
439
|
}
|
|
440
440
|
} else if (elem.type === 'credit-card') {
|
|
441
441
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
442
442
|
elem.validity = 'tooShort';
|
|
443
|
-
elem.
|
|
443
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
444
444
|
}
|
|
445
445
|
} else if (elem.type === 'number') {
|
|
446
446
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
447
447
|
elem.validity = 'rangeOverflow';
|
|
448
|
-
elem.
|
|
448
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
451
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
452
452
|
elem.validity = 'rangeUnderflow';
|
|
453
|
-
elem.
|
|
453
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
454
454
|
}
|
|
455
|
-
|
|
456
455
|
} else if (elem.type === 'month-day-year' ||
|
|
457
456
|
elem.type === 'month-year' ||
|
|
458
457
|
elem.type === 'month-fullYear' ||
|
|
459
458
|
elem.type === 'year-month-day'
|
|
460
459
|
) {
|
|
461
|
-
if (elem.value
|
|
460
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
462
461
|
elem.validity = 'tooShort';
|
|
463
|
-
elem.
|
|
462
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
464
463
|
} else {
|
|
465
464
|
const valueDate = new Date(elem.value);
|
|
466
465
|
|
|
@@ -470,7 +469,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
470
469
|
|
|
471
470
|
if (valueDate > maxDate) {
|
|
472
471
|
elem.validity = 'rangeOverflow';
|
|
473
|
-
elem.
|
|
472
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
474
473
|
}
|
|
475
474
|
}
|
|
476
475
|
|
|
@@ -480,7 +479,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
480
479
|
|
|
481
480
|
if (valueDate < minDate) {
|
|
482
481
|
elem.validity = 'rangeUnderflow';
|
|
483
|
-
elem.
|
|
482
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
484
483
|
}
|
|
485
484
|
}
|
|
486
485
|
}
|
|
@@ -503,10 +502,10 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
503
502
|
|
|
504
503
|
if (elem.hasAttribute('error')) {
|
|
505
504
|
elem.validity = 'customError';
|
|
506
|
-
elem.
|
|
505
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
507
506
|
} else if (validationShouldRun) {
|
|
508
507
|
elem.validity = 'valid';
|
|
509
|
-
elem.
|
|
508
|
+
elem.errorMessage = '';
|
|
510
509
|
|
|
511
510
|
/**
|
|
512
511
|
* Only validate once we interact with the datepicker
|
|
@@ -518,7 +517,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
518
517
|
let hasValue = elem.value && elem.value.length > 0;
|
|
519
518
|
|
|
520
519
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
521
|
-
if (this.auroInputElements
|
|
520
|
+
if (this.auroInputElements?.length === 2) {
|
|
522
521
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
523
522
|
hasValue = false;
|
|
524
523
|
}
|
|
@@ -526,31 +525,27 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
526
525
|
|
|
527
526
|
if (!hasValue && elem.required) {
|
|
528
527
|
elem.validity = 'valueMissing';
|
|
529
|
-
elem.
|
|
528
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
530
529
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
531
530
|
this.validateType(elem);
|
|
532
531
|
this.validateAttributes(elem);
|
|
533
532
|
}
|
|
534
533
|
}
|
|
535
534
|
|
|
536
|
-
if (this.auroInputElements
|
|
535
|
+
if (this.auroInputElements?.length > 0) {
|
|
537
536
|
elem.validity = this.auroInputElements[0].validity;
|
|
538
|
-
elem.
|
|
537
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
539
538
|
|
|
540
|
-
if (elem.validity === 'valid') {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
544
|
-
}
|
|
539
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
540
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
541
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
545
542
|
}
|
|
546
543
|
}
|
|
547
544
|
|
|
548
545
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
553
|
-
}
|
|
546
|
+
// Use the validity message override if it is declared
|
|
547
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
548
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
554
549
|
}
|
|
555
550
|
|
|
556
551
|
this.getErrorMessage(elem);
|
|
@@ -596,18 +591,18 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
596
591
|
if (elem.validity !== 'valid') {
|
|
597
592
|
if (elem.setCustomValidity) {
|
|
598
593
|
elem.errorMessage = elem.setCustomValidity;
|
|
599
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
594
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
600
595
|
const input = elem.renderRoot.querySelector('input');
|
|
601
596
|
|
|
602
597
|
if (input.validationMessage.length > 0) {
|
|
603
598
|
elem.errorMessage = input.validationMessage;
|
|
604
599
|
}
|
|
605
|
-
} else if (this.inputElements &&
|
|
600
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
606
601
|
const firstInput = this.inputElements[0];
|
|
607
602
|
|
|
608
603
|
if (firstInput.validationMessage.length > 0) {
|
|
609
604
|
elem.errorMessage = firstInput.validationMessage;
|
|
610
|
-
} else if (this.inputElements
|
|
605
|
+
} else if (this.inputElements?.length === 2) {
|
|
611
606
|
const secondInput = this.inputElements[1];
|
|
612
607
|
|
|
613
608
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -13718,7 +13713,7 @@ const t=globalThis,e$1=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShad
|
|
|
13718
13713
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13719
13714
|
*/class r extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(s,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return T}}r._$litElement$=!0,r["finalized"]=!0,globalThis.litElementHydrateSupport?.({LitElement:r});const i=globalThis.litElementPolyfillSupport;i?.({LitElement:r});(globalThis.litElementVersions??=[]).push("4.1.1");
|
|
13720
13715
|
|
|
13721
|
-
var styleCss$3 = i$2`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.typeIcon{display:flex;flex-direction:row;align-items:center}.typeIcon [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);height:var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-100, 0.5rem)}.notificationIcons{display:flex;flex-direction:row;padding-right:var(--ds-size-100, 0.5rem)}:host([bordered]) .typeIcon{padding-left:var(--ds-size-100, 0.5rem)}:host([bordered]) .notificationIcons{align-items:center}.notification:not(:first-of-type){margin-left:var(--ds-size-100, 0.5rem)}.alertNotification{width:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-25, 0.125rem));height:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-25, 0.125rem))}.
|
|
13716
|
+
var styleCss$3 = i$2`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.typeIcon{display:flex;flex-direction:row;align-items:center}.typeIcon [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);height:var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-100, 0.5rem)}.notificationIcons{display:flex;flex-direction:row;padding-right:var(--ds-size-100, 0.5rem)}:host([bordered]) .typeIcon{padding-left:var(--ds-size-100, 0.5rem)}:host([bordered]) .notificationIcons{align-items:center}.notification:not(:first-of-type){margin-left:var(--ds-size-100, 0.5rem)}.alertNotification{width:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-25, 0.125rem));height:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-25, 0.125rem))}.passwordBtn{width:calc(var(--ds-size-300, 1.5rem));height:calc(var(--ds-size-300, 1.5rem))}.notificationBtn{display:block;width:var(--ds-size-300, 1.5rem);height:var(--ds-size-300, 1.5rem);padding:0;border:0;background:unset;cursor:pointer}.notificationBtn [auro-icon]{display:block;height:var(--ds-size-300, 1.5rem);--ds-auro-icon-size: var(--ds-size-300, 1.5rem)}.notificationBtn [auro-icon][hidden]{display:none}:host(:not([bordered])) .typeIcon,:host(:not([bordered])) .notificationIcons{align-items:flex-end;padding-bottom:var(--ds-size-50, 0.25rem)}.clearBtn{transition:all .3s cubic-bezier(0.215, 0.61, 0.355, 1);overflow:hidden;width:0;opacity:0}:host .wrapper:hover .clearBtn,:host .wrapper:focus-within .clearBtn{width:calc(var(--ds-size-200, 1rem) + var(--ds-size-25, 0.125rem));height:calc(var(--ds-size-200, 1rem) + var(--ds-size-25, 0.125rem));opacity:1}:host(:focus-within[type=password]) .notificationIcons[hasValue] .alertNotification{overflow:hidden;width:0;height:0;padding:0;margin:0;visibility:hidden}.inputElement-helpText{margin:var(--ds-size-50, 0.25rem) 0;font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-size-200, 1rem)}input{border:unset}.wrapper{position:relative;overflow:hidden;border-style:solid}:host(:not([bordered],[borderless])) .wrapper{border-width:1px 0}:host([bordered]) .wrapper{border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}:host(:not([borderless])) .wrapper:focus-within:before{position:absolute;display:block;border-bottom-width:1px;border-bottom-style:solid;content:"";inset:0;pointer-events:none}:host([validity]:not([validity=valid])) .wrapper:before{border-bottom:0}label{transition:all .3s cubic-bezier(0.215, 0.61, 0.355, 1);position:absolute;overflow:hidden;pointer-events:none;text-overflow:ellipsis;white-space:nowrap}:host(:not([bordered])) label{top:calc(100% - var(--ds-size-25, 0.125rem));transform:translateY(-100%)}:host(:not([bordered])) label.withIcon{left:var(--ds-size-400, 2rem)}:host([bordered]) label{top:50%;transform:translateY(-50%)}:host([bordered]) label.withIcon{left:var(--ds-size-500, 2.5rem)}:host([bordered]) label:not(label.withIcon){left:var(--ds-size-100, 0.5rem)}:host .wrapper:focus-within label{top:var(--ds-size-100, 0.5rem);font-size:var(--ds-text-body-size-xs, 0.75rem);transform:unset}:host label.withValue{top:var(--ds-size-100, 0.5rem);font-size:var(--ds-text-body-size-xs, 0.75rem);transform:unset}:host([activeLabel]) .wrapper label{top:var(--ds-size-100, 0.5rem);font-size:var(--ds-text-body-size-xs, 0.75rem);transform:unset}:host{position:relative;display:block}.wrapper{display:flex;flex-direction:row}.main{display:flex;flex-direction:row;position:relative;flex:1}input{transition:all .3s cubic-bezier(0.215, 0.61, 0.355, 1);position:relative;overflow:hidden;min-height:calc(var(--ds-size-700, 3.5rem) + var(--ds-size-25, 0.125rem));max-height:calc(var(--ds-size-700, 3.5rem) + var(--ds-size-25, 0.125rem));flex:1;padding:var(--ds-size-400, 2rem) 0 var(--ds-size-50, 0.25rem);margin:0;font-family:var(--ds-font-family-default, "AS Circular", Helvetica Neue, Arial, sans-serif);font-size:var(--ds-size-200, 1rem);outline:none;text-overflow:ellipsis;white-space:nowrap}input::-ms-reveal,input::-ms-clear{display:none}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}input[type=number]{-moz-appearance:textfield;appearance:textfield}input:disabled{background:none;pointer-events:none}:host([bordered]) input{padding:var(--ds-size-400, 2rem) 0 var(--ds-size-100, 0.5rem)}`;
|
|
13722
13717
|
|
|
13723
13718
|
var colorCss$3 = i$2`.wrapper{border-color:transparent}.inputElement-helpText{color:var(--ds-auro-input-help-text-color)}input{background-color:transparent;caret-color:var(--ds-auro-input-caret-color);color:var(--ds-auro-input-text-color)}input::placeholder{color:transparent}input:focus::placeholder{color:var(--ds-auro-input-placeholder-text-color)}input:disabled{--ds-auro-input-input-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}label{color:var(--ds-auro-input-label-text-color)}:host(:not([bordered],[borderless])) .wrapper{border-bottom-color:var(--ds-auro-input-border-color)}:host([bordered]) .wrapper{border-color:var(--ds-auro-input-border-color);background-color:var(--ds-auro-input-container-color)}:host([bordered]) .wrapper:focus-within{--ds-auro-input-border-color: var(--ds-color-border-ui-focus-default, #2c67b5);box-shadow:inset 0 0 0 1px var(--ds-auro-input-border-color)}:host(:not([borderless])) .wrapper:focus-within{--ds-auro-input-border-color: var(--ds-color-border-ui-focus-default, #2c67b5)}:host(:not([borderless])) .wrapper:focus-within:before{border-bottom-color:transparent}:host([validity]:not([validity=valid])){--ds-auro-input-border-color: var(--ds-color-border-error-default, #cc1816);--ds-auro-input-help-text-color: var(--ds-color-text-error-default, #cc1816)}:host([validity]:not([validity=valid])[bordered]) .wrapper{--ds-auro-input-border-color: var(--ds-color-border-error-default, #cc1816);box-shadow:inset 0 0 0 1px var(--ds-auro-input-border-color)}:host([disabled]){--ds-auro-input-border-color: var(--ds-color-border-ui-disabled-default, #adadad);--ds-auro-input-label-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}`;
|
|
13724
13719
|
|
|
@@ -15395,20 +15390,20 @@ class AuroFormValidation {
|
|
|
15395
15390
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
15396
15391
|
|
|
15397
15392
|
if (!pattern.test(elem.value)) {
|
|
15398
|
-
elem.validity = '
|
|
15399
|
-
elem.
|
|
15393
|
+
elem.validity = 'patternMismatch';
|
|
15394
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
15400
15395
|
}
|
|
15401
15396
|
}
|
|
15402
15397
|
|
|
15403
15398
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
15404
15399
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
15405
15400
|
elem.validity = 'tooShort';
|
|
15406
|
-
elem.
|
|
15401
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
15407
15402
|
}
|
|
15408
15403
|
|
|
15409
15404
|
if (elem.value?.length > elem.maxLength) {
|
|
15410
15405
|
elem.validity = 'tooLong';
|
|
15411
|
-
elem.
|
|
15406
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
15412
15407
|
}
|
|
15413
15408
|
}
|
|
15414
15409
|
|
|
@@ -15424,33 +15419,32 @@ class AuroFormValidation {
|
|
|
15424
15419
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
15425
15420
|
|
|
15426
15421
|
if (!elem.value.match(emailRegex)) {
|
|
15427
|
-
elem.validity = '
|
|
15428
|
-
elem.
|
|
15422
|
+
elem.validity = 'patternMismatch';
|
|
15423
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
15429
15424
|
}
|
|
15430
15425
|
} else if (elem.type === 'credit-card') {
|
|
15431
15426
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
15432
15427
|
elem.validity = 'tooShort';
|
|
15433
|
-
elem.
|
|
15428
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
15434
15429
|
}
|
|
15435
15430
|
} else if (elem.type === 'number') {
|
|
15436
15431
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
15437
15432
|
elem.validity = 'rangeOverflow';
|
|
15438
|
-
elem.
|
|
15433
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
15439
15434
|
}
|
|
15440
15435
|
|
|
15441
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
15436
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
15442
15437
|
elem.validity = 'rangeUnderflow';
|
|
15443
|
-
elem.
|
|
15438
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
15444
15439
|
}
|
|
15445
|
-
|
|
15446
15440
|
} else if (elem.type === 'month-day-year' ||
|
|
15447
15441
|
elem.type === 'month-year' ||
|
|
15448
15442
|
elem.type === 'month-fullYear' ||
|
|
15449
15443
|
elem.type === 'year-month-day'
|
|
15450
15444
|
) {
|
|
15451
|
-
if (elem.value
|
|
15445
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
15452
15446
|
elem.validity = 'tooShort';
|
|
15453
|
-
elem.
|
|
15447
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
15454
15448
|
} else {
|
|
15455
15449
|
const valueDate = new Date(elem.value);
|
|
15456
15450
|
|
|
@@ -15460,7 +15454,7 @@ class AuroFormValidation {
|
|
|
15460
15454
|
|
|
15461
15455
|
if (valueDate > maxDate) {
|
|
15462
15456
|
elem.validity = 'rangeOverflow';
|
|
15463
|
-
elem.
|
|
15457
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
15464
15458
|
}
|
|
15465
15459
|
}
|
|
15466
15460
|
|
|
@@ -15470,7 +15464,7 @@ class AuroFormValidation {
|
|
|
15470
15464
|
|
|
15471
15465
|
if (valueDate < minDate) {
|
|
15472
15466
|
elem.validity = 'rangeUnderflow';
|
|
15473
|
-
elem.
|
|
15467
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
15474
15468
|
}
|
|
15475
15469
|
}
|
|
15476
15470
|
}
|
|
@@ -15493,10 +15487,10 @@ class AuroFormValidation {
|
|
|
15493
15487
|
|
|
15494
15488
|
if (elem.hasAttribute('error')) {
|
|
15495
15489
|
elem.validity = 'customError';
|
|
15496
|
-
elem.
|
|
15490
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
15497
15491
|
} else if (validationShouldRun) {
|
|
15498
15492
|
elem.validity = 'valid';
|
|
15499
|
-
elem.
|
|
15493
|
+
elem.errorMessage = '';
|
|
15500
15494
|
|
|
15501
15495
|
/**
|
|
15502
15496
|
* Only validate once we interact with the datepicker
|
|
@@ -15508,7 +15502,7 @@ class AuroFormValidation {
|
|
|
15508
15502
|
let hasValue = elem.value && elem.value.length > 0;
|
|
15509
15503
|
|
|
15510
15504
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
15511
|
-
if (this.auroInputElements
|
|
15505
|
+
if (this.auroInputElements?.length === 2) {
|
|
15512
15506
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
15513
15507
|
hasValue = false;
|
|
15514
15508
|
}
|
|
@@ -15516,31 +15510,27 @@ class AuroFormValidation {
|
|
|
15516
15510
|
|
|
15517
15511
|
if (!hasValue && elem.required) {
|
|
15518
15512
|
elem.validity = 'valueMissing';
|
|
15519
|
-
elem.
|
|
15513
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
15520
15514
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
15521
15515
|
this.validateType(elem);
|
|
15522
15516
|
this.validateAttributes(elem);
|
|
15523
15517
|
}
|
|
15524
15518
|
}
|
|
15525
15519
|
|
|
15526
|
-
if (this.auroInputElements
|
|
15520
|
+
if (this.auroInputElements?.length > 0) {
|
|
15527
15521
|
elem.validity = this.auroInputElements[0].validity;
|
|
15528
|
-
elem.
|
|
15522
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
15529
15523
|
|
|
15530
|
-
if (elem.validity === 'valid') {
|
|
15531
|
-
|
|
15532
|
-
|
|
15533
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
15534
|
-
}
|
|
15524
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
15525
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
15526
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
15535
15527
|
}
|
|
15536
15528
|
}
|
|
15537
15529
|
|
|
15538
15530
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
15539
|
-
|
|
15540
|
-
|
|
15541
|
-
|
|
15542
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
15543
|
-
}
|
|
15531
|
+
// Use the validity message override if it is declared
|
|
15532
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
15533
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
15544
15534
|
}
|
|
15545
15535
|
|
|
15546
15536
|
this.getErrorMessage(elem);
|
|
@@ -15586,18 +15576,18 @@ class AuroFormValidation {
|
|
|
15586
15576
|
if (elem.validity !== 'valid') {
|
|
15587
15577
|
if (elem.setCustomValidity) {
|
|
15588
15578
|
elem.errorMessage = elem.setCustomValidity;
|
|
15589
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
15579
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
15590
15580
|
const input = elem.renderRoot.querySelector('input');
|
|
15591
15581
|
|
|
15592
15582
|
if (input.validationMessage.length > 0) {
|
|
15593
15583
|
elem.errorMessage = input.validationMessage;
|
|
15594
15584
|
}
|
|
15595
|
-
} else if (this.inputElements &&
|
|
15585
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
15596
15586
|
const firstInput = this.inputElements[0];
|
|
15597
15587
|
|
|
15598
15588
|
if (firstInput.validationMessage.length > 0) {
|
|
15599
15589
|
elem.errorMessage = firstInput.validationMessage;
|
|
15600
|
-
} else if (this.inputElements
|
|
15590
|
+
} else if (this.inputElements?.length === 2) {
|
|
15601
15591
|
const secondInput = this.inputElements[1];
|
|
15602
15592
|
|
|
15603
15593
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -15625,8 +15615,7 @@ class AuroFormValidation {
|
|
|
15625
15615
|
* @attr {Boolean} bordered - Applies bordered UI variant.
|
|
15626
15616
|
* @attr {Boolean} borderless - Applies borderless UI variant.
|
|
15627
15617
|
* @attr {Boolean} disabled - If set, disables the input.
|
|
15628
|
-
* @attr {String} error - When defined, sets persistent validity to `customError` and sets
|
|
15629
|
-
* @prop {String} errorMessage - Contains the help text message for the current validity error.
|
|
15618
|
+
* @attr {String} error - When defined, sets persistent validity to `customError` and sets the validation message to the attribute value.
|
|
15630
15619
|
* @attr {Boolean} icon - If set, will render an icon inside the input to the left of the value. Support is limited to auro-input instances with credit card format.
|
|
15631
15620
|
* @attr {String} id - Sets the unique ID of the element.
|
|
15632
15621
|
* @attr {String} lang - defines the language of an element.
|
|
@@ -15640,10 +15629,10 @@ class AuroFormValidation {
|
|
|
15640
15629
|
* @attr {Boolean} required - Populates the `required` attribute on the input. Used for client-side validation.
|
|
15641
15630
|
* @attr {String} pattern - Specifies a regular expression the form control's value should match.
|
|
15642
15631
|
* @attr {String} placeholder - Define custom placeholder text, only supported by date input formats.
|
|
15643
|
-
* @attr {String} setCustomValidity - Sets a custom help text message to display for all
|
|
15632
|
+
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validity states.
|
|
15644
15633
|
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
15645
15634
|
* @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
|
|
15646
|
-
* @attr {String}
|
|
15635
|
+
* @attr {String} setCustomValidityPatternMismatch - Custom help text message to display when validity = `patternMismatch`.
|
|
15647
15636
|
* @attr {String} setCustomValidityTooShort - Custom help text message to display when validity = `tooShort`.
|
|
15648
15637
|
* @attr {String} setCustomValidityTooLong - Custom help text message to display when validity = `tooLong`.
|
|
15649
15638
|
* @attr {String} setCustomValidityForType - Custom help text message to display for the declared element `type` and type validity fails.
|
|
@@ -15789,20 +15778,18 @@ class BaseInput extends r {
|
|
|
15789
15778
|
type: String,
|
|
15790
15779
|
reflect: true
|
|
15791
15780
|
},
|
|
15792
|
-
errorMessage: { type: String },
|
|
15793
15781
|
validity: {
|
|
15794
15782
|
type: String,
|
|
15795
15783
|
reflect: true
|
|
15796
15784
|
},
|
|
15797
|
-
setCustomValidity:
|
|
15798
|
-
setCustomValidityCustomError:
|
|
15799
|
-
setCustomValidityValueMissing:
|
|
15800
|
-
|
|
15801
|
-
setCustomValidityTooShort:
|
|
15802
|
-
setCustomValidityTooLong:
|
|
15803
|
-
setCustomValidityRangeOverflow:
|
|
15804
|
-
setCustomValidityRangeUnderflow:
|
|
15805
|
-
customValidityTypeEmail: { type: String }
|
|
15785
|
+
setCustomValidity: { type: String },
|
|
15786
|
+
setCustomValidityCustomError: { type: String },
|
|
15787
|
+
setCustomValidityValueMissing: { type: String },
|
|
15788
|
+
setCustomValidityPatternMismatch: { type: String },
|
|
15789
|
+
setCustomValidityTooShort: { type: String },
|
|
15790
|
+
setCustomValidityTooLong: { type: String },
|
|
15791
|
+
setCustomValidityRangeOverflow: { type: String },
|
|
15792
|
+
setCustomValidityRangeUnderflow: { type: String }
|
|
15806
15793
|
};
|
|
15807
15794
|
}
|
|
15808
15795
|
|
|
@@ -16430,7 +16417,7 @@ class BaseInput extends r {
|
|
|
16430
16417
|
this.maxLength = card.formatLength;
|
|
16431
16418
|
this.minLength = card.formatMinLength;
|
|
16432
16419
|
|
|
16433
|
-
this.
|
|
16420
|
+
this.errorMessage = card.errorMessage;
|
|
16434
16421
|
|
|
16435
16422
|
if (this.icon) {
|
|
16436
16423
|
this.inputIconName = card.cardIcon;
|
|
@@ -16450,63 +16437,63 @@ class BaseInput extends r {
|
|
|
16450
16437
|
name: 'Airlines',
|
|
16451
16438
|
regex: /^(?<num>1|2)\d{0}/u,
|
|
16452
16439
|
formatMinLength: 17,
|
|
16453
|
-
|
|
16440
|
+
errorMessage: CreditCardValidationMessage,
|
|
16454
16441
|
cardIcon: 'credit-card'
|
|
16455
16442
|
},
|
|
16456
16443
|
{
|
|
16457
16444
|
name: 'Commercial',
|
|
16458
16445
|
regex: /^(?<num>2)\d{0}/u,
|
|
16459
16446
|
formatMinLength: 8,
|
|
16460
|
-
|
|
16447
|
+
errorMessage: CreditCardValidationMessage,
|
|
16461
16448
|
cardIcon: 'credit-card'
|
|
16462
16449
|
},
|
|
16463
16450
|
{
|
|
16464
16451
|
name: 'Alaska Commercial',
|
|
16465
16452
|
regex: /^(?<num>27)\d{0}/u,
|
|
16466
16453
|
formatMinLength: 8,
|
|
16467
|
-
|
|
16454
|
+
errorMessage: CreditCardValidationMessage,
|
|
16468
16455
|
cardIcon: 'cc-alaska'
|
|
16469
16456
|
},
|
|
16470
16457
|
{
|
|
16471
16458
|
name: 'American Express',
|
|
16472
16459
|
regex: /^(?<num>34|37)\d{0}/u,
|
|
16473
16460
|
formatLength: 17,
|
|
16474
|
-
|
|
16461
|
+
errorMessage: CreditCardValidationMessage,
|
|
16475
16462
|
cardIcon: 'cc-amex'
|
|
16476
16463
|
},
|
|
16477
16464
|
{
|
|
16478
16465
|
name: 'Diners club',
|
|
16479
16466
|
regex: /^(?<num>36|38)\d{0}/u,
|
|
16480
16467
|
formatLength: 16,
|
|
16481
|
-
|
|
16468
|
+
errorMessage: CreditCardValidationMessage,
|
|
16482
16469
|
cardIcon: 'credit-card'
|
|
16483
16470
|
},
|
|
16484
16471
|
{
|
|
16485
16472
|
name: 'Visa',
|
|
16486
16473
|
regex: /^(?<num>4)\d{0}/u,
|
|
16487
16474
|
formatLength: 19,
|
|
16488
|
-
|
|
16475
|
+
errorMessage: CreditCardValidationMessage,
|
|
16489
16476
|
cardIcon: 'cc-visa'
|
|
16490
16477
|
},
|
|
16491
16478
|
{
|
|
16492
16479
|
name: 'Alaska Airlines Visa',
|
|
16493
16480
|
regex: /^(?<num>4147\s34|4888\s93|4800\s11|4313\s51|4313\s07)\d{0}/u,
|
|
16494
16481
|
formatLength: 19,
|
|
16495
|
-
|
|
16482
|
+
errorMessage: CreditCardValidationMessage,
|
|
16496
16483
|
cardIcon: 'cc-alaska'
|
|
16497
16484
|
},
|
|
16498
16485
|
{
|
|
16499
16486
|
name: 'Master Card',
|
|
16500
16487
|
regex: /^(?<num>5)\d{0}/u,
|
|
16501
16488
|
formatLength: 19,
|
|
16502
|
-
|
|
16489
|
+
errorMessage: CreditCardValidationMessage,
|
|
16503
16490
|
cardIcon: 'cc-mastercard'
|
|
16504
16491
|
},
|
|
16505
16492
|
{
|
|
16506
16493
|
name: 'Discover Card',
|
|
16507
16494
|
regex: /^(?<num>6)\d{0}/u,
|
|
16508
16495
|
formatLength: 19,
|
|
16509
|
-
|
|
16496
|
+
errorMessage: CreditCardValidationMessage,
|
|
16510
16497
|
cardIcon: 'cc-discover'
|
|
16511
16498
|
}
|
|
16512
16499
|
];
|
|
@@ -16514,7 +16501,7 @@ class BaseInput extends r {
|
|
|
16514
16501
|
let type = {
|
|
16515
16502
|
name: 'Default Card',
|
|
16516
16503
|
formatLength: 19,
|
|
16517
|
-
|
|
16504
|
+
errorMessage: CreditCardValidationMessage,
|
|
16518
16505
|
cardIcon: 'credit-card'
|
|
16519
16506
|
};
|
|
16520
16507
|
|
|
@@ -17539,7 +17526,6 @@ class AuroInput extends BaseInput {
|
|
|
17539
17526
|
<p class="inputElement-helpText" id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
17540
17527
|
${this.errorMessage}
|
|
17541
17528
|
</p>`
|
|
17542
|
-
|
|
17543
17529
|
}
|
|
17544
17530
|
`;
|
|
17545
17531
|
}
|
|
@@ -17557,9 +17543,10 @@ var inputVersion = '4.2.0';
|
|
|
17557
17543
|
/**
|
|
17558
17544
|
* @prop {String} value - Value selected for the date picker.
|
|
17559
17545
|
* @prop {String} valueEnd - Value selected for the second date picker when using date range.
|
|
17560
|
-
* @attr {String} error - When defined, sets persistent validity to `customError` and sets
|
|
17546
|
+
* @attr {String} error - When defined, sets persistent validity to `customError` and sets the validation message to the attribute value.
|
|
17561
17547
|
* @attr {String} validity - Specifies the `validityState` this element is in.
|
|
17562
17548
|
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validityStates.
|
|
17549
|
+
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
17563
17550
|
* @attr {String} setCustomValidityRangeUnderflow - Custom help text message to display when validity = `rangeUnderflow`.
|
|
17564
17551
|
* @attr {String} setCustomValidityRangeOverflow - Custom help text message to display when validity = `rangeOverflow`.
|
|
17565
17552
|
* @attr {String} setCustomValidityValueMissing - Help text message to display when validity = `valueMissing`.
|
|
@@ -17689,19 +17676,18 @@ class AuroDatePicker extends r$7 {
|
|
|
17689
17676
|
},
|
|
17690
17677
|
setCustomValidity: {
|
|
17691
17678
|
type: String,
|
|
17692
|
-
|
|
17679
|
+
},
|
|
17680
|
+
setCustomValidityCustomError: {
|
|
17681
|
+
type: String,
|
|
17693
17682
|
},
|
|
17694
17683
|
setCustomValidityRangeUnderflow: {
|
|
17695
17684
|
type: String,
|
|
17696
|
-
reflect: true
|
|
17697
17685
|
},
|
|
17698
17686
|
setCustomValidityRangeOverflow: {
|
|
17699
17687
|
type: String,
|
|
17700
|
-
reflect: true
|
|
17701
17688
|
},
|
|
17702
17689
|
setCustomValidityValueMissing: {
|
|
17703
17690
|
type: String,
|
|
17704
|
-
reflect: true
|
|
17705
17691
|
},
|
|
17706
17692
|
validity: {
|
|
17707
17693
|
type: String,
|
|
@@ -17896,30 +17882,6 @@ class AuroDatePicker extends r$7 {
|
|
|
17896
17882
|
return dateStr;
|
|
17897
17883
|
}
|
|
17898
17884
|
|
|
17899
|
-
/**
|
|
17900
|
-
* Return appropriate error message.
|
|
17901
|
-
* @param {Object} evt - Event passed in from auro-input when the event triggered this function.
|
|
17902
|
-
* @private
|
|
17903
|
-
*/
|
|
17904
|
-
getErrorMessage(evt) {
|
|
17905
|
-
if (evt) {
|
|
17906
|
-
const inputClass = evt.target.getAttribute('class');
|
|
17907
|
-
if (inputClass === 'dateFrom') {
|
|
17908
|
-
if (this.inputList[0].validity && this.inputList[0].validity !== 'valid') {
|
|
17909
|
-
this.errorMessage = evt.target.errorMessage;
|
|
17910
|
-
} else {
|
|
17911
|
-
this.errorMessage = undefined;
|
|
17912
|
-
}
|
|
17913
|
-
}
|
|
17914
|
-
|
|
17915
|
-
if (inputClass === 'dateTo') {
|
|
17916
|
-
if (!this.errorMessage && this.inputList[1].validity && this.inputList[1].validity !== 'valid') {
|
|
17917
|
-
this.errorMessage = evt.target.errorMessage;
|
|
17918
|
-
}
|
|
17919
|
-
}
|
|
17920
|
-
}
|
|
17921
|
-
}
|
|
17922
|
-
|
|
17923
17885
|
/**
|
|
17924
17886
|
* Changes the calendar's visibility to reflect the value of the central date attribute.
|
|
17925
17887
|
* @private
|
|
@@ -18028,13 +17990,13 @@ class AuroDatePicker extends r$7 {
|
|
|
18028
17990
|
input.addEventListener('auroFormElement-validated', (evt) => {
|
|
18029
17991
|
if (evt.detail.validity === 'customError') {
|
|
18030
17992
|
this.validity = evt.detail.validity;
|
|
18031
|
-
this.
|
|
17993
|
+
this.errorMessage = evt.detail.message;
|
|
18032
17994
|
} else if (evt.target === this.inputList[0]) {
|
|
18033
17995
|
this.validity = evt.detail.validity;
|
|
18034
|
-
this.
|
|
17996
|
+
this.errorMessage = evt.detail.message;
|
|
18035
17997
|
} else if (this.inputList.length > 1 && evt.target === this.inputList[1] && (this.inputList[0].validity === 'valid' || this.inputList[0].validity === undefined)) {
|
|
18036
17998
|
this.validity = evt.detail.validity;
|
|
18037
|
-
this.
|
|
17999
|
+
this.errorMessage = evt.detail.message;
|
|
18038
18000
|
}
|
|
18039
18001
|
});
|
|
18040
18002
|
});
|
|
@@ -18324,7 +18286,7 @@ class AuroDatePicker extends r$7 {
|
|
|
18324
18286
|
// This is done to prevent error icon from displaying on both inputs in range support
|
|
18325
18287
|
const lastInput = this.inputList[this.inputList.length - 1];
|
|
18326
18288
|
|
|
18327
|
-
if (this.error) {
|
|
18289
|
+
if (this.hasAttribute('error')) {
|
|
18328
18290
|
// Set the error attribute on the last input
|
|
18329
18291
|
lastInput.setAttribute('error', this.getAttribute('error'));
|
|
18330
18292
|
} else {
|
|
@@ -18442,6 +18404,8 @@ class AuroDatePicker extends r$7 {
|
|
|
18442
18404
|
noValidate
|
|
18443
18405
|
.max="${this.maxDate}"
|
|
18444
18406
|
.min="${this.minDate}"
|
|
18407
|
+
setCustomValidity="${this.setCustomValidity}"
|
|
18408
|
+
setCustomValidityCustomError="${this.setCustomValidityCustomError}"
|
|
18445
18409
|
setCustomValidityValueMissing="${this.setCustomValidityValueMissing}"
|
|
18446
18410
|
setCustomValidityRangeOverflow="${this.setCustomValidityRangeOverflow}"
|
|
18447
18411
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
@@ -18459,6 +18423,8 @@ class AuroDatePicker extends r$7 {
|
|
|
18459
18423
|
noValidate
|
|
18460
18424
|
.max="${this.maxDate}"
|
|
18461
18425
|
.min="${this.minDate}"
|
|
18426
|
+
setCustomValidity="${this.setCustomValidity}"
|
|
18427
|
+
setCustomValidityCustomError="${this.setCustomValidityCustomError}"
|
|
18462
18428
|
setCustomValidityValueMissing="${this.setCustomValidityValueMissing}"
|
|
18463
18429
|
setCustomValidityRangeOverflow="${this.setCustomValidityRangeOverflow}"
|
|
18464
18430
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
@@ -18489,8 +18455,8 @@ class AuroDatePicker extends r$7 {
|
|
|
18489
18455
|
? u$6`
|
|
18490
18456
|
<slot name="helpText"></slot>
|
|
18491
18457
|
` : u$6`
|
|
18492
|
-
<p class="datepickerElement-helpText"
|
|
18493
|
-
${this.
|
|
18458
|
+
<p class="datepickerElement-helpText" role="alert" aria-live="assertive" part="helpText">
|
|
18459
|
+
${this.errorMessage}
|
|
18494
18460
|
</p>`
|
|
18495
18461
|
}
|
|
18496
18462
|
</span>
|