@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
|
@@ -1010,13 +1010,24 @@ class AuroFormValidation {
|
|
|
1010
1010
|
this.getInputElements(elem);
|
|
1011
1011
|
this.getAuroInputs(elem);
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1013
|
+
// Check if validation should run
|
|
1014
1014
|
let validationShouldRun =
|
|
1015
|
+
|
|
1016
|
+
// If the validation was forced
|
|
1015
1017
|
force ||
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1018
|
+
|
|
1019
|
+
// If the validation should run on input
|
|
1020
|
+
elem.validateOnInput ||
|
|
1021
|
+
|
|
1022
|
+
// State-based checks
|
|
1023
|
+
(
|
|
1024
|
+
// Element is not currently focused
|
|
1025
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
1026
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
1027
|
+
|
|
1028
|
+
// And element has been touched or is untouched but has a value
|
|
1029
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
1030
|
+
);
|
|
1020
1031
|
|
|
1021
1032
|
if (elem.hasAttribute('error')) {
|
|
1022
1033
|
elem.validity = 'customError';
|
|
@@ -940,13 +940,24 @@ class AuroFormValidation {
|
|
|
940
940
|
this.getInputElements(elem);
|
|
941
941
|
this.getAuroInputs(elem);
|
|
942
942
|
|
|
943
|
-
//
|
|
943
|
+
// Check if validation should run
|
|
944
944
|
let validationShouldRun =
|
|
945
|
+
|
|
946
|
+
// If the validation was forced
|
|
945
947
|
force ||
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
948
|
+
|
|
949
|
+
// If the validation should run on input
|
|
950
|
+
elem.validateOnInput ||
|
|
951
|
+
|
|
952
|
+
// State-based checks
|
|
953
|
+
(
|
|
954
|
+
// Element is not currently focused
|
|
955
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
956
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
957
|
+
|
|
958
|
+
// And element has been touched or is untouched but has a value
|
|
959
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
960
|
+
);
|
|
950
961
|
|
|
951
962
|
if (elem.hasAttribute('error')) {
|
|
952
963
|
elem.validity = 'customError';
|
|
@@ -2814,7 +2825,7 @@ class AuroFloatingUI {
|
|
|
2814
2825
|
*/
|
|
2815
2826
|
mirrorSize() {
|
|
2816
2827
|
// mirror the boxsize from bibSizer
|
|
2817
|
-
if (this.element.bibSizer
|
|
2828
|
+
if (this.element.bibSizer) {
|
|
2818
2829
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2819
2830
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2820
2831
|
if (sizerStyle.width !== '0px') {
|
|
@@ -3026,13 +3037,13 @@ class AuroFloatingUI {
|
|
|
3026
3037
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
3027
3038
|
return;
|
|
3028
3039
|
}
|
|
3029
|
-
|
|
3040
|
+
|
|
3030
3041
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
3031
3042
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
3032
3043
|
return;
|
|
3033
3044
|
}
|
|
3034
3045
|
|
|
3035
|
-
this.hideBib(
|
|
3046
|
+
this.hideBib();
|
|
3036
3047
|
}
|
|
3037
3048
|
|
|
3038
3049
|
setupHideHandlers() {
|
|
@@ -3057,7 +3068,7 @@ class AuroFloatingUI {
|
|
|
3057
3068
|
document.expandedAuroFormkitDropdown = null;
|
|
3058
3069
|
document.expandedAuroFloater = this;
|
|
3059
3070
|
} else {
|
|
3060
|
-
this.hideBib(
|
|
3071
|
+
this.hideBib();
|
|
3061
3072
|
}
|
|
3062
3073
|
}
|
|
3063
3074
|
};
|
|
@@ -3070,7 +3081,7 @@ class AuroFloatingUI {
|
|
|
3070
3081
|
// if something else is open, let it handle itself
|
|
3071
3082
|
return;
|
|
3072
3083
|
}
|
|
3073
|
-
this.hideBib(
|
|
3084
|
+
this.hideBib();
|
|
3074
3085
|
}
|
|
3075
3086
|
};
|
|
3076
3087
|
|
|
@@ -3153,11 +3164,7 @@ class AuroFloatingUI {
|
|
|
3153
3164
|
}
|
|
3154
3165
|
}
|
|
3155
3166
|
|
|
3156
|
-
|
|
3157
|
-
* Hides the floating UI element.
|
|
3158
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3159
|
-
*/
|
|
3160
|
-
hideBib(eventType = "unknown") {
|
|
3167
|
+
hideBib() {
|
|
3161
3168
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3162
3169
|
this.lockScroll(false);
|
|
3163
3170
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3168,7 +3175,7 @@ class AuroFloatingUI {
|
|
|
3168
3175
|
if (this.showing) {
|
|
3169
3176
|
this.cleanupHideHandlers();
|
|
3170
3177
|
this.showing = false;
|
|
3171
|
-
this.dispatchEventDropdownToggle(
|
|
3178
|
+
this.dispatchEventDropdownToggle();
|
|
3172
3179
|
}
|
|
3173
3180
|
}
|
|
3174
3181
|
document.expandedAuroFloater = null;
|
|
@@ -3177,13 +3184,11 @@ class AuroFloatingUI {
|
|
|
3177
3184
|
/**
|
|
3178
3185
|
* @private
|
|
3179
3186
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3180
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3181
3187
|
*/
|
|
3182
|
-
dispatchEventDropdownToggle(
|
|
3188
|
+
dispatchEventDropdownToggle() {
|
|
3183
3189
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3184
3190
|
detail: {
|
|
3185
3191
|
expanded: this.showing,
|
|
3186
|
-
eventType: eventType || "unknown",
|
|
3187
3192
|
},
|
|
3188
3193
|
composed: true
|
|
3189
3194
|
});
|
|
@@ -3193,7 +3198,7 @@ class AuroFloatingUI {
|
|
|
3193
3198
|
|
|
3194
3199
|
handleClick() {
|
|
3195
3200
|
if (this.element.isPopoverVisible) {
|
|
3196
|
-
this.hideBib(
|
|
3201
|
+
this.hideBib();
|
|
3197
3202
|
} else {
|
|
3198
3203
|
this.showBib();
|
|
3199
3204
|
}
|
|
@@ -3220,7 +3225,7 @@ class AuroFloatingUI {
|
|
|
3220
3225
|
|
|
3221
3226
|
event.preventDefault();
|
|
3222
3227
|
this.handleClick();
|
|
3223
|
-
}
|
|
3228
|
+
}
|
|
3224
3229
|
break;
|
|
3225
3230
|
case 'mouseenter':
|
|
3226
3231
|
if (this.element.hoverToggle) {
|
|
@@ -3229,7 +3234,7 @@ class AuroFloatingUI {
|
|
|
3229
3234
|
break;
|
|
3230
3235
|
case 'mouseleave':
|
|
3231
3236
|
if (this.element.hoverToggle) {
|
|
3232
|
-
this.hideBib(
|
|
3237
|
+
this.hideBib();
|
|
3233
3238
|
}
|
|
3234
3239
|
break;
|
|
3235
3240
|
case 'focus':
|
|
@@ -4617,9 +4622,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4617
4622
|
|
|
4618
4623
|
this.parentBorder = false;
|
|
4619
4624
|
|
|
4620
|
-
/** @private */
|
|
4621
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4622
|
-
|
|
4623
4625
|
this.privateDefaults();
|
|
4624
4626
|
}
|
|
4625
4627
|
|
|
@@ -5053,19 +5055,12 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
5053
5055
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
5054
5056
|
this.handleTriggerContentSlotChange();
|
|
5055
5057
|
}
|
|
5056
|
-
}
|
|
5057
5058
|
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
handleDropdownToggle(event) {
|
|
5064
|
-
this.updateFocusTrap();
|
|
5065
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
5066
|
-
const eventType = event.detail.eventType || "unknown";
|
|
5067
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
5068
|
-
this.trigger.focus();
|
|
5059
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
5060
|
+
this.updateFocusTrap();
|
|
5061
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
5062
|
+
this.trigger.focus();
|
|
5063
|
+
}
|
|
5069
5064
|
}
|
|
5070
5065
|
}
|
|
5071
5066
|
|
|
@@ -5073,7 +5068,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
5073
5068
|
|
|
5074
5069
|
// Configure the floater to, this will generate the ID for the bib
|
|
5075
5070
|
this.floater.configure(this, 'auroDropdown');
|
|
5076
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
5077
5071
|
|
|
5078
5072
|
/**
|
|
5079
5073
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -848,13 +848,24 @@ class AuroFormValidation {
|
|
|
848
848
|
this.getInputElements(elem);
|
|
849
849
|
this.getAuroInputs(elem);
|
|
850
850
|
|
|
851
|
-
//
|
|
851
|
+
// Check if validation should run
|
|
852
852
|
let validationShouldRun =
|
|
853
|
+
|
|
854
|
+
// If the validation was forced
|
|
853
855
|
force ||
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
856
|
+
|
|
857
|
+
// If the validation should run on input
|
|
858
|
+
elem.validateOnInput ||
|
|
859
|
+
|
|
860
|
+
// State-based checks
|
|
861
|
+
(
|
|
862
|
+
// Element is not currently focused
|
|
863
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
864
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
865
|
+
|
|
866
|
+
// And element has been touched or is untouched but has a value
|
|
867
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
868
|
+
);
|
|
858
869
|
|
|
859
870
|
if (elem.hasAttribute('error')) {
|
|
860
871
|
elem.validity = 'customError';
|
|
@@ -2722,7 +2733,7 @@ class AuroFloatingUI {
|
|
|
2722
2733
|
*/
|
|
2723
2734
|
mirrorSize() {
|
|
2724
2735
|
// mirror the boxsize from bibSizer
|
|
2725
|
-
if (this.element.bibSizer
|
|
2736
|
+
if (this.element.bibSizer) {
|
|
2726
2737
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2727
2738
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2728
2739
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2934,13 +2945,13 @@ class AuroFloatingUI {
|
|
|
2934
2945
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2935
2946
|
return;
|
|
2936
2947
|
}
|
|
2937
|
-
|
|
2948
|
+
|
|
2938
2949
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2939
2950
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2940
2951
|
return;
|
|
2941
2952
|
}
|
|
2942
2953
|
|
|
2943
|
-
this.hideBib(
|
|
2954
|
+
this.hideBib();
|
|
2944
2955
|
}
|
|
2945
2956
|
|
|
2946
2957
|
setupHideHandlers() {
|
|
@@ -2965,7 +2976,7 @@ class AuroFloatingUI {
|
|
|
2965
2976
|
document.expandedAuroFormkitDropdown = null;
|
|
2966
2977
|
document.expandedAuroFloater = this;
|
|
2967
2978
|
} else {
|
|
2968
|
-
this.hideBib(
|
|
2979
|
+
this.hideBib();
|
|
2969
2980
|
}
|
|
2970
2981
|
}
|
|
2971
2982
|
};
|
|
@@ -2978,7 +2989,7 @@ class AuroFloatingUI {
|
|
|
2978
2989
|
// if something else is open, let it handle itself
|
|
2979
2990
|
return;
|
|
2980
2991
|
}
|
|
2981
|
-
this.hideBib(
|
|
2992
|
+
this.hideBib();
|
|
2982
2993
|
}
|
|
2983
2994
|
};
|
|
2984
2995
|
|
|
@@ -3061,11 +3072,7 @@ class AuroFloatingUI {
|
|
|
3061
3072
|
}
|
|
3062
3073
|
}
|
|
3063
3074
|
|
|
3064
|
-
|
|
3065
|
-
* Hides the floating UI element.
|
|
3066
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3067
|
-
*/
|
|
3068
|
-
hideBib(eventType = "unknown") {
|
|
3075
|
+
hideBib() {
|
|
3069
3076
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3070
3077
|
this.lockScroll(false);
|
|
3071
3078
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3076,7 +3083,7 @@ class AuroFloatingUI {
|
|
|
3076
3083
|
if (this.showing) {
|
|
3077
3084
|
this.cleanupHideHandlers();
|
|
3078
3085
|
this.showing = false;
|
|
3079
|
-
this.dispatchEventDropdownToggle(
|
|
3086
|
+
this.dispatchEventDropdownToggle();
|
|
3080
3087
|
}
|
|
3081
3088
|
}
|
|
3082
3089
|
document.expandedAuroFloater = null;
|
|
@@ -3085,13 +3092,11 @@ class AuroFloatingUI {
|
|
|
3085
3092
|
/**
|
|
3086
3093
|
* @private
|
|
3087
3094
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3088
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3089
3095
|
*/
|
|
3090
|
-
dispatchEventDropdownToggle(
|
|
3096
|
+
dispatchEventDropdownToggle() {
|
|
3091
3097
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3092
3098
|
detail: {
|
|
3093
3099
|
expanded: this.showing,
|
|
3094
|
-
eventType: eventType || "unknown",
|
|
3095
3100
|
},
|
|
3096
3101
|
composed: true
|
|
3097
3102
|
});
|
|
@@ -3101,7 +3106,7 @@ class AuroFloatingUI {
|
|
|
3101
3106
|
|
|
3102
3107
|
handleClick() {
|
|
3103
3108
|
if (this.element.isPopoverVisible) {
|
|
3104
|
-
this.hideBib(
|
|
3109
|
+
this.hideBib();
|
|
3105
3110
|
} else {
|
|
3106
3111
|
this.showBib();
|
|
3107
3112
|
}
|
|
@@ -3128,7 +3133,7 @@ class AuroFloatingUI {
|
|
|
3128
3133
|
|
|
3129
3134
|
event.preventDefault();
|
|
3130
3135
|
this.handleClick();
|
|
3131
|
-
}
|
|
3136
|
+
}
|
|
3132
3137
|
break;
|
|
3133
3138
|
case 'mouseenter':
|
|
3134
3139
|
if (this.element.hoverToggle) {
|
|
@@ -3137,7 +3142,7 @@ class AuroFloatingUI {
|
|
|
3137
3142
|
break;
|
|
3138
3143
|
case 'mouseleave':
|
|
3139
3144
|
if (this.element.hoverToggle) {
|
|
3140
|
-
this.hideBib(
|
|
3145
|
+
this.hideBib();
|
|
3141
3146
|
}
|
|
3142
3147
|
break;
|
|
3143
3148
|
case 'focus':
|
|
@@ -4525,9 +4530,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4525
4530
|
|
|
4526
4531
|
this.parentBorder = false;
|
|
4527
4532
|
|
|
4528
|
-
/** @private */
|
|
4529
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4530
|
-
|
|
4531
4533
|
this.privateDefaults();
|
|
4532
4534
|
}
|
|
4533
4535
|
|
|
@@ -4961,19 +4963,12 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4961
4963
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4962
4964
|
this.handleTriggerContentSlotChange();
|
|
4963
4965
|
}
|
|
4964
|
-
}
|
|
4965
4966
|
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
handleDropdownToggle(event) {
|
|
4972
|
-
this.updateFocusTrap();
|
|
4973
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
4974
|
-
const eventType = event.detail.eventType || "unknown";
|
|
4975
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4976
|
-
this.trigger.focus();
|
|
4967
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
4968
|
+
this.updateFocusTrap();
|
|
4969
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
4970
|
+
this.trigger.focus();
|
|
4971
|
+
}
|
|
4977
4972
|
}
|
|
4978
4973
|
}
|
|
4979
4974
|
|
|
@@ -4981,7 +4976,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4981
4976
|
|
|
4982
4977
|
// Configure the floater to, this will generate the ID for the bib
|
|
4983
4978
|
this.floater.configure(this, 'auroDropdown');
|
|
4984
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4985
4979
|
|
|
4986
4980
|
/**
|
|
4987
4981
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -808,13 +808,24 @@ class AuroFormValidation {
|
|
|
808
808
|
this.getInputElements(elem);
|
|
809
809
|
this.getAuroInputs(elem);
|
|
810
810
|
|
|
811
|
-
//
|
|
811
|
+
// Check if validation should run
|
|
812
812
|
let validationShouldRun =
|
|
813
|
+
|
|
814
|
+
// If the validation was forced
|
|
813
815
|
force ||
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
816
|
+
|
|
817
|
+
// If the validation should run on input
|
|
818
|
+
elem.validateOnInput ||
|
|
819
|
+
|
|
820
|
+
// State-based checks
|
|
821
|
+
(
|
|
822
|
+
// Element is not currently focused
|
|
823
|
+
!elem.contains(document.activeElement) && // native input is not focused directly
|
|
824
|
+
!document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
|
|
825
|
+
|
|
826
|
+
// And element has been touched or is untouched but has a value
|
|
827
|
+
( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
|
|
828
|
+
);
|
|
818
829
|
|
|
819
830
|
if (elem.hasAttribute('error')) {
|
|
820
831
|
elem.validity = 'customError';
|
|
@@ -2676,7 +2687,7 @@ class AuroFloatingUI {
|
|
|
2676
2687
|
*/
|
|
2677
2688
|
mirrorSize() {
|
|
2678
2689
|
// mirror the boxsize from bibSizer
|
|
2679
|
-
if (this.element.bibSizer
|
|
2690
|
+
if (this.element.bibSizer) {
|
|
2680
2691
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
2681
2692
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
2682
2693
|
if (sizerStyle.width !== '0px') {
|
|
@@ -2888,13 +2899,13 @@ class AuroFloatingUI {
|
|
|
2888
2899
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
2889
2900
|
return;
|
|
2890
2901
|
}
|
|
2891
|
-
|
|
2902
|
+
|
|
2892
2903
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
2893
2904
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
2894
2905
|
return;
|
|
2895
2906
|
}
|
|
2896
2907
|
|
|
2897
|
-
this.hideBib(
|
|
2908
|
+
this.hideBib();
|
|
2898
2909
|
}
|
|
2899
2910
|
|
|
2900
2911
|
setupHideHandlers() {
|
|
@@ -2919,7 +2930,7 @@ class AuroFloatingUI {
|
|
|
2919
2930
|
document.expandedAuroFormkitDropdown = null;
|
|
2920
2931
|
document.expandedAuroFloater = this;
|
|
2921
2932
|
} else {
|
|
2922
|
-
this.hideBib(
|
|
2933
|
+
this.hideBib();
|
|
2923
2934
|
}
|
|
2924
2935
|
}
|
|
2925
2936
|
};
|
|
@@ -2932,7 +2943,7 @@ class AuroFloatingUI {
|
|
|
2932
2943
|
// if something else is open, let it handle itself
|
|
2933
2944
|
return;
|
|
2934
2945
|
}
|
|
2935
|
-
this.hideBib(
|
|
2946
|
+
this.hideBib();
|
|
2936
2947
|
}
|
|
2937
2948
|
};
|
|
2938
2949
|
|
|
@@ -3015,11 +3026,7 @@ class AuroFloatingUI {
|
|
|
3015
3026
|
}
|
|
3016
3027
|
}
|
|
3017
3028
|
|
|
3018
|
-
|
|
3019
|
-
* Hides the floating UI element.
|
|
3020
|
-
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3021
|
-
*/
|
|
3022
|
-
hideBib(eventType = "unknown") {
|
|
3029
|
+
hideBib() {
|
|
3023
3030
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
3024
3031
|
this.lockScroll(false);
|
|
3025
3032
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -3030,7 +3037,7 @@ class AuroFloatingUI {
|
|
|
3030
3037
|
if (this.showing) {
|
|
3031
3038
|
this.cleanupHideHandlers();
|
|
3032
3039
|
this.showing = false;
|
|
3033
|
-
this.dispatchEventDropdownToggle(
|
|
3040
|
+
this.dispatchEventDropdownToggle();
|
|
3034
3041
|
}
|
|
3035
3042
|
}
|
|
3036
3043
|
document.expandedAuroFloater = null;
|
|
@@ -3039,13 +3046,11 @@ class AuroFloatingUI {
|
|
|
3039
3046
|
/**
|
|
3040
3047
|
* @private
|
|
3041
3048
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
3042
|
-
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3043
3049
|
*/
|
|
3044
|
-
dispatchEventDropdownToggle(
|
|
3050
|
+
dispatchEventDropdownToggle() {
|
|
3045
3051
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
3046
3052
|
detail: {
|
|
3047
3053
|
expanded: this.showing,
|
|
3048
|
-
eventType: eventType || "unknown",
|
|
3049
3054
|
},
|
|
3050
3055
|
composed: true
|
|
3051
3056
|
});
|
|
@@ -3055,7 +3060,7 @@ class AuroFloatingUI {
|
|
|
3055
3060
|
|
|
3056
3061
|
handleClick() {
|
|
3057
3062
|
if (this.element.isPopoverVisible) {
|
|
3058
|
-
this.hideBib(
|
|
3063
|
+
this.hideBib();
|
|
3059
3064
|
} else {
|
|
3060
3065
|
this.showBib();
|
|
3061
3066
|
}
|
|
@@ -3082,7 +3087,7 @@ class AuroFloatingUI {
|
|
|
3082
3087
|
|
|
3083
3088
|
event.preventDefault();
|
|
3084
3089
|
this.handleClick();
|
|
3085
|
-
}
|
|
3090
|
+
}
|
|
3086
3091
|
break;
|
|
3087
3092
|
case 'mouseenter':
|
|
3088
3093
|
if (this.element.hoverToggle) {
|
|
@@ -3091,7 +3096,7 @@ class AuroFloatingUI {
|
|
|
3091
3096
|
break;
|
|
3092
3097
|
case 'mouseleave':
|
|
3093
3098
|
if (this.element.hoverToggle) {
|
|
3094
|
-
this.hideBib(
|
|
3099
|
+
this.hideBib();
|
|
3095
3100
|
}
|
|
3096
3101
|
break;
|
|
3097
3102
|
case 'focus':
|
|
@@ -4479,9 +4484,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4479
4484
|
|
|
4480
4485
|
this.parentBorder = false;
|
|
4481
4486
|
|
|
4482
|
-
/** @private */
|
|
4483
|
-
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
4484
|
-
|
|
4485
4487
|
this.privateDefaults();
|
|
4486
4488
|
}
|
|
4487
4489
|
|
|
@@ -4915,19 +4917,12 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4915
4917
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
4916
4918
|
this.handleTriggerContentSlotChange();
|
|
4917
4919
|
}
|
|
4918
|
-
}
|
|
4919
4920
|
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
handleDropdownToggle(event) {
|
|
4926
|
-
this.updateFocusTrap();
|
|
4927
|
-
this.isPopoverVisible = event.detail.expanded;
|
|
4928
|
-
const eventType = event.detail.eventType || "unknown";
|
|
4929
|
-
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4930
|
-
this.trigger.focus();
|
|
4921
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
4922
|
+
this.updateFocusTrap();
|
|
4923
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
4924
|
+
this.trigger.focus();
|
|
4925
|
+
}
|
|
4931
4926
|
}
|
|
4932
4927
|
}
|
|
4933
4928
|
|
|
@@ -4935,7 +4930,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4935
4930
|
|
|
4936
4931
|
// Configure the floater to, this will generate the ID for the bib
|
|
4937
4932
|
this.floater.configure(this, 'auroDropdown');
|
|
4938
|
-
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
4939
4933
|
|
|
4940
4934
|
/**
|
|
4941
4935
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|