@aurodesignsystem-dev/auro-formkit 0.0.0-pr1422.2 → 0.0.0-pr1424.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/CHANGELOG.md +2 -2
- package/README.md +183 -133
- 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 -276
- package/components/combobox/demo/index.min.js +165 -276
- package/components/combobox/dist/index.js +165 -276
- package/components/combobox/dist/registered.js +165 -276
- package/components/counter/demo/api.min.js +164 -275
- package/components/counter/demo/index.min.js +164 -275
- package/components/counter/dist/index.js +164 -275
- package/components/counter/dist/registered.js +164 -275
- package/components/datepicker/demo/api.min.js +165 -276
- package/components/datepicker/demo/index.min.js +165 -276
- package/components/datepicker/dist/index.js +165 -276
- package/components/datepicker/dist/registered.js +165 -276
- package/components/dropdown/demo/api.min.js +164 -275
- package/components/dropdown/demo/index.min.js +164 -275
- package/components/dropdown/dist/index.js +164 -275
- package/components/dropdown/dist/registered.js +164 -275
- package/components/form/demo/api.md +460 -76
- package/components/form/demo/api.min.js +661 -1105
- package/components/form/demo/index.min.js +661 -1105
- 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 -275
- package/components/select/demo/index.min.js +164 -275
- package/components/select/dist/index.js +164 -275
- package/components/select/dist/registered.js +164 -275
- package/package.json +3 -3
|
@@ -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 "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,33 +3480,23 @@ class AuroFloatingUI {
|
|
|
3533
3480
|
}
|
|
3534
3481
|
|
|
3535
3482
|
setupHideHandlers() {
|
|
3536
|
-
const element = this.element;
|
|
3537
|
-
if (!element) {
|
|
3538
|
-
return;
|
|
3539
|
-
}
|
|
3540
|
-
|
|
3541
3483
|
// Define handlers & store references
|
|
3542
3484
|
this.focusHandler = () => this.handleFocusLoss();
|
|
3543
3485
|
|
|
3544
3486
|
this.clickHandler = (evt) => {
|
|
3545
|
-
const element = this.element;
|
|
3546
|
-
if (!element?.bib) {
|
|
3547
|
-
return;
|
|
3548
|
-
}
|
|
3549
|
-
|
|
3550
3487
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
3551
3488
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
3552
3489
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
3553
3490
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
3554
|
-
if (element.bib.hasAttribute("isfullscreen")) {
|
|
3491
|
+
if (this.element.bib && this.element.bib.hasAttribute("isfullscreen")) {
|
|
3555
3492
|
return;
|
|
3556
3493
|
}
|
|
3557
3494
|
|
|
3558
3495
|
if (
|
|
3559
|
-
(!evt.composedPath().includes(element.trigger) &&
|
|
3560
|
-
!evt.composedPath().includes(element.bib)) ||
|
|
3561
|
-
(element.bib.backdrop &&
|
|
3562
|
-
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))
|
|
3563
3500
|
) {
|
|
3564
3501
|
const existedVisibleFloatingUI =
|
|
3565
3502
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -3580,12 +3517,7 @@ class AuroFloatingUI {
|
|
|
3580
3517
|
|
|
3581
3518
|
// ESC key handler
|
|
3582
3519
|
this.keyDownHandler = (evt) => {
|
|
3583
|
-
|
|
3584
|
-
if (!element) {
|
|
3585
|
-
return;
|
|
3586
|
-
}
|
|
3587
|
-
|
|
3588
|
-
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
3520
|
+
if (evt.key === "Escape" && this.element.isPopoverVisible) {
|
|
3589
3521
|
const existedVisibleFloatingUI =
|
|
3590
3522
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
3591
3523
|
if (
|
|
@@ -3642,10 +3574,6 @@ class AuroFloatingUI {
|
|
|
3642
3574
|
}
|
|
3643
3575
|
|
|
3644
3576
|
updateCurrentExpandedDropdown() {
|
|
3645
|
-
if (!this.element) {
|
|
3646
|
-
return;
|
|
3647
|
-
}
|
|
3648
|
-
|
|
3649
3577
|
// Close any other dropdown that is already open
|
|
3650
3578
|
const existedVisibleFloatingUI =
|
|
3651
3579
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -3662,34 +3590,25 @@ class AuroFloatingUI {
|
|
|
3662
3590
|
}
|
|
3663
3591
|
|
|
3664
3592
|
showBib() {
|
|
3665
|
-
|
|
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) {
|
|
3593
|
+
if (!this.element.disabled && !this.showing) {
|
|
3675
3594
|
this.updateCurrentExpandedDropdown();
|
|
3676
|
-
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
3595
|
+
this.element.triggerChevron?.setAttribute("data-expanded", true);
|
|
3677
3596
|
|
|
3678
3597
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
3679
3598
|
if (!this.showing) {
|
|
3680
|
-
if (!element.modal) {
|
|
3599
|
+
if (!this.element.modal) {
|
|
3681
3600
|
this.setupHideHandlers();
|
|
3682
3601
|
}
|
|
3683
3602
|
this.showing = true;
|
|
3684
|
-
element.isPopoverVisible = true;
|
|
3603
|
+
this.element.isPopoverVisible = true;
|
|
3685
3604
|
this.position();
|
|
3686
3605
|
this.dispatchEventDropdownToggle();
|
|
3687
3606
|
}
|
|
3688
3607
|
|
|
3689
3608
|
// Setup auto update to handle resize and scroll
|
|
3690
|
-
element.cleanup = autoUpdate(
|
|
3691
|
-
element.trigger || element.parentNode,
|
|
3692
|
-
element.bib,
|
|
3609
|
+
this.element.cleanup = autoUpdate(
|
|
3610
|
+
this.element.trigger || this.element.parentNode,
|
|
3611
|
+
this.element.bib,
|
|
3693
3612
|
() => {
|
|
3694
3613
|
this.position();
|
|
3695
3614
|
},
|
|
@@ -3702,27 +3621,22 @@ class AuroFloatingUI {
|
|
|
3702
3621
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3703
3622
|
*/
|
|
3704
3623
|
hideBib(eventType = "unknown") {
|
|
3705
|
-
|
|
3706
|
-
if (!element) {
|
|
3707
|
-
return;
|
|
3708
|
-
}
|
|
3709
|
-
|
|
3710
|
-
if (element.disabled) {
|
|
3624
|
+
if (this.element.disabled) {
|
|
3711
3625
|
return;
|
|
3712
3626
|
}
|
|
3713
3627
|
|
|
3714
3628
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
3715
3629
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
3716
3630
|
// Escape key or focus loss.
|
|
3717
|
-
if (element.noToggle && eventType === "click") {
|
|
3631
|
+
if (this.element.noToggle && eventType === "click") {
|
|
3718
3632
|
return;
|
|
3719
3633
|
}
|
|
3720
3634
|
|
|
3721
3635
|
this.lockScroll(false);
|
|
3722
|
-
element.triggerChevron?.removeAttribute("data-expanded");
|
|
3636
|
+
this.element.triggerChevron?.removeAttribute("data-expanded");
|
|
3723
3637
|
|
|
3724
|
-
if (element.isPopoverVisible) {
|
|
3725
|
-
element.isPopoverVisible = false;
|
|
3638
|
+
if (this.element.isPopoverVisible) {
|
|
3639
|
+
this.element.isPopoverVisible = false;
|
|
3726
3640
|
}
|
|
3727
3641
|
if (this.showing) {
|
|
3728
3642
|
this.cleanupHideHandlers();
|
|
@@ -3742,11 +3656,6 @@ class AuroFloatingUI {
|
|
|
3742
3656
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3743
3657
|
*/
|
|
3744
3658
|
dispatchEventDropdownToggle(eventType) {
|
|
3745
|
-
const element = this.element;
|
|
3746
|
-
if (!element) {
|
|
3747
|
-
return;
|
|
3748
|
-
}
|
|
3749
|
-
|
|
3750
3659
|
const event = new CustomEvent(
|
|
3751
3660
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
3752
3661
|
{
|
|
@@ -3758,16 +3667,11 @@ class AuroFloatingUI {
|
|
|
3758
3667
|
},
|
|
3759
3668
|
);
|
|
3760
3669
|
|
|
3761
|
-
element.dispatchEvent(event);
|
|
3670
|
+
this.element.dispatchEvent(event);
|
|
3762
3671
|
}
|
|
3763
3672
|
|
|
3764
3673
|
handleClick() {
|
|
3765
|
-
|
|
3766
|
-
if (!element) {
|
|
3767
|
-
return;
|
|
3768
|
-
}
|
|
3769
|
-
|
|
3770
|
-
if (element.isPopoverVisible) {
|
|
3674
|
+
if (this.element.isPopoverVisible) {
|
|
3771
3675
|
this.hideBib("click");
|
|
3772
3676
|
} else {
|
|
3773
3677
|
this.showBib();
|
|
@@ -3778,66 +3682,63 @@ class AuroFloatingUI {
|
|
|
3778
3682
|
{
|
|
3779
3683
|
composed: true,
|
|
3780
3684
|
detail: {
|
|
3781
|
-
expanded: element.isPopoverVisible,
|
|
3685
|
+
expanded: this.element.isPopoverVisible,
|
|
3782
3686
|
},
|
|
3783
3687
|
},
|
|
3784
3688
|
);
|
|
3785
3689
|
|
|
3786
|
-
element.dispatchEvent(event);
|
|
3690
|
+
this.element.dispatchEvent(event);
|
|
3787
3691
|
}
|
|
3788
3692
|
|
|
3789
3693
|
handleEvent(event) {
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
event.preventDefault();
|
|
3806
|
-
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;
|
|
3807
3709
|
}
|
|
3808
|
-
|
|
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
|
|
3809
3741
|
}
|
|
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
|
|
3841
3742
|
}
|
|
3842
3743
|
}
|
|
3843
3744
|
|
|
@@ -3848,11 +3749,6 @@ class AuroFloatingUI {
|
|
|
3848
3749
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
3849
3750
|
*/
|
|
3850
3751
|
handleTriggerTabIndex() {
|
|
3851
|
-
const element = this.element;
|
|
3852
|
-
if (!element) {
|
|
3853
|
-
return;
|
|
3854
|
-
}
|
|
3855
|
-
|
|
3856
3752
|
const focusableElementSelectors = [
|
|
3857
3753
|
"a",
|
|
3858
3754
|
"button",
|
|
@@ -3865,7 +3761,7 @@ class AuroFloatingUI {
|
|
|
3865
3761
|
"auro-hyperlink",
|
|
3866
3762
|
];
|
|
3867
3763
|
|
|
3868
|
-
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
3764
|
+
const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
|
|
3869
3765
|
if (!triggerNode) {
|
|
3870
3766
|
return;
|
|
3871
3767
|
}
|
|
@@ -3874,13 +3770,13 @@ class AuroFloatingUI {
|
|
|
3874
3770
|
focusableElementSelectors.forEach((selector) => {
|
|
3875
3771
|
// Check if the trigger node element is focusable
|
|
3876
3772
|
if (triggerNodeTagName === selector) {
|
|
3877
|
-
element.tabIndex = -1;
|
|
3773
|
+
this.element.tabIndex = -1;
|
|
3878
3774
|
return;
|
|
3879
3775
|
}
|
|
3880
3776
|
|
|
3881
3777
|
// Check if any child is focusable
|
|
3882
3778
|
if (triggerNode.querySelector(selector)) {
|
|
3883
|
-
element.tabIndex = -1;
|
|
3779
|
+
this.element.tabIndex = -1;
|
|
3884
3780
|
}
|
|
3885
3781
|
});
|
|
3886
3782
|
}
|
|
@@ -3890,18 +3786,13 @@ class AuroFloatingUI {
|
|
|
3890
3786
|
* @param {*} eventPrefix
|
|
3891
3787
|
*/
|
|
3892
3788
|
regenerateBibId() {
|
|
3893
|
-
|
|
3894
|
-
if (!element) {
|
|
3895
|
-
return;
|
|
3896
|
-
}
|
|
3897
|
-
|
|
3898
|
-
this.id = element.getAttribute("id");
|
|
3789
|
+
this.id = this.element.getAttribute("id");
|
|
3899
3790
|
if (!this.id) {
|
|
3900
3791
|
this.id = window.crypto.randomUUID();
|
|
3901
|
-
element.setAttribute("id", this.id);
|
|
3792
|
+
this.element.setAttribute("id", this.id);
|
|
3902
3793
|
}
|
|
3903
3794
|
|
|
3904
|
-
element.bib
|
|
3795
|
+
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
3905
3796
|
}
|
|
3906
3797
|
|
|
3907
3798
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -3913,69 +3804,67 @@ class AuroFloatingUI {
|
|
|
3913
3804
|
this.element = elem;
|
|
3914
3805
|
}
|
|
3915
3806
|
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
return;
|
|
3807
|
+
if (this.behavior !== this.element.behavior) {
|
|
3808
|
+
this.behavior = this.element.behavior;
|
|
3919
3809
|
}
|
|
3920
3810
|
|
|
3921
|
-
if (this.
|
|
3922
|
-
this.behavior = element.behavior;
|
|
3923
|
-
}
|
|
3924
|
-
|
|
3925
|
-
if (element.trigger) {
|
|
3811
|
+
if (this.element.trigger) {
|
|
3926
3812
|
this.disconnect();
|
|
3927
3813
|
}
|
|
3928
|
-
element.trigger =
|
|
3929
|
-
element.triggerElement ||
|
|
3930
|
-
element.shadowRoot
|
|
3931
|
-
element.trigger;
|
|
3932
|
-
element.bib =
|
|
3933
|
-
|
|
3934
|
-
element.
|
|
3935
|
-
|
|
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");
|
|
3936
3823
|
|
|
3937
|
-
if (element.floaterConfig) {
|
|
3938
|
-
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
3824
|
+
if (this.element.floaterConfig) {
|
|
3825
|
+
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
3939
3826
|
}
|
|
3940
3827
|
|
|
3941
3828
|
this.regenerateBibId();
|
|
3942
3829
|
this.handleTriggerTabIndex();
|
|
3943
3830
|
|
|
3944
3831
|
this.handleEvent = this.handleEvent.bind(this);
|
|
3945
|
-
if (element.trigger) {
|
|
3832
|
+
if (this.element.trigger) {
|
|
3946
3833
|
if (this.enableKeyboardHandling) {
|
|
3947
|
-
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
3834
|
+
this.element.trigger.addEventListener("keydown", this.handleEvent);
|
|
3948
3835
|
}
|
|
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);
|
|
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);
|
|
3954
3841
|
}
|
|
3955
3842
|
}
|
|
3956
3843
|
|
|
3957
3844
|
disconnect() {
|
|
3958
3845
|
this.cleanupHideHandlers();
|
|
3846
|
+
if (this.element) {
|
|
3847
|
+
this.element.cleanup?.();
|
|
3959
3848
|
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
}
|
|
3964
|
-
|
|
3965
|
-
element.cleanup?.();
|
|
3966
|
-
|
|
3967
|
-
if (element.bib && element.shadowRoot) {
|
|
3968
|
-
element.shadowRoot.append(element.bib);
|
|
3969
|
-
}
|
|
3849
|
+
if (this.element.bib) {
|
|
3850
|
+
this.element.shadowRoot.append(this.element.bib);
|
|
3851
|
+
}
|
|
3970
3852
|
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
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
|
+
}
|
|
3979
3868
|
}
|
|
3980
3869
|
}
|
|
3981
3870
|
}
|
|
@@ -5103,7 +4992,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
|
|
|
5103
4992
|
}
|
|
5104
4993
|
};
|
|
5105
4994
|
|
|
5106
|
-
var formkitVersion$2 = '
|
|
4995
|
+
var formkitVersion$2 = '202604072118';
|
|
5107
4996
|
|
|
5108
4997
|
let AuroElement$2 = class AuroElement extends i$4 {
|
|
5109
4998
|
static get properties() {
|
|
@@ -12867,7 +12756,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
|
|
|
12867
12756
|
}
|
|
12868
12757
|
};
|
|
12869
12758
|
|
|
12870
|
-
var formkitVersion$1 = '
|
|
12759
|
+
var formkitVersion$1 = '202604072118';
|
|
12871
12760
|
|
|
12872
12761
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12873
12762
|
// See LICENSE in the project root for license information.
|
|
@@ -13932,7 +13821,7 @@ class AuroBibtemplate extends i$4 {
|
|
|
13932
13821
|
}
|
|
13933
13822
|
}
|
|
13934
13823
|
|
|
13935
|
-
var formkitVersion = '
|
|
13824
|
+
var formkitVersion = '202604072118';
|
|
13936
13825
|
|
|
13937
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}`;
|
|
13938
13827
|
|