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