@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.
Files changed (35) hide show
  1. package/components/checkbox/demo/api.min.js +1 -1
  2. package/components/checkbox/demo/index.min.js +1 -1
  3. package/components/checkbox/dist/index.js +1 -1
  4. package/components/checkbox/dist/registered.js +1 -1
  5. package/components/combobox/demo/api.min.js +165 -275
  6. package/components/combobox/demo/index.min.js +165 -275
  7. package/components/combobox/dist/index.js +165 -275
  8. package/components/combobox/dist/registered.js +165 -275
  9. package/components/counter/demo/api.min.js +164 -274
  10. package/components/counter/demo/index.min.js +164 -274
  11. package/components/counter/dist/index.js +164 -274
  12. package/components/counter/dist/registered.js +164 -274
  13. package/components/datepicker/demo/api.min.js +165 -275
  14. package/components/datepicker/demo/index.min.js +165 -275
  15. package/components/datepicker/dist/index.js +165 -275
  16. package/components/datepicker/dist/registered.js +165 -275
  17. package/components/dropdown/demo/api.min.js +164 -274
  18. package/components/dropdown/demo/index.min.js +164 -274
  19. package/components/dropdown/dist/index.js +164 -274
  20. package/components/dropdown/dist/registered.js +164 -274
  21. package/components/form/demo/api.min.js +661 -1101
  22. package/components/form/demo/index.min.js +661 -1101
  23. package/components/input/demo/api.min.js +1 -1
  24. package/components/input/demo/index.min.js +1 -1
  25. package/components/input/dist/index.js +1 -1
  26. package/components/input/dist/registered.js +1 -1
  27. package/components/radio/demo/api.min.js +1 -1
  28. package/components/radio/demo/index.min.js +1 -1
  29. package/components/radio/dist/index.js +1 -1
  30. package/components/radio/dist/registered.js +1 -1
  31. package/components/select/demo/api.min.js +164 -274
  32. package/components/select/demo/index.min.js +164 -274
  33. package/components/select/dist/index.js +164 -274
  34. package/components/select/dist/registered.js +164 -274
  35. package/package.json +2 -2
