@aurodesignsystem-dev/auro-formkit 0.0.0-pr1424.2 → 0.0.0-pr1424.4
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 +133 -183
- package/components/checkbox/demo/api.min.js +3 -3
- package/components/checkbox/demo/index.min.js +3 -3
- package/components/checkbox/dist/index.js +3 -3
- package/components/checkbox/dist/registered.js +3 -3
- package/components/combobox/demo/api.html +1 -0
- package/components/combobox/demo/api.js +3 -1
- package/components/combobox/demo/api.md +75 -0
- package/components/combobox/demo/api.min.js +314 -172
- package/components/combobox/demo/index.min.js +301 -171
- package/components/combobox/dist/comboboxKeyboardStrategy.d.ts +1 -1
- package/components/combobox/dist/index.js +291 -171
- package/components/combobox/dist/registered.js +291 -171
- package/components/counter/demo/api.html +3 -0
- package/components/counter/demo/api.js +4 -0
- package/components/counter/demo/api.md +130 -0
- package/components/counter/demo/api.min.js +320 -167
- package/components/counter/demo/index.min.js +300 -167
- package/components/counter/dist/counterGroupKeyboardStrategy.d.ts +3 -0
- package/components/counter/dist/index.js +300 -167
- package/components/counter/dist/registered.js +300 -167
- package/components/datepicker/demo/api.html +1 -0
- package/components/datepicker/demo/api.js +2 -0
- package/components/datepicker/demo/api.md +57 -0
- package/components/datepicker/demo/api.min.js +376 -171
- package/components/datepicker/demo/index.min.js +364 -171
- package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +3 -1
- package/components/datepicker/dist/index.js +364 -171
- package/components/datepicker/dist/registered.js +364 -171
- package/components/dropdown/demo/api.html +1 -0
- package/components/dropdown/demo/api.js +2 -0
- package/components/dropdown/demo/api.md +95 -0
- package/components/dropdown/demo/api.min.js +296 -165
- package/components/dropdown/demo/index.min.js +276 -165
- package/components/dropdown/dist/index.js +276 -165
- package/components/dropdown/dist/registered.js +276 -165
- package/components/form/demo/api.min.js +1254 -684
- package/components/form/demo/index.min.js +1254 -684
- 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/menu/demo/api.md +1 -0
- package/components/menu/demo/api.min.js +10 -0
- package/components/menu/demo/index.min.js +10 -0
- package/components/menu/dist/auro-menuoption.d.ts +9 -0
- package/components/menu/dist/index.js +10 -0
- package/components/menu/dist/registered.js +10 -0
- package/components/radio/demo/api.min.js +2 -2
- package/components/radio/demo/index.min.js +2 -2
- package/components/radio/dist/index.js +2 -2
- package/components/radio/dist/registered.js +2 -2
- package/components/select/demo/api.html +1 -0
- package/components/select/demo/api.js +2 -0
- package/components/select/demo/api.md +76 -0
- package/components/select/demo/api.min.js +306 -169
- package/components/select/demo/index.min.js +293 -169
- package/components/select/dist/index.js +283 -169
- package/components/select/dist/registered.js +283 -169
- package/custom-elements.json +48 -3
- package/package.json +5 -3
|
@@ -196,7 +196,7 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
// Copyright (c) 2026 Alaska Airlines. All
|
|
199
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
200
200
|
// See LICENSE in the project root for license information.
|
|
201
201
|
|
|
202
202
|
|
|
@@ -1521,9 +1521,9 @@ let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
};
|
|
1523
1523
|
|
|
1524
|
-
var formkitVersion$1 = '
|
|
1524
|
+
var formkitVersion$1 = '202604091759';
|
|
1525
1525
|
|
|
1526
|
-
// Copyright (c) 2026 Alaska Airlines. All
|
|
1526
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
1527
1527
|
// See LICENSE in the project root for license information.
|
|
1528
1528
|
|
|
1529
1529
|
const keyboardStrategy = {
|
|
@@ -3837,11 +3837,19 @@ 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
|
+
|
|
3840
3845
|
// mirror the boxsize from bibSizer
|
|
3841
|
-
if (
|
|
3842
|
-
const sizerStyle = window.getComputedStyle(
|
|
3843
|
-
const bibContent =
|
|
3844
|
-
|
|
3846
|
+
if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
|
|
3847
|
+
const sizerStyle = window.getComputedStyle(element.bibSizer);
|
|
3848
|
+
const bibContent = element.bib.shadowRoot.querySelector(".container");
|
|
3849
|
+
if (!bibContent) {
|
|
3850
|
+
return;
|
|
3851
|
+
}
|
|
3852
|
+
|
|
3845
3853
|
if (sizerStyle.width !== "0px") {
|
|
3846
3854
|
bibContent.style.width = sizerStyle.width;
|
|
3847
3855
|
}
|
|
@@ -3863,9 +3871,14 @@ class AuroFloatingUI {
|
|
|
3863
3871
|
* @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
|
|
3864
3872
|
*/
|
|
3865
3873
|
getPositioningStrategy() {
|
|
3874
|
+
const element = this.element;
|
|
3875
|
+
if (!element) {
|
|
3876
|
+
return "floating";
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3866
3879
|
const breakpoint =
|
|
3867
|
-
|
|
3868
|
-
|
|
3880
|
+
element.bib?.mobileFullscreenBreakpoint ||
|
|
3881
|
+
element.floaterConfig?.fullscreenBreakpoint;
|
|
3869
3882
|
switch (this.behavior) {
|
|
3870
3883
|
case "tooltip":
|
|
3871
3884
|
return "floating";
|
|
@@ -3876,9 +3889,9 @@ class AuroFloatingUI {
|
|
|
3876
3889
|
`(max-width: ${breakpoint})`,
|
|
3877
3890
|
).matches;
|
|
3878
3891
|
|
|
3879
|
-
|
|
3892
|
+
element.expanded = smallerThanBreakpoint;
|
|
3880
3893
|
}
|
|
3881
|
-
if (
|
|
3894
|
+
if (element.nested) {
|
|
3882
3895
|
return "cover";
|
|
3883
3896
|
}
|
|
3884
3897
|
return "fullscreen";
|
|
@@ -3908,42 +3921,65 @@ class AuroFloatingUI {
|
|
|
3908
3921
|
* and applies the calculated position to the bib's style.
|
|
3909
3922
|
*/
|
|
3910
3923
|
position() {
|
|
3924
|
+
const element = this.element;
|
|
3925
|
+
if (!element) {
|
|
3926
|
+
return;
|
|
3927
|
+
}
|
|
3928
|
+
|
|
3911
3929
|
const strategy = this.getPositioningStrategy();
|
|
3912
3930
|
this.configureBibStrategy(strategy);
|
|
3913
3931
|
|
|
3914
3932
|
if (strategy === "floating") {
|
|
3933
|
+
if (!element.trigger || !element.bib) {
|
|
3934
|
+
return;
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3915
3937
|
this.mirrorSize();
|
|
3916
3938
|
// Define the middlware for the floater configuration
|
|
3917
3939
|
const middleware = [
|
|
3918
|
-
offset(
|
|
3919
|
-
...(
|
|
3920
|
-
...(
|
|
3921
|
-
...(
|
|
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.
|
|
3922
3944
|
];
|
|
3923
3945
|
|
|
3924
3946
|
// Compute the position of the bib
|
|
3925
|
-
computePosition(
|
|
3926
|
-
strategy:
|
|
3927
|
-
placement:
|
|
3947
|
+
computePosition(element.trigger, element.bib, {
|
|
3948
|
+
strategy: element.floaterConfig?.strategy || "fixed",
|
|
3949
|
+
placement: element.floaterConfig?.placement,
|
|
3928
3950
|
middleware: middleware || [],
|
|
3929
3951
|
}).then(({ x, y }) => {
|
|
3930
3952
|
// eslint-disable-line id-length
|
|
3931
|
-
|
|
3953
|
+
const currentElement = this.element;
|
|
3954
|
+
if (!currentElement?.bib) {
|
|
3955
|
+
return;
|
|
3956
|
+
}
|
|
3957
|
+
|
|
3958
|
+
Object.assign(currentElement.bib.style, {
|
|
3932
3959
|
left: `${x}px`,
|
|
3933
3960
|
top: `${y}px`,
|
|
3934
3961
|
});
|
|
3935
3962
|
});
|
|
3936
3963
|
} else if (strategy === "cover") {
|
|
3964
|
+
if (!element.parentNode || !element.bib) {
|
|
3965
|
+
return;
|
|
3966
|
+
}
|
|
3967
|
+
|
|
3937
3968
|
// Compute the position of the bib
|
|
3938
|
-
computePosition(
|
|
3969
|
+
computePosition(element.parentNode, element.bib, {
|
|
3939
3970
|
placement: "bottom-start",
|
|
3940
3971
|
}).then(({ x, y }) => {
|
|
3941
3972
|
// eslint-disable-line id-length
|
|
3942
|
-
|
|
3973
|
+
const currentElement = this.element;
|
|
3974
|
+
if (!currentElement?.bib || !currentElement.parentNode) {
|
|
3975
|
+
return;
|
|
3976
|
+
}
|
|
3977
|
+
|
|
3978
|
+
Object.assign(currentElement.bib.style, {
|
|
3943
3979
|
left: `${x}px`,
|
|
3944
|
-
top: `${y -
|
|
3945
|
-
width: `${
|
|
3946
|
-
height: `${
|
|
3980
|
+
top: `${y - currentElement.parentNode.offsetHeight}px`,
|
|
3981
|
+
width: `${currentElement.parentNode.offsetWidth}px`,
|
|
3982
|
+
height: `${currentElement.parentNode.offsetHeight}px`,
|
|
3947
3983
|
});
|
|
3948
3984
|
});
|
|
3949
3985
|
}
|
|
@@ -3955,11 +3991,17 @@ class AuroFloatingUI {
|
|
|
3955
3991
|
* @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
|
|
3956
3992
|
*/
|
|
3957
3993
|
lockScroll(lock = true) {
|
|
3994
|
+
const element = this.element;
|
|
3995
|
+
|
|
3958
3996
|
if (lock) {
|
|
3997
|
+
if (!element?.bib) {
|
|
3998
|
+
return;
|
|
3999
|
+
}
|
|
4000
|
+
|
|
3959
4001
|
document.body.style.overflow = "hidden"; // hide body's scrollbar
|
|
3960
4002
|
|
|
3961
4003
|
// Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
|
|
3962
|
-
|
|
4004
|
+
element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
3963
4005
|
} else {
|
|
3964
4006
|
document.body.style.overflow = "";
|
|
3965
4007
|
}
|
|
@@ -3975,20 +4017,24 @@ class AuroFloatingUI {
|
|
|
3975
4017
|
* @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
|
|
3976
4018
|
*/
|
|
3977
4019
|
configureBibStrategy(value) {
|
|
4020
|
+
const element = this.element;
|
|
4021
|
+
if (!element?.bib) {
|
|
4022
|
+
return;
|
|
4023
|
+
}
|
|
4024
|
+
|
|
3978
4025
|
if (value === "fullscreen") {
|
|
3979
|
-
|
|
4026
|
+
element.isBibFullscreen = true;
|
|
3980
4027
|
// reset the prev position
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
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 = "";
|
|
3988
4035
|
|
|
3989
4036
|
// reset the size that was mirroring `size` css-part
|
|
3990
|
-
const bibContent =
|
|
3991
|
-
this.element.bib.shadowRoot.querySelector(".container");
|
|
4037
|
+
const bibContent = element.bib.shadowRoot?.querySelector(".container");
|
|
3992
4038
|
if (bibContent) {
|
|
3993
4039
|
bibContent.style.width = "";
|
|
3994
4040
|
bibContent.style.height = "";
|
|
@@ -4003,14 +4049,14 @@ class AuroFloatingUI {
|
|
|
4003
4049
|
}, 0);
|
|
4004
4050
|
}
|
|
4005
4051
|
|
|
4006
|
-
if (
|
|
4052
|
+
if (element.isPopoverVisible) {
|
|
4007
4053
|
this.lockScroll(true);
|
|
4008
4054
|
}
|
|
4009
4055
|
} else {
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4056
|
+
element.bib.style.position = "";
|
|
4057
|
+
element.bib.removeAttribute("isfullscreen");
|
|
4058
|
+
element.isBibFullscreen = false;
|
|
4059
|
+
element.style.contain = "layout";
|
|
4014
4060
|
}
|
|
4015
4061
|
|
|
4016
4062
|
const isChanged = this.strategy && this.strategy !== value;
|
|
@@ -4028,16 +4074,21 @@ class AuroFloatingUI {
|
|
|
4028
4074
|
},
|
|
4029
4075
|
);
|
|
4030
4076
|
|
|
4031
|
-
|
|
4077
|
+
element.dispatchEvent(event);
|
|
4032
4078
|
}
|
|
4033
4079
|
}
|
|
4034
4080
|
|
|
4035
4081
|
updateState() {
|
|
4036
|
-
const
|
|
4082
|
+
const element = this.element;
|
|
4083
|
+
if (!element) {
|
|
4084
|
+
return;
|
|
4085
|
+
}
|
|
4086
|
+
|
|
4087
|
+
const isVisible = element.isPopoverVisible;
|
|
4037
4088
|
if (!isVisible) {
|
|
4038
4089
|
this.cleanupHideHandlers();
|
|
4039
4090
|
try {
|
|
4040
|
-
|
|
4091
|
+
element.cleanup?.();
|
|
4041
4092
|
} catch (error) {
|
|
4042
4093
|
// Do nothing
|
|
4043
4094
|
}
|
|
@@ -4053,28 +4104,30 @@ class AuroFloatingUI {
|
|
|
4053
4104
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
4054
4105
|
*/
|
|
4055
4106
|
handleFocusLoss() {
|
|
4107
|
+
const element = this.element;
|
|
4108
|
+
if (!element?.bib) {
|
|
4109
|
+
return;
|
|
4110
|
+
}
|
|
4111
|
+
|
|
4056
4112
|
// if mouse is being pressed, skip and let click event to handle the action
|
|
4057
4113
|
if (AuroFloatingUI.isMousePressed) {
|
|
4058
4114
|
return;
|
|
4059
4115
|
}
|
|
4060
4116
|
|
|
4061
4117
|
if (
|
|
4062
|
-
|
|
4063
|
-
|
|
4118
|
+
element.noHideOnThisFocusLoss ||
|
|
4119
|
+
element.hasAttribute("noHideOnThisFocusLoss")
|
|
4064
4120
|
) {
|
|
4065
4121
|
return;
|
|
4066
4122
|
}
|
|
4067
4123
|
|
|
4068
4124
|
// if focus is still inside of trigger or bib, do not close
|
|
4069
|
-
if (
|
|
4070
|
-
this.element.matches(":focus") ||
|
|
4071
|
-
this.element.matches(":focus-within")
|
|
4072
|
-
) {
|
|
4125
|
+
if (element.matches(":focus") || element.matches(":focus-within")) {
|
|
4073
4126
|
return;
|
|
4074
4127
|
}
|
|
4075
4128
|
|
|
4076
4129
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
4077
|
-
if (
|
|
4130
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
4078
4131
|
return;
|
|
4079
4132
|
}
|
|
4080
4133
|
|
|
@@ -4082,23 +4135,33 @@ class AuroFloatingUI {
|
|
|
4082
4135
|
}
|
|
4083
4136
|
|
|
4084
4137
|
setupHideHandlers() {
|
|
4138
|
+
const element = this.element;
|
|
4139
|
+
if (!element) {
|
|
4140
|
+
return;
|
|
4141
|
+
}
|
|
4142
|
+
|
|
4085
4143
|
// Define handlers & store references
|
|
4086
4144
|
this.focusHandler = () => this.handleFocusLoss();
|
|
4087
4145
|
|
|
4088
4146
|
this.clickHandler = (evt) => {
|
|
4147
|
+
const element = this.element;
|
|
4148
|
+
if (!element?.bib) {
|
|
4149
|
+
return;
|
|
4150
|
+
}
|
|
4151
|
+
|
|
4089
4152
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
4090
4153
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
4091
4154
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
4092
4155
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
4093
|
-
if (
|
|
4156
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
4094
4157
|
return;
|
|
4095
4158
|
}
|
|
4096
4159
|
|
|
4097
4160
|
if (
|
|
4098
|
-
(!evt.composedPath().includes(
|
|
4099
|
-
!evt.composedPath().includes(
|
|
4100
|
-
(
|
|
4101
|
-
evt.composedPath().includes(
|
|
4161
|
+
(!evt.composedPath().includes(element.trigger) &&
|
|
4162
|
+
!evt.composedPath().includes(element.bib)) ||
|
|
4163
|
+
(element.bib.backdrop &&
|
|
4164
|
+
evt.composedPath().includes(element.bib.backdrop))
|
|
4102
4165
|
) {
|
|
4103
4166
|
const existedVisibleFloatingUI =
|
|
4104
4167
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -4119,7 +4182,12 @@ class AuroFloatingUI {
|
|
|
4119
4182
|
|
|
4120
4183
|
// ESC key handler
|
|
4121
4184
|
this.keyDownHandler = (evt) => {
|
|
4122
|
-
|
|
4185
|
+
const element = this.element;
|
|
4186
|
+
if (!element) {
|
|
4187
|
+
return;
|
|
4188
|
+
}
|
|
4189
|
+
|
|
4190
|
+
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
4123
4191
|
const existedVisibleFloatingUI =
|
|
4124
4192
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
4125
4193
|
if (
|
|
@@ -4176,6 +4244,10 @@ class AuroFloatingUI {
|
|
|
4176
4244
|
}
|
|
4177
4245
|
|
|
4178
4246
|
updateCurrentExpandedDropdown() {
|
|
4247
|
+
if (!this.element) {
|
|
4248
|
+
return;
|
|
4249
|
+
}
|
|
4250
|
+
|
|
4179
4251
|
// Close any other dropdown that is already open
|
|
4180
4252
|
const existedVisibleFloatingUI =
|
|
4181
4253
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -4192,25 +4264,34 @@ class AuroFloatingUI {
|
|
|
4192
4264
|
}
|
|
4193
4265
|
|
|
4194
4266
|
showBib() {
|
|
4195
|
-
|
|
4267
|
+
const element = this.element;
|
|
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) {
|
|
4196
4277
|
this.updateCurrentExpandedDropdown();
|
|
4197
|
-
|
|
4278
|
+
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
4198
4279
|
|
|
4199
4280
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
4200
4281
|
if (!this.showing) {
|
|
4201
|
-
if (!
|
|
4282
|
+
if (!element.modal) {
|
|
4202
4283
|
this.setupHideHandlers();
|
|
4203
4284
|
}
|
|
4204
4285
|
this.showing = true;
|
|
4205
|
-
|
|
4286
|
+
element.isPopoverVisible = true;
|
|
4206
4287
|
this.position();
|
|
4207
4288
|
this.dispatchEventDropdownToggle();
|
|
4208
4289
|
}
|
|
4209
4290
|
|
|
4210
4291
|
// Setup auto update to handle resize and scroll
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4292
|
+
element.cleanup = autoUpdate(
|
|
4293
|
+
element.trigger || element.parentNode,
|
|
4294
|
+
element.bib,
|
|
4214
4295
|
() => {
|
|
4215
4296
|
this.position();
|
|
4216
4297
|
},
|
|
@@ -4223,22 +4304,27 @@ class AuroFloatingUI {
|
|
|
4223
4304
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
4224
4305
|
*/
|
|
4225
4306
|
hideBib(eventType = "unknown") {
|
|
4226
|
-
|
|
4307
|
+
const element = this.element;
|
|
4308
|
+
if (!element) {
|
|
4309
|
+
return;
|
|
4310
|
+
}
|
|
4311
|
+
|
|
4312
|
+
if (element.disabled) {
|
|
4227
4313
|
return;
|
|
4228
4314
|
}
|
|
4229
4315
|
|
|
4230
4316
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
4231
4317
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
4232
4318
|
// Escape key or focus loss.
|
|
4233
|
-
if (
|
|
4319
|
+
if (element.noToggle && eventType === "click") {
|
|
4234
4320
|
return;
|
|
4235
4321
|
}
|
|
4236
4322
|
|
|
4237
4323
|
this.lockScroll(false);
|
|
4238
|
-
|
|
4324
|
+
element.triggerChevron?.removeAttribute("data-expanded");
|
|
4239
4325
|
|
|
4240
|
-
if (
|
|
4241
|
-
|
|
4326
|
+
if (element.isPopoverVisible) {
|
|
4327
|
+
element.isPopoverVisible = false;
|
|
4242
4328
|
}
|
|
4243
4329
|
if (this.showing) {
|
|
4244
4330
|
this.cleanupHideHandlers();
|
|
@@ -4258,6 +4344,11 @@ class AuroFloatingUI {
|
|
|
4258
4344
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
4259
4345
|
*/
|
|
4260
4346
|
dispatchEventDropdownToggle(eventType) {
|
|
4347
|
+
const element = this.element;
|
|
4348
|
+
if (!element) {
|
|
4349
|
+
return;
|
|
4350
|
+
}
|
|
4351
|
+
|
|
4261
4352
|
const event = new CustomEvent(
|
|
4262
4353
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
4263
4354
|
{
|
|
@@ -4269,11 +4360,16 @@ class AuroFloatingUI {
|
|
|
4269
4360
|
},
|
|
4270
4361
|
);
|
|
4271
4362
|
|
|
4272
|
-
|
|
4363
|
+
element.dispatchEvent(event);
|
|
4273
4364
|
}
|
|
4274
4365
|
|
|
4275
4366
|
handleClick() {
|
|
4276
|
-
|
|
4367
|
+
const element = this.element;
|
|
4368
|
+
if (!element) {
|
|
4369
|
+
return;
|
|
4370
|
+
}
|
|
4371
|
+
|
|
4372
|
+
if (element.isPopoverVisible) {
|
|
4277
4373
|
this.hideBib("click");
|
|
4278
4374
|
} else {
|
|
4279
4375
|
this.showBib();
|
|
@@ -4284,63 +4380,66 @@ class AuroFloatingUI {
|
|
|
4284
4380
|
{
|
|
4285
4381
|
composed: true,
|
|
4286
4382
|
detail: {
|
|
4287
|
-
expanded:
|
|
4383
|
+
expanded: element.isPopoverVisible,
|
|
4288
4384
|
},
|
|
4289
4385
|
},
|
|
4290
4386
|
);
|
|
4291
4387
|
|
|
4292
|
-
|
|
4388
|
+
element.dispatchEvent(event);
|
|
4293
4389
|
}
|
|
4294
4390
|
|
|
4295
4391
|
handleEvent(event) {
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
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
|
-
}
|
|
4392
|
+
const element = this.element;
|
|
4393
|
+
if (!element || element.disableEventShow) {
|
|
4394
|
+
return;
|
|
4395
|
+
}
|
|
4396
|
+
|
|
4397
|
+
switch (event.type) {
|
|
4398
|
+
case "keydown": {
|
|
4399
|
+
// Support both Enter and Space keys for accessibility
|
|
4400
|
+
// Space is included as it's expected behavior for interactive elements
|
|
4401
|
+
|
|
4402
|
+
const origin = event.composedPath()[0];
|
|
4403
|
+
if (
|
|
4404
|
+
event.key === "Enter" ||
|
|
4405
|
+
(event.key === " " && (!origin || origin.tagName !== "INPUT"))
|
|
4406
|
+
) {
|
|
4407
|
+
event.preventDefault();
|
|
4340
4408
|
this.handleClick();
|
|
4341
|
-
|
|
4342
|
-
|
|
4409
|
+
}
|
|
4410
|
+
break;
|
|
4343
4411
|
}
|
|
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
|
|
4344
4443
|
}
|
|
4345
4444
|
}
|
|
4346
4445
|
|
|
@@ -4351,6 +4450,11 @@ class AuroFloatingUI {
|
|
|
4351
4450
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
4352
4451
|
*/
|
|
4353
4452
|
handleTriggerTabIndex() {
|
|
4453
|
+
const element = this.element;
|
|
4454
|
+
if (!element) {
|
|
4455
|
+
return;
|
|
4456
|
+
}
|
|
4457
|
+
|
|
4354
4458
|
const focusableElementSelectors = [
|
|
4355
4459
|
"a",
|
|
4356
4460
|
"button",
|
|
@@ -4363,7 +4467,7 @@ class AuroFloatingUI {
|
|
|
4363
4467
|
"auro-hyperlink",
|
|
4364
4468
|
];
|
|
4365
4469
|
|
|
4366
|
-
const triggerNode =
|
|
4470
|
+
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
4367
4471
|
if (!triggerNode) {
|
|
4368
4472
|
return;
|
|
4369
4473
|
}
|
|
@@ -4372,13 +4476,13 @@ class AuroFloatingUI {
|
|
|
4372
4476
|
focusableElementSelectors.forEach((selector) => {
|
|
4373
4477
|
// Check if the trigger node element is focusable
|
|
4374
4478
|
if (triggerNodeTagName === selector) {
|
|
4375
|
-
|
|
4479
|
+
element.tabIndex = -1;
|
|
4376
4480
|
return;
|
|
4377
4481
|
}
|
|
4378
4482
|
|
|
4379
4483
|
// Check if any child is focusable
|
|
4380
4484
|
if (triggerNode.querySelector(selector)) {
|
|
4381
|
-
|
|
4485
|
+
element.tabIndex = -1;
|
|
4382
4486
|
}
|
|
4383
4487
|
});
|
|
4384
4488
|
}
|
|
@@ -4388,13 +4492,18 @@ class AuroFloatingUI {
|
|
|
4388
4492
|
* @param {*} eventPrefix
|
|
4389
4493
|
*/
|
|
4390
4494
|
regenerateBibId() {
|
|
4391
|
-
|
|
4495
|
+
const element = this.element;
|
|
4496
|
+
if (!element) {
|
|
4497
|
+
return;
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4500
|
+
this.id = element.getAttribute("id");
|
|
4392
4501
|
if (!this.id) {
|
|
4393
4502
|
this.id = window.crypto.randomUUID();
|
|
4394
|
-
|
|
4503
|
+
element.setAttribute("id", this.id);
|
|
4395
4504
|
}
|
|
4396
4505
|
|
|
4397
|
-
|
|
4506
|
+
element.bib?.setAttribute("id", `${this.id}-floater-bib`);
|
|
4398
4507
|
}
|
|
4399
4508
|
|
|
4400
4509
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -4406,67 +4515,69 @@ class AuroFloatingUI {
|
|
|
4406
4515
|
this.element = elem;
|
|
4407
4516
|
}
|
|
4408
4517
|
|
|
4409
|
-
|
|
4410
|
-
|
|
4518
|
+
const element = this.element;
|
|
4519
|
+
if (!element) {
|
|
4520
|
+
return;
|
|
4411
4521
|
}
|
|
4412
4522
|
|
|
4413
|
-
if (this.element.
|
|
4523
|
+
if (this.behavior !== element.behavior) {
|
|
4524
|
+
this.behavior = element.behavior;
|
|
4525
|
+
}
|
|
4526
|
+
|
|
4527
|
+
if (element.trigger) {
|
|
4414
4528
|
this.disconnect();
|
|
4415
4529
|
}
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
this.element.shadowRoot.querySelector("#showStateIcon");
|
|
4530
|
+
element.trigger =
|
|
4531
|
+
element.triggerElement ||
|
|
4532
|
+
element.shadowRoot?.querySelector("#trigger") ||
|
|
4533
|
+
element.trigger;
|
|
4534
|
+
element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
|
|
4535
|
+
element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
|
|
4536
|
+
element.triggerChevron =
|
|
4537
|
+
element.shadowRoot?.querySelector("#showStateIcon");
|
|
4425
4538
|
|
|
4426
|
-
if (
|
|
4427
|
-
|
|
4539
|
+
if (element.floaterConfig) {
|
|
4540
|
+
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
4428
4541
|
}
|
|
4429
4542
|
|
|
4430
4543
|
this.regenerateBibId();
|
|
4431
4544
|
this.handleTriggerTabIndex();
|
|
4432
4545
|
|
|
4433
4546
|
this.handleEvent = this.handleEvent.bind(this);
|
|
4434
|
-
if (
|
|
4547
|
+
if (element.trigger) {
|
|
4435
4548
|
if (this.enableKeyboardHandling) {
|
|
4436
|
-
|
|
4549
|
+
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
4437
4550
|
}
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
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);
|
|
4443
4556
|
}
|
|
4444
4557
|
}
|
|
4445
4558
|
|
|
4446
4559
|
disconnect() {
|
|
4447
4560
|
this.cleanupHideHandlers();
|
|
4448
|
-
if (this.element) {
|
|
4449
|
-
this.element.cleanup?.();
|
|
4450
4561
|
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4562
|
+
const element = this.element;
|
|
4563
|
+
if (!element) {
|
|
4564
|
+
return;
|
|
4565
|
+
}
|
|
4454
4566
|
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
}
|
|
4567
|
+
element.cleanup?.();
|
|
4568
|
+
|
|
4569
|
+
if (element.bib && element.shadowRoot) {
|
|
4570
|
+
element.shadowRoot.append(element.bib);
|
|
4571
|
+
}
|
|
4572
|
+
|
|
4573
|
+
// Remove event & keyboard listeners
|
|
4574
|
+
if (element.trigger) {
|
|
4575
|
+
element.trigger.removeEventListener("keydown", this.handleEvent);
|
|
4576
|
+
element.trigger.removeEventListener("click", this.handleEvent);
|
|
4577
|
+
element.trigger.removeEventListener("mouseenter", this.handleEvent);
|
|
4578
|
+
element.trigger.removeEventListener("mouseleave", this.handleEvent);
|
|
4579
|
+
element.trigger.removeEventListener("focus", this.handleEvent);
|
|
4580
|
+
element.trigger.removeEventListener("blur", this.handleEvent);
|
|
4470
4581
|
}
|
|
4471
4582
|
}
|
|
4472
4583
|
}
|
|
@@ -5594,7 +5705,7 @@ class AuroHelpText extends i$2 {
|
|
|
5594
5705
|
}
|
|
5595
5706
|
}
|
|
5596
5707
|
|
|
5597
|
-
var formkitVersion = '
|
|
5708
|
+
var formkitVersion = '202604091759';
|
|
5598
5709
|
|
|
5599
5710
|
let AuroElement$1 = class AuroElement extends i$2 {
|
|
5600
5711
|
static get properties() {
|
|
@@ -5700,7 +5811,7 @@ let AuroElement$1 = class AuroElement extends i$2 {
|
|
|
5700
5811
|
}
|
|
5701
5812
|
};
|
|
5702
5813
|
|
|
5703
|
-
// Copyright (c) 2026 Alaska Airlines. All
|
|
5814
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
5704
5815
|
// See LICENSE in the project root for license information.
|
|
5705
5816
|
|
|
5706
5817
|
|
|
@@ -7260,6 +7371,24 @@ class AuroElement extends i$2 {
|
|
|
7260
7371
|
}
|
|
7261
7372
|
}
|
|
7262
7373
|
|
|
7374
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
7375
|
+
// See LICENSE in the project root for license information.
|
|
7376
|
+
|
|
7377
|
+
const counterGroupKeyboardStrategy = {
|
|
7378
|
+
Escape(component, evt) {
|
|
7379
|
+
if (!component.dropdown || !component.dropdown.isPopoverVisible) {
|
|
7380
|
+
return;
|
|
7381
|
+
}
|
|
7382
|
+
|
|
7383
|
+
// Prevent the Escape key from bubbling up and closing any parent dialogs / drawers / popups.
|
|
7384
|
+
// Because stopPropagation prevents the document-level floatingUI keydown handler from
|
|
7385
|
+
// seeing this event, we must also close the dropdown explicitly.
|
|
7386
|
+
evt.stopPropagation();
|
|
7387
|
+
|
|
7388
|
+
component.dropdown.hide();
|
|
7389
|
+
},
|
|
7390
|
+
};
|
|
7391
|
+
|
|
7263
7392
|
/* eslint-disable lit/no-invalid-html, lit/binding-positions, max-lines, no-underscore-dangle, arrow-parens, no-confusing-arrow, curly, dot-location, no-inline-comments, line-comment-position,
|
|
7264
7393
|
*/
|
|
7265
7394
|
|
|
@@ -7860,6 +7989,10 @@ class AuroCounterGroup extends AuroElement {
|
|
|
7860
7989
|
super.firstUpdated();
|
|
7861
7990
|
this.updateValue();
|
|
7862
7991
|
this.updateValueText();
|
|
7992
|
+
|
|
7993
|
+
if (this.isDropdown) {
|
|
7994
|
+
applyKeyboardStrategy$1(this, counterGroupKeyboardStrategy);
|
|
7995
|
+
}
|
|
7863
7996
|
}
|
|
7864
7997
|
|
|
7865
7998
|
/**
|
|
@@ -8097,6 +8230,24 @@ function eventCounterExample() {
|
|
|
8097
8230
|
});
|
|
8098
8231
|
}
|
|
8099
8232
|
|
|
8233
|
+
function inDialogExample() {
|
|
8234
|
+
document.querySelector("#counter-dialog-opener").addEventListener("click", () => {
|
|
8235
|
+
const dialog = document.querySelector("#counter-dialog");
|
|
8236
|
+
dialog.open = true;
|
|
8237
|
+
});
|
|
8238
|
+
}
|
|
8239
|
+
|
|
8240
|
+
function inDrawerExample() {
|
|
8241
|
+
document.querySelector("#counter-drawer-opener").addEventListener("click", () => {
|
|
8242
|
+
const drawer = document.querySelector("#counter-drawer");
|
|
8243
|
+
if (drawer.hasAttribute('open')) {
|
|
8244
|
+
drawer.removeAttribute('open');
|
|
8245
|
+
} else {
|
|
8246
|
+
drawer.setAttribute('open', true);
|
|
8247
|
+
}
|
|
8248
|
+
});
|
|
8249
|
+
}
|
|
8250
|
+
|
|
8100
8251
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers */
|
|
8101
8252
|
|
|
8102
8253
|
function initExamples(initialCount = 0) {
|
|
@@ -8104,6 +8255,8 @@ function initExamples(initialCount = 0) {
|
|
|
8104
8255
|
// javascript example function calls to be added here upon creation to test examples
|
|
8105
8256
|
// dropdownCounterExample();
|
|
8106
8257
|
eventCounterExample();
|
|
8258
|
+
inDialogExample();
|
|
8259
|
+
inDrawerExample();
|
|
8107
8260
|
|
|
8108
8261
|
} catch (err) {
|
|
8109
8262
|
if (initialCount <= 20) {
|