@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
|
@@ -350,20 +350,20 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
350
350
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
351
351
|
|
|
352
352
|
if (!pattern.test(elem.value)) {
|
|
353
|
-
elem.validity = '
|
|
354
|
-
elem.
|
|
353
|
+
elem.validity = 'patternMismatch';
|
|
354
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
359
359
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
360
360
|
elem.validity = 'tooShort';
|
|
361
|
-
elem.
|
|
361
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
if (elem.value?.length > elem.maxLength) {
|
|
365
365
|
elem.validity = 'tooLong';
|
|
366
|
-
elem.
|
|
366
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
|
|
@@ -379,33 +379,32 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
379
379
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
380
380
|
|
|
381
381
|
if (!elem.value.match(emailRegex)) {
|
|
382
|
-
elem.validity = '
|
|
383
|
-
elem.
|
|
382
|
+
elem.validity = 'patternMismatch';
|
|
383
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
384
384
|
}
|
|
385
385
|
} else if (elem.type === 'credit-card') {
|
|
386
386
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
387
387
|
elem.validity = 'tooShort';
|
|
388
|
-
elem.
|
|
388
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
389
389
|
}
|
|
390
390
|
} else if (elem.type === 'number') {
|
|
391
391
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
392
392
|
elem.validity = 'rangeOverflow';
|
|
393
|
-
elem.
|
|
393
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
396
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
397
397
|
elem.validity = 'rangeUnderflow';
|
|
398
|
-
elem.
|
|
398
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
399
399
|
}
|
|
400
|
-
|
|
401
400
|
} else if (elem.type === 'month-day-year' ||
|
|
402
401
|
elem.type === 'month-year' ||
|
|
403
402
|
elem.type === 'month-fullYear' ||
|
|
404
403
|
elem.type === 'year-month-day'
|
|
405
404
|
) {
|
|
406
|
-
if (elem.value
|
|
405
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
407
406
|
elem.validity = 'tooShort';
|
|
408
|
-
elem.
|
|
407
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
409
408
|
} else {
|
|
410
409
|
const valueDate = new Date(elem.value);
|
|
411
410
|
|
|
@@ -415,7 +414,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
415
414
|
|
|
416
415
|
if (valueDate > maxDate) {
|
|
417
416
|
elem.validity = 'rangeOverflow';
|
|
418
|
-
elem.
|
|
417
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
419
418
|
}
|
|
420
419
|
}
|
|
421
420
|
|
|
@@ -425,7 +424,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
425
424
|
|
|
426
425
|
if (valueDate < minDate) {
|
|
427
426
|
elem.validity = 'rangeUnderflow';
|
|
428
|
-
elem.
|
|
427
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
429
428
|
}
|
|
430
429
|
}
|
|
431
430
|
}
|
|
@@ -448,10 +447,10 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
448
447
|
|
|
449
448
|
if (elem.hasAttribute('error')) {
|
|
450
449
|
elem.validity = 'customError';
|
|
451
|
-
elem.
|
|
450
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
452
451
|
} else if (validationShouldRun) {
|
|
453
452
|
elem.validity = 'valid';
|
|
454
|
-
elem.
|
|
453
|
+
elem.errorMessage = '';
|
|
455
454
|
|
|
456
455
|
/**
|
|
457
456
|
* Only validate once we interact with the datepicker
|
|
@@ -463,7 +462,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
463
462
|
let hasValue = elem.value && elem.value.length > 0;
|
|
464
463
|
|
|
465
464
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
466
|
-
if (this.auroInputElements
|
|
465
|
+
if (this.auroInputElements?.length === 2) {
|
|
467
466
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
468
467
|
hasValue = false;
|
|
469
468
|
}
|
|
@@ -471,31 +470,27 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
471
470
|
|
|
472
471
|
if (!hasValue && elem.required) {
|
|
473
472
|
elem.validity = 'valueMissing';
|
|
474
|
-
elem.
|
|
473
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
475
474
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
476
475
|
this.validateType(elem);
|
|
477
476
|
this.validateAttributes(elem);
|
|
478
477
|
}
|
|
479
478
|
}
|
|
480
479
|
|
|
481
|
-
if (this.auroInputElements
|
|
480
|
+
if (this.auroInputElements?.length > 0) {
|
|
482
481
|
elem.validity = this.auroInputElements[0].validity;
|
|
483
|
-
elem.
|
|
482
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
484
483
|
|
|
485
|
-
if (elem.validity === 'valid') {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
489
|
-
}
|
|
484
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
485
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
486
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
490
487
|
}
|
|
491
488
|
}
|
|
492
489
|
|
|
493
490
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
498
|
-
}
|
|
491
|
+
// Use the validity message override if it is declared
|
|
492
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
493
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
499
494
|
}
|
|
500
495
|
|
|
501
496
|
this.getErrorMessage(elem);
|
|
@@ -541,18 +536,18 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
541
536
|
if (elem.validity !== 'valid') {
|
|
542
537
|
if (elem.setCustomValidity) {
|
|
543
538
|
elem.errorMessage = elem.setCustomValidity;
|
|
544
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
539
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
545
540
|
const input = elem.renderRoot.querySelector('input');
|
|
546
541
|
|
|
547
542
|
if (input.validationMessage.length > 0) {
|
|
548
543
|
elem.errorMessage = input.validationMessage;
|
|
549
544
|
}
|
|
550
|
-
} else if (this.inputElements &&
|
|
545
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
551
546
|
const firstInput = this.inputElements[0];
|
|
552
547
|
|
|
553
548
|
if (firstInput.validationMessage.length > 0) {
|
|
554
549
|
elem.errorMessage = firstInput.validationMessage;
|
|
555
|
-
} else if (this.inputElements
|
|
550
|
+
} else if (this.inputElements?.length === 2) {
|
|
556
551
|
const secondInput = this.inputElements[1];
|
|
557
552
|
|
|
558
553
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -3577,7 +3572,7 @@ const t$4=globalThis,e$1$1=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.
|
|
|
3577
3572
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3578
3573
|
*/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$6=globalThis.litElementPolyfillSupport;i$6?.({LitElement:r});(globalThis.litElementVersions??=[]).push("4.1.1");
|
|
3579
3574
|
|
|
3580
|
-
var styleCss$3$1 = 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))}.
|
|
3575
|
+
var styleCss$3$1 = 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)}`;
|
|
3581
3576
|
|
|
3582
3577
|
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)}`;
|
|
3583
3578
|
|
|
@@ -5254,20 +5249,20 @@ class AuroFormValidation {
|
|
|
5254
5249
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
5255
5250
|
|
|
5256
5251
|
if (!pattern.test(elem.value)) {
|
|
5257
|
-
elem.validity = '
|
|
5258
|
-
elem.
|
|
5252
|
+
elem.validity = 'patternMismatch';
|
|
5253
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
5259
5254
|
}
|
|
5260
5255
|
}
|
|
5261
5256
|
|
|
5262
5257
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
5263
5258
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
5264
5259
|
elem.validity = 'tooShort';
|
|
5265
|
-
elem.
|
|
5260
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
5266
5261
|
}
|
|
5267
5262
|
|
|
5268
5263
|
if (elem.value?.length > elem.maxLength) {
|
|
5269
5264
|
elem.validity = 'tooLong';
|
|
5270
|
-
elem.
|
|
5265
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
5271
5266
|
}
|
|
5272
5267
|
}
|
|
5273
5268
|
|
|
@@ -5283,33 +5278,32 @@ class AuroFormValidation {
|
|
|
5283
5278
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
5284
5279
|
|
|
5285
5280
|
if (!elem.value.match(emailRegex)) {
|
|
5286
|
-
elem.validity = '
|
|
5287
|
-
elem.
|
|
5281
|
+
elem.validity = 'patternMismatch';
|
|
5282
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
5288
5283
|
}
|
|
5289
5284
|
} else if (elem.type === 'credit-card') {
|
|
5290
5285
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
5291
5286
|
elem.validity = 'tooShort';
|
|
5292
|
-
elem.
|
|
5287
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
5293
5288
|
}
|
|
5294
5289
|
} else if (elem.type === 'number') {
|
|
5295
5290
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
5296
5291
|
elem.validity = 'rangeOverflow';
|
|
5297
|
-
elem.
|
|
5292
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
5298
5293
|
}
|
|
5299
5294
|
|
|
5300
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
5295
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
5301
5296
|
elem.validity = 'rangeUnderflow';
|
|
5302
|
-
elem.
|
|
5297
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
5303
5298
|
}
|
|
5304
|
-
|
|
5305
5299
|
} else if (elem.type === 'month-day-year' ||
|
|
5306
5300
|
elem.type === 'month-year' ||
|
|
5307
5301
|
elem.type === 'month-fullYear' ||
|
|
5308
5302
|
elem.type === 'year-month-day'
|
|
5309
5303
|
) {
|
|
5310
|
-
if (elem.value
|
|
5304
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
5311
5305
|
elem.validity = 'tooShort';
|
|
5312
|
-
elem.
|
|
5306
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
5313
5307
|
} else {
|
|
5314
5308
|
const valueDate = new Date(elem.value);
|
|
5315
5309
|
|
|
@@ -5319,7 +5313,7 @@ class AuroFormValidation {
|
|
|
5319
5313
|
|
|
5320
5314
|
if (valueDate > maxDate) {
|
|
5321
5315
|
elem.validity = 'rangeOverflow';
|
|
5322
|
-
elem.
|
|
5316
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
5323
5317
|
}
|
|
5324
5318
|
}
|
|
5325
5319
|
|
|
@@ -5329,7 +5323,7 @@ class AuroFormValidation {
|
|
|
5329
5323
|
|
|
5330
5324
|
if (valueDate < minDate) {
|
|
5331
5325
|
elem.validity = 'rangeUnderflow';
|
|
5332
|
-
elem.
|
|
5326
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
5333
5327
|
}
|
|
5334
5328
|
}
|
|
5335
5329
|
}
|
|
@@ -5352,10 +5346,10 @@ class AuroFormValidation {
|
|
|
5352
5346
|
|
|
5353
5347
|
if (elem.hasAttribute('error')) {
|
|
5354
5348
|
elem.validity = 'customError';
|
|
5355
|
-
elem.
|
|
5349
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
5356
5350
|
} else if (validationShouldRun) {
|
|
5357
5351
|
elem.validity = 'valid';
|
|
5358
|
-
elem.
|
|
5352
|
+
elem.errorMessage = '';
|
|
5359
5353
|
|
|
5360
5354
|
/**
|
|
5361
5355
|
* Only validate once we interact with the datepicker
|
|
@@ -5367,7 +5361,7 @@ class AuroFormValidation {
|
|
|
5367
5361
|
let hasValue = elem.value && elem.value.length > 0;
|
|
5368
5362
|
|
|
5369
5363
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
5370
|
-
if (this.auroInputElements
|
|
5364
|
+
if (this.auroInputElements?.length === 2) {
|
|
5371
5365
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
5372
5366
|
hasValue = false;
|
|
5373
5367
|
}
|
|
@@ -5375,31 +5369,27 @@ class AuroFormValidation {
|
|
|
5375
5369
|
|
|
5376
5370
|
if (!hasValue && elem.required) {
|
|
5377
5371
|
elem.validity = 'valueMissing';
|
|
5378
|
-
elem.
|
|
5372
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
5379
5373
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
5380
5374
|
this.validateType(elem);
|
|
5381
5375
|
this.validateAttributes(elem);
|
|
5382
5376
|
}
|
|
5383
5377
|
}
|
|
5384
5378
|
|
|
5385
|
-
if (this.auroInputElements
|
|
5379
|
+
if (this.auroInputElements?.length > 0) {
|
|
5386
5380
|
elem.validity = this.auroInputElements[0].validity;
|
|
5387
|
-
elem.
|
|
5381
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
5388
5382
|
|
|
5389
|
-
if (elem.validity === 'valid') {
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
5393
|
-
}
|
|
5383
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
5384
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
5385
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
5394
5386
|
}
|
|
5395
5387
|
}
|
|
5396
5388
|
|
|
5397
5389
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
5402
|
-
}
|
|
5390
|
+
// Use the validity message override if it is declared
|
|
5391
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
5392
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
5403
5393
|
}
|
|
5404
5394
|
|
|
5405
5395
|
this.getErrorMessage(elem);
|
|
@@ -5445,18 +5435,18 @@ class AuroFormValidation {
|
|
|
5445
5435
|
if (elem.validity !== 'valid') {
|
|
5446
5436
|
if (elem.setCustomValidity) {
|
|
5447
5437
|
elem.errorMessage = elem.setCustomValidity;
|
|
5448
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
5438
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
5449
5439
|
const input = elem.renderRoot.querySelector('input');
|
|
5450
5440
|
|
|
5451
5441
|
if (input.validationMessage.length > 0) {
|
|
5452
5442
|
elem.errorMessage = input.validationMessage;
|
|
5453
5443
|
}
|
|
5454
|
-
} else if (this.inputElements &&
|
|
5444
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
5455
5445
|
const firstInput = this.inputElements[0];
|
|
5456
5446
|
|
|
5457
5447
|
if (firstInput.validationMessage.length > 0) {
|
|
5458
5448
|
elem.errorMessage = firstInput.validationMessage;
|
|
5459
|
-
} else if (this.inputElements
|
|
5449
|
+
} else if (this.inputElements?.length === 2) {
|
|
5460
5450
|
const secondInput = this.inputElements[1];
|
|
5461
5451
|
|
|
5462
5452
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -5484,8 +5474,7 @@ class AuroFormValidation {
|
|
|
5484
5474
|
* @attr {Boolean} bordered - Applies bordered UI variant.
|
|
5485
5475
|
* @attr {Boolean} borderless - Applies borderless UI variant.
|
|
5486
5476
|
* @attr {Boolean} disabled - If set, disables the input.
|
|
5487
|
-
* @attr {String} error - When defined, sets persistent validity to `customError` and sets
|
|
5488
|
-
* @prop {String} errorMessage - Contains the help text message for the current validity error.
|
|
5477
|
+
* @attr {String} error - When defined, sets persistent validity to `customError` and sets the validation message to the attribute value.
|
|
5489
5478
|
* @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.
|
|
5490
5479
|
* @attr {String} id - Sets the unique ID of the element.
|
|
5491
5480
|
* @attr {String} lang - defines the language of an element.
|
|
@@ -5499,10 +5488,10 @@ class AuroFormValidation {
|
|
|
5499
5488
|
* @attr {Boolean} required - Populates the `required` attribute on the input. Used for client-side validation.
|
|
5500
5489
|
* @attr {String} pattern - Specifies a regular expression the form control's value should match.
|
|
5501
5490
|
* @attr {String} placeholder - Define custom placeholder text, only supported by date input formats.
|
|
5502
|
-
* @attr {String} setCustomValidity - Sets a custom help text message to display for all
|
|
5491
|
+
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validity states.
|
|
5503
5492
|
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
5504
5493
|
* @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
|
|
5505
|
-
* @attr {String}
|
|
5494
|
+
* @attr {String} setCustomValidityPatternMismatch - Custom help text message to display when validity = `patternMismatch`.
|
|
5506
5495
|
* @attr {String} setCustomValidityTooShort - Custom help text message to display when validity = `tooShort`.
|
|
5507
5496
|
* @attr {String} setCustomValidityTooLong - Custom help text message to display when validity = `tooLong`.
|
|
5508
5497
|
* @attr {String} setCustomValidityForType - Custom help text message to display for the declared element `type` and type validity fails.
|
|
@@ -5648,20 +5637,18 @@ class BaseInput extends r {
|
|
|
5648
5637
|
type: String,
|
|
5649
5638
|
reflect: true
|
|
5650
5639
|
},
|
|
5651
|
-
errorMessage: { type: String },
|
|
5652
5640
|
validity: {
|
|
5653
5641
|
type: String,
|
|
5654
5642
|
reflect: true
|
|
5655
5643
|
},
|
|
5656
|
-
setCustomValidity:
|
|
5657
|
-
setCustomValidityCustomError:
|
|
5658
|
-
setCustomValidityValueMissing:
|
|
5659
|
-
|
|
5660
|
-
setCustomValidityTooShort:
|
|
5661
|
-
setCustomValidityTooLong:
|
|
5662
|
-
setCustomValidityRangeOverflow:
|
|
5663
|
-
setCustomValidityRangeUnderflow:
|
|
5664
|
-
customValidityTypeEmail: { type: String }
|
|
5644
|
+
setCustomValidity: { type: String },
|
|
5645
|
+
setCustomValidityCustomError: { type: String },
|
|
5646
|
+
setCustomValidityValueMissing: { type: String },
|
|
5647
|
+
setCustomValidityPatternMismatch: { type: String },
|
|
5648
|
+
setCustomValidityTooShort: { type: String },
|
|
5649
|
+
setCustomValidityTooLong: { type: String },
|
|
5650
|
+
setCustomValidityRangeOverflow: { type: String },
|
|
5651
|
+
setCustomValidityRangeUnderflow: { type: String }
|
|
5665
5652
|
};
|
|
5666
5653
|
}
|
|
5667
5654
|
|
|
@@ -6289,7 +6276,7 @@ class BaseInput extends r {
|
|
|
6289
6276
|
this.maxLength = card.formatLength;
|
|
6290
6277
|
this.minLength = card.formatMinLength;
|
|
6291
6278
|
|
|
6292
|
-
this.
|
|
6279
|
+
this.errorMessage = card.errorMessage;
|
|
6293
6280
|
|
|
6294
6281
|
if (this.icon) {
|
|
6295
6282
|
this.inputIconName = card.cardIcon;
|
|
@@ -6309,63 +6296,63 @@ class BaseInput extends r {
|
|
|
6309
6296
|
name: 'Airlines',
|
|
6310
6297
|
regex: /^(?<num>1|2)\d{0}/u,
|
|
6311
6298
|
formatMinLength: 17,
|
|
6312
|
-
|
|
6299
|
+
errorMessage: CreditCardValidationMessage,
|
|
6313
6300
|
cardIcon: 'credit-card'
|
|
6314
6301
|
},
|
|
6315
6302
|
{
|
|
6316
6303
|
name: 'Commercial',
|
|
6317
6304
|
regex: /^(?<num>2)\d{0}/u,
|
|
6318
6305
|
formatMinLength: 8,
|
|
6319
|
-
|
|
6306
|
+
errorMessage: CreditCardValidationMessage,
|
|
6320
6307
|
cardIcon: 'credit-card'
|
|
6321
6308
|
},
|
|
6322
6309
|
{
|
|
6323
6310
|
name: 'Alaska Commercial',
|
|
6324
6311
|
regex: /^(?<num>27)\d{0}/u,
|
|
6325
6312
|
formatMinLength: 8,
|
|
6326
|
-
|
|
6313
|
+
errorMessage: CreditCardValidationMessage,
|
|
6327
6314
|
cardIcon: 'cc-alaska'
|
|
6328
6315
|
},
|
|
6329
6316
|
{
|
|
6330
6317
|
name: 'American Express',
|
|
6331
6318
|
regex: /^(?<num>34|37)\d{0}/u,
|
|
6332
6319
|
formatLength: 17,
|
|
6333
|
-
|
|
6320
|
+
errorMessage: CreditCardValidationMessage,
|
|
6334
6321
|
cardIcon: 'cc-amex'
|
|
6335
6322
|
},
|
|
6336
6323
|
{
|
|
6337
6324
|
name: 'Diners club',
|
|
6338
6325
|
regex: /^(?<num>36|38)\d{0}/u,
|
|
6339
6326
|
formatLength: 16,
|
|
6340
|
-
|
|
6327
|
+
errorMessage: CreditCardValidationMessage,
|
|
6341
6328
|
cardIcon: 'credit-card'
|
|
6342
6329
|
},
|
|
6343
6330
|
{
|
|
6344
6331
|
name: 'Visa',
|
|
6345
6332
|
regex: /^(?<num>4)\d{0}/u,
|
|
6346
6333
|
formatLength: 19,
|
|
6347
|
-
|
|
6334
|
+
errorMessage: CreditCardValidationMessage,
|
|
6348
6335
|
cardIcon: 'cc-visa'
|
|
6349
6336
|
},
|
|
6350
6337
|
{
|
|
6351
6338
|
name: 'Alaska Airlines Visa',
|
|
6352
6339
|
regex: /^(?<num>4147\s34|4888\s93|4800\s11|4313\s51|4313\s07)\d{0}/u,
|
|
6353
6340
|
formatLength: 19,
|
|
6354
|
-
|
|
6341
|
+
errorMessage: CreditCardValidationMessage,
|
|
6355
6342
|
cardIcon: 'cc-alaska'
|
|
6356
6343
|
},
|
|
6357
6344
|
{
|
|
6358
6345
|
name: 'Master Card',
|
|
6359
6346
|
regex: /^(?<num>5)\d{0}/u,
|
|
6360
6347
|
formatLength: 19,
|
|
6361
|
-
|
|
6348
|
+
errorMessage: CreditCardValidationMessage,
|
|
6362
6349
|
cardIcon: 'cc-mastercard'
|
|
6363
6350
|
},
|
|
6364
6351
|
{
|
|
6365
6352
|
name: 'Discover Card',
|
|
6366
6353
|
regex: /^(?<num>6)\d{0}/u,
|
|
6367
6354
|
formatLength: 19,
|
|
6368
|
-
|
|
6355
|
+
errorMessage: CreditCardValidationMessage,
|
|
6369
6356
|
cardIcon: 'cc-discover'
|
|
6370
6357
|
}
|
|
6371
6358
|
];
|
|
@@ -6373,7 +6360,7 @@ class BaseInput extends r {
|
|
|
6373
6360
|
let type = {
|
|
6374
6361
|
name: 'Default Card',
|
|
6375
6362
|
formatLength: 19,
|
|
6376
|
-
|
|
6363
|
+
errorMessage: CreditCardValidationMessage,
|
|
6377
6364
|
cardIcon: 'credit-card'
|
|
6378
6365
|
};
|
|
6379
6366
|
|
|
@@ -7398,7 +7385,6 @@ class AuroInput extends BaseInput {
|
|
|
7398
7385
|
<p class="inputElement-helpText" id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
7399
7386
|
${this.errorMessage}
|
|
7400
7387
|
</p>`
|
|
7401
|
-
|
|
7402
7388
|
}
|
|
7403
7389
|
`;
|
|
7404
7390
|
}
|
|
@@ -7419,9 +7405,11 @@ var styleCss$3 = i$c`.util_displayInline{display:inline}.util_displayInlineBlock
|
|
|
7419
7405
|
* @prop {Object} optionSelected - Specifies the current selected option.
|
|
7420
7406
|
* @prop {String} value - Value selected for the dropdown menu.
|
|
7421
7407
|
* @prop {Boolean} checkmark - When attribute is present auro-menu will apply checkmarks to selected options.
|
|
7422
|
-
* @attr {
|
|
7408
|
+
* @attr {String} error - When defined, sets persistent validity to `customError` and sets the validation message to the attribute value.
|
|
7423
7409
|
* @attr {String} validity - Specifies the `validityState` this element is in.
|
|
7424
7410
|
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validityStates.
|
|
7411
|
+
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
7412
|
+
* @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
|
|
7425
7413
|
* @attr {Boolean} disabled - If set, disables the combobox.
|
|
7426
7414
|
* @attr {Boolean} noFilter - If set, combobox will not filter menuoptions based in input.
|
|
7427
7415
|
* @attr {Boolean} noValidate - If set, disables auto-validation on blur.
|
|
@@ -7487,12 +7475,17 @@ class AuroCombobox extends r$6 {
|
|
|
7487
7475
|
return {
|
|
7488
7476
|
// ...super.properties,
|
|
7489
7477
|
error: {
|
|
7490
|
-
type:
|
|
7478
|
+
type: String,
|
|
7491
7479
|
reflect: true
|
|
7492
7480
|
},
|
|
7493
7481
|
setCustomValidity: {
|
|
7494
|
-
type: String
|
|
7495
|
-
|
|
7482
|
+
type: String
|
|
7483
|
+
},
|
|
7484
|
+
setCustomValidityCustomError: {
|
|
7485
|
+
type: String
|
|
7486
|
+
},
|
|
7487
|
+
setCustomValidityValueMissing: {
|
|
7488
|
+
type: String
|
|
7496
7489
|
},
|
|
7497
7490
|
validity: {
|
|
7498
7491
|
type: String,
|
|
@@ -7776,9 +7769,7 @@ class AuroCombobox extends r$6 {
|
|
|
7776
7769
|
});
|
|
7777
7770
|
|
|
7778
7771
|
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
7779
|
-
this.
|
|
7780
|
-
this.value = undefined;
|
|
7781
|
-
this.validation.validate(this);
|
|
7772
|
+
this.reset();
|
|
7782
7773
|
});
|
|
7783
7774
|
}
|
|
7784
7775
|
|
|
@@ -7856,7 +7847,7 @@ class AuroCombobox extends r$6 {
|
|
|
7856
7847
|
});
|
|
7857
7848
|
|
|
7858
7849
|
this.input.addEventListener('auroFormElement-validated', (evt) => {
|
|
7859
|
-
this.
|
|
7850
|
+
this.errorMessage = evt.detail.message;
|
|
7860
7851
|
});
|
|
7861
7852
|
}
|
|
7862
7853
|
|
|
@@ -8000,9 +7991,6 @@ class AuroCombobox extends r$6 {
|
|
|
8000
7991
|
* @returns {void}
|
|
8001
7992
|
*/
|
|
8002
7993
|
reset() {
|
|
8003
|
-
// Resets the help text of the combobox
|
|
8004
|
-
this.auroInputHelpText = undefined;
|
|
8005
|
-
|
|
8006
7994
|
this.input.reset();
|
|
8007
7995
|
this.validation.reset(this);
|
|
8008
7996
|
}
|
|
@@ -8035,10 +8023,6 @@ class AuroCombobox extends r$6 {
|
|
|
8035
8023
|
this.input.setAttribute('error', this.getAttribute('error'));
|
|
8036
8024
|
this.validation.validate(this);
|
|
8037
8025
|
}
|
|
8038
|
-
|
|
8039
|
-
if (changedProperties.has('setCustomValidity')) {
|
|
8040
|
-
this.input.setAttribute('setCustomValidity', this.setCustomValidity);
|
|
8041
|
-
}
|
|
8042
8026
|
}
|
|
8043
8027
|
|
|
8044
8028
|
/**
|
|
@@ -8092,19 +8076,23 @@ class AuroCombobox extends r$6 {
|
|
|
8092
8076
|
?noValidate="${this.noValidate}"
|
|
8093
8077
|
?disabled="${this.disabled}"
|
|
8094
8078
|
?icon="${this.triggerIcon}"
|
|
8079
|
+
setCustomValidity="${this.setCustomValidity}"
|
|
8080
|
+
setCustomValidityValueMissing="${this.setCustomValidityValueMissing}"
|
|
8081
|
+
setCustomValidityCustomError="${this.setCustomValidityCustomError}"
|
|
8095
8082
|
.type="${this.type}">
|
|
8096
8083
|
<slot name="label" slot="label"></slot>
|
|
8097
8084
|
</${this.inputTag}>
|
|
8098
8085
|
<div class="menuWrapper">
|
|
8099
8086
|
</div>
|
|
8100
8087
|
<span slot="helpText">
|
|
8101
|
-
|
|
8088
|
+
<!-- Help text and error message template -->
|
|
8089
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
8102
8090
|
? u$6`
|
|
8103
|
-
${this.auroInputHelpText}
|
|
8104
|
-
`
|
|
8105
|
-
: u$6`
|
|
8106
8091
|
<slot name="helpText"></slot>
|
|
8107
|
-
`
|
|
8092
|
+
` : u$6`
|
|
8093
|
+
<p role="alert" aria-live="assertive" part="helpText">
|
|
8094
|
+
${this.errorMessage}
|
|
8095
|
+
</p>`
|
|
8108
8096
|
}
|
|
8109
8097
|
</span>
|
|
8110
8098
|
</${this.dropdownTag}>
|
|
@@ -8136,8 +8124,8 @@ var tokensCss$1 = i$c`:host{--ds-auro-menu-divider-color: var(--ds-color-border-
|
|
|
8136
8124
|
* @event auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
|
|
8137
8125
|
* @event auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
8138
8126
|
* @event auroMenu-selectValueFailure - Notifies that a an attempt to select a menuoption by matching a value has failed.
|
|
8139
|
-
* @event auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
8140
8127
|
* @event auroMenu-selectValueReset - Notifies that the component value has been reset.
|
|
8128
|
+
* @event auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
8141
8129
|
* @event auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
8142
8130
|
* @slot loadingText - Text to show while loading attribute is set
|
|
8143
8131
|
* @slot loadingIcon - Icon to show while loading attribute is set
|