@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
|
@@ -243,6 +243,17 @@ function inDialogExample() {
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
function inDrawerExample() {
|
|
247
|
+
document.querySelector("#datepicker-drawer-opener").addEventListener("click", () => {
|
|
248
|
+
const drawer = document.querySelector("#datepicker-drawer");
|
|
249
|
+
if (drawer.hasAttribute('open')) {
|
|
250
|
+
drawer.removeAttribute('open');
|
|
251
|
+
} else {
|
|
252
|
+
drawer.setAttribute('open', true);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
246
257
|
function localizationExample() {
|
|
247
258
|
const localizedDatepicker = document.querySelector("#localizationExample");
|
|
248
259
|
|
|
@@ -9549,7 +9560,7 @@ class AuroBibtemplate extends i$1 {
|
|
|
9549
9560
|
}
|
|
9550
9561
|
}
|
|
9551
9562
|
|
|
9552
|
-
var formkitVersion$2 = '
|
|
9563
|
+
var formkitVersion$2 = '202604091759';
|
|
9553
9564
|
|
|
9554
9565
|
let l$1 = class l{generateElementName(t,e){let o=t;return o+="-",o+=e.replace(/[.]/g,"_"),o}generateTag(o,s,a){const r=this.generateElementName(o,s),i=i$5`${s$5(r)}`;return customElements.get(r)||customElements.define(r,class extends a{}),i}};let d$1 = class d{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,o=(e,s=e&&e.closest(t))=>e&&e!==document&&e!==window?s||o(e.getRootNode().host):null){return o(e)}handleComponentTagRename(t,e){const o=e.toLowerCase();t.tagName.toLowerCase()!==o&&t.setAttribute(o,true);}elementMatch(t,e){const o=e.toLowerCase();return t.tagName.toLowerCase()===o||t.hasAttribute(o)}getSlotText(t,e){const o=t.shadowRoot?.querySelector(`slot[name="${e}"]`),s=(o?.assignedNodes({flatten:true})||[]).map(t=>t.textContent?.trim()).join(" ").trim();return s||null}};let h$4 = class h{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{});}closestElement(t,e=this,o=(e,s=e&&e.closest(t))=>e&&e!==document&&e!==window?s||o(e.getRootNode().host):null){return o(e)}handleComponentTagRename(t,e){const o=e.toLowerCase();t.tagName.toLowerCase()!==o&&t.setAttribute(o,true);}elementMatch(t,e){const o=e.toLowerCase();return t.tagName.toLowerCase()===o||t.hasAttribute(o)}};var c$3=i$3`:host{color:var(--ds-auro-loader-color)}:host>span{background-color:var(--ds-auro-loader-background-color);border-color:var(--ds-auro-loader-border-color)}:host([onlight]),:host([appearance=brand]){--ds-auro-loader-color: var(--ds-basic-color-brand-primary, #01426a)}:host([ondark]),:host([appearance=inverse]){--ds-auro-loader-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([orbit])>span{--ds-auro-loader-background-color: transparent}:host([orbit])>span:nth-child(1){--ds-auro-loader-border-color: currentcolor;opacity:.25}:host([orbit])>span:nth-child(2){--ds-auro-loader-border-color: currentcolor;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}
|
|
9555
9566
|
`,u$6=i$3`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, .875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, .75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, .625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, .875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, .05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, .05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, .05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, .05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, .05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, .1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(.875rem, 1.1666666667vw, .875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, .1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}:host,:host>span{position:relative}:host{width:2rem;height:2rem;display:inline-block;font-size:0}:host>span{position:absolute;display:inline-block;float:none;top:0;left:0;width:2rem;height:2rem;border-radius:100%;border-style:solid;border-width:0;box-sizing:border-box}:host([xs]),:host([xs])>span{width:1.2rem;height:1.2rem}:host([sm]),:host([sm])>span{width:3rem;height:3rem}:host([md]),:host([md])>span{width:5rem;height:5rem}:host([lg]),:host([lg])>span{width:8rem;height:8rem}:host{--margin: .375rem;--margin-xs: .2rem;--margin-sm: .5rem;--margin-md: .75rem;--margin-lg: 1rem}:host([pulse]),:host([pulse])>span{position:relative}:host([pulse]){width:calc(3rem + var(--margin) * 6);height:calc(1rem + var(--margin) * 2)}:host([pulse])>span{width:1rem;height:1rem;margin:var(--margin);animation:pulse 1.5s ease infinite}:host([pulse][xs]){width:calc(1.95rem + var(--margin-xs) * 6);height:calc(.65rem + var(--margin-xs) * 2)}:host([pulse][xs])>span{margin:var(--margin-xs);width:.65rem;height:.65rem}:host([pulse][sm]){width:calc(6rem + var(--margin-sm) * 6);height:calc(2rem + var(--margin-sm) * 2)}:host([pulse][sm])>span{margin:var(--margin-sm);width:2rem;height:2rem}:host([pulse][md]){width:calc(9rem + var(--margin-md) * 6);height:calc(3rem + var(--margin-md) * 2)}:host([pulse][md])>span{margin:var(--margin-md);width:3rem;height:3rem}:host([pulse][lg]){width:calc(15rem + var(--margin-lg) * 6);height:calc(5rem + var(--margin-lg) * 2)}:host([pulse][lg])>span{margin:var(--margin-lg);width:5rem;height:5rem}:host([pulse])>span:nth-child(1){animation-delay:-.4s}:host([pulse])>span:nth-child(2){animation-delay:-.2s}:host([pulse])>span:nth-child(3){animation-delay:0ms}@keyframes pulse{0%,to{opacity:.1;transform:scale(.9)}50%{opacity:1;transform:scale(1.1)}}:host([orbit]),:host([orbit])>span{opacity:1}:host([orbit])>span{border-width:5px}:host([orbit])>span:nth-child(2){animation:orbit 2s linear infinite}:host([orbit][sm])>span{border-width:8px}:host([orbit][md])>span{border-width:13px}:host([orbit][lg])>span{border-width:21px}@keyframes orbit{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:host([ringworm])>svg{animation:rotate 2s linear infinite;height:100%;width:100%;stroke:currentcolor;stroke-width:8}:host([ringworm]) .path{stroke-dashoffset:0;animation:ringworm 1.5s ease-in-out infinite;stroke-linecap:round}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes ringworm{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}:host([laser]){position:static;width:100%;display:block;height:0;overflow:hidden;font-size:unset}:host([laser])>span{position:fixed;width:100%;height:.25rem;border-radius:0;z-index:100}:host([laser])>span:nth-child(1){border-color:currentcolor;opacity:.25}:host([laser])>span:nth-child(2){border-color:currentcolor;animation:laser 2s linear infinite;opacity:1;width:50%}:host([laser][sm])>span:nth-child(2){width:20%}:host([laser][md])>span:nth-child(2){width:30%}:host([laser][lg])>span:nth-child(2){width:50%;animation-duration:1.5s}:host([laser][xl])>span:nth-child(2){width:80%;animation-duration:1.5s}@keyframes laser{0%{left:-100%}to{left:110%}}:host>.no-animation{display:none}@media (prefers-reduced-motion: reduce){:host{display:flex;align-items:center;justify-content:center}:host>span{opacity:1}:host>.loader{display:none}:host>svg{display:none}:host>.no-animation{display:block}}
|
|
@@ -11883,11 +11894,19 @@ class AuroFloatingUI {
|
|
|
11883
11894
|
* This ensures that the bib content has the same dimensions as the sizer element.
|
|
11884
11895
|
*/
|
|
11885
11896
|
mirrorSize() {
|
|
11897
|
+
const element = this.element;
|
|
11898
|
+
if (!element) {
|
|
11899
|
+
return;
|
|
11900
|
+
}
|
|
11901
|
+
|
|
11886
11902
|
// mirror the boxsize from bibSizer
|
|
11887
|
-
if (
|
|
11888
|
-
const sizerStyle = window.getComputedStyle(
|
|
11889
|
-
const bibContent =
|
|
11890
|
-
|
|
11903
|
+
if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
|
|
11904
|
+
const sizerStyle = window.getComputedStyle(element.bibSizer);
|
|
11905
|
+
const bibContent = element.bib.shadowRoot.querySelector(".container");
|
|
11906
|
+
if (!bibContent) {
|
|
11907
|
+
return;
|
|
11908
|
+
}
|
|
11909
|
+
|
|
11891
11910
|
if (sizerStyle.width !== "0px") {
|
|
11892
11911
|
bibContent.style.width = sizerStyle.width;
|
|
11893
11912
|
}
|
|
@@ -11909,9 +11928,14 @@ class AuroFloatingUI {
|
|
|
11909
11928
|
* @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
|
|
11910
11929
|
*/
|
|
11911
11930
|
getPositioningStrategy() {
|
|
11931
|
+
const element = this.element;
|
|
11932
|
+
if (!element) {
|
|
11933
|
+
return "floating";
|
|
11934
|
+
}
|
|
11935
|
+
|
|
11912
11936
|
const breakpoint =
|
|
11913
|
-
|
|
11914
|
-
|
|
11937
|
+
element.bib?.mobileFullscreenBreakpoint ||
|
|
11938
|
+
element.floaterConfig?.fullscreenBreakpoint;
|
|
11915
11939
|
switch (this.behavior) {
|
|
11916
11940
|
case "tooltip":
|
|
11917
11941
|
return "floating";
|
|
@@ -11922,9 +11946,9 @@ class AuroFloatingUI {
|
|
|
11922
11946
|
`(max-width: ${breakpoint})`,
|
|
11923
11947
|
).matches;
|
|
11924
11948
|
|
|
11925
|
-
|
|
11949
|
+
element.expanded = smallerThanBreakpoint;
|
|
11926
11950
|
}
|
|
11927
|
-
if (
|
|
11951
|
+
if (element.nested) {
|
|
11928
11952
|
return "cover";
|
|
11929
11953
|
}
|
|
11930
11954
|
return "fullscreen";
|
|
@@ -11954,42 +11978,65 @@ class AuroFloatingUI {
|
|
|
11954
11978
|
* and applies the calculated position to the bib's style.
|
|
11955
11979
|
*/
|
|
11956
11980
|
position() {
|
|
11981
|
+
const element = this.element;
|
|
11982
|
+
if (!element) {
|
|
11983
|
+
return;
|
|
11984
|
+
}
|
|
11985
|
+
|
|
11957
11986
|
const strategy = this.getPositioningStrategy();
|
|
11958
11987
|
this.configureBibStrategy(strategy);
|
|
11959
11988
|
|
|
11960
11989
|
if (strategy === "floating") {
|
|
11990
|
+
if (!element.trigger || !element.bib) {
|
|
11991
|
+
return;
|
|
11992
|
+
}
|
|
11993
|
+
|
|
11961
11994
|
this.mirrorSize();
|
|
11962
11995
|
// Define the middlware for the floater configuration
|
|
11963
11996
|
const middleware = [
|
|
11964
|
-
offset(
|
|
11965
|
-
...(
|
|
11966
|
-
...(
|
|
11967
|
-
...(
|
|
11997
|
+
offset(element.floaterConfig?.offset || 0),
|
|
11998
|
+
...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
|
|
11999
|
+
...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
|
|
12000
|
+
...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
|
|
11968
12001
|
];
|
|
11969
12002
|
|
|
11970
12003
|
// Compute the position of the bib
|
|
11971
|
-
computePosition(
|
|
11972
|
-
strategy:
|
|
11973
|
-
placement:
|
|
12004
|
+
computePosition(element.trigger, element.bib, {
|
|
12005
|
+
strategy: element.floaterConfig?.strategy || "fixed",
|
|
12006
|
+
placement: element.floaterConfig?.placement,
|
|
11974
12007
|
middleware: middleware || [],
|
|
11975
12008
|
}).then(({ x, y }) => {
|
|
11976
12009
|
// eslint-disable-line id-length
|
|
11977
|
-
|
|
12010
|
+
const currentElement = this.element;
|
|
12011
|
+
if (!currentElement?.bib) {
|
|
12012
|
+
return;
|
|
12013
|
+
}
|
|
12014
|
+
|
|
12015
|
+
Object.assign(currentElement.bib.style, {
|
|
11978
12016
|
left: `${x}px`,
|
|
11979
12017
|
top: `${y}px`,
|
|
11980
12018
|
});
|
|
11981
12019
|
});
|
|
11982
12020
|
} else if (strategy === "cover") {
|
|
12021
|
+
if (!element.parentNode || !element.bib) {
|
|
12022
|
+
return;
|
|
12023
|
+
}
|
|
12024
|
+
|
|
11983
12025
|
// Compute the position of the bib
|
|
11984
|
-
computePosition(
|
|
12026
|
+
computePosition(element.parentNode, element.bib, {
|
|
11985
12027
|
placement: "bottom-start",
|
|
11986
12028
|
}).then(({ x, y }) => {
|
|
11987
12029
|
// eslint-disable-line id-length
|
|
11988
|
-
|
|
12030
|
+
const currentElement = this.element;
|
|
12031
|
+
if (!currentElement?.bib || !currentElement.parentNode) {
|
|
12032
|
+
return;
|
|
12033
|
+
}
|
|
12034
|
+
|
|
12035
|
+
Object.assign(currentElement.bib.style, {
|
|
11989
12036
|
left: `${x}px`,
|
|
11990
|
-
top: `${y -
|
|
11991
|
-
width: `${
|
|
11992
|
-
height: `${
|
|
12037
|
+
top: `${y - currentElement.parentNode.offsetHeight}px`,
|
|
12038
|
+
width: `${currentElement.parentNode.offsetWidth}px`,
|
|
12039
|
+
height: `${currentElement.parentNode.offsetHeight}px`,
|
|
11993
12040
|
});
|
|
11994
12041
|
});
|
|
11995
12042
|
}
|
|
@@ -12001,11 +12048,17 @@ class AuroFloatingUI {
|
|
|
12001
12048
|
* @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
|
|
12002
12049
|
*/
|
|
12003
12050
|
lockScroll(lock = true) {
|
|
12051
|
+
const element = this.element;
|
|
12052
|
+
|
|
12004
12053
|
if (lock) {
|
|
12054
|
+
if (!element?.bib) {
|
|
12055
|
+
return;
|
|
12056
|
+
}
|
|
12057
|
+
|
|
12005
12058
|
document.body.style.overflow = "hidden"; // hide body's scrollbar
|
|
12006
12059
|
|
|
12007
12060
|
// Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
|
|
12008
|
-
|
|
12061
|
+
element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
12009
12062
|
} else {
|
|
12010
12063
|
document.body.style.overflow = "";
|
|
12011
12064
|
}
|
|
@@ -12021,20 +12074,24 @@ class AuroFloatingUI {
|
|
|
12021
12074
|
* @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
|
|
12022
12075
|
*/
|
|
12023
12076
|
configureBibStrategy(value) {
|
|
12077
|
+
const element = this.element;
|
|
12078
|
+
if (!element?.bib) {
|
|
12079
|
+
return;
|
|
12080
|
+
}
|
|
12081
|
+
|
|
12024
12082
|
if (value === "fullscreen") {
|
|
12025
|
-
|
|
12083
|
+
element.isBibFullscreen = true;
|
|
12026
12084
|
// reset the prev position
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12085
|
+
element.bib.setAttribute("isfullscreen", "");
|
|
12086
|
+
element.bib.style.position = "fixed";
|
|
12087
|
+
element.bib.style.top = "0px";
|
|
12088
|
+
element.bib.style.left = "0px";
|
|
12089
|
+
element.bib.style.width = "";
|
|
12090
|
+
element.bib.style.height = "";
|
|
12091
|
+
element.style.contain = "";
|
|
12034
12092
|
|
|
12035
12093
|
// reset the size that was mirroring `size` css-part
|
|
12036
|
-
const bibContent =
|
|
12037
|
-
this.element.bib.shadowRoot.querySelector(".container");
|
|
12094
|
+
const bibContent = element.bib.shadowRoot?.querySelector(".container");
|
|
12038
12095
|
if (bibContent) {
|
|
12039
12096
|
bibContent.style.width = "";
|
|
12040
12097
|
bibContent.style.height = "";
|
|
@@ -12049,14 +12106,14 @@ class AuroFloatingUI {
|
|
|
12049
12106
|
}, 0);
|
|
12050
12107
|
}
|
|
12051
12108
|
|
|
12052
|
-
if (
|
|
12109
|
+
if (element.isPopoverVisible) {
|
|
12053
12110
|
this.lockScroll(true);
|
|
12054
12111
|
}
|
|
12055
12112
|
} else {
|
|
12056
|
-
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
|
|
12113
|
+
element.bib.style.position = "";
|
|
12114
|
+
element.bib.removeAttribute("isfullscreen");
|
|
12115
|
+
element.isBibFullscreen = false;
|
|
12116
|
+
element.style.contain = "layout";
|
|
12060
12117
|
}
|
|
12061
12118
|
|
|
12062
12119
|
const isChanged = this.strategy && this.strategy !== value;
|
|
@@ -12074,16 +12131,21 @@ class AuroFloatingUI {
|
|
|
12074
12131
|
},
|
|
12075
12132
|
);
|
|
12076
12133
|
|
|
12077
|
-
|
|
12134
|
+
element.dispatchEvent(event);
|
|
12078
12135
|
}
|
|
12079
12136
|
}
|
|
12080
12137
|
|
|
12081
12138
|
updateState() {
|
|
12082
|
-
const
|
|
12139
|
+
const element = this.element;
|
|
12140
|
+
if (!element) {
|
|
12141
|
+
return;
|
|
12142
|
+
}
|
|
12143
|
+
|
|
12144
|
+
const isVisible = element.isPopoverVisible;
|
|
12083
12145
|
if (!isVisible) {
|
|
12084
12146
|
this.cleanupHideHandlers();
|
|
12085
12147
|
try {
|
|
12086
|
-
|
|
12148
|
+
element.cleanup?.();
|
|
12087
12149
|
} catch (error) {
|
|
12088
12150
|
// Do nothing
|
|
12089
12151
|
}
|
|
@@ -12099,28 +12161,30 @@ class AuroFloatingUI {
|
|
|
12099
12161
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
12100
12162
|
*/
|
|
12101
12163
|
handleFocusLoss() {
|
|
12164
|
+
const element = this.element;
|
|
12165
|
+
if (!element?.bib) {
|
|
12166
|
+
return;
|
|
12167
|
+
}
|
|
12168
|
+
|
|
12102
12169
|
// if mouse is being pressed, skip and let click event to handle the action
|
|
12103
12170
|
if (AuroFloatingUI.isMousePressed) {
|
|
12104
12171
|
return;
|
|
12105
12172
|
}
|
|
12106
12173
|
|
|
12107
12174
|
if (
|
|
12108
|
-
|
|
12109
|
-
|
|
12175
|
+
element.noHideOnThisFocusLoss ||
|
|
12176
|
+
element.hasAttribute("noHideOnThisFocusLoss")
|
|
12110
12177
|
) {
|
|
12111
12178
|
return;
|
|
12112
12179
|
}
|
|
12113
12180
|
|
|
12114
12181
|
// if focus is still inside of trigger or bib, do not close
|
|
12115
|
-
if (
|
|
12116
|
-
this.element.matches(":focus") ||
|
|
12117
|
-
this.element.matches(":focus-within")
|
|
12118
|
-
) {
|
|
12182
|
+
if (element.matches(":focus") || element.matches(":focus-within")) {
|
|
12119
12183
|
return;
|
|
12120
12184
|
}
|
|
12121
12185
|
|
|
12122
12186
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
12123
|
-
if (
|
|
12187
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
12124
12188
|
return;
|
|
12125
12189
|
}
|
|
12126
12190
|
|
|
@@ -12128,23 +12192,33 @@ class AuroFloatingUI {
|
|
|
12128
12192
|
}
|
|
12129
12193
|
|
|
12130
12194
|
setupHideHandlers() {
|
|
12195
|
+
const element = this.element;
|
|
12196
|
+
if (!element) {
|
|
12197
|
+
return;
|
|
12198
|
+
}
|
|
12199
|
+
|
|
12131
12200
|
// Define handlers & store references
|
|
12132
12201
|
this.focusHandler = () => this.handleFocusLoss();
|
|
12133
12202
|
|
|
12134
12203
|
this.clickHandler = (evt) => {
|
|
12204
|
+
const element = this.element;
|
|
12205
|
+
if (!element?.bib) {
|
|
12206
|
+
return;
|
|
12207
|
+
}
|
|
12208
|
+
|
|
12135
12209
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
12136
12210
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
12137
12211
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
12138
12212
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
12139
|
-
if (
|
|
12213
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
12140
12214
|
return;
|
|
12141
12215
|
}
|
|
12142
12216
|
|
|
12143
12217
|
if (
|
|
12144
|
-
(!evt.composedPath().includes(
|
|
12145
|
-
!evt.composedPath().includes(
|
|
12146
|
-
(
|
|
12147
|
-
evt.composedPath().includes(
|
|
12218
|
+
(!evt.composedPath().includes(element.trigger) &&
|
|
12219
|
+
!evt.composedPath().includes(element.bib)) ||
|
|
12220
|
+
(element.bib.backdrop &&
|
|
12221
|
+
evt.composedPath().includes(element.bib.backdrop))
|
|
12148
12222
|
) {
|
|
12149
12223
|
const existedVisibleFloatingUI =
|
|
12150
12224
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -12165,7 +12239,12 @@ class AuroFloatingUI {
|
|
|
12165
12239
|
|
|
12166
12240
|
// ESC key handler
|
|
12167
12241
|
this.keyDownHandler = (evt) => {
|
|
12168
|
-
|
|
12242
|
+
const element = this.element;
|
|
12243
|
+
if (!element) {
|
|
12244
|
+
return;
|
|
12245
|
+
}
|
|
12246
|
+
|
|
12247
|
+
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
12169
12248
|
const existedVisibleFloatingUI =
|
|
12170
12249
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
12171
12250
|
if (
|
|
@@ -12222,6 +12301,10 @@ class AuroFloatingUI {
|
|
|
12222
12301
|
}
|
|
12223
12302
|
|
|
12224
12303
|
updateCurrentExpandedDropdown() {
|
|
12304
|
+
if (!this.element) {
|
|
12305
|
+
return;
|
|
12306
|
+
}
|
|
12307
|
+
|
|
12225
12308
|
// Close any other dropdown that is already open
|
|
12226
12309
|
const existedVisibleFloatingUI =
|
|
12227
12310
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -12238,25 +12321,34 @@ class AuroFloatingUI {
|
|
|
12238
12321
|
}
|
|
12239
12322
|
|
|
12240
12323
|
showBib() {
|
|
12241
|
-
|
|
12324
|
+
const element = this.element;
|
|
12325
|
+
if (!element) {
|
|
12326
|
+
return;
|
|
12327
|
+
}
|
|
12328
|
+
|
|
12329
|
+
if (!element.bib || (!element.trigger && !element.parentNode)) {
|
|
12330
|
+
return;
|
|
12331
|
+
}
|
|
12332
|
+
|
|
12333
|
+
if (!element.disabled && !this.showing) {
|
|
12242
12334
|
this.updateCurrentExpandedDropdown();
|
|
12243
|
-
|
|
12335
|
+
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
12244
12336
|
|
|
12245
12337
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
12246
12338
|
if (!this.showing) {
|
|
12247
|
-
if (!
|
|
12339
|
+
if (!element.modal) {
|
|
12248
12340
|
this.setupHideHandlers();
|
|
12249
12341
|
}
|
|
12250
12342
|
this.showing = true;
|
|
12251
|
-
|
|
12343
|
+
element.isPopoverVisible = true;
|
|
12252
12344
|
this.position();
|
|
12253
12345
|
this.dispatchEventDropdownToggle();
|
|
12254
12346
|
}
|
|
12255
12347
|
|
|
12256
12348
|
// Setup auto update to handle resize and scroll
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12349
|
+
element.cleanup = autoUpdate(
|
|
12350
|
+
element.trigger || element.parentNode,
|
|
12351
|
+
element.bib,
|
|
12260
12352
|
() => {
|
|
12261
12353
|
this.position();
|
|
12262
12354
|
},
|
|
@@ -12269,22 +12361,27 @@ class AuroFloatingUI {
|
|
|
12269
12361
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
12270
12362
|
*/
|
|
12271
12363
|
hideBib(eventType = "unknown") {
|
|
12272
|
-
|
|
12364
|
+
const element = this.element;
|
|
12365
|
+
if (!element) {
|
|
12366
|
+
return;
|
|
12367
|
+
}
|
|
12368
|
+
|
|
12369
|
+
if (element.disabled) {
|
|
12273
12370
|
return;
|
|
12274
12371
|
}
|
|
12275
12372
|
|
|
12276
12373
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
12277
12374
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
12278
12375
|
// Escape key or focus loss.
|
|
12279
|
-
if (
|
|
12376
|
+
if (element.noToggle && eventType === "click") {
|
|
12280
12377
|
return;
|
|
12281
12378
|
}
|
|
12282
12379
|
|
|
12283
12380
|
this.lockScroll(false);
|
|
12284
|
-
|
|
12381
|
+
element.triggerChevron?.removeAttribute("data-expanded");
|
|
12285
12382
|
|
|
12286
|
-
if (
|
|
12287
|
-
|
|
12383
|
+
if (element.isPopoverVisible) {
|
|
12384
|
+
element.isPopoverVisible = false;
|
|
12288
12385
|
}
|
|
12289
12386
|
if (this.showing) {
|
|
12290
12387
|
this.cleanupHideHandlers();
|
|
@@ -12304,6 +12401,11 @@ class AuroFloatingUI {
|
|
|
12304
12401
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
12305
12402
|
*/
|
|
12306
12403
|
dispatchEventDropdownToggle(eventType) {
|
|
12404
|
+
const element = this.element;
|
|
12405
|
+
if (!element) {
|
|
12406
|
+
return;
|
|
12407
|
+
}
|
|
12408
|
+
|
|
12307
12409
|
const event = new CustomEvent(
|
|
12308
12410
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
12309
12411
|
{
|
|
@@ -12315,11 +12417,16 @@ class AuroFloatingUI {
|
|
|
12315
12417
|
},
|
|
12316
12418
|
);
|
|
12317
12419
|
|
|
12318
|
-
|
|
12420
|
+
element.dispatchEvent(event);
|
|
12319
12421
|
}
|
|
12320
12422
|
|
|
12321
12423
|
handleClick() {
|
|
12322
|
-
|
|
12424
|
+
const element = this.element;
|
|
12425
|
+
if (!element) {
|
|
12426
|
+
return;
|
|
12427
|
+
}
|
|
12428
|
+
|
|
12429
|
+
if (element.isPopoverVisible) {
|
|
12323
12430
|
this.hideBib("click");
|
|
12324
12431
|
} else {
|
|
12325
12432
|
this.showBib();
|
|
@@ -12330,63 +12437,66 @@ class AuroFloatingUI {
|
|
|
12330
12437
|
{
|
|
12331
12438
|
composed: true,
|
|
12332
12439
|
detail: {
|
|
12333
|
-
expanded:
|
|
12440
|
+
expanded: element.isPopoverVisible,
|
|
12334
12441
|
},
|
|
12335
12442
|
},
|
|
12336
12443
|
);
|
|
12337
12444
|
|
|
12338
|
-
|
|
12445
|
+
element.dispatchEvent(event);
|
|
12339
12446
|
}
|
|
12340
12447
|
|
|
12341
12448
|
handleEvent(event) {
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
|
|
12353
|
-
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
case "mouseenter":
|
|
12359
|
-
if (this.element.hoverToggle) {
|
|
12360
|
-
this.showBib();
|
|
12361
|
-
}
|
|
12362
|
-
break;
|
|
12363
|
-
case "mouseleave":
|
|
12364
|
-
if (this.element.hoverToggle) {
|
|
12365
|
-
this.hideBib("mouseleave");
|
|
12366
|
-
}
|
|
12367
|
-
break;
|
|
12368
|
-
case "focus":
|
|
12369
|
-
if (this.element.focusShow) {
|
|
12370
|
-
/*
|
|
12371
|
-
This needs to better handle clicking that gives focus -
|
|
12372
|
-
currently it shows and then immediately hides the bib
|
|
12373
|
-
*/
|
|
12374
|
-
this.showBib();
|
|
12375
|
-
}
|
|
12376
|
-
break;
|
|
12377
|
-
case "blur":
|
|
12378
|
-
// send this task 100ms later queue to
|
|
12379
|
-
// wait a frame in case focus moves within the floating element/bib
|
|
12380
|
-
setTimeout(() => this.handleFocusLoss(), 0);
|
|
12381
|
-
break;
|
|
12382
|
-
case "click":
|
|
12383
|
-
if (document.activeElement === document.body) {
|
|
12384
|
-
event.currentTarget.focus();
|
|
12385
|
-
}
|
|
12449
|
+
const element = this.element;
|
|
12450
|
+
if (!element || element.disableEventShow) {
|
|
12451
|
+
return;
|
|
12452
|
+
}
|
|
12453
|
+
|
|
12454
|
+
switch (event.type) {
|
|
12455
|
+
case "keydown": {
|
|
12456
|
+
// Support both Enter and Space keys for accessibility
|
|
12457
|
+
// Space is included as it's expected behavior for interactive elements
|
|
12458
|
+
|
|
12459
|
+
const origin = event.composedPath()[0];
|
|
12460
|
+
if (
|
|
12461
|
+
event.key === "Enter" ||
|
|
12462
|
+
(event.key === " " && (!origin || origin.tagName !== "INPUT"))
|
|
12463
|
+
) {
|
|
12464
|
+
event.preventDefault();
|
|
12386
12465
|
this.handleClick();
|
|
12387
|
-
|
|
12388
|
-
|
|
12466
|
+
}
|
|
12467
|
+
break;
|
|
12389
12468
|
}
|
|
12469
|
+
case "mouseenter":
|
|
12470
|
+
if (element.hoverToggle) {
|
|
12471
|
+
this.showBib();
|
|
12472
|
+
}
|
|
12473
|
+
break;
|
|
12474
|
+
case "mouseleave":
|
|
12475
|
+
if (element.hoverToggle) {
|
|
12476
|
+
this.hideBib("mouseleave");
|
|
12477
|
+
}
|
|
12478
|
+
break;
|
|
12479
|
+
case "focus":
|
|
12480
|
+
if (element.focusShow) {
|
|
12481
|
+
/*
|
|
12482
|
+
This needs to better handle clicking that gives focus -
|
|
12483
|
+
currently it shows and then immediately hides the bib
|
|
12484
|
+
*/
|
|
12485
|
+
this.showBib();
|
|
12486
|
+
}
|
|
12487
|
+
break;
|
|
12488
|
+
case "blur":
|
|
12489
|
+
// send this task 100ms later queue to
|
|
12490
|
+
// wait a frame in case focus moves within the floating element/bib
|
|
12491
|
+
setTimeout(() => this.handleFocusLoss(), 0);
|
|
12492
|
+
break;
|
|
12493
|
+
case "click":
|
|
12494
|
+
if (document.activeElement === document.body) {
|
|
12495
|
+
event.currentTarget.focus();
|
|
12496
|
+
}
|
|
12497
|
+
this.handleClick();
|
|
12498
|
+
break;
|
|
12499
|
+
// Do nothing
|
|
12390
12500
|
}
|
|
12391
12501
|
}
|
|
12392
12502
|
|
|
@@ -12397,6 +12507,11 @@ class AuroFloatingUI {
|
|
|
12397
12507
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
12398
12508
|
*/
|
|
12399
12509
|
handleTriggerTabIndex() {
|
|
12510
|
+
const element = this.element;
|
|
12511
|
+
if (!element) {
|
|
12512
|
+
return;
|
|
12513
|
+
}
|
|
12514
|
+
|
|
12400
12515
|
const focusableElementSelectors = [
|
|
12401
12516
|
"a",
|
|
12402
12517
|
"button",
|
|
@@ -12409,7 +12524,7 @@ class AuroFloatingUI {
|
|
|
12409
12524
|
"auro-hyperlink",
|
|
12410
12525
|
];
|
|
12411
12526
|
|
|
12412
|
-
const triggerNode =
|
|
12527
|
+
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
12413
12528
|
if (!triggerNode) {
|
|
12414
12529
|
return;
|
|
12415
12530
|
}
|
|
@@ -12418,13 +12533,13 @@ class AuroFloatingUI {
|
|
|
12418
12533
|
focusableElementSelectors.forEach((selector) => {
|
|
12419
12534
|
// Check if the trigger node element is focusable
|
|
12420
12535
|
if (triggerNodeTagName === selector) {
|
|
12421
|
-
|
|
12536
|
+
element.tabIndex = -1;
|
|
12422
12537
|
return;
|
|
12423
12538
|
}
|
|
12424
12539
|
|
|
12425
12540
|
// Check if any child is focusable
|
|
12426
12541
|
if (triggerNode.querySelector(selector)) {
|
|
12427
|
-
|
|
12542
|
+
element.tabIndex = -1;
|
|
12428
12543
|
}
|
|
12429
12544
|
});
|
|
12430
12545
|
}
|
|
@@ -12434,13 +12549,18 @@ class AuroFloatingUI {
|
|
|
12434
12549
|
* @param {*} eventPrefix
|
|
12435
12550
|
*/
|
|
12436
12551
|
regenerateBibId() {
|
|
12437
|
-
|
|
12552
|
+
const element = this.element;
|
|
12553
|
+
if (!element) {
|
|
12554
|
+
return;
|
|
12555
|
+
}
|
|
12556
|
+
|
|
12557
|
+
this.id = element.getAttribute("id");
|
|
12438
12558
|
if (!this.id) {
|
|
12439
12559
|
this.id = window.crypto.randomUUID();
|
|
12440
|
-
|
|
12560
|
+
element.setAttribute("id", this.id);
|
|
12441
12561
|
}
|
|
12442
12562
|
|
|
12443
|
-
|
|
12563
|
+
element.bib?.setAttribute("id", `${this.id}-floater-bib`);
|
|
12444
12564
|
}
|
|
12445
12565
|
|
|
12446
12566
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -12452,67 +12572,69 @@ class AuroFloatingUI {
|
|
|
12452
12572
|
this.element = elem;
|
|
12453
12573
|
}
|
|
12454
12574
|
|
|
12455
|
-
|
|
12456
|
-
|
|
12575
|
+
const element = this.element;
|
|
12576
|
+
if (!element) {
|
|
12577
|
+
return;
|
|
12578
|
+
}
|
|
12579
|
+
|
|
12580
|
+
if (this.behavior !== element.behavior) {
|
|
12581
|
+
this.behavior = element.behavior;
|
|
12457
12582
|
}
|
|
12458
12583
|
|
|
12459
|
-
if (
|
|
12584
|
+
if (element.trigger) {
|
|
12460
12585
|
this.disconnect();
|
|
12461
12586
|
}
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
this.element.shadowRoot.querySelector("#showStateIcon");
|
|
12587
|
+
element.trigger =
|
|
12588
|
+
element.triggerElement ||
|
|
12589
|
+
element.shadowRoot?.querySelector("#trigger") ||
|
|
12590
|
+
element.trigger;
|
|
12591
|
+
element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
|
|
12592
|
+
element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
|
|
12593
|
+
element.triggerChevron =
|
|
12594
|
+
element.shadowRoot?.querySelector("#showStateIcon");
|
|
12471
12595
|
|
|
12472
|
-
if (
|
|
12473
|
-
|
|
12596
|
+
if (element.floaterConfig) {
|
|
12597
|
+
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
12474
12598
|
}
|
|
12475
12599
|
|
|
12476
12600
|
this.regenerateBibId();
|
|
12477
12601
|
this.handleTriggerTabIndex();
|
|
12478
12602
|
|
|
12479
12603
|
this.handleEvent = this.handleEvent.bind(this);
|
|
12480
|
-
if (
|
|
12604
|
+
if (element.trigger) {
|
|
12481
12605
|
if (this.enableKeyboardHandling) {
|
|
12482
|
-
|
|
12606
|
+
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
12483
12607
|
}
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12608
|
+
element.trigger.addEventListener("click", this.handleEvent);
|
|
12609
|
+
element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
12610
|
+
element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
12611
|
+
element.trigger.addEventListener("focus", this.handleEvent);
|
|
12612
|
+
element.trigger.addEventListener("blur", this.handleEvent);
|
|
12489
12613
|
}
|
|
12490
12614
|
}
|
|
12491
12615
|
|
|
12492
12616
|
disconnect() {
|
|
12493
12617
|
this.cleanupHideHandlers();
|
|
12494
|
-
if (this.element) {
|
|
12495
|
-
this.element.cleanup?.();
|
|
12496
12618
|
|
|
12497
|
-
|
|
12498
|
-
|
|
12499
|
-
|
|
12619
|
+
const element = this.element;
|
|
12620
|
+
if (!element) {
|
|
12621
|
+
return;
|
|
12622
|
+
}
|
|
12500
12623
|
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
|
|
12504
|
-
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
}
|
|
12624
|
+
element.cleanup?.();
|
|
12625
|
+
|
|
12626
|
+
if (element.bib && element.shadowRoot) {
|
|
12627
|
+
element.shadowRoot.append(element.bib);
|
|
12628
|
+
}
|
|
12629
|
+
|
|
12630
|
+
// Remove event & keyboard listeners
|
|
12631
|
+
if (element.trigger) {
|
|
12632
|
+
element.trigger.removeEventListener("keydown", this.handleEvent);
|
|
12633
|
+
element.trigger.removeEventListener("click", this.handleEvent);
|
|
12634
|
+
element.trigger.removeEventListener("mouseenter", this.handleEvent);
|
|
12635
|
+
element.trigger.removeEventListener("mouseleave", this.handleEvent);
|
|
12636
|
+
element.trigger.removeEventListener("focus", this.handleEvent);
|
|
12637
|
+
element.trigger.removeEventListener("blur", this.handleEvent);
|
|
12516
12638
|
}
|
|
12517
12639
|
}
|
|
12518
12640
|
}
|
|
@@ -12969,7 +13091,7 @@ var iconVersion$2 = '9.1.2';
|
|
|
12969
13091
|
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
12970
13092
|
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
12971
13093
|
*/
|
|
12972
|
-
function createDisplayContext(component, options = {}) {
|
|
13094
|
+
function createDisplayContext$1(component, options = {}) {
|
|
12973
13095
|
const dd = options.dropdown || component.dropdown;
|
|
12974
13096
|
// isPopoverVisible reflects as the `open` attribute.
|
|
12975
13097
|
// It reports whether the bib is open in any mode (popover or modal).
|
|
@@ -12999,11 +13121,11 @@ function createDisplayContext(component, options = {}) {
|
|
|
12999
13121
|
* @param {Object} strategy - Map of key names to handler functions.
|
|
13000
13122
|
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
13001
13123
|
*/
|
|
13002
|
-
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
13124
|
+
function applyKeyboardStrategy$1(component, strategy, options = {}) {
|
|
13003
13125
|
component.addEventListener('keydown', async (evt) => {
|
|
13004
13126
|
const handler = strategy[evt.key] || strategy.default;
|
|
13005
13127
|
if (typeof handler === 'function') {
|
|
13006
|
-
const ctx = createDisplayContext(component, options);
|
|
13128
|
+
const ctx = createDisplayContext$1(component, options);
|
|
13007
13129
|
await handler(component, evt, ctx);
|
|
13008
13130
|
}
|
|
13009
13131
|
});
|
|
@@ -13238,7 +13360,7 @@ class AuroDropdownBib extends i$1 {
|
|
|
13238
13360
|
|
|
13239
13361
|
const dialog = this.shadowRoot.querySelector('dialog');
|
|
13240
13362
|
this._setupCancelHandler(dialog);
|
|
13241
|
-
applyKeyboardStrategy(dialog, createDropdownBibKeyboardStrategy());
|
|
13363
|
+
applyKeyboardStrategy$1(dialog, createDropdownBibKeyboardStrategy());
|
|
13242
13364
|
|
|
13243
13365
|
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
13244
13366
|
bubbles: true,
|
|
@@ -13640,7 +13762,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$1 {
|
|
|
13640
13762
|
}
|
|
13641
13763
|
};
|
|
13642
13764
|
|
|
13643
|
-
var formkitVersion$1 = '
|
|
13765
|
+
var formkitVersion$1 = '202604091759';
|
|
13644
13766
|
|
|
13645
13767
|
let AuroElement$2 = class AuroElement extends i$1 {
|
|
13646
13768
|
static get properties() {
|
|
@@ -13746,7 +13868,7 @@ let AuroElement$2 = class AuroElement extends i$1 {
|
|
|
13746
13868
|
}
|
|
13747
13869
|
};
|
|
13748
13870
|
|
|
13749
|
-
// Copyright (c) 2026 Alaska Airlines. All
|
|
13871
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
13750
13872
|
// See LICENSE in the project root for license information.
|
|
13751
13873
|
|
|
13752
13874
|
|
|
@@ -21396,7 +21518,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$1 {
|
|
|
21396
21518
|
}
|
|
21397
21519
|
};
|
|
21398
21520
|
|
|
21399
|
-
var formkitVersion = '
|
|
21521
|
+
var formkitVersion = '202604091759';
|
|
21400
21522
|
|
|
21401
21523
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
21402
21524
|
// See LICENSE in the project root for license information.
|
|
@@ -22593,7 +22715,88 @@ function guardTouchPassthrough(element) {
|
|
|
22593
22715
|
}, { once: true });
|
|
22594
22716
|
}
|
|
22595
22717
|
|
|
22596
|
-
|
|
22718
|
+
/**
|
|
22719
|
+
* Computes display state once per keydown event.
|
|
22720
|
+
* Centralizes null-safety checks and makes the shared/modal/popover branching explicit.
|
|
22721
|
+
*
|
|
22722
|
+
* @param {HTMLElement} component - The component with a dropdown reference.
|
|
22723
|
+
* @param {Object} [options] - Optional config.
|
|
22724
|
+
* @param {HTMLElement} [options.dropdown] - Explicit dropdown reference. Falls back to component.dropdown.
|
|
22725
|
+
* @param {Function} [options.inputResolver] - Called with (component, ctx) to resolve the active input element.
|
|
22726
|
+
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
22727
|
+
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
22728
|
+
*/
|
|
22729
|
+
function createDisplayContext(component, options = {}) {
|
|
22730
|
+
const dd = options.dropdown || component.dropdown;
|
|
22731
|
+
// isPopoverVisible reflects as the `open` attribute.
|
|
22732
|
+
// It reports whether the bib is open in any mode (popover or modal).
|
|
22733
|
+
const isExpanded = Boolean(dd && dd.isPopoverVisible);
|
|
22734
|
+
const isFullscreen = Boolean(dd && dd.isBibFullscreen);
|
|
22735
|
+
|
|
22736
|
+
const ctx = {
|
|
22737
|
+
isExpanded,
|
|
22738
|
+
isModal: isFullscreen,
|
|
22739
|
+
isPopover: !isFullscreen,
|
|
22740
|
+
activeInput: null,
|
|
22741
|
+
};
|
|
22742
|
+
|
|
22743
|
+
if (options.inputResolver) {
|
|
22744
|
+
const resolvedInput = options.inputResolver(component, ctx);
|
|
22745
|
+
// Guard against resolvers returning undefined or non-HTMLElement values.
|
|
22746
|
+
ctx.activeInput = resolvedInput instanceof HTMLElement ? resolvedInput : null;
|
|
22747
|
+
}
|
|
22748
|
+
|
|
22749
|
+
return ctx;
|
|
22750
|
+
}
|
|
22751
|
+
|
|
22752
|
+
/**
|
|
22753
|
+
* Wires up a keydown listener that dispatches to strategy[evt.key] or strategy.default.
|
|
22754
|
+
* Handles both sync and async handlers.
|
|
22755
|
+
* @param {HTMLElement} component - The component to attach the listener to.
|
|
22756
|
+
* @param {Object} strategy - Map of key names to handler functions.
|
|
22757
|
+
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
22758
|
+
*/
|
|
22759
|
+
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
22760
|
+
component.addEventListener('keydown', async (evt) => {
|
|
22761
|
+
const handler = strategy[evt.key] || strategy.default;
|
|
22762
|
+
if (typeof handler === 'function') {
|
|
22763
|
+
const ctx = createDisplayContext(component, options);
|
|
22764
|
+
await handler(component, evt, ctx);
|
|
22765
|
+
}
|
|
22766
|
+
});
|
|
22767
|
+
}
|
|
22768
|
+
|
|
22769
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
22770
|
+
// See LICENSE in the project root for license information.
|
|
22771
|
+
|
|
22772
|
+
// Authoritative datepicker keyboard behavior spec:
|
|
22773
|
+
// components/datepicker/docs/partials/keyboardBehavior.md
|
|
22774
|
+
//
|
|
22775
|
+
// Current behavior (transitional — full bib keyboard navigation is planned for a future iteration):
|
|
22776
|
+
// - The bib opens and closes via pointer/touch interaction only.
|
|
22777
|
+
// - Escape closes the bib and prevents the event from reaching parent containers.
|
|
22778
|
+
// - Tab uses the browser's default tabindex sequence across trigger controls.
|
|
22779
|
+
// - Enter and Space do not open or close the bib.
|
|
22780
|
+
//
|
|
22781
|
+
// This file is an intentional placeholder for most keys. When datepicker bib keyboard navigation is
|
|
22782
|
+
// added, handlers should go here following the same strategy pattern used by
|
|
22783
|
+
// auro-select (selectKeyboardStrategy.js) and auro-combobox (comboboxKeyboardStrategy.js).
|
|
22784
|
+
const datepickerKeyboardStrategy = {
|
|
22785
|
+
Escape(component, evt) {
|
|
22786
|
+
if (!component.dropdown || !component.dropdown.isPopoverVisible) {
|
|
22787
|
+
return;
|
|
22788
|
+
}
|
|
22789
|
+
|
|
22790
|
+
// Prevent the Escape key from bubbling up and closing any parent dialogs / drawers / popups.
|
|
22791
|
+
// Because stopPropagation prevents the document-level floatingUI keydown handler from
|
|
22792
|
+
// seeing this event, we must also close the dropdown explicitly.
|
|
22793
|
+
evt.stopPropagation();
|
|
22794
|
+
|
|
22795
|
+
component.dropdown.hide();
|
|
22796
|
+
},
|
|
22797
|
+
};
|
|
22798
|
+
|
|
22799
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
22597
22800
|
// See LICENSE in the project root for license information.
|
|
22598
22801
|
|
|
22599
22802
|
|
|
@@ -24050,6 +24253,7 @@ class AuroDatePicker extends AuroElement {
|
|
|
24050
24253
|
this.configureCalendar();
|
|
24051
24254
|
this.configureDatepicker();
|
|
24052
24255
|
this.configureClickHandler();
|
|
24256
|
+
applyKeyboardStrategy(this, datepickerKeyboardStrategy);
|
|
24053
24257
|
}
|
|
24054
24258
|
|
|
24055
24259
|
connectedCallback() {
|
|
@@ -24520,6 +24724,7 @@ function initExamples(initCount) {
|
|
|
24520
24724
|
updateMinDateExample();
|
|
24521
24725
|
validityExample();
|
|
24522
24726
|
inDialogExample();
|
|
24727
|
+
inDrawerExample();
|
|
24523
24728
|
localizationExample();
|
|
24524
24729
|
resetStateExample();
|
|
24525
24730
|
} catch (error) {
|