@aurodesignsystem-dev/auro-formkit 0.0.0-pr783.1 → 0.0.0-pr784.0
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/checkbox/demo/api.min.js +16 -5
- package/components/checkbox/demo/index.min.js +16 -5
- package/components/checkbox/dist/index.js +16 -5
- package/components/checkbox/dist/registered.js +16 -5
- package/components/combobox/demo/api.md +1 -0
- package/components/combobox/demo/api.min.js +69 -48
- package/components/combobox/demo/index.min.js +69 -48
- package/components/combobox/dist/auro-combobox.d.ts +5 -0
- package/components/combobox/dist/index.js +69 -48
- package/components/combobox/dist/registered.js +69 -48
- package/components/counter/demo/api.min.js +32 -39
- package/components/counter/demo/index.min.js +32 -39
- package/components/counter/dist/index.js +32 -39
- package/components/counter/dist/registered.js +32 -39
- package/components/datepicker/demo/api.md +2 -0
- package/components/datepicker/demo/api.min.js +69 -107
- package/components/datepicker/demo/index.min.js +69 -107
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -19
- package/components/datepicker/dist/index.js +69 -107
- package/components/datepicker/dist/registered.js +69 -107
- package/components/dropdown/demo/api.min.js +16 -33
- package/components/dropdown/demo/index.min.js +16 -33
- package/components/dropdown/dist/auro-dropdown.d.ts +0 -6
- package/components/dropdown/dist/index.js +16 -33
- package/components/dropdown/dist/registered.js +16 -33
- package/components/input/demo/api.md +2 -1
- package/components/input/demo/api.min.js +25 -7
- package/components/input/demo/index.min.js +25 -7
- package/components/input/dist/base-input.d.ts +5 -1
- package/components/input/dist/index.js +25 -7
- package/components/input/dist/registered.js +25 -7
- package/components/radio/demo/api.min.js +16 -5
- package/components/radio/demo/index.min.js +16 -5
- package/components/radio/dist/index.js +16 -5
- package/components/radio/dist/registered.js +16 -5
- package/components/select/demo/api.min.js +32 -38
- package/components/select/demo/index.min.js +32 -38
- package/components/select/dist/index.js +32 -38
- package/components/select/dist/registered.js +32 -38
- package/package.json +2 -2
|
@@ -812,13 +812,24 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
812
812
|
this.getInputElements(elem);
|
|
813
813
|
this.getAuroInputs(elem);
|
|
814
814
|
|
|
815
|
-
//
|
|
815
|
+
// Check if validation should run
|
|
816
816
|
let validationShouldRun =
|
|
817
|
+
|
|
818
|
+
// If the validation was forced
|
|
817
819
|
force ||
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
820
|
+
|
|
821
|
+
// If the validation should run on input
|
|
822
|
+
elem.validateOnInput ||
|
|
823
|
+
|
|
824
|
+
// State-based checks
|
|
825
|
+
(
|
|
826
|
+
// Element is not currently focused
|
|
827
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
828
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
829
|
+
|
|
830
|
+
// And element has been touched or is untouched but has a value
|
|
831
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
832
|
+
);
|
|
822
833
|
|
|
823
834
|
if (elem.hasAttribute('error')) {
|
|
824
835
|
elem.validity = 'customError';
|
|
@@ -2646,7 +2657,7 @@ class AuroFloatingUI {
|
|
|
2646
2657
|
*/
|
|
2647
2658
|
mirrorSize() {
|
|
2648
2659
|
// mirror the boxsize from bibSizer
|
|
2649
|
-
if (this.element.bibSizer
|
|
2660
|
+
if (this.element.bibSizer) {
|
|
2650
2661
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2651
2662
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2652
2663
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2858,13 +2869,13 @@ class AuroFloatingUI {
|
|
|
2858
2869
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2859
2870
|
return;
|
|
2860
2871
|
}
|
|
2861
|
-
|
|
2872
|
+
|
|
2862
2873
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2863
2874
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2864
2875
|
return;
|
|
2865
2876
|
}
|
|
2866
2877
|
|
|
2867
|
-
this.hideBib(
|
|
2878
|
+
this.hideBib();
|
|
2868
2879
|
}
|
|
2869
2880
|
|
|
2870
2881
|
setupHideHandlers() {
|
|
@@ -2889,7 +2900,7 @@ class AuroFloatingUI {
|
|
|
2889
2900
|
document.expandedAuroFormkitDropdown = null;
|
|
2890
2901
|
document.expandedAuroFloater = this;
|
|
2891
2902
|
} else {
|
|
2892
|
-
this.hideBib(
|
|
2903
|
+
this.hideBib();
|
|
2893
2904
|
}
|
|
2894
2905
|
}
|
|
2895
2906
|
};
|
|
@@ -2902,7 +2913,7 @@ class AuroFloatingUI {
|
|
|
2902
2913
|
// if something else is open, let it handle itself
|
|
2903
2914
|
return;
|
|
2904
2915
|
}
|
|
2905
|
-
this.hideBib(
|
|
2916
|
+
this.hideBib();
|
|
2906
2917
|
}
|
|
2907
2918
|
};
|
|
2908
2919
|
|
|
@@ -2985,11 +2996,7 @@ class AuroFloatingUI {
|
|
|
2985
2996
|
}
|
|
2986
2997
|
}
|
|
2987
2998
|
|
|
2988
|
-
|
|
2989
|
-
* Hides the floating UI element.
|
|
2990
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2991
|
-
*/
|
|
2992
|
-
hideBib(eventType = "unknown") {
|
|
2999
|
+
hideBib() {
|
|
2993
3000
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2994
3001
|
this.lockScroll(false);
|
|
2995
3002
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3000,7 +3007,7 @@ class AuroFloatingUI {
|
|
|
3000
3007
|
if (this.showing) {
|
|
3001
3008
|
this.cleanupHideHandlers();
|
|
3002
3009
|
this.showing = false;
|
|
3003
|
-
this.dispatchEventDropdownToggle(
|
|
3010
|
+
this.dispatchEventDropdownToggle();
|
|
3004
3011
|
}
|
|
3005
3012
|
}
|
|
3006
3013
|
document.expandedAuroFloater = null;
|
|
@@ -3009,13 +3016,11 @@ class AuroFloatingUI {
|
|
|
3009
3016
|
/**
|
|
3010
3017
|
* @private
|
|
3011
3018
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3012
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3013
3019
|
*/
|
|
3014
|
-
dispatchEventDropdownToggle(
|
|
3020
|
+
dispatchEventDropdownToggle() {
|
|
3015
3021
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3016
3022
|
detail: {
|
|
3017
3023
|
expanded: this.showing,
|
|
3018
|
-
eventType: eventType || "unknown",
|
|
3019
3024
|
},
|
|
3020
3025
|
composed: true
|
|
3021
3026
|
});
|
|
@@ -3025,7 +3030,7 @@ class AuroFloatingUI {
|
|
|
3025
3030
|
|
|
3026
3031
|
handleClick() {
|
|
3027
3032
|
if (this.element.isPopoverVisible) {
|
|
3028
|
-
this.hideBib(
|
|
3033
|
+
this.hideBib();
|
|
3029
3034
|
} else {
|
|
3030
3035
|
this.showBib();
|
|
3031
3036
|
}
|
|
@@ -3052,7 +3057,7 @@ class AuroFloatingUI {
|
|
|
3052
3057
|
|
|
3053
3058
|
event.preventDefault();
|
|
3054
3059
|
this.handleClick();
|
|
3055
|
-
}
|
|
3060
|
+
}
|
|
3056
3061
|
break;
|
|
3057
3062
|
case 'mouseenter':
|
|
3058
3063
|
if (this.element.hoverToggle) {
|
|
@@ -3061,7 +3066,7 @@ class AuroFloatingUI {
|
|
|
3061
3066
|
break;
|
|
3062
3067
|
case 'mouseleave':
|
|
3063
3068
|
if (this.element.hoverToggle) {
|
|
3064
|
-
this.hideBib(
|
|
3069
|
+
this.hideBib();
|
|
3065
3070
|
}
|
|
3066
3071
|
break;
|
|
3067
3072
|
case 'focus':
|
|
@@ -4449,9 +4454,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4449
4454
|
|
|
4450
4455
|
this.parentBorder = false;
|
|
4451
4456
|
|
|
4452
|
-
/** @private */
|
|
4453
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4454
|
-
|
|
4455
4457
|
this.privateDefaults();
|
|
4456
4458
|
}
|
|
4457
4459
|
|
|
@@ -4885,19 +4887,12 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4885
4887
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4886
4888
|
this.handleTriggerContentSlotChange();
|
|
4887
4889
|
}
|
|
4888
|
-
}
|
|
4889
4890
|
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
handleDropdownToggle(event) {
|
|
4896
|
-
this.updateFocusTrap();
|
|
4897
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
4898
|
-
const eventType = event.detail.eventType || "unknown";
|
|
4899
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4900
|
-
this.trigger.focus();
|
|
4891
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
4892
|
+
this.updateFocusTrap();
|
|
4893
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
4894
|
+
this.trigger.focus();
|
|
4895
|
+
}
|
|
4901
4896
|
}
|
|
4902
4897
|
}
|
|
4903
4898
|
|
|
@@ -4905,7 +4900,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4905
4900
|
|
|
4906
4901
|
// Configure the floater to, this will generate the ID for the bib
|
|
4907
4902
|
this.floater.configure(this, 'auroDropdown');
|
|
4908
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4909
4903
|
|
|
4910
4904
|
/**
|
|
4911
4905
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -10065,13 +10059,24 @@ class AuroFormValidation {
|
|
|
10065
10059
|
this.getInputElements(elem);
|
|
10066
10060
|
this.getAuroInputs(elem);
|
|
10067
10061
|
|
|
10068
|
-
//
|
|
10062
|
+
// Check if validation should run
|
|
10069
10063
|
let validationShouldRun =
|
|
10064
|
+
|
|
10065
|
+
// If the validation was forced
|
|
10070
10066
|
force ||
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10067
|
+
|
|
10068
|
+
// If the validation should run on input
|
|
10069
|
+
elem.validateOnInput ||
|
|
10070
|
+
|
|
10071
|
+
// State-based checks
|
|
10072
|
+
(
|
|
10073
|
+
// Element is not currently focused
|
|
10074
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
10075
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
10076
|
+
|
|
10077
|
+
// And element has been touched or is untouched but has a value
|
|
10078
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
10079
|
+
);
|
|
10075
10080
|
|
|
10076
10081
|
if (elem.hasAttribute('error')) {
|
|
10077
10082
|
elem.validity = 'customError';
|
|
@@ -11022,9 +11027,9 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
11022
11027
|
this.inputElement.value = "";
|
|
11023
11028
|
this.value = "";
|
|
11024
11029
|
this.labelElement.classList.remove('inputElement-label--sticky');
|
|
11030
|
+
this.notifyValueChanged();
|
|
11025
11031
|
this.focus();
|
|
11026
11032
|
this.validation.validate(this);
|
|
11027
|
-
this.notifyValueChanged();
|
|
11028
11033
|
}
|
|
11029
11034
|
|
|
11030
11035
|
/**
|
|
@@ -11119,13 +11124,20 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
11119
11124
|
}
|
|
11120
11125
|
|
|
11121
11126
|
/**
|
|
11122
|
-
* Resets component to initial state.
|
|
11127
|
+
* Resets component to initial state, including resetting the touched state and validity.
|
|
11123
11128
|
* @returns {void}
|
|
11124
11129
|
*/
|
|
11125
11130
|
reset() {
|
|
11126
11131
|
this.validation.reset(this);
|
|
11127
11132
|
}
|
|
11128
11133
|
|
|
11134
|
+
/**
|
|
11135
|
+
* Clears the input value
|
|
11136
|
+
*/
|
|
11137
|
+
clear() {
|
|
11138
|
+
this.value = undefined;
|
|
11139
|
+
}
|
|
11140
|
+
|
|
11129
11141
|
/**
|
|
11130
11142
|
* Sets configuration data used elsewhere based on the `type` attribute.
|
|
11131
11143
|
* @private
|
|
@@ -16469,7 +16481,7 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16469
16481
|
});
|
|
16470
16482
|
|
|
16471
16483
|
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
16472
|
-
this.
|
|
16484
|
+
this.clear();
|
|
16473
16485
|
});
|
|
16474
16486
|
}
|
|
16475
16487
|
|
|
@@ -16489,7 +16501,7 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16489
16501
|
});
|
|
16490
16502
|
|
|
16491
16503
|
/**
|
|
16492
|
-
* Validate every time we remove focus from the
|
|
16504
|
+
* Validate every time we remove focus from the combo box.
|
|
16493
16505
|
*/
|
|
16494
16506
|
this.addEventListener('focusout', () => {
|
|
16495
16507
|
if (document.activeElement !== this) {
|
|
@@ -16694,7 +16706,16 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16694
16706
|
*/
|
|
16695
16707
|
reset() {
|
|
16696
16708
|
this.input.reset();
|
|
16709
|
+
this.menu.value = undefined;
|
|
16697
16710
|
this.validation.reset(this);
|
|
16711
|
+
}
|
|
16712
|
+
|
|
16713
|
+
/**
|
|
16714
|
+
* Clears the current value of the combobox.
|
|
16715
|
+
* @returns {void}
|
|
16716
|
+
*/
|
|
16717
|
+
clear() {
|
|
16718
|
+
this.input.clear();
|
|
16698
16719
|
this.menu.value = undefined;
|
|
16699
16720
|
}
|
|
16700
16721
|
|
|
@@ -16720,7 +16741,7 @@ class AuroCombobox extends AuroElement$1 {
|
|
|
16720
16741
|
this.hideBib();
|
|
16721
16742
|
}
|
|
16722
16743
|
} else {
|
|
16723
|
-
this.
|
|
16744
|
+
this.clear();
|
|
16724
16745
|
}
|
|
16725
16746
|
}
|
|
16726
16747
|
|
|
@@ -390,6 +390,11 @@ export class AuroCombobox extends AuroElement {
|
|
|
390
390
|
* @returns {void}
|
|
391
391
|
*/
|
|
392
392
|
reset(): void;
|
|
393
|
+
/**
|
|
394
|
+
* Clears the current value of the combobox.
|
|
395
|
+
* @returns {void}
|
|
396
|
+
*/
|
|
397
|
+
clear(): void;
|
|
393
398
|
/**
|
|
394
399
|
* Validates value.
|
|
395
400
|
* @param {boolean} [force=false] - Whether to force validation.
|
|
@@ -749,13 +749,24 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
749
749
|
this.getInputElements(elem);
|
|
750
750
|
this.getAuroInputs(elem);
|
|
751
751
|
|
|
752
|
-
//
|
|
752
|
+
// Check if validation should run
|
|
753
753
|
let validationShouldRun =
|
|
754
|
+
|
|
755
|
+
// If the validation was forced
|
|
754
756
|
force ||
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
|
|
758
|
+
// If the validation should run on input
|
|
759
|
+
elem.validateOnInput ||
|
|
760
|
+
|
|
761
|
+
// State-based checks
|
|
762
|
+
(
|
|
763
|
+
// Element is not currently focused
|
|
764
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
765
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
766
|
+
|
|
767
|
+
// And element has been touched or is untouched but has a value
|
|
768
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
769
|
+
);
|
|
759
770
|
|
|
760
771
|
if (elem.hasAttribute('error')) {
|
|
761
772
|
elem.validity = 'customError';
|
|
@@ -2577,7 +2588,7 @@ class AuroFloatingUI {
|
|
|
2577
2588
|
*/
|
|
2578
2589
|
mirrorSize() {
|
|
2579
2590
|
// mirror the boxsize from bibSizer
|
|
2580
|
-
if (this.element.bibSizer
|
|
2591
|
+
if (this.element.bibSizer) {
|
|
2581
2592
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2582
2593
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2583
2594
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2789,13 +2800,13 @@ class AuroFloatingUI {
|
|
|
2789
2800
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2790
2801
|
return;
|
|
2791
2802
|
}
|
|
2792
|
-
|
|
2803
|
+
|
|
2793
2804
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2794
2805
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2795
2806
|
return;
|
|
2796
2807
|
}
|
|
2797
2808
|
|
|
2798
|
-
this.hideBib(
|
|
2809
|
+
this.hideBib();
|
|
2799
2810
|
}
|
|
2800
2811
|
|
|
2801
2812
|
setupHideHandlers() {
|
|
@@ -2820,7 +2831,7 @@ class AuroFloatingUI {
|
|
|
2820
2831
|
document.expandedAuroFormkitDropdown = null;
|
|
2821
2832
|
document.expandedAuroFloater = this;
|
|
2822
2833
|
} else {
|
|
2823
|
-
this.hideBib(
|
|
2834
|
+
this.hideBib();
|
|
2824
2835
|
}
|
|
2825
2836
|
}
|
|
2826
2837
|
};
|
|
@@ -2833,7 +2844,7 @@ class AuroFloatingUI {
|
|
|
2833
2844
|
// if something else is open, let it handle itself
|
|
2834
2845
|
return;
|
|
2835
2846
|
}
|
|
2836
|
-
this.hideBib(
|
|
2847
|
+
this.hideBib();
|
|
2837
2848
|
}
|
|
2838
2849
|
};
|
|
2839
2850
|
|
|
@@ -2916,11 +2927,7 @@ class AuroFloatingUI {
|
|
|
2916
2927
|
}
|
|
2917
2928
|
}
|
|
2918
2929
|
|
|
2919
|
-
|
|
2920
|
-
* Hides the floating UI element.
|
|
2921
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2922
|
-
*/
|
|
2923
|
-
hideBib(eventType = "unknown") {
|
|
2930
|
+
hideBib() {
|
|
2924
2931
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2925
2932
|
this.lockScroll(false);
|
|
2926
2933
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -2931,7 +2938,7 @@ class AuroFloatingUI {
|
|
|
2931
2938
|
if (this.showing) {
|
|
2932
2939
|
this.cleanupHideHandlers();
|
|
2933
2940
|
this.showing = false;
|
|
2934
|
-
this.dispatchEventDropdownToggle(
|
|
2941
|
+
this.dispatchEventDropdownToggle();
|
|
2935
2942
|
}
|
|
2936
2943
|
}
|
|
2937
2944
|
document.expandedAuroFloater = null;
|
|
@@ -2940,13 +2947,11 @@ class AuroFloatingUI {
|
|
|
2940
2947
|
/**
|
|
2941
2948
|
* @private
|
|
2942
2949
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
2943
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
2944
2950
|
*/
|
|
2945
|
-
dispatchEventDropdownToggle(
|
|
2951
|
+
dispatchEventDropdownToggle() {
|
|
2946
2952
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
2947
2953
|
detail: {
|
|
2948
2954
|
expanded: this.showing,
|
|
2949
|
-
eventType: eventType || "unknown",
|
|
2950
2955
|
},
|
|
2951
2956
|
composed: true
|
|
2952
2957
|
});
|
|
@@ -2956,7 +2961,7 @@ class AuroFloatingUI {
|
|
|
2956
2961
|
|
|
2957
2962
|
handleClick() {
|
|
2958
2963
|
if (this.element.isPopoverVisible) {
|
|
2959
|
-
this.hideBib(
|
|
2964
|
+
this.hideBib();
|
|
2960
2965
|
} else {
|
|
2961
2966
|
this.showBib();
|
|
2962
2967
|
}
|
|
@@ -2983,7 +2988,7 @@ class AuroFloatingUI {
|
|
|
2983
2988
|
|
|
2984
2989
|
event.preventDefault();
|
|
2985
2990
|
this.handleClick();
|
|
2986
|
-
}
|
|
2991
|
+
}
|
|
2987
2992
|
break;
|
|
2988
2993
|
case 'mouseenter':
|
|
2989
2994
|
if (this.element.hoverToggle) {
|
|
@@ -2992,7 +2997,7 @@ class AuroFloatingUI {
|
|
|
2992
2997
|
break;
|
|
2993
2998
|
case 'mouseleave':
|
|
2994
2999
|
if (this.element.hoverToggle) {
|
|
2995
|
-
this.hideBib(
|
|
3000
|
+
this.hideBib();
|
|
2996
3001
|
}
|
|
2997
3002
|
break;
|
|
2998
3003
|
case 'focus':
|
|
@@ -4380,9 +4385,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4380
4385
|
|
|
4381
4386
|
this.parentBorder = false;
|
|
4382
4387
|
|
|
4383
|
-
/** @private */
|
|
4384
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4385
|
-
|
|
4386
4388
|
this.privateDefaults();
|
|
4387
4389
|
}
|
|
4388
4390
|
|
|
@@ -4816,19 +4818,12 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4816
4818
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4817
4819
|
this.handleTriggerContentSlotChange();
|
|
4818
4820
|
}
|
|
4819
|
-
}
|
|
4820
4821
|
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
handleDropdownToggle(event) {
|
|
4827
|
-
this.updateFocusTrap();
|
|
4828
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
4829
|
-
const eventType = event.detail.eventType || "unknown";
|
|
4830
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4831
|
-
this.trigger.focus();
|
|
4822
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
4823
|
+
this.updateFocusTrap();
|
|
4824
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
4825
|
+
this.trigger.focus();
|
|
4826
|
+
}
|
|
4832
4827
|
}
|
|
4833
4828
|
}
|
|
4834
4829
|
|
|
@@ -4836,7 +4831,6 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4836
4831
|
|
|
4837
4832
|
// Configure the floater to, this will generate the ID for the bib
|
|
4838
4833
|
this.floater.configure(this, 'auroDropdown');
|
|
4839
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4840
4834
|
|
|
4841
4835
|
/**
|
|
4842
4836
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -9983,13 +9977,24 @@ class AuroFormValidation {
|
|
|
9983
9977
|
this.getInputElements(elem);
|
|
9984
9978
|
this.getAuroInputs(elem);
|
|
9985
9979
|
|
|
9986
|
-
//
|
|
9980
|
+
// Check if validation should run
|
|
9987
9981
|
let validationShouldRun =
|
|
9982
|
+
|
|
9983
|
+
// If the validation was forced
|
|
9988
9984
|
force ||
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9985
|
+
|
|
9986
|
+
// If the validation should run on input
|
|
9987
|
+
elem.validateOnInput ||
|
|
9988
|
+
|
|
9989
|
+
// State-based checks
|
|
9990
|
+
(
|
|
9991
|
+
// Element is not currently focused
|
|
9992
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
9993
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
9994
|
+
|
|
9995
|
+
// And element has been touched or is untouched but has a value
|
|
9996
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
9997
|
+
);
|
|
9993
9998
|
|
|
9994
9999
|
if (elem.hasAttribute('error')) {
|
|
9995
10000
|
elem.validity = 'customError';
|
|
@@ -10940,9 +10945,9 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10940
10945
|
this.inputElement.value = "";
|
|
10941
10946
|
this.value = "";
|
|
10942
10947
|
this.labelElement.classList.remove('inputElement-label--sticky');
|
|
10948
|
+
this.notifyValueChanged();
|
|
10943
10949
|
this.focus();
|
|
10944
10950
|
this.validation.validate(this);
|
|
10945
|
-
this.notifyValueChanged();
|
|
10946
10951
|
}
|
|
10947
10952
|
|
|
10948
10953
|
/**
|
|
@@ -11037,13 +11042,20 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
11037
11042
|
}
|
|
11038
11043
|
|
|
11039
11044
|
/**
|
|
11040
|
-
* Resets component to initial state.
|
|
11045
|
+
* Resets component to initial state, including resetting the touched state and validity.
|
|
11041
11046
|
* @returns {void}
|
|
11042
11047
|
*/
|
|
11043
11048
|
reset() {
|
|
11044
11049
|
this.validation.reset(this);
|
|
11045
11050
|
}
|
|
11046
11051
|
|
|
11052
|
+
/**
|
|
11053
|
+
* Clears the input value
|
|
11054
|
+
*/
|
|
11055
|
+
clear() {
|
|
11056
|
+
this.value = undefined;
|
|
11057
|
+
}
|
|
11058
|
+
|
|
11047
11059
|
/**
|
|
11048
11060
|
* Sets configuration data used elsewhere based on the `type` attribute.
|
|
11049
11061
|
* @private
|
|
@@ -16387,7 +16399,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16387
16399
|
});
|
|
16388
16400
|
|
|
16389
16401
|
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
16390
|
-
this.
|
|
16402
|
+
this.clear();
|
|
16391
16403
|
});
|
|
16392
16404
|
}
|
|
16393
16405
|
|
|
@@ -16407,7 +16419,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16407
16419
|
});
|
|
16408
16420
|
|
|
16409
16421
|
/**
|
|
16410
|
-
* Validate every time we remove focus from the
|
|
16422
|
+
* Validate every time we remove focus from the combo box.
|
|
16411
16423
|
*/
|
|
16412
16424
|
this.addEventListener('focusout', () => {
|
|
16413
16425
|
if (document.activeElement !== this) {
|
|
@@ -16612,7 +16624,16 @@ class AuroCombobox extends AuroElement {
|
|
|
16612
16624
|
*/
|
|
16613
16625
|
reset() {
|
|
16614
16626
|
this.input.reset();
|
|
16627
|
+
this.menu.value = undefined;
|
|
16615
16628
|
this.validation.reset(this);
|
|
16629
|
+
}
|
|
16630
|
+
|
|
16631
|
+
/**
|
|
16632
|
+
* Clears the current value of the combobox.
|
|
16633
|
+
* @returns {void}
|
|
16634
|
+
*/
|
|
16635
|
+
clear() {
|
|
16636
|
+
this.input.clear();
|
|
16616
16637
|
this.menu.value = undefined;
|
|
16617
16638
|
}
|
|
16618
16639
|
|
|
@@ -16638,7 +16659,7 @@ class AuroCombobox extends AuroElement {
|
|
|
16638
16659
|
this.hideBib();
|
|
16639
16660
|
}
|
|
16640
16661
|
} else {
|
|
16641
|
-
this.
|
|
16662
|
+
this.clear();
|
|
16642
16663
|
}
|
|
16643
16664
|
}
|
|
16644
16665
|
|