@aurodesignsystem-dev/auro-formkit 0.0.0-pr1422.1 → 0.0.0-pr1423.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 +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/api.min.js +165 -275
- package/components/combobox/demo/index.min.js +165 -275
- package/components/combobox/dist/index.js +165 -275
- package/components/combobox/dist/registered.js +165 -275
- package/components/counter/demo/api.min.js +164 -274
- package/components/counter/demo/index.min.js +164 -274
- package/components/counter/dist/index.js +164 -274
- package/components/counter/dist/registered.js +164 -274
- package/components/datepicker/demo/api.min.js +165 -275
- package/components/datepicker/demo/index.min.js +165 -275
- package/components/datepicker/dist/index.js +165 -275
- package/components/datepicker/dist/registered.js +165 -275
- package/components/dropdown/demo/api.min.js +164 -274
- package/components/dropdown/demo/index.min.js +164 -274
- package/components/dropdown/dist/index.js +164 -274
- package/components/dropdown/dist/registered.js +164 -274
- package/components/form/demo/api.min.js +661 -1101
- package/components/form/demo/index.min.js +661 -1101
- package/components/input/demo/api.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/radio/demo/api.min.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/api.min.js +164 -274
- package/components/select/demo/index.min.js +164 -274
- package/components/select/dist/index.js +164 -274
- package/components/select/dist/registered.js +164 -274
- package/package.json +2 -2
|
@@ -1521,7 +1521,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
};
|
|
1523
1523
|
|
|
1524
|
-
var formkitVersion$1 = '
|
|
1524
|
+
var formkitVersion$1 = '202604071525';
|
|
1525
1525
|
|
|
1526
1526
|
// Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
1527
1527
|
// See LICENSE in the project root for license information.
|
|
@@ -3837,19 +3837,11 @@ class AuroFloatingUI {
|
|
|
3837
3837
|
* This ensures that the bib content has the same dimensions as the sizer element.
|
|
3838
3838
|
*/
|
|
3839
3839
|
mirrorSize() {
|
|
3840
|
-
const element = this.element;
|
|
3841
|
-
if (!element) {
|
|
3842
|
-
return;
|
|
3843
|
-
}
|
|
3844
|
-
|
|
3845
3840
|
// mirror the boxsize from bibSizer
|
|
3846
|
-
if (element.bibSizer && element.matchWidth
|
|
3847
|
-
const sizerStyle = window.getComputedStyle(element.bibSizer);
|
|
3848
|
-
const bibContent =
|
|
3849
|
-
|
|
3850
|
-
return;
|
|
3851
|
-
}
|
|
3852
|
-
|
|
3841
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
3842
|
+
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
3843
|
+
const bibContent =
|
|
3844
|
+
this.element.bib.shadowRoot.querySelector(".container");
|
|
3853
3845
|
if (sizerStyle.width !== "0px") {
|
|
3854
3846
|
bibContent.style.width = sizerStyle.width;
|
|
3855
3847
|
}
|
|
@@ -3871,14 +3863,9 @@ class AuroFloatingUI {
|
|
|
3871
3863
|
* @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
|
|
3872
3864
|
*/
|
|
3873
3865
|
getPositioningStrategy() {
|
|
3874
|
-
const element = this.element;
|
|
3875
|
-
if (!element) {
|
|
3876
|
-
return this.behavior || "floating";
|
|
3877
|
-
}
|
|
3878
|
-
|
|
3879
3866
|
const breakpoint =
|
|
3880
|
-
element.bib
|
|
3881
|
-
element.floaterConfig?.fullscreenBreakpoint;
|
|
3867
|
+
this.element.bib.mobileFullscreenBreakpoint ||
|
|
3868
|
+
this.element.floaterConfig?.fullscreenBreakpoint;
|
|
3882
3869
|
switch (this.behavior) {
|
|
3883
3870
|
case "tooltip":
|
|
3884
3871
|
return "floating";
|
|
@@ -3889,9 +3876,9 @@ class AuroFloatingUI {
|
|
|
3889
3876
|
`(max-width: ${breakpoint})`,
|
|
3890
3877
|
).matches;
|
|
3891
3878
|
|
|
3892
|
-
element.expanded = smallerThanBreakpoint;
|
|
3879
|
+
this.element.expanded = smallerThanBreakpoint;
|
|
3893
3880
|
}
|
|
3894
|
-
if (element.nested) {
|
|
3881
|
+
if (this.element.nested) {
|
|
3895
3882
|
return "cover";
|
|
3896
3883
|
}
|
|
3897
3884
|
return "fullscreen";
|
|
@@ -3921,65 +3908,42 @@ class AuroFloatingUI {
|
|
|
3921
3908
|
* and applies the calculated position to the bib's style.
|
|
3922
3909
|
*/
|
|
3923
3910
|
position() {
|
|
3924
|
-
const element = this.element;
|
|
3925
|
-
if (!element) {
|
|
3926
|
-
return;
|
|
3927
|
-
}
|
|
3928
|
-
|
|
3929
3911
|
const strategy = this.getPositioningStrategy();
|
|
3930
3912
|
this.configureBibStrategy(strategy);
|
|
3931
3913
|
|
|
3932
3914
|
if (strategy === "floating") {
|
|
3933
|
-
if (!element.trigger || !element.bib) {
|
|
3934
|
-
return;
|
|
3935
|
-
}
|
|
3936
|
-
|
|
3937
3915
|
this.mirrorSize();
|
|
3938
3916
|
// Define the middlware for the floater configuration
|
|
3939
3917
|
const middleware = [
|
|
3940
|
-
offset(element.floaterConfig?.offset || 0),
|
|
3941
|
-
...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
|
|
3942
|
-
...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
|
|
3943
|
-
...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
|
|
3918
|
+
offset(this.element.floaterConfig?.offset || 0),
|
|
3919
|
+
...(this.element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
|
|
3920
|
+
...(this.element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
|
|
3921
|
+
...(this.element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
|
|
3944
3922
|
];
|
|
3945
3923
|
|
|
3946
3924
|
// Compute the position of the bib
|
|
3947
|
-
computePosition(element.trigger, element.bib, {
|
|
3948
|
-
strategy: element.floaterConfig?.strategy || "fixed",
|
|
3949
|
-
placement: element.floaterConfig?.placement,
|
|
3925
|
+
computePosition(this.element.trigger, this.element.bib, {
|
|
3926
|
+
strategy: this.element.floaterConfig?.strategy || "fixed",
|
|
3927
|
+
placement: this.element.floaterConfig?.placement,
|
|
3950
3928
|
middleware: middleware || [],
|
|
3951
3929
|
}).then(({ x, y }) => {
|
|
3952
3930
|
// eslint-disable-line id-length
|
|
3953
|
-
|
|
3954
|
-
if (!currentElement?.bib) {
|
|
3955
|
-
return;
|
|
3956
|
-
}
|
|
3957
|
-
|
|
3958
|
-
Object.assign(currentElement.bib.style, {
|
|
3931
|
+
Object.assign(this.element.bib.style, {
|
|
3959
3932
|
left: `${x}px`,
|
|
3960
3933
|
top: `${y}px`,
|
|
3961
3934
|
});
|
|
3962
3935
|
});
|
|
3963
3936
|
} else if (strategy === "cover") {
|
|
3964
|
-
if (!element.parentNode || !element.bib) {
|
|
3965
|
-
return;
|
|
3966
|
-
}
|
|
3967
|
-
|
|
3968
3937
|
// Compute the position of the bib
|
|
3969
|
-
computePosition(element.parentNode, element.bib, {
|
|
3938
|
+
computePosition(this.element.parentNode, this.element.bib, {
|
|
3970
3939
|
placement: "bottom-start",
|
|
3971
3940
|
}).then(({ x, y }) => {
|
|
3972
3941
|
// eslint-disable-line id-length
|
|
3973
|
-
|
|
3974
|
-
if (!currentElement?.bib || !currentElement.parentNode) {
|
|
3975
|
-
return;
|
|
3976
|
-
}
|
|
3977
|
-
|
|
3978
|
-
Object.assign(currentElement.bib.style, {
|
|
3942
|
+
Object.assign(this.element.bib.style, {
|
|
3979
3943
|
left: `${x}px`,
|
|
3980
|
-
top: `${y -
|
|
3981
|
-
width: `${
|
|
3982
|
-
height: `${
|
|
3944
|
+
top: `${y - this.element.parentNode.offsetHeight}px`,
|
|
3945
|
+
width: `${this.element.parentNode.offsetWidth}px`,
|
|
3946
|
+
height: `${this.element.parentNode.offsetHeight}px`,
|
|
3983
3947
|
});
|
|
3984
3948
|
});
|
|
3985
3949
|
}
|
|
@@ -3991,17 +3955,11 @@ class AuroFloatingUI {
|
|
|
3991
3955
|
* @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
|
|
3992
3956
|
*/
|
|
3993
3957
|
lockScroll(lock = true) {
|
|
3994
|
-
const element = this.element;
|
|
3995
|
-
|
|
3996
3958
|
if (lock) {
|
|
3997
|
-
if (!element?.bib) {
|
|
3998
|
-
return;
|
|
3999
|
-
}
|
|
4000
|
-
|
|
4001
3959
|
document.body.style.overflow = "hidden"; // hide body's scrollbar
|
|
4002
3960
|
|
|
4003
3961
|
// Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
|
|
4004
|
-
element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
3962
|
+
this.element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
4005
3963
|
} else {
|
|
4006
3964
|
document.body.style.overflow = "";
|
|
4007
3965
|
}
|
|
@@ -4017,24 +3975,20 @@ class AuroFloatingUI {
|
|
|
4017
3975
|
* @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
|
|
4018
3976
|
*/
|
|
4019
3977
|
configureBibStrategy(value) {
|
|
4020
|
-
const element = this.element;
|
|
4021
|
-
if (!element?.bib) {
|
|
4022
|
-
return;
|
|
4023
|
-
}
|
|
4024
|
-
|
|
4025
3978
|
if (value === "fullscreen") {
|
|
4026
|
-
element.isBibFullscreen = true;
|
|
3979
|
+
this.element.isBibFullscreen = true;
|
|
4027
3980
|
// reset the prev position
|
|
4028
|
-
element.bib.setAttribute("isfullscreen", "");
|
|
4029
|
-
element.bib.style.position = "fixed";
|
|
4030
|
-
element.bib.style.top = "0px";
|
|
4031
|
-
element.bib.style.left = "0px";
|
|
4032
|
-
element.bib.style.width = "";
|
|
4033
|
-
element.bib.style.height = "";
|
|
4034
|
-
element.style.contain = "";
|
|
3981
|
+
this.element.bib.setAttribute("isfullscreen", "");
|
|
3982
|
+
this.element.bib.style.position = "fixed";
|
|
3983
|
+
this.element.bib.style.top = "0px";
|
|
3984
|
+
this.element.bib.style.left = "0px";
|
|
3985
|
+
this.element.bib.style.width = "";
|
|
3986
|
+
this.element.bib.style.height = "";
|
|
3987
|
+
this.element.style.contain = "";
|
|
4035
3988
|
|
|
4036
3989
|
// reset the size that was mirroring `size` css-part
|
|
4037
|
-
const bibContent =
|
|
3990
|
+
const bibContent =
|
|
3991
|
+
this.element.bib.shadowRoot.querySelector(".container");
|
|
4038
3992
|
if (bibContent) {
|
|
4039
3993
|
bibContent.style.width = "";
|
|
4040
3994
|
bibContent.style.height = "";
|
|
@@ -4049,14 +4003,14 @@ class AuroFloatingUI {
|
|
|
4049
4003
|
}, 0);
|
|
4050
4004
|
}
|
|
4051
4005
|
|
|
4052
|
-
if (element.isPopoverVisible) {
|
|
4006
|
+
if (this.element.isPopoverVisible) {
|
|
4053
4007
|
this.lockScroll(true);
|
|
4054
4008
|
}
|
|
4055
4009
|
} else {
|
|
4056
|
-
element.bib.style.position = "";
|
|
4057
|
-
element.bib.removeAttribute("isfullscreen");
|
|
4058
|
-
element.isBibFullscreen = false;
|
|
4059
|
-
element.style.contain = "layout";
|
|
4010
|
+
this.element.bib.style.position = "";
|
|
4011
|
+
this.element.bib.removeAttribute("isfullscreen");
|
|
4012
|
+
this.element.isBibFullscreen = false;
|
|
4013
|
+
this.element.style.contain = "layout";
|
|
4060
4014
|
}
|
|
4061
4015
|
|
|
4062
4016
|
const isChanged = this.strategy && this.strategy !== value;
|
|
@@ -4074,21 +4028,16 @@ class AuroFloatingUI {
|
|
|
4074
4028
|
},
|
|
4075
4029
|
);
|
|
4076
4030
|
|
|
4077
|
-
element.dispatchEvent(event);
|
|
4031
|
+
this.element.dispatchEvent(event);
|
|
4078
4032
|
}
|
|
4079
4033
|
}
|
|
4080
4034
|
|
|
4081
4035
|
updateState() {
|
|
4082
|
-
const
|
|
4083
|
-
if (!element) {
|
|
4084
|
-
return;
|
|
4085
|
-
}
|
|
4086
|
-
|
|
4087
|
-
const isVisible = element.isPopoverVisible;
|
|
4036
|
+
const isVisible = this.element.isPopoverVisible;
|
|
4088
4037
|
if (!isVisible) {
|
|
4089
4038
|
this.cleanupHideHandlers();
|
|
4090
4039
|
try {
|
|
4091
|
-
element.cleanup?.();
|
|
4040
|
+
this.element.cleanup?.();
|
|
4092
4041
|
} catch (error) {
|
|
4093
4042
|
// Do nothing
|
|
4094
4043
|
}
|
|
@@ -4104,30 +4053,28 @@ class AuroFloatingUI {
|
|
|
4104
4053
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
4105
4054
|
*/
|
|
4106
4055
|
handleFocusLoss() {
|
|
4107
|
-
const element = this.element;
|
|
4108
|
-
if (!element?.bib) {
|
|
4109
|
-
return;
|
|
4110
|
-
}
|
|
4111
|
-
|
|
4112
4056
|
// if mouse is being pressed, skip and let click event to handle the action
|
|
4113
4057
|
if (AuroFloatingUI.isMousePressed) {
|
|
4114
4058
|
return;
|
|
4115
4059
|
}
|
|
4116
4060
|
|
|
4117
4061
|
if (
|
|
4118
|
-
element.noHideOnThisFocusLoss ||
|
|
4119
|
-
element.hasAttribute("noHideOnThisFocusLoss")
|
|
4062
|
+
this.element.noHideOnThisFocusLoss ||
|
|
4063
|
+
this.element.hasAttribute("noHideOnThisFocusLoss")
|
|
4120
4064
|
) {
|
|
4121
4065
|
return;
|
|
4122
4066
|
}
|
|
4123
4067
|
|
|
4124
4068
|
// if focus is still inside of trigger or bib, do not close
|
|
4125
|
-
if (
|
|
4069
|
+
if (
|
|
4070
|
+
this.element.matches(":focus") ||
|
|
4071
|
+
this.element.matches(":focus-within")
|
|
4072
|
+
) {
|
|
4126
4073
|
return;
|
|
4127
4074
|
}
|
|
4128
4075
|
|
|
4129
4076
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
4130
|
-
if (element.bib.hasAttribute("isfullscreen")) {
|
|
4077
|
+
if (this.element.bib.hasAttribute("isfullscreen")) {
|
|
4131
4078
|
return;
|
|
4132
4079
|
}
|
|
4133
4080
|
|
|
@@ -4135,32 +4082,23 @@ class AuroFloatingUI {
|
|
|
4135
4082
|
}
|
|
4136
4083
|
|
|
4137
4084
|
setupHideHandlers() {
|
|
4138
|
-
if (!this.element) {
|
|
4139
|
-
return;
|
|
4140
|
-
}
|
|
4141
|
-
|
|
4142
4085
|
// Define handlers & store references
|
|
4143
4086
|
this.focusHandler = () => this.handleFocusLoss();
|
|
4144
4087
|
|
|
4145
4088
|
this.clickHandler = (evt) => {
|
|
4146
|
-
const element = this.element;
|
|
4147
|
-
if (!element?.bib) {
|
|
4148
|
-
return;
|
|
4149
|
-
}
|
|
4150
|
-
|
|
4151
4089
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
4152
4090
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
4153
4091
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
4154
4092
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
4155
|
-
if (element.bib.hasAttribute("isfullscreen")) {
|
|
4093
|
+
if (this.element.bib && this.element.bib.hasAttribute("isfullscreen")) {
|
|
4156
4094
|
return;
|
|
4157
4095
|
}
|
|
4158
4096
|
|
|
4159
4097
|
if (
|
|
4160
|
-
(!evt.composedPath().includes(element.trigger) &&
|
|
4161
|
-
!evt.composedPath().includes(element.bib)) ||
|
|
4162
|
-
(element.bib.backdrop &&
|
|
4163
|
-
evt.composedPath().includes(element.bib.backdrop))
|
|
4098
|
+
(!evt.composedPath().includes(this.element.trigger) &&
|
|
4099
|
+
!evt.composedPath().includes(this.element.bib)) ||
|
|
4100
|
+
(this.element.bib.backdrop &&
|
|
4101
|
+
evt.composedPath().includes(this.element.bib.backdrop))
|
|
4164
4102
|
) {
|
|
4165
4103
|
const existedVisibleFloatingUI =
|
|
4166
4104
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -4181,12 +4119,7 @@ class AuroFloatingUI {
|
|
|
4181
4119
|
|
|
4182
4120
|
// ESC key handler
|
|
4183
4121
|
this.keyDownHandler = (evt) => {
|
|
4184
|
-
|
|
4185
|
-
if (!element) {
|
|
4186
|
-
return;
|
|
4187
|
-
}
|
|
4188
|
-
|
|
4189
|
-
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
4122
|
+
if (evt.key === "Escape" && this.element.isPopoverVisible) {
|
|
4190
4123
|
const existedVisibleFloatingUI =
|
|
4191
4124
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
4192
4125
|
if (
|
|
@@ -4243,10 +4176,6 @@ class AuroFloatingUI {
|
|
|
4243
4176
|
}
|
|
4244
4177
|
|
|
4245
4178
|
updateCurrentExpandedDropdown() {
|
|
4246
|
-
if (!this.element) {
|
|
4247
|
-
return;
|
|
4248
|
-
}
|
|
4249
|
-
|
|
4250
4179
|
// Close any other dropdown that is already open
|
|
4251
4180
|
const existedVisibleFloatingUI =
|
|
4252
4181
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -4263,34 +4192,25 @@ class AuroFloatingUI {
|
|
|
4263
4192
|
}
|
|
4264
4193
|
|
|
4265
4194
|
showBib() {
|
|
4266
|
-
|
|
4267
|
-
if (!element) {
|
|
4268
|
-
return;
|
|
4269
|
-
}
|
|
4270
|
-
|
|
4271
|
-
if (!element.disabled && !this.showing) {
|
|
4195
|
+
if (!this.element.disabled && !this.showing) {
|
|
4272
4196
|
this.updateCurrentExpandedDropdown();
|
|
4273
|
-
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
4197
|
+
this.element.triggerChevron?.setAttribute("data-expanded", true);
|
|
4274
4198
|
|
|
4275
4199
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
4276
4200
|
if (!this.showing) {
|
|
4277
|
-
if (!element.modal) {
|
|
4201
|
+
if (!this.element.modal) {
|
|
4278
4202
|
this.setupHideHandlers();
|
|
4279
4203
|
}
|
|
4280
4204
|
this.showing = true;
|
|
4281
|
-
element.isPopoverVisible = true;
|
|
4205
|
+
this.element.isPopoverVisible = true;
|
|
4282
4206
|
this.position();
|
|
4283
4207
|
this.dispatchEventDropdownToggle();
|
|
4284
4208
|
}
|
|
4285
4209
|
|
|
4286
|
-
if (!element.bib || (!element.trigger && !element.parentNode)) {
|
|
4287
|
-
return;
|
|
4288
|
-
}
|
|
4289
|
-
|
|
4290
4210
|
// Setup auto update to handle resize and scroll
|
|
4291
|
-
element.cleanup = autoUpdate(
|
|
4292
|
-
element.trigger || element.parentNode,
|
|
4293
|
-
element.bib,
|
|
4211
|
+
this.element.cleanup = autoUpdate(
|
|
4212
|
+
this.element.trigger || this.element.parentNode,
|
|
4213
|
+
this.element.bib,
|
|
4294
4214
|
() => {
|
|
4295
4215
|
this.position();
|
|
4296
4216
|
},
|
|
@@ -4303,27 +4223,22 @@ class AuroFloatingUI {
|
|
|
4303
4223
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
4304
4224
|
*/
|
|
4305
4225
|
hideBib(eventType = "unknown") {
|
|
4306
|
-
|
|
4307
|
-
if (!element) {
|
|
4308
|
-
return;
|
|
4309
|
-
}
|
|
4310
|
-
|
|
4311
|
-
if (element.disabled) {
|
|
4226
|
+
if (this.element.disabled) {
|
|
4312
4227
|
return;
|
|
4313
4228
|
}
|
|
4314
4229
|
|
|
4315
4230
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
4316
4231
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
4317
4232
|
// Escape key or focus loss.
|
|
4318
|
-
if (element.noToggle && eventType === "click") {
|
|
4233
|
+
if (this.element.noToggle && eventType === "click") {
|
|
4319
4234
|
return;
|
|
4320
4235
|
}
|
|
4321
4236
|
|
|
4322
4237
|
this.lockScroll(false);
|
|
4323
|
-
element.triggerChevron?.removeAttribute("data-expanded");
|
|
4238
|
+
this.element.triggerChevron?.removeAttribute("data-expanded");
|
|
4324
4239
|
|
|
4325
|
-
if (element.isPopoverVisible) {
|
|
4326
|
-
element.isPopoverVisible = false;
|
|
4240
|
+
if (this.element.isPopoverVisible) {
|
|
4241
|
+
this.element.isPopoverVisible = false;
|
|
4327
4242
|
}
|
|
4328
4243
|
if (this.showing) {
|
|
4329
4244
|
this.cleanupHideHandlers();
|
|
@@ -4343,11 +4258,6 @@ class AuroFloatingUI {
|
|
|
4343
4258
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
4344
4259
|
*/
|
|
4345
4260
|
dispatchEventDropdownToggle(eventType) {
|
|
4346
|
-
const element = this.element;
|
|
4347
|
-
if (!element) {
|
|
4348
|
-
return;
|
|
4349
|
-
}
|
|
4350
|
-
|
|
4351
4261
|
const event = new CustomEvent(
|
|
4352
4262
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
4353
4263
|
{
|
|
@@ -4359,16 +4269,11 @@ class AuroFloatingUI {
|
|
|
4359
4269
|
},
|
|
4360
4270
|
);
|
|
4361
4271
|
|
|
4362
|
-
element.dispatchEvent(event);
|
|
4272
|
+
this.element.dispatchEvent(event);
|
|
4363
4273
|
}
|
|
4364
4274
|
|
|
4365
4275
|
handleClick() {
|
|
4366
|
-
|
|
4367
|
-
if (!element) {
|
|
4368
|
-
return;
|
|
4369
|
-
}
|
|
4370
|
-
|
|
4371
|
-
if (element.isPopoverVisible) {
|
|
4276
|
+
if (this.element.isPopoverVisible) {
|
|
4372
4277
|
this.hideBib("click");
|
|
4373
4278
|
} else {
|
|
4374
4279
|
this.showBib();
|
|
@@ -4379,66 +4284,63 @@ class AuroFloatingUI {
|
|
|
4379
4284
|
{
|
|
4380
4285
|
composed: true,
|
|
4381
4286
|
detail: {
|
|
4382
|
-
expanded: element.isPopoverVisible,
|
|
4287
|
+
expanded: this.element.isPopoverVisible,
|
|
4383
4288
|
},
|
|
4384
4289
|
},
|
|
4385
4290
|
);
|
|
4386
4291
|
|
|
4387
|
-
element.dispatchEvent(event);
|
|
4292
|
+
this.element.dispatchEvent(event);
|
|
4388
4293
|
}
|
|
4389
4294
|
|
|
4390
4295
|
handleEvent(event) {
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
event.preventDefault();
|
|
4407
|
-
this.handleClick();
|
|
4296
|
+
if (!this.element.disableEventShow) {
|
|
4297
|
+
switch (event.type) {
|
|
4298
|
+
case "keydown": {
|
|
4299
|
+
// Support both Enter and Space keys for accessibility
|
|
4300
|
+
// Space is included as it's expected behavior for interactive elements
|
|
4301
|
+
|
|
4302
|
+
const origin = event.composedPath()[0];
|
|
4303
|
+
if (
|
|
4304
|
+
event.key === "Enter" ||
|
|
4305
|
+
(event.key === " " && (!origin || origin.tagName !== "INPUT"))
|
|
4306
|
+
) {
|
|
4307
|
+
event.preventDefault();
|
|
4308
|
+
this.handleClick();
|
|
4309
|
+
}
|
|
4310
|
+
break;
|
|
4408
4311
|
}
|
|
4409
|
-
|
|
4312
|
+
case "mouseenter":
|
|
4313
|
+
if (this.element.hoverToggle) {
|
|
4314
|
+
this.showBib();
|
|
4315
|
+
}
|
|
4316
|
+
break;
|
|
4317
|
+
case "mouseleave":
|
|
4318
|
+
if (this.element.hoverToggle) {
|
|
4319
|
+
this.hideBib("mouseleave");
|
|
4320
|
+
}
|
|
4321
|
+
break;
|
|
4322
|
+
case "focus":
|
|
4323
|
+
if (this.element.focusShow) {
|
|
4324
|
+
/*
|
|
4325
|
+
This needs to better handle clicking that gives focus -
|
|
4326
|
+
currently it shows and then immediately hides the bib
|
|
4327
|
+
*/
|
|
4328
|
+
this.showBib();
|
|
4329
|
+
}
|
|
4330
|
+
break;
|
|
4331
|
+
case "blur":
|
|
4332
|
+
// send this task 100ms later queue to
|
|
4333
|
+
// wait a frame in case focus moves within the floating element/bib
|
|
4334
|
+
setTimeout(() => this.handleFocusLoss(), 0);
|
|
4335
|
+
break;
|
|
4336
|
+
case "click":
|
|
4337
|
+
if (document.activeElement === document.body) {
|
|
4338
|
+
event.currentTarget.focus();
|
|
4339
|
+
}
|
|
4340
|
+
this.handleClick();
|
|
4341
|
+
break;
|
|
4342
|
+
// Do nothing
|
|
4410
4343
|
}
|
|
4411
|
-
case "mouseenter":
|
|
4412
|
-
if (element.hoverToggle) {
|
|
4413
|
-
this.showBib();
|
|
4414
|
-
}
|
|
4415
|
-
break;
|
|
4416
|
-
case "mouseleave":
|
|
4417
|
-
if (element.hoverToggle) {
|
|
4418
|
-
this.hideBib("mouseleave");
|
|
4419
|
-
}
|
|
4420
|
-
break;
|
|
4421
|
-
case "focus":
|
|
4422
|
-
if (element.focusShow) {
|
|
4423
|
-
/*
|
|
4424
|
-
This needs to better handle clicking that gives focus -
|
|
4425
|
-
currently it shows and then immediately hides the bib
|
|
4426
|
-
*/
|
|
4427
|
-
this.showBib();
|
|
4428
|
-
}
|
|
4429
|
-
break;
|
|
4430
|
-
case "blur":
|
|
4431
|
-
// send this task 100ms later queue to
|
|
4432
|
-
// wait a frame in case focus moves within the floating element/bib
|
|
4433
|
-
setTimeout(() => this.handleFocusLoss(), 0);
|
|
4434
|
-
break;
|
|
4435
|
-
case "click":
|
|
4436
|
-
if (document.activeElement === document.body) {
|
|
4437
|
-
event.currentTarget.focus();
|
|
4438
|
-
}
|
|
4439
|
-
this.handleClick();
|
|
4440
|
-
break;
|
|
4441
|
-
// Do nothing
|
|
4442
4344
|
}
|
|
4443
4345
|
}
|
|
4444
4346
|
|
|
@@ -4449,11 +4351,6 @@ class AuroFloatingUI {
|
|
|
4449
4351
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
4450
4352
|
*/
|
|
4451
4353
|
handleTriggerTabIndex() {
|
|
4452
|
-
const element = this.element;
|
|
4453
|
-
if (!element) {
|
|
4454
|
-
return;
|
|
4455
|
-
}
|
|
4456
|
-
|
|
4457
4354
|
const focusableElementSelectors = [
|
|
4458
4355
|
"a",
|
|
4459
4356
|
"button",
|
|
@@ -4466,7 +4363,7 @@ class AuroFloatingUI {
|
|
|
4466
4363
|
"auro-hyperlink",
|
|
4467
4364
|
];
|
|
4468
4365
|
|
|
4469
|
-
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
4366
|
+
const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
|
|
4470
4367
|
if (!triggerNode) {
|
|
4471
4368
|
return;
|
|
4472
4369
|
}
|
|
@@ -4475,13 +4372,13 @@ class AuroFloatingUI {
|
|
|
4475
4372
|
focusableElementSelectors.forEach((selector) => {
|
|
4476
4373
|
// Check if the trigger node element is focusable
|
|
4477
4374
|
if (triggerNodeTagName === selector) {
|
|
4478
|
-
element.tabIndex = -1;
|
|
4375
|
+
this.element.tabIndex = -1;
|
|
4479
4376
|
return;
|
|
4480
4377
|
}
|
|
4481
4378
|
|
|
4482
4379
|
// Check if any child is focusable
|
|
4483
4380
|
if (triggerNode.querySelector(selector)) {
|
|
4484
|
-
element.tabIndex = -1;
|
|
4381
|
+
this.element.tabIndex = -1;
|
|
4485
4382
|
}
|
|
4486
4383
|
});
|
|
4487
4384
|
}
|
|
@@ -4491,18 +4388,13 @@ class AuroFloatingUI {
|
|
|
4491
4388
|
* @param {*} eventPrefix
|
|
4492
4389
|
*/
|
|
4493
4390
|
regenerateBibId() {
|
|
4494
|
-
|
|
4495
|
-
if (!element) {
|
|
4496
|
-
return;
|
|
4497
|
-
}
|
|
4498
|
-
|
|
4499
|
-
this.id = element.getAttribute("id");
|
|
4391
|
+
this.id = this.element.getAttribute("id");
|
|
4500
4392
|
if (!this.id) {
|
|
4501
4393
|
this.id = window.crypto.randomUUID();
|
|
4502
|
-
element.setAttribute("id", this.id);
|
|
4394
|
+
this.element.setAttribute("id", this.id);
|
|
4503
4395
|
}
|
|
4504
4396
|
|
|
4505
|
-
element.bib
|
|
4397
|
+
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
4506
4398
|
}
|
|
4507
4399
|
|
|
4508
4400
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -4514,69 +4406,67 @@ class AuroFloatingUI {
|
|
|
4514
4406
|
this.element = elem;
|
|
4515
4407
|
}
|
|
4516
4408
|
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
return;
|
|
4409
|
+
if (this.behavior !== this.element.behavior) {
|
|
4410
|
+
this.behavior = this.element.behavior;
|
|
4520
4411
|
}
|
|
4521
4412
|
|
|
4522
|
-
if (this.
|
|
4523
|
-
this.behavior = element.behavior;
|
|
4524
|
-
}
|
|
4525
|
-
|
|
4526
|
-
if (element.trigger) {
|
|
4413
|
+
if (this.element.trigger) {
|
|
4527
4414
|
this.disconnect();
|
|
4528
4415
|
}
|
|
4529
|
-
element.trigger =
|
|
4530
|
-
element.triggerElement ||
|
|
4531
|
-
element.shadowRoot
|
|
4532
|
-
element.trigger;
|
|
4533
|
-
element.bib =
|
|
4534
|
-
|
|
4535
|
-
element.
|
|
4536
|
-
|
|
4416
|
+
this.element.trigger =
|
|
4417
|
+
this.element.triggerElement ||
|
|
4418
|
+
this.element.shadowRoot.querySelector("#trigger") ||
|
|
4419
|
+
this.element.trigger;
|
|
4420
|
+
this.element.bib =
|
|
4421
|
+
this.element.shadowRoot.querySelector("#bib") || this.element.bib;
|
|
4422
|
+
this.element.bibSizer = this.element.shadowRoot.querySelector("#bibSizer");
|
|
4423
|
+
this.element.triggerChevron =
|
|
4424
|
+
this.element.shadowRoot.querySelector("#showStateIcon");
|
|
4537
4425
|
|
|
4538
|
-
if (element.floaterConfig) {
|
|
4539
|
-
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
4426
|
+
if (this.element.floaterConfig) {
|
|
4427
|
+
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
4540
4428
|
}
|
|
4541
4429
|
|
|
4542
4430
|
this.regenerateBibId();
|
|
4543
4431
|
this.handleTriggerTabIndex();
|
|
4544
4432
|
|
|
4545
4433
|
this.handleEvent = this.handleEvent.bind(this);
|
|
4546
|
-
if (element.trigger) {
|
|
4434
|
+
if (this.element.trigger) {
|
|
4547
4435
|
if (this.enableKeyboardHandling) {
|
|
4548
|
-
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
4436
|
+
this.element.trigger.addEventListener("keydown", this.handleEvent);
|
|
4549
4437
|
}
|
|
4550
|
-
element.trigger.addEventListener("click", this.handleEvent);
|
|
4551
|
-
element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
4552
|
-
element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
4553
|
-
element.trigger.addEventListener("focus", this.handleEvent);
|
|
4554
|
-
element.trigger.addEventListener("blur", this.handleEvent);
|
|
4438
|
+
this.element.trigger.addEventListener("click", this.handleEvent);
|
|
4439
|
+
this.element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
4440
|
+
this.element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
4441
|
+
this.element.trigger.addEventListener("focus", this.handleEvent);
|
|
4442
|
+
this.element.trigger.addEventListener("blur", this.handleEvent);
|
|
4555
4443
|
}
|
|
4556
4444
|
}
|
|
4557
4445
|
|
|
4558
4446
|
disconnect() {
|
|
4559
4447
|
this.cleanupHideHandlers();
|
|
4448
|
+
if (this.element) {
|
|
4449
|
+
this.element.cleanup?.();
|
|
4560
4450
|
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
}
|
|
4565
|
-
|
|
4566
|
-
element.cleanup?.();
|
|
4567
|
-
|
|
4568
|
-
if (element.bib && element.shadowRoot) {
|
|
4569
|
-
element.shadowRoot.append(element.bib);
|
|
4570
|
-
}
|
|
4451
|
+
if (this.element.bib) {
|
|
4452
|
+
this.element.shadowRoot.append(this.element.bib);
|
|
4453
|
+
}
|
|
4571
4454
|
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4455
|
+
// Remove event & keyboard listeners
|
|
4456
|
+
if (this.element?.trigger) {
|
|
4457
|
+
this.element.trigger.removeEventListener("keydown", this.handleEvent);
|
|
4458
|
+
this.element.trigger.removeEventListener("click", this.handleEvent);
|
|
4459
|
+
this.element.trigger.removeEventListener(
|
|
4460
|
+
"mouseenter",
|
|
4461
|
+
this.handleEvent,
|
|
4462
|
+
);
|
|
4463
|
+
this.element.trigger.removeEventListener(
|
|
4464
|
+
"mouseleave",
|
|
4465
|
+
this.handleEvent,
|
|
4466
|
+
);
|
|
4467
|
+
this.element.trigger.removeEventListener("focus", this.handleEvent);
|
|
4468
|
+
this.element.trigger.removeEventListener("blur", this.handleEvent);
|
|
4469
|
+
}
|
|
4580
4470
|
}
|
|
4581
4471
|
}
|
|
4582
4472
|
}
|
|
@@ -5704,7 +5594,7 @@ class AuroHelpText extends i$2 {
|
|
|
5704
5594
|
}
|
|
5705
5595
|
}
|
|
5706
5596
|
|
|
5707
|
-
var formkitVersion = '
|
|
5597
|
+
var formkitVersion = '202604071525';
|
|
5708
5598
|
|
|
5709
5599
|
let AuroElement$1 = class AuroElement extends i$2 {
|
|
5710
5600
|
static get properties() {
|