@@ -3168,19 +3168,11 @@ class AuroFloatingUI {
3168
3168
  * This ensures that the bib content has the same dimensions as the sizer element.
3169
3169
  */
3170
3170
  mirrorSize() {
3171
- const element = this.element;
3172
- if (!element) {
3173
- return;
3174
- }
3175
-
3176
3171
  // mirror the boxsize from bibSizer
3177
- if (element.bibSizer && element.matchWidth && element.bib?.shadowRoot) {
3178
- const sizerStyle = window.getComputedStyle(element.bibSizer);
3179
- const bibContent = element.bib.shadowRoot.querySelector(".container");
3180
- if (!bibContent) {
3181
- return;
3182
- }
3183
-
3172
+ if (this.element.bibSizer && this.element.matchWidth) {
3173
+ const sizerStyle = window.getComputedStyle(this.element.bibSizer);
3174
+ const bibContent =
3175
+ this.element.bib.shadowRoot.querySelector(".container");
3184
3176
  if (sizerStyle.width !== "0px") {
3185
3177
  bibContent.style.width = sizerStyle.width;
3186
3178
  }
@@ -3202,14 +3194,9 @@ class AuroFloatingUI {
3202
3194
  * @returns {String} The positioning strategy, one of 'fullscreen', 'floating', 'cover'.
3203
3195
  */
3204
3196
  getPositioningStrategy() {
3205
- const element = this.element;
3206
- if (!element) {
3207
- return this.behavior || "floating";
3208
- }
3209
-
3210
3197
  const breakpoint =
3211
- element.bib?.mobileFullscreenBreakpoint ||
3212
- element.floaterConfig?.fullscreenBreakpoint;
3198
+ this.element.bib.mobileFullscreenBreakpoint ||
3199
+ this.element.floaterConfig?.fullscreenBreakpoint;
3213
3200
  switch (this.behavior) {
3214
3201
  case "tooltip":
3215
3202
  return "floating";
@@ -3220,9 +3207,9 @@ class AuroFloatingUI {
3220
3207
  `(max-width: ${breakpoint})`,
3221
3208
  ).matches;
3222
3209
 
3223
- element.expanded = smallerThanBreakpoint;
3210
+ this.element.expanded = smallerThanBreakpoint;
3224
3211
  }
3225
- if (element.nested) {
3212
+ if (this.element.nested) {
3226
3213
  return "cover";
3227
3214
  }
3228
3215
  return "fullscreen";
@@ -3252,65 +3239,42 @@ class AuroFloatingUI {
3252
3239
  * and applies the calculated position to the bib's style.
3253
3240
  */
3254
3241
  position() {
3255
- const element = this.element;
3256
- if (!element) {
3257
- return;
3258
- }
3259
-
3260
3242
  const strategy = this.getPositioningStrategy();
3261
3243
  this.configureBibStrategy(strategy);
3262
3244
 
3263
3245
  if (strategy === "floating") {
3264
- if (!element.trigger || !element.bib) {
3265
- return;
3266
- }
3267
-
3268
3246
  this.mirrorSize();
3269
3247
  // Define the middlware for the floater configuration
3270
3248
  const middleware = [
3271
- offset(element.floaterConfig?.offset || 0),
3272
- ...(element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
3273
- ...(element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
3274
- ...(element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
3249
+ offset(this.element.floaterConfig?.offset || 0),
3250
+ ...(this.element.floaterConfig?.shift ? [shift()] : []), // Add shift middleware if shift is enabled.
3251
+ ...(this.element.floaterConfig?.flip ? [flip()] : []), // Add flip middleware if flip is enabled.
3252
+ ...(this.element.floaterConfig?.autoPlacement ? [autoPlacement()] : []), // Add autoPlacement middleware if autoPlacement is enabled.
3275
3253
  ];
3276
3254
 
3277
3255
  // Compute the position of the bib
3278
- computePosition(element.trigger, element.bib, {
3279
- strategy: element.floaterConfig?.strategy || "fixed",
3280
- placement: element.floaterConfig?.placement,
3256
+ computePosition(this.element.trigger, this.element.bib, {
3257
+ strategy: this.element.floaterConfig?.strategy || "fixed",
3258
+ placement: this.element.floaterConfig?.placement,
3281
3259
  middleware: middleware || [],
3282
3260
  }).then(({ x, y }) => {
3283
3261
  // eslint-disable-line id-length
3284
- const currentElement = this.element;
3285
- if (!currentElement?.bib) {
3286
- return;
3287
- }
3288
-
3289
- Object.assign(currentElement.bib.style, {
3262
+ Object.assign(this.element.bib.style, {
3290
3263
  left: `${x}px`,
3291
3264
  top: `${y}px`,
3292
3265
  });
3293
3266
  });
3294
3267
  } else if (strategy === "cover") {
3295
- if (!element.parentNode || !element.bib) {
3296
- return;
3297
- }
3298
-
3299
3268
  // Compute the position of the bib
3300
- computePosition(element.parentNode, element.bib, {
3269
+ computePosition(this.element.parentNode, this.element.bib, {
3301
3270
  placement: "bottom-start",
3302
3271
  }).then(({ x, y }) => {
3303
3272
  // eslint-disable-line id-length
3304
- const currentElement = this.element;
3305
- if (!currentElement?.bib || !currentElement.parentNode) {
3306
- return;
3307
- }
3308
-
3309
- Object.assign(currentElement.bib.style, {
3273
+ Object.assign(this.element.bib.style, {
3310
3274
  left: `${x}px`,
3311
- top: `${y - currentElement.parentNode.offsetHeight}px`,
3312
- width: `${currentElement.parentNode.offsetWidth}px`,
3313
- height: `${currentElement.parentNode.offsetHeight}px`,
3275
+ top: `${y - this.element.parentNode.offsetHeight}px`,
3276
+ width: `${this.element.parentNode.offsetWidth}px`,
3277
+ height: `${this.element.parentNode.offsetHeight}px`,
3314
3278
  });
3315
3279
  });
3316
3280
  }
@@ -3322,17 +3286,11 @@ class AuroFloatingUI {
3322
3286
  * @param {Boolean} lock - If true, locks the body's scrolling functionlity; otherwise, unlock.
3323
3287
  */
3324
3288
  lockScroll(lock = true) {
3325
- const element = this.element;
3326
-
3327
3289
  if (lock) {
3328
- if (!element?.bib) {
3329
- return;
3330
- }
3331
-
3332
3290
  document.body.style.overflow = "hidden"; // hide body's scrollbar
3333
3291
 
3334
3292
  // Move `bib` by the amount the viewport is shifted to stay aligned in fullscreen.
3335
- element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
3293
+ this.element.bib.style.transform = `translateY(${window?.visualViewport?.offsetTop}px)`;
3336
3294
  } else {
3337
3295
  document.body.style.overflow = "";
3338
3296
  }
@@ -3348,24 +3306,20 @@ class AuroFloatingUI {
3348
3306
  * @param {string} strategy - The positioning strategy ('fullscreen' or 'floating').
3349
3307
  */
3350
3308
  configureBibStrategy(value) {
3351
- const element = this.element;
3352
- if (!element?.bib) {
3353
- return;
3354
- }
3355
-
3356
3309
  if (value === "fullscreen") {
3357
- element.isBibFullscreen = true;
3310
+ this.element.isBibFullscreen = true;
3358
3311
  // reset the prev position
3359
- element.bib.setAttribute("isfullscreen", "");
3360
- element.bib.style.position = "fixed";
3361
- element.bib.style.top = "0px";
3362
- element.bib.style.left = "0px";
3363
- element.bib.style.width = "";
3364
- element.bib.style.height = "";
3365
- element.style.contain = "";
3312
+ this.element.bib.setAttribute("isfullscreen", "");
3313
+ this.element.bib.style.position = "fixed";
3314
+ this.element.bib.style.top = "0px";
3315
+ this.element.bib.style.left = "0px";
3316
+ this.element.bib.style.width = "";
3317
+ this.element.bib.style.height = "";
3318
+ this.element.style.contain = "";
3366
3319
 
3367
3320
  // reset the size that was mirroring `size` css-part
3368
- const bibContent = element.bib.shadowRoot?.querySelector(".container");
3321
+ const bibContent =
3322
+ this.element.bib.shadowRoot.querySelector(".container");
3369
3323
  if (bibContent) {
3370
3324
  bibContent.style.width = "";
3371
3325
  bibContent.style.height = "";
@@ -3380,14 +3334,14 @@ class AuroFloatingUI {
3380
3334
  }, 0);
3381
3335
  }
3382
3336
 
3383
- if (element.isPopoverVisible) {
3337
+ if (this.element.isPopoverVisible) {
3384
3338
  this.lockScroll(true);
3385
3339
  }
3386
3340
  } else {
3387
- element.bib.style.position = "";
3388
- element.bib.removeAttribute("isfullscreen");
3389
- element.isBibFullscreen = false;
3390
- element.style.contain = "layout";
3341
+ this.element.bib.style.position = "";
3342
+ this.element.bib.removeAttribute("isfullscreen");
3343
+ this.element.isBibFullscreen = false;
3344
+ this.element.style.contain = "layout";
3391
3345
  }
3392
3346
 
3393
3347
  const isChanged = this.strategy && this.strategy !== value;
@@ -3405,21 +3359,16 @@ class AuroFloatingUI {
3405
3359
  },
3406
3360
  );
3407
3361
 
3408
- element.dispatchEvent(event);
3362
+ this.element.dispatchEvent(event);
3409
3363
  }
3410
3364
  }
3411
3365
 
3412
3366
  updateState() {
3413
- const element = this.element;
3414
- if (!element) {
3415
- return;
3416
- }
3417
-
3418
- const isVisible = element.isPopoverVisible;
3367
+ const isVisible = this.element.isPopoverVisible;
3419
3368
  if (!isVisible) {
3420
3369
  this.cleanupHideHandlers();
3421
3370
  try {
3422
- element.cleanup?.();
3371
+ this.element.cleanup?.();
3423
3372
  } catch (error) {
3424
3373
  // Do nothing
3425
3374
  }
@@ -3435,30 +3384,28 @@ class AuroFloatingUI {
3435
3384
  * If not, and if the bib isn't in fullscreen mode with focus lost, it hides the bib.
3436
3385
  */
3437
3386
  handleFocusLoss() {
3438
- const element = this.element;
3439
- if (!element?.bib) {
3440
- return;
3441
- }
3442
-
3443
3387
  // if mouse is being pressed, skip and let click event to handle the action
3444
3388
  if (AuroFloatingUI.isMousePressed) {
3445
3389
  return;
3446
3390
  }
3447
3391
 
3448
3392
  if (
3449
- element.noHideOnThisFocusLoss ||
3450
- element.hasAttribute("noHideOnThisFocusLoss")
3393
+ this.element.noHideOnThisFocusLoss ||
3394
+ this.element.hasAttribute("noHideOnThisFocusLoss")
3451
3395
  ) {
3452
3396
  return;
3453
3397
  }
3454
3398
 
3455
3399
  // if focus is still inside of trigger or bib, do not close
3456
- if (element.matches(":focus") || element.matches(":focus-within")) {
3400
+ if (
3401
+ this.element.matches(":focus") ||
3402
+ this.element.matches(":focus-within")
3403
+ ) {
3457
3404
  return;
3458
3405
  }
3459
3406
 
3460
3407
  // if fullscreen bib is in fullscreen mode, do not close
3461
- if (element.bib.hasAttribute("isfullscreen")) {
3408
+ if (this.element.bib.hasAttribute("isfullscreen")) {
3462
3409
  return;
3463
3410
  }
3464
3411
 
@@ -3466,32 +3413,23 @@ class AuroFloatingUI {
3466
3413
  }
3467
3414
 
3468
3415
  setupHideHandlers() {
3469
- if (!this.element) {
3470
- return;
3471
- }
3472
-
3473
3416
  // Define handlers & store references
3474
3417
  this.focusHandler = () => this.handleFocusLoss();
3475
3418
 
3476
3419
  this.clickHandler = (evt) => {
3477
- const element = this.element;
3478
- if (!element?.bib) {
3479
- return;
3480
- }
3481
-
3482
3420
  // When the bib is fullscreen (modal dialog), don't close on outside
3483
3421
  // clicks. VoiceOver's synthetic click events inside a top-layer modal
3484
3422
  // <dialog> may not include the bib in composedPath(), causing false
3485
3423
  // positives. This mirrors the fullscreen guard in handleFocusLoss().
3486
- if (element.bib.hasAttribute("isfullscreen")) {
3424
+ if (this.element.bib && this.element.bib.hasAttribute("isfullscreen")) {
3487
3425
  return;
3488
3426
  }
3489
3427
 
3490
3428
  if (
3491
- (!evt.composedPath().includes(element.trigger) &&
3492
- !evt.composedPath().includes(element.bib)) ||
3493
- (element.bib.backdrop &&
3494
- evt.composedPath().includes(element.bib.backdrop))
3429
+ (!evt.composedPath().includes(this.element.trigger) &&
3430
+ !evt.composedPath().includes(this.element.bib)) ||
3431
+ (this.element.bib.backdrop &&
3432
+ evt.composedPath().includes(this.element.bib.backdrop))
3495
3433
  ) {
3496
3434
  const existedVisibleFloatingUI =
3497
3435
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
@@ -3512,12 +3450,7 @@ class AuroFloatingUI {
3512
3450
 
3513
3451
  // ESC key handler
3514
3452
  this.keyDownHandler = (evt) => {
3515
- const element = this.element;
3516
- if (!element) {
3517
- return;
3518
- }
3519
-
3520
- if (evt.key === "Escape" && element.isPopoverVisible) {
3453
+ if (evt.key === "Escape" && this.element.isPopoverVisible) {
3521
3454
  const existedVisibleFloatingUI =
3522
3455
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
3523
3456
  if (
@@ -3574,10 +3507,6 @@ class AuroFloatingUI {
3574
3507
  }
3575
3508
 
3576
3509
  updateCurrentExpandedDropdown() {
3577
- if (!this.element) {
3578
- return;
3579
- }
3580
-
3581
3510
  // Close any other dropdown that is already open
3582
3511
  const existedVisibleFloatingUI =
3583
3512
  document.expandedAuroFormkitDropdown || document.expandedAuroFloater;
@@ -3594,34 +3523,25 @@ class AuroFloatingUI {
3594
3523
  }
3595
3524
 
3596
3525
  showBib() {
3597
- const element = this.element;
3598
- if (!element) {
3599
- return;
3600
- }
3601
-
3602
- if (!element.disabled && !this.showing) {
3526
+ if (!this.element.disabled && !this.showing) {
3603
3527
  this.updateCurrentExpandedDropdown();
3604
- element.triggerChevron?.setAttribute("data-expanded", true);
3528
+ this.element.triggerChevron?.setAttribute("data-expanded", true);
3605
3529
 
3606
3530
  // prevent double showing: isPopovervisible gets first and showBib gets called later
3607
3531
  if (!this.showing) {
3608
- if (!element.modal) {
3532
+ if (!this.element.modal) {
3609
3533
  this.setupHideHandlers();
3610
3534
  }
3611
3535
  this.showing = true;
3612
- element.isPopoverVisible = true;
3536
+ this.element.isPopoverVisible = true;
3613
3537
  this.position();
3614
3538
  this.dispatchEventDropdownToggle();
3615
3539
  }
3616
3540
 
3617
- if (!element.bib || (!element.trigger && !element.parentNode)) {
3618
- return;
3619
- }
3620
-
3621
3541
  // Setup auto update to handle resize and scroll
3622
- element.cleanup = autoUpdate(
3623
- element.trigger || element.parentNode,
3624
- element.bib,
3542
+ this.element.cleanup = autoUpdate(
3543
+ this.element.trigger || this.element.parentNode,
3544
+ this.element.bib,
3625
3545
  () => {
3626
3546
  this.position();
3627
3547
  },
@@ -3634,27 +3554,22 @@ class AuroFloatingUI {
3634
3554
  * @param {String} eventType - The event type that triggered the hiding action.
3635
3555
  */
3636
3556
  hideBib(eventType = "unknown") {
3637
- const element = this.element;
3638
- if (!element) {
3639
- return;
3640
- }
3641
-
3642
- if (element.disabled) {
3557
+ if (this.element.disabled) {
3643
3558
  return;
3644
3559
  }
3645
3560
 
3646
3561
  // noToggle dropdowns should not close when the trigger is clicked (the
3647
3562
  // "toggle" behavior), but they CAN still close via other interactions like
3648
3563
  // Escape key or focus loss.
3649
- if (element.noToggle && eventType === "click") {
3564
+ if (this.element.noToggle && eventType === "click") {
3650
3565
  return;
3651
3566
  }
3652
3567
 
3653
3568
  this.lockScroll(false);
3654
- element.triggerChevron?.removeAttribute("data-expanded");
3569
+ this.element.triggerChevron?.removeAttribute("data-expanded");
3655
3570
 
3656
- if (element.isPopoverVisible) {
3657
- element.isPopoverVisible = false;
3571
+ if (this.element.isPopoverVisible) {
3572
+ this.element.isPopoverVisible = false;
3658
3573
  }
3659
3574
  if (this.showing) {
3660
3575
  this.cleanupHideHandlers();
@@ -3674,11 +3589,6 @@ class AuroFloatingUI {
3674
3589
  * @param {String} eventType - The event type that triggered the toggle action.
3675
3590
  */
3676
3591
  dispatchEventDropdownToggle(eventType) {
3677
- const element = this.element;
3678
- if (!element) {
3679
- return;
3680
- }
3681
-
3682
3592
  const event = new CustomEvent(
3683
3593
  this.eventPrefix ? `${this.eventPrefix}-toggled` : "toggled",
3684
3594
  {
@@ -3690,16 +3600,11 @@ class AuroFloatingUI {
3690
3600
  },
3691
3601
  );
3692
3602
 
3693
- element.dispatchEvent(event);
3603
+ this.element.dispatchEvent(event);
3694
3604
  }
3695
3605
 
3696
3606
  handleClick() {
3697
- const element = this.element;
3698
- if (!element) {
3699
- return;
3700
- }
3701
-
3702
- if (element.isPopoverVisible) {
3607
+ if (this.element.isPopoverVisible) {
3703
3608
  this.hideBib("click");
3704
3609
  } else {
3705
3610
  this.showBib();
@@ -3710,66 +3615,63 @@ class AuroFloatingUI {
3710
3615
  {
3711
3616
  composed: true,
3712
3617
  detail: {
3713
- expanded: element.isPopoverVisible,
3618
+ expanded: this.element.isPopoverVisible,
3714
3619
  },
3715
3620
  },
3716
3621
  );
3717
3622
 
3718
- element.dispatchEvent(event);
3623
+ this.element.dispatchEvent(event);
3719
3624
  }
3720
3625
 
3721
3626
  handleEvent(event) {
3722
- const element = this.element;
3723
- if (!element || element.disableEventShow) {
3724
- return;
3725
- }
3726
-
3727
- switch (event.type) {
3728
- case "keydown": {
3729
- // Support both Enter and Space keys for accessibility
3730
- // Space is included as it's expected behavior for interactive elements
3731
-
3732
- const origin = event.composedPath()[0];
3733
- if (
3734
- event.key === "Enter" ||
3735
- (event.key === " " && (!origin || origin.tagName !== "INPUT"))
3736
- ) {
3737
- event.preventDefault();
3738
- this.handleClick();
3627
+ if (!this.element.disableEventShow) {
3628
+ switch (event.type) {
3629
+ case "keydown": {
3630
+ // Support both Enter and Space keys for accessibility
3631
+ // Space is included as it's expected behavior for interactive elements
3632
+
3633
+ const origin = event.composedPath()[0];
3634
+ if (
3635
+ event.key === "Enter" ||
3636
+ (event.key === " " && (!origin || origin.tagName !== "INPUT"))
3637
+ ) {
3638
+ event.preventDefault();
3639
+ this.handleClick();
3640
+ }
3641
+ break;
3739
3642
  }
3740
- break;
3643
+ case "mouseenter":
3644
+ if (this.element.hoverToggle) {
3645
+ this.showBib();
3646
+ }
3647
+ break;
3648
+ case "mouseleave":
3649
+ if (this.element.hoverToggle) {
3650
+ this.hideBib("mouseleave");
3651
+ }
3652
+ break;
3653
+ case "focus":
3654
+ if (this.element.focusShow) {
3655
+ /*
3656
+ This needs to better handle clicking that gives focus -
3657
+ currently it shows and then immediately hides the bib
3658
+ */
3659
+ this.showBib();
3660
+ }
3661
+ break;
3662
+ case "blur":
3663
+ // send this task 100ms later queue to
3664
+ // wait a frame in case focus moves within the floating element/bib
3665
+ setTimeout(() => this.handleFocusLoss(), 0);
3666
+ break;
3667
+ case "click":
3668
+ if (document.activeElement === document.body) {
3669
+ event.currentTarget.focus();
3670
+ }
3671
+ this.handleClick();
3672
+ break;
3673
+ // Do nothing
3741
3674
  }
3742
- case "mouseenter":
3743
- if (element.hoverToggle) {
3744
- this.showBib();
3745
- }
3746
- break;
3747
- case "mouseleave":
3748
- if (element.hoverToggle) {
3749
- this.hideBib("mouseleave");
3750
- }
3751
- break;
3752
- case "focus":
3753
- if (element.focusShow) {
3754
- /*
3755
- This needs to better handle clicking that gives focus -
3756
- currently it shows and then immediately hides the bib
3757
- */
3758
- this.showBib();
3759
- }
3760
- break;
3761
- case "blur":
3762
- // send this task 100ms later queue to
3763
- // wait a frame in case focus moves within the floating element/bib
3764
- setTimeout(() => this.handleFocusLoss(), 0);
3765
- break;
3766
- case "click":
3767
- if (document.activeElement === document.body) {
3768
- event.currentTarget.focus();
3769
- }
3770
- this.handleClick();
3771
- break;
3772
- // Do nothing
3773
3675
  }
3774
3676
  }
3775
3677
 
@@ -3780,11 +3682,6 @@ class AuroFloatingUI {
3780
3682
  * This prevents the component itself from being focusable when the trigger element already handles focus.
3781
3683
  */
3782
3684
  handleTriggerTabIndex() {
3783
- const element = this.element;
3784
- if (!element) {
3785
- return;
3786
- }
3787
-
3788
3685
  const focusableElementSelectors = [
3789
3686
  "a",
3790
3687
  "button",
@@ -3797,7 +3694,7 @@ class AuroFloatingUI {
3797
3694
  "auro-hyperlink",
3798
3695
  ];
3799
3696
 
3800
- const triggerNode = element.querySelectorAll('[slot="trigger"]')[0];
3697
+ const triggerNode = this.element.querySelectorAll('[slot="trigger"]')[0];
3801
3698
  if (!triggerNode) {
3802
3699
  return;
3803
3700
  }
@@ -3806,13 +3703,13 @@ class AuroFloatingUI {
3806
3703
  focusableElementSelectors.forEach((selector) => {
3807
3704
  // Check if the trigger node element is focusable
3808
3705
  if (triggerNodeTagName === selector) {
3809
- element.tabIndex = -1;
3706
+ this.element.tabIndex = -1;
3810
3707
  return;
3811
3708
  }
3812
3709
 
3813
3710
  // Check if any child is focusable
3814
3711
  if (triggerNode.querySelector(selector)) {
3815
- element.tabIndex = -1;
3712
+ this.element.tabIndex = -1;
3816
3713
  }
3817
3714
  });
3818
3715
  }
@@ -3822,18 +3719,13 @@ class AuroFloatingUI {
3822
3719
  * @param {*} eventPrefix
3823
3720
  */
3824
3721
  regenerateBibId() {
3825
- const element = this.element;
3826
- if (!element) {
3827
- return;
3828
- }
3829
-
3830
- this.id = element.getAttribute("id");
3722
+ this.id = this.element.getAttribute("id");
3831
3723
  if (!this.id) {
3832
3724
  this.id = window.crypto.randomUUID();
3833
- element.setAttribute("id", this.id);
3725
+ this.element.setAttribute("id", this.id);
3834
3726
  }
3835
3727
 
3836
- element.bib?.setAttribute("id", `${this.id}-floater-bib`);
3728
+ this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
3837
3729
  }
3838
3730
 
3839
3731
  configure(elem, eventPrefix, enableKeyboardHandling = true) {
@@ -3845,69 +3737,67 @@ class AuroFloatingUI {
3845
3737
  this.element = elem;
3846
3738
  }
3847
3739
 
3848
- const element = this.element;
3849
- if (!element) {
3850
- return;
3740
+ if (this.behavior !== this.element.behavior) {
3741
+ this.behavior = this.element.behavior;
3851
3742
  }
3852
3743
 
3853
- if (this.behavior !== element.behavior) {
3854
- this.behavior = element.behavior;
3855
- }
3856
-
3857
- if (element.trigger) {
3744
+ if (this.element.trigger) {
3858
3745
  this.disconnect();
3859
3746
  }
3860
- element.trigger =
3861
- element.triggerElement ||
3862
- element.shadowRoot?.querySelector("#trigger") ||
3863
- element.trigger;
3864
- element.bib = element.shadowRoot?.querySelector("#bib") || element.bib;
3865
- element.bibSizer = element.shadowRoot?.querySelector("#bibSizer");
3866
- element.triggerChevron =
3867
- element.shadowRoot?.querySelector("#showStateIcon");
3747
+ this.element.trigger =
3748
+ this.element.triggerElement ||
3749
+ this.element.shadowRoot.querySelector("#trigger") ||
3750
+ this.element.trigger;
3751
+ this.element.bib =
3752
+ this.element.shadowRoot.querySelector("#bib") || this.element.bib;
3753
+ this.element.bibSizer = this.element.shadowRoot.querySelector("#bibSizer");
3754
+ this.element.triggerChevron =
3755
+ this.element.shadowRoot.querySelector("#showStateIcon");
3868
3756
 
3869
- if (element.floaterConfig) {
3870
- element.hoverToggle = element.floaterConfig.hoverToggle;
3757
+ if (this.element.floaterConfig) {
3758
+ this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
3871
3759
  }
3872
3760
 
3873
3761
  this.regenerateBibId();
3874
3762
  this.handleTriggerTabIndex();
3875
3763
 
3876
3764
  this.handleEvent = this.handleEvent.bind(this);
3877
- if (element.trigger) {
3765
+ if (this.element.trigger) {
3878
3766
  if (this.enableKeyboardHandling) {
3879
- element.trigger.addEventListener("keydown", this.handleEvent);
3767
+ this.element.trigger.addEventListener("keydown", this.handleEvent);
3880
3768
  }
3881
- element.trigger.addEventListener("click", this.handleEvent);
3882
- element.trigger.addEventListener("mouseenter", this.handleEvent);
3883
- element.trigger.addEventListener("mouseleave", this.handleEvent);
3884
- element.trigger.addEventListener("focus", this.handleEvent);
3885
- element.trigger.addEventListener("blur", this.handleEvent);
3769
+ this.element.trigger.addEventListener("click", this.handleEvent);
3770
+ this.element.trigger.addEventListener("mouseenter", this.handleEvent);
3771
+ this.element.trigger.addEventListener("mouseleave", this.handleEvent);
3772
+ this.element.trigger.addEventListener("focus", this.handleEvent);
3773
+ this.element.trigger.addEventListener("blur", this.handleEvent);
3886
3774
  }
3887
3775
  }
3888
3776
 
3889
3777
  disconnect() {
3890
3778
  this.cleanupHideHandlers();
3779
+ if (this.element) {
3780
+ this.element.cleanup?.();
3891
3781
 
3892
- const element = this.element;
3893
- if (!element) {
3894
- return;
3895
- }
3896
-
3897
- element.cleanup?.();
3898
-
3899
- if (element.bib && element.shadowRoot) {
3900
- element.shadowRoot.append(element.bib);
3901
- }
3782
+ if (this.element.bib) {
3783
+ this.element.shadowRoot.append(this.element.bib);
3784
+ }
3902
3785
 
3903
- // Remove event & keyboard listeners
3904
- if (element.trigger) {
3905
- element.trigger.removeEventListener("keydown", this.handleEvent);
3906
- element.trigger.removeEventListener("click", this.handleEvent);
3907
- element.trigger.removeEventListener("mouseenter", this.handleEvent);
3908
- element.trigger.removeEventListener("mouseleave", this.handleEvent);
3909
- element.trigger.removeEventListener("focus", this.handleEvent);
3910
- element.trigger.removeEventListener("blur", this.handleEvent);
3786
+ // Remove event & keyboard listeners
3787
+ if (this.element?.trigger) {
3788
+ this.element.trigger.removeEventListener("keydown", this.handleEvent);
3789
+ this.element.trigger.removeEventListener("click", this.handleEvent);
3790
+ this.element.trigger.removeEventListener(
3791
+ "mouseenter",
3792
+ this.handleEvent,
3793
+ );
3794
+ this.element.trigger.removeEventListener(
3795
+ "mouseleave",
3796
+ this.handleEvent,
3797
+ );
3798
+ this.element.trigger.removeEventListener("focus", this.handleEvent);
3799
+ this.element.trigger.removeEventListener("blur", this.handleEvent);
3800
+ }
3911
3801
  }
3912
3802
  }
3913
3803
  }
@@ -5035,7 +4925,7 @@ let AuroHelpText$2 = class AuroHelpText extends LitElement {
5035
4925
  }
5036
4926
  };
5037
4927
 
5038
- var formkitVersion$2 = '202604070549';
4928
+ var formkitVersion$2 = '202604071525';
5039
4929
 
5040
4930
  let AuroElement$2 = class AuroElement extends LitElement {
5041
4931
  static get properties() {
@@ -12792,7 +12682,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
12792
12682
  }
12793
12683
  };
12794
12684
 
12795
- var formkitVersion$1 = '202604070549';
12685
+ var formkitVersion$1 = '202604071525';
12796
12686
 
12797
12687
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
12798
12688
  // See LICENSE in the project root for license information.
@@ -13857,7 +13747,7 @@ class AuroBibtemplate extends LitElement {
13857
13747
  }
13858
13748
  }
13859
13749
 
13860
- var formkitVersion = '202604070549';
13750
+ var formkitVersion = '202604071525';
13861
13751
 
13862
13752
  var styleCss$1 = css`.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}`;
13863
13753