@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
|
@@ -1471,7 +1471,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
};
|
|
1473
1473
|
|
|
1474
|
-
var formkitVersion$1 = '
|
|
1474
|
+
var formkitVersion$1 = '202604071525';
|
|
1475
1475
|
|
|
1476
1476
|
// Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
1477
1477
|
// See LICENSE in the project root for license information.
|
|
@@ -3769,19 +3769,11 @@ class AuroFloatingUI {
|
|
|
3769
3769
|
* This ensures that the bib content has the same dimensions as the sizer element.
|
|
3770
3770
|
*/
|
|
3771
3771
|
mirrorSize() {
|
|
3772
|
-
const element = this.element;
|
|
3773
|
-
if (!element) {
|
|
3774
|
-
return;
|
|
3775
|
-
}
|
|
3776
|
-
|
|
3777
3772
|
// mirror the boxsize from bibSizer
|
|
3778
|
-
if (element.bibSizer && element.matchWidth
|
|
3779
|
-
const sizerStyle = window.getComputedStyle(element.bibSizer);
|
|
3780
|
-
const bibContent =
|
|
3781
|
-
|
|
3782
|
-
return;
|
|
3783
|
-
}
|
|
3784
|
-
|
|
3773
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
3774
|
+
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
3775
|
+
const bibContent =
|
|
3776
|
+
this.element.bib.shadowRoot.querySelector(".container");
|
|
3785
3777
|
if (sizerStyle.width !== "0px") {
|
|
3786
3778
|
bibContent.style.width = sizerStyle.width;
|
|
3787
3779
|
}
|
|
@@ -3803,14 +3795,9 @@ class AuroFloatingUI {
|
|
|
3803
3795
|
* @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
|
|
3804
3796
|
*/
|
|
3805
3797
|
getPositioningStrategy() {
|
|
3806
|
-
const element = this.element;
|
|
3807
|
-
if (!element) {
|
|
3808
|
-
return this.behavior || "floating";
|
|
3809
|
-
}
|
|
3810
|
-
|
|
3811
3798
|
const breakpoint =
|
|
3812
|
-
element.bib
|
|
3813
|
-
element.floaterConfig?.fullscreenBreakpoint;
|
|
3799
|
+
this.element.bib.mobileFullscreenBreakpoint ||
|
|
3800
|
+
this.element.floaterConfig?.fullscreenBreakpoint;
|
|
3814
3801
|
switch (this.behavior) {
|
|
3815
3802
|
case "tooltip":
|
|
3816
3803
|
return "floating";
|
|
@@ -3821,9 +3808,9 @@ class AuroFloatingUI {
|
|
|
3821
3808
|
`(max-width: ${breakpoint})`,
|
|
3822
3809
|
).matches;
|
|
3823
3810
|
|
|
3824
|
-
element.expanded = smallerThanBreakpoint;
|
|
3811
|
+
this.element.expanded = smallerThanBreakpoint;
|
|
3825
3812
|
}
|
|
3826
|
-
if (element.nested) {
|
|
3813
|
+
if (this.element.nested) {
|
|
3827
3814
|
return "cover";
|
|
3828
3815
|
}
|
|
3829
3816
|
return "fullscreen";
|
|
@@ -3853,65 +3840,42 @@ class AuroFloatingUI {
|
|
|
3853
3840
|
* and applies the calculated position to the bib's style.
|
|
3854
3841
|
*/
|
|
3855
3842
|
position() {
|
|
3856
|
-
const element = this.element;
|
|
3857
|
-
if (!element) {
|
|
3858
|
-
return;
|
|
3859
|
-
}
|
|
3860
|
-
|
|
3861
3843
|
const strategy = this.getPositioningStrategy();
|
|
3862
3844
|
this.configureBibStrategy(strategy);
|
|
3863
3845
|
|
|
3864
3846
|
if (strategy === "floating") {
|
|
3865
|
-
if (!element.trigger || !element.bib) {
|
|
3866
|
-
return;
|
|
3867
|
-
}
|
|
3868
|
-
|
|
3869
3847
|
this.mirrorSize();
|
|
3870
3848
|
// Define the middlware for the floater configuration
|
|
3871
3849
|
const middleware = [
|
|
3872
|
-
offset(element.floaterConfig?.offset || 0),
|
|
3873
|
-
...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
|
|
3874
|
-
...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
|
|
3875
|
-
...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
|
|
3850
|
+
offset(this.element.floaterConfig?.offset || 0),
|
|
3851
|
+
...(this.element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
|
|
3852
|
+
...(this.element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
|
|
3853
|
+
...(this.element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
|
|
3876
3854
|
];
|
|
3877
3855
|
|
|
3878
3856
|
// Compute the position of the bib
|
|
3879
|
-
computePosition(element.trigger, element.bib, {
|
|
3880
|
-
strategy: element.floaterConfig?.strategy || "fixed",
|
|
3881
|
-
placement: element.floaterConfig?.placement,
|
|
3857
|
+
computePosition(this.element.trigger, this.element.bib, {
|
|
3858
|
+
strategy: this.element.floaterConfig?.strategy || "fixed",
|
|
3859
|
+
placement: this.element.floaterConfig?.placement,
|
|
3882
3860
|
middleware: middleware || [],
|
|
3883
3861
|
}).then(({ x, y }) => {
|
|
3884
3862
|
// eslint-disable-line id-length
|
|
3885
|
-
|
|
3886
|
-
if (!currentElement?.bib) {
|
|
3887
|
-
return;
|
|
3888
|
-
}
|
|
3889
|
-
|
|
3890
|
-
Object.assign(currentElement.bib.style, {
|
|
3863
|
+
Object.assign(this.element.bib.style, {
|
|
3891
3864
|
left: `${x}px`,
|
|
3892
3865
|
top: `${y}px`,
|
|
3893
3866
|
});
|
|
3894
3867
|
});
|
|
3895
3868
|
} else if (strategy === "cover") {
|
|
3896
|
-
if (!element.parentNode || !element.bib) {
|
|
3897
|
-
return;
|
|
3898
|
-
}
|
|
3899
|
-
|
|
3900
3869
|
// Compute the position of the bib
|
|
3901
|
-
computePosition(element.parentNode, element.bib, {
|
|
3870
|
+
computePosition(this.element.parentNode, this.element.bib, {
|
|
3902
3871
|
placement: "bottom-start",
|
|
3903
3872
|
}).then(({ x, y }) => {
|
|
3904
3873
|
// eslint-disable-line id-length
|
|
3905
|
-
|
|
3906
|
-
if (!currentElement?.bib || !currentElement.parentNode) {
|
|
3907
|
-
return;
|
|
3908
|
-
}
|
|
3909
|
-
|
|
3910
|
-
Object.assign(currentElement.bib.style, {
|
|
3874
|
+
Object.assign(this.element.bib.style, {
|
|
3911
3875
|
left: `${x}px`,
|
|
3912
|
-
top: `${y -
|
|
3913
|
-
width: `${
|
|
3914
|
-
height: `${
|
|
3876
|
+
top: `${y - this.element.parentNode.offsetHeight}px`,
|
|
3877
|
+
width: `${this.element.parentNode.offsetWidth}px`,
|
|
3878
|
+
height: `${this.element.parentNode.offsetHeight}px`,
|
|
3915
3879
|
});
|
|
3916
3880
|
});
|
|
3917
3881
|
}
|
|
@@ -3923,17 +3887,11 @@ class AuroFloatingUI {
|
|
|
3923
3887
|
* @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
|
|
3924
3888
|
*/
|
|
3925
3889
|
lockScroll(lock = true) {
|
|
3926
|
-
const element = this.element;
|
|
3927
|
-
|
|
3928
3890
|
if (lock) {
|
|
3929
|
-
if (!element?.bib) {
|
|
3930
|
-
return;
|
|
3931
|
-
}
|
|
3932
|
-
|
|
3933
3891
|
document.body.style.overflow = "hidden"; // hide body's scrollbar
|
|
3934
3892
|
|
|
3935
3893
|
// Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
|
|
3936
|
-
element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
3894
|
+
this.element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
3937
3895
|
} else {
|
|
3938
3896
|
document.body.style.overflow = "";
|
|
3939
3897
|
}
|
|
@@ -3949,24 +3907,20 @@ class AuroFloatingUI {
|
|
|
3949
3907
|
* @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
|
|
3950
3908
|
*/
|
|
3951
3909
|
configureBibStrategy(value) {
|
|
3952
|
-
const element = this.element;
|
|
3953
|
-
if (!element?.bib) {
|
|
3954
|
-
return;
|
|
3955
|
-
}
|
|
3956
|
-
|
|
3957
3910
|
if (value === "fullscreen") {
|
|
3958
|
-
element.isBibFullscreen = true;
|
|
3911
|
+
this.element.isBibFullscreen = true;
|
|
3959
3912
|
// reset the prev position
|
|
3960
|
-
element.bib.setAttribute("isfullscreen", "");
|
|
3961
|
-
element.bib.style.position = "fixed";
|
|
3962
|
-
element.bib.style.top = "0px";
|
|
3963
|
-
element.bib.style.left = "0px";
|
|
3964
|
-
element.bib.style.width = "";
|
|
3965
|
-
element.bib.style.height = "";
|
|
3966
|
-
element.style.contain = "";
|
|
3913
|
+
this.element.bib.setAttribute("isfullscreen", "");
|
|
3914
|
+
this.element.bib.style.position = "fixed";
|
|
3915
|
+
this.element.bib.style.top = "0px";
|
|
3916
|
+
this.element.bib.style.left = "0px";
|
|
3917
|
+
this.element.bib.style.width = "";
|
|
3918
|
+
this.element.bib.style.height = "";
|
|
3919
|
+
this.element.style.contain = "";
|
|
3967
3920
|
|
|
3968
3921
|
// reset the size that was mirroring `size` css-part
|
|
3969
|
-
const bibContent =
|
|
3922
|
+
const bibContent =
|
|
3923
|
+
this.element.bib.shadowRoot.querySelector(".container");
|
|
3970
3924
|
if (bibContent) {
|
|
3971
3925
|
bibContent.style.width = "";
|
|
3972
3926
|
bibContent.style.height = "";
|
|
@@ -3981,14 +3935,14 @@ class AuroFloatingUI {
|
|
|
3981
3935
|
}, 0);
|
|
3982
3936
|
}
|
|
3983
3937
|
|
|
3984
|
-
if (element.isPopoverVisible) {
|
|
3938
|
+
if (this.element.isPopoverVisible) {
|
|
3985
3939
|
this.lockScroll(true);
|
|
3986
3940
|
}
|
|
3987
3941
|
} else {
|
|
3988
|
-
element.bib.style.position = "";
|
|
3989
|
-
element.bib.removeAttribute("isfullscreen");
|
|
3990
|
-
element.isBibFullscreen = false;
|
|
3991
|
-
element.style.contain = "layout";
|
|
3942
|
+
this.element.bib.style.position = "";
|
|
3943
|
+
this.element.bib.removeAttribute("isfullscreen");
|
|
3944
|
+
this.element.isBibFullscreen = false;
|
|
3945
|
+
this.element.style.contain = "layout";
|
|
3992
3946
|
}
|
|
3993
3947
|
|
|
3994
3948
|
const isChanged = this.strategy && this.strategy !== value;
|
|
@@ -4006,21 +3960,16 @@ class AuroFloatingUI {
|
|
|
4006
3960
|
},
|
|
4007
3961
|
);
|
|
4008
3962
|
|
|
4009
|
-
element.dispatchEvent(event);
|
|
3963
|
+
this.element.dispatchEvent(event);
|
|
4010
3964
|
}
|
|
4011
3965
|
}
|
|
4012
3966
|
|
|
4013
3967
|
updateState() {
|
|
4014
|
-
const
|
|
4015
|
-
if (!element) {
|
|
4016
|
-
return;
|
|
4017
|
-
}
|
|
4018
|
-
|
|
4019
|
-
const isVisible = element.isPopoverVisible;
|
|
3968
|
+
const isVisible = this.element.isPopoverVisible;
|
|
4020
3969
|
if (!isVisible) {
|
|
4021
3970
|
this.cleanupHideHandlers();
|
|
4022
3971
|
try {
|
|
4023
|
-
element.cleanup?.();
|
|
3972
|
+
this.element.cleanup?.();
|
|
4024
3973
|
} catch (error) {
|
|
4025
3974
|
// Do nothing
|
|
4026
3975
|
}
|
|
@@ -4036,30 +3985,28 @@ class AuroFloatingUI {
|
|
|
4036
3985
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
4037
3986
|
*/
|
|
4038
3987
|
handleFocusLoss() {
|
|
4039
|
-
const element = this.element;
|
|
4040
|
-
if (!element?.bib) {
|
|
4041
|
-
return;
|
|
4042
|
-
}
|
|
4043
|
-
|
|
4044
3988
|
// if mouse is being pressed, skip and let click event to handle the action
|
|
4045
3989
|
if (AuroFloatingUI.isMousePressed) {
|
|
4046
3990
|
return;
|
|
4047
3991
|
}
|
|
4048
3992
|
|
|
4049
3993
|
if (
|
|
4050
|
-
element.noHideOnThisFocusLoss ||
|
|
4051
|
-
element.hasAttribute("noHideOnThisFocusLoss")
|
|
3994
|
+
this.element.noHideOnThisFocusLoss ||
|
|
3995
|
+
this.element.hasAttribute("noHideOnThisFocusLoss")
|
|
4052
3996
|
) {
|
|
4053
3997
|
return;
|
|
4054
3998
|
}
|
|
4055
3999
|
|
|
4056
4000
|
// if focus is still inside of trigger or bib, do not close
|
|
4057
|
-
if (
|
|
4001
|
+
if (
|
|
4002
|
+
this.element.matches(":focus") ||
|
|
4003
|
+
this.element.matches(":focus-within")
|
|
4004
|
+
) {
|
|
4058
4005
|
return;
|
|
4059
4006
|
}
|
|
4060
4007
|
|
|
4061
4008
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
4062
|
-
if (element.bib.hasAttribute("isfullscreen")) {
|
|
4009
|
+
if (this.element.bib.hasAttribute("isfullscreen")) {
|
|
4063
4010
|
return;
|
|
4064
4011
|
}
|
|
4065
4012
|
|
|
@@ -4067,32 +4014,23 @@ class AuroFloatingUI {
|
|
|
4067
4014
|
}
|
|
4068
4015
|
|
|
4069
4016
|
setupHideHandlers() {
|
|
4070
|
-
if (!this.element) {
|
|
4071
|
-
return;
|
|
4072
|
-
}
|
|
4073
|
-
|
|
4074
4017
|
// Define handlers & store references
|
|
4075
4018
|
this.focusHandler = () => this.handleFocusLoss();
|
|
4076
4019
|
|
|
4077
4020
|
this.clickHandler = (evt) => {
|
|
4078
|
-
const element = this.element;
|
|
4079
|
-
if (!element?.bib) {
|
|
4080
|
-
return;
|
|
4081
|
-
}
|
|
4082
|
-
|
|
4083
4021
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
4084
4022
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
4085
4023
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
4086
4024
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
4087
|
-
if (element.bib.hasAttribute("isfullscreen")) {
|
|
4025
|
+
if (this.element.bib && this.element.bib.hasAttribute("isfullscreen")) {
|
|
4088
4026
|
return;
|
|
4089
4027
|
}
|
|
4090
4028
|
|
|
4091
4029
|
if (
|
|
4092
|
-
(!evt.composedPath().includes(element.trigger) &&
|
|
4093
|
-
!evt.composedPath().includes(element.bib)) ||
|
|
4094
|
-
(element.bib.backdrop &&
|
|
4095
|
-
evt.composedPath().includes(element.bib.backdrop))
|
|
4030
|
+
(!evt.composedPath().includes(this.element.trigger) &&
|
|
4031
|
+
!evt.composedPath().includes(this.element.bib)) ||
|
|
4032
|
+
(this.element.bib.backdrop &&
|
|
4033
|
+
evt.composedPath().includes(this.element.bib.backdrop))
|
|
4096
4034
|
) {
|
|
4097
4035
|
const existedVisibleFloatingUI =
|
|
4098
4036
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -4113,12 +4051,7 @@ class AuroFloatingUI {
|
|
|
4113
4051
|
|
|
4114
4052
|
// ESC key handler
|
|
4115
4053
|
this.keyDownHandler = (evt) => {
|
|
4116
|
-
|
|
4117
|
-
if (!element) {
|
|
4118
|
-
return;
|
|
4119
|
-
}
|
|
4120
|
-
|
|
4121
|
-
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
4054
|
+
if (evt.key === "Escape" && this.element.isPopoverVisible) {
|
|
4122
4055
|
const existedVisibleFloatingUI =
|
|
4123
4056
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
4124
4057
|
if (
|
|
@@ -4175,10 +4108,6 @@ class AuroFloatingUI {
|
|
|
4175
4108
|
}
|
|
4176
4109
|
|
|
4177
4110
|
updateCurrentExpandedDropdown() {
|
|
4178
|
-
if (!this.element) {
|
|
4179
|
-
return;
|
|
4180
|
-
}
|
|
4181
|
-
|
|
4182
4111
|
// Close any other dropdown that is already open
|
|
4183
4112
|
const existedVisibleFloatingUI =
|
|
4184
4113
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -4195,34 +4124,25 @@ class AuroFloatingUI {
|
|
|
4195
4124
|
}
|
|
4196
4125
|
|
|
4197
4126
|
showBib() {
|
|
4198
|
-
|
|
4199
|
-
if (!element) {
|
|
4200
|
-
return;
|
|
4201
|
-
}
|
|
4202
|
-
|
|
4203
|
-
if (!element.disabled && !this.showing) {
|
|
4127
|
+
if (!this.element.disabled && !this.showing) {
|
|
4204
4128
|
this.updateCurrentExpandedDropdown();
|
|
4205
|
-
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
4129
|
+
this.element.triggerChevron?.setAttribute("data-expanded", true);
|
|
4206
4130
|
|
|
4207
4131
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
4208
4132
|
if (!this.showing) {
|
|
4209
|
-
if (!element.modal) {
|
|
4133
|
+
if (!this.element.modal) {
|
|
4210
4134
|
this.setupHideHandlers();
|
|
4211
4135
|
}
|
|
4212
4136
|
this.showing = true;
|
|
4213
|
-
element.isPopoverVisible = true;
|
|
4137
|
+
this.element.isPopoverVisible = true;
|
|
4214
4138
|
this.position();
|
|
4215
4139
|
this.dispatchEventDropdownToggle();
|
|
4216
4140
|
}
|
|
4217
4141
|
|
|
4218
|
-
if (!element.bib || (!element.trigger && !element.parentNode)) {
|
|
4219
|
-
return;
|
|
4220
|
-
}
|
|
4221
|
-
|
|
4222
4142
|
// Setup auto update to handle resize and scroll
|
|
4223
|
-
element.cleanup = autoUpdate(
|
|
4224
|
-
element.trigger || element.parentNode,
|
|
4225
|
-
element.bib,
|
|
4143
|
+
this.element.cleanup = autoUpdate(
|
|
4144
|
+
this.element.trigger || this.element.parentNode,
|
|
4145
|
+
this.element.bib,
|
|
4226
4146
|
() => {
|
|
4227
4147
|
this.position();
|
|
4228
4148
|
},
|
|
@@ -4235,27 +4155,22 @@ class AuroFloatingUI {
|
|
|
4235
4155
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
4236
4156
|
*/
|
|
4237
4157
|
hideBib(eventType = "unknown") {
|
|
4238
|
-
|
|
4239
|
-
if (!element) {
|
|
4240
|
-
return;
|
|
4241
|
-
}
|
|
4242
|
-
|
|
4243
|
-
if (element.disabled) {
|
|
4158
|
+
if (this.element.disabled) {
|
|
4244
4159
|
return;
|
|
4245
4160
|
}
|
|
4246
4161
|
|
|
4247
4162
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
4248
4163
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
4249
4164
|
// Escape key or focus loss.
|
|
4250
|
-
if (element.noToggle && eventType === "click") {
|
|
4165
|
+
if (this.element.noToggle && eventType === "click") {
|
|
4251
4166
|
return;
|
|
4252
4167
|
}
|
|
4253
4168
|
|
|
4254
4169
|
this.lockScroll(false);
|
|
4255
|
-
element.triggerChevron?.removeAttribute("data-expanded");
|
|
4170
|
+
this.element.triggerChevron?.removeAttribute("data-expanded");
|
|
4256
4171
|
|
|
4257
|
-
if (element.isPopoverVisible) {
|
|
4258
|
-
element.isPopoverVisible = false;
|
|
4172
|
+
if (this.element.isPopoverVisible) {
|
|
4173
|
+
this.element.isPopoverVisible = false;
|
|
4259
4174
|
}
|
|
4260
4175
|
if (this.showing) {
|
|
4261
4176
|
this.cleanupHideHandlers();
|
|
@@ -4275,11 +4190,6 @@ class AuroFloatingUI {
|
|
|
4275
4190
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
4276
4191
|
*/
|
|
4277
4192
|
dispatchEventDropdownToggle(eventType) {
|
|
4278
|
-
const element = this.element;
|
|
4279
|
-
if (!element) {
|
|
4280
|
-
return;
|
|
4281
|
-
}
|
|
4282
|
-
|
|
4283
4193
|
const event = new CustomEvent(
|
|
4284
4194
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
4285
4195
|
{
|
|
@@ -4291,16 +4201,11 @@ class AuroFloatingUI {
|
|
|
4291
4201
|
},
|
|
4292
4202
|
);
|
|
4293
4203
|
|
|
4294
|
-
element.dispatchEvent(event);
|
|
4204
|
+
this.element.dispatchEvent(event);
|
|
4295
4205
|
}
|
|
4296
4206
|
|
|
4297
4207
|
handleClick() {
|
|
4298
|
-
|
|
4299
|
-
if (!element) {
|
|
4300
|
-
return;
|
|
4301
|
-
}
|
|
4302
|
-
|
|
4303
|
-
if (element.isPopoverVisible) {
|
|
4208
|
+
if (this.element.isPopoverVisible) {
|
|
4304
4209
|
this.hideBib("click");
|
|
4305
4210
|
} else {
|
|
4306
4211
|
this.showBib();
|
|
@@ -4311,66 +4216,63 @@ class AuroFloatingUI {
|
|
|
4311
4216
|
{
|
|
4312
4217
|
composed: true,
|
|
4313
4218
|
detail: {
|
|
4314
|
-
expanded: element.isPopoverVisible,
|
|
4219
|
+
expanded: this.element.isPopoverVisible,
|
|
4315
4220
|
},
|
|
4316
4221
|
},
|
|
4317
4222
|
);
|
|
4318
4223
|
|
|
4319
|
-
element.dispatchEvent(event);
|
|
4224
|
+
this.element.dispatchEvent(event);
|
|
4320
4225
|
}
|
|
4321
4226
|
|
|
4322
4227
|
handleEvent(event) {
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
event.preventDefault();
|
|
4339
|
-
this.handleClick();
|
|
4228
|
+
if (!this.element.disableEventShow) {
|
|
4229
|
+
switch (event.type) {
|
|
4230
|
+
case "keydown": {
|
|
4231
|
+
// Support both Enter and Space keys for accessibility
|
|
4232
|
+
// Space is included as it's expected behavior for interactive elements
|
|
4233
|
+
|
|
4234
|
+
const origin = event.composedPath()[0];
|
|
4235
|
+
if (
|
|
4236
|
+
event.key === "Enter" ||
|
|
4237
|
+
(event.key === " " && (!origin || origin.tagName !== "INPUT"))
|
|
4238
|
+
) {
|
|
4239
|
+
event.preventDefault();
|
|
4240
|
+
this.handleClick();
|
|
4241
|
+
}
|
|
4242
|
+
break;
|
|
4340
4243
|
}
|
|
4341
|
-
|
|
4244
|
+
case "mouseenter":
|
|
4245
|
+
if (this.element.hoverToggle) {
|
|
4246
|
+
this.showBib();
|
|
4247
|
+
}
|
|
4248
|
+
break;
|
|
4249
|
+
case "mouseleave":
|
|
4250
|
+
if (this.element.hoverToggle) {
|
|
4251
|
+
this.hideBib("mouseleave");
|
|
4252
|
+
}
|
|
4253
|
+
break;
|
|
4254
|
+
case "focus":
|
|
4255
|
+
if (this.element.focusShow) {
|
|
4256
|
+
/*
|
|
4257
|
+
This needs to better handle clicking that gives focus -
|
|
4258
|
+
currently it shows and then immediately hides the bib
|
|
4259
|
+
*/
|
|
4260
|
+
this.showBib();
|
|
4261
|
+
}
|
|
4262
|
+
break;
|
|
4263
|
+
case "blur":
|
|
4264
|
+
// send this task 100ms later queue to
|
|
4265
|
+
// wait a frame in case focus moves within the floating element/bib
|
|
4266
|
+
setTimeout(() => this.handleFocusLoss(), 0);
|
|
4267
|
+
break;
|
|
4268
|
+
case "click":
|
|
4269
|
+
if (document.activeElement === document.body) {
|
|
4270
|
+
event.currentTarget.focus();
|
|
4271
|
+
}
|
|
4272
|
+
this.handleClick();
|
|
4273
|
+
break;
|
|
4274
|
+
// Do nothing
|
|
4342
4275
|
}
|
|
4343
|
-
case "mouseenter":
|
|
4344
|
-
if (element.hoverToggle) {
|
|
4345
|
-
this.showBib();
|
|
4346
|
-
}
|
|
4347
|
-
break;
|
|
4348
|
-
case "mouseleave":
|
|
4349
|
-
if (element.hoverToggle) {
|
|
4350
|
-
this.hideBib("mouseleave");
|
|
4351
|
-
}
|
|
4352
|
-
break;
|
|
4353
|
-
case "focus":
|
|
4354
|
-
if (element.focusShow) {
|
|
4355
|
-
/*
|
|
4356
|
-
This needs to better handle clicking that gives focus -
|
|
4357
|
-
currently it shows and then immediately hides the bib
|
|
4358
|
-
*/
|
|
4359
|
-
this.showBib();
|
|
4360
|
-
}
|
|
4361
|
-
break;
|
|
4362
|
-
case "blur":
|
|
4363
|
-
// send this task 100ms later queue to
|
|
4364
|
-
// wait a frame in case focus moves within the floating element/bib
|
|
4365
|
-
setTimeout(() => this.handleFocusLoss(), 0);
|
|
4366
|
-
break;
|
|
4367
|
-
case "click":
|
|
4368
|
-
if (document.activeElement === document.body) {
|
|
4369
|
-
event.currentTarget.focus();
|
|
4370
|
-
}
|
|
4371
|
-
this.handleClick();
|
|
4372
|
-
break;
|
|
4373
|
-
// Do nothing
|
|
4374
4276
|
}
|
|
4375
4277
|
}
|
|
4376
4278
|
|
|
@@ -4381,11 +4283,6 @@ class AuroFloatingUI {
|
|
|
4381
4283
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
4382
4284
|
*/
|
|
4383
4285
|
handleTriggerTabIndex() {
|
|
4384
|
-
const element = this.element;
|
|
4385
|
-
if (!element) {
|
|
4386
|
-
return;
|
|
4387
|
-
}
|
|
4388
|
-
|
|
4389
4286
|
const focusableElementSelectors = [
|
|
4390
4287
|
"a",
|
|
4391
4288
|
"button",
|
|
@@ -4398,7 +4295,7 @@ class AuroFloatingUI {
|
|
|
4398
4295
|
"auro-hyperlink",
|
|
4399
4296
|
];
|
|
4400
4297
|
|
|
4401
|
-
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
4298
|
+
const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
|
|
4402
4299
|
if (!triggerNode) {
|
|
4403
4300
|
return;
|
|
4404
4301
|
}
|
|
@@ -4407,13 +4304,13 @@ class AuroFloatingUI {
|
|
|
4407
4304
|
focusableElementSelectors.forEach((selector) => {
|
|
4408
4305
|
// Check if the trigger node element is focusable
|
|
4409
4306
|
if (triggerNodeTagName === selector) {
|
|
4410
|
-
element.tabIndex = -1;
|
|
4307
|
+
this.element.tabIndex = -1;
|
|
4411
4308
|
return;
|
|
4412
4309
|
}
|
|
4413
4310
|
|
|
4414
4311
|
// Check if any child is focusable
|
|
4415
4312
|
if (triggerNode.querySelector(selector)) {
|
|
4416
|
-
element.tabIndex = -1;
|
|
4313
|
+
this.element.tabIndex = -1;
|
|
4417
4314
|
}
|
|
4418
4315
|
});
|
|
4419
4316
|
}
|
|
@@ -4423,18 +4320,13 @@ class AuroFloatingUI {
|
|
|
4423
4320
|
* @param {*} eventPrefix
|
|
4424
4321
|
*/
|
|
4425
4322
|
regenerateBibId() {
|
|
4426
|
-
|
|
4427
|
-
if (!element) {
|
|
4428
|
-
return;
|
|
4429
|
-
}
|
|
4430
|
-
|
|
4431
|
-
this.id = element.getAttribute("id");
|
|
4323
|
+
this.id = this.element.getAttribute("id");
|
|
4432
4324
|
if (!this.id) {
|
|
4433
4325
|
this.id = window.crypto.randomUUID();
|
|
4434
|
-
element.setAttribute("id", this.id);
|
|
4326
|
+
this.element.setAttribute("id", this.id);
|
|
4435
4327
|
}
|
|
4436
4328
|
|
|
4437
|
-
element.bib
|
|
4329
|
+
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
4438
4330
|
}
|
|
4439
4331
|
|
|
4440
4332
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -4446,69 +4338,67 @@ class AuroFloatingUI {
|
|
|
4446
4338
|
this.element = elem;
|
|
4447
4339
|
}
|
|
4448
4340
|
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
return;
|
|
4341
|
+
if (this.behavior !== this.element.behavior) {
|
|
4342
|
+
this.behavior = this.element.behavior;
|
|
4452
4343
|
}
|
|
4453
4344
|
|
|
4454
|
-
if (this.
|
|
4455
|
-
this.behavior = element.behavior;
|
|
4456
|
-
}
|
|
4457
|
-
|
|
4458
|
-
if (element.trigger) {
|
|
4345
|
+
if (this.element.trigger) {
|
|
4459
4346
|
this.disconnect();
|
|
4460
4347
|
}
|
|
4461
|
-
element.trigger =
|
|
4462
|
-
element.triggerElement ||
|
|
4463
|
-
element.shadowRoot
|
|
4464
|
-
element.trigger;
|
|
4465
|
-
element.bib =
|
|
4466
|
-
|
|
4467
|
-
element.
|
|
4468
|
-
|
|
4348
|
+
this.element.trigger =
|
|
4349
|
+
this.element.triggerElement ||
|
|
4350
|
+
this.element.shadowRoot.querySelector("#trigger") ||
|
|
4351
|
+
this.element.trigger;
|
|
4352
|
+
this.element.bib =
|
|
4353
|
+
this.element.shadowRoot.querySelector("#bib") || this.element.bib;
|
|
4354
|
+
this.element.bibSizer = this.element.shadowRoot.querySelector("#bibSizer");
|
|
4355
|
+
this.element.triggerChevron =
|
|
4356
|
+
this.element.shadowRoot.querySelector("#showStateIcon");
|
|
4469
4357
|
|
|
4470
|
-
if (element.floaterConfig) {
|
|
4471
|
-
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
4358
|
+
if (this.element.floaterConfig) {
|
|
4359
|
+
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
4472
4360
|
}
|
|
4473
4361
|
|
|
4474
4362
|
this.regenerateBibId();
|
|
4475
4363
|
this.handleTriggerTabIndex();
|
|
4476
4364
|
|
|
4477
4365
|
this.handleEvent = this.handleEvent.bind(this);
|
|
4478
|
-
if (element.trigger) {
|
|
4366
|
+
if (this.element.trigger) {
|
|
4479
4367
|
if (this.enableKeyboardHandling) {
|
|
4480
|
-
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
4368
|
+
this.element.trigger.addEventListener("keydown", this.handleEvent);
|
|
4481
4369
|
}
|
|
4482
|
-
element.trigger.addEventListener("click", this.handleEvent);
|
|
4483
|
-
element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
4484
|
-
element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
4485
|
-
element.trigger.addEventListener("focus", this.handleEvent);
|
|
4486
|
-
element.trigger.addEventListener("blur", this.handleEvent);
|
|
4370
|
+
this.element.trigger.addEventListener("click", this.handleEvent);
|
|
4371
|
+
this.element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
4372
|
+
this.element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
4373
|
+
this.element.trigger.addEventListener("focus", this.handleEvent);
|
|
4374
|
+
this.element.trigger.addEventListener("blur", this.handleEvent);
|
|
4487
4375
|
}
|
|
4488
4376
|
}
|
|
4489
4377
|
|
|
4490
4378
|
disconnect() {
|
|
4491
4379
|
this.cleanupHideHandlers();
|
|
4380
|
+
if (this.element) {
|
|
4381
|
+
this.element.cleanup?.();
|
|
4492
4382
|
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
}
|
|
4497
|
-
|
|
4498
|
-
element.cleanup?.();
|
|
4499
|
-
|
|
4500
|
-
if (element.bib && element.shadowRoot) {
|
|
4501
|
-
element.shadowRoot.append(element.bib);
|
|
4502
|
-
}
|
|
4383
|
+
if (this.element.bib) {
|
|
4384
|
+
this.element.shadowRoot.append(this.element.bib);
|
|
4385
|
+
}
|
|
4503
4386
|
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4387
|
+
// Remove event & keyboard listeners
|
|
4388
|
+
if (this.element?.trigger) {
|
|
4389
|
+
this.element.trigger.removeEventListener("keydown", this.handleEvent);
|
|
4390
|
+
this.element.trigger.removeEventListener("click", this.handleEvent);
|
|
4391
|
+
this.element.trigger.removeEventListener(
|
|
4392
|
+
"mouseenter",
|
|
4393
|
+
this.handleEvent,
|
|
4394
|
+
);
|
|
4395
|
+
this.element.trigger.removeEventListener(
|
|
4396
|
+
"mouseleave",
|
|
4397
|
+
this.handleEvent,
|
|
4398
|
+
);
|
|
4399
|
+
this.element.trigger.removeEventListener("focus", this.handleEvent);
|
|
4400
|
+
this.element.trigger.removeEventListener("blur", this.handleEvent);
|
|
4401
|
+
}
|
|
4512
4402
|
}
|
|
4513
4403
|
}
|
|
4514
4404
|
}
|
|
@@ -5636,7 +5526,7 @@ class AuroHelpText extends LitElement {
|
|
|
5636
5526
|
}
|
|
5637
5527
|
}
|
|
5638
5528
|
|
|
5639
|
-
var formkitVersion = '
|
|
5529
|
+
var formkitVersion = '202604071525';
|
|
5640
5530
|
|
|
5641
5531
|
let AuroElement$1 = class AuroElement extends LitElement {
|
|
5642
5532
|
static get properties() {
|