@aurodesignsystem-dev/auro-formkit 0.0.0-pr776.1 → 0.0.0-pr783.1
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/combobox/demo/api.min.js +35 -18
- package/components/combobox/demo/index.min.js +35 -18
- package/components/combobox/dist/index.js +35 -18
- package/components/combobox/dist/registered.js +35 -18
- package/components/counter/demo/api.min.js +34 -16
- package/components/counter/demo/index.min.js +34 -16
- package/components/counter/dist/index.js +34 -16
- package/components/counter/dist/registered.js +34 -16
- package/components/datepicker/demo/api.md +0 -1
- package/components/datepicker/demo/api.min.js +95 -21
- package/components/datepicker/demo/index.min.js +95 -21
- package/components/datepicker/dist/auro-datepicker.d.ts +19 -1
- package/components/datepicker/dist/index.js +95 -21
- package/components/datepicker/dist/registered.js +95 -21
- package/components/dropdown/demo/api.min.js +33 -16
- package/components/dropdown/demo/index.min.js +33 -16
- package/components/dropdown/dist/auro-dropdown.d.ts +6 -0
- package/components/dropdown/dist/index.js +33 -16
- package/components/dropdown/dist/registered.js +33 -16
- package/components/input/demo/api.min.js +2 -2
- package/components/input/demo/index.min.js +2 -2
- package/components/input/dist/index.js +2 -2
- package/components/input/dist/registered.js +2 -2
- package/components/select/demo/api.min.js +33 -16
- package/components/select/demo/index.min.js +33 -16
- package/components/select/dist/index.js +33 -16
- package/components/select/dist/registered.js +33 -16
- package/package.json +2 -2
|
@@ -2788,7 +2788,7 @@ class AuroFloatingUI {
|
|
|
2788
2788
|
*/
|
|
2789
2789
|
mirrorSize() {
|
|
2790
2790
|
// mirror the boxsize from bibSizer
|
|
2791
|
-
if (this.element.bibSizer) {
|
|
2791
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2792
2792
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2793
2793
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2794
2794
|
if (sizerStyle.width !== '0px') {
|
|
@@ -3000,13 +3000,13 @@ class AuroFloatingUI {
|
|
|
3000
3000
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
3001
3001
|
return;
|
|
3002
3002
|
}
|
|
3003
|
-
|
|
3003
|
+
|
|
3004
3004
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
3005
3005
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
3006
3006
|
return;
|
|
3007
3007
|
}
|
|
3008
3008
|
|
|
3009
|
-
this.hideBib();
|
|
3009
|
+
this.hideBib("keydown");
|
|
3010
3010
|
}
|
|
3011
3011
|
|
|
3012
3012
|
setupHideHandlers() {
|
|
@@ -3031,7 +3031,7 @@ class AuroFloatingUI {
|
|
|
3031
3031
|
document.expandedAuroFormkitDropdown = null;
|
|
3032
3032
|
document.expandedAuroFloater = this;
|
|
3033
3033
|
} else {
|
|
3034
|
-
this.hideBib();
|
|
3034
|
+
this.hideBib("click");
|
|
3035
3035
|
}
|
|
3036
3036
|
}
|
|
3037
3037
|
};
|
|
@@ -3044,7 +3044,7 @@ class AuroFloatingUI {
|
|
|
3044
3044
|
// if something else is open, let it handle itself
|
|
3045
3045
|
return;
|
|
3046
3046
|
}
|
|
3047
|
-
this.hideBib();
|
|
3047
|
+
this.hideBib("keydown");
|
|
3048
3048
|
}
|
|
3049
3049
|
};
|
|
3050
3050
|
|
|
@@ -3127,7 +3127,11 @@ class AuroFloatingUI {
|
|
|
3127
3127
|
}
|
|
3128
3128
|
}
|
|
3129
3129
|
|
|
3130
|
-
|
|
3130
|
+
/**
|
|
3131
|
+
* Hides the floating UI element.
|
|
3132
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3133
|
+
*/
|
|
3134
|
+
hideBib(eventType = "unknown") {
|
|
3131
3135
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3132
3136
|
this.lockScroll(false);
|
|
3133
3137
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3138,7 +3142,7 @@ class AuroFloatingUI {
|
|
|
3138
3142
|
if (this.showing) {
|
|
3139
3143
|
this.cleanupHideHandlers();
|
|
3140
3144
|
this.showing = false;
|
|
3141
|
-
this.dispatchEventDropdownToggle();
|
|
3145
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
3142
3146
|
}
|
|
3143
3147
|
}
|
|
3144
3148
|
document.expandedAuroFloater = null;
|
|
@@ -3147,11 +3151,13 @@ class AuroFloatingUI {
|
|
|
3147
3151
|
/**
|
|
3148
3152
|
* @private
|
|
3149
3153
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3154
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3150
3155
|
*/
|
|
3151
|
-
dispatchEventDropdownToggle() {
|
|
3156
|
+
dispatchEventDropdownToggle(eventType) {
|
|
3152
3157
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3153
3158
|
detail: {
|
|
3154
3159
|
expanded: this.showing,
|
|
3160
|
+
eventType: eventType || "unknown",
|
|
3155
3161
|
},
|
|
3156
3162
|
composed: true
|
|
3157
3163
|
});
|
|
@@ -3161,7 +3167,7 @@ class AuroFloatingUI {
|
|
|
3161
3167
|
|
|
3162
3168
|
handleClick() {
|
|
3163
3169
|
if (this.element.isPopoverVisible) {
|
|
3164
|
-
this.hideBib();
|
|
3170
|
+
this.hideBib("click");
|
|
3165
3171
|
} else {
|
|
3166
3172
|
this.showBib();
|
|
3167
3173
|
}
|
|
@@ -3188,7 +3194,7 @@ class AuroFloatingUI {
|
|
|
3188
3194
|
|
|
3189
3195
|
event.preventDefault();
|
|
3190
3196
|
this.handleClick();
|
|
3191
|
-
}
|
|
3197
|
+
}
|
|
3192
3198
|
break;
|
|
3193
3199
|
case 'mouseenter':
|
|
3194
3200
|
if (this.element.hoverToggle) {
|
|
@@ -3197,7 +3203,7 @@ class AuroFloatingUI {
|
|
|
3197
3203
|
break;
|
|
3198
3204
|
case 'mouseleave':
|
|
3199
3205
|
if (this.element.hoverToggle) {
|
|
3200
|
-
this.hideBib();
|
|
3206
|
+
this.hideBib("mouseleave");
|
|
3201
3207
|
}
|
|
3202
3208
|
break;
|
|
3203
3209
|
case 'focus':
|
|
@@ -4585,6 +4591,9 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4585
4591
|
|
|
4586
4592
|
this.parentBorder = false;
|
|
4587
4593
|
|
|
4594
|
+
/** @private */
|
|
4595
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4596
|
+
|
|
4588
4597
|
this.privateDefaults();
|
|
4589
4598
|
}
|
|
4590
4599
|
|
|
@@ -5018,12 +5027,19 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5018
5027
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
5019
5028
|
this.handleTriggerContentSlotChange();
|
|
5020
5029
|
}
|
|
5030
|
+
}
|
|
5021
5031
|
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5032
|
+
/**
|
|
5033
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
5034
|
+
* @private
|
|
5035
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
5036
|
+
*/
|
|
5037
|
+
handleDropdownToggle(event) {
|
|
5038
|
+
this.updateFocusTrap();
|
|
5039
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
5040
|
+
const eventType = event.detail.eventType || "unknown";
|
|
5041
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
5042
|
+
this.trigger.focus();
|
|
5027
5043
|
}
|
|
5028
5044
|
}
|
|
5029
5045
|
|
|
@@ -5031,6 +5047,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
5031
5047
|
|
|
5032
5048
|
// Configure the floater to, this will generate the ID for the bib
|
|
5033
5049
|
this.floater.configure(this, 'auroDropdown');
|
|
5050
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
5034
5051
|
|
|
5035
5052
|
/**
|
|
5036
5053
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -11020,9 +11037,9 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
11020
11037
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
11021
11038
|
this.validation.validate(this);
|
|
11022
11039
|
}
|
|
11023
|
-
|
|
11024
|
-
this.notifyValueChanged();
|
|
11025
11040
|
}
|
|
11041
|
+
|
|
11042
|
+
this.notifyValueChanged();
|
|
11026
11043
|
}
|
|
11027
11044
|
|
|
11028
11045
|
if (changedProperties.has('error')) {
|
|
@@ -2646,7 +2646,7 @@ class AuroFloatingUI {
|
|
|
2646
2646
|
*/
|
|
2647
2647
|
mirrorSize() {
|
|
2648
2648
|
// mirror the boxsize from bibSizer
|
|
2649
|
-
if (this.element.bibSizer) {
|
|
2649
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2650
2650
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2651
2651
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2652
2652
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2858,13 +2858,13 @@ class AuroFloatingUI {
|
|
|
2858
2858
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2859
2859
|
return;
|
|
2860
2860
|
}
|
|
2861
|
-
|
|
2861
|
+
|
|
2862
2862
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2863
2863
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2864
2864
|
return;
|
|
2865
2865
|
}
|
|
2866
2866
|
|
|
2867
|
-
this.hideBib();
|
|
2867
|
+
this.hideBib("keydown");
|
|
2868
2868
|
}
|
|
2869
2869
|
|
|
2870
2870
|
setupHideHandlers() {
|
|
@@ -2889,7 +2889,7 @@ class AuroFloatingUI {
|
|
|
2889
2889
|
document.expandedAuroFormkitDropdown = null;
|
|
2890
2890
|
document.expandedAuroFloater = this;
|
|
2891
2891
|
} else {
|
|
2892
|
-
this.hideBib();
|
|
2892
|
+
this.hideBib("click");
|
|
2893
2893
|
}
|
|
2894
2894
|
}
|
|
2895
2895
|
};
|
|
@@ -2902,7 +2902,7 @@ class AuroFloatingUI {
|
|
|
2902
2902
|
// if something else is open, let it handle itself
|
|
2903
2903
|
return;
|
|
2904
2904
|
}
|
|
2905
|
-
this.hideBib();
|
|
2905
|
+
this.hideBib("keydown");
|
|
2906
2906
|
}
|
|
2907
2907
|
};
|
|
2908
2908
|
|
|
@@ -2985,7 +2985,11 @@ class AuroFloatingUI {
|
|
|
2985
2985
|
}
|
|
2986
2986
|
}
|
|
2987
2987
|
|
|
2988
|
-
|
|
2988
|
+
/**
|
|
2989
|
+
* Hides the floating UI element.
|
|
2990
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2991
|
+
*/
|
|
2992
|
+
hideBib(eventType = "unknown") {
|
|
2989
2993
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2990
2994
|
this.lockScroll(false);
|
|
2991
2995
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -2996,7 +3000,7 @@ class AuroFloatingUI {
|
|
|
2996
3000
|
if (this.showing) {
|
|
2997
3001
|
this.cleanupHideHandlers();
|
|
2998
3002
|
this.showing = false;
|
|
2999
|
-
this.dispatchEventDropdownToggle();
|
|
3003
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
3000
3004
|
}
|
|
3001
3005
|
}
|
|
3002
3006
|
document.expandedAuroFloater = null;
|
|
@@ -3005,11 +3009,13 @@ class AuroFloatingUI {
|
|
|
3005
3009
|
/**
|
|
3006
3010
|
* @private
|
|
3007
3011
|
* @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.
|
|
3008
3013
|
*/
|
|
3009
|
-
dispatchEventDropdownToggle() {
|
|
3014
|
+
dispatchEventDropdownToggle(eventType) {
|
|
3010
3015
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3011
3016
|
detail: {
|
|
3012
3017
|
expanded: this.showing,
|
|
3018
|
+
eventType: eventType || "unknown",
|
|
3013
3019
|
},
|
|
3014
3020
|
composed: true
|
|
3015
3021
|
});
|
|
@@ -3019,7 +3025,7 @@ class AuroFloatingUI {
|
|
|
3019
3025
|
|
|
3020
3026
|
handleClick() {
|
|
3021
3027
|
if (this.element.isPopoverVisible) {
|
|
3022
|
-
this.hideBib();
|
|
3028
|
+
this.hideBib("click");
|
|
3023
3029
|
} else {
|
|
3024
3030
|
this.showBib();
|
|
3025
3031
|
}
|
|
@@ -3046,7 +3052,7 @@ class AuroFloatingUI {
|
|
|
3046
3052
|
|
|
3047
3053
|
event.preventDefault();
|
|
3048
3054
|
this.handleClick();
|
|
3049
|
-
}
|
|
3055
|
+
}
|
|
3050
3056
|
break;
|
|
3051
3057
|
case 'mouseenter':
|
|
3052
3058
|
if (this.element.hoverToggle) {
|
|
@@ -3055,7 +3061,7 @@ class AuroFloatingUI {
|
|
|
3055
3061
|
break;
|
|
3056
3062
|
case 'mouseleave':
|
|
3057
3063
|
if (this.element.hoverToggle) {
|
|
3058
|
-
this.hideBib();
|
|
3064
|
+
this.hideBib("mouseleave");
|
|
3059
3065
|
}
|
|
3060
3066
|
break;
|
|
3061
3067
|
case 'focus':
|
|
@@ -4443,6 +4449,9 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4443
4449
|
|
|
4444
4450
|
this.parentBorder = false;
|
|
4445
4451
|
|
|
4452
|
+
/** @private */
|
|
4453
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4454
|
+
|
|
4446
4455
|
this.privateDefaults();
|
|
4447
4456
|
}
|
|
4448
4457
|
|
|
@@ -4876,12 +4885,19 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4876
4885
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4877
4886
|
this.handleTriggerContentSlotChange();
|
|
4878
4887
|
}
|
|
4888
|
+
}
|
|
4879
4889
|
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4890
|
+
/**
|
|
4891
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
4892
|
+
* @private
|
|
4893
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
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();
|
|
4885
4901
|
}
|
|
4886
4902
|
}
|
|
4887
4903
|
|
|
@@ -4889,6 +4905,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4889
4905
|
|
|
4890
4906
|
// Configure the floater to, this will generate the ID for the bib
|
|
4891
4907
|
this.floater.configure(this, 'auroDropdown');
|
|
4908
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4892
4909
|
|
|
4893
4910
|
/**
|
|
4894
4911
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -10878,9 +10895,9 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10878
10895
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
10879
10896
|
this.validation.validate(this);
|
|
10880
10897
|
}
|
|
10881
|
-
|
|
10882
|
-
this.notifyValueChanged();
|
|
10883
10898
|
}
|
|
10899
|
+
|
|
10900
|
+
this.notifyValueChanged();
|
|
10884
10901
|
}
|
|
10885
10902
|
|
|
10886
10903
|
if (changedProperties.has('error')) {
|
|
@@ -2577,7 +2577,7 @@ class AuroFloatingUI {
|
|
|
2577
2577
|
*/
|
|
2578
2578
|
mirrorSize() {
|
|
2579
2579
|
// mirror the boxsize from bibSizer
|
|
2580
|
-
if (this.element.bibSizer) {
|
|
2580
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2581
2581
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2582
2582
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2583
2583
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2789,13 +2789,13 @@ class AuroFloatingUI {
|
|
|
2789
2789
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2790
2790
|
return;
|
|
2791
2791
|
}
|
|
2792
|
-
|
|
2792
|
+
|
|
2793
2793
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2794
2794
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2795
2795
|
return;
|
|
2796
2796
|
}
|
|
2797
2797
|
|
|
2798
|
-
this.hideBib();
|
|
2798
|
+
this.hideBib("keydown");
|
|
2799
2799
|
}
|
|
2800
2800
|
|
|
2801
2801
|
setupHideHandlers() {
|
|
@@ -2820,7 +2820,7 @@ class AuroFloatingUI {
|
|
|
2820
2820
|
document.expandedAuroFormkitDropdown = null;
|
|
2821
2821
|
document.expandedAuroFloater = this;
|
|
2822
2822
|
} else {
|
|
2823
|
-
this.hideBib();
|
|
2823
|
+
this.hideBib("click");
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
2826
|
};
|
|
@@ -2833,7 +2833,7 @@ class AuroFloatingUI {
|
|
|
2833
2833
|
// if something else is open, let it handle itself
|
|
2834
2834
|
return;
|
|
2835
2835
|
}
|
|
2836
|
-
this.hideBib();
|
|
2836
|
+
this.hideBib("keydown");
|
|
2837
2837
|
}
|
|
2838
2838
|
};
|
|
2839
2839
|
|
|
@@ -2916,7 +2916,11 @@ class AuroFloatingUI {
|
|
|
2916
2916
|
}
|
|
2917
2917
|
}
|
|
2918
2918
|
|
|
2919
|
-
|
|
2919
|
+
/**
|
|
2920
|
+
* Hides the floating UI element.
|
|
2921
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2922
|
+
*/
|
|
2923
|
+
hideBib(eventType = "unknown") {
|
|
2920
2924
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2921
2925
|
this.lockScroll(false);
|
|
2922
2926
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -2927,7 +2931,7 @@ class AuroFloatingUI {
|
|
|
2927
2931
|
if (this.showing) {
|
|
2928
2932
|
this.cleanupHideHandlers();
|
|
2929
2933
|
this.showing = false;
|
|
2930
|
-
this.dispatchEventDropdownToggle();
|
|
2934
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
2931
2935
|
}
|
|
2932
2936
|
}
|
|
2933
2937
|
document.expandedAuroFloater = null;
|
|
@@ -2936,11 +2940,13 @@ class AuroFloatingUI {
|
|
|
2936
2940
|
/**
|
|
2937
2941
|
* @private
|
|
2938
2942
|
* @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.
|
|
2939
2944
|
*/
|
|
2940
|
-
dispatchEventDropdownToggle() {
|
|
2945
|
+
dispatchEventDropdownToggle(eventType) {
|
|
2941
2946
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
2942
2947
|
detail: {
|
|
2943
2948
|
expanded: this.showing,
|
|
2949
|
+
eventType: eventType || "unknown",
|
|
2944
2950
|
},
|
|
2945
2951
|
composed: true
|
|
2946
2952
|
});
|
|
@@ -2950,7 +2956,7 @@ class AuroFloatingUI {
|
|
|
2950
2956
|
|
|
2951
2957
|
handleClick() {
|
|
2952
2958
|
if (this.element.isPopoverVisible) {
|
|
2953
|
-
this.hideBib();
|
|
2959
|
+
this.hideBib("click");
|
|
2954
2960
|
} else {
|
|
2955
2961
|
this.showBib();
|
|
2956
2962
|
}
|
|
@@ -2977,7 +2983,7 @@ class AuroFloatingUI {
|
|
|
2977
2983
|
|
|
2978
2984
|
event.preventDefault();
|
|
2979
2985
|
this.handleClick();
|
|
2980
|
-
}
|
|
2986
|
+
}
|
|
2981
2987
|
break;
|
|
2982
2988
|
case 'mouseenter':
|
|
2983
2989
|
if (this.element.hoverToggle) {
|
|
@@ -2986,7 +2992,7 @@ class AuroFloatingUI {
|
|
|
2986
2992
|
break;
|
|
2987
2993
|
case 'mouseleave':
|
|
2988
2994
|
if (this.element.hoverToggle) {
|
|
2989
|
-
this.hideBib();
|
|
2995
|
+
this.hideBib("mouseleave");
|
|
2990
2996
|
}
|
|
2991
2997
|
break;
|
|
2992
2998
|
case 'focus':
|
|
@@ -4374,6 +4380,9 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4374
4380
|
|
|
4375
4381
|
this.parentBorder = false;
|
|
4376
4382
|
|
|
4383
|
+
/** @private */
|
|
4384
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4385
|
+
|
|
4377
4386
|
this.privateDefaults();
|
|
4378
4387
|
}
|
|
4379
4388
|
|
|
@@ -4807,12 +4816,19 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4807
4816
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4808
4817
|
this.handleTriggerContentSlotChange();
|
|
4809
4818
|
}
|
|
4819
|
+
}
|
|
4810
4820
|
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4821
|
+
/**
|
|
4822
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
4823
|
+
* @private
|
|
4824
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
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();
|
|
4816
4832
|
}
|
|
4817
4833
|
}
|
|
4818
4834
|
|
|
@@ -4820,6 +4836,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4820
4836
|
|
|
4821
4837
|
// Configure the floater to, this will generate the ID for the bib
|
|
4822
4838
|
this.floater.configure(this, 'auroDropdown');
|
|
4839
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4823
4840
|
|
|
4824
4841
|
/**
|
|
4825
4842
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -10796,9 +10813,9 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10796
10813
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
10797
10814
|
this.validation.validate(this);
|
|
10798
10815
|
}
|
|
10799
|
-
|
|
10800
|
-
this.notifyValueChanged();
|
|
10801
10816
|
}
|
|
10817
|
+
|
|
10818
|
+
this.notifyValueChanged();
|
|
10802
10819
|
}
|
|
10803
10820
|
|
|
10804
10821
|
if (changedProperties.has('error')) {
|
|
@@ -2577,7 +2577,7 @@ class AuroFloatingUI {
|
|
|
2577
2577
|
*/
|
|
2578
2578
|
mirrorSize() {
|
|
2579
2579
|
// mirror the boxsize from bibSizer
|
|
2580
|
-
if (this.element.bibSizer) {
|
|
2580
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
2581
2581
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2582
2582
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2583
2583
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2789,13 +2789,13 @@ class AuroFloatingUI {
|
|
|
2789
2789
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2790
2790
|
return;
|
|
2791
2791
|
}
|
|
2792
|
-
|
|
2792
|
+
|
|
2793
2793
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2794
2794
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2795
2795
|
return;
|
|
2796
2796
|
}
|
|
2797
2797
|
|
|
2798
|
-
this.hideBib();
|
|
2798
|
+
this.hideBib("keydown");
|
|
2799
2799
|
}
|
|
2800
2800
|
|
|
2801
2801
|
setupHideHandlers() {
|
|
@@ -2820,7 +2820,7 @@ class AuroFloatingUI {
|
|
|
2820
2820
|
document.expandedAuroFormkitDropdown = null;
|
|
2821
2821
|
document.expandedAuroFloater = this;
|
|
2822
2822
|
} else {
|
|
2823
|
-
this.hideBib();
|
|
2823
|
+
this.hideBib("click");
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
2826
|
};
|
|
@@ -2833,7 +2833,7 @@ class AuroFloatingUI {
|
|
|
2833
2833
|
// if something else is open, let it handle itself
|
|
2834
2834
|
return;
|
|
2835
2835
|
}
|
|
2836
|
-
this.hideBib();
|
|
2836
|
+
this.hideBib("keydown");
|
|
2837
2837
|
}
|
|
2838
2838
|
};
|
|
2839
2839
|
|
|
@@ -2916,7 +2916,11 @@ class AuroFloatingUI {
|
|
|
2916
2916
|
}
|
|
2917
2917
|
}
|
|
2918
2918
|
|
|
2919
|
-
|
|
2919
|
+
/**
|
|
2920
|
+
* Hides the floating UI element.
|
|
2921
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2922
|
+
*/
|
|
2923
|
+
hideBib(eventType = "unknown") {
|
|
2920
2924
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2921
2925
|
this.lockScroll(false);
|
|
2922
2926
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -2927,7 +2931,7 @@ class AuroFloatingUI {
|
|
|
2927
2931
|
if (this.showing) {
|
|
2928
2932
|
this.cleanupHideHandlers();
|
|
2929
2933
|
this.showing = false;
|
|
2930
|
-
this.dispatchEventDropdownToggle();
|
|
2934
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
2931
2935
|
}
|
|
2932
2936
|
}
|
|
2933
2937
|
document.expandedAuroFloater = null;
|
|
@@ -2936,11 +2940,13 @@ class AuroFloatingUI {
|
|
|
2936
2940
|
/**
|
|
2937
2941
|
* @private
|
|
2938
2942
|
* @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.
|
|
2939
2944
|
*/
|
|
2940
|
-
dispatchEventDropdownToggle() {
|
|
2945
|
+
dispatchEventDropdownToggle(eventType) {
|
|
2941
2946
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
2942
2947
|
detail: {
|
|
2943
2948
|
expanded: this.showing,
|
|
2949
|
+
eventType: eventType || "unknown",
|
|
2944
2950
|
},
|
|
2945
2951
|
composed: true
|
|
2946
2952
|
});
|
|
@@ -2950,7 +2956,7 @@ class AuroFloatingUI {
|
|
|
2950
2956
|
|
|
2951
2957
|
handleClick() {
|
|
2952
2958
|
if (this.element.isPopoverVisible) {
|
|
2953
|
-
this.hideBib();
|
|
2959
|
+
this.hideBib("click");
|
|
2954
2960
|
} else {
|
|
2955
2961
|
this.showBib();
|
|
2956
2962
|
}
|
|
@@ -2977,7 +2983,7 @@ class AuroFloatingUI {
|
|
|
2977
2983
|
|
|
2978
2984
|
event.preventDefault();
|
|
2979
2985
|
this.handleClick();
|
|
2980
|
-
}
|
|
2986
|
+
}
|
|
2981
2987
|
break;
|
|
2982
2988
|
case 'mouseenter':
|
|
2983
2989
|
if (this.element.hoverToggle) {
|
|
@@ -2986,7 +2992,7 @@ class AuroFloatingUI {
|
|
|
2986
2992
|
break;
|
|
2987
2993
|
case 'mouseleave':
|
|
2988
2994
|
if (this.element.hoverToggle) {
|
|
2989
|
-
this.hideBib();
|
|
2995
|
+
this.hideBib("mouseleave");
|
|
2990
2996
|
}
|
|
2991
2997
|
break;
|
|
2992
2998
|
case 'focus':
|
|
@@ -4374,6 +4380,9 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4374
4380
|
|
|
4375
4381
|
this.parentBorder = false;
|
|
4376
4382
|
|
|
4383
|
+
/** @private */
|
|
4384
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4385
|
+
|
|
4377
4386
|
this.privateDefaults();
|
|
4378
4387
|
}
|
|
4379
4388
|
|
|
@@ -4807,12 +4816,19 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4807
4816
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4808
4817
|
this.handleTriggerContentSlotChange();
|
|
4809
4818
|
}
|
|
4819
|
+
}
|
|
4810
4820
|
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4821
|
+
/**
|
|
4822
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
4823
|
+
* @private
|
|
4824
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
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();
|
|
4816
4832
|
}
|
|
4817
4833
|
}
|
|
4818
4834
|
|
|
@@ -4820,6 +4836,7 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
4820
4836
|
|
|
4821
4837
|
// Configure the floater to, this will generate the ID for the bib
|
|
4822
4838
|
this.floater.configure(this, 'auroDropdown');
|
|
4839
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4823
4840
|
|
|
4824
4841
|
/**
|
|
4825
4842
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -10796,9 +10813,9 @@ class BaseInput extends AuroElement$2$1 {
|
|
|
10796
10813
|
if (!this.shadowRoot.contains(this.getActiveElement())) {
|
|
10797
10814
|
this.validation.validate(this);
|
|
10798
10815
|
}
|
|
10799
|
-
|
|
10800
|
-
this.notifyValueChanged();
|
|
10801
10816
|
}
|
|
10817
|
+
|
|
10818
|
+
this.notifyValueChanged();
|
|
10802
10819
|
}
|
|
10803
10820
|
|
|
10804
10821
|
if (changedProperties.has('error')) {
|