@aurodesignsystem-dev/auro-formkit 0.0.0-pr1408.9 → 0.0.0-pr1411.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkbox/demo/api.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/demo/keyboardBehavior.md +0 -0
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/api.min.js +138 -142
- package/components/combobox/demo/index.min.js +138 -142
- package/components/combobox/demo/keyboardBehavior.html +1 -0
- package/components/combobox/demo/keyboardBehavior.md +20 -21
- package/components/combobox/dist/index.js +104 -115
- package/components/combobox/dist/registered.js +104 -115
- package/components/counter/demo/api.md +1 -1
- package/components/counter/demo/api.min.js +201 -146
- package/components/counter/demo/index.min.js +201 -146
- package/components/counter/demo/keyboardBehavior.html +1 -0
- package/components/counter/demo/keyboardBehavior.md +1 -1
- package/components/counter/dist/auro-counter.d.ts +11 -8
- package/components/counter/dist/index.js +201 -146
- package/components/counter/dist/keyboardStrategy.d.ts +4 -0
- package/components/counter/dist/registered.js +201 -146
- package/components/datepicker/demo/api.min.js +106 -118
- package/components/datepicker/demo/index.min.js +106 -118
- package/components/datepicker/demo/keyboardBehavior.html +1 -0
- package/components/datepicker/demo/keyboardBehavior.md +14 -13
- package/components/datepicker/dist/index.js +101 -113
- package/components/datepicker/dist/registered.js +101 -113
- package/components/dropdown/demo/api.md +29 -29
- package/components/dropdown/demo/api.min.js +116 -121
- package/components/dropdown/demo/index.md +2 -2
- package/components/dropdown/demo/index.min.js +116 -121
- package/components/dropdown/demo/keyboardBehavior.html +1 -0
- package/components/dropdown/dist/auro-dropdown.d.ts +3 -3
- package/components/dropdown/dist/auro-dropdownBib.d.ts +1 -40
- package/components/dropdown/dist/dropdownBibKeyboardStrategy.d.ts +7 -0
- package/components/dropdown/dist/index.js +100 -109
- package/components/dropdown/dist/registered.js +100 -109
- package/components/form/demo/api.min.js +625 -546
- package/components/form/demo/index.min.js +625 -546
- package/components/form/demo/keyboardBehavior.md +0 -0
- package/components/input/demo/api.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/demo/keyboardBehavior.md +0 -0
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/demo/api.min.js +34 -27
- package/components/menu/demo/index.min.js +34 -27
- package/components/menu/dist/auro-menu.d.ts +0 -6
- package/components/menu/dist/index.js +34 -27
- package/components/menu/dist/registered.js +34 -27
- 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 +213 -166
- package/components/select/demo/index.min.js +213 -166
- package/components/select/demo/keyboardBehavior.html +1 -0
- package/components/select/demo/keyboardBehavior.md +240 -239
- package/components/select/dist/index.js +179 -139
- package/components/select/dist/registered.js +179 -139
- package/components/select/dist/selectKeyboardStrategy.d.ts +5 -2
- package/custom-elements.json +1526 -1489
- package/package.json +8 -6
|
@@ -1165,7 +1165,7 @@ function restoreTriggerAfterClose(dropdown, focusTarget) {
|
|
|
1165
1165
|
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
1166
1166
|
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
1167
1167
|
*/
|
|
1168
|
-
function createDisplayContext(component, options = {}) {
|
|
1168
|
+
function createDisplayContext$1(component, options = {}) {
|
|
1169
1169
|
const dd = options.dropdown || component.dropdown;
|
|
1170
1170
|
// isPopoverVisible reflects as the `open` attribute.
|
|
1171
1171
|
// It reports whether the bib is open in any mode (popover or modal).
|
|
@@ -1195,11 +1195,11 @@ function createDisplayContext(component, options = {}) {
|
|
|
1195
1195
|
* @param {Object} strategy - Map of key names to handler functions.
|
|
1196
1196
|
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
1197
1197
|
*/
|
|
1198
|
-
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
1198
|
+
function applyKeyboardStrategy$1(component, strategy, options = {}) {
|
|
1199
1199
|
component.addEventListener('keydown', async (evt) => {
|
|
1200
1200
|
const handler = strategy[evt.key] || strategy.default;
|
|
1201
1201
|
if (typeof handler === 'function') {
|
|
1202
|
-
const ctx = createDisplayContext(component, options);
|
|
1202
|
+
const ctx = createDisplayContext$1(component, options);
|
|
1203
1203
|
await handler(component, evt, ctx);
|
|
1204
1204
|
}
|
|
1205
1205
|
});
|
|
@@ -3195,6 +3195,11 @@ class AuroFloatingUI {
|
|
|
3195
3195
|
this.clickHandler = null;
|
|
3196
3196
|
this.keyDownHandler = null;
|
|
3197
3197
|
|
|
3198
|
+
/**
|
|
3199
|
+
* @private
|
|
3200
|
+
*/
|
|
3201
|
+
this.enableKeyboardHandling = true;
|
|
3202
|
+
|
|
3198
3203
|
/**
|
|
3199
3204
|
* @private
|
|
3200
3205
|
*/
|
|
@@ -3455,11 +3460,10 @@ class AuroFloatingUI {
|
|
|
3455
3460
|
return;
|
|
3456
3461
|
}
|
|
3457
3462
|
|
|
3458
|
-
const { activeElement } = document;
|
|
3459
3463
|
// if focus is still inside of trigger or bib, do not close
|
|
3460
3464
|
if (
|
|
3461
|
-
this.element.
|
|
3462
|
-
this.element.
|
|
3465
|
+
this.element.matches(":focus") ||
|
|
3466
|
+
this.element.matches(":focus-within")
|
|
3463
3467
|
) {
|
|
3464
3468
|
return;
|
|
3465
3469
|
}
|
|
@@ -3530,7 +3534,9 @@ class AuroFloatingUI {
|
|
|
3530
3534
|
document.addEventListener("focusin", this.focusHandler);
|
|
3531
3535
|
}
|
|
3532
3536
|
|
|
3533
|
-
|
|
3537
|
+
if (this.enableKeyboardHandling) {
|
|
3538
|
+
document.addEventListener("keydown", this.keyDownHandler);
|
|
3539
|
+
}
|
|
3534
3540
|
|
|
3535
3541
|
// send this task to the end of queue to prevent conflicting
|
|
3536
3542
|
// it conflicts if showBib gets call from a button that's not this.element.trigger
|
|
@@ -3786,8 +3792,9 @@ class AuroFloatingUI {
|
|
|
3786
3792
|
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
3787
3793
|
}
|
|
3788
3794
|
|
|
3789
|
-
configure(elem, eventPrefix) {
|
|
3795
|
+
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
3790
3796
|
AuroFloatingUI.setupMousePressChecker();
|
|
3797
|
+
this.enableKeyboardHandling = enableKeyboardHandling;
|
|
3791
3798
|
|
|
3792
3799
|
this.eventPrefix = eventPrefix;
|
|
3793
3800
|
if (this.element !== elem) {
|
|
@@ -3820,7 +3827,9 @@ class AuroFloatingUI {
|
|
|
3820
3827
|
|
|
3821
3828
|
this.handleEvent = this.handleEvent.bind(this);
|
|
3822
3829
|
if (this.element.trigger) {
|
|
3823
|
-
|
|
3830
|
+
if (this.enableKeyboardHandling) {
|
|
3831
|
+
this.element.trigger.addEventListener("keydown", this.handleEvent);
|
|
3832
|
+
}
|
|
3824
3833
|
this.element.trigger.addEventListener("click", this.handleEvent);
|
|
3825
3834
|
this.element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
3826
3835
|
this.element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
@@ -4298,12 +4307,83 @@ let p$4 = class p{registerComponent(t,a){customElements.get(t)||customElements.d
|
|
|
4298
4307
|
|
|
4299
4308
|
var iconVersion$3 = '9.1.2';
|
|
4300
4309
|
|
|
4310
|
+
/**
|
|
4311
|
+
* Computes display state once per keydown event.
|
|
4312
|
+
* Centralizes null-safety checks and makes the shared/modal/popover branching explicit.
|
|
4313
|
+
*
|
|
4314
|
+
* @param {HTMLElement} component - The component with a dropdown reference.
|
|
4315
|
+
* @param {Object} [options] - Optional config.
|
|
4316
|
+
* @param {HTMLElement} [options.dropdown] - Explicit dropdown reference. Falls back to component.dropdown.
|
|
4317
|
+
* @param {Function} [options.inputResolver] - Called with (component, ctx) to resolve the active input element.
|
|
4318
|
+
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
4319
|
+
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
4320
|
+
*/
|
|
4321
|
+
function createDisplayContext(component, options = {}) {
|
|
4322
|
+
const dd = options.dropdown || component.dropdown;
|
|
4323
|
+
// isPopoverVisible reflects as the `open` attribute.
|
|
4324
|
+
// It reports whether the bib is open in any mode (popover or modal).
|
|
4325
|
+
const isExpanded = Boolean(dd && dd.isPopoverVisible);
|
|
4326
|
+
const isFullscreen = Boolean(dd && dd.isBibFullscreen);
|
|
4327
|
+
|
|
4328
|
+
const ctx = {
|
|
4329
|
+
isExpanded,
|
|
4330
|
+
isModal: isFullscreen,
|
|
4331
|
+
isPopover: !isFullscreen,
|
|
4332
|
+
activeInput: null,
|
|
4333
|
+
};
|
|
4334
|
+
|
|
4335
|
+
if (options.inputResolver) {
|
|
4336
|
+
const resolvedInput = options.inputResolver(component, ctx);
|
|
4337
|
+
// Guard against resolvers returning undefined or non-HTMLElement values.
|
|
4338
|
+
ctx.activeInput = resolvedInput instanceof HTMLElement ? resolvedInput : null;
|
|
4339
|
+
}
|
|
4340
|
+
|
|
4341
|
+
return ctx;
|
|
4342
|
+
}
|
|
4343
|
+
|
|
4344
|
+
/**
|
|
4345
|
+
* Wires up a keydown listener that dispatches to strategy[evt.key] or strategy.default.
|
|
4346
|
+
* Handles both sync and async handlers.
|
|
4347
|
+
* @param {HTMLElement} component - The component to attach the listener to.
|
|
4348
|
+
* @param {Object} strategy - Map of key names to handler functions.
|
|
4349
|
+
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
4350
|
+
*/
|
|
4351
|
+
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
4352
|
+
component.addEventListener('keydown', async (evt) => {
|
|
4353
|
+
const handler = strategy[evt.key] || strategy.default;
|
|
4354
|
+
if (typeof handler === 'function') {
|
|
4355
|
+
const ctx = createDisplayContext(component, options);
|
|
4356
|
+
await handler(component, evt, ctx);
|
|
4357
|
+
}
|
|
4358
|
+
});
|
|
4359
|
+
}
|
|
4360
|
+
|
|
4301
4361
|
var styleCss$2$1 = i$7`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
|
|
4302
4362
|
|
|
4303
4363
|
var colorCss$2$1 = i$7`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
4304
4364
|
|
|
4305
4365
|
var tokensCss$1$2 = i$7`:host(:not([ondark])),:host(:not([appearance=inverse])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-hover-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]),:host([appearance=inverse]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-hover-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
|
|
4306
4366
|
|
|
4367
|
+
/**
|
|
4368
|
+
* Creates a keyboard strategy for dialog-specific key handling.
|
|
4369
|
+
* All other keydown behavior is left to the browser's native bubbling path.
|
|
4370
|
+
* @param {HTMLElement} bib - The dropdown bib element.
|
|
4371
|
+
* @returns {Object} Keyboard handlers keyed by `event.key`.
|
|
4372
|
+
*/
|
|
4373
|
+
// eslint-disable-next-line no-unused-vars
|
|
4374
|
+
function createDropdownBibKeyboardStrategy(bib) {
|
|
4375
|
+
return {
|
|
4376
|
+
// eslint-disable-next-line no-unused-vars
|
|
4377
|
+
Enter(_dialog, event) {
|
|
4378
|
+
// Floating UI handles Enter key to open the dropdown
|
|
4379
|
+
},
|
|
4380
|
+
// eslint-disable-next-line no-unused-vars
|
|
4381
|
+
Escape(_dialog, event) {
|
|
4382
|
+
// Floating UI handles Escape key to close the dropdown
|
|
4383
|
+
}
|
|
4384
|
+
};
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4307
4387
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
4308
4388
|
// See LICENSE in the project root for license information.
|
|
4309
4389
|
/* eslint-disable max-lines */
|
|
@@ -4428,11 +4508,7 @@ class AuroDropdownBib extends i$4 {
|
|
|
4428
4508
|
},
|
|
4429
4509
|
|
|
4430
4510
|
/**
|
|
4431
|
-
*
|
|
4432
|
-
* aria-activedescendant. The dialog keyboard bridge checks this
|
|
4433
|
-
* flag so that Enter selects the highlighted option instead of
|
|
4434
|
-
* activating the focused interactive element (e.g. the trigger
|
|
4435
|
-
* button, or the bibtemplate close button in fullscreen).
|
|
4511
|
+
* Tracks whether a menu option is currently highlighted.
|
|
4436
4512
|
* @private
|
|
4437
4513
|
*/
|
|
4438
4514
|
hasActiveDescendant: {
|
|
@@ -4506,7 +4582,7 @@ class AuroDropdownBib extends i$4 {
|
|
|
4506
4582
|
|
|
4507
4583
|
const dialog = this.shadowRoot.querySelector('dialog');
|
|
4508
4584
|
this._setupCancelHandler(dialog);
|
|
4509
|
-
|
|
4585
|
+
applyKeyboardStrategy(dialog, createDropdownBibKeyboardStrategy());
|
|
4510
4586
|
|
|
4511
4587
|
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
4512
4588
|
bubbles: true,
|
|
@@ -4533,92 +4609,6 @@ class AuroDropdownBib extends i$4 {
|
|
|
4533
4609
|
});
|
|
4534
4610
|
}
|
|
4535
4611
|
|
|
4536
|
-
/**
|
|
4537
|
-
* showModal() creates a closed focus scope — keyboard events inside
|
|
4538
|
-
* the dialog's shadow DOM do NOT bubble out to the combobox/select
|
|
4539
|
-
* keydown handlers in the parent shadow DOM. This handler bridges
|
|
4540
|
-
* that gap by re-dispatching navigation keys so they cross the
|
|
4541
|
-
* shadow boundary and reach the menu navigation logic in the parent
|
|
4542
|
-
* component.
|
|
4543
|
-
*
|
|
4544
|
-
* The trade-off: intercepting these keys means native keyboard
|
|
4545
|
-
* behaviors that would normally "just work" must be manually
|
|
4546
|
-
* re-implemented here:
|
|
4547
|
-
*
|
|
4548
|
-
* - Enter on buttons: Custom elements (auro-button) don't get the
|
|
4549
|
-
* native Enter→click that <button> provides, so we call .click()
|
|
4550
|
-
* directly when Enter is pressed on a button-like element.
|
|
4551
|
-
*
|
|
4552
|
-
* - Tab: Intercepted and re-dispatched so parent components
|
|
4553
|
-
* (select/combobox) can select the active option and close the
|
|
4554
|
-
* dialog. The <dialog> provides containment and isolation
|
|
4555
|
-
* (inert background, VoiceOver focus trapping, top layer), while
|
|
4556
|
-
* the content inside is a role="listbox" navigated via
|
|
4557
|
-
* aria-activedescendant (options are not focusable). Tab keyboard
|
|
4558
|
-
* behavior follows listbox conventions (select + close) because
|
|
4559
|
-
* the dialog's native Tab trap only cycles between the close
|
|
4560
|
-
* button and browser chrome.
|
|
4561
|
-
*
|
|
4562
|
-
* - Escape: The native <dialog> fires a `cancel` event on ESC
|
|
4563
|
-
* (handled by _setupCancelHandler), so the re-dispatched Escape
|
|
4564
|
-
* is a secondary path for parent components that also listen for
|
|
4565
|
-
* Escape keydown.
|
|
4566
|
-
*
|
|
4567
|
-
* @param {HTMLDialogElement} dialog - The dialog element to attach the keyboard bridge to.
|
|
4568
|
-
* @private
|
|
4569
|
-
*/
|
|
4570
|
-
_setupKeyboardBridge(dialog) {
|
|
4571
|
-
const navKeys = new Set([
|
|
4572
|
-
'ArrowUp',
|
|
4573
|
-
'ArrowDown',
|
|
4574
|
-
'Enter',
|
|
4575
|
-
'Escape',
|
|
4576
|
-
'Tab'
|
|
4577
|
-
]);
|
|
4578
|
-
|
|
4579
|
-
dialog.addEventListener('keydown', (event) => {
|
|
4580
|
-
if (!navKeys.has(event.key)) {
|
|
4581
|
-
return;
|
|
4582
|
-
}
|
|
4583
|
-
|
|
4584
|
-
// Custom elements (auro-button) don't get the native Enter→click
|
|
4585
|
-
// behavior that <button> has. Find the button in the composed path
|
|
4586
|
-
// and click it directly — but only when no menu option is
|
|
4587
|
-
// highlighted. In fullscreen mode focus stays on the close button
|
|
4588
|
-
// while arrow keys move the active-descendant highlight through
|
|
4589
|
-
// the listbox. If the user presses Enter with an option
|
|
4590
|
-
// highlighted, the intent is to select that option, not to click
|
|
4591
|
-
// the close button. In that case we fall through and bridge the
|
|
4592
|
-
// Enter key to the parent component's keyboard strategy.
|
|
4593
|
-
if (event.key === 'Enter') {
|
|
4594
|
-
if (!this.hasActiveDescendant) {
|
|
4595
|
-
const buttonSelector = 'button, [role="button"], auro-button, [auro-button]';
|
|
4596
|
-
const btn = event.composedPath().find((el) => el.matches && el.matches(buttonSelector));
|
|
4597
|
-
if (btn) {
|
|
4598
|
-
event.preventDefault();
|
|
4599
|
-
event.stopPropagation();
|
|
4600
|
-
btn.click();
|
|
4601
|
-
return;
|
|
4602
|
-
}
|
|
4603
|
-
}
|
|
4604
|
-
}
|
|
4605
|
-
|
|
4606
|
-
event.preventDefault();
|
|
4607
|
-
event.stopPropagation();
|
|
4608
|
-
const newEvent = new KeyboardEvent('keydown', {
|
|
4609
|
-
key: event.key,
|
|
4610
|
-
code: event.code,
|
|
4611
|
-
shiftKey: event.shiftKey,
|
|
4612
|
-
altKey: event.altKey,
|
|
4613
|
-
ctrlKey: event.ctrlKey,
|
|
4614
|
-
metaKey: event.metaKey,
|
|
4615
|
-
bubbles: true,
|
|
4616
|
-
composed: true,
|
|
4617
|
-
cancelable: true
|
|
4618
|
-
});
|
|
4619
|
-
this.dispatchEvent(newEvent);
|
|
4620
|
-
});
|
|
4621
|
-
}
|
|
4622
4612
|
|
|
4623
4613
|
/**
|
|
4624
4614
|
* Blocks touch-driven page scroll while a fullscreen modal dialog is open.
|
|
@@ -4993,7 +4983,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
|
|
|
4993
4983
|
}
|
|
4994
4984
|
};
|
|
4995
4985
|
|
|
4996
|
-
var formkitVersion$2 = '
|
|
4986
|
+
var formkitVersion$2 = '202604021632';
|
|
4997
4987
|
|
|
4998
4988
|
let AuroElement$2 = class AuroElement extends i$4 {
|
|
4999
4989
|
static get properties() {
|
|
@@ -5174,7 +5164,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5174
5164
|
this.appearance = 'default';
|
|
5175
5165
|
this.chevron = false;
|
|
5176
5166
|
this.disabled = false;
|
|
5177
|
-
this.
|
|
5167
|
+
this.disableKeyboardHandling = false;
|
|
5178
5168
|
this.error = false;
|
|
5179
5169
|
this.tabIndex = 0;
|
|
5180
5170
|
this.noToggle = false;
|
|
@@ -5272,9 +5262,8 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5272
5262
|
// showModal() fires asynchronously via Lit's update cycle, which
|
|
5273
5263
|
// falls outside the user activation window and causes iOS to
|
|
5274
5264
|
// dismiss the keyboard.
|
|
5275
|
-
if (this.
|
|
5276
|
-
|
|
5277
|
-
this.bibElement.value.open(useModal);
|
|
5265
|
+
if (this.bibElement && this.bibElement.value) {
|
|
5266
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
5278
5267
|
}
|
|
5279
5268
|
}
|
|
5280
5269
|
|
|
@@ -5388,9 +5377,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5388
5377
|
},
|
|
5389
5378
|
|
|
5390
5379
|
/**
|
|
5391
|
-
* If declared, the
|
|
5380
|
+
* If declared, the dropdown will not handle keyboard events and will require the consumer to manage this behavior.
|
|
5392
5381
|
*/
|
|
5393
|
-
|
|
5382
|
+
disableKeyboardHandling: {
|
|
5394
5383
|
type: Boolean,
|
|
5395
5384
|
reflect: true
|
|
5396
5385
|
},
|
|
@@ -5668,7 +5657,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5668
5657
|
if (this.isPopoverVisible) {
|
|
5669
5658
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
5670
5659
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
5671
|
-
const useModal = this.isBibFullscreen
|
|
5660
|
+
const useModal = this.isBibFullscreen;
|
|
5672
5661
|
this.bibElement.value.open(useModal);
|
|
5673
5662
|
} else {
|
|
5674
5663
|
this.bibElement.value.close();
|
|
@@ -5678,7 +5667,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5678
5667
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
5679
5668
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
5680
5669
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
5681
|
-
const useModal = this.isBibFullscreen
|
|
5670
|
+
const useModal = this.isBibFullscreen;
|
|
5682
5671
|
this.bibElement.value.close();
|
|
5683
5672
|
this.bibElement.value.open(useModal);
|
|
5684
5673
|
}
|
|
@@ -5700,7 +5689,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5700
5689
|
|
|
5701
5690
|
firstUpdated() {
|
|
5702
5691
|
// Configure the floater to, this will generate the ID for the bib
|
|
5703
|
-
this.floater.configure(this, 'auroDropdown');
|
|
5692
|
+
this.floater.configure(this, 'auroDropdown', !this.disableKeyboardHandling);
|
|
5704
5693
|
|
|
5705
5694
|
// Prevent `contain: layout` on the dropdown host. Layout containment
|
|
5706
5695
|
// creates a containing block for position:fixed descendants (the bib),
|
|
@@ -5790,7 +5779,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5790
5779
|
* @private
|
|
5791
5780
|
*/
|
|
5792
5781
|
updateFocusTrap() {
|
|
5793
|
-
if (this.isPopoverVisible
|
|
5782
|
+
if (this.isPopoverVisible) {
|
|
5794
5783
|
if (!this.isBibFullscreen) {
|
|
5795
5784
|
// Desktop: show() doesn't trap focus, so use FocusTrap
|
|
5796
5785
|
this.focusTrap = new FocusTrap(this.bibContent);
|
|
@@ -12757,7 +12746,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
|
|
|
12757
12746
|
}
|
|
12758
12747
|
};
|
|
12759
12748
|
|
|
12760
|
-
var formkitVersion$1 = '
|
|
12749
|
+
var formkitVersion$1 = '202604021632';
|
|
12761
12750
|
|
|
12762
12751
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12763
12752
|
// See LICENSE in the project root for license information.
|
|
@@ -13796,7 +13785,7 @@ class AuroBibtemplate extends i$4 {
|
|
|
13796
13785
|
}
|
|
13797
13786
|
}
|
|
13798
13787
|
|
|
13799
|
-
var formkitVersion = '
|
|
13788
|
+
var formkitVersion = '202604021632';
|
|
13800
13789
|
|
|
13801
13790
|
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}`;
|
|
13802
13791
|
|
|
@@ -15290,7 +15279,7 @@ class AuroCombobox extends AuroElement {
|
|
|
15290
15279
|
* @returns {void}
|
|
15291
15280
|
*/
|
|
15292
15281
|
configureCombobox() {
|
|
15293
|
-
applyKeyboardStrategy(this, comboboxKeyboardStrategy, {
|
|
15282
|
+
applyKeyboardStrategy$1(this, comboboxKeyboardStrategy, {
|
|
15294
15283
|
// In modal mode the input moves into the bib; route keyboard events to that element instead.
|
|
15295
15284
|
inputResolver: (comp, ctx) => (ctx.isModal && comp.inputInBib ? comp.inputInBib : comp.input),
|
|
15296
15285
|
});
|
|
@@ -16299,7 +16288,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
16299
16288
|
});
|
|
16300
16289
|
|
|
16301
16290
|
return u$7`
|
|
16302
|
-
<div class="${classes}">
|
|
16291
|
+
<div class="${classes}" aria-disabled="${this.disabled ? 'true' : 'false'}">
|
|
16303
16292
|
${this.selected && !this.noCheckmark
|
|
16304
16293
|
? this.generateIconHtml(checkmarkIcon.svg)
|
|
16305
16294
|
: undefined}
|
|
@@ -17070,10 +17059,10 @@ class AuroMenu extends AuroElement {
|
|
|
17070
17059
|
|
|
17071
17060
|
// Event Bindings
|
|
17072
17061
|
|
|
17073
|
-
/**
|
|
17074
|
-
|
|
17075
|
-
|
|
17076
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
17062
|
+
// /**
|
|
17063
|
+
// * @private
|
|
17064
|
+
// */
|
|
17065
|
+
// this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
17077
17066
|
|
|
17078
17067
|
|
|
17079
17068
|
/**
|
|
@@ -17422,7 +17411,7 @@ class AuroMenu extends AuroElement {
|
|
|
17422
17411
|
|
|
17423
17412
|
this.provideContext();
|
|
17424
17413
|
|
|
17425
|
-
this.addEventListener('keydown', this.handleKeyDown);
|
|
17414
|
+
// this.addEventListener('keydown', this.handleKeyDown);
|
|
17426
17415
|
this.addEventListener('auroMenuOption-click', this.handleMouseSelect);
|
|
17427
17416
|
this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
17428
17417
|
this.addEventListener('slotchange', this.handleSlotChange);
|
|
@@ -17430,7 +17419,7 @@ class AuroMenu extends AuroElement {
|
|
|
17430
17419
|
}
|
|
17431
17420
|
|
|
17432
17421
|
disconnectedCallback() {
|
|
17433
|
-
this.removeEventListener('keydown', this.handleKeyDown);
|
|
17422
|
+
// this.removeEventListener('keydown', this.handleKeyDown);
|
|
17434
17423
|
this.removeEventListener('auroMenuOption-click', this.handleMouseSelect);
|
|
17435
17424
|
this.removeEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
17436
17425
|
this.removeEventListener('slotchange', this.handleSlotChange);
|
|
@@ -17571,26 +17560,33 @@ class AuroMenu extends AuroElement {
|
|
|
17571
17560
|
|
|
17572
17561
|
// Event Handlers
|
|
17573
17562
|
|
|
17574
|
-
/**
|
|
17575
|
-
|
|
17576
|
-
|
|
17577
|
-
|
|
17578
|
-
|
|
17579
|
-
handleKeyDown(event) {
|
|
17580
|
-
|
|
17581
|
-
|
|
17582
|
-
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
|
|
17588
|
-
|
|
17589
|
-
|
|
17590
|
-
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17563
|
+
// /**
|
|
17564
|
+
// * Handles keyboard navigation.
|
|
17565
|
+
// * @private
|
|
17566
|
+
// * @param {KeyboardEvent} event - Event object from the browser.
|
|
17567
|
+
// */
|
|
17568
|
+
// handleKeyDown(event) {
|
|
17569
|
+
// // Update to Chris keyboard handler
|
|
17570
|
+
// // We have a new "navigateArrow" function in that handler, maybe that replaces those keys here?
|
|
17571
|
+
// event.preventDefault();
|
|
17572
|
+
// switch (event.key) {
|
|
17573
|
+
// case "ArrowDown":
|
|
17574
|
+
// console.warn("ArrowDown key is pressed and heard from menu");
|
|
17575
|
+
// this.menuService.highlightNext();
|
|
17576
|
+
// break;
|
|
17577
|
+
// case "ArrowUp":
|
|
17578
|
+
// console.warn("ArrowUp key is pressed and heard from menu");
|
|
17579
|
+
// this.menuService.highlightPrevious();
|
|
17580
|
+
// break;
|
|
17581
|
+
// case "Tab":
|
|
17582
|
+
// case "Enter":
|
|
17583
|
+
// this.menuService.selectHighlightedOption();
|
|
17584
|
+
// // Does this need to get separated into two cases to handle the different expected behavior of tab vs enter?
|
|
17585
|
+
// break;
|
|
17586
|
+
// default:
|
|
17587
|
+
// break;
|
|
17588
|
+
// }
|
|
17589
|
+
// }
|
|
17594
17590
|
|
|
17595
17591
|
/**
|
|
17596
17592
|
* Navigates the menu options in the specified direction.
|
|
@@ -76,5 +76,6 @@
|
|
|
76
76
|
|
|
77
77
|
<!-- If additional elements are needed for the demo, add them here. -->
|
|
78
78
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
79
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
79
80
|
</body>
|
|
80
81
|
</html>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<li><strong>Input</strong></li>
|
|
9
9
|
<li><strong>Clear button:</strong> only shown when the input has a value.</li>
|
|
10
10
|
</ol>
|
|
11
|
-
<p>Each focusable element <em>(when shown)</em> participates in the browser
|
|
11
|
+
<p>Each focusable element <em>(when shown)</em> participates in the browser window's default <code>tabindex</code> sequence.</p>
|
|
12
12
|
<p>When the component is <code>disabled</code> it is removed from the <code>tabindex</code> sequence. VoiceOver's virtual cursor <em>(swipe navigation)</em> can still encounter the component, but standard keyboard <code>Tab</code> navigation skips it.</p>
|
|
13
13
|
<p>On <strong>large viewport devices</strong> (e.g., desktop browser, tablet) there is no focusable content inside the component bib.</p>
|
|
14
14
|
<p>On <strong>small viewport devices</strong> (e.g., phone) the bib opens a modal dialog with a focusable <strong>input</strong> and <strong>clear button</strong> which may be tabbed through naturally.</p>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/keyEvents.md) -->
|
|
17
17
|
<!-- The below content is automatically added from ./../docs/partials/keyEvents.md -->
|
|
18
18
|
<div class="note">
|
|
19
|
-
<p><
|
|
19
|
+
<p><strong>Static vs Dynamic Option List:</strong> The <strong>expanded</strong> state can never be applied without list options rendered into the DOM. Since the component supports dynamic option lists generated <em>after</em> a value is typed into the <strong>input</strong>, certain key events (as noted in the <strong>Current State</strong> column of the table below) only function with the option list rendered into the DOM.</p>
|
|
20
20
|
</div>
|
|
21
21
|
<table>
|
|
22
22
|
<thead>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<td>
|
|
44
44
|
Input element, <strong>NOT</strong> the input clear button
|
|
45
45
|
<div class="note">
|
|
46
|
-
<
|
|
46
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs depending on viewport size.
|
|
47
47
|
</div>
|
|
48
48
|
</td>
|
|
49
49
|
<td>
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<td>
|
|
64
64
|
Input element, <strong>NOT</strong> the input clear button
|
|
65
65
|
<div class="note">
|
|
66
|
-
<
|
|
66
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
67
67
|
</div>
|
|
68
68
|
</td>
|
|
69
69
|
<td>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
<td>
|
|
84
84
|
Input element, <strong>NOT</strong> the input clear button
|
|
85
85
|
<div class="note">
|
|
86
|
-
<
|
|
86
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
87
87
|
</div>
|
|
88
88
|
</td>
|
|
89
89
|
<td>
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
<td>
|
|
105
105
|
Input element, <strong>NOT</strong> the input clear button
|
|
106
106
|
<div class="note">
|
|
107
|
-
<
|
|
107
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
108
108
|
</div>
|
|
109
109
|
</td>
|
|
110
110
|
<td>
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
<td>
|
|
125
125
|
Input element, <strong>NOT</strong> the input clear button
|
|
126
126
|
<div class="note">
|
|
127
|
-
<
|
|
127
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
128
128
|
</div>
|
|
129
129
|
</td>
|
|
130
130
|
<td>
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
<td>
|
|
145
145
|
Input element, <strong>NOT</strong> the input clear button
|
|
146
146
|
<div class="note">
|
|
147
|
-
<
|
|
147
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
148
148
|
</div>
|
|
149
149
|
</td>
|
|
150
150
|
<td>
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
<td>
|
|
159
159
|
Input element, <strong>NOT</strong> the input clear button
|
|
160
160
|
<div class="note">
|
|
161
|
-
<
|
|
161
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
162
162
|
</div>
|
|
163
163
|
</td>
|
|
164
164
|
<td>
|
|
@@ -220,13 +220,13 @@
|
|
|
220
220
|
</td>
|
|
221
221
|
</tr>
|
|
222
222
|
<tr>
|
|
223
|
-
<td>
|
|
223
|
+
<td>Escape</td>
|
|
224
224
|
<td>-</td>
|
|
225
225
|
<td>Expanded</td>
|
|
226
226
|
<td>
|
|
227
227
|
Input element, <strong>NOT</strong> the input clear button
|
|
228
228
|
<div class="note">
|
|
229
|
-
<
|
|
229
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
230
230
|
</div>
|
|
231
231
|
</td>
|
|
232
232
|
<td>
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
<td>
|
|
241
241
|
Input element, <strong>NOT</strong> the input clear button
|
|
242
242
|
<div class="note">
|
|
243
|
-
<
|
|
243
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
244
244
|
</div>
|
|
245
245
|
</td>
|
|
246
246
|
<td>
|
|
@@ -254,23 +254,22 @@
|
|
|
254
254
|
<td>
|
|
255
255
|
Input element, <strong>NOT</strong> the input clear button
|
|
256
256
|
<div class="note">
|
|
257
|
-
<
|
|
257
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
258
258
|
</div>
|
|
259
259
|
</td>
|
|
260
260
|
<td>
|
|
261
|
-
The current <code>focused</code> option is selected, the bib is closed and <strong>focus</strong> is moved to the <strong>clear button</strong> in the component trigger
|
|
262
|
-
</div>
|
|
261
|
+
The current <code>focused</code> option is selected, the bib is closed and <strong>focus</strong> is moved to the <strong>clear button</strong> in the component trigger.
|
|
263
262
|
</td>
|
|
264
263
|
</tr>
|
|
265
264
|
<tr>
|
|
266
265
|
<td>
|
|
267
266
|
Input clear button, <strong>NOT</strong> the input element
|
|
268
267
|
<div class="note">
|
|
269
|
-
<
|
|
268
|
+
<strong>Note:</strong> Includes both trigger and bib content input clear buttons.
|
|
270
269
|
</div>
|
|
271
270
|
</td>
|
|
272
271
|
<td>
|
|
273
|
-
<span style="background-color: pink; color: red;"> 
|
|
272
|
+
<span style="background-color: pink; color: red;"> What do we do here? </span>
|
|
274
273
|
</td>
|
|
275
274
|
</tr>
|
|
276
275
|
<tr>
|
|
@@ -279,13 +278,13 @@
|
|
|
279
278
|
<td>
|
|
280
279
|
Input element, <strong>NOT</strong> the input clear button
|
|
281
280
|
<div class="note">
|
|
282
|
-
<
|
|
281
|
+
<strong>Note:</strong> Includes both trigger and bib content inputs.
|
|
283
282
|
</div>
|
|
284
283
|
</td>
|
|
285
284
|
<td>
|
|
286
285
|
Advances the <code>focused</code> option to the first enabled option in the list.
|
|
287
286
|
<div class="note">
|
|
288
|
-
<
|
|
287
|
+
<strong>Note:</strong> the bib will <strong>NOT</strong> close and the page will <strong>NOT</strong> navigate to the previous focusable element in the tabindex order.
|
|
289
288
|
</div>
|
|
290
289
|
</td>
|
|
291
290
|
</tr>
|
|
@@ -295,8 +294,8 @@
|
|
|
295
294
|
<div class="note">
|
|
296
295
|
<p><strong>Note:</strong> The following keyboard behavior is unsupported at this time:</p>
|
|
297
296
|
<ul>
|
|
298
|
-
<li><strong>PageUp:</strong> The browser
|
|
299
|
-
<li><strong>PageDown:</strong> The browser
|
|
297
|
+
<li><strong>PageUp:</strong> The browser moves the <code>focused</code> option up by approximately one <strong>page</strong> of visible options (typically equal to the number of rendered rows). The scroll position updates in tandem so that the newly focused option is brought into view, usually aligning near the top of the visible list.</li>
|
|
298
|
+
<li><strong>PageDown:</strong> The browser advances the <code>focused</code> option down by approximately one <strong>page</strong> of visible items (typically equal to the number of rendered rows). The scroll position updates accordingly so the newly focused option is brought into view, often aligning near the bottom of the visible list.</li>
|
|
300
299
|
</ul>
|
|
301
300
|
</div>
|
|
302
301
|
</div>
|