@aurodesignsystem-dev/auro-formkit 0.0.0-pr1425.0 → 0.0.0-pr1428.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 +276 -165
- package/components/combobox/demo/index.min.js +276 -165
- package/components/combobox/dist/index.js +276 -165
- package/components/combobox/dist/registered.js +276 -165
- package/components/counter/demo/api.min.js +275 -164
- package/components/counter/demo/index.min.js +275 -164
- package/components/counter/dist/index.js +275 -164
- package/components/counter/dist/registered.js +275 -164
- package/components/datepicker/demo/api.min.js +276 -165
- package/components/datepicker/demo/index.min.js +276 -165
- package/components/datepicker/dist/index.js +276 -165
- package/components/datepicker/dist/registered.js +276 -165
- package/components/dropdown/demo/api.min.js +275 -164
- package/components/dropdown/demo/index.min.js +275 -164
- package/components/dropdown/dist/index.js +275 -164
- package/components/dropdown/dist/registered.js +275 -164
- package/components/form/demo/api.min.js +1105 -661
- package/components/form/demo/index.min.js +1105 -661
- 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 +275 -164
- package/components/select/demo/index.min.js +275 -164
- package/components/select/dist/index.js +275 -164
- package/components/select/dist/registered.js +275 -164
- package/custom-elements.json +244 -244
- package/package.json +2 -2
|
@@ -3235,11 +3235,19 @@ class AuroFloatingUI {
|
|
|
3235
3235
|
* This ensures that the bib content has the same dimensions as the sizer element.
|
|
3236
3236
|
*/
|
|
3237
3237
|
mirrorSize() {
|
|
3238
|
+
const element = this.element;
|
|
3239
|
+
if (!element) {
|
|
3240
|
+
return;
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3238
3243
|
// mirror the boxsize from bibSizer
|
|
3239
|
-
if (
|
|
3240
|
-
const sizerStyle = window.getComputedStyle(
|
|
3241
|
-
const bibContent =
|
|
3242
|
-
|
|
3244
|
+
if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
|
|
3245
|
+
const sizerStyle = window.getComputedStyle(element.bibSizer);
|
|
3246
|
+
const bibContent = element.bib.shadowRoot.querySelector(".container");
|
|
3247
|
+
if (!bibContent) {
|
|
3248
|
+
return;
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3243
3251
|
if (sizerStyle.width !== "0px") {
|
|
3244
3252
|
bibContent.style.width = sizerStyle.width;
|
|
3245
3253
|
}
|
|
@@ -3261,9 +3269,14 @@ class AuroFloatingUI {
|
|
|
3261
3269
|
* @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
|
|
3262
3270
|
*/
|
|
3263
3271
|
getPositioningStrategy() {
|
|
3272
|
+
const element = this.element;
|
|
3273
|
+
if (!element) {
|
|
3274
|
+
return "floating";
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3264
3277
|
const breakpoint =
|
|
3265
|
-
|
|
3266
|
-
|
|
3278
|
+
element.bib?.mobileFullscreenBreakpoint ||
|
|
3279
|
+
element.floaterConfig?.fullscreenBreakpoint;
|
|
3267
3280
|
switch (this.behavior) {
|
|
3268
3281
|
case "tooltip":
|
|
3269
3282
|
return "floating";
|
|
@@ -3274,9 +3287,9 @@ class AuroFloatingUI {
|
|
|
3274
3287
|
`(max-width: ${breakpoint})`,
|
|
3275
3288
|
).matches;
|
|
3276
3289
|
|
|
3277
|
-
|
|
3290
|
+
element.expanded = smallerThanBreakpoint;
|
|
3278
3291
|
}
|
|
3279
|
-
if (
|
|
3292
|
+
if (element.nested) {
|
|
3280
3293
|
return "cover";
|
|
3281
3294
|
}
|
|
3282
3295
|
return "fullscreen";
|
|
@@ -3306,42 +3319,65 @@ class AuroFloatingUI {
|
|
|
3306
3319
|
* and applies the calculated position to the bib's style.
|
|
3307
3320
|
*/
|
|
3308
3321
|
position() {
|
|
3322
|
+
const element = this.element;
|
|
3323
|
+
if (!element) {
|
|
3324
|
+
return;
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3309
3327
|
const strategy = this.getPositioningStrategy();
|
|
3310
3328
|
this.configureBibStrategy(strategy);
|
|
3311
3329
|
|
|
3312
3330
|
if (strategy === "floating") {
|
|
3331
|
+
if (!element.trigger || !element.bib) {
|
|
3332
|
+
return;
|
|
3333
|
+
}
|
|
3334
|
+
|
|
3313
3335
|
this.mirrorSize();
|
|
3314
3336
|
// Define the middlware for the floater configuration
|
|
3315
3337
|
const middleware = [
|
|
3316
|
-
offset(
|
|
3317
|
-
...(
|
|
3318
|
-
...(
|
|
3319
|
-
...(
|
|
3338
|
+
offset(element.floaterConfig?.offset || 0),
|
|
3339
|
+
...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
|
|
3340
|
+
...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
|
|
3341
|
+
...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
|
|
3320
3342
|
];
|
|
3321
3343
|
|
|
3322
3344
|
// Compute the position of the bib
|
|
3323
|
-
computePosition(
|
|
3324
|
-
strategy:
|
|
3325
|
-
placement:
|
|
3345
|
+
computePosition(element.trigger, element.bib, {
|
|
3346
|
+
strategy: element.floaterConfig?.strategy || "fixed",
|
|
3347
|
+
placement: element.floaterConfig?.placement,
|
|
3326
3348
|
middleware: middleware || [],
|
|
3327
3349
|
}).then(({ x, y }) => {
|
|
3328
3350
|
// eslint-disable-line id-length
|
|
3329
|
-
|
|
3351
|
+
const currentElement = this.element;
|
|
3352
|
+
if (!currentElement?.bib) {
|
|
3353
|
+
return;
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
Object.assign(currentElement.bib.style, {
|
|
3330
3357
|
left: `${x}px`,
|
|
3331
3358
|
top: `${y}px`,
|
|
3332
3359
|
});
|
|
3333
3360
|
});
|
|
3334
3361
|
} else if (strategy === "cover") {
|
|
3362
|
+
if (!element.parentNode || !element.bib) {
|
|
3363
|
+
return;
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3335
3366
|
// Compute the position of the bib
|
|
3336
|
-
computePosition(
|
|
3367
|
+
computePosition(element.parentNode, element.bib, {
|
|
3337
3368
|
placement: "bottom-start",
|
|
3338
3369
|
}).then(({ x, y }) => {
|
|
3339
3370
|
// eslint-disable-line id-length
|
|
3340
|
-
|
|
3371
|
+
const currentElement = this.element;
|
|
3372
|
+
if (!currentElement?.bib || !currentElement.parentNode) {
|
|
3373
|
+
return;
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
Object.assign(currentElement.bib.style, {
|
|
3341
3377
|
left: `${x}px`,
|
|
3342
|
-
top: `${y -
|
|
3343
|
-
width: `${
|
|
3344
|
-
height: `${
|
|
3378
|
+
top: `${y - currentElement.parentNode.offsetHeight}px`,
|
|
3379
|
+
width: `${currentElement.parentNode.offsetWidth}px`,
|
|
3380
|
+
height: `${currentElement.parentNode.offsetHeight}px`,
|
|
3345
3381
|
});
|
|
3346
3382
|
});
|
|
3347
3383
|
}
|
|
@@ -3353,11 +3389,17 @@ class AuroFloatingUI {
|
|
|
3353
3389
|
* @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
|
|
3354
3390
|
*/
|
|
3355
3391
|
lockScroll(lock = true) {
|
|
3392
|
+
const element = this.element;
|
|
3393
|
+
|
|
3356
3394
|
if (lock) {
|
|
3395
|
+
if (!element?.bib) {
|
|
3396
|
+
return;
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3357
3399
|
document.body.style.overflow = "hidden"; // hide body's scrollbar
|
|
3358
3400
|
|
|
3359
3401
|
// Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
|
|
3360
|
-
|
|
3402
|
+
element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
3361
3403
|
} else {
|
|
3362
3404
|
document.body.style.overflow = "";
|
|
3363
3405
|
}
|
|
@@ -3373,20 +3415,24 @@ class AuroFloatingUI {
|
|
|
3373
3415
|
* @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
|
|
3374
3416
|
*/
|
|
3375
3417
|
configureBibStrategy(value) {
|
|
3418
|
+
const element = this.element;
|
|
3419
|
+
if (!element?.bib) {
|
|
3420
|
+
return;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3376
3423
|
if (value === "fullscreen") {
|
|
3377
|
-
|
|
3424
|
+
element.isBibFullscreen = true;
|
|
3378
3425
|
// reset the prev position
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3426
|
+
element.bib.setAttribute("isfullscreen", "");
|
|
3427
|
+
element.bib.style.position = "fixed";
|
|
3428
|
+
element.bib.style.top = "0px";
|
|
3429
|
+
element.bib.style.left = "0px";
|
|
3430
|
+
element.bib.style.width = "";
|
|
3431
|
+
element.bib.style.height = "";
|
|
3432
|
+
element.style.contain = "";
|
|
3386
3433
|
|
|
3387
3434
|
// reset the size that was mirroring `size` css-part
|
|
3388
|
-
const bibContent =
|
|
3389
|
-
this.element.bib.shadowRoot.querySelector(".container");
|
|
3435
|
+
const bibContent = element.bib.shadowRoot?.querySelector(".container");
|
|
3390
3436
|
if (bibContent) {
|
|
3391
3437
|
bibContent.style.width = "";
|
|
3392
3438
|
bibContent.style.height = "";
|
|
@@ -3401,14 +3447,14 @@ class AuroFloatingUI {
|
|
|
3401
3447
|
}, 0);
|
|
3402
3448
|
}
|
|
3403
3449
|
|
|
3404
|
-
if (
|
|
3450
|
+
if (element.isPopoverVisible) {
|
|
3405
3451
|
this.lockScroll(true);
|
|
3406
3452
|
}
|
|
3407
3453
|
} else {
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3454
|
+
element.bib.style.position = "";
|
|
3455
|
+
element.bib.removeAttribute("isfullscreen");
|
|
3456
|
+
element.isBibFullscreen = false;
|
|
3457
|
+
element.style.contain = "layout";
|
|
3412
3458
|
}
|
|
3413
3459
|
|
|
3414
3460
|
const isChanged = this.strategy && this.strategy !== value;
|
|
@@ -3426,16 +3472,21 @@ class AuroFloatingUI {
|
|
|
3426
3472
|
},
|
|
3427
3473
|
);
|
|
3428
3474
|
|
|
3429
|
-
|
|
3475
|
+
element.dispatchEvent(event);
|
|
3430
3476
|
}
|
|
3431
3477
|
}
|
|
3432
3478
|
|
|
3433
3479
|
updateState() {
|
|
3434
|
-
const
|
|
3480
|
+
const element = this.element;
|
|
3481
|
+
if (!element) {
|
|
3482
|
+
return;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
const isVisible = element.isPopoverVisible;
|
|
3435
3486
|
if (!isVisible) {
|
|
3436
3487
|
this.cleanupHideHandlers();
|
|
3437
3488
|
try {
|
|
3438
|
-
|
|
3489
|
+
element.cleanup?.();
|
|
3439
3490
|
} catch (error) {
|
|
3440
3491
|
// Do nothing
|
|
3441
3492
|
}
|
|
@@ -3451,28 +3502,30 @@ class AuroFloatingUI {
|
|
|
3451
3502
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
3452
3503
|
*/
|
|
3453
3504
|
handleFocusLoss() {
|
|
3505
|
+
const element = this.element;
|
|
3506
|
+
if (!element?.bib) {
|
|
3507
|
+
return;
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3454
3510
|
// if mouse is being pressed, skip and let click event to handle the action
|
|
3455
3511
|
if (AuroFloatingUI.isMousePressed) {
|
|
3456
3512
|
return;
|
|
3457
3513
|
}
|
|
3458
3514
|
|
|
3459
3515
|
if (
|
|
3460
|
-
|
|
3461
|
-
|
|
3516
|
+
element.noHideOnThisFocusLoss ||
|
|
3517
|
+
element.hasAttribute("noHideOnThisFocusLoss")
|
|
3462
3518
|
) {
|
|
3463
3519
|
return;
|
|
3464
3520
|
}
|
|
3465
3521
|
|
|
3466
3522
|
// if focus is still inside of trigger or bib, do not close
|
|
3467
|
-
if (
|
|
3468
|
-
this.element.matches(":focus") ||
|
|
3469
|
-
this.element.matches(":focus-within")
|
|
3470
|
-
) {
|
|
3523
|
+
if (element.matches(":focus") || element.matches(":focus-within")) {
|
|
3471
3524
|
return;
|
|
3472
3525
|
}
|
|
3473
3526
|
|
|
3474
3527
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
3475
|
-
if (
|
|
3528
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
3476
3529
|
return;
|
|
3477
3530
|
}
|
|
3478
3531
|
|
|
@@ -3480,23 +3533,33 @@ class AuroFloatingUI {
|
|
|
3480
3533
|
}
|
|
3481
3534
|
|
|
3482
3535
|
setupHideHandlers() {
|
|
3536
|
+
const element = this.element;
|
|
3537
|
+
if (!element) {
|
|
3538
|
+
return;
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3483
3541
|
// Define handlers & store references
|
|
3484
3542
|
this.focusHandler = () => this.handleFocusLoss();
|
|
3485
3543
|
|
|
3486
3544
|
this.clickHandler = (evt) => {
|
|
3545
|
+
const element = this.element;
|
|
3546
|
+
if (!element?.bib) {
|
|
3547
|
+
return;
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3487
3550
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
3488
3551
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
3489
3552
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
3490
3553
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
3491
|
-
if (
|
|
3554
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
3492
3555
|
return;
|
|
3493
3556
|
}
|
|
3494
3557
|
|
|
3495
3558
|
if (
|
|
3496
|
-
(!evt.composedPath().includes(
|
|
3497
|
-
!evt.composedPath().includes(
|
|
3498
|
-
(
|
|
3499
|
-
evt.composedPath().includes(
|
|
3559
|
+
(!evt.composedPath().includes(element.trigger) &&
|
|
3560
|
+
!evt.composedPath().includes(element.bib)) ||
|
|
3561
|
+
(element.bib.backdrop &&
|
|
3562
|
+
evt.composedPath().includes(element.bib.backdrop))
|
|
3500
3563
|
) {
|
|
3501
3564
|
const existedVisibleFloatingUI =
|
|
3502
3565
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -3517,7 +3580,12 @@ class AuroFloatingUI {
|
|
|
3517
3580
|
|
|
3518
3581
|
// ESC key handler
|
|
3519
3582
|
this.keyDownHandler = (evt) => {
|
|
3520
|
-
|
|
3583
|
+
const element = this.element;
|
|
3584
|
+
if (!element) {
|
|
3585
|
+
return;
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
3521
3589
|
const existedVisibleFloatingUI =
|
|
3522
3590
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
3523
3591
|
if (
|
|
@@ -3574,6 +3642,10 @@ class AuroFloatingUI {
|
|
|
3574
3642
|
}
|
|
3575
3643
|
|
|
3576
3644
|
updateCurrentExpandedDropdown() {
|
|
3645
|
+
if (!this.element) {
|
|
3646
|
+
return;
|
|
3647
|
+
}
|
|
3648
|
+
|
|
3577
3649
|
// Close any other dropdown that is already open
|
|
3578
3650
|
const existedVisibleFloatingUI =
|
|
3579
3651
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -3590,25 +3662,34 @@ class AuroFloatingUI {
|
|
|
3590
3662
|
}
|
|
3591
3663
|
|
|
3592
3664
|
showBib() {
|
|
3593
|
-
|
|
3665
|
+
const element = this.element;
|
|
3666
|
+
if (!element) {
|
|
3667
|
+
return;
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
if (!element.bib || (!element.trigger && !element.parentNode)) {
|
|
3671
|
+
return;
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3674
|
+
if (!element.disabled && !this.showing) {
|
|
3594
3675
|
this.updateCurrentExpandedDropdown();
|
|
3595
|
-
|
|
3676
|
+
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
3596
3677
|
|
|
3597
3678
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
3598
3679
|
if (!this.showing) {
|
|
3599
|
-
if (!
|
|
3680
|
+
if (!element.modal) {
|
|
3600
3681
|
this.setupHideHandlers();
|
|
3601
3682
|
}
|
|
3602
3683
|
this.showing = true;
|
|
3603
|
-
|
|
3684
|
+
element.isPopoverVisible = true;
|
|
3604
3685
|
this.position();
|
|
3605
3686
|
this.dispatchEventDropdownToggle();
|
|
3606
3687
|
}
|
|
3607
3688
|
|
|
3608
3689
|
// Setup auto update to handle resize and scroll
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3690
|
+
element.cleanup = autoUpdate(
|
|
3691
|
+
element.trigger || element.parentNode,
|
|
3692
|
+
element.bib,
|
|
3612
3693
|
() => {
|
|
3613
3694
|
this.position();
|
|
3614
3695
|
},
|
|
@@ -3621,22 +3702,27 @@ class AuroFloatingUI {
|
|
|
3621
3702
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3622
3703
|
*/
|
|
3623
3704
|
hideBib(eventType = "unknown") {
|
|
3624
|
-
|
|
3705
|
+
const element = this.element;
|
|
3706
|
+
if (!element) {
|
|
3707
|
+
return;
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3710
|
+
if (element.disabled) {
|
|
3625
3711
|
return;
|
|
3626
3712
|
}
|
|
3627
3713
|
|
|
3628
3714
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
3629
3715
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
3630
3716
|
// Escape key or focus loss.
|
|
3631
|
-
if (
|
|
3717
|
+
if (element.noToggle && eventType === "click") {
|
|
3632
3718
|
return;
|
|
3633
3719
|
}
|
|
3634
3720
|
|
|
3635
3721
|
this.lockScroll(false);
|
|
3636
|
-
|
|
3722
|
+
element.triggerChevron?.removeAttribute("data-expanded");
|
|
3637
3723
|
|
|
3638
|
-
if (
|
|
3639
|
-
|
|
3724
|
+
if (element.isPopoverVisible) {
|
|
3725
|
+
element.isPopoverVisible = false;
|
|
3640
3726
|
}
|
|
3641
3727
|
if (this.showing) {
|
|
3642
3728
|
this.cleanupHideHandlers();
|
|
@@ -3656,6 +3742,11 @@ class AuroFloatingUI {
|
|
|
3656
3742
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3657
3743
|
*/
|
|
3658
3744
|
dispatchEventDropdownToggle(eventType) {
|
|
3745
|
+
const element = this.element;
|
|
3746
|
+
if (!element) {
|
|
3747
|
+
return;
|
|
3748
|
+
}
|
|
3749
|
+
|
|
3659
3750
|
const event = new CustomEvent(
|
|
3660
3751
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
3661
3752
|
{
|
|
@@ -3667,11 +3758,16 @@ class AuroFloatingUI {
|
|
|
3667
3758
|
},
|
|
3668
3759
|
);
|
|
3669
3760
|
|
|
3670
|
-
|
|
3761
|
+
element.dispatchEvent(event);
|
|
3671
3762
|
}
|
|
3672
3763
|
|
|
3673
3764
|
handleClick() {
|
|
3674
|
-
|
|
3765
|
+
const element = this.element;
|
|
3766
|
+
if (!element) {
|
|
3767
|
+
return;
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
if (element.isPopoverVisible) {
|
|
3675
3771
|
this.hideBib("click");
|
|
3676
3772
|
} else {
|
|
3677
3773
|
this.showBib();
|
|
@@ -3682,63 +3778,66 @@ class AuroFloatingUI {
|
|
|
3682
3778
|
{
|
|
3683
3779
|
composed: true,
|
|
3684
3780
|
detail: {
|
|
3685
|
-
expanded:
|
|
3781
|
+
expanded: element.isPopoverVisible,
|
|
3686
3782
|
},
|
|
3687
3783
|
},
|
|
3688
3784
|
);
|
|
3689
3785
|
|
|
3690
|
-
|
|
3786
|
+
element.dispatchEvent(event);
|
|
3691
3787
|
}
|
|
3692
3788
|
|
|
3693
3789
|
handleEvent(event) {
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
case "mouseenter":
|
|
3711
|
-
if (this.element.hoverToggle) {
|
|
3712
|
-
this.showBib();
|
|
3713
|
-
}
|
|
3714
|
-
break;
|
|
3715
|
-
case "mouseleave":
|
|
3716
|
-
if (this.element.hoverToggle) {
|
|
3717
|
-
this.hideBib("mouseleave");
|
|
3718
|
-
}
|
|
3719
|
-
break;
|
|
3720
|
-
case "focus":
|
|
3721
|
-
if (this.element.focusShow) {
|
|
3722
|
-
/*
|
|
3723
|
-
This needs to better handle clicking that gives focus -
|
|
3724
|
-
currently it shows and then immediately hides the bib
|
|
3725
|
-
*/
|
|
3726
|
-
this.showBib();
|
|
3727
|
-
}
|
|
3728
|
-
break;
|
|
3729
|
-
case "blur":
|
|
3730
|
-
// send this task 100ms later queue to
|
|
3731
|
-
// wait a frame in case focus moves within the floating element/bib
|
|
3732
|
-
setTimeout(() => this.handleFocusLoss(), 0);
|
|
3733
|
-
break;
|
|
3734
|
-
case "click":
|
|
3735
|
-
if (document.activeElement === document.body) {
|
|
3736
|
-
event.currentTarget.focus();
|
|
3737
|
-
}
|
|
3790
|
+
const element = this.element;
|
|
3791
|
+
if (!element || element.disableEventShow) {
|
|
3792
|
+
return;
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3795
|
+
switch (event.type) {
|
|
3796
|
+
case "keydown": {
|
|
3797
|
+
// Support both Enter and Space keys for accessibility
|
|
3798
|
+
// Space is included as it's expected behavior for interactive elements
|
|
3799
|
+
|
|
3800
|
+
const origin = event.composedPath()[0];
|
|
3801
|
+
if (
|
|
3802
|
+
event.key === "Enter" ||
|
|
3803
|
+
(event.key === " " && (!origin || origin.tagName !== "INPUT"))
|
|
3804
|
+
) {
|
|
3805
|
+
event.preventDefault();
|
|
3738
3806
|
this.handleClick();
|
|
3739
|
-
|
|
3740
|
-
|
|
3807
|
+
}
|
|
3808
|
+
break;
|
|
3741
3809
|
}
|
|
3810
|
+
case "mouseenter":
|
|
3811
|
+
if (element.hoverToggle) {
|
|
3812
|
+
this.showBib();
|
|
3813
|
+
}
|
|
3814
|
+
break;
|
|
3815
|
+
case "mouseleave":
|
|
3816
|
+
if (element.hoverToggle) {
|
|
3817
|
+
this.hideBib("mouseleave");
|
|
3818
|
+
}
|
|
3819
|
+
break;
|
|
3820
|
+
case "focus":
|
|
3821
|
+
if (element.focusShow) {
|
|
3822
|
+
/*
|
|
3823
|
+
This needs to better handle clicking that gives focus -
|
|
3824
|
+
currently it shows and then immediately hides the bib
|
|
3825
|
+
*/
|
|
3826
|
+
this.showBib();
|
|
3827
|
+
}
|
|
3828
|
+
break;
|
|
3829
|
+
case "blur":
|
|
3830
|
+
// send this task 100ms later queue to
|
|
3831
|
+
// wait a frame in case focus moves within the floating element/bib
|
|
3832
|
+
setTimeout(() => this.handleFocusLoss(), 0);
|
|
3833
|
+
break;
|
|
3834
|
+
case "click":
|
|
3835
|
+
if (document.activeElement === document.body) {
|
|
3836
|
+
event.currentTarget.focus();
|
|
3837
|
+
}
|
|
3838
|
+
this.handleClick();
|
|
3839
|
+
break;
|
|
3840
|
+
// Do nothing
|
|
3742
3841
|
}
|
|
3743
3842
|
}
|
|
3744
3843
|
|
|
@@ -3749,6 +3848,11 @@ class AuroFloatingUI {
|
|
|
3749
3848
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
3750
3849
|
*/
|
|
3751
3850
|
handleTriggerTabIndex() {
|
|
3851
|
+
const element = this.element;
|
|
3852
|
+
if (!element) {
|
|
3853
|
+
return;
|
|
3854
|
+
}
|
|
3855
|
+
|
|
3752
3856
|
const focusableElementSelectors = [
|
|
3753
3857
|
"a",
|
|
3754
3858
|
"button",
|
|
@@ -3761,7 +3865,7 @@ class AuroFloatingUI {
|
|
|
3761
3865
|
"auro-hyperlink",
|
|
3762
3866
|
];
|
|
3763
3867
|
|
|
3764
|
-
const triggerNode =
|
|
3868
|
+
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
3765
3869
|
if (!triggerNode) {
|
|
3766
3870
|
return;
|
|
3767
3871
|
}
|
|
@@ -3770,13 +3874,13 @@ class AuroFloatingUI {
|
|
|
3770
3874
|
focusableElementSelectors.forEach((selector) => {
|
|
3771
3875
|
// Check if the trigger node element is focusable
|
|
3772
3876
|
if (triggerNodeTagName === selector) {
|
|
3773
|
-
|
|
3877
|
+
element.tabIndex = -1;
|
|
3774
3878
|
return;
|
|
3775
3879
|
}
|
|
3776
3880
|
|
|
3777
3881
|
// Check if any child is focusable
|
|
3778
3882
|
if (triggerNode.querySelector(selector)) {
|
|
3779
|
-
|
|
3883
|
+
element.tabIndex = -1;
|
|
3780
3884
|
}
|
|
3781
3885
|
});
|
|
3782
3886
|
}
|
|
@@ -3786,13 +3890,18 @@ class AuroFloatingUI {
|
|
|
3786
3890
|
* @param {*} eventPrefix
|
|
3787
3891
|
*/
|
|
3788
3892
|
regenerateBibId() {
|
|
3789
|
-
|
|
3893
|
+
const element = this.element;
|
|
3894
|
+
if (!element) {
|
|
3895
|
+
return;
|
|
3896
|
+
}
|
|
3897
|
+
|
|
3898
|
+
this.id = element.getAttribute("id");
|
|
3790
3899
|
if (!this.id) {
|
|
3791
3900
|
this.id = window.crypto.randomUUID();
|
|
3792
|
-
|
|
3901
|
+
element.setAttribute("id", this.id);
|
|
3793
3902
|
}
|
|
3794
3903
|
|
|
3795
|
-
|
|
3904
|
+
element.bib?.setAttribute("id", `${this.id}-floater-bib`);
|
|
3796
3905
|
}
|
|
3797
3906
|
|
|
3798
3907
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -3804,67 +3913,69 @@ class AuroFloatingUI {
|
|
|
3804
3913
|
this.element = elem;
|
|
3805
3914
|
}
|
|
3806
3915
|
|
|
3807
|
-
|
|
3808
|
-
|
|
3916
|
+
const element = this.element;
|
|
3917
|
+
if (!element) {
|
|
3918
|
+
return;
|
|
3809
3919
|
}
|
|
3810
3920
|
|
|
3811
|
-
if (this.element.
|
|
3921
|
+
if (this.behavior !== element.behavior) {
|
|
3922
|
+
this.behavior = element.behavior;
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3925
|
+
if (element.trigger) {
|
|
3812
3926
|
this.disconnect();
|
|
3813
3927
|
}
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
this.element.shadowRoot.querySelector("#showStateIcon");
|
|
3928
|
+
element.trigger =
|
|
3929
|
+
element.triggerElement ||
|
|
3930
|
+
element.shadowRoot?.querySelector("#trigger") ||
|
|
3931
|
+
element.trigger;
|
|
3932
|
+
element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
|
|
3933
|
+
element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
|
|
3934
|
+
element.triggerChevron =
|
|
3935
|
+
element.shadowRoot?.querySelector("#showStateIcon");
|
|
3823
3936
|
|
|
3824
|
-
if (
|
|
3825
|
-
|
|
3937
|
+
if (element.floaterConfig) {
|
|
3938
|
+
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
3826
3939
|
}
|
|
3827
3940
|
|
|
3828
3941
|
this.regenerateBibId();
|
|
3829
3942
|
this.handleTriggerTabIndex();
|
|
3830
3943
|
|
|
3831
3944
|
this.handleEvent = this.handleEvent.bind(this);
|
|
3832
|
-
if (
|
|
3945
|
+
if (element.trigger) {
|
|
3833
3946
|
if (this.enableKeyboardHandling) {
|
|
3834
|
-
|
|
3947
|
+
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
3835
3948
|
}
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3949
|
+
element.trigger.addEventListener("click", this.handleEvent);
|
|
3950
|
+
element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
3951
|
+
element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
3952
|
+
element.trigger.addEventListener("focus", this.handleEvent);
|
|
3953
|
+
element.trigger.addEventListener("blur", this.handleEvent);
|
|
3841
3954
|
}
|
|
3842
3955
|
}
|
|
3843
3956
|
|
|
3844
3957
|
disconnect() {
|
|
3845
3958
|
this.cleanupHideHandlers();
|
|
3846
|
-
if (this.element) {
|
|
3847
|
-
this.element.cleanup?.();
|
|
3848
3959
|
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3960
|
+
const element = this.element;
|
|
3961
|
+
if (!element) {
|
|
3962
|
+
return;
|
|
3963
|
+
}
|
|
3852
3964
|
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
}
|
|
3965
|
+
element.cleanup?.();
|
|
3966
|
+
|
|
3967
|
+
if (element.bib && element.shadowRoot) {
|
|
3968
|
+
element.shadowRoot.append(element.bib);
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3971
|
+
// Remove event & keyboard listeners
|
|
3972
|
+
if (element.trigger) {
|
|
3973
|
+
element.trigger.removeEventListener("keydown", this.handleEvent);
|
|
3974
|
+
element.trigger.removeEventListener("click", this.handleEvent);
|
|
3975
|
+
element.trigger.removeEventListener("mouseenter", this.handleEvent);
|
|
3976
|
+
element.trigger.removeEventListener("mouseleave", this.handleEvent);
|
|
3977
|
+
element.trigger.removeEventListener("focus", this.handleEvent);
|
|
3978
|
+
element.trigger.removeEventListener("blur", this.handleEvent);
|
|
3868
3979
|
}
|
|
3869
3980
|
}
|
|
3870
3981
|
}
|
|
@@ -4992,7 +5103,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
|
|
|
4992
5103
|
}
|
|
4993
5104
|
};
|
|
4994
5105
|
|
|
4995
|
-
var formkitVersion$2 = '
|
|
5106
|
+
var formkitVersion$2 = '202604081417';
|
|
4996
5107
|
|
|
4997
5108
|
let AuroElement$2 = class AuroElement extends i$4 {
|
|
4998
5109
|
static get properties() {
|
|
@@ -12756,7 +12867,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
|
|
|
12756
12867
|
}
|
|
12757
12868
|
};
|
|
12758
12869
|
|
|
12759
|
-
var formkitVersion$1 = '
|
|
12870
|
+
var formkitVersion$1 = '202604081417';
|
|
12760
12871
|
|
|
12761
12872
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12762
12873
|
// See LICENSE in the project root for license information.
|
|
@@ -13821,7 +13932,7 @@ class AuroBibtemplate extends i$4 {
|
|
|
13821
13932
|
}
|
|
13822
13933
|
}
|
|
13823
13934
|
|
|
13824
|
-
var formkitVersion = '
|
|
13935
|
+
var formkitVersion = '202604081417';
|
|
13825
13936
|
|
|
13826
13937
|
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}`;
|
|
13827
13938
|
|