@aurodesignsystem-dev/auro-formkit 0.0.0-pr1422.2 → 0.0.0-pr1424.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/CHANGELOG.md +2 -2
- package/README.md +183 -133
- 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 -276
- package/components/combobox/demo/index.min.js +165 -276
- package/components/combobox/dist/index.js +165 -276
- package/components/combobox/dist/registered.js +165 -276
- package/components/counter/demo/api.min.js +164 -275
- package/components/counter/demo/index.min.js +164 -275
- package/components/counter/dist/index.js +164 -275
- package/components/counter/dist/registered.js +164 -275
- package/components/datepicker/demo/api.min.js +165 -276
- package/components/datepicker/demo/index.min.js +165 -276
- package/components/datepicker/dist/index.js +165 -276
- package/components/datepicker/dist/registered.js +165 -276
- package/components/dropdown/demo/api.min.js +164 -275
- package/components/dropdown/demo/index.min.js +164 -275
- package/components/dropdown/dist/index.js +164 -275
- package/components/dropdown/dist/registered.js +164 -275
- package/components/form/demo/api.md +460 -76
- package/components/form/demo/api.min.js +661 -1105
- package/components/form/demo/index.min.js +661 -1105
- 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 -275
- package/components/select/demo/index.min.js +164 -275
- package/components/select/dist/index.js +164 -275
- package/components/select/dist/registered.js +164 -275
- package/package.json +3 -3
|
@@ -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 = '202604072118';
|
|
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 "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,33 +4082,23 @@ class AuroFloatingUI {
|
|
|
4135
4082
|
}
|
|
4136
4083
|
|
|
4137
4084
|
setupHideHandlers() {
|
|
4138
|
-
const element = this.element;
|
|
4139
|
-
if (!element) {
|
|
4140
|
-
return;
|
|
4141
|
-
}
|
|
4142
|
-
|
|
4143
4085
|
// Define handlers & store references
|
|
4144
4086
|
this.focusHandler = () => this.handleFocusLoss();
|
|
4145
4087
|
|
|
4146
4088
|
this.clickHandler = (evt) => {
|
|
4147
|
-
const element = this.element;
|
|
4148
|
-
if (!element?.bib) {
|
|
4149
|
-
return;
|
|
4150
|
-
}
|
|
4151
|
-
|
|
4152
4089
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
4153
4090
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
4154
4091
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
4155
4092
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
4156
|
-
if (element.bib.hasAttribute("isfullscreen")) {
|
|
4093
|
+
if (this.element.bib && this.element.bib.hasAttribute("isfullscreen")) {
|
|
4157
4094
|
return;
|
|
4158
4095
|
}
|
|
4159
4096
|
|
|
4160
4097
|
if (
|
|
4161
|
-
(!evt.composedPath().includes(element.trigger) &&
|
|
4162
|
-
!evt.composedPath().includes(element.bib)) ||
|
|
4163
|
-
(element.bib.backdrop &&
|
|
4164
|
-
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))
|
|
4165
4102
|
) {
|
|
4166
4103
|
const existedVisibleFloatingUI =
|
|
4167
4104
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -4182,12 +4119,7 @@ class AuroFloatingUI {
|
|
|
4182
4119
|
|
|
4183
4120
|
// ESC key handler
|
|
4184
4121
|
this.keyDownHandler = (evt) => {
|
|
4185
|
-
|
|
4186
|
-
if (!element) {
|
|
4187
|
-
return;
|
|
4188
|
-
}
|
|
4189
|
-
|
|
4190
|
-
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
4122
|
+
if (evt.key === "Escape" && this.element.isPopoverVisible) {
|
|
4191
4123
|
const existedVisibleFloatingUI =
|
|
4192
4124
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
4193
4125
|
if (
|
|
@@ -4244,10 +4176,6 @@ class AuroFloatingUI {
|
|
|
4244
4176
|
}
|
|
4245
4177
|
|
|
4246
4178
|
updateCurrentExpandedDropdown() {
|
|
4247
|
-
if (!this.element) {
|
|
4248
|
-
return;
|
|
4249
|
-
}
|
|
4250
|
-
|
|
4251
4179
|
// Close any other dropdown that is already open
|
|
4252
4180
|
const existedVisibleFloatingUI =
|
|
4253
4181
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -4264,34 +4192,25 @@ class AuroFloatingUI {
|
|
|
4264
4192
|
}
|
|
4265
4193
|
|
|
4266
4194
|
showBib() {
|
|
4267
|
-
|
|
4268
|
-
if (!element) {
|
|
4269
|
-
return;
|
|
4270
|
-
}
|
|
4271
|
-
|
|
4272
|
-
if (!element.bib || (!element.trigger && !element.parentNode)) {
|
|
4273
|
-
return;
|
|
4274
|
-
}
|
|
4275
|
-
|
|
4276
|
-
if (!element.disabled && !this.showing) {
|
|
4195
|
+
if (!this.element.disabled && !this.showing) {
|
|
4277
4196
|
this.updateCurrentExpandedDropdown();
|
|
4278
|
-
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
4197
|
+
this.element.triggerChevron?.setAttribute("data-expanded", true);
|
|
4279
4198
|
|
|
4280
4199
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
4281
4200
|
if (!this.showing) {
|
|
4282
|
-
if (!element.modal) {
|
|
4201
|
+
if (!this.element.modal) {
|
|
4283
4202
|
this.setupHideHandlers();
|
|
4284
4203
|
}
|
|
4285
4204
|
this.showing = true;
|
|
4286
|
-
element.isPopoverVisible = true;
|
|
4205
|
+
this.element.isPopoverVisible = true;
|
|
4287
4206
|
this.position();
|
|
4288
4207
|
this.dispatchEventDropdownToggle();
|
|
4289
4208
|
}
|
|
4290
4209
|
|
|
4291
4210
|
// Setup auto update to handle resize and scroll
|
|
4292
|
-
element.cleanup = autoUpdate(
|
|
4293
|
-
element.trigger || element.parentNode,
|
|
4294
|
-
element.bib,
|
|
4211
|
+
this.element.cleanup = autoUpdate(
|
|
4212
|
+
this.element.trigger || this.element.parentNode,
|
|
4213
|
+
this.element.bib,
|
|
4295
4214
|
() => {
|
|
4296
4215
|
this.position();
|
|
4297
4216
|
},
|
|
@@ -4304,27 +4223,22 @@ class AuroFloatingUI {
|
|
|
4304
4223
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
4305
4224
|
*/
|
|
4306
4225
|
hideBib(eventType = "unknown") {
|
|
4307
|
-
|
|
4308
|
-
if (!element) {
|
|
4309
|
-
return;
|
|
4310
|
-
}
|
|
4311
|
-
|
|
4312
|
-
if (element.disabled) {
|
|
4226
|
+
if (this.element.disabled) {
|
|
4313
4227
|
return;
|
|
4314
4228
|
}
|
|
4315
4229
|
|
|
4316
4230
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
4317
4231
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
4318
4232
|
// Escape key or focus loss.
|
|
4319
|
-
if (element.noToggle && eventType === "click") {
|
|
4233
|
+
if (this.element.noToggle && eventType === "click") {
|
|
4320
4234
|
return;
|
|
4321
4235
|
}
|
|
4322
4236
|
|
|
4323
4237
|
this.lockScroll(false);
|
|
4324
|
-
element.triggerChevron?.removeAttribute("data-expanded");
|
|
4238
|
+
this.element.triggerChevron?.removeAttribute("data-expanded");
|
|
4325
4239
|
|
|
4326
|
-
if (element.isPopoverVisible) {
|
|
4327
|
-
element.isPopoverVisible = false;
|
|
4240
|
+
if (this.element.isPopoverVisible) {
|
|
4241
|
+
this.element.isPopoverVisible = false;
|
|
4328
4242
|
}
|
|
4329
4243
|
if (this.showing) {
|
|
4330
4244
|
this.cleanupHideHandlers();
|
|
@@ -4344,11 +4258,6 @@ class AuroFloatingUI {
|
|
|
4344
4258
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
4345
4259
|
*/
|
|
4346
4260
|
dispatchEventDropdownToggle(eventType) {
|
|
4347
|
-
const element = this.element;
|
|
4348
|
-
if (!element) {
|
|
4349
|
-
return;
|
|
4350
|
-
}
|
|
4351
|
-
|
|
4352
4261
|
const event = new CustomEvent(
|
|
4353
4262
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
4354
4263
|
{
|
|
@@ -4360,16 +4269,11 @@ class AuroFloatingUI {
|
|
|
4360
4269
|
},
|
|
4361
4270
|
);
|
|
4362
4271
|
|
|
4363
|
-
element.dispatchEvent(event);
|
|
4272
|
+
this.element.dispatchEvent(event);
|
|
4364
4273
|
}
|
|
4365
4274
|
|
|
4366
4275
|
handleClick() {
|
|
4367
|
-
|
|
4368
|
-
if (!element) {
|
|
4369
|
-
return;
|
|
4370
|
-
}
|
|
4371
|
-
|
|
4372
|
-
if (element.isPopoverVisible) {
|
|
4276
|
+
if (this.element.isPopoverVisible) {
|
|
4373
4277
|
this.hideBib("click");
|
|
4374
4278
|
} else {
|
|
4375
4279
|
this.showBib();
|
|
@@ -4380,66 +4284,63 @@ class AuroFloatingUI {
|
|
|
4380
4284
|
{
|
|
4381
4285
|
composed: true,
|
|
4382
4286
|
detail: {
|
|
4383
|
-
expanded: element.isPopoverVisible,
|
|
4287
|
+
expanded: this.element.isPopoverVisible,
|
|
4384
4288
|
},
|
|
4385
4289
|
},
|
|
4386
4290
|
);
|
|
4387
4291
|
|
|
4388
|
-
element.dispatchEvent(event);
|
|
4292
|
+
this.element.dispatchEvent(event);
|
|
4389
4293
|
}
|
|
4390
4294
|
|
|
4391
4295
|
handleEvent(event) {
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
event.preventDefault();
|
|
4408
|
-
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;
|
|
4409
4311
|
}
|
|
4410
|
-
|
|
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
|
|
4411
4343
|
}
|
|
4412
|
-
case "mouseenter":
|
|
4413
|
-
if (element.hoverToggle) {
|
|
4414
|
-
this.showBib();
|
|
4415
|
-
}
|
|
4416
|
-
break;
|
|
4417
|
-
case "mouseleave":
|
|
4418
|
-
if (element.hoverToggle) {
|
|
4419
|
-
this.hideBib("mouseleave");
|
|
4420
|
-
}
|
|
4421
|
-
break;
|
|
4422
|
-
case "focus":
|
|
4423
|
-
if (element.focusShow) {
|
|
4424
|
-
/*
|
|
4425
|
-
This needs to better handle clicking that gives focus -
|
|
4426
|
-
currently it shows and then immediately hides the bib
|
|
4427
|
-
*/
|
|
4428
|
-
this.showBib();
|
|
4429
|
-
}
|
|
4430
|
-
break;
|
|
4431
|
-
case "blur":
|
|
4432
|
-
// send this task 100ms later queue to
|
|
4433
|
-
// wait a frame in case focus moves within the floating element/bib
|
|
4434
|
-
setTimeout(() => this.handleFocusLoss(), 0);
|
|
4435
|
-
break;
|
|
4436
|
-
case "click":
|
|
4437
|
-
if (document.activeElement === document.body) {
|
|
4438
|
-
event.currentTarget.focus();
|
|
4439
|
-
}
|
|
4440
|
-
this.handleClick();
|
|
4441
|
-
break;
|
|
4442
|
-
// Do nothing
|
|
4443
4344
|
}
|
|
4444
4345
|
}
|
|
4445
4346
|
|
|
@@ -4450,11 +4351,6 @@ class AuroFloatingUI {
|
|
|
4450
4351
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
4451
4352
|
*/
|
|
4452
4353
|
handleTriggerTabIndex() {
|
|
4453
|
-
const element = this.element;
|
|
4454
|
-
if (!element) {
|
|
4455
|
-
return;
|
|
4456
|
-
}
|
|
4457
|
-
|
|
4458
4354
|
const focusableElementSelectors = [
|
|
4459
4355
|
"a",
|
|
4460
4356
|
"button",
|
|
@@ -4467,7 +4363,7 @@ class AuroFloatingUI {
|
|
|
4467
4363
|
"auro-hyperlink",
|
|
4468
4364
|
];
|
|
4469
4365
|
|
|
4470
|
-
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
4366
|
+
const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
|
|
4471
4367
|
if (!triggerNode) {
|
|
4472
4368
|
return;
|
|
4473
4369
|
}
|
|
@@ -4476,13 +4372,13 @@ class AuroFloatingUI {
|
|
|
4476
4372
|
focusableElementSelectors.forEach((selector) => {
|
|
4477
4373
|
// Check if the trigger node element is focusable
|
|
4478
4374
|
if (triggerNodeTagName === selector) {
|
|
4479
|
-
element.tabIndex = -1;
|
|
4375
|
+
this.element.tabIndex = -1;
|
|
4480
4376
|
return;
|
|
4481
4377
|
}
|
|
4482
4378
|
|
|
4483
4379
|
// Check if any child is focusable
|
|
4484
4380
|
if (triggerNode.querySelector(selector)) {
|
|
4485
|
-
element.tabIndex = -1;
|
|
4381
|
+
this.element.tabIndex = -1;
|
|
4486
4382
|
}
|
|
4487
4383
|
});
|
|
4488
4384
|
}
|
|
@@ -4492,18 +4388,13 @@ class AuroFloatingUI {
|
|
|
4492
4388
|
* @param {*} eventPrefix
|
|
4493
4389
|
*/
|
|
4494
4390
|
regenerateBibId() {
|
|
4495
|
-
|
|
4496
|
-
if (!element) {
|
|
4497
|
-
return;
|
|
4498
|
-
}
|
|
4499
|
-
|
|
4500
|
-
this.id = element.getAttribute("id");
|
|
4391
|
+
this.id = this.element.getAttribute("id");
|
|
4501
4392
|
if (!this.id) {
|
|
4502
4393
|
this.id = window.crypto.randomUUID();
|
|
4503
|
-
element.setAttribute("id", this.id);
|
|
4394
|
+
this.element.setAttribute("id", this.id);
|
|
4504
4395
|
}
|
|
4505
4396
|
|
|
4506
|
-
element.bib
|
|
4397
|
+
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
4507
4398
|
}
|
|
4508
4399
|
|
|
4509
4400
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -4515,69 +4406,67 @@ class AuroFloatingUI {
|
|
|
4515
4406
|
this.element = elem;
|
|
4516
4407
|
}
|
|
4517
4408
|
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
return;
|
|
4409
|
+
if (this.behavior !== this.element.behavior) {
|
|
4410
|
+
this.behavior = this.element.behavior;
|
|
4521
4411
|
}
|
|
4522
4412
|
|
|
4523
|
-
if (this.
|
|
4524
|
-
this.behavior = element.behavior;
|
|
4525
|
-
}
|
|
4526
|
-
|
|
4527
|
-
if (element.trigger) {
|
|
4413
|
+
if (this.element.trigger) {
|
|
4528
4414
|
this.disconnect();
|
|
4529
4415
|
}
|
|
4530
|
-
element.trigger =
|
|
4531
|
-
element.triggerElement ||
|
|
4532
|
-
element.shadowRoot
|
|
4533
|
-
element.trigger;
|
|
4534
|
-
element.bib =
|
|
4535
|
-
|
|
4536
|
-
element.
|
|
4537
|
-
|
|
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");
|
|
4538
4425
|
|
|
4539
|
-
if (element.floaterConfig) {
|
|
4540
|
-
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
4426
|
+
if (this.element.floaterConfig) {
|
|
4427
|
+
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
4541
4428
|
}
|
|
4542
4429
|
|
|
4543
4430
|
this.regenerateBibId();
|
|
4544
4431
|
this.handleTriggerTabIndex();
|
|
4545
4432
|
|
|
4546
4433
|
this.handleEvent = this.handleEvent.bind(this);
|
|
4547
|
-
if (element.trigger) {
|
|
4434
|
+
if (this.element.trigger) {
|
|
4548
4435
|
if (this.enableKeyboardHandling) {
|
|
4549
|
-
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
4436
|
+
this.element.trigger.addEventListener("keydown", this.handleEvent);
|
|
4550
4437
|
}
|
|
4551
|
-
element.trigger.addEventListener("click", this.handleEvent);
|
|
4552
|
-
element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
4553
|
-
element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
4554
|
-
element.trigger.addEventListener("focus", this.handleEvent);
|
|
4555
|
-
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);
|
|
4556
4443
|
}
|
|
4557
4444
|
}
|
|
4558
4445
|
|
|
4559
4446
|
disconnect() {
|
|
4560
4447
|
this.cleanupHideHandlers();
|
|
4448
|
+
if (this.element) {
|
|
4449
|
+
this.element.cleanup?.();
|
|
4561
4450
|
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
}
|
|
4566
|
-
|
|
4567
|
-
element.cleanup?.();
|
|
4568
|
-
|
|
4569
|
-
if (element.bib && element.shadowRoot) {
|
|
4570
|
-
element.shadowRoot.append(element.bib);
|
|
4571
|
-
}
|
|
4451
|
+
if (this.element.bib) {
|
|
4452
|
+
this.element.shadowRoot.append(this.element.bib);
|
|
4453
|
+
}
|
|
4572
4454
|
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
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
|
+
}
|
|
4581
4470
|
}
|
|
4582
4471
|
}
|
|
4583
4472
|
}
|
|
@@ -5705,7 +5594,7 @@ class AuroHelpText extends i$2 {
|
|
|
5705
5594
|
}
|
|
5706
5595
|
}
|
|
5707
5596
|
|
|
5708
|
-
var formkitVersion = '
|
|
5597
|
+
var formkitVersion = '202604072118';
|
|
5709
5598
|
|
|
5710
5599
|
let AuroElement$1 = class AuroElement extends i$2 {
|
|
5711
5600
|
static get properties() {
|