@aurodesignsystem/auro-formkit 2.0.0-beta.2 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/cache/013a48308b893dac-meta.json +1 -1
- package/.turbo/cache/02244170c798a2bd-meta.json +1 -0
- package/.turbo/cache/02244170c798a2bd.tar.zst +0 -0
- package/.turbo/cache/051ff97a20add0e2-meta.json +1 -0
- package/.turbo/cache/051ff97a20add0e2.tar.zst +0 -0
- package/.turbo/cache/07ca42419b9f050c-meta.json +1 -1
- package/.turbo/cache/0cea4c1f34f3683b-meta.json +1 -1
- package/.turbo/cache/0ea853339c064fa1-meta.json +1 -0
- package/.turbo/cache/0ea853339c064fa1.tar.zst +0 -0
- package/.turbo/cache/16658beec9f4a809-meta.json +1 -0
- package/.turbo/cache/16658beec9f4a809.tar.zst +0 -0
- package/.turbo/cache/17259cf94d8f8925-meta.json +1 -1
- package/.turbo/cache/1b9818717e4bdf9f-meta.json +1 -0
- package/.turbo/cache/1b9818717e4bdf9f.tar.zst +0 -0
- package/.turbo/cache/1c0f580d37370ba2-meta.json +1 -0
- package/.turbo/cache/1c0f580d37370ba2.tar.zst +0 -0
- package/.turbo/cache/1c99a949ec63ab35-meta.json +1 -1
- package/.turbo/cache/1df4710eef8ed00d-meta.json +1 -0
- package/.turbo/cache/1df4710eef8ed00d.tar.zst +0 -0
- package/.turbo/cache/204b66d1b253e9cc-meta.json +1 -0
- package/.turbo/cache/204b66d1b253e9cc.tar.zst +0 -0
- package/.turbo/cache/257a7a26ea72dbc5-meta.json +1 -1
- package/.turbo/cache/2a5d0939d6fc1052-meta.json +1 -0
- package/.turbo/cache/2a5d0939d6fc1052.tar.zst +0 -0
- package/.turbo/cache/2e3b829fcf75c836-meta.json +1 -0
- package/.turbo/cache/2e3b829fcf75c836.tar.zst +0 -0
- package/.turbo/cache/3bf45120d0cc9bd8-meta.json +1 -1
- package/.turbo/cache/3d380d0d40404cac-meta.json +1 -0
- package/.turbo/cache/3d380d0d40404cac.tar.zst +0 -0
- package/.turbo/cache/3e12285c614db539-meta.json +1 -0
- package/.turbo/cache/3e12285c614db539.tar.zst +0 -0
- package/.turbo/cache/45035bf5c4147ccd-meta.json +1 -1
- package/.turbo/cache/5bf2d3f7ba5891e0-meta.json +1 -0
- package/.turbo/cache/5bf2d3f7ba5891e0.tar.zst +0 -0
- package/.turbo/cache/5f304c0f37ef25f3-meta.json +1 -1
- package/.turbo/cache/64de7a53e02db647-meta.json +1 -1
- package/.turbo/cache/691a74627ec57993-meta.json +1 -1
- package/.turbo/cache/69aae513b7ec6c7d-meta.json +1 -1
- package/.turbo/cache/6dd67d179191bda8-meta.json +1 -0
- package/.turbo/cache/6dd67d179191bda8.tar.zst +0 -0
- package/.turbo/cache/6dd7058e6703cb35-meta.json +1 -1
- package/.turbo/cache/73e9073a5274616d-meta.json +1 -1
- package/.turbo/cache/773edc0f83c8c5a5-meta.json +1 -1
- package/.turbo/cache/786a822763403879-meta.json +1 -1
- package/.turbo/cache/7e1043cffa69f327-meta.json +1 -0
- package/.turbo/cache/7e1043cffa69f327.tar.zst +0 -0
- package/.turbo/cache/7ffd501e81790676-meta.json +1 -0
- package/.turbo/cache/7ffd501e81790676.tar.zst +0 -0
- package/.turbo/cache/80a13352066a9801-meta.json +1 -0
- package/.turbo/cache/80a13352066a9801.tar.zst +0 -0
- package/.turbo/cache/80b5d974184a01df-meta.json +1 -1
- package/.turbo/cache/8954c6073396fadd-meta.json +1 -1
- package/.turbo/cache/8e79bd5c3a16a72e-meta.json +1 -0
- package/.turbo/cache/8e9ebc3df0e18de0-meta.json +1 -0
- package/.turbo/cache/8e9ebc3df0e18de0.tar.zst +0 -0
- package/.turbo/cache/92daa6d7c389d548-meta.json +1 -1
- package/.turbo/cache/973d0eea26083f4b-meta.json +1 -0
- package/.turbo/cache/973d0eea26083f4b.tar.zst +0 -0
- package/.turbo/cache/9c6ad42729c7b2d8-meta.json +1 -0
- package/.turbo/cache/9c6ad42729c7b2d8.tar.zst +0 -0
- package/.turbo/cache/a77bc920ea508bb8-meta.json +1 -1
- package/.turbo/cache/a77bc920ea508bb8.tar.zst +0 -0
- package/.turbo/cache/a9a9d012c83882d8-meta.json +1 -0
- package/.turbo/cache/a9a9d012c83882d8.tar.zst +0 -0
- package/.turbo/cache/b54fc4f664a7a5a0-meta.json +1 -1
- package/.turbo/cache/ba4418918621fbcd-meta.json +1 -1
- package/.turbo/cache/be7c23c37b8ec74b-meta.json +1 -1
- package/.turbo/cache/be7c23c37b8ec74b.tar.zst +0 -0
- package/.turbo/cache/bffc7582905c2a5e-meta.json +1 -0
- package/.turbo/cache/bffc7582905c2a5e.tar.zst +0 -0
- package/.turbo/cache/caa0b4ac8d2a04dd-meta.json +1 -1
- package/.turbo/cache/caa0b4ac8d2a04dd.tar.zst +0 -0
- package/.turbo/cache/cc81de9c0b452a7c-meta.json +1 -1
- package/.turbo/cache/d572ebb3c833e8f4-meta.json +1 -0
- package/.turbo/cache/d572ebb3c833e8f4.tar.zst +0 -0
- package/.turbo/cache/d61543843c932504-meta.json +1 -0
- package/.turbo/cache/d61543843c932504.tar.zst +0 -0
- package/.turbo/cache/dad1301ac69bcb85-meta.json +1 -1
- package/.turbo/cache/db361cb6578dca84-meta.json +1 -0
- package/.turbo/cache/db361cb6578dca84.tar.zst +0 -0
- package/.turbo/cache/dea5945f55c6aba5-meta.json +1 -0
- package/.turbo/cache/dea5945f55c6aba5.tar.zst +0 -0
- package/.turbo/cache/e992dab20aeefbaf-meta.json +1 -1
- package/.turbo/cache/e992dab20aeefbaf.tar.zst +0 -0
- package/.turbo/cache/f3ff9040a2196834-meta.json +1 -0
- package/.turbo/cache/f3ff9040a2196834.tar.zst +0 -0
- package/.turbo/cache/f817d89688cefca8-meta.json +1 -0
- package/.turbo/cache/f817d89688cefca8.tar.zst +0 -0
- package/.turbo/cache/fa132b5b5f0e75f8-meta.json +1 -1
- package/.turbo/cache/fc57c17867dcac3d-meta.json +1 -0
- package/.turbo/cache/fc57c17867dcac3d.tar.zst +0 -0
- package/CHANGELOG.md +44 -0
- package/components/checkbox/.turbo/turbo-build.log +3 -3
- package/components/checkbox/.turbo/turbo-bundler.log +3 -3
- package/components/checkbox/demo/api.md +4 -2
- package/components/checkbox/demo/api.min.js +31 -36
- package/components/checkbox/demo/index.min.js +31 -36
- package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
- package/components/checkbox/dist/index.js +31 -36
- package/components/checkbox/src/auro-checkbox-group.js +2 -2
- package/components/combobox/.turbo/turbo-build.log +3 -3
- package/components/combobox/demo/api.md +17 -15
- package/components/combobox/demo/api.min.js +500 -218
- package/components/combobox/demo/index.min.js +500 -218
- package/components/combobox/dist/auro-combobox.d.ts +11 -4
- package/components/combobox/dist/auro-combobox.d.ts.map +1 -1
- package/components/combobox/dist/index.js +499 -217
- package/components/combobox/src/auro-combobox.js +22 -20
- package/components/counter/.turbo/turbo-build.log +3 -3
- package/components/counter/.turbo/turbo-bundler.log +3 -3
- package/components/datepicker/.turbo/turbo-build.log +9 -8
- package/components/datepicker/demo/api.md +107 -87
- package/components/datepicker/demo/api.min.js +492 -232
- package/components/datepicker/demo/index.min.js +492 -232
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -13
- package/components/datepicker/dist/auro-datepicker.d.ts.map +1 -1
- package/components/datepicker/dist/index.js +492 -232
- package/components/datepicker/src/auro-datepicker.js +15 -35
- package/components/dropdown/.turbo/turbo-build.log +3 -3
- package/components/dropdown/.turbo/turbo-bundler.log +2 -2
- package/components/dropdown/demo/api.md +4 -4
- package/components/dropdown/demo/api.min.js +166 -42
- package/components/dropdown/demo/index.min.js +166 -42
- package/components/dropdown/dist/auro-dropdown.d.ts +93 -34
- package/components/dropdown/dist/auro-dropdown.d.ts.map +1 -1
- package/components/dropdown/dist/auro-dropdownBib.d.ts +9 -3
- package/components/dropdown/dist/auro-dropdownBib.d.ts.map +1 -1
- package/components/dropdown/dist/index.js +166 -42
- package/components/dropdown/src/auro-dropdown.js +154 -39
- package/components/dropdown/src/auro-dropdownBib.js +12 -3
- package/components/dropdown/src/styles/style-css.js +1 -1
- package/components/dropdown/src/styles/style.css +4 -0
- package/components/dropdown/src/styles/style.scss +5 -0
- package/components/form/.turbo/turbo-build.log +3 -3
- package/components/form/.turbo/turbo-bundler.log +3 -3
- package/components/input/.turbo/turbo-build$colon$sass.log +51 -1
- package/components/input/.turbo/turbo-build.log +56 -6
- package/components/input/.turbo/turbo-bundler.log +3 -3
- package/components/input/.turbo/turbo-sass$colon$render.log +6 -0
- package/components/input/demo/api.md +83 -81
- package/components/input/demo/api.min.js +282 -121
- package/components/input/demo/index.md +6 -6
- package/components/input/demo/index.min.js +282 -121
- package/components/input/dist/auro-input.d.ts.map +1 -1
- package/components/input/dist/base-input.d.ts +155 -84
- package/components/input/dist/base-input.d.ts.map +1 -1
- package/components/input/dist/index.js +282 -121
- package/components/input/dist/styles/mixins-css.d.ts +3 -0
- package/components/input/dist/styles/mixins-css.d.ts.map +1 -0
- package/components/input/src/auro-input.js +0 -1
- package/components/input/src/base-input.js +252 -85
- package/components/input/src/styles/borders.scss +3 -19
- package/components/input/src/styles/color.css +1 -2
- package/components/input/src/styles/color.scss +3 -10
- package/components/input/src/styles/input-css.js +1 -1
- package/components/input/src/styles/input.css +1 -1
- package/components/input/src/styles/input.scss +4 -1
- package/components/input/src/styles/label-css.js +1 -1
- package/components/input/src/styles/label.css +1 -1
- package/components/input/src/styles/label.scss +4 -7
- package/components/input/src/styles/mixins-css.js +2 -0
- package/components/input/src/styles/mixins.css +1 -0
- package/components/input/src/styles/mixins.scss +45 -0
- package/components/input/src/styles/notificationIcons-css.js +1 -1
- package/components/input/src/styles/notificationIcons.css +13 -12
- package/components/input/src/styles/notificationIcons.scss +17 -25
- package/components/input/src/styles/style-css.js +1 -1
- package/components/input/src/styles/style.css +15 -17
- package/components/input/src/styles/style.scss +0 -4
- package/components/menu/.turbo/turbo-build.log +3 -3
- package/components/menu/.turbo/turbo-bundler.log +3 -3
- package/components/menu/demo/api.min.js +1 -1
- package/components/menu/demo/index.min.js +1 -1
- package/components/menu/dist/auro-menu.d.ts +1 -1
- package/components/menu/dist/index.js +1 -1
- package/components/menu/src/auro-menu.js +1 -1
- package/components/radio/.turbo/turbo-build.log +3 -3
- package/components/radio/.turbo/turbo-bundler.log +3 -3
- package/components/radio/demo/api.md +3 -1
- package/components/radio/demo/api.min.js +30 -35
- package/components/radio/demo/index.min.js +30 -35
- package/components/radio/dist/index.js +30 -35
- package/components/radio/src/auro-radio-group.js +1 -1
- package/components/select/.turbo/turbo-build.log +7 -9
- package/components/select/demo/api.md +45 -110
- package/components/select/demo/api.min.js +320 -224
- package/components/select/demo/index.md +100 -43
- package/components/select/demo/index.min.js +320 -220
- package/components/select/dist/auro-select.d.ts +64 -51
- package/components/select/dist/auro-select.d.ts.map +1 -1
- package/components/select/dist/index.js +314 -201
- package/components/select/src/auro-select.js +100 -118
- package/components/select/src/styles/style-css.js +1 -1
- package/components/select/src/styles/style.css +7 -0
- package/components/select/src/styles/style.scss +11 -1
- package/package.json +1 -1
- package/packages/form-validation/src/validation.js +29 -34
- package/.turbo/cache/0663fcbb1d711029-meta.json +0 -1
- package/.turbo/cache/0663fcbb1d711029.tar.zst +0 -0
- package/.turbo/cache/0a2b0a4df8a0443f-meta.json +0 -1
- package/.turbo/cache/120c8e207aa1ba35-meta.json +0 -1
- package/.turbo/cache/120c8e207aa1ba35.tar.zst +0 -0
- package/.turbo/cache/17dd4bdef6550a07-meta.json +0 -1
- package/.turbo/cache/17dd4bdef6550a07.tar.zst +0 -0
- package/.turbo/cache/1de15d89eed2d760-meta.json +0 -1
- package/.turbo/cache/1de15d89eed2d760.tar.zst +0 -0
- package/.turbo/cache/2990aaa7ebc5b967-meta.json +0 -1
- package/.turbo/cache/2990aaa7ebc5b967.tar.zst +0 -0
- package/.turbo/cache/32c0b9995fb5f8dd-meta.json +0 -1
- package/.turbo/cache/32c0b9995fb5f8dd.tar.zst +0 -0
- package/.turbo/cache/47ba2b5ebdb579e9-meta.json +0 -1
- package/.turbo/cache/47ba2b5ebdb579e9.tar.zst +0 -0
- package/.turbo/cache/4f92cea2d8c63de2-meta.json +0 -1
- package/.turbo/cache/4f92cea2d8c63de2.tar.zst +0 -0
- package/.turbo/cache/56cb35d4c7473a23-meta.json +0 -1
- package/.turbo/cache/56cb35d4c7473a23.tar.zst +0 -0
- package/.turbo/cache/5c16ce3cff5c9dff-meta.json +0 -1
- package/.turbo/cache/5c16ce3cff5c9dff.tar.zst +0 -0
- package/.turbo/cache/626afdc67e0cb540-meta.json +0 -1
- package/.turbo/cache/626afdc67e0cb540.tar.zst +0 -0
- package/.turbo/cache/6ef81cf9a66f982a-meta.json +0 -1
- package/.turbo/cache/6ef81cf9a66f982a.tar.zst +0 -0
- package/.turbo/cache/784c03fe9fd5ac05-meta.json +0 -1
- package/.turbo/cache/784c03fe9fd5ac05.tar.zst +0 -0
- package/.turbo/cache/87219c41a4ace9cd-meta.json +0 -1
- package/.turbo/cache/87219c41a4ace9cd.tar.zst +0 -0
- package/.turbo/cache/8b735250fa5a62bf-meta.json +0 -1
- package/.turbo/cache/8b735250fa5a62bf.tar.zst +0 -0
- package/.turbo/cache/9154e8fe6ab767ea-meta.json +0 -1
- package/.turbo/cache/9154e8fe6ab767ea.tar.zst +0 -0
- package/.turbo/cache/993dff2edb7b6766-meta.json +0 -1
- package/.turbo/cache/993dff2edb7b6766.tar.zst +0 -0
- package/.turbo/cache/9a097d6576dadd64-meta.json +0 -1
- package/.turbo/cache/9a097d6576dadd64.tar.zst +0 -0
- package/.turbo/cache/a49cc58242467fdc-meta.json +0 -1
- package/.turbo/cache/a49cc58242467fdc.tar.zst +0 -0
- package/.turbo/cache/a6a56bb802e1c20f-meta.json +0 -1
- package/.turbo/cache/a6a56bb802e1c20f.tar.zst +0 -0
- package/.turbo/cache/af061e7a077a9ba5-meta.json +0 -1
- package/.turbo/cache/af061e7a077a9ba5.tar.zst +0 -0
- package/.turbo/cache/b50f1b283b4b81cd-meta.json +0 -1
- package/.turbo/cache/b50f1b283b4b81cd.tar.zst +0 -0
- package/.turbo/cache/bf85bc040b7e64db-meta.json +0 -1
- package/.turbo/cache/bf85bc040b7e64db.tar.zst +0 -0
- package/.turbo/cache/cd5f6987783fb56d-meta.json +0 -1
- package/.turbo/cache/cd5f6987783fb56d.tar.zst +0 -0
- package/.turbo/cache/ce67b6522dd09e64-meta.json +0 -1
- package/.turbo/cache/ce67b6522dd09e64.tar.zst +0 -0
- package/.turbo/cache/d716cb7a08152beb-meta.json +0 -1
- package/.turbo/cache/d716cb7a08152beb.tar.zst +0 -0
- package/.turbo/cache/d7a47b77deb3d9a4-meta.json +0 -1
- package/.turbo/cache/d7a47b77deb3d9a4.tar.zst +0 -0
- package/.turbo/cache/fbbe2704bf9cb90b-meta.json +0 -1
- package/.turbo/cache/fbbe2704bf9cb90b.tar.zst +0 -0
- package/.turbo/cache/ff58f630c9d69af4-meta.json +0 -1
- package/.turbo/cache/ff58f630c9d69af4.tar.zst +0 -0
- /package/.turbo/cache/{0a2b0a4df8a0443f.tar.zst → 8e79bd5c3a16a72e.tar.zst} +0 -0
|
@@ -208,20 +208,20 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
208
208
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
209
209
|
|
|
210
210
|
if (!pattern.test(elem.value)) {
|
|
211
|
-
elem.validity = '
|
|
212
|
-
elem.
|
|
211
|
+
elem.validity = 'patternMismatch';
|
|
212
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
217
217
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
218
218
|
elem.validity = 'tooShort';
|
|
219
|
-
elem.
|
|
219
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
if (elem.value?.length > elem.maxLength) {
|
|
223
223
|
elem.validity = 'tooLong';
|
|
224
|
-
elem.
|
|
224
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
|
|
@@ -237,33 +237,32 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
237
237
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
238
238
|
|
|
239
239
|
if (!elem.value.match(emailRegex)) {
|
|
240
|
-
elem.validity = '
|
|
241
|
-
elem.
|
|
240
|
+
elem.validity = 'patternMismatch';
|
|
241
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
242
242
|
}
|
|
243
243
|
} else if (elem.type === 'credit-card') {
|
|
244
244
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
245
245
|
elem.validity = 'tooShort';
|
|
246
|
-
elem.
|
|
246
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
247
247
|
}
|
|
248
248
|
} else if (elem.type === 'number') {
|
|
249
249
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
250
250
|
elem.validity = 'rangeOverflow';
|
|
251
|
-
elem.
|
|
251
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
254
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
255
255
|
elem.validity = 'rangeUnderflow';
|
|
256
|
-
elem.
|
|
256
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
257
257
|
}
|
|
258
|
-
|
|
259
258
|
} else if (elem.type === 'month-day-year' ||
|
|
260
259
|
elem.type === 'month-year' ||
|
|
261
260
|
elem.type === 'month-fullYear' ||
|
|
262
261
|
elem.type === 'year-month-day'
|
|
263
262
|
) {
|
|
264
|
-
if (elem.value
|
|
263
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
265
264
|
elem.validity = 'tooShort';
|
|
266
|
-
elem.
|
|
265
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
267
266
|
} else {
|
|
268
267
|
const valueDate = new Date(elem.value);
|
|
269
268
|
|
|
@@ -273,7 +272,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
273
272
|
|
|
274
273
|
if (valueDate > maxDate) {
|
|
275
274
|
elem.validity = 'rangeOverflow';
|
|
276
|
-
elem.
|
|
275
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
277
276
|
}
|
|
278
277
|
}
|
|
279
278
|
|
|
@@ -283,7 +282,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
283
282
|
|
|
284
283
|
if (valueDate < minDate) {
|
|
285
284
|
elem.validity = 'rangeUnderflow';
|
|
286
|
-
elem.
|
|
285
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
287
286
|
}
|
|
288
287
|
}
|
|
289
288
|
}
|
|
@@ -306,10 +305,10 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
306
305
|
|
|
307
306
|
if (elem.hasAttribute('error')) {
|
|
308
307
|
elem.validity = 'customError';
|
|
309
|
-
elem.
|
|
308
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
310
309
|
} else if (validationShouldRun) {
|
|
311
310
|
elem.validity = 'valid';
|
|
312
|
-
elem.
|
|
311
|
+
elem.errorMessage = '';
|
|
313
312
|
|
|
314
313
|
/**
|
|
315
314
|
* Only validate once we interact with the datepicker
|
|
@@ -321,7 +320,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
321
320
|
let hasValue = elem.value && elem.value.length > 0;
|
|
322
321
|
|
|
323
322
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
324
|
-
if (this.auroInputElements
|
|
323
|
+
if (this.auroInputElements?.length === 2) {
|
|
325
324
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
326
325
|
hasValue = false;
|
|
327
326
|
}
|
|
@@ -329,31 +328,27 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
329
328
|
|
|
330
329
|
if (!hasValue && elem.required) {
|
|
331
330
|
elem.validity = 'valueMissing';
|
|
332
|
-
elem.
|
|
331
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
333
332
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
334
333
|
this.validateType(elem);
|
|
335
334
|
this.validateAttributes(elem);
|
|
336
335
|
}
|
|
337
336
|
}
|
|
338
337
|
|
|
339
|
-
if (this.auroInputElements
|
|
338
|
+
if (this.auroInputElements?.length > 0) {
|
|
340
339
|
elem.validity = this.auroInputElements[0].validity;
|
|
341
|
-
elem.
|
|
340
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
342
341
|
|
|
343
|
-
if (elem.validity === 'valid') {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
347
|
-
}
|
|
342
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
343
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
344
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
348
345
|
}
|
|
349
346
|
}
|
|
350
347
|
|
|
351
348
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
356
|
-
}
|
|
349
|
+
// Use the validity message override if it is declared
|
|
350
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
351
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
357
352
|
}
|
|
358
353
|
|
|
359
354
|
this.getErrorMessage(elem);
|
|
@@ -399,18 +394,18 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
399
394
|
if (elem.validity !== 'valid') {
|
|
400
395
|
if (elem.setCustomValidity) {
|
|
401
396
|
elem.errorMessage = elem.setCustomValidity;
|
|
402
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
397
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
403
398
|
const input = elem.renderRoot.querySelector('input');
|
|
404
399
|
|
|
405
400
|
if (input.validationMessage.length > 0) {
|
|
406
401
|
elem.errorMessage = input.validationMessage;
|
|
407
402
|
}
|
|
408
|
-
} else if (this.inputElements &&
|
|
403
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
409
404
|
const firstInput = this.inputElements[0];
|
|
410
405
|
|
|
411
406
|
if (firstInput.validationMessage.length > 0) {
|
|
412
407
|
elem.errorMessage = firstInput.validationMessage;
|
|
413
|
-
} else if (this.inputElements
|
|
408
|
+
} else if (this.inputElements?.length === 2) {
|
|
414
409
|
const secondInput = this.inputElements[1];
|
|
415
410
|
|
|
416
411
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -2828,7 +2823,7 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
2828
2823
|
|
|
2829
2824
|
var iconVersion$2 = '6.1.2';
|
|
2830
2825
|
|
|
2831
|
-
var styleCss$1$2 = i$3$1`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);white-space:normal}.trigger{position:relative;display:flex;align-items:center;border-width:1px;border-style:solid}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}.helpText{margin-top:var(--ds-size-50, 0.25rem);font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
2826
|
+
var styleCss$1$2 = i$3$1`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center;border-width:1px;border-style:solid}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}.helpText{margin-top:var(--ds-size-50, 0.25rem);font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
2832
2827
|
|
|
2833
2828
|
var colorCss$1$2 = i$3$1`.label{color:var(--ds-auro-dropdown-label-text-color)}.trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color)}.trigger:focus-within,.trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8)}.trigger:focus-within:not(:active){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5);outline:1px solid var(--ds-color-border-ui-focus-default, #2c67b5)}.trigger:hover{--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}.helpText{color:var(--ds-auro-dropdown-help-text-color)}:host([disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-ui-disabled-default, #adadad);--ds-auro-dropdown-label-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host([common]),:host([bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-primary-default, #585e67)}:host([common]) .trigger:active,:host([common]) .trigger:focus-within,:host([bordered]) .trigger:active,:host([bordered]) .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5)}:host([error]){--ds-auro-dropdown-help-text-color: var(--ds-color-text-error-default, #cc1816);--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-error-default, #cc1816)}:host([error]) .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([error]) .trigger:focus-within,:host([error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8)}:host([error]) .trigger:active{box-shadow:none;outline:none}:host([disabled][common]),:host([disabled][bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-disabled-default, #adadad)}`;
|
|
2834
2829
|
|
|
@@ -2852,9 +2847,6 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
2852
2847
|
];
|
|
2853
2848
|
|
|
2854
2849
|
/**
|
|
2855
|
-
* @attr { Boolean } common - If declared, will apply all styles for the common theme.
|
|
2856
|
-
* @attr { Boolean } rounded - If declared, will apply border-radius to the bib.
|
|
2857
|
-
* @attr { Boolean } inset - If declared, will apply extra padding to bib content.
|
|
2858
2850
|
* @prop { String } mobileFullscreenBreakpoint - Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
2859
2851
|
* @csspart bibContainer - Apply css to the bib container.
|
|
2860
2852
|
*/
|
|
@@ -2880,14 +2872,26 @@ class AuroDropdownBib extends r$5 {
|
|
|
2880
2872
|
|
|
2881
2873
|
static get properties() {
|
|
2882
2874
|
return {
|
|
2875
|
+
|
|
2876
|
+
/**
|
|
2877
|
+
* If declared, will apply all styles for the common theme.
|
|
2878
|
+
*/
|
|
2883
2879
|
common: {
|
|
2884
2880
|
type: Boolean,
|
|
2885
2881
|
reflect: true
|
|
2886
2882
|
},
|
|
2883
|
+
|
|
2884
|
+
/**
|
|
2885
|
+
* If declared, will apply extra padding to bib content.
|
|
2886
|
+
*/
|
|
2887
2887
|
inset: {
|
|
2888
2888
|
type: Boolean,
|
|
2889
2889
|
reflect: true
|
|
2890
2890
|
},
|
|
2891
|
+
|
|
2892
|
+
/**
|
|
2893
|
+
* If declared, will apply border-radius to the bib.
|
|
2894
|
+
*/
|
|
2891
2895
|
rounded: {
|
|
2892
2896
|
type: Boolean,
|
|
2893
2897
|
reflect: true
|
|
@@ -2931,22 +2935,7 @@ if (!customElements.get("auro-dropdownbib")) {
|
|
|
2931
2935
|
|
|
2932
2936
|
|
|
2933
2937
|
/**
|
|
2934
|
-
* @attr { Boolean } bordered - If declared, applies a border around the trigger slot.
|
|
2935
|
-
* @attr { Boolean } common - If declared, the dropdown will be styled with the common theme.
|
|
2936
|
-
* @attr { Boolean } chevron - If declared, the dropdown displays an display state chevron on the right.
|
|
2937
|
-
* @attr { Boolean } disabled - If declared, the dropdown is not interactive.
|
|
2938
2938
|
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
2939
|
-
* @attr { Boolean } error - If declared in combination with `bordered` property or `helpText` slot content, will apply red color to both.
|
|
2940
|
-
* @attr {Boolean} fluid - Makes the trigger to be full width of its parent container
|
|
2941
|
-
* @attr { Boolean } matchWidth - If declared, the popover and trigger will be set to the same width.
|
|
2942
|
-
* @attr { Boolean } inset - If declared, will apply padding around trigger slot content.
|
|
2943
|
-
* @attr { Boolean } rounded - If declared, will apply border-radius to trigger and default slots.
|
|
2944
|
-
* @attr { Boolean } hoverToggle - if declared, the trigger will toggle the big on mouseover/mouseout.
|
|
2945
|
-
* @attr { Boolean } noToggle - If declared, the trigger will only show the dropdown bib.
|
|
2946
|
-
* @attr { Boolean } focusShow - if declared, the bib will display when focus is applied to the trigger.
|
|
2947
|
-
* @attr { Boolean } noHideOnThisFocusLoss - If declared, the dropdown will not hide when moving focus outside the element.
|
|
2948
|
-
* @attr { String } mobileFullscreenBreakpoint - Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
2949
|
-
* @prop { Boolean } isPopoverVisible - If true, the dropdown bib is displayed.
|
|
2950
2939
|
* @slot - Default slot for the popover content.
|
|
2951
2940
|
* @slot label - Defines the content of the label.
|
|
2952
2941
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -2984,6 +2973,16 @@ class AuroDropdown extends r$5 {
|
|
|
2984
2973
|
this.tabIndex = 0;
|
|
2985
2974
|
this.noToggle = false;
|
|
2986
2975
|
|
|
2976
|
+
/**
|
|
2977
|
+
* @private
|
|
2978
|
+
*/
|
|
2979
|
+
this.hasTriggerContent = false;
|
|
2980
|
+
|
|
2981
|
+
/**
|
|
2982
|
+
* @private
|
|
2983
|
+
*/
|
|
2984
|
+
this.triggerContentSlot = undefined;
|
|
2985
|
+
|
|
2987
2986
|
/**
|
|
2988
2987
|
* @private
|
|
2989
2988
|
*/
|
|
@@ -3030,89 +3029,166 @@ class AuroDropdown extends r$5 {
|
|
|
3030
3029
|
// function to define props used within the scope of this component
|
|
3031
3030
|
static get properties() {
|
|
3032
3031
|
return {
|
|
3032
|
+
|
|
3033
|
+
/**
|
|
3034
|
+
* If declared, applies a border around the trigger slot.
|
|
3035
|
+
*/
|
|
3033
3036
|
bordered: {
|
|
3034
3037
|
type: Boolean,
|
|
3035
3038
|
reflect: true
|
|
3036
3039
|
},
|
|
3040
|
+
|
|
3041
|
+
/**
|
|
3042
|
+
* If declared, the dropdown displays a chevron on the right.
|
|
3043
|
+
* @attr {Boolean} chevron
|
|
3044
|
+
*/
|
|
3037
3045
|
chevron: {
|
|
3038
3046
|
type: Boolean,
|
|
3039
3047
|
reflect: true
|
|
3040
3048
|
},
|
|
3041
|
-
|
|
3049
|
+
|
|
3050
|
+
/**
|
|
3051
|
+
* If declared, the dropdown will be styled with the common theme.
|
|
3052
|
+
*/
|
|
3053
|
+
common: {
|
|
3042
3054
|
type: Boolean,
|
|
3043
3055
|
reflect: true
|
|
3044
3056
|
},
|
|
3045
|
-
|
|
3057
|
+
|
|
3058
|
+
/**
|
|
3059
|
+
* If declared, the dropdown is not interactive.
|
|
3060
|
+
*/
|
|
3061
|
+
disabled: {
|
|
3046
3062
|
type: Boolean,
|
|
3047
3063
|
reflect: true
|
|
3048
3064
|
},
|
|
3049
|
-
|
|
3065
|
+
|
|
3066
|
+
/**
|
|
3067
|
+
* @private
|
|
3068
|
+
*/
|
|
3069
|
+
dropdownWidth: {
|
|
3070
|
+
type: Number
|
|
3071
|
+
},
|
|
3072
|
+
|
|
3073
|
+
/**
|
|
3074
|
+
* If declared in combination with `bordered` property or `helpText` slot content, will apply red color to both.
|
|
3075
|
+
*/
|
|
3076
|
+
error: {
|
|
3050
3077
|
type: Boolean,
|
|
3051
|
-
reflect: true
|
|
3078
|
+
reflect: true
|
|
3052
3079
|
},
|
|
3080
|
+
|
|
3081
|
+
/**
|
|
3082
|
+
* If declared, the bib will display when focus is applied to the trigger.
|
|
3083
|
+
*/
|
|
3053
3084
|
focusShow: {
|
|
3054
3085
|
type: Boolean,
|
|
3055
3086
|
reflect: true
|
|
3056
3087
|
},
|
|
3057
|
-
|
|
3088
|
+
|
|
3089
|
+
/**
|
|
3090
|
+
* Makes the trigger to be full width of its parent container.
|
|
3091
|
+
*/
|
|
3092
|
+
fluid: {
|
|
3058
3093
|
type: Boolean,
|
|
3059
3094
|
reflect: true
|
|
3060
3095
|
},
|
|
3096
|
+
|
|
3097
|
+
/**
|
|
3098
|
+
* If declared, will apply padding around trigger slot content.
|
|
3099
|
+
*/
|
|
3061
3100
|
inset: {
|
|
3062
3101
|
type: Boolean,
|
|
3063
3102
|
reflect: true
|
|
3064
3103
|
},
|
|
3065
|
-
|
|
3104
|
+
|
|
3105
|
+
/**
|
|
3106
|
+
* If true, the dropdown bib is displayed.
|
|
3107
|
+
*/
|
|
3108
|
+
isPopoverVisible: {
|
|
3109
|
+
type: Boolean
|
|
3110
|
+
},
|
|
3111
|
+
|
|
3112
|
+
/**
|
|
3113
|
+
* If declared, the trigger will toggle the dropdown on mouseover/mouseout.
|
|
3114
|
+
*/
|
|
3115
|
+
hoverToggle: {
|
|
3066
3116
|
type: Boolean,
|
|
3067
3117
|
reflect: true
|
|
3068
3118
|
},
|
|
3069
|
-
|
|
3070
|
-
|
|
3119
|
+
|
|
3120
|
+
/**
|
|
3121
|
+
* @private
|
|
3122
|
+
*/
|
|
3123
|
+
hasTriggerContent: {
|
|
3124
|
+
type: Boolean
|
|
3125
|
+
},
|
|
3126
|
+
|
|
3127
|
+
/**
|
|
3128
|
+
* Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
3129
|
+
*/
|
|
3130
|
+
mobileFullscreenBreakpoint: {
|
|
3131
|
+
type: String,
|
|
3071
3132
|
reflect: true
|
|
3072
3133
|
},
|
|
3073
|
-
|
|
3134
|
+
|
|
3135
|
+
/**
|
|
3136
|
+
* If declared, the popover and trigger will be set to the same width.
|
|
3137
|
+
*/
|
|
3138
|
+
matchWidth: {
|
|
3074
3139
|
type: Boolean,
|
|
3075
3140
|
reflect: true
|
|
3076
3141
|
},
|
|
3077
|
-
|
|
3142
|
+
|
|
3143
|
+
/**
|
|
3144
|
+
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3145
|
+
*/
|
|
3146
|
+
noHideOnThisFocusLoss: {
|
|
3078
3147
|
type: Boolean,
|
|
3079
3148
|
reflect: true
|
|
3080
3149
|
},
|
|
3081
|
-
|
|
3150
|
+
|
|
3151
|
+
/**
|
|
3152
|
+
* If declared, the trigger will only show the dropdown bib.
|
|
3153
|
+
*/
|
|
3154
|
+
noToggle: {
|
|
3082
3155
|
type: Boolean,
|
|
3083
3156
|
reflect: true
|
|
3084
3157
|
},
|
|
3085
|
-
|
|
3158
|
+
|
|
3086
3159
|
onSlotChange: {
|
|
3087
3160
|
type: Function,
|
|
3088
3161
|
reflect: false
|
|
3089
3162
|
},
|
|
3090
|
-
mobileFullscreenBreakpoint: {
|
|
3091
|
-
type: String,
|
|
3092
|
-
reflect: true,
|
|
3093
|
-
},
|
|
3094
3163
|
|
|
3095
3164
|
/**
|
|
3096
3165
|
* @private
|
|
3097
3166
|
*/
|
|
3098
|
-
|
|
3167
|
+
placement: {
|
|
3168
|
+
type: String
|
|
3169
|
+
},
|
|
3099
3170
|
|
|
3100
3171
|
/**
|
|
3101
|
-
*
|
|
3172
|
+
* If declared, will apply border-radius to trigger and default slots.
|
|
3102
3173
|
*/
|
|
3103
|
-
|
|
3174
|
+
rounded: {
|
|
3175
|
+
type: Boolean,
|
|
3176
|
+
reflect: true
|
|
3177
|
+
},
|
|
3104
3178
|
|
|
3105
3179
|
/**
|
|
3106
3180
|
* @private
|
|
3107
3181
|
*/
|
|
3108
|
-
tabIndex: {
|
|
3182
|
+
tabIndex: {
|
|
3183
|
+
type: Number
|
|
3184
|
+
}
|
|
3109
3185
|
};
|
|
3110
3186
|
}
|
|
3111
3187
|
|
|
3112
3188
|
static get styles() {
|
|
3113
3189
|
return [
|
|
3114
|
-
styleCss$1$2,
|
|
3115
3190
|
colorCss$1$2,
|
|
3191
|
+
styleCss$1$2,
|
|
3116
3192
|
tokensCss$5
|
|
3117
3193
|
];
|
|
3118
3194
|
}
|
|
@@ -3143,6 +3219,12 @@ class AuroDropdown extends r$5 {
|
|
|
3143
3219
|
if (changedProperties.has('mobileFullscreenBreakpoint')) {
|
|
3144
3220
|
this.bibContent.mobileFullscreenBreakpoint = this.mobileFullscreenBreakpoint;
|
|
3145
3221
|
}
|
|
3222
|
+
|
|
3223
|
+
// when trigger's content is changed without any attribute or node change,
|
|
3224
|
+
// `requestUpdate` needs to be called to update hasTriggerContnet
|
|
3225
|
+
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
3226
|
+
this.handleTriggerContentSlotChange();
|
|
3227
|
+
}
|
|
3146
3228
|
}
|
|
3147
3229
|
|
|
3148
3230
|
firstUpdated() {
|
|
@@ -3185,6 +3267,43 @@ class AuroDropdown extends r$5 {
|
|
|
3185
3267
|
return inCustomSlot;
|
|
3186
3268
|
}
|
|
3187
3269
|
|
|
3270
|
+
/**
|
|
3271
|
+
* Handles changes to the trigger content slot and updates related properties.
|
|
3272
|
+
*
|
|
3273
|
+
* It first updates the floater settings
|
|
3274
|
+
* Then, it retrieves the assigned nodes from the event target and checks if any of
|
|
3275
|
+
* the nodes contain non-empty text content, updating the `hasTriggerContent` property accordingly.
|
|
3276
|
+
*
|
|
3277
|
+
* @private
|
|
3278
|
+
* @method handleTriggerContentSlotChange
|
|
3279
|
+
* @param {Event} event - native slotchange event
|
|
3280
|
+
* @returns {void}
|
|
3281
|
+
*/
|
|
3282
|
+
handleTriggerContentSlotChange(event) {
|
|
3283
|
+
this.floater.handleTriggerTabIndex();
|
|
3284
|
+
|
|
3285
|
+
if (event) {
|
|
3286
|
+
this.triggerNode = event.target;
|
|
3287
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3290
|
+
if (this.triggerContentSlot) {
|
|
3291
|
+
this.hasTriggerContent = this.triggerContentSlot.some((slot) => {
|
|
3292
|
+
if (slot.textContent.trim()) {
|
|
3293
|
+
return true;
|
|
3294
|
+
}
|
|
3295
|
+
const slotInSlot = slot.querySelector('slot');
|
|
3296
|
+
if (!slotInSlot) {
|
|
3297
|
+
return false;
|
|
3298
|
+
}
|
|
3299
|
+
const slotsInSlotNodes = slotInSlot.assignedNodes();
|
|
3300
|
+
return slotsInSlotNodes.some((ss) => Boolean(ss.textContent.trim()));
|
|
3301
|
+
});
|
|
3302
|
+
} else {
|
|
3303
|
+
this.hasTriggerContent = false;
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3188
3307
|
/**
|
|
3189
3308
|
* Handles the default slot change event and updates the content.
|
|
3190
3309
|
*
|
|
@@ -3219,13 +3338,13 @@ class AuroDropdown extends r$5 {
|
|
|
3219
3338
|
tabindex="${this.tabIndex}"
|
|
3220
3339
|
>
|
|
3221
3340
|
<div class="triggerContentWrapper">
|
|
3222
|
-
<label class="label" id="triggerLabel">
|
|
3341
|
+
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3223
3342
|
<slot name="label"></slot>
|
|
3224
3343
|
</label>
|
|
3225
3344
|
<div class="triggerContent">
|
|
3226
3345
|
<slot
|
|
3227
3346
|
name="trigger"
|
|
3228
|
-
@slotchange="${() =>
|
|
3347
|
+
@slotchange="${(event) => this.handleTriggerContentSlotChange(event)}"></slot>
|
|
3229
3348
|
</div>
|
|
3230
3349
|
</div>
|
|
3231
3350
|
${this.chevron || this.common ? u$1$1`
|
|
@@ -3435,7 +3554,7 @@ const t$4=globalThis,e$1$1=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.
|
|
|
3435
3554
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3436
3555
|
*/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");
|
|
3437
3556
|
|
|
3438
|
-
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))}.
|
|
3557
|
+
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)}`;
|
|
3439
3558
|
|
|
3440
3559
|
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)}`;
|
|
3441
3560
|
|
|
@@ -5112,20 +5231,20 @@ class AuroFormValidation {
|
|
|
5112
5231
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
5113
5232
|
|
|
5114
5233
|
if (!pattern.test(elem.value)) {
|
|
5115
|
-
elem.validity = '
|
|
5116
|
-
elem.
|
|
5234
|
+
elem.validity = 'patternMismatch';
|
|
5235
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
5117
5236
|
}
|
|
5118
5237
|
}
|
|
5119
5238
|
|
|
5120
5239
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
5121
5240
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
5122
5241
|
elem.validity = 'tooShort';
|
|
5123
|
-
elem.
|
|
5242
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
5124
5243
|
}
|
|
5125
5244
|
|
|
5126
5245
|
if (elem.value?.length > elem.maxLength) {
|
|
5127
5246
|
elem.validity = 'tooLong';
|
|
5128
|
-
elem.
|
|
5247
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
5129
5248
|
}
|
|
5130
5249
|
}
|
|
5131
5250
|
|
|
@@ -5141,33 +5260,32 @@ class AuroFormValidation {
|
|
|
5141
5260
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
5142
5261
|
|
|
5143
5262
|
if (!elem.value.match(emailRegex)) {
|
|
5144
|
-
elem.validity = '
|
|
5145
|
-
elem.
|
|
5263
|
+
elem.validity = 'patternMismatch';
|
|
5264
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
5146
5265
|
}
|
|
5147
5266
|
} else if (elem.type === 'credit-card') {
|
|
5148
5267
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
5149
5268
|
elem.validity = 'tooShort';
|
|
5150
|
-
elem.
|
|
5269
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
5151
5270
|
}
|
|
5152
5271
|
} else if (elem.type === 'number') {
|
|
5153
5272
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
5154
5273
|
elem.validity = 'rangeOverflow';
|
|
5155
|
-
elem.
|
|
5274
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
5156
5275
|
}
|
|
5157
5276
|
|
|
5158
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
5277
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
5159
5278
|
elem.validity = 'rangeUnderflow';
|
|
5160
|
-
elem.
|
|
5279
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
5161
5280
|
}
|
|
5162
|
-
|
|
5163
5281
|
} else if (elem.type === 'month-day-year' ||
|
|
5164
5282
|
elem.type === 'month-year' ||
|
|
5165
5283
|
elem.type === 'month-fullYear' ||
|
|
5166
5284
|
elem.type === 'year-month-day'
|
|
5167
5285
|
) {
|
|
5168
|
-
if (elem.value
|
|
5286
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
5169
5287
|
elem.validity = 'tooShort';
|
|
5170
|
-
elem.
|
|
5288
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
5171
5289
|
} else {
|
|
5172
5290
|
const valueDate = new Date(elem.value);
|
|
5173
5291
|
|
|
@@ -5177,7 +5295,7 @@ class AuroFormValidation {
|
|
|
5177
5295
|
|
|
5178
5296
|
if (valueDate > maxDate) {
|
|
5179
5297
|
elem.validity = 'rangeOverflow';
|
|
5180
|
-
elem.
|
|
5298
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
5181
5299
|
}
|
|
5182
5300
|
}
|
|
5183
5301
|
|
|
@@ -5187,7 +5305,7 @@ class AuroFormValidation {
|
|
|
5187
5305
|
|
|
5188
5306
|
if (valueDate < minDate) {
|
|
5189
5307
|
elem.validity = 'rangeUnderflow';
|
|
5190
|
-
elem.
|
|
5308
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
5191
5309
|
}
|
|
5192
5310
|
}
|
|
5193
5311
|
}
|
|
@@ -5210,10 +5328,10 @@ class AuroFormValidation {
|
|
|
5210
5328
|
|
|
5211
5329
|
if (elem.hasAttribute('error')) {
|
|
5212
5330
|
elem.validity = 'customError';
|
|
5213
|
-
elem.
|
|
5331
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
5214
5332
|
} else if (validationShouldRun) {
|
|
5215
5333
|
elem.validity = 'valid';
|
|
5216
|
-
elem.
|
|
5334
|
+
elem.errorMessage = '';
|
|
5217
5335
|
|
|
5218
5336
|
/**
|
|
5219
5337
|
* Only validate once we interact with the datepicker
|
|
@@ -5225,7 +5343,7 @@ class AuroFormValidation {
|
|
|
5225
5343
|
let hasValue = elem.value && elem.value.length > 0;
|
|
5226
5344
|
|
|
5227
5345
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
5228
|
-
if (this.auroInputElements
|
|
5346
|
+
if (this.auroInputElements?.length === 2) {
|
|
5229
5347
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
5230
5348
|
hasValue = false;
|
|
5231
5349
|
}
|
|
@@ -5233,31 +5351,27 @@ class AuroFormValidation {
|
|
|
5233
5351
|
|
|
5234
5352
|
if (!hasValue && elem.required) {
|
|
5235
5353
|
elem.validity = 'valueMissing';
|
|
5236
|
-
elem.
|
|
5354
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
5237
5355
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
5238
5356
|
this.validateType(elem);
|
|
5239
5357
|
this.validateAttributes(elem);
|
|
5240
5358
|
}
|
|
5241
5359
|
}
|
|
5242
5360
|
|
|
5243
|
-
if (this.auroInputElements
|
|
5361
|
+
if (this.auroInputElements?.length > 0) {
|
|
5244
5362
|
elem.validity = this.auroInputElements[0].validity;
|
|
5245
|
-
elem.
|
|
5363
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
5246
5364
|
|
|
5247
|
-
if (elem.validity === 'valid') {
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
5251
|
-
}
|
|
5365
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
5366
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
5367
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
5252
5368
|
}
|
|
5253
5369
|
}
|
|
5254
5370
|
|
|
5255
5371
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
5260
|
-
}
|
|
5372
|
+
// Use the validity message override if it is declared
|
|
5373
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
5374
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
5261
5375
|
}
|
|
5262
5376
|
|
|
5263
5377
|
this.getErrorMessage(elem);
|
|
@@ -5303,18 +5417,18 @@ class AuroFormValidation {
|
|
|
5303
5417
|
if (elem.validity !== 'valid') {
|
|
5304
5418
|
if (elem.setCustomValidity) {
|
|
5305
5419
|
elem.errorMessage = elem.setCustomValidity;
|
|
5306
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
5420
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
5307
5421
|
const input = elem.renderRoot.querySelector('input');
|
|
5308
5422
|
|
|
5309
5423
|
if (input.validationMessage.length > 0) {
|
|
5310
5424
|
elem.errorMessage = input.validationMessage;
|
|
5311
5425
|
}
|
|
5312
|
-
} else if (this.inputElements &&
|
|
5426
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
5313
5427
|
const firstInput = this.inputElements[0];
|
|
5314
5428
|
|
|
5315
5429
|
if (firstInput.validationMessage.length > 0) {
|
|
5316
5430
|
elem.errorMessage = firstInput.validationMessage;
|
|
5317
|
-
} else if (this.inputElements
|
|
5431
|
+
} else if (this.inputElements?.length === 2) {
|
|
5318
5432
|
const secondInput = this.inputElements[1];
|
|
5319
5433
|
|
|
5320
5434
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -5335,42 +5449,8 @@ class AuroFormValidation {
|
|
|
5335
5449
|
/**
|
|
5336
5450
|
* Auro-input provides users a way to enter data into a text field.
|
|
5337
5451
|
*
|
|
5338
|
-
* @attr {Boolean} activeLabel - If set, the label will remain fixed in the active position.
|
|
5339
|
-
* @attr {String} autocapitalize - An enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. [off/none, on/sentences, words, characters]
|
|
5340
|
-
* @attr {String} autocomplete - An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported.
|
|
5341
|
-
* @attr {String} autocorrect - When set to `off`, stops iOS from auto correcting words when typed into a text box.
|
|
5342
5452
|
* @attr {Boolean} bordered - Applies bordered UI variant.
|
|
5343
5453
|
* @attr {Boolean} borderless - Applies borderless UI variant.
|
|
5344
|
-
* @attr {Boolean} disabled - If set, disables the input.
|
|
5345
|
-
* @attr {String} error - When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value.
|
|
5346
|
-
* @prop {String} errorMessage - Contains the help text message for the current validity error.
|
|
5347
|
-
* @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.
|
|
5348
|
-
* @attr {String} id - Sets the unique ID of the element.
|
|
5349
|
-
* @attr {String} lang - defines the language of an element.
|
|
5350
|
-
* @attr {String} max - The maximum value allowed. This only applies for inputs with a type of `number` and all date formats.
|
|
5351
|
-
* @attr {Number} maxLength - The maximum number of characters the user can enter into the text input. This must be an integer value `0` or higher.
|
|
5352
|
-
* @attr {String} min - The minimum value allowed. This only applies for inputs with a type of `number` and all date formats.
|
|
5353
|
-
* @attr {Number} minLength - The minimum number of characters the user can enter into the text input. This must be an non-negative integer value smaller than or equal to the value specified by `maxlength`.
|
|
5354
|
-
* @attr {String} name - Populates the `name` attribute on the input.
|
|
5355
|
-
* @attr {Boolean} noValidate - If set, disables auto-validation on blur.
|
|
5356
|
-
* @attr {Boolean} readonly - Makes the input read-only, but can be set programmatically.
|
|
5357
|
-
* @attr {Boolean} required - Populates the `required` attribute on the input. Used for client-side validation.
|
|
5358
|
-
* @attr {String} pattern - Specifies a regular expression the form control's value should match.
|
|
5359
|
-
* @attr {String} placeholder - Define custom placeholder text, only supported by date input formats.
|
|
5360
|
-
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validityStates.
|
|
5361
|
-
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
5362
|
-
* @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
|
|
5363
|
-
* @attr {String} setCustomValidityBadInput - Custom help text message to display when validity = `badInput`.
|
|
5364
|
-
* @attr {String} setCustomValidityTooShort - Custom help text message to display when validity = `tooShort`.
|
|
5365
|
-
* @attr {String} setCustomValidityTooLong - Custom help text message to display when validity = `tooLong`.
|
|
5366
|
-
* @attr {String} setCustomValidityForType - Custom help text message to display for the declared element `type` and type validity fails.
|
|
5367
|
-
* @attr {String} setCustomValidityRangeOverflow - Custom help text message to display when validity = `rangeOverflow`.
|
|
5368
|
-
* @attr {String} setCustomValidityRangeUnderflow - Custom help text message to display when validity = `rangeUnderflow`.
|
|
5369
|
-
* @attr {String} spellcheck - An enumerated attribute defines whether the element may be checked for spelling errors. [true, false]. When set to `false` the attribute `autocorrect` is set to `off` and `autocapitalize` is set to `none`.
|
|
5370
|
-
* @attr {String} type - Populates the `type` attribute on the input. Allowed values are `password`, `email`, `credit-card`, `month-day-year`, `month-year`, `year-month-day` or `text`. If given value is not allowed or set, defaults to `text`.
|
|
5371
|
-
* @attr {Boolean} validateOnInput - Sets validation mode to re-eval with each input.
|
|
5372
|
-
* @attr {String} validity - Specifies the `validityState` this element is in.
|
|
5373
|
-
* @attr {String} value - Populates the `value` attribute on the input. Can also be read to retrieve the current value of the input.
|
|
5374
5454
|
*
|
|
5375
5455
|
* @slot helptext - Sets the help text displayed below the input.
|
|
5376
5456
|
* @slot label - Sets the label text for the input.
|
|
@@ -5462,71 +5542,272 @@ class BaseInput extends r {
|
|
|
5462
5542
|
.substring(idSubstrStart, idSubstrEnd);
|
|
5463
5543
|
}
|
|
5464
5544
|
|
|
5465
|
-
// function to define props used within the scope of this
|
|
5545
|
+
// function to define props used within the scope of this componentstatic
|
|
5466
5546
|
static get properties() {
|
|
5467
5547
|
return {
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5548
|
+
|
|
5549
|
+
/**
|
|
5550
|
+
* If set, the label will remain fixed in the active position.
|
|
5551
|
+
*/
|
|
5552
|
+
activeLabel: {
|
|
5553
|
+
type: Boolean,
|
|
5554
|
+
reflect: true
|
|
5555
|
+
},
|
|
5556
|
+
|
|
5557
|
+
/**
|
|
5558
|
+
* An enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. [off/none, on/sentences, words, characters]
|
|
5559
|
+
*/
|
|
5560
|
+
autocapitalize: {
|
|
5561
|
+
type: String
|
|
5562
|
+
},
|
|
5563
|
+
|
|
5564
|
+
/**
|
|
5565
|
+
* An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported.
|
|
5566
|
+
*/
|
|
5567
|
+
autocomplete: {
|
|
5475
5568
|
type: String,
|
|
5476
5569
|
reflect: true
|
|
5477
5570
|
},
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5571
|
+
|
|
5572
|
+
/**
|
|
5573
|
+
* When set to `off`, stops iOS from auto-correcting words when typed into a text box.
|
|
5574
|
+
*/
|
|
5575
|
+
autocorrect: {
|
|
5576
|
+
type: String
|
|
5577
|
+
},
|
|
5578
|
+
|
|
5579
|
+
/**
|
|
5580
|
+
* If set, disables the input.
|
|
5581
|
+
*/
|
|
5582
|
+
disabled: {
|
|
5583
|
+
type: Boolean
|
|
5584
|
+
},
|
|
5585
|
+
|
|
5586
|
+
error: {
|
|
5486
5587
|
type: String,
|
|
5487
5588
|
reflect: true
|
|
5488
5589
|
},
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5590
|
+
|
|
5591
|
+
/**
|
|
5592
|
+
* Contains the help text message for the current validity error.
|
|
5593
|
+
*/
|
|
5594
|
+
errorMessage: {
|
|
5595
|
+
type: String
|
|
5596
|
+
},
|
|
5597
|
+
|
|
5598
|
+
/**
|
|
5599
|
+
* 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.
|
|
5600
|
+
*/
|
|
5601
|
+
icon: {
|
|
5602
|
+
type: Boolean
|
|
5603
|
+
},
|
|
5604
|
+
|
|
5605
|
+
/**
|
|
5606
|
+
* Sets the unique ID of the element.
|
|
5607
|
+
*/
|
|
5608
|
+
id: {
|
|
5609
|
+
type: String
|
|
5610
|
+
},
|
|
5611
|
+
|
|
5612
|
+
/**
|
|
5613
|
+
* Defines the language of an element.
|
|
5614
|
+
*/
|
|
5615
|
+
lang: {
|
|
5616
|
+
type: String
|
|
5617
|
+
},
|
|
5618
|
+
|
|
5619
|
+
/**
|
|
5620
|
+
* The maximum value allowed. This only applies for inputs with a type of `number` and all date formats.
|
|
5621
|
+
*/
|
|
5622
|
+
max: {
|
|
5623
|
+
type: String
|
|
5624
|
+
},
|
|
5625
|
+
|
|
5626
|
+
/**
|
|
5627
|
+
* The maximum number of characters the user can enter into the text input. This must be an integer value `0` or higher.
|
|
5628
|
+
*/
|
|
5629
|
+
maxLength: {
|
|
5630
|
+
type: Number
|
|
5631
|
+
},
|
|
5632
|
+
|
|
5633
|
+
/**
|
|
5634
|
+
* The minimum value allowed. This only applies for inputs with a type of `number` and all date formats.
|
|
5635
|
+
*/
|
|
5636
|
+
min: {
|
|
5637
|
+
type: String
|
|
5638
|
+
},
|
|
5639
|
+
|
|
5640
|
+
/**
|
|
5641
|
+
* The minimum number of characters the user can enter into the text input. This must be a non-negative integer value smaller than or equal to the value specified by `maxlength`.
|
|
5642
|
+
*/
|
|
5643
|
+
minLength: {
|
|
5644
|
+
type: Number
|
|
5645
|
+
},
|
|
5646
|
+
|
|
5647
|
+
/**
|
|
5648
|
+
* Populates the `name` attribute on the input.
|
|
5649
|
+
*/
|
|
5650
|
+
name: {
|
|
5651
|
+
type: String
|
|
5652
|
+
},
|
|
5653
|
+
|
|
5654
|
+
/**
|
|
5655
|
+
* If set, disables auto-validation on blur.
|
|
5656
|
+
*/
|
|
5657
|
+
noValidate: {
|
|
5658
|
+
type: Boolean
|
|
5659
|
+
},
|
|
5660
|
+
|
|
5661
|
+
/**
|
|
5662
|
+
* Specifies a regular expression the form control's value should match.
|
|
5663
|
+
*/
|
|
5664
|
+
pattern: {
|
|
5665
|
+
type: String,
|
|
5492
5666
|
reflect: true
|
|
5493
5667
|
},
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5668
|
+
|
|
5669
|
+
/**
|
|
5670
|
+
* Define custom placeholder text, only supported by date input formats.
|
|
5671
|
+
*/
|
|
5672
|
+
placeholder: {
|
|
5673
|
+
type: String
|
|
5674
|
+
},
|
|
5675
|
+
|
|
5676
|
+
/**
|
|
5677
|
+
* Makes the input read-only, but can be set programmatically.
|
|
5678
|
+
*/
|
|
5679
|
+
readonly: {
|
|
5680
|
+
type: Boolean
|
|
5681
|
+
},
|
|
5682
|
+
|
|
5683
|
+
/**
|
|
5684
|
+
* Populates the `required` attribute on the input. Used for client-side validation.
|
|
5685
|
+
*/
|
|
5686
|
+
required: {
|
|
5687
|
+
type: Boolean
|
|
5688
|
+
},
|
|
5498
5689
|
|
|
5499
5690
|
/**
|
|
5500
5691
|
* @ignore
|
|
5501
5692
|
*/
|
|
5502
|
-
showPassword:
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5693
|
+
showPassword: {
|
|
5694
|
+
state: true
|
|
5695
|
+
},
|
|
5696
|
+
|
|
5697
|
+
/**
|
|
5698
|
+
* Sets a custom help text message to display for all validityStates.
|
|
5699
|
+
*/
|
|
5700
|
+
setCustomValidity: {
|
|
5701
|
+
type: String
|
|
5702
|
+
},
|
|
5703
|
+
|
|
5704
|
+
/**
|
|
5705
|
+
* Custom help text message to display when validity = `badInput`.
|
|
5706
|
+
*/
|
|
5707
|
+
setCustomValidityBadInput: {
|
|
5708
|
+
type: String
|
|
5709
|
+
},
|
|
5710
|
+
|
|
5711
|
+
/**
|
|
5712
|
+
* Custom help text message to display when validity = `customError`.
|
|
5713
|
+
*/
|
|
5714
|
+
setCustomValidityCustomError: {
|
|
5715
|
+
type: String
|
|
5716
|
+
},
|
|
5717
|
+
|
|
5718
|
+
/**
|
|
5719
|
+
* Custom help text message to display for the declared element `type` and type validity fails.
|
|
5720
|
+
*/
|
|
5721
|
+
setCustomValidityForType: {
|
|
5722
|
+
type: String
|
|
5723
|
+
},
|
|
5724
|
+
|
|
5725
|
+
/**
|
|
5726
|
+
* Custom help text message to display when validity = `rangeOverflow`.
|
|
5727
|
+
*/
|
|
5728
|
+
setCustomValidityRangeOverflow: {
|
|
5729
|
+
type: String
|
|
5730
|
+
},
|
|
5731
|
+
|
|
5732
|
+
/**
|
|
5733
|
+
* Custom help text message to display when validity = `rangeUnderflow`.
|
|
5734
|
+
*/
|
|
5735
|
+
setCustomValidityRangeUnderflow: {
|
|
5736
|
+
type: String
|
|
5737
|
+
},
|
|
5738
|
+
|
|
5739
|
+
/**
|
|
5740
|
+
* Custom help text message to display when validity = `tooLong`.
|
|
5741
|
+
*/
|
|
5742
|
+
setCustomValidityTooLong: {
|
|
5743
|
+
type: String
|
|
5744
|
+
},
|
|
5745
|
+
|
|
5746
|
+
/**
|
|
5747
|
+
* Custom help text message to display when validity = `tooShort`.
|
|
5748
|
+
*/
|
|
5749
|
+
setCustomValidityTooShort: {
|
|
5750
|
+
type: String
|
|
5751
|
+
},
|
|
5752
|
+
|
|
5753
|
+
/**
|
|
5754
|
+
* Custom help text message to display when validity = `valueMissing`.
|
|
5755
|
+
*/
|
|
5756
|
+
setCustomValidityValueMissing: {
|
|
5757
|
+
type: String
|
|
5758
|
+
},
|
|
5759
|
+
|
|
5760
|
+
/**
|
|
5761
|
+
* Custom help text message for email type validity.
|
|
5762
|
+
*/
|
|
5763
|
+
customValidityTypeEmail: {
|
|
5764
|
+
type: String
|
|
5765
|
+
},
|
|
5766
|
+
|
|
5767
|
+
/**
|
|
5768
|
+
* An enumerated attribute defines whether the element may be checked for spelling errors. [true, false]. When set to `false` the attribute `autocorrect` is set to `off` and `autocapitalize` is set to `none`.
|
|
5769
|
+
*/
|
|
5770
|
+
spellcheck: {
|
|
5771
|
+
type: String
|
|
5772
|
+
},
|
|
5773
|
+
|
|
5774
|
+
/**
|
|
5775
|
+
* Populates the `type` attribute on the input. Allowed values are `password`, `email`, `credit-card`, `month-day-year`, `month-year`, `year-month-day` or `text`. If given value is not allowed or set, defaults to `text`.
|
|
5776
|
+
*/
|
|
5777
|
+
type: {
|
|
5506
5778
|
type: String,
|
|
5507
5779
|
reflect: true
|
|
5508
5780
|
},
|
|
5509
|
-
|
|
5510
|
-
|
|
5781
|
+
|
|
5782
|
+
/**
|
|
5783
|
+
* Populates the `value` attribute on the input. Can also be read to retrieve the current value of the input.
|
|
5784
|
+
*/
|
|
5785
|
+
value: {
|
|
5786
|
+
type: String
|
|
5787
|
+
},
|
|
5788
|
+
|
|
5789
|
+
/**
|
|
5790
|
+
* Sets validation mode to re-eval with each input.
|
|
5791
|
+
*/
|
|
5792
|
+
validateOnInput: {
|
|
5793
|
+
type: Boolean
|
|
5794
|
+
},
|
|
5795
|
+
|
|
5796
|
+
/**
|
|
5797
|
+
* Specifies the `validityState` this element is in.
|
|
5798
|
+
*/
|
|
5799
|
+
validity: {
|
|
5511
5800
|
type: String,
|
|
5512
5801
|
reflect: true
|
|
5513
|
-
}
|
|
5514
|
-
setCustomValidity: { type: String },
|
|
5515
|
-
setCustomValidityCustomError: { type: String },
|
|
5516
|
-
setCustomValidityValueMissing: { type: String },
|
|
5517
|
-
setCustomValidityBadInput: { type: String },
|
|
5518
|
-
setCustomValidityTooShort: { type: String },
|
|
5519
|
-
setCustomValidityTooLong: { type: String },
|
|
5520
|
-
setCustomValidityRangeOverflow: { type: String},
|
|
5521
|
-
setCustomValidityRangeUnderflow: { type: String},
|
|
5522
|
-
customValidityTypeEmail: { type: String }
|
|
5802
|
+
}
|
|
5523
5803
|
};
|
|
5524
5804
|
}
|
|
5525
5805
|
|
|
5806
|
+
|
|
5526
5807
|
static get styles() {
|
|
5527
5808
|
return [
|
|
5528
|
-
i$2`${styleCss$3$1}`,
|
|
5529
5809
|
i$2`${colorCss$3}`,
|
|
5810
|
+
i$2`${styleCss$3$1}`,
|
|
5530
5811
|
i$2`${tokensCss$3}`
|
|
5531
5812
|
];
|
|
5532
5813
|
}
|
|
@@ -6147,7 +6428,7 @@ class BaseInput extends r {
|
|
|
6147
6428
|
this.maxLength = card.formatLength;
|
|
6148
6429
|
this.minLength = card.formatMinLength;
|
|
6149
6430
|
|
|
6150
|
-
this.
|
|
6431
|
+
this.errorMessage = card.errorMessage;
|
|
6151
6432
|
|
|
6152
6433
|
if (this.icon) {
|
|
6153
6434
|
this.inputIconName = card.cardIcon;
|
|
@@ -6167,63 +6448,63 @@ class BaseInput extends r {
|
|
|
6167
6448
|
name: 'Airlines',
|
|
6168
6449
|
regex: /^(?<num>1|2)\d{0}/u,
|
|
6169
6450
|
formatMinLength: 17,
|
|
6170
|
-
|
|
6451
|
+
errorMessage: CreditCardValidationMessage,
|
|
6171
6452
|
cardIcon: 'credit-card'
|
|
6172
6453
|
},
|
|
6173
6454
|
{
|
|
6174
6455
|
name: 'Commercial',
|
|
6175
6456
|
regex: /^(?<num>2)\d{0}/u,
|
|
6176
6457
|
formatMinLength: 8,
|
|
6177
|
-
|
|
6458
|
+
errorMessage: CreditCardValidationMessage,
|
|
6178
6459
|
cardIcon: 'credit-card'
|
|
6179
6460
|
},
|
|
6180
6461
|
{
|
|
6181
6462
|
name: 'Alaska Commercial',
|
|
6182
6463
|
regex: /^(?<num>27)\d{0}/u,
|
|
6183
6464
|
formatMinLength: 8,
|
|
6184
|
-
|
|
6465
|
+
errorMessage: CreditCardValidationMessage,
|
|
6185
6466
|
cardIcon: 'cc-alaska'
|
|
6186
6467
|
},
|
|
6187
6468
|
{
|
|
6188
6469
|
name: 'American Express',
|
|
6189
6470
|
regex: /^(?<num>34|37)\d{0}/u,
|
|
6190
6471
|
formatLength: 17,
|
|
6191
|
-
|
|
6472
|
+
errorMessage: CreditCardValidationMessage,
|
|
6192
6473
|
cardIcon: 'cc-amex'
|
|
6193
6474
|
},
|
|
6194
6475
|
{
|
|
6195
6476
|
name: 'Diners club',
|
|
6196
6477
|
regex: /^(?<num>36|38)\d{0}/u,
|
|
6197
6478
|
formatLength: 16,
|
|
6198
|
-
|
|
6479
|
+
errorMessage: CreditCardValidationMessage,
|
|
6199
6480
|
cardIcon: 'credit-card'
|
|
6200
6481
|
},
|
|
6201
6482
|
{
|
|
6202
6483
|
name: 'Visa',
|
|
6203
6484
|
regex: /^(?<num>4)\d{0}/u,
|
|
6204
6485
|
formatLength: 19,
|
|
6205
|
-
|
|
6486
|
+
errorMessage: CreditCardValidationMessage,
|
|
6206
6487
|
cardIcon: 'cc-visa'
|
|
6207
6488
|
},
|
|
6208
6489
|
{
|
|
6209
6490
|
name: 'Alaska Airlines Visa',
|
|
6210
6491
|
regex: /^(?<num>4147\s34|4888\s93|4800\s11|4313\s51|4313\s07)\d{0}/u,
|
|
6211
6492
|
formatLength: 19,
|
|
6212
|
-
|
|
6493
|
+
errorMessage: CreditCardValidationMessage,
|
|
6213
6494
|
cardIcon: 'cc-alaska'
|
|
6214
6495
|
},
|
|
6215
6496
|
{
|
|
6216
6497
|
name: 'Master Card',
|
|
6217
6498
|
regex: /^(?<num>5)\d{0}/u,
|
|
6218
6499
|
formatLength: 19,
|
|
6219
|
-
|
|
6500
|
+
errorMessage: CreditCardValidationMessage,
|
|
6220
6501
|
cardIcon: 'cc-mastercard'
|
|
6221
6502
|
},
|
|
6222
6503
|
{
|
|
6223
6504
|
name: 'Discover Card',
|
|
6224
6505
|
regex: /^(?<num>6)\d{0}/u,
|
|
6225
6506
|
formatLength: 19,
|
|
6226
|
-
|
|
6507
|
+
errorMessage: CreditCardValidationMessage,
|
|
6227
6508
|
cardIcon: 'cc-discover'
|
|
6228
6509
|
}
|
|
6229
6510
|
];
|
|
@@ -6231,7 +6512,7 @@ class BaseInput extends r {
|
|
|
6231
6512
|
let type = {
|
|
6232
6513
|
name: 'Default Card',
|
|
6233
6514
|
formatLength: 19,
|
|
6234
|
-
|
|
6515
|
+
errorMessage: CreditCardValidationMessage,
|
|
6235
6516
|
cardIcon: 'credit-card'
|
|
6236
6517
|
};
|
|
6237
6518
|
|
|
@@ -7256,7 +7537,6 @@ class AuroInput extends BaseInput {
|
|
|
7256
7537
|
<p class="inputElement-helpText" id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
7257
7538
|
${this.errorMessage}
|
|
7258
7539
|
</p>`
|
|
7259
|
-
|
|
7260
7540
|
}
|
|
7261
7541
|
`;
|
|
7262
7542
|
}
|
|
@@ -7277,9 +7557,11 @@ var styleCss$3 = i$c`.util_displayInline{display:inline}.util_displayInlineBlock
|
|
|
7277
7557
|
* @prop {Object} optionSelected - Specifies the current selected option.
|
|
7278
7558
|
* @prop {String} value - Value selected for the dropdown menu.
|
|
7279
7559
|
* @prop {Boolean} checkmark - When attribute is present auro-menu will apply checkmarks to selected options.
|
|
7280
|
-
* @attr {
|
|
7560
|
+
* @attr {String} error - When defined, sets persistent validity to `customError` and sets the validation message to the attribute value.
|
|
7281
7561
|
* @attr {String} validity - Specifies the `validityState` this element is in.
|
|
7282
7562
|
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validityStates.
|
|
7563
|
+
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
7564
|
+
* @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
|
|
7283
7565
|
* @attr {Boolean} disabled - If set, disables the combobox.
|
|
7284
7566
|
* @attr {Boolean} noFilter - If set, combobox will not filter menuoptions based in input.
|
|
7285
7567
|
* @attr {Boolean} noValidate - If set, disables auto-validation on blur.
|
|
@@ -7345,12 +7627,17 @@ class AuroCombobox extends r$6 {
|
|
|
7345
7627
|
return {
|
|
7346
7628
|
// ...super.properties,
|
|
7347
7629
|
error: {
|
|
7348
|
-
type:
|
|
7630
|
+
type: String,
|
|
7349
7631
|
reflect: true
|
|
7350
7632
|
},
|
|
7351
7633
|
setCustomValidity: {
|
|
7352
|
-
type: String
|
|
7353
|
-
|
|
7634
|
+
type: String
|
|
7635
|
+
},
|
|
7636
|
+
setCustomValidityCustomError: {
|
|
7637
|
+
type: String
|
|
7638
|
+
},
|
|
7639
|
+
setCustomValidityValueMissing: {
|
|
7640
|
+
type: String
|
|
7354
7641
|
},
|
|
7355
7642
|
validity: {
|
|
7356
7643
|
type: String,
|
|
@@ -7634,9 +7921,7 @@ class AuroCombobox extends r$6 {
|
|
|
7634
7921
|
});
|
|
7635
7922
|
|
|
7636
7923
|
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
7637
|
-
this.
|
|
7638
|
-
this.value = undefined;
|
|
7639
|
-
this.validation.validate(this);
|
|
7924
|
+
this.reset();
|
|
7640
7925
|
});
|
|
7641
7926
|
}
|
|
7642
7927
|
|
|
@@ -7714,7 +7999,7 @@ class AuroCombobox extends r$6 {
|
|
|
7714
7999
|
});
|
|
7715
8000
|
|
|
7716
8001
|
this.input.addEventListener('auroFormElement-validated', (evt) => {
|
|
7717
|
-
this.
|
|
8002
|
+
this.errorMessage = evt.detail.message;
|
|
7718
8003
|
});
|
|
7719
8004
|
}
|
|
7720
8005
|
|
|
@@ -7858,9 +8143,6 @@ class AuroCombobox extends r$6 {
|
|
|
7858
8143
|
* @returns {void}
|
|
7859
8144
|
*/
|
|
7860
8145
|
reset() {
|
|
7861
|
-
// Resets the help text of the combobox
|
|
7862
|
-
this.auroInputHelpText = undefined;
|
|
7863
|
-
|
|
7864
8146
|
this.input.reset();
|
|
7865
8147
|
this.validation.reset(this);
|
|
7866
8148
|
}
|
|
@@ -7893,10 +8175,6 @@ class AuroCombobox extends r$6 {
|
|
|
7893
8175
|
this.input.setAttribute('error', this.getAttribute('error'));
|
|
7894
8176
|
this.validation.validate(this);
|
|
7895
8177
|
}
|
|
7896
|
-
|
|
7897
|
-
if (changedProperties.has('setCustomValidity')) {
|
|
7898
|
-
this.input.setAttribute('setCustomValidity', this.setCustomValidity);
|
|
7899
|
-
}
|
|
7900
8178
|
}
|
|
7901
8179
|
|
|
7902
8180
|
/**
|
|
@@ -7950,19 +8228,23 @@ class AuroCombobox extends r$6 {
|
|
|
7950
8228
|
?noValidate="${this.noValidate}"
|
|
7951
8229
|
?disabled="${this.disabled}"
|
|
7952
8230
|
?icon="${this.triggerIcon}"
|
|
8231
|
+
setCustomValidity="${this.setCustomValidity}"
|
|
8232
|
+
setCustomValidityValueMissing="${this.setCustomValidityValueMissing}"
|
|
8233
|
+
setCustomValidityCustomError="${this.setCustomValidityCustomError}"
|
|
7953
8234
|
.type="${this.type}">
|
|
7954
8235
|
<slot name="label" slot="label"></slot>
|
|
7955
8236
|
</${this.inputTag}>
|
|
7956
8237
|
<div class="menuWrapper">
|
|
7957
8238
|
</div>
|
|
7958
8239
|
<span slot="helpText">
|
|
7959
|
-
|
|
8240
|
+
<!-- Help text and error message template -->
|
|
8241
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
7960
8242
|
? u$6`
|
|
7961
|
-
${this.auroInputHelpText}
|
|
7962
|
-
`
|
|
7963
|
-
: u$6`
|
|
7964
8243
|
<slot name="helpText"></slot>
|
|
7965
|
-
`
|
|
8244
|
+
` : u$6`
|
|
8245
|
+
<p role="alert" aria-live="assertive" part="helpText">
|
|
8246
|
+
${this.errorMessage}
|
|
8247
|
+
</p>`
|
|
7966
8248
|
}
|
|
7967
8249
|
</span>
|
|
7968
8250
|
</${this.dropdownTag}>
|
|
@@ -7994,8 +8276,8 @@ var tokensCss$1 = i$c`:host{--ds-auro-menu-divider-color: var(--ds-color-border-
|
|
|
7994
8276
|
* @event auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
|
|
7995
8277
|
* @event auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
7996
8278
|
* @event auroMenu-selectValueFailure - Notifies that a an attempt to select a menuoption by matching a value has failed.
|
|
7997
|
-
* @event auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
7998
8279
|
* @event auroMenu-selectValueReset - Notifies that the component value has been reset.
|
|
8280
|
+
* @event auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
7999
8281
|
* @event auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
8000
8282
|
* @slot loadingText - Text to show while loading attribute is set
|
|
8001
8283
|
* @slot loadingIcon - Icon to show while loading attribute is set
|