@aurodesignsystem-dev/auro-formkit 0.0.0-pr1424.3 → 0.0.0-pr1425.1
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 +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 +284 -165
- package/components/combobox/demo/index.min.js +284 -165
- package/components/combobox/dist/index.js +284 -165
- package/components/combobox/dist/registered.js +284 -165
- package/components/counter/demo/api.min.js +283 -164
- package/components/counter/demo/index.min.js +283 -164
- package/components/counter/dist/index.js +283 -164
- package/components/counter/dist/registered.js +283 -164
- package/components/datepicker/demo/api.min.js +284 -165
- package/components/datepicker/demo/index.min.js +284 -165
- package/components/datepicker/dist/index.js +284 -165
- package/components/datepicker/dist/registered.js +284 -165
- package/components/dropdown/demo/api.md +1 -0
- package/components/dropdown/demo/api.min.js +283 -164
- package/components/dropdown/demo/index.min.js +283 -164
- package/components/dropdown/dist/auro-dropdown.d.ts +7 -0
- package/components/dropdown/dist/index.js +283 -164
- package/components/dropdown/dist/registered.js +283 -164
- package/components/form/demo/api.md +76 -460
- package/components/form/demo/api.min.js +1139 -664
- package/components/form/demo/index.min.js +1139 -664
- 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 +285 -167
- package/components/select/demo/index.min.js +285 -167
- package/components/select/dist/index.js +285 -167
- package/components/select/dist/registered.js +285 -167
- package/custom-elements.json +19 -0
- package/package.json +3 -3
|
@@ -3312,11 +3312,19 @@ class AuroFloatingUI {
|
|
|
3312
3312
|
* This ensures that the bib content has the same dimensions as the sizer element.
|
|
3313
3313
|
*/
|
|
3314
3314
|
mirrorSize() {
|
|
3315
|
+
const element = this.element;
|
|
3316
|
+
if (!element) {
|
|
3317
|
+
return;
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3315
3320
|
// mirror the boxsize from bibSizer
|
|
3316
|
-
if (
|
|
3317
|
-
const sizerStyle = window.getComputedStyle(
|
|
3318
|
-
const bibContent =
|
|
3319
|
-
|
|
3321
|
+
if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
|
|
3322
|
+
const sizerStyle = window.getComputedStyle(element.bibSizer);
|
|
3323
|
+
const bibContent = element.bib.shadowRoot.querySelector(".container");
|
|
3324
|
+
if (!bibContent) {
|
|
3325
|
+
return;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3320
3328
|
if (sizerStyle.width !== "0px") {
|
|
3321
3329
|
bibContent.style.width = sizerStyle.width;
|
|
3322
3330
|
}
|
|
@@ -3338,9 +3346,14 @@ class AuroFloatingUI {
|
|
|
3338
3346
|
* @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
|
|
3339
3347
|
*/
|
|
3340
3348
|
getPositioningStrategy() {
|
|
3349
|
+
const element = this.element;
|
|
3350
|
+
if (!element) {
|
|
3351
|
+
return "floating";
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3341
3354
|
const breakpoint =
|
|
3342
|
-
|
|
3343
|
-
|
|
3355
|
+
element.bib?.mobileFullscreenBreakpoint ||
|
|
3356
|
+
element.floaterConfig?.fullscreenBreakpoint;
|
|
3344
3357
|
switch (this.behavior) {
|
|
3345
3358
|
case "tooltip":
|
|
3346
3359
|
return "floating";
|
|
@@ -3351,9 +3364,9 @@ class AuroFloatingUI {
|
|
|
3351
3364
|
`(max-width: ${breakpoint})`,
|
|
3352
3365
|
).matches;
|
|
3353
3366
|
|
|
3354
|
-
|
|
3367
|
+
element.expanded = smallerThanBreakpoint;
|
|
3355
3368
|
}
|
|
3356
|
-
if (
|
|
3369
|
+
if (element.nested) {
|
|
3357
3370
|
return "cover";
|
|
3358
3371
|
}
|
|
3359
3372
|
return "fullscreen";
|
|
@@ -3383,42 +3396,65 @@ class AuroFloatingUI {
|
|
|
3383
3396
|
* and applies the calculated position to the bib's style.
|
|
3384
3397
|
*/
|
|
3385
3398
|
position() {
|
|
3399
|
+
const element = this.element;
|
|
3400
|
+
if (!element) {
|
|
3401
|
+
return;
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3386
3404
|
const strategy = this.getPositioningStrategy();
|
|
3387
3405
|
this.configureBibStrategy(strategy);
|
|
3388
3406
|
|
|
3389
3407
|
if (strategy === "floating") {
|
|
3408
|
+
if (!element.trigger || !element.bib) {
|
|
3409
|
+
return;
|
|
3410
|
+
}
|
|
3411
|
+
|
|
3390
3412
|
this.mirrorSize();
|
|
3391
3413
|
// Define the middlware for the floater configuration
|
|
3392
3414
|
const middleware = [
|
|
3393
|
-
offset(
|
|
3394
|
-
...(
|
|
3395
|
-
...(
|
|
3396
|
-
...(
|
|
3415
|
+
offset(element.floaterConfig?.offset || 0),
|
|
3416
|
+
...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
|
|
3417
|
+
...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
|
|
3418
|
+
...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
|
|
3397
3419
|
];
|
|
3398
3420
|
|
|
3399
3421
|
// Compute the position of the bib
|
|
3400
|
-
computePosition(
|
|
3401
|
-
strategy:
|
|
3402
|
-
placement:
|
|
3422
|
+
computePosition(element.trigger, element.bib, {
|
|
3423
|
+
strategy: element.floaterConfig?.strategy || "fixed",
|
|
3424
|
+
placement: element.floaterConfig?.placement,
|
|
3403
3425
|
middleware: middleware || [],
|
|
3404
3426
|
}).then(({ x, y }) => {
|
|
3405
3427
|
// eslint-disable-line id-length
|
|
3406
|
-
|
|
3428
|
+
const currentElement = this.element;
|
|
3429
|
+
if (!currentElement?.bib) {
|
|
3430
|
+
return;
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
Object.assign(currentElement.bib.style, {
|
|
3407
3434
|
left: `${x}px`,
|
|
3408
3435
|
top: `${y}px`,
|
|
3409
3436
|
});
|
|
3410
3437
|
});
|
|
3411
3438
|
} else if (strategy === "cover") {
|
|
3439
|
+
if (!element.parentNode || !element.bib) {
|
|
3440
|
+
return;
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3412
3443
|
// Compute the position of the bib
|
|
3413
|
-
computePosition(
|
|
3444
|
+
computePosition(element.parentNode, element.bib, {
|
|
3414
3445
|
placement: "bottom-start",
|
|
3415
3446
|
}).then(({ x, y }) => {
|
|
3416
3447
|
// eslint-disable-line id-length
|
|
3417
|
-
|
|
3448
|
+
const currentElement = this.element;
|
|
3449
|
+
if (!currentElement?.bib || !currentElement.parentNode) {
|
|
3450
|
+
return;
|
|
3451
|
+
}
|
|
3452
|
+
|
|
3453
|
+
Object.assign(currentElement.bib.style, {
|
|
3418
3454
|
left: `${x}px`,
|
|
3419
|
-
top: `${y -
|
|
3420
|
-
width: `${
|
|
3421
|
-
height: `${
|
|
3455
|
+
top: `${y - currentElement.parentNode.offsetHeight}px`,
|
|
3456
|
+
width: `${currentElement.parentNode.offsetWidth}px`,
|
|
3457
|
+
height: `${currentElement.parentNode.offsetHeight}px`,
|
|
3422
3458
|
});
|
|
3423
3459
|
});
|
|
3424
3460
|
}
|
|
@@ -3430,11 +3466,17 @@ class AuroFloatingUI {
|
|
|
3430
3466
|
* @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
|
|
3431
3467
|
*/
|
|
3432
3468
|
lockScroll(lock = true) {
|
|
3469
|
+
const element = this.element;
|
|
3470
|
+
|
|
3433
3471
|
if (lock) {
|
|
3472
|
+
if (!element?.bib) {
|
|
3473
|
+
return;
|
|
3474
|
+
}
|
|
3475
|
+
|
|
3434
3476
|
document.body.style.overflow = "hidden"; // hide body's scrollbar
|
|
3435
3477
|
|
|
3436
3478
|
// Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
|
|
3437
|
-
|
|
3479
|
+
element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
3438
3480
|
} else {
|
|
3439
3481
|
document.body.style.overflow = "";
|
|
3440
3482
|
}
|
|
@@ -3450,20 +3492,24 @@ class AuroFloatingUI {
|
|
|
3450
3492
|
* @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
|
|
3451
3493
|
*/
|
|
3452
3494
|
configureBibStrategy(value) {
|
|
3495
|
+
const element = this.element;
|
|
3496
|
+
if (!element?.bib) {
|
|
3497
|
+
return;
|
|
3498
|
+
}
|
|
3499
|
+
|
|
3453
3500
|
if (value === "fullscreen") {
|
|
3454
|
-
|
|
3501
|
+
element.isBibFullscreen = true;
|
|
3455
3502
|
// reset the prev position
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3503
|
+
element.bib.setAttribute("isfullscreen", "");
|
|
3504
|
+
element.bib.style.position = "fixed";
|
|
3505
|
+
element.bib.style.top = "0px";
|
|
3506
|
+
element.bib.style.left = "0px";
|
|
3507
|
+
element.bib.style.width = "";
|
|
3508
|
+
element.bib.style.height = "";
|
|
3509
|
+
element.style.contain = "";
|
|
3463
3510
|
|
|
3464
3511
|
// reset the size that was mirroring `size` css-part
|
|
3465
|
-
const bibContent =
|
|
3466
|
-
this.element.bib.shadowRoot.querySelector(".container");
|
|
3512
|
+
const bibContent = element.bib.shadowRoot?.querySelector(".container");
|
|
3467
3513
|
if (bibContent) {
|
|
3468
3514
|
bibContent.style.width = "";
|
|
3469
3515
|
bibContent.style.height = "";
|
|
@@ -3478,14 +3524,14 @@ class AuroFloatingUI {
|
|
|
3478
3524
|
}, 0);
|
|
3479
3525
|
}
|
|
3480
3526
|
|
|
3481
|
-
if (
|
|
3527
|
+
if (element.isPopoverVisible) {
|
|
3482
3528
|
this.lockScroll(true);
|
|
3483
3529
|
}
|
|
3484
3530
|
} else {
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3531
|
+
element.bib.style.position = "";
|
|
3532
|
+
element.bib.removeAttribute("isfullscreen");
|
|
3533
|
+
element.isBibFullscreen = false;
|
|
3534
|
+
element.style.contain = "layout";
|
|
3489
3535
|
}
|
|
3490
3536
|
|
|
3491
3537
|
const isChanged = this.strategy && this.strategy !== value;
|
|
@@ -3503,16 +3549,21 @@ class AuroFloatingUI {
|
|
|
3503
3549
|
},
|
|
3504
3550
|
);
|
|
3505
3551
|
|
|
3506
|
-
|
|
3552
|
+
element.dispatchEvent(event);
|
|
3507
3553
|
}
|
|
3508
3554
|
}
|
|
3509
3555
|
|
|
3510
3556
|
updateState() {
|
|
3511
|
-
const
|
|
3557
|
+
const element = this.element;
|
|
3558
|
+
if (!element) {
|
|
3559
|
+
return;
|
|
3560
|
+
}
|
|
3561
|
+
|
|
3562
|
+
const isVisible = element.isPopoverVisible;
|
|
3512
3563
|
if (!isVisible) {
|
|
3513
3564
|
this.cleanupHideHandlers();
|
|
3514
3565
|
try {
|
|
3515
|
-
|
|
3566
|
+
element.cleanup?.();
|
|
3516
3567
|
} catch (error) {
|
|
3517
3568
|
// Do nothing
|
|
3518
3569
|
}
|
|
@@ -3528,28 +3579,30 @@ class AuroFloatingUI {
|
|
|
3528
3579
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
3529
3580
|
*/
|
|
3530
3581
|
handleFocusLoss() {
|
|
3582
|
+
const element = this.element;
|
|
3583
|
+
if (!element?.bib) {
|
|
3584
|
+
return;
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3531
3587
|
// if mouse is being pressed, skip and let click event to handle the action
|
|
3532
3588
|
if (AuroFloatingUI.isMousePressed) {
|
|
3533
3589
|
return;
|
|
3534
3590
|
}
|
|
3535
3591
|
|
|
3536
3592
|
if (
|
|
3537
|
-
|
|
3538
|
-
|
|
3593
|
+
element.noHideOnThisFocusLoss ||
|
|
3594
|
+
element.hasAttribute("noHideOnThisFocusLoss")
|
|
3539
3595
|
) {
|
|
3540
3596
|
return;
|
|
3541
3597
|
}
|
|
3542
3598
|
|
|
3543
3599
|
// if focus is still inside of trigger or bib, do not close
|
|
3544
|
-
if (
|
|
3545
|
-
this.element.matches(":focus") ||
|
|
3546
|
-
this.element.matches(":focus-within")
|
|
3547
|
-
) {
|
|
3600
|
+
if (element.matches(":focus") || element.matches(":focus-within")) {
|
|
3548
3601
|
return;
|
|
3549
3602
|
}
|
|
3550
3603
|
|
|
3551
3604
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
3552
|
-
if (
|
|
3605
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
3553
3606
|
return;
|
|
3554
3607
|
}
|
|
3555
3608
|
|
|
@@ -3557,23 +3610,33 @@ class AuroFloatingUI {
|
|
|
3557
3610
|
}
|
|
3558
3611
|
|
|
3559
3612
|
setupHideHandlers() {
|
|
3613
|
+
const element = this.element;
|
|
3614
|
+
if (!element) {
|
|
3615
|
+
return;
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3560
3618
|
// Define handlers & store references
|
|
3561
3619
|
this.focusHandler = () => this.handleFocusLoss();
|
|
3562
3620
|
|
|
3563
3621
|
this.clickHandler = (evt) => {
|
|
3622
|
+
const element = this.element;
|
|
3623
|
+
if (!element?.bib) {
|
|
3624
|
+
return;
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3564
3627
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
3565
3628
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
3566
3629
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
3567
3630
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
3568
|
-
if (
|
|
3631
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
3569
3632
|
return;
|
|
3570
3633
|
}
|
|
3571
3634
|
|
|
3572
3635
|
if (
|
|
3573
|
-
(!evt.composedPath().includes(
|
|
3574
|
-
!evt.composedPath().includes(
|
|
3575
|
-
(
|
|
3576
|
-
evt.composedPath().includes(
|
|
3636
|
+
(!evt.composedPath().includes(element.trigger) &&
|
|
3637
|
+
!evt.composedPath().includes(element.bib)) ||
|
|
3638
|
+
(element.bib.backdrop &&
|
|
3639
|
+
evt.composedPath().includes(element.bib.backdrop))
|
|
3577
3640
|
) {
|
|
3578
3641
|
const existedVisibleFloatingUI =
|
|
3579
3642
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -3594,7 +3657,12 @@ class AuroFloatingUI {
|
|
|
3594
3657
|
|
|
3595
3658
|
// ESC key handler
|
|
3596
3659
|
this.keyDownHandler = (evt) => {
|
|
3597
|
-
|
|
3660
|
+
const element = this.element;
|
|
3661
|
+
if (!element) {
|
|
3662
|
+
return;
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
3598
3666
|
const existedVisibleFloatingUI =
|
|
3599
3667
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
3600
3668
|
if (
|
|
@@ -3651,6 +3719,10 @@ class AuroFloatingUI {
|
|
|
3651
3719
|
}
|
|
3652
3720
|
|
|
3653
3721
|
updateCurrentExpandedDropdown() {
|
|
3722
|
+
if (!this.element) {
|
|
3723
|
+
return;
|
|
3724
|
+
}
|
|
3725
|
+
|
|
3654
3726
|
// Close any other dropdown that is already open
|
|
3655
3727
|
const existedVisibleFloatingUI =
|
|
3656
3728
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -3667,25 +3739,34 @@ class AuroFloatingUI {
|
|
|
3667
3739
|
}
|
|
3668
3740
|
|
|
3669
3741
|
showBib() {
|
|
3670
|
-
|
|
3742
|
+
const element = this.element;
|
|
3743
|
+
if (!element) {
|
|
3744
|
+
return;
|
|
3745
|
+
}
|
|
3746
|
+
|
|
3747
|
+
if (!element.bib || (!element.trigger && !element.parentNode)) {
|
|
3748
|
+
return;
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
if (!element.disabled && !this.showing) {
|
|
3671
3752
|
this.updateCurrentExpandedDropdown();
|
|
3672
|
-
|
|
3753
|
+
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
3673
3754
|
|
|
3674
3755
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
3675
3756
|
if (!this.showing) {
|
|
3676
|
-
if (!
|
|
3757
|
+
if (!element.modal) {
|
|
3677
3758
|
this.setupHideHandlers();
|
|
3678
3759
|
}
|
|
3679
3760
|
this.showing = true;
|
|
3680
|
-
|
|
3761
|
+
element.isPopoverVisible = true;
|
|
3681
3762
|
this.position();
|
|
3682
3763
|
this.dispatchEventDropdownToggle();
|
|
3683
3764
|
}
|
|
3684
3765
|
|
|
3685
3766
|
// Setup auto update to handle resize and scroll
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3767
|
+
element.cleanup = autoUpdate(
|
|
3768
|
+
element.trigger || element.parentNode,
|
|
3769
|
+
element.bib,
|
|
3689
3770
|
() => {
|
|
3690
3771
|
this.position();
|
|
3691
3772
|
},
|
|
@@ -3698,22 +3779,27 @@ class AuroFloatingUI {
|
|
|
3698
3779
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3699
3780
|
*/
|
|
3700
3781
|
hideBib(eventType = "unknown") {
|
|
3701
|
-
|
|
3782
|
+
const element = this.element;
|
|
3783
|
+
if (!element) {
|
|
3784
|
+
return;
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
if (element.disabled) {
|
|
3702
3788
|
return;
|
|
3703
3789
|
}
|
|
3704
3790
|
|
|
3705
3791
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
3706
3792
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
3707
3793
|
// Escape key or focus loss.
|
|
3708
|
-
if (
|
|
3794
|
+
if (element.noToggle && eventType === "click") {
|
|
3709
3795
|
return;
|
|
3710
3796
|
}
|
|
3711
3797
|
|
|
3712
3798
|
this.lockScroll(false);
|
|
3713
|
-
|
|
3799
|
+
element.triggerChevron?.removeAttribute("data-expanded");
|
|
3714
3800
|
|
|
3715
|
-
if (
|
|
3716
|
-
|
|
3801
|
+
if (element.isPopoverVisible) {
|
|
3802
|
+
element.isPopoverVisible = false;
|
|
3717
3803
|
}
|
|
3718
3804
|
if (this.showing) {
|
|
3719
3805
|
this.cleanupHideHandlers();
|
|
@@ -3733,6 +3819,11 @@ class AuroFloatingUI {
|
|
|
3733
3819
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3734
3820
|
*/
|
|
3735
3821
|
dispatchEventDropdownToggle(eventType) {
|
|
3822
|
+
const element = this.element;
|
|
3823
|
+
if (!element) {
|
|
3824
|
+
return;
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3736
3827
|
const event = new CustomEvent(
|
|
3737
3828
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
3738
3829
|
{
|
|
@@ -3744,11 +3835,16 @@ class AuroFloatingUI {
|
|
|
3744
3835
|
},
|
|
3745
3836
|
);
|
|
3746
3837
|
|
|
3747
|
-
|
|
3838
|
+
element.dispatchEvent(event);
|
|
3748
3839
|
}
|
|
3749
3840
|
|
|
3750
3841
|
handleClick() {
|
|
3751
|
-
|
|
3842
|
+
const element = this.element;
|
|
3843
|
+
if (!element) {
|
|
3844
|
+
return;
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3847
|
+
if (element.isPopoverVisible) {
|
|
3752
3848
|
this.hideBib("click");
|
|
3753
3849
|
} else {
|
|
3754
3850
|
this.showBib();
|
|
@@ -3759,63 +3855,66 @@ class AuroFloatingUI {
|
|
|
3759
3855
|
{
|
|
3760
3856
|
composed: true,
|
|
3761
3857
|
detail: {
|
|
3762
|
-
expanded:
|
|
3858
|
+
expanded: element.isPopoverVisible,
|
|
3763
3859
|
},
|
|
3764
3860
|
},
|
|
3765
3861
|
);
|
|
3766
3862
|
|
|
3767
|
-
|
|
3863
|
+
element.dispatchEvent(event);
|
|
3768
3864
|
}
|
|
3769
3865
|
|
|
3770
3866
|
handleEvent(event) {
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
case "mouseenter":
|
|
3788
|
-
if (this.element.hoverToggle) {
|
|
3789
|
-
this.showBib();
|
|
3790
|
-
}
|
|
3791
|
-
break;
|
|
3792
|
-
case "mouseleave":
|
|
3793
|
-
if (this.element.hoverToggle) {
|
|
3794
|
-
this.hideBib("mouseleave");
|
|
3795
|
-
}
|
|
3796
|
-
break;
|
|
3797
|
-
case "focus":
|
|
3798
|
-
if (this.element.focusShow) {
|
|
3799
|
-
/*
|
|
3800
|
-
This needs to better handle clicking that gives focus -
|
|
3801
|
-
currently it shows and then immediately hides the bib
|
|
3802
|
-
*/
|
|
3803
|
-
this.showBib();
|
|
3804
|
-
}
|
|
3805
|
-
break;
|
|
3806
|
-
case "blur":
|
|
3807
|
-
// send this task 100ms later queue to
|
|
3808
|
-
// wait a frame in case focus moves within the floating element/bib
|
|
3809
|
-
setTimeout(() => this.handleFocusLoss(), 0);
|
|
3810
|
-
break;
|
|
3811
|
-
case "click":
|
|
3812
|
-
if (document.activeElement === document.body) {
|
|
3813
|
-
event.currentTarget.focus();
|
|
3814
|
-
}
|
|
3867
|
+
const element = this.element;
|
|
3868
|
+
if (!element || element.disableEventShow) {
|
|
3869
|
+
return;
|
|
3870
|
+
}
|
|
3871
|
+
|
|
3872
|
+
switch (event.type) {
|
|
3873
|
+
case "keydown": {
|
|
3874
|
+
// Support both Enter and Space keys for accessibility
|
|
3875
|
+
// Space is included as it's expected behavior for interactive elements
|
|
3876
|
+
|
|
3877
|
+
const origin = event.composedPath()[0];
|
|
3878
|
+
if (
|
|
3879
|
+
event.key === "Enter" ||
|
|
3880
|
+
(event.key === " " && (!origin || origin.tagName !== "INPUT"))
|
|
3881
|
+
) {
|
|
3882
|
+
event.preventDefault();
|
|
3815
3883
|
this.handleClick();
|
|
3816
|
-
|
|
3817
|
-
|
|
3884
|
+
}
|
|
3885
|
+
break;
|
|
3818
3886
|
}
|
|
3887
|
+
case "mouseenter":
|
|
3888
|
+
if (element.hoverToggle) {
|
|
3889
|
+
this.showBib();
|
|
3890
|
+
}
|
|
3891
|
+
break;
|
|
3892
|
+
case "mouseleave":
|
|
3893
|
+
if (element.hoverToggle) {
|
|
3894
|
+
this.hideBib("mouseleave");
|
|
3895
|
+
}
|
|
3896
|
+
break;
|
|
3897
|
+
case "focus":
|
|
3898
|
+
if (element.focusShow) {
|
|
3899
|
+
/*
|
|
3900
|
+
This needs to better handle clicking that gives focus -
|
|
3901
|
+
currently it shows and then immediately hides the bib
|
|
3902
|
+
*/
|
|
3903
|
+
this.showBib();
|
|
3904
|
+
}
|
|
3905
|
+
break;
|
|
3906
|
+
case "blur":
|
|
3907
|
+
// send this task 100ms later queue to
|
|
3908
|
+
// wait a frame in case focus moves within the floating element/bib
|
|
3909
|
+
setTimeout(() => this.handleFocusLoss(), 0);
|
|
3910
|
+
break;
|
|
3911
|
+
case "click":
|
|
3912
|
+
if (document.activeElement === document.body) {
|
|
3913
|
+
event.currentTarget.focus();
|
|
3914
|
+
}
|
|
3915
|
+
this.handleClick();
|
|
3916
|
+
break;
|
|
3917
|
+
// Do nothing
|
|
3819
3918
|
}
|
|
3820
3919
|
}
|
|
3821
3920
|
|
|
@@ -3826,6 +3925,11 @@ class AuroFloatingUI {
|
|
|
3826
3925
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
3827
3926
|
*/
|
|
3828
3927
|
handleTriggerTabIndex() {
|
|
3928
|
+
const element = this.element;
|
|
3929
|
+
if (!element) {
|
|
3930
|
+
return;
|
|
3931
|
+
}
|
|
3932
|
+
|
|
3829
3933
|
const focusableElementSelectors = [
|
|
3830
3934
|
"a",
|
|
3831
3935
|
"button",
|
|
@@ -3838,7 +3942,7 @@ class AuroFloatingUI {
|
|
|
3838
3942
|
"auro-hyperlink",
|
|
3839
3943
|
];
|
|
3840
3944
|
|
|
3841
|
-
const triggerNode =
|
|
3945
|
+
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
3842
3946
|
if (!triggerNode) {
|
|
3843
3947
|
return;
|
|
3844
3948
|
}
|
|
@@ -3847,13 +3951,13 @@ class AuroFloatingUI {
|
|
|
3847
3951
|
focusableElementSelectors.forEach((selector) => {
|
|
3848
3952
|
// Check if the trigger node element is focusable
|
|
3849
3953
|
if (triggerNodeTagName === selector) {
|
|
3850
|
-
|
|
3954
|
+
element.tabIndex = -1;
|
|
3851
3955
|
return;
|
|
3852
3956
|
}
|
|
3853
3957
|
|
|
3854
3958
|
// Check if any child is focusable
|
|
3855
3959
|
if (triggerNode.querySelector(selector)) {
|
|
3856
|
-
|
|
3960
|
+
element.tabIndex = -1;
|
|
3857
3961
|
}
|
|
3858
3962
|
});
|
|
3859
3963
|
}
|
|
@@ -3863,13 +3967,18 @@ class AuroFloatingUI {
|
|
|
3863
3967
|
* @param {*} eventPrefix
|
|
3864
3968
|
*/
|
|
3865
3969
|
regenerateBibId() {
|
|
3866
|
-
|
|
3970
|
+
const element = this.element;
|
|
3971
|
+
if (!element) {
|
|
3972
|
+
return;
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
this.id = element.getAttribute("id");
|
|
3867
3976
|
if (!this.id) {
|
|
3868
3977
|
this.id = window.crypto.randomUUID();
|
|
3869
|
-
|
|
3978
|
+
element.setAttribute("id", this.id);
|
|
3870
3979
|
}
|
|
3871
3980
|
|
|
3872
|
-
|
|
3981
|
+
element.bib?.setAttribute("id", `${this.id}-floater-bib`);
|
|
3873
3982
|
}
|
|
3874
3983
|
|
|
3875
3984
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -3881,67 +3990,69 @@ class AuroFloatingUI {
|
|
|
3881
3990
|
this.element = elem;
|
|
3882
3991
|
}
|
|
3883
3992
|
|
|
3884
|
-
|
|
3885
|
-
|
|
3993
|
+
const element = this.element;
|
|
3994
|
+
if (!element) {
|
|
3995
|
+
return;
|
|
3886
3996
|
}
|
|
3887
3997
|
|
|
3888
|
-
if (this.element.
|
|
3998
|
+
if (this.behavior !== element.behavior) {
|
|
3999
|
+
this.behavior = element.behavior;
|
|
4000
|
+
}
|
|
4001
|
+
|
|
4002
|
+
if (element.trigger) {
|
|
3889
4003
|
this.disconnect();
|
|
3890
4004
|
}
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
this.element.shadowRoot.querySelector("#showStateIcon");
|
|
4005
|
+
element.trigger =
|
|
4006
|
+
element.triggerElement ||
|
|
4007
|
+
element.shadowRoot?.querySelector("#trigger") ||
|
|
4008
|
+
element.trigger;
|
|
4009
|
+
element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
|
|
4010
|
+
element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
|
|
4011
|
+
element.triggerChevron =
|
|
4012
|
+
element.shadowRoot?.querySelector("#showStateIcon");
|
|
3900
4013
|
|
|
3901
|
-
if (
|
|
3902
|
-
|
|
4014
|
+
if (element.floaterConfig) {
|
|
4015
|
+
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
3903
4016
|
}
|
|
3904
4017
|
|
|
3905
4018
|
this.regenerateBibId();
|
|
3906
4019
|
this.handleTriggerTabIndex();
|
|
3907
4020
|
|
|
3908
4021
|
this.handleEvent = this.handleEvent.bind(this);
|
|
3909
|
-
if (
|
|
4022
|
+
if (element.trigger) {
|
|
3910
4023
|
if (this.enableKeyboardHandling) {
|
|
3911
|
-
|
|
4024
|
+
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
3912
4025
|
}
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
4026
|
+
element.trigger.addEventListener("click", this.handleEvent);
|
|
4027
|
+
element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
4028
|
+
element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
4029
|
+
element.trigger.addEventListener("focus", this.handleEvent);
|
|
4030
|
+
element.trigger.addEventListener("blur", this.handleEvent);
|
|
3918
4031
|
}
|
|
3919
4032
|
}
|
|
3920
4033
|
|
|
3921
4034
|
disconnect() {
|
|
3922
4035
|
this.cleanupHideHandlers();
|
|
3923
|
-
if (this.element) {
|
|
3924
|
-
this.element.cleanup?.();
|
|
3925
4036
|
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
4037
|
+
const element = this.element;
|
|
4038
|
+
if (!element) {
|
|
4039
|
+
return;
|
|
4040
|
+
}
|
|
3929
4041
|
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
}
|
|
4042
|
+
element.cleanup?.();
|
|
4043
|
+
|
|
4044
|
+
if (element.bib && element.shadowRoot) {
|
|
4045
|
+
element.shadowRoot.append(element.bib);
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
// Remove event & keyboard listeners
|
|
4049
|
+
if (element.trigger) {
|
|
4050
|
+
element.trigger.removeEventListener("keydown", this.handleEvent);
|
|
4051
|
+
element.trigger.removeEventListener("click", this.handleEvent);
|
|
4052
|
+
element.trigger.removeEventListener("mouseenter", this.handleEvent);
|
|
4053
|
+
element.trigger.removeEventListener("mouseleave", this.handleEvent);
|
|
4054
|
+
element.trigger.removeEventListener("focus", this.handleEvent);
|
|
4055
|
+
element.trigger.removeEventListener("blur", this.handleEvent);
|
|
3945
4056
|
}
|
|
3946
4057
|
}
|
|
3947
4058
|
}
|
|
@@ -5069,7 +5180,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
|
|
|
5069
5180
|
}
|
|
5070
5181
|
};
|
|
5071
5182
|
|
|
5072
|
-
var formkitVersion$2 = '
|
|
5183
|
+
var formkitVersion$2 = '202604081411';
|
|
5073
5184
|
|
|
5074
5185
|
let AuroElement$2 = class AuroElement extends i$4 {
|
|
5075
5186
|
static get properties() {
|
|
@@ -5527,6 +5638,14 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5527
5638
|
reflect: true
|
|
5528
5639
|
},
|
|
5529
5640
|
|
|
5641
|
+
/**
|
|
5642
|
+
* If declared, the trigger will toggle the dropdown on mouseover/mouseout.
|
|
5643
|
+
*/
|
|
5644
|
+
hoverToggle: {
|
|
5645
|
+
type: Boolean,
|
|
5646
|
+
reflect: true
|
|
5647
|
+
},
|
|
5648
|
+
|
|
5530
5649
|
/**
|
|
5531
5650
|
* @private
|
|
5532
5651
|
*/
|
|
@@ -12825,7 +12944,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
|
|
|
12825
12944
|
}
|
|
12826
12945
|
};
|
|
12827
12946
|
|
|
12828
|
-
var formkitVersion$1 = '
|
|
12947
|
+
var formkitVersion$1 = '202604081411';
|
|
12829
12948
|
|
|
12830
12949
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12831
12950
|
// See LICENSE in the project root for license information.
|
|
@@ -13890,7 +14009,7 @@ class AuroBibtemplate extends i$4 {
|
|
|
13890
14009
|
}
|
|
13891
14010
|
}
|
|
13892
14011
|
|
|
13893
|
-
var formkitVersion = '
|
|
14012
|
+
var formkitVersion = '202604081411';
|
|
13894
14013
|
|
|
13895
14014
|
var styleCss$3 = i$7`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
|
|
13896
14015
|
|