@aurodesignsystem/auro-formkit 2.0.0-beta.1 → 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/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 +34 -0
- package/components/checkbox/.turbo/turbo-build.log +3 -3
- package/components/checkbox/.turbo/turbo-bundler.log +3 -3
- package/components/checkbox/README.md +8 -8
- package/components/checkbox/demo/api.md +53 -51
- package/components/checkbox/demo/api.min.js +32 -37
- package/components/checkbox/demo/index.md +62 -62
- package/components/checkbox/demo/index.min.js +32 -37
- package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +1 -1
- package/components/checkbox/dist/index.js +32 -37
- package/components/checkbox/src/auro-checkbox-group.js +2 -2
- package/components/checkbox/src/auro-checkbox.js +1 -1
- 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 +2 -2
- 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/141bb7d9a95e288b-meta.json +0 -1
- package/.turbo/cache/141bb7d9a95e288b.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/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/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/bb8b41cd0ade3986-meta.json +0 -1
- package/.turbo/cache/bb8b41cd0ade3986.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/cd845bb6102c589a-meta.json +0 -1
- package/.turbo/cache/cd845bb6102c589a.tar.zst +0 -0
- package/.turbo/cache/ce67b6522dd09e64-meta.json +0 -1
- package/.turbo/cache/ce67b6522dd09e64.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
|
@@ -145,20 +145,20 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
145
145
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
146
146
|
|
|
147
147
|
if (!pattern.test(elem.value)) {
|
|
148
|
-
elem.validity = '
|
|
149
|
-
elem.
|
|
148
|
+
elem.validity = 'patternMismatch';
|
|
149
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
154
154
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
155
155
|
elem.validity = 'tooShort';
|
|
156
|
-
elem.
|
|
156
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
if (elem.value?.length > elem.maxLength) {
|
|
160
160
|
elem.validity = 'tooLong';
|
|
161
|
-
elem.
|
|
161
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -174,33 +174,32 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
174
174
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
175
175
|
|
|
176
176
|
if (!elem.value.match(emailRegex)) {
|
|
177
|
-
elem.validity = '
|
|
178
|
-
elem.
|
|
177
|
+
elem.validity = 'patternMismatch';
|
|
178
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
179
179
|
}
|
|
180
180
|
} else if (elem.type === 'credit-card') {
|
|
181
181
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
182
182
|
elem.validity = 'tooShort';
|
|
183
|
-
elem.
|
|
183
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
184
184
|
}
|
|
185
185
|
} else if (elem.type === 'number') {
|
|
186
186
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
187
187
|
elem.validity = 'rangeOverflow';
|
|
188
|
-
elem.
|
|
188
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
191
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
192
192
|
elem.validity = 'rangeUnderflow';
|
|
193
|
-
elem.
|
|
193
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
194
194
|
}
|
|
195
|
-
|
|
196
195
|
} else if (elem.type === 'month-day-year' ||
|
|
197
196
|
elem.type === 'month-year' ||
|
|
198
197
|
elem.type === 'month-fullYear' ||
|
|
199
198
|
elem.type === 'year-month-day'
|
|
200
199
|
) {
|
|
201
|
-
if (elem.value
|
|
200
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
202
201
|
elem.validity = 'tooShort';
|
|
203
|
-
elem.
|
|
202
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
204
203
|
} else {
|
|
205
204
|
const valueDate = new Date(elem.value);
|
|
206
205
|
|
|
@@ -210,7 +209,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
210
209
|
|
|
211
210
|
if (valueDate > maxDate) {
|
|
212
211
|
elem.validity = 'rangeOverflow';
|
|
213
|
-
elem.
|
|
212
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
215
|
|
|
@@ -220,7 +219,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
220
219
|
|
|
221
220
|
if (valueDate < minDate) {
|
|
222
221
|
elem.validity = 'rangeUnderflow';
|
|
223
|
-
elem.
|
|
222
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
224
223
|
}
|
|
225
224
|
}
|
|
226
225
|
}
|
|
@@ -243,10 +242,10 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
243
242
|
|
|
244
243
|
if (elem.hasAttribute('error')) {
|
|
245
244
|
elem.validity = 'customError';
|
|
246
|
-
elem.
|
|
245
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
247
246
|
} else if (validationShouldRun) {
|
|
248
247
|
elem.validity = 'valid';
|
|
249
|
-
elem.
|
|
248
|
+
elem.errorMessage = '';
|
|
250
249
|
|
|
251
250
|
/**
|
|
252
251
|
* Only validate once we interact with the datepicker
|
|
@@ -258,7 +257,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
258
257
|
let hasValue = elem.value && elem.value.length > 0;
|
|
259
258
|
|
|
260
259
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
261
|
-
if (this.auroInputElements
|
|
260
|
+
if (this.auroInputElements?.length === 2) {
|
|
262
261
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
263
262
|
hasValue = false;
|
|
264
263
|
}
|
|
@@ -266,31 +265,27 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
266
265
|
|
|
267
266
|
if (!hasValue && elem.required) {
|
|
268
267
|
elem.validity = 'valueMissing';
|
|
269
|
-
elem.
|
|
268
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
270
269
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
271
270
|
this.validateType(elem);
|
|
272
271
|
this.validateAttributes(elem);
|
|
273
272
|
}
|
|
274
273
|
}
|
|
275
274
|
|
|
276
|
-
if (this.auroInputElements
|
|
275
|
+
if (this.auroInputElements?.length > 0) {
|
|
277
276
|
elem.validity = this.auroInputElements[0].validity;
|
|
278
|
-
elem.
|
|
277
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
279
278
|
|
|
280
|
-
if (elem.validity === 'valid') {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
284
|
-
}
|
|
279
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
280
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
281
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
285
282
|
}
|
|
286
283
|
}
|
|
287
284
|
|
|
288
285
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
293
|
-
}
|
|
286
|
+
// Use the validity message override if it is declared
|
|
287
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
288
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
294
289
|
}
|
|
295
290
|
|
|
296
291
|
this.getErrorMessage(elem);
|
|
@@ -336,18 +331,18 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
336
331
|
if (elem.validity !== 'valid') {
|
|
337
332
|
if (elem.setCustomValidity) {
|
|
338
333
|
elem.errorMessage = elem.setCustomValidity;
|
|
339
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
334
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
340
335
|
const input = elem.renderRoot.querySelector('input');
|
|
341
336
|
|
|
342
337
|
if (input.validationMessage.length > 0) {
|
|
343
338
|
elem.errorMessage = input.validationMessage;
|
|
344
339
|
}
|
|
345
|
-
} else if (this.inputElements &&
|
|
340
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
346
341
|
const firstInput = this.inputElements[0];
|
|
347
342
|
|
|
348
343
|
if (firstInput.validationMessage.length > 0) {
|
|
349
344
|
elem.errorMessage = firstInput.validationMessage;
|
|
350
|
-
} else if (this.inputElements
|
|
345
|
+
} else if (this.inputElements?.length === 2) {
|
|
351
346
|
const secondInput = this.inputElements[1];
|
|
352
347
|
|
|
353
348
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -13458,7 +13453,7 @@ const t=globalThis,e$1=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShad
|
|
|
13458
13453
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13459
13454
|
*/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");
|
|
13460
13455
|
|
|
13461
|
-
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))}.
|
|
13456
|
+
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)}`;
|
|
13462
13457
|
|
|
13463
13458
|
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)}`;
|
|
13464
13459
|
|
|
@@ -15135,20 +15130,20 @@ class AuroFormValidation {
|
|
|
15135
15130
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
15136
15131
|
|
|
15137
15132
|
if (!pattern.test(elem.value)) {
|
|
15138
|
-
elem.validity = '
|
|
15139
|
-
elem.
|
|
15133
|
+
elem.validity = 'patternMismatch';
|
|
15134
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
15140
15135
|
}
|
|
15141
15136
|
}
|
|
15142
15137
|
|
|
15143
15138
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
15144
15139
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
15145
15140
|
elem.validity = 'tooShort';
|
|
15146
|
-
elem.
|
|
15141
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
15147
15142
|
}
|
|
15148
15143
|
|
|
15149
15144
|
if (elem.value?.length > elem.maxLength) {
|
|
15150
15145
|
elem.validity = 'tooLong';
|
|
15151
|
-
elem.
|
|
15146
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
15152
15147
|
}
|
|
15153
15148
|
}
|
|
15154
15149
|
|
|
@@ -15164,33 +15159,32 @@ class AuroFormValidation {
|
|
|
15164
15159
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
15165
15160
|
|
|
15166
15161
|
if (!elem.value.match(emailRegex)) {
|
|
15167
|
-
elem.validity = '
|
|
15168
|
-
elem.
|
|
15162
|
+
elem.validity = 'patternMismatch';
|
|
15163
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
15169
15164
|
}
|
|
15170
15165
|
} else if (elem.type === 'credit-card') {
|
|
15171
15166
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
15172
15167
|
elem.validity = 'tooShort';
|
|
15173
|
-
elem.
|
|
15168
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
15174
15169
|
}
|
|
15175
15170
|
} else if (elem.type === 'number') {
|
|
15176
15171
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
15177
15172
|
elem.validity = 'rangeOverflow';
|
|
15178
|
-
elem.
|
|
15173
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
15179
15174
|
}
|
|
15180
15175
|
|
|
15181
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
15176
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
15182
15177
|
elem.validity = 'rangeUnderflow';
|
|
15183
|
-
elem.
|
|
15178
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
15184
15179
|
}
|
|
15185
|
-
|
|
15186
15180
|
} else if (elem.type === 'month-day-year' ||
|
|
15187
15181
|
elem.type === 'month-year' ||
|
|
15188
15182
|
elem.type === 'month-fullYear' ||
|
|
15189
15183
|
elem.type === 'year-month-day'
|
|
15190
15184
|
) {
|
|
15191
|
-
if (elem.value
|
|
15185
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
15192
15186
|
elem.validity = 'tooShort';
|
|
15193
|
-
elem.
|
|
15187
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
15194
15188
|
} else {
|
|
15195
15189
|
const valueDate = new Date(elem.value);
|
|
15196
15190
|
|
|
@@ -15200,7 +15194,7 @@ class AuroFormValidation {
|
|
|
15200
15194
|
|
|
15201
15195
|
if (valueDate > maxDate) {
|
|
15202
15196
|
elem.validity = 'rangeOverflow';
|
|
15203
|
-
elem.
|
|
15197
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
15204
15198
|
}
|
|
15205
15199
|
}
|
|
15206
15200
|
|
|
@@ -15210,7 +15204,7 @@ class AuroFormValidation {
|
|
|
15210
15204
|
|
|
15211
15205
|
if (valueDate < minDate) {
|
|
15212
15206
|
elem.validity = 'rangeUnderflow';
|
|
15213
|
-
elem.
|
|
15207
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
15214
15208
|
}
|
|
15215
15209
|
}
|
|
15216
15210
|
}
|
|
@@ -15233,10 +15227,10 @@ class AuroFormValidation {
|
|
|
15233
15227
|
|
|
15234
15228
|
if (elem.hasAttribute('error')) {
|
|
15235
15229
|
elem.validity = 'customError';
|
|
15236
|
-
elem.
|
|
15230
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
15237
15231
|
} else if (validationShouldRun) {
|
|
15238
15232
|
elem.validity = 'valid';
|
|
15239
|
-
elem.
|
|
15233
|
+
elem.errorMessage = '';
|
|
15240
15234
|
|
|
15241
15235
|
/**
|
|
15242
15236
|
* Only validate once we interact with the datepicker
|
|
@@ -15248,7 +15242,7 @@ class AuroFormValidation {
|
|
|
15248
15242
|
let hasValue = elem.value && elem.value.length > 0;
|
|
15249
15243
|
|
|
15250
15244
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
15251
|
-
if (this.auroInputElements
|
|
15245
|
+
if (this.auroInputElements?.length === 2) {
|
|
15252
15246
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
15253
15247
|
hasValue = false;
|
|
15254
15248
|
}
|
|
@@ -15256,31 +15250,27 @@ class AuroFormValidation {
|
|
|
15256
15250
|
|
|
15257
15251
|
if (!hasValue && elem.required) {
|
|
15258
15252
|
elem.validity = 'valueMissing';
|
|
15259
|
-
elem.
|
|
15253
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
15260
15254
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
15261
15255
|
this.validateType(elem);
|
|
15262
15256
|
this.validateAttributes(elem);
|
|
15263
15257
|
}
|
|
15264
15258
|
}
|
|
15265
15259
|
|
|
15266
|
-
if (this.auroInputElements
|
|
15260
|
+
if (this.auroInputElements?.length > 0) {
|
|
15267
15261
|
elem.validity = this.auroInputElements[0].validity;
|
|
15268
|
-
elem.
|
|
15262
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
15269
15263
|
|
|
15270
|
-
if (elem.validity === 'valid') {
|
|
15271
|
-
|
|
15272
|
-
|
|
15273
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
15274
|
-
}
|
|
15264
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
15265
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
15266
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
15275
15267
|
}
|
|
15276
15268
|
}
|
|
15277
15269
|
|
|
15278
15270
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15282
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
15283
|
-
}
|
|
15271
|
+
// Use the validity message override if it is declared
|
|
15272
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
15273
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
15284
15274
|
}
|
|
15285
15275
|
|
|
15286
15276
|
this.getErrorMessage(elem);
|
|
@@ -15326,18 +15316,18 @@ class AuroFormValidation {
|
|
|
15326
15316
|
if (elem.validity !== 'valid') {
|
|
15327
15317
|
if (elem.setCustomValidity) {
|
|
15328
15318
|
elem.errorMessage = elem.setCustomValidity;
|
|
15329
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
15319
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
15330
15320
|
const input = elem.renderRoot.querySelector('input');
|
|
15331
15321
|
|
|
15332
15322
|
if (input.validationMessage.length > 0) {
|
|
15333
15323
|
elem.errorMessage = input.validationMessage;
|
|
15334
15324
|
}
|
|
15335
|
-
} else if (this.inputElements &&
|
|
15325
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
15336
15326
|
const firstInput = this.inputElements[0];
|
|
15337
15327
|
|
|
15338
15328
|
if (firstInput.validationMessage.length > 0) {
|
|
15339
15329
|
elem.errorMessage = firstInput.validationMessage;
|
|
15340
|
-
} else if (this.inputElements
|
|
15330
|
+
} else if (this.inputElements?.length === 2) {
|
|
15341
15331
|
const secondInput = this.inputElements[1];
|
|
15342
15332
|
|
|
15343
15333
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -15365,8 +15355,7 @@ class AuroFormValidation {
|
|
|
15365
15355
|
* @attr {Boolean} bordered - Applies bordered UI variant.
|
|
15366
15356
|
* @attr {Boolean} borderless - Applies borderless UI variant.
|
|
15367
15357
|
* @attr {Boolean} disabled - If set, disables the input.
|
|
15368
|
-
* @attr {String} error - When defined, sets persistent validity to `customError` and sets
|
|
15369
|
-
* @prop {String} errorMessage - Contains the help text message for the current validity error.
|
|
15358
|
+
* @attr {String} error - When defined, sets persistent validity to `customError` and sets the validation message to the attribute value.
|
|
15370
15359
|
* @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.
|
|
15371
15360
|
* @attr {String} id - Sets the unique ID of the element.
|
|
15372
15361
|
* @attr {String} lang - defines the language of an element.
|
|
@@ -15380,10 +15369,10 @@ class AuroFormValidation {
|
|
|
15380
15369
|
* @attr {Boolean} required - Populates the `required` attribute on the input. Used for client-side validation.
|
|
15381
15370
|
* @attr {String} pattern - Specifies a regular expression the form control's value should match.
|
|
15382
15371
|
* @attr {String} placeholder - Define custom placeholder text, only supported by date input formats.
|
|
15383
|
-
* @attr {String} setCustomValidity - Sets a custom help text message to display for all
|
|
15372
|
+
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validity states.
|
|
15384
15373
|
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
15385
15374
|
* @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
|
|
15386
|
-
* @attr {String}
|
|
15375
|
+
* @attr {String} setCustomValidityPatternMismatch - Custom help text message to display when validity = `patternMismatch`.
|
|
15387
15376
|
* @attr {String} setCustomValidityTooShort - Custom help text message to display when validity = `tooShort`.
|
|
15388
15377
|
* @attr {String} setCustomValidityTooLong - Custom help text message to display when validity = `tooLong`.
|
|
15389
15378
|
* @attr {String} setCustomValidityForType - Custom help text message to display for the declared element `type` and type validity fails.
|
|
@@ -15529,20 +15518,18 @@ class BaseInput extends r {
|
|
|
15529
15518
|
type: String,
|
|
15530
15519
|
reflect: true
|
|
15531
15520
|
},
|
|
15532
|
-
errorMessage: { type: String },
|
|
15533
15521
|
validity: {
|
|
15534
15522
|
type: String,
|
|
15535
15523
|
reflect: true
|
|
15536
15524
|
},
|
|
15537
|
-
setCustomValidity:
|
|
15538
|
-
setCustomValidityCustomError:
|
|
15539
|
-
setCustomValidityValueMissing:
|
|
15540
|
-
|
|
15541
|
-
setCustomValidityTooShort:
|
|
15542
|
-
setCustomValidityTooLong:
|
|
15543
|
-
setCustomValidityRangeOverflow:
|
|
15544
|
-
setCustomValidityRangeUnderflow:
|
|
15545
|
-
customValidityTypeEmail: { type: String }
|
|
15525
|
+
setCustomValidity: { type: String },
|
|
15526
|
+
setCustomValidityCustomError: { type: String },
|
|
15527
|
+
setCustomValidityValueMissing: { type: String },
|
|
15528
|
+
setCustomValidityPatternMismatch: { type: String },
|
|
15529
|
+
setCustomValidityTooShort: { type: String },
|
|
15530
|
+
setCustomValidityTooLong: { type: String },
|
|
15531
|
+
setCustomValidityRangeOverflow: { type: String },
|
|
15532
|
+
setCustomValidityRangeUnderflow: { type: String }
|
|
15546
15533
|
};
|
|
15547
15534
|
}
|
|
15548
15535
|
|
|
@@ -16170,7 +16157,7 @@ class BaseInput extends r {
|
|
|
16170
16157
|
this.maxLength = card.formatLength;
|
|
16171
16158
|
this.minLength = card.formatMinLength;
|
|
16172
16159
|
|
|
16173
|
-
this.
|
|
16160
|
+
this.errorMessage = card.errorMessage;
|
|
16174
16161
|
|
|
16175
16162
|
if (this.icon) {
|
|
16176
16163
|
this.inputIconName = card.cardIcon;
|
|
@@ -16190,63 +16177,63 @@ class BaseInput extends r {
|
|
|
16190
16177
|
name: 'Airlines',
|
|
16191
16178
|
regex: /^(?<num>1|2)\d{0}/u,
|
|
16192
16179
|
formatMinLength: 17,
|
|
16193
|
-
|
|
16180
|
+
errorMessage: CreditCardValidationMessage,
|
|
16194
16181
|
cardIcon: 'credit-card'
|
|
16195
16182
|
},
|
|
16196
16183
|
{
|
|
16197
16184
|
name: 'Commercial',
|
|
16198
16185
|
regex: /^(?<num>2)\d{0}/u,
|
|
16199
16186
|
formatMinLength: 8,
|
|
16200
|
-
|
|
16187
|
+
errorMessage: CreditCardValidationMessage,
|
|
16201
16188
|
cardIcon: 'credit-card'
|
|
16202
16189
|
},
|
|
16203
16190
|
{
|
|
16204
16191
|
name: 'Alaska Commercial',
|
|
16205
16192
|
regex: /^(?<num>27)\d{0}/u,
|
|
16206
16193
|
formatMinLength: 8,
|
|
16207
|
-
|
|
16194
|
+
errorMessage: CreditCardValidationMessage,
|
|
16208
16195
|
cardIcon: 'cc-alaska'
|
|
16209
16196
|
},
|
|
16210
16197
|
{
|
|
16211
16198
|
name: 'American Express',
|
|
16212
16199
|
regex: /^(?<num>34|37)\d{0}/u,
|
|
16213
16200
|
formatLength: 17,
|
|
16214
|
-
|
|
16201
|
+
errorMessage: CreditCardValidationMessage,
|
|
16215
16202
|
cardIcon: 'cc-amex'
|
|
16216
16203
|
},
|
|
16217
16204
|
{
|
|
16218
16205
|
name: 'Diners club',
|
|
16219
16206
|
regex: /^(?<num>36|38)\d{0}/u,
|
|
16220
16207
|
formatLength: 16,
|
|
16221
|
-
|
|
16208
|
+
errorMessage: CreditCardValidationMessage,
|
|
16222
16209
|
cardIcon: 'credit-card'
|
|
16223
16210
|
},
|
|
16224
16211
|
{
|
|
16225
16212
|
name: 'Visa',
|
|
16226
16213
|
regex: /^(?<num>4)\d{0}/u,
|
|
16227
16214
|
formatLength: 19,
|
|
16228
|
-
|
|
16215
|
+
errorMessage: CreditCardValidationMessage,
|
|
16229
16216
|
cardIcon: 'cc-visa'
|
|
16230
16217
|
},
|
|
16231
16218
|
{
|
|
16232
16219
|
name: 'Alaska Airlines Visa',
|
|
16233
16220
|
regex: /^(?<num>4147\s34|4888\s93|4800\s11|4313\s51|4313\s07)\d{0}/u,
|
|
16234
16221
|
formatLength: 19,
|
|
16235
|
-
|
|
16222
|
+
errorMessage: CreditCardValidationMessage,
|
|
16236
16223
|
cardIcon: 'cc-alaska'
|
|
16237
16224
|
},
|
|
16238
16225
|
{
|
|
16239
16226
|
name: 'Master Card',
|
|
16240
16227
|
regex: /^(?<num>5)\d{0}/u,
|
|
16241
16228
|
formatLength: 19,
|
|
16242
|
-
|
|
16229
|
+
errorMessage: CreditCardValidationMessage,
|
|
16243
16230
|
cardIcon: 'cc-mastercard'
|
|
16244
16231
|
},
|
|
16245
16232
|
{
|
|
16246
16233
|
name: 'Discover Card',
|
|
16247
16234
|
regex: /^(?<num>6)\d{0}/u,
|
|
16248
16235
|
formatLength: 19,
|
|
16249
|
-
|
|
16236
|
+
errorMessage: CreditCardValidationMessage,
|
|
16250
16237
|
cardIcon: 'cc-discover'
|
|
16251
16238
|
}
|
|
16252
16239
|
];
|
|
@@ -16254,7 +16241,7 @@ class BaseInput extends r {
|
|
|
16254
16241
|
let type = {
|
|
16255
16242
|
name: 'Default Card',
|
|
16256
16243
|
formatLength: 19,
|
|
16257
|
-
|
|
16244
|
+
errorMessage: CreditCardValidationMessage,
|
|
16258
16245
|
cardIcon: 'credit-card'
|
|
16259
16246
|
};
|
|
16260
16247
|
|
|
@@ -17279,7 +17266,6 @@ class AuroInput extends BaseInput {
|
|
|
17279
17266
|
<p class="inputElement-helpText" id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
17280
17267
|
${this.errorMessage}
|
|
17281
17268
|
</p>`
|
|
17282
|
-
|
|
17283
17269
|
}
|
|
17284
17270
|
`;
|
|
17285
17271
|
}
|
|
@@ -17297,9 +17283,10 @@ var inputVersion = '4.2.0';
|
|
|
17297
17283
|
/**
|
|
17298
17284
|
* @prop {String} value - Value selected for the date picker.
|
|
17299
17285
|
* @prop {String} valueEnd - Value selected for the second date picker when using date range.
|
|
17300
|
-
* @attr {String} error - When defined, sets persistent validity to `customError` and sets
|
|
17286
|
+
* @attr {String} error - When defined, sets persistent validity to `customError` and sets the validation message to the attribute value.
|
|
17301
17287
|
* @attr {String} validity - Specifies the `validityState` this element is in.
|
|
17302
17288
|
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validityStates.
|
|
17289
|
+
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
17303
17290
|
* @attr {String} setCustomValidityRangeUnderflow - Custom help text message to display when validity = `rangeUnderflow`.
|
|
17304
17291
|
* @attr {String} setCustomValidityRangeOverflow - Custom help text message to display when validity = `rangeOverflow`.
|
|
17305
17292
|
* @attr {String} setCustomValidityValueMissing - Help text message to display when validity = `valueMissing`.
|
|
@@ -17429,19 +17416,18 @@ class AuroDatePicker extends r$7 {
|
|
|
17429
17416
|
},
|
|
17430
17417
|
setCustomValidity: {
|
|
17431
17418
|
type: String,
|
|
17432
|
-
|
|
17419
|
+
},
|
|
17420
|
+
setCustomValidityCustomError: {
|
|
17421
|
+
type: String,
|
|
17433
17422
|
},
|
|
17434
17423
|
setCustomValidityRangeUnderflow: {
|
|
17435
17424
|
type: String,
|
|
17436
|
-
reflect: true
|
|
17437
17425
|
},
|
|
17438
17426
|
setCustomValidityRangeOverflow: {
|
|
17439
17427
|
type: String,
|
|
17440
|
-
reflect: true
|
|
17441
17428
|
},
|
|
17442
17429
|
setCustomValidityValueMissing: {
|
|
17443
17430
|
type: String,
|
|
17444
|
-
reflect: true
|
|
17445
17431
|
},
|
|
17446
17432
|
validity: {
|
|
17447
17433
|
type: String,
|
|
@@ -17636,30 +17622,6 @@ class AuroDatePicker extends r$7 {
|
|
|
17636
17622
|
return dateStr;
|
|
17637
17623
|
}
|
|
17638
17624
|
|
|
17639
|
-
/**
|
|
17640
|
-
* Return appropriate error message.
|
|
17641
|
-
* @param {Object} evt - Event passed in from auro-input when the event triggered this function.
|
|
17642
|
-
* @private
|
|
17643
|
-
*/
|
|
17644
|
-
getErrorMessage(evt) {
|
|
17645
|
-
if (evt) {
|
|
17646
|
-
const inputClass = evt.target.getAttribute('class');
|
|
17647
|
-
if (inputClass === 'dateFrom') {
|
|
17648
|
-
if (this.inputList[0].validity && this.inputList[0].validity !== 'valid') {
|
|
17649
|
-
this.errorMessage = evt.target.errorMessage;
|
|
17650
|
-
} else {
|
|
17651
|
-
this.errorMessage = undefined;
|
|
17652
|
-
}
|
|
17653
|
-
}
|
|
17654
|
-
|
|
17655
|
-
if (inputClass === 'dateTo') {
|
|
17656
|
-
if (!this.errorMessage && this.inputList[1].validity && this.inputList[1].validity !== 'valid') {
|
|
17657
|
-
this.errorMessage = evt.target.errorMessage;
|
|
17658
|
-
}
|
|
17659
|
-
}
|
|
17660
|
-
}
|
|
17661
|
-
}
|
|
17662
|
-
|
|
17663
17625
|
/**
|
|
17664
17626
|
* Changes the calendar's visibility to reflect the value of the central date attribute.
|
|
17665
17627
|
* @private
|
|
@@ -17768,13 +17730,13 @@ class AuroDatePicker extends r$7 {
|
|
|
17768
17730
|
input.addEventListener('auroFormElement-validated', (evt) => {
|
|
17769
17731
|
if (evt.detail.validity === 'customError') {
|
|
17770
17732
|
this.validity = evt.detail.validity;
|
|
17771
|
-
this.
|
|
17733
|
+
this.errorMessage = evt.detail.message;
|
|
17772
17734
|
} else if (evt.target === this.inputList[0]) {
|
|
17773
17735
|
this.validity = evt.detail.validity;
|
|
17774
|
-
this.
|
|
17736
|
+
this.errorMessage = evt.detail.message;
|
|
17775
17737
|
} else if (this.inputList.length > 1 && evt.target === this.inputList[1] && (this.inputList[0].validity === 'valid' || this.inputList[0].validity === undefined)) {
|
|
17776
17738
|
this.validity = evt.detail.validity;
|
|
17777
|
-
this.
|
|
17739
|
+
this.errorMessage = evt.detail.message;
|
|
17778
17740
|
}
|
|
17779
17741
|
});
|
|
17780
17742
|
});
|
|
@@ -18064,7 +18026,7 @@ class AuroDatePicker extends r$7 {
|
|
|
18064
18026
|
// This is done to prevent error icon from displaying on both inputs in range support
|
|
18065
18027
|
const lastInput = this.inputList[this.inputList.length - 1];
|
|
18066
18028
|
|
|
18067
|
-
if (this.error) {
|
|
18029
|
+
if (this.hasAttribute('error')) {
|
|
18068
18030
|
// Set the error attribute on the last input
|
|
18069
18031
|
lastInput.setAttribute('error', this.getAttribute('error'));
|
|
18070
18032
|
} else {
|
|
@@ -18182,6 +18144,8 @@ class AuroDatePicker extends r$7 {
|
|
|
18182
18144
|
noValidate
|
|
18183
18145
|
.max="${this.maxDate}"
|
|
18184
18146
|
.min="${this.minDate}"
|
|
18147
|
+
setCustomValidity="${this.setCustomValidity}"
|
|
18148
|
+
setCustomValidityCustomError="${this.setCustomValidityCustomError}"
|
|
18185
18149
|
setCustomValidityValueMissing="${this.setCustomValidityValueMissing}"
|
|
18186
18150
|
setCustomValidityRangeOverflow="${this.setCustomValidityRangeOverflow}"
|
|
18187
18151
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
@@ -18199,6 +18163,8 @@ class AuroDatePicker extends r$7 {
|
|
|
18199
18163
|
noValidate
|
|
18200
18164
|
.max="${this.maxDate}"
|
|
18201
18165
|
.min="${this.minDate}"
|
|
18166
|
+
setCustomValidity="${this.setCustomValidity}"
|
|
18167
|
+
setCustomValidityCustomError="${this.setCustomValidityCustomError}"
|
|
18202
18168
|
setCustomValidityValueMissing="${this.setCustomValidityValueMissing}"
|
|
18203
18169
|
setCustomValidityRangeOverflow="${this.setCustomValidityRangeOverflow}"
|
|
18204
18170
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
@@ -18229,8 +18195,8 @@ class AuroDatePicker extends r$7 {
|
|
|
18229
18195
|
? u$6`
|
|
18230
18196
|
<slot name="helpText"></slot>
|
|
18231
18197
|
` : u$6`
|
|
18232
|
-
<p class="datepickerElement-helpText"
|
|
18233
|
-
${this.
|
|
18198
|
+
<p class="datepickerElement-helpText" role="alert" aria-live="assertive" part="helpText">
|
|
18199
|
+
${this.errorMessage}
|
|
18234
18200
|
</p>`
|
|
18235
18201
|
}
|
|
18236
18202
|
</span>
|