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