@aurodesignsystem-dev/auro-formkit 0.0.0-pr1424.2 → 0.0.0-pr1424.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/README.md +133 -183
- package/components/checkbox/demo/api.min.js +3 -3
- package/components/checkbox/demo/index.min.js +3 -3
- package/components/checkbox/dist/index.js +3 -3
- package/components/checkbox/dist/registered.js +3 -3
- package/components/combobox/demo/api.html +1 -0
- package/components/combobox/demo/api.js +3 -1
- package/components/combobox/demo/api.md +75 -0
- package/components/combobox/demo/api.min.js +314 -172
- package/components/combobox/demo/index.min.js +301 -171
- package/components/combobox/dist/comboboxKeyboardStrategy.d.ts +1 -1
- package/components/combobox/dist/index.js +291 -171
- package/components/combobox/dist/registered.js +291 -171
- package/components/counter/demo/api.html +3 -0
- package/components/counter/demo/api.js +4 -0
- package/components/counter/demo/api.md +130 -0
- package/components/counter/demo/api.min.js +320 -167
- package/components/counter/demo/index.min.js +300 -167
- package/components/counter/dist/counterGroupKeyboardStrategy.d.ts +3 -0
- package/components/counter/dist/index.js +300 -167
- package/components/counter/dist/registered.js +300 -167
- package/components/datepicker/demo/api.html +1 -0
- package/components/datepicker/demo/api.js +2 -0
- package/components/datepicker/demo/api.md +57 -0
- package/components/datepicker/demo/api.min.js +376 -171
- package/components/datepicker/demo/index.min.js +364 -171
- package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +3 -1
- package/components/datepicker/dist/index.js +364 -171
- package/components/datepicker/dist/registered.js +364 -171
- package/components/dropdown/demo/api.html +1 -0
- package/components/dropdown/demo/api.js +2 -0
- package/components/dropdown/demo/api.md +95 -0
- package/components/dropdown/demo/api.min.js +296 -165
- package/components/dropdown/demo/index.min.js +276 -165
- package/components/dropdown/dist/index.js +276 -165
- package/components/dropdown/dist/registered.js +276 -165
- package/components/form/demo/api.min.js +1254 -684
- package/components/form/demo/index.min.js +1254 -684
- 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/menu/demo/api.md +1 -0
- package/components/menu/demo/api.min.js +10 -0
- package/components/menu/demo/index.min.js +10 -0
- package/components/menu/dist/auro-menuoption.d.ts +9 -0
- package/components/menu/dist/index.js +10 -0
- package/components/menu/dist/registered.js +10 -0
- package/components/radio/demo/api.min.js +2 -2
- package/components/radio/demo/index.min.js +2 -2
- package/components/radio/dist/index.js +2 -2
- package/components/radio/dist/registered.js +2 -2
- package/components/select/demo/api.html +1 -0
- package/components/select/demo/api.js +2 -0
- package/components/select/demo/api.md +76 -0
- package/components/select/demo/api.min.js +306 -169
- package/components/select/demo/index.min.js +293 -169
- package/components/select/dist/index.js +283 -169
- package/components/select/dist/registered.js +283 -169
- package/custom-elements.json +48 -3
- package/package.json +5 -3
|
@@ -1344,10 +1344,19 @@ const comboboxKeyboardStrategy = {
|
|
|
1344
1344
|
}
|
|
1345
1345
|
},
|
|
1346
1346
|
|
|
1347
|
-
Escape(component,
|
|
1348
|
-
if (ctx.isExpanded
|
|
1347
|
+
Escape(component, evt, ctx) {
|
|
1348
|
+
if (!ctx.isExpanded) {
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
// Prevent the Escape key from bubbling up and closing any parent dialogs / drawers / popups
|
|
1353
|
+
evt.stopPropagation();
|
|
1354
|
+
|
|
1355
|
+
if (ctx.isModal) {
|
|
1349
1356
|
component.setTriggerInputFocus();
|
|
1350
1357
|
}
|
|
1358
|
+
|
|
1359
|
+
component.hideBib();
|
|
1351
1360
|
},
|
|
1352
1361
|
|
|
1353
1362
|
Home(component, evt, ctx) {
|
|
@@ -3235,11 +3244,19 @@ class AuroFloatingUI {
|
|
|
3235
3244
|
* This ensures that the bib content has the same dimensions as the sizer element.
|
|
3236
3245
|
*/
|
|
3237
3246
|
mirrorSize() {
|
|
3247
|
+
const element = this.element;
|
|
3248
|
+
if (!element) {
|
|
3249
|
+
return;
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3238
3252
|
// mirror the boxsize from bibSizer
|
|
3239
|
-
if (
|
|
3240
|
-
const sizerStyle = window.getComputedStyle(
|
|
3241
|
-
const bibContent =
|
|
3242
|
-
|
|
3253
|
+
if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
|
|
3254
|
+
const sizerStyle = window.getComputedStyle(element.bibSizer);
|
|
3255
|
+
const bibContent = element.bib.shadowRoot.querySelector(".container");
|
|
3256
|
+
if (!bibContent) {
|
|
3257
|
+
return;
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3243
3260
|
if (sizerStyle.width !== "0px") {
|
|
3244
3261
|
bibContent.style.width = sizerStyle.width;
|
|
3245
3262
|
}
|
|
@@ -3261,9 +3278,14 @@ class AuroFloatingUI {
|
|
|
3261
3278
|
* @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
|
|
3262
3279
|
*/
|
|
3263
3280
|
getPositioningStrategy() {
|
|
3281
|
+
const element = this.element;
|
|
3282
|
+
if (!element) {
|
|
3283
|
+
return "floating";
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3264
3286
|
const breakpoint =
|
|
3265
|
-
|
|
3266
|
-
|
|
3287
|
+
element.bib?.mobileFullscreenBreakpoint ||
|
|
3288
|
+
element.floaterConfig?.fullscreenBreakpoint;
|
|
3267
3289
|
switch (this.behavior) {
|
|
3268
3290
|
case "tooltip":
|
|
3269
3291
|
return "floating";
|
|
@@ -3274,9 +3296,9 @@ class AuroFloatingUI {
|
|
|
3274
3296
|
`(max-width: ${breakpoint})`,
|
|
3275
3297
|
).matches;
|
|
3276
3298
|
|
|
3277
|
-
|
|
3299
|
+
element.expanded = smallerThanBreakpoint;
|
|
3278
3300
|
}
|
|
3279
|
-
if (
|
|
3301
|
+
if (element.nested) {
|
|
3280
3302
|
return "cover";
|
|
3281
3303
|
}
|
|
3282
3304
|
return "fullscreen";
|
|
@@ -3306,42 +3328,65 @@ class AuroFloatingUI {
|
|
|
3306
3328
|
* and applies the calculated position to the bib's style.
|
|
3307
3329
|
*/
|
|
3308
3330
|
position() {
|
|
3331
|
+
const element = this.element;
|
|
3332
|
+
if (!element) {
|
|
3333
|
+
return;
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3309
3336
|
const strategy = this.getPositioningStrategy();
|
|
3310
3337
|
this.configureBibStrategy(strategy);
|
|
3311
3338
|
|
|
3312
3339
|
if (strategy === "floating") {
|
|
3340
|
+
if (!element.trigger || !element.bib) {
|
|
3341
|
+
return;
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3313
3344
|
this.mirrorSize();
|
|
3314
3345
|
// Define the middlware for the floater configuration
|
|
3315
3346
|
const middleware = [
|
|
3316
|
-
offset(
|
|
3317
|
-
...(
|
|
3318
|
-
...(
|
|
3319
|
-
...(
|
|
3347
|
+
offset(element.floaterConfig?.offset || 0),
|
|
3348
|
+
...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
|
|
3349
|
+
...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
|
|
3350
|
+
...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
|
|
3320
3351
|
];
|
|
3321
3352
|
|
|
3322
3353
|
// Compute the position of the bib
|
|
3323
|
-
computePosition(
|
|
3324
|
-
strategy:
|
|
3325
|
-
placement:
|
|
3354
|
+
computePosition(element.trigger, element.bib, {
|
|
3355
|
+
strategy: element.floaterConfig?.strategy || "fixed",
|
|
3356
|
+
placement: element.floaterConfig?.placement,
|
|
3326
3357
|
middleware: middleware || [],
|
|
3327
3358
|
}).then(({ x, y }) => {
|
|
3328
3359
|
// eslint-disable-line id-length
|
|
3329
|
-
|
|
3360
|
+
const currentElement = this.element;
|
|
3361
|
+
if (!currentElement?.bib) {
|
|
3362
|
+
return;
|
|
3363
|
+
}
|
|
3364
|
+
|
|
3365
|
+
Object.assign(currentElement.bib.style, {
|
|
3330
3366
|
left: `${x}px`,
|
|
3331
3367
|
top: `${y}px`,
|
|
3332
3368
|
});
|
|
3333
3369
|
});
|
|
3334
3370
|
} else if (strategy === "cover") {
|
|
3371
|
+
if (!element.parentNode || !element.bib) {
|
|
3372
|
+
return;
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3335
3375
|
// Compute the position of the bib
|
|
3336
|
-
computePosition(
|
|
3376
|
+
computePosition(element.parentNode, element.bib, {
|
|
3337
3377
|
placement: "bottom-start",
|
|
3338
3378
|
}).then(({ x, y }) => {
|
|
3339
3379
|
// eslint-disable-line id-length
|
|
3340
|
-
|
|
3380
|
+
const currentElement = this.element;
|
|
3381
|
+
if (!currentElement?.bib || !currentElement.parentNode) {
|
|
3382
|
+
return;
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
Object.assign(currentElement.bib.style, {
|
|
3341
3386
|
left: `${x}px`,
|
|
3342
|
-
top: `${y -
|
|
3343
|
-
width: `${
|
|
3344
|
-
height: `${
|
|
3387
|
+
top: `${y - currentElement.parentNode.offsetHeight}px`,
|
|
3388
|
+
width: `${currentElement.parentNode.offsetWidth}px`,
|
|
3389
|
+
height: `${currentElement.parentNode.offsetHeight}px`,
|
|
3345
3390
|
});
|
|
3346
3391
|
});
|
|
3347
3392
|
}
|
|
@@ -3353,11 +3398,17 @@ class AuroFloatingUI {
|
|
|
3353
3398
|
* @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
|
|
3354
3399
|
*/
|
|
3355
3400
|
lockScroll(lock = true) {
|
|
3401
|
+
const element = this.element;
|
|
3402
|
+
|
|
3356
3403
|
if (lock) {
|
|
3404
|
+
if (!element?.bib) {
|
|
3405
|
+
return;
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3357
3408
|
document.body.style.overflow = "hidden"; // hide body's scrollbar
|
|
3358
3409
|
|
|
3359
3410
|
// Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
|
|
3360
|
-
|
|
3411
|
+
element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
|
|
3361
3412
|
} else {
|
|
3362
3413
|
document.body.style.overflow = "";
|
|
3363
3414
|
}
|
|
@@ -3373,20 +3424,24 @@ class AuroFloatingUI {
|
|
|
3373
3424
|
* @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
|
|
3374
3425
|
*/
|
|
3375
3426
|
configureBibStrategy(value) {
|
|
3427
|
+
const element = this.element;
|
|
3428
|
+
if (!element?.bib) {
|
|
3429
|
+
return;
|
|
3430
|
+
}
|
|
3431
|
+
|
|
3376
3432
|
if (value === "fullscreen") {
|
|
3377
|
-
|
|
3433
|
+
element.isBibFullscreen = true;
|
|
3378
3434
|
// reset the prev position
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3435
|
+
element.bib.setAttribute("isfullscreen", "");
|
|
3436
|
+
element.bib.style.position = "fixed";
|
|
3437
|
+
element.bib.style.top = "0px";
|
|
3438
|
+
element.bib.style.left = "0px";
|
|
3439
|
+
element.bib.style.width = "";
|
|
3440
|
+
element.bib.style.height = "";
|
|
3441
|
+
element.style.contain = "";
|
|
3386
3442
|
|
|
3387
3443
|
// reset the size that was mirroring `size` css-part
|
|
3388
|
-
const bibContent =
|
|
3389
|
-
this.element.bib.shadowRoot.querySelector(".container");
|
|
3444
|
+
const bibContent = element.bib.shadowRoot?.querySelector(".container");
|
|
3390
3445
|
if (bibContent) {
|
|
3391
3446
|
bibContent.style.width = "";
|
|
3392
3447
|
bibContent.style.height = "";
|
|
@@ -3401,14 +3456,14 @@ class AuroFloatingUI {
|
|
|
3401
3456
|
}, 0);
|
|
3402
3457
|
}
|
|
3403
3458
|
|
|
3404
|
-
if (
|
|
3459
|
+
if (element.isPopoverVisible) {
|
|
3405
3460
|
this.lockScroll(true);
|
|
3406
3461
|
}
|
|
3407
3462
|
} else {
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3463
|
+
element.bib.style.position = "";
|
|
3464
|
+
element.bib.removeAttribute("isfullscreen");
|
|
3465
|
+
element.isBibFullscreen = false;
|
|
3466
|
+
element.style.contain = "layout";
|
|
3412
3467
|
}
|
|
3413
3468
|
|
|
3414
3469
|
const isChanged = this.strategy && this.strategy !== value;
|
|
@@ -3426,16 +3481,21 @@ class AuroFloatingUI {
|
|
|
3426
3481
|
},
|
|
3427
3482
|
);
|
|
3428
3483
|
|
|
3429
|
-
|
|
3484
|
+
element.dispatchEvent(event);
|
|
3430
3485
|
}
|
|
3431
3486
|
}
|
|
3432
3487
|
|
|
3433
3488
|
updateState() {
|
|
3434
|
-
const
|
|
3489
|
+
const element = this.element;
|
|
3490
|
+
if (!element) {
|
|
3491
|
+
return;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
const isVisible = element.isPopoverVisible;
|
|
3435
3495
|
if (!isVisible) {
|
|
3436
3496
|
this.cleanupHideHandlers();
|
|
3437
3497
|
try {
|
|
3438
|
-
|
|
3498
|
+
element.cleanup?.();
|
|
3439
3499
|
} catch (error) {
|
|
3440
3500
|
// Do nothing
|
|
3441
3501
|
}
|
|
@@ -3451,28 +3511,30 @@ class AuroFloatingUI {
|
|
|
3451
3511
|
* If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
|
|
3452
3512
|
*/
|
|
3453
3513
|
handleFocusLoss() {
|
|
3514
|
+
const element = this.element;
|
|
3515
|
+
if (!element?.bib) {
|
|
3516
|
+
return;
|
|
3517
|
+
}
|
|
3518
|
+
|
|
3454
3519
|
// if mouse is being pressed, skip and let click event to handle the action
|
|
3455
3520
|
if (AuroFloatingUI.isMousePressed) {
|
|
3456
3521
|
return;
|
|
3457
3522
|
}
|
|
3458
3523
|
|
|
3459
3524
|
if (
|
|
3460
|
-
|
|
3461
|
-
|
|
3525
|
+
element.noHideOnThisFocusLoss ||
|
|
3526
|
+
element.hasAttribute("noHideOnThisFocusLoss")
|
|
3462
3527
|
) {
|
|
3463
3528
|
return;
|
|
3464
3529
|
}
|
|
3465
3530
|
|
|
3466
3531
|
// 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
|
-
) {
|
|
3532
|
+
if (element.matches(":focus") || element.matches(":focus-within")) {
|
|
3471
3533
|
return;
|
|
3472
3534
|
}
|
|
3473
3535
|
|
|
3474
3536
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
3475
|
-
if (
|
|
3537
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
3476
3538
|
return;
|
|
3477
3539
|
}
|
|
3478
3540
|
|
|
@@ -3480,23 +3542,33 @@ class AuroFloatingUI {
|
|
|
3480
3542
|
}
|
|
3481
3543
|
|
|
3482
3544
|
setupHideHandlers() {
|
|
3545
|
+
const element = this.element;
|
|
3546
|
+
if (!element) {
|
|
3547
|
+
return;
|
|
3548
|
+
}
|
|
3549
|
+
|
|
3483
3550
|
// Define handlers & store references
|
|
3484
3551
|
this.focusHandler = () => this.handleFocusLoss();
|
|
3485
3552
|
|
|
3486
3553
|
this.clickHandler = (evt) => {
|
|
3554
|
+
const element = this.element;
|
|
3555
|
+
if (!element?.bib) {
|
|
3556
|
+
return;
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3487
3559
|
// When the bib is fullscreen (modal dialog), don't close on outside
|
|
3488
3560
|
// clicks. VoiceOver's synthetic click events inside a top-layer modal
|
|
3489
3561
|
// <dialog> may not include the bib in composedPath(), causing false
|
|
3490
3562
|
// positives. This mirrors the fullscreen guard in handleFocusLoss().
|
|
3491
|
-
if (
|
|
3563
|
+
if (element.bib.hasAttribute("isfullscreen")) {
|
|
3492
3564
|
return;
|
|
3493
3565
|
}
|
|
3494
3566
|
|
|
3495
3567
|
if (
|
|
3496
|
-
(!evt.composedPath().includes(
|
|
3497
|
-
!evt.composedPath().includes(
|
|
3498
|
-
(
|
|
3499
|
-
evt.composedPath().includes(
|
|
3568
|
+
(!evt.composedPath().includes(element.trigger) &&
|
|
3569
|
+
!evt.composedPath().includes(element.bib)) ||
|
|
3570
|
+
(element.bib.backdrop &&
|
|
3571
|
+
evt.composedPath().includes(element.bib.backdrop))
|
|
3500
3572
|
) {
|
|
3501
3573
|
const existedVisibleFloatingUI =
|
|
3502
3574
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -3517,7 +3589,12 @@ class AuroFloatingUI {
|
|
|
3517
3589
|
|
|
3518
3590
|
// ESC key handler
|
|
3519
3591
|
this.keyDownHandler = (evt) => {
|
|
3520
|
-
|
|
3592
|
+
const element = this.element;
|
|
3593
|
+
if (!element) {
|
|
3594
|
+
return;
|
|
3595
|
+
}
|
|
3596
|
+
|
|
3597
|
+
if (evt.key === "Escape" && element.isPopoverVisible) {
|
|
3521
3598
|
const existedVisibleFloatingUI =
|
|
3522
3599
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
3523
3600
|
if (
|
|
@@ -3574,6 +3651,10 @@ class AuroFloatingUI {
|
|
|
3574
3651
|
}
|
|
3575
3652
|
|
|
3576
3653
|
updateCurrentExpandedDropdown() {
|
|
3654
|
+
if (!this.element) {
|
|
3655
|
+
return;
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3577
3658
|
// Close any other dropdown that is already open
|
|
3578
3659
|
const existedVisibleFloatingUI =
|
|
3579
3660
|
document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
|
|
@@ -3590,25 +3671,34 @@ class AuroFloatingUI {
|
|
|
3590
3671
|
}
|
|
3591
3672
|
|
|
3592
3673
|
showBib() {
|
|
3593
|
-
|
|
3674
|
+
const element = this.element;
|
|
3675
|
+
if (!element) {
|
|
3676
|
+
return;
|
|
3677
|
+
}
|
|
3678
|
+
|
|
3679
|
+
if (!element.bib || (!element.trigger && !element.parentNode)) {
|
|
3680
|
+
return;
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
if (!element.disabled && !this.showing) {
|
|
3594
3684
|
this.updateCurrentExpandedDropdown();
|
|
3595
|
-
|
|
3685
|
+
element.triggerChevron?.setAttribute("data-expanded", true);
|
|
3596
3686
|
|
|
3597
3687
|
// prevent double showing: isPopovervisible gets first and showBib gets called later
|
|
3598
3688
|
if (!this.showing) {
|
|
3599
|
-
if (!
|
|
3689
|
+
if (!element.modal) {
|
|
3600
3690
|
this.setupHideHandlers();
|
|
3601
3691
|
}
|
|
3602
3692
|
this.showing = true;
|
|
3603
|
-
|
|
3693
|
+
element.isPopoverVisible = true;
|
|
3604
3694
|
this.position();
|
|
3605
3695
|
this.dispatchEventDropdownToggle();
|
|
3606
3696
|
}
|
|
3607
3697
|
|
|
3608
3698
|
// Setup auto update to handle resize and scroll
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3699
|
+
element.cleanup = autoUpdate(
|
|
3700
|
+
element.trigger || element.parentNode,
|
|
3701
|
+
element.bib,
|
|
3612
3702
|
() => {
|
|
3613
3703
|
this.position();
|
|
3614
3704
|
},
|
|
@@ -3621,22 +3711,27 @@ class AuroFloatingUI {
|
|
|
3621
3711
|
* @param {String} eventType - The event type that triggered the hiding action.
|
|
3622
3712
|
*/
|
|
3623
3713
|
hideBib(eventType = "unknown") {
|
|
3624
|
-
|
|
3714
|
+
const element = this.element;
|
|
3715
|
+
if (!element) {
|
|
3716
|
+
return;
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
if (element.disabled) {
|
|
3625
3720
|
return;
|
|
3626
3721
|
}
|
|
3627
3722
|
|
|
3628
3723
|
// noToggle dropdowns should not close when the trigger is clicked (the
|
|
3629
3724
|
// "toggle" behavior), but they CAN still close via other interactions like
|
|
3630
3725
|
// Escape key or focus loss.
|
|
3631
|
-
if (
|
|
3726
|
+
if (element.noToggle && eventType === "click") {
|
|
3632
3727
|
return;
|
|
3633
3728
|
}
|
|
3634
3729
|
|
|
3635
3730
|
this.lockScroll(false);
|
|
3636
|
-
|
|
3731
|
+
element.triggerChevron?.removeAttribute("data-expanded");
|
|
3637
3732
|
|
|
3638
|
-
if (
|
|
3639
|
-
|
|
3733
|
+
if (element.isPopoverVisible) {
|
|
3734
|
+
element.isPopoverVisible = false;
|
|
3640
3735
|
}
|
|
3641
3736
|
if (this.showing) {
|
|
3642
3737
|
this.cleanupHideHandlers();
|
|
@@ -3656,6 +3751,11 @@ class AuroFloatingUI {
|
|
|
3656
3751
|
* @param {String} eventType - The event type that triggered the toggle action.
|
|
3657
3752
|
*/
|
|
3658
3753
|
dispatchEventDropdownToggle(eventType) {
|
|
3754
|
+
const element = this.element;
|
|
3755
|
+
if (!element) {
|
|
3756
|
+
return;
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3659
3759
|
const event = new CustomEvent(
|
|
3660
3760
|
this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
|
|
3661
3761
|
{
|
|
@@ -3667,11 +3767,16 @@ class AuroFloatingUI {
|
|
|
3667
3767
|
},
|
|
3668
3768
|
);
|
|
3669
3769
|
|
|
3670
|
-
|
|
3770
|
+
element.dispatchEvent(event);
|
|
3671
3771
|
}
|
|
3672
3772
|
|
|
3673
3773
|
handleClick() {
|
|
3674
|
-
|
|
3774
|
+
const element = this.element;
|
|
3775
|
+
if (!element) {
|
|
3776
|
+
return;
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
if (element.isPopoverVisible) {
|
|
3675
3780
|
this.hideBib("click");
|
|
3676
3781
|
} else {
|
|
3677
3782
|
this.showBib();
|
|
@@ -3682,63 +3787,66 @@ class AuroFloatingUI {
|
|
|
3682
3787
|
{
|
|
3683
3788
|
composed: true,
|
|
3684
3789
|
detail: {
|
|
3685
|
-
expanded:
|
|
3790
|
+
expanded: element.isPopoverVisible,
|
|
3686
3791
|
},
|
|
3687
3792
|
},
|
|
3688
3793
|
);
|
|
3689
3794
|
|
|
3690
|
-
|
|
3795
|
+
element.dispatchEvent(event);
|
|
3691
3796
|
}
|
|
3692
3797
|
|
|
3693
3798
|
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
|
-
}
|
|
3799
|
+
const element = this.element;
|
|
3800
|
+
if (!element || element.disableEventShow) {
|
|
3801
|
+
return;
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
switch (event.type) {
|
|
3805
|
+
case "keydown": {
|
|
3806
|
+
// Support both Enter and Space keys for accessibility
|
|
3807
|
+
// Space is included as it's expected behavior for interactive elements
|
|
3808
|
+
|
|
3809
|
+
const origin = event.composedPath()[0];
|
|
3810
|
+
if (
|
|
3811
|
+
event.key === "Enter" ||
|
|
3812
|
+
(event.key === " " && (!origin || origin.tagName !== "INPUT"))
|
|
3813
|
+
) {
|
|
3814
|
+
event.preventDefault();
|
|
3738
3815
|
this.handleClick();
|
|
3739
|
-
|
|
3740
|
-
|
|
3816
|
+
}
|
|
3817
|
+
break;
|
|
3741
3818
|
}
|
|
3819
|
+
case "mouseenter":
|
|
3820
|
+
if (element.hoverToggle) {
|
|
3821
|
+
this.showBib();
|
|
3822
|
+
}
|
|
3823
|
+
break;
|
|
3824
|
+
case "mouseleave":
|
|
3825
|
+
if (element.hoverToggle) {
|
|
3826
|
+
this.hideBib("mouseleave");
|
|
3827
|
+
}
|
|
3828
|
+
break;
|
|
3829
|
+
case "focus":
|
|
3830
|
+
if (element.focusShow) {
|
|
3831
|
+
/*
|
|
3832
|
+
This needs to better handle clicking that gives focus -
|
|
3833
|
+
currently it shows and then immediately hides the bib
|
|
3834
|
+
*/
|
|
3835
|
+
this.showBib();
|
|
3836
|
+
}
|
|
3837
|
+
break;
|
|
3838
|
+
case "blur":
|
|
3839
|
+
// send this task 100ms later queue to
|
|
3840
|
+
// wait a frame in case focus moves within the floating element/bib
|
|
3841
|
+
setTimeout(() => this.handleFocusLoss(), 0);
|
|
3842
|
+
break;
|
|
3843
|
+
case "click":
|
|
3844
|
+
if (document.activeElement === document.body) {
|
|
3845
|
+
event.currentTarget.focus();
|
|
3846
|
+
}
|
|
3847
|
+
this.handleClick();
|
|
3848
|
+
break;
|
|
3849
|
+
// Do nothing
|
|
3742
3850
|
}
|
|
3743
3851
|
}
|
|
3744
3852
|
|
|
@@ -3749,6 +3857,11 @@ class AuroFloatingUI {
|
|
|
3749
3857
|
* This prevents the component itself from being focusable when the trigger element already handles focus.
|
|
3750
3858
|
*/
|
|
3751
3859
|
handleTriggerTabIndex() {
|
|
3860
|
+
const element = this.element;
|
|
3861
|
+
if (!element) {
|
|
3862
|
+
return;
|
|
3863
|
+
}
|
|
3864
|
+
|
|
3752
3865
|
const focusableElementSelectors = [
|
|
3753
3866
|
"a",
|
|
3754
3867
|
"button",
|
|
@@ -3761,7 +3874,7 @@ class AuroFloatingUI {
|
|
|
3761
3874
|
"auro-hyperlink",
|
|
3762
3875
|
];
|
|
3763
3876
|
|
|
3764
|
-
const triggerNode =
|
|
3877
|
+
const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
|
|
3765
3878
|
if (!triggerNode) {
|
|
3766
3879
|
return;
|
|
3767
3880
|
}
|
|
@@ -3770,13 +3883,13 @@ class AuroFloatingUI {
|
|
|
3770
3883
|
focusableElementSelectors.forEach((selector) => {
|
|
3771
3884
|
// Check if the trigger node element is focusable
|
|
3772
3885
|
if (triggerNodeTagName === selector) {
|
|
3773
|
-
|
|
3886
|
+
element.tabIndex = -1;
|
|
3774
3887
|
return;
|
|
3775
3888
|
}
|
|
3776
3889
|
|
|
3777
3890
|
// Check if any child is focusable
|
|
3778
3891
|
if (triggerNode.querySelector(selector)) {
|
|
3779
|
-
|
|
3892
|
+
element.tabIndex = -1;
|
|
3780
3893
|
}
|
|
3781
3894
|
});
|
|
3782
3895
|
}
|
|
@@ -3786,13 +3899,18 @@ class AuroFloatingUI {
|
|
|
3786
3899
|
* @param {*} eventPrefix
|
|
3787
3900
|
*/
|
|
3788
3901
|
regenerateBibId() {
|
|
3789
|
-
|
|
3902
|
+
const element = this.element;
|
|
3903
|
+
if (!element) {
|
|
3904
|
+
return;
|
|
3905
|
+
}
|
|
3906
|
+
|
|
3907
|
+
this.id = element.getAttribute("id");
|
|
3790
3908
|
if (!this.id) {
|
|
3791
3909
|
this.id = window.crypto.randomUUID();
|
|
3792
|
-
|
|
3910
|
+
element.setAttribute("id", this.id);
|
|
3793
3911
|
}
|
|
3794
3912
|
|
|
3795
|
-
|
|
3913
|
+
element.bib?.setAttribute("id", `${this.id}-floater-bib`);
|
|
3796
3914
|
}
|
|
3797
3915
|
|
|
3798
3916
|
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
@@ -3804,67 +3922,69 @@ class AuroFloatingUI {
|
|
|
3804
3922
|
this.element = elem;
|
|
3805
3923
|
}
|
|
3806
3924
|
|
|
3807
|
-
|
|
3808
|
-
|
|
3925
|
+
const element = this.element;
|
|
3926
|
+
if (!element) {
|
|
3927
|
+
return;
|
|
3928
|
+
}
|
|
3929
|
+
|
|
3930
|
+
if (this.behavior !== element.behavior) {
|
|
3931
|
+
this.behavior = element.behavior;
|
|
3809
3932
|
}
|
|
3810
3933
|
|
|
3811
|
-
if (
|
|
3934
|
+
if (element.trigger) {
|
|
3812
3935
|
this.disconnect();
|
|
3813
3936
|
}
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
this.element.shadowRoot.querySelector("#showStateIcon");
|
|
3937
|
+
element.trigger =
|
|
3938
|
+
element.triggerElement ||
|
|
3939
|
+
element.shadowRoot?.querySelector("#trigger") ||
|
|
3940
|
+
element.trigger;
|
|
3941
|
+
element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
|
|
3942
|
+
element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
|
|
3943
|
+
element.triggerChevron =
|
|
3944
|
+
element.shadowRoot?.querySelector("#showStateIcon");
|
|
3823
3945
|
|
|
3824
|
-
if (
|
|
3825
|
-
|
|
3946
|
+
if (element.floaterConfig) {
|
|
3947
|
+
element.hoverToggle = element.floaterConfig.hoverToggle;
|
|
3826
3948
|
}
|
|
3827
3949
|
|
|
3828
3950
|
this.regenerateBibId();
|
|
3829
3951
|
this.handleTriggerTabIndex();
|
|
3830
3952
|
|
|
3831
3953
|
this.handleEvent = this.handleEvent.bind(this);
|
|
3832
|
-
if (
|
|
3954
|
+
if (element.trigger) {
|
|
3833
3955
|
if (this.enableKeyboardHandling) {
|
|
3834
|
-
|
|
3956
|
+
element.trigger.addEventListener("keydown", this.handleEvent);
|
|
3835
3957
|
}
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3958
|
+
element.trigger.addEventListener("click", this.handleEvent);
|
|
3959
|
+
element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
3960
|
+
element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
3961
|
+
element.trigger.addEventListener("focus", this.handleEvent);
|
|
3962
|
+
element.trigger.addEventListener("blur", this.handleEvent);
|
|
3841
3963
|
}
|
|
3842
3964
|
}
|
|
3843
3965
|
|
|
3844
3966
|
disconnect() {
|
|
3845
3967
|
this.cleanupHideHandlers();
|
|
3846
|
-
if (this.element) {
|
|
3847
|
-
this.element.cleanup?.();
|
|
3848
3968
|
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3969
|
+
const element = this.element;
|
|
3970
|
+
if (!element) {
|
|
3971
|
+
return;
|
|
3972
|
+
}
|
|
3852
3973
|
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
}
|
|
3974
|
+
element.cleanup?.();
|
|
3975
|
+
|
|
3976
|
+
if (element.bib && element.shadowRoot) {
|
|
3977
|
+
element.shadowRoot.append(element.bib);
|
|
3978
|
+
}
|
|
3979
|
+
|
|
3980
|
+
// Remove event & keyboard listeners
|
|
3981
|
+
if (element.trigger) {
|
|
3982
|
+
element.trigger.removeEventListener("keydown", this.handleEvent);
|
|
3983
|
+
element.trigger.removeEventListener("click", this.handleEvent);
|
|
3984
|
+
element.trigger.removeEventListener("mouseenter", this.handleEvent);
|
|
3985
|
+
element.trigger.removeEventListener("mouseleave", this.handleEvent);
|
|
3986
|
+
element.trigger.removeEventListener("focus", this.handleEvent);
|
|
3987
|
+
element.trigger.removeEventListener("blur", this.handleEvent);
|
|
3868
3988
|
}
|
|
3869
3989
|
}
|
|
3870
3990
|
}
|
|
@@ -4992,7 +5112,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
|
|
|
4992
5112
|
}
|
|
4993
5113
|
};
|
|
4994
5114
|
|
|
4995
|
-
var formkitVersion$2 = '
|
|
5115
|
+
var formkitVersion$2 = '202604091759';
|
|
4996
5116
|
|
|
4997
5117
|
let AuroElement$2 = class AuroElement extends i$4 {
|
|
4998
5118
|
static get properties() {
|
|
@@ -5098,7 +5218,7 @@ let AuroElement$2 = class AuroElement extends i$4 {
|
|
|
5098
5218
|
}
|
|
5099
5219
|
};
|
|
5100
5220
|
|
|
5101
|
-
// Copyright (c) 2026 Alaska Airlines. All
|
|
5221
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
5102
5222
|
// See LICENSE in the project root for license information.
|
|
5103
5223
|
|
|
5104
5224
|
|
|
@@ -12748,7 +12868,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
|
|
|
12748
12868
|
}
|
|
12749
12869
|
};
|
|
12750
12870
|
|
|
12751
|
-
var formkitVersion$1 = '
|
|
12871
|
+
var formkitVersion$1 = '202604091759';
|
|
12752
12872
|
|
|
12753
12873
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12754
12874
|
// See LICENSE in the project root for license information.
|
|
@@ -13813,7 +13933,7 @@ class AuroBibtemplate extends i$4 {
|
|
|
13813
13933
|
}
|
|
13814
13934
|
}
|
|
13815
13935
|
|
|
13816
|
-
var formkitVersion = '
|
|
13936
|
+
var formkitVersion = '202604091759';
|
|
13817
13937
|
|
|
13818
13938
|
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}`;
|
|
13819
13939
|
|
|
@@ -14153,7 +14273,7 @@ class AuroHelpText extends i$4 {
|
|
|
14153
14273
|
}
|
|
14154
14274
|
}
|
|
14155
14275
|
|
|
14156
|
-
// Copyright (c) 2026 Alaska Airlines. All
|
|
14276
|
+
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
14157
14277
|
// See LICENSE in the project root for license information.
|
|
14158
14278
|
|
|
14159
14279
|
|
|
@@ -14676,7 +14796,7 @@ class AuroCombobox extends AuroElement {
|
|
|
14676
14796
|
* @returns {void}
|
|
14677
14797
|
*/
|
|
14678
14798
|
activateFirstEnabledAvailableOption() {
|
|
14679
|
-
const firstEnabledOptionIndex = this.availableOptions.findIndex((opt) => !opt.disabled);
|
|
14799
|
+
const firstEnabledOptionIndex = this.availableOptions.findIndex((opt) => !opt.disabled && !opt.hasAttribute('nomatch'));
|
|
14680
14800
|
this.updateActiveOption(firstEnabledOptionIndex);
|
|
14681
14801
|
}
|
|
14682
14802
|
|
|
@@ -14690,7 +14810,7 @@ class AuroCombobox extends AuroElement {
|
|
|
14690
14810
|
|
|
14691
14811
|
// Work backwards through the available options array to find the last enabled option
|
|
14692
14812
|
for (let index = this.availableOptions.length - 1; index >= 0; index -= 1) {
|
|
14693
|
-
if (!this.availableOptions[index].disabled) {
|
|
14813
|
+
if (!this.availableOptions[index].disabled && !this.availableOptions[index].hasAttribute('nomatch')) {
|
|
14694
14814
|
lastEnabledOptionIndex = index;
|
|
14695
14815
|
break;
|
|
14696
14816
|
}
|
|
@@ -15955,6 +16075,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
15955
16075
|
this.selected = false;
|
|
15956
16076
|
this.noCheckmark = false;
|
|
15957
16077
|
this.disabled = false;
|
|
16078
|
+
this.noMatch = false;
|
|
15958
16079
|
|
|
15959
16080
|
/**
|
|
15960
16081
|
* @private
|
|
@@ -16030,6 +16151,15 @@ class AuroMenuOption extends AuroElement {
|
|
|
16030
16151
|
reflect: true
|
|
16031
16152
|
},
|
|
16032
16153
|
|
|
16154
|
+
/**
|
|
16155
|
+
* When true, marks this option as the "no matching results" placeholder shown by combobox when the user's input does not match any available options. Enables distinct styling and prevents the option from being treated as a selectable match.
|
|
16156
|
+
*/
|
|
16157
|
+
noMatch: {
|
|
16158
|
+
type: Boolean,
|
|
16159
|
+
reflect: true,
|
|
16160
|
+
attribute: 'nomatch'
|
|
16161
|
+
},
|
|
16162
|
+
|
|
16033
16163
|
/**
|
|
16034
16164
|
* Specifies that an option is selected.
|
|
16035
16165
|
*/
|