@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.50 → 0.0.0-pr624.52
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/components/bibtemplate/dist/index.js +1 -1
- package/components/bibtemplate/dist/registered.js +1 -1
- package/components/checkbox/demo/api.min.js +5 -5
- package/components/checkbox/demo/index.min.js +5 -5
- package/components/checkbox/dist/index.js +5 -5
- package/components/checkbox/dist/registered.js +5 -5
- package/components/combobox/demo/api.min.js +69 -86
- package/components/combobox/demo/index.min.js +69 -86
- package/components/combobox/dist/index.js +33 -75
- package/components/combobox/dist/registered.js +33 -75
- package/components/counter/demo/api.md +127 -0
- package/components/counter/demo/api.min.js +548 -385
- package/components/counter/demo/index.md +82 -0
- package/components/counter/demo/index.min.js +548 -385
- package/components/counter/dist/auro-counter-group.d.ts +70 -13
- package/components/counter/dist/auro-counter.d.ts +10 -0
- package/components/counter/dist/index.js +548 -385
- package/components/counter/dist/registered.js +548 -385
- package/components/datepicker/demo/api.min.js +54 -81
- package/components/datepicker/demo/index.min.js +54 -81
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -0
- package/components/datepicker/dist/index.js +54 -81
- package/components/datepicker/dist/registered.js +54 -81
- package/components/dropdown/demo/api.md +59 -265
- package/components/dropdown/demo/api.min.js +22 -64
- package/components/dropdown/demo/index.md +45 -363
- package/components/dropdown/demo/index.min.js +22 -64
- package/components/dropdown/dist/auro-dropdown.d.ts +21 -71
- package/components/dropdown/dist/index.js +22 -64
- package/components/dropdown/dist/registered.js +22 -64
- package/components/input/demo/api.min.js +5 -5
- package/components/input/demo/index.min.js +5 -5
- package/components/input/dist/index.js +5 -5
- package/components/input/dist/registered.js +5 -5
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/api.min.js +36 -11
- package/components/menu/demo/index.min.js +36 -11
- package/components/menu/dist/auro-menu.d.ts +13 -2
- package/components/menu/dist/index.js +36 -11
- package/components/menu/dist/registered.js +36 -11
- package/components/radio/demo/api.min.js +6 -6
- package/components/radio/demo/index.min.js +6 -6
- package/components/radio/dist/auro-radio.d.ts +1 -1
- package/components/radio/dist/index.js +6 -6
- package/components/radio/dist/registered.js +6 -6
- package/components/select/demo/api.md +2 -2
- package/components/select/demo/api.min.js +94 -164
- package/components/select/demo/index.min.js +94 -164
- package/components/select/dist/auro-select.d.ts +13 -3
- package/components/select/dist/index.js +58 -153
- package/components/select/dist/registered.js +58 -153
- package/package.json +1 -1
|
@@ -266,7 +266,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
266
266
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
267
267
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
268
268
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
269
|
-
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
270
269
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
271
270
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
272
271
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -379,9 +378,14 @@ class AuroMenu extends AuroElement$1 {
|
|
|
379
378
|
reflect: true,
|
|
380
379
|
attribute: 'multiselect'
|
|
381
380
|
},
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Value selected for the component.
|
|
384
|
+
*/
|
|
382
385
|
value: {
|
|
383
|
-
|
|
384
|
-
|
|
386
|
+
type: String,
|
|
387
|
+
reflect: true,
|
|
388
|
+
attribute: 'value'
|
|
385
389
|
},
|
|
386
390
|
|
|
387
391
|
/**
|
|
@@ -416,6 +420,25 @@ class AuroMenu extends AuroElement$1 {
|
|
|
416
420
|
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
|
|
417
421
|
}
|
|
418
422
|
|
|
423
|
+
/**
|
|
424
|
+
* Formatted value based on `multiSelect` state.
|
|
425
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
426
|
+
* @private
|
|
427
|
+
* @returns {String|Array<String>}
|
|
428
|
+
*/
|
|
429
|
+
get formattedValue() {
|
|
430
|
+
if (this.multiSelect) {
|
|
431
|
+
if (!this.value) {
|
|
432
|
+
return undefined;
|
|
433
|
+
}
|
|
434
|
+
if (this.value.startsWith("[")) {
|
|
435
|
+
return JSON.parse(this.value);
|
|
436
|
+
}
|
|
437
|
+
return [this.value];
|
|
438
|
+
}
|
|
439
|
+
return this.value;
|
|
440
|
+
}
|
|
441
|
+
|
|
419
442
|
// Lifecycle Methods
|
|
420
443
|
|
|
421
444
|
connectedCallback() {
|
|
@@ -458,7 +481,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
458
481
|
updated(changedProperties) {
|
|
459
482
|
super.updated(changedProperties);
|
|
460
483
|
|
|
461
|
-
if (changedProperties.has('multiSelect')) {
|
|
484
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
462
485
|
// Reset selection if multiSelect mode changes
|
|
463
486
|
this.clearSelection();
|
|
464
487
|
}
|
|
@@ -472,7 +495,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
472
495
|
} else {
|
|
473
496
|
if (this.multiSelect) {
|
|
474
497
|
// In multiselect mode, this.value should be an array of strings
|
|
475
|
-
const valueArray =
|
|
498
|
+
const valueArray = this.formattedValue;
|
|
476
499
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
477
500
|
|
|
478
501
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -639,14 +662,14 @@ class AuroMenu extends AuroElement$1 {
|
|
|
639
662
|
*/
|
|
640
663
|
handleSelectState(option) {
|
|
641
664
|
if (this.multiSelect) {
|
|
642
|
-
const currentValue = this.
|
|
665
|
+
const currentValue = this.formattedValue || [];
|
|
643
666
|
const currentSelected = this.optionSelected || [];
|
|
644
667
|
|
|
645
668
|
if (!currentValue.includes(option.value)) {
|
|
646
|
-
this.value = [
|
|
669
|
+
this.value = JSON.stringify([
|
|
647
670
|
...currentValue,
|
|
648
671
|
option.value
|
|
649
|
-
];
|
|
672
|
+
]);
|
|
650
673
|
}
|
|
651
674
|
if (!currentSelected.includes(option)) {
|
|
652
675
|
this.optionSelected = [
|
|
@@ -669,13 +692,15 @@ class AuroMenu extends AuroElement$1 {
|
|
|
669
692
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
670
693
|
*/
|
|
671
694
|
handleDeselectState(option) {
|
|
672
|
-
if (this.multiSelect
|
|
695
|
+
if (this.multiSelect) {
|
|
673
696
|
// Remove this option from array
|
|
674
|
-
|
|
697
|
+
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
675
698
|
|
|
676
699
|
// If array is empty after removal, set back to undefined
|
|
677
|
-
if (
|
|
700
|
+
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
678
701
|
this.value = undefined;
|
|
702
|
+
} else {
|
|
703
|
+
this.value = JSON.stringify(newFormattedValue);
|
|
679
704
|
}
|
|
680
705
|
|
|
681
706
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
@@ -225,7 +225,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
225
225
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
226
226
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
227
227
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
228
|
-
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
229
228
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
230
229
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
231
230
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -338,9 +337,14 @@ class AuroMenu extends AuroElement$1 {
|
|
|
338
337
|
reflect: true,
|
|
339
338
|
attribute: 'multiselect'
|
|
340
339
|
},
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Value selected for the component.
|
|
343
|
+
*/
|
|
341
344
|
value: {
|
|
342
|
-
|
|
343
|
-
|
|
345
|
+
type: String,
|
|
346
|
+
reflect: true,
|
|
347
|
+
attribute: 'value'
|
|
344
348
|
},
|
|
345
349
|
|
|
346
350
|
/**
|
|
@@ -375,6 +379,25 @@ class AuroMenu extends AuroElement$1 {
|
|
|
375
379
|
AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
|
|
376
380
|
}
|
|
377
381
|
|
|
382
|
+
/**
|
|
383
|
+
* Formatted value based on `multiSelect` state.
|
|
384
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
385
|
+
* @private
|
|
386
|
+
* @returns {String|Array<String>}
|
|
387
|
+
*/
|
|
388
|
+
get formattedValue() {
|
|
389
|
+
if (this.multiSelect) {
|
|
390
|
+
if (!this.value) {
|
|
391
|
+
return undefined;
|
|
392
|
+
}
|
|
393
|
+
if (this.value.startsWith("[")) {
|
|
394
|
+
return JSON.parse(this.value);
|
|
395
|
+
}
|
|
396
|
+
return [this.value];
|
|
397
|
+
}
|
|
398
|
+
return this.value;
|
|
399
|
+
}
|
|
400
|
+
|
|
378
401
|
// Lifecycle Methods
|
|
379
402
|
|
|
380
403
|
connectedCallback() {
|
|
@@ -417,7 +440,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
417
440
|
updated(changedProperties) {
|
|
418
441
|
super.updated(changedProperties);
|
|
419
442
|
|
|
420
|
-
if (changedProperties.has('multiSelect')) {
|
|
443
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
421
444
|
// Reset selection if multiSelect mode changes
|
|
422
445
|
this.clearSelection();
|
|
423
446
|
}
|
|
@@ -431,7 +454,7 @@ class AuroMenu extends AuroElement$1 {
|
|
|
431
454
|
} else {
|
|
432
455
|
if (this.multiSelect) {
|
|
433
456
|
// In multiselect mode, this.value should be an array of strings
|
|
434
|
-
const valueArray =
|
|
457
|
+
const valueArray = this.formattedValue;
|
|
435
458
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
436
459
|
|
|
437
460
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -598,14 +621,14 @@ class AuroMenu extends AuroElement$1 {
|
|
|
598
621
|
*/
|
|
599
622
|
handleSelectState(option) {
|
|
600
623
|
if (this.multiSelect) {
|
|
601
|
-
const currentValue = this.
|
|
624
|
+
const currentValue = this.formattedValue || [];
|
|
602
625
|
const currentSelected = this.optionSelected || [];
|
|
603
626
|
|
|
604
627
|
if (!currentValue.includes(option.value)) {
|
|
605
|
-
this.value = [
|
|
628
|
+
this.value = JSON.stringify([
|
|
606
629
|
...currentValue,
|
|
607
630
|
option.value
|
|
608
|
-
];
|
|
631
|
+
]);
|
|
609
632
|
}
|
|
610
633
|
if (!currentSelected.includes(option)) {
|
|
611
634
|
this.optionSelected = [
|
|
@@ -628,13 +651,15 @@ class AuroMenu extends AuroElement$1 {
|
|
|
628
651
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
629
652
|
*/
|
|
630
653
|
handleDeselectState(option) {
|
|
631
|
-
if (this.multiSelect
|
|
654
|
+
if (this.multiSelect) {
|
|
632
655
|
// Remove this option from array
|
|
633
|
-
|
|
656
|
+
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
634
657
|
|
|
635
658
|
// If array is empty after removal, set back to undefined
|
|
636
|
-
if (
|
|
659
|
+
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
637
660
|
this.value = undefined;
|
|
661
|
+
} else {
|
|
662
|
+
this.value = JSON.stringify(newFormattedValue);
|
|
638
663
|
}
|
|
639
664
|
|
|
640
665
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
@@ -246,8 +246,8 @@ class AuroRadio extends i$2 {
|
|
|
246
246
|
},
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
|
+
* Do not add to api doc since changing of this can easily break a11y.
|
|
249
250
|
* @private
|
|
250
|
-
* not to add to api.md since changing of this can easily break a11y.
|
|
251
251
|
*/
|
|
252
252
|
role: {
|
|
253
253
|
type: String,
|
|
@@ -923,19 +923,19 @@ class AuroFormValidation {
|
|
|
923
923
|
{
|
|
924
924
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
925
925
|
validity: 'tooShort',
|
|
926
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
926
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
927
927
|
},
|
|
928
928
|
{
|
|
929
929
|
check: (e) => e.value?.length > e.maxLength,
|
|
930
930
|
validity: 'tooLong',
|
|
931
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
931
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
932
932
|
}
|
|
933
933
|
],
|
|
934
934
|
pattern: [
|
|
935
935
|
{
|
|
936
936
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
937
937
|
validity: 'patternMismatch',
|
|
938
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
938
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
939
939
|
}
|
|
940
940
|
]
|
|
941
941
|
},
|
|
@@ -1130,10 +1130,10 @@ class AuroFormValidation {
|
|
|
1130
1130
|
if (!hasValue && elem.required && elem.touched) {
|
|
1131
1131
|
elem.validity = 'valueMissing';
|
|
1132
1132
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
1133
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1133
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1134
1134
|
this.validateType(elem);
|
|
1135
1135
|
this.validateElementAttributes(elem);
|
|
1136
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
1136
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1137
1137
|
this.validateElementAttributes(elem);
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
@@ -221,8 +221,8 @@ class AuroRadio extends i$2 {
|
|
|
221
221
|
},
|
|
222
222
|
|
|
223
223
|
/**
|
|
224
|
+
* Do not add to api doc since changing of this can easily break a11y.
|
|
224
225
|
* @private
|
|
225
|
-
* not to add to api.md since changing of this can easily break a11y.
|
|
226
226
|
*/
|
|
227
227
|
role: {
|
|
228
228
|
type: String,
|
|
@@ -898,19 +898,19 @@ class AuroFormValidation {
|
|
|
898
898
|
{
|
|
899
899
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
900
900
|
validity: 'tooShort',
|
|
901
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
901
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
902
902
|
},
|
|
903
903
|
{
|
|
904
904
|
check: (e) => e.value?.length > e.maxLength,
|
|
905
905
|
validity: 'tooLong',
|
|
906
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
906
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
907
907
|
}
|
|
908
908
|
],
|
|
909
909
|
pattern: [
|
|
910
910
|
{
|
|
911
911
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
912
912
|
validity: 'patternMismatch',
|
|
913
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
913
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
914
914
|
}
|
|
915
915
|
]
|
|
916
916
|
},
|
|
@@ -1105,10 +1105,10 @@ class AuroFormValidation {
|
|
|
1105
1105
|
if (!hasValue && elem.required && elem.touched) {
|
|
1106
1106
|
elem.validity = 'valueMissing';
|
|
1107
1107
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
1108
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1108
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1109
1109
|
this.validateType(elem);
|
|
1110
1110
|
this.validateElementAttributes(elem);
|
|
1111
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
1111
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1112
1112
|
this.validateElementAttributes(elem);
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
@@ -69,8 +69,8 @@ export class AuroRadio extends LitElement {
|
|
|
69
69
|
attribute: boolean;
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
|
+
* Do not add to api doc since changing of this can easily break a11y.
|
|
72
73
|
* @private
|
|
73
|
-
* not to add to api.md since changing of this can easily break a11y.
|
|
74
74
|
*/
|
|
75
75
|
role: {
|
|
76
76
|
type: StringConstructor;
|
|
@@ -181,8 +181,8 @@ class AuroRadio extends LitElement {
|
|
|
181
181
|
},
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
|
+
* Do not add to api doc since changing of this can easily break a11y.
|
|
184
185
|
* @private
|
|
185
|
-
* not to add to api.md since changing of this can easily break a11y.
|
|
186
186
|
*/
|
|
187
187
|
role: {
|
|
188
188
|
type: String,
|
|
@@ -851,19 +851,19 @@ class AuroFormValidation {
|
|
|
851
851
|
{
|
|
852
852
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
853
853
|
validity: 'tooShort',
|
|
854
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
854
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
855
855
|
},
|
|
856
856
|
{
|
|
857
857
|
check: (e) => e.value?.length > e.maxLength,
|
|
858
858
|
validity: 'tooLong',
|
|
859
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
859
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
860
860
|
}
|
|
861
861
|
],
|
|
862
862
|
pattern: [
|
|
863
863
|
{
|
|
864
864
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
865
865
|
validity: 'patternMismatch',
|
|
866
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
866
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
867
867
|
}
|
|
868
868
|
]
|
|
869
869
|
},
|
|
@@ -1058,10 +1058,10 @@ class AuroFormValidation {
|
|
|
1058
1058
|
if (!hasValue && elem.required && elem.touched) {
|
|
1059
1059
|
elem.validity = 'valueMissing';
|
|
1060
1060
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
1061
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1061
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1062
1062
|
this.validateType(elem);
|
|
1063
1063
|
this.validateElementAttributes(elem);
|
|
1064
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
1064
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1065
1065
|
this.validateElementAttributes(elem);
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
@@ -181,8 +181,8 @@ class AuroRadio extends LitElement {
|
|
|
181
181
|
},
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
|
+
* Do not add to api doc since changing of this can easily break a11y.
|
|
184
185
|
* @private
|
|
185
|
-
* not to add to api.md since changing of this can easily break a11y.
|
|
186
186
|
*/
|
|
187
187
|
role: {
|
|
188
188
|
type: String,
|
|
@@ -851,19 +851,19 @@ class AuroFormValidation {
|
|
|
851
851
|
{
|
|
852
852
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
853
853
|
validity: 'tooShort',
|
|
854
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
854
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
855
855
|
},
|
|
856
856
|
{
|
|
857
857
|
check: (e) => e.value?.length > e.maxLength,
|
|
858
858
|
validity: 'tooLong',
|
|
859
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
859
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
860
860
|
}
|
|
861
861
|
],
|
|
862
862
|
pattern: [
|
|
863
863
|
{
|
|
864
864
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
865
865
|
validity: 'patternMismatch',
|
|
866
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
866
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
867
867
|
}
|
|
868
868
|
]
|
|
869
869
|
},
|
|
@@ -1058,10 +1058,10 @@ class AuroFormValidation {
|
|
|
1058
1058
|
if (!hasValue && elem.required && elem.touched) {
|
|
1059
1059
|
elem.validity = 'valueMissing';
|
|
1060
1060
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
1061
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1061
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1062
1062
|
this.validateType(elem);
|
|
1063
1063
|
this.validateElementAttributes(elem);
|
|
1064
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
1064
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1065
1065
|
this.validateElementAttributes(elem);
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
@@ -42,7 +42,7 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
42
42
|
| [shape](#shape) | | `string` | "snowflake" | |
|
|
43
43
|
| [size](#size) | | `string` | "xl" | |
|
|
44
44
|
| [validity](#validity) | `validity` | `string` | | Specifies the `validityState` this element is in. |
|
|
45
|
-
| [value](#value) | `value` | `
|
|
45
|
+
| [value](#value) | `value` | `string` | | Value selected for the component. |
|
|
46
46
|
|
|
47
47
|
## Methods
|
|
48
48
|
|
|
@@ -57,7 +57,7 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
|
|
|
57
57
|
|-----------------------------|--------------------------------------------------|--------------------------------------------------|
|
|
58
58
|
| `auroFormElement-validated` | | Notifies that the `validity` and `errorMessage` values have changed. |
|
|
59
59
|
| `auroSelect-valueSet` | `CustomEvent<any>` | Notifies that the component has a new value set. |
|
|
60
|
-
| [input](#input) | `CustomEvent<{ optionSelected: any; value:
|
|
60
|
+
| [input](#input) | `CustomEvent<{ optionSelected: any; value: string \| string[]; }>` | Notifies every time the value prop of the element is changed. The updated `value` and `optionSelected` will be delivered in `detail` object. |
|
|
61
61
|
|
|
62
62
|
## Slots
|
|
63
63
|
|