@aurodesignsystem-dev/auro-formkit 0.0.0-pr1408.8 → 0.0.0-pr1411.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkbox/demo/api.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/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 +121 -144
- package/components/combobox/demo/index.min.js +121 -144
- package/components/combobox/demo/keyboardBehavior.html +1 -0
- package/components/combobox/demo/keyboardBehavior.md +21 -22
- package/components/combobox/dist/index.js +87 -117
- package/components/combobox/dist/registered.js +87 -117
- package/components/counter/demo/api.md +1 -1
- package/components/counter/demo/api.min.js +184 -148
- package/components/counter/demo/index.min.js +184 -148
- 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 +184 -148
- package/components/counter/dist/keyboardStrategy.d.ts +4 -0
- package/components/counter/dist/registered.js +184 -148
- package/components/datepicker/demo/api.min.js +89 -120
- package/components/datepicker/demo/index.min.js +89 -120
- package/components/datepicker/demo/keyboardBehavior.html +1 -0
- package/components/datepicker/demo/keyboardBehavior.md +14 -13
- package/components/datepicker/dist/index.js +84 -115
- package/components/datepicker/dist/registered.js +84 -115
- package/components/dropdown/demo/api.md +0 -1
- package/components/dropdown/demo/api.min.js +99 -123
- package/components/dropdown/demo/index.md +2 -2
- package/components/dropdown/demo/index.min.js +99 -123
- package/components/dropdown/demo/keyboardBehavior.html +1 -0
- package/components/dropdown/dist/auro-dropdown.d.ts +0 -8
- 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 +83 -111
- package/components/dropdown/dist/registered.js +83 -111
- package/components/form/demo/api.min.js +542 -564
- package/components/form/demo/index.min.js +542 -564
- 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 +181 -178
- package/components/select/demo/index.min.js +181 -178
- package/components/select/demo/keyboardBehavior.html +1 -0
- package/components/select/demo/keyboardBehavior.md +240 -239
- package/components/select/dist/index.js +147 -151
- package/components/select/dist/registered.js +147 -151
- package/components/select/dist/selectKeyboardStrategy.d.ts +3 -1
- package/custom-elements.json +1521 -1503
- package/package.json +5 -3
|
@@ -1234,6 +1234,57 @@ class IconUtil {
|
|
|
1234
1234
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1235
1235
|
*/let e$1 = class e extends i{constructor(i){if(super(i),this.it=A$2,i.type!==t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A$2||null==r)return this._t=void 0,this.it=r;if(r===E)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};e$1.directiveName="unsafeHTML",e$1.resultType=1;
|
|
1236
1236
|
|
|
1237
|
+
/**
|
|
1238
|
+
* Computes display state once per keydown event.
|
|
1239
|
+
* Centralizes null-safety checks and makes the shared/modal/popover branching explicit.
|
|
1240
|
+
*
|
|
1241
|
+
* @param {HTMLElement} component - The component with a dropdown reference.
|
|
1242
|
+
* @param {Object} [options] - Optional config.
|
|
1243
|
+
* @param {HTMLElement} [options.dropdown] - Explicit dropdown reference. Falls back to component.dropdown.
|
|
1244
|
+
* @param {Function} [options.inputResolver] - Called with (component, ctx) to resolve the active input element.
|
|
1245
|
+
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
1246
|
+
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
1247
|
+
*/
|
|
1248
|
+
function createDisplayContext$1(component, options = {}) {
|
|
1249
|
+
const dd = options.dropdown || component.dropdown;
|
|
1250
|
+
// isPopoverVisible reflects as the `open` attribute.
|
|
1251
|
+
// It reports whether the bib is open in any mode (popover or modal).
|
|
1252
|
+
const isExpanded = Boolean(dd && dd.isPopoverVisible);
|
|
1253
|
+
const isFullscreen = Boolean(dd && dd.isBibFullscreen);
|
|
1254
|
+
|
|
1255
|
+
const ctx = {
|
|
1256
|
+
isExpanded,
|
|
1257
|
+
isModal: isFullscreen,
|
|
1258
|
+
isPopover: !isFullscreen,
|
|
1259
|
+
activeInput: null,
|
|
1260
|
+
};
|
|
1261
|
+
|
|
1262
|
+
if (options.inputResolver) {
|
|
1263
|
+
const resolvedInput = options.inputResolver(component, ctx);
|
|
1264
|
+
// Guard against resolvers returning undefined or non-HTMLElement values.
|
|
1265
|
+
ctx.activeInput = resolvedInput instanceof HTMLElement ? resolvedInput : null;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
return ctx;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Wires up a keydown listener that dispatches to strategy[evt.key] or strategy.default.
|
|
1273
|
+
* Handles both sync and async handlers.
|
|
1274
|
+
* @param {HTMLElement} component - The component to attach the listener to.
|
|
1275
|
+
* @param {Object} strategy - Map of key names to handler functions.
|
|
1276
|
+
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
1277
|
+
*/
|
|
1278
|
+
function applyKeyboardStrategy$1(component, strategy, options = {}) {
|
|
1279
|
+
component.addEventListener('keydown', async (evt) => {
|
|
1280
|
+
const handler = strategy[evt.key] || strategy.default;
|
|
1281
|
+
if (typeof handler === 'function') {
|
|
1282
|
+
const ctx = createDisplayContext$1(component, options);
|
|
1283
|
+
await handler(component, evt, ctx);
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1237
1288
|
var plusIcon = {"role":"img","color":"currentColor","title":"","desc":"","width":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","height":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","xmlns":"http://www.w3.org/2000/svg","xmlns_xlink":"http://www.w3.org/1999/xlink","viewBox":"0 0 24 24","path":"/icons","style":"ico_squareLarge","type":"icon","name":"plus-lg","category":"interface","svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" class=\"ico_squareLarge\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><path d=\"M11.898 5.007 12 5a.75.75 0 0 1 .743.648l.007.102v5.5h5.5a.75.75 0 0 1 .743.648L19 12a.75.75 0 0 1-.648.743l-.102.007h-5.501l.001 5.5a.75.75 0 0 1-.648.743L12 19a.75.75 0 0 1-.743-.648l-.007-.102-.001-5.5H5.75a.75.75 0 0 1-.743-.648L5 12a.75.75 0 0 1 .648-.743l.102-.007h5.5v-5.5a.75.75 0 0 1 .648-.743L12 5z\"/></svg>"};
|
|
1238
1289
|
|
|
1239
1290
|
var minusIcon = {"role":"img","color":"currentColor","title":"","desc":"","width":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","height":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","xmlns":"http://www.w3.org/2000/svg","xmlns_xlink":"http://www.w3.org/1999/xlink","viewBox":"0 0 24 24","path":"/icons","style":"ico_squareLarge","type":"icon","name":"minus-lg","category":"interface","deprecated":true,"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><path d=\"M5.75 12.75h12.5a.75.75 0 1 0 0-1.5H5.75a.75.75 0 1 0 0 1.5\"/></svg>"};
|
|
@@ -1470,7 +1521,30 @@ let AuroHelpText$1 = class AuroHelpText extends i$2 {
|
|
|
1470
1521
|
}
|
|
1471
1522
|
};
|
|
1472
1523
|
|
|
1473
|
-
var formkitVersion$1 = '
|
|
1524
|
+
var formkitVersion$1 = '202604021512';
|
|
1525
|
+
|
|
1526
|
+
// Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
1527
|
+
// See LICENSE in the project root for license information.
|
|
1528
|
+
|
|
1529
|
+
const keyboardStrategy = {
|
|
1530
|
+
ArrowUp(component, _evt) {
|
|
1531
|
+
if (component.disabled) {
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
_evt.preventDefault();
|
|
1536
|
+
component.increment();
|
|
1537
|
+
},
|
|
1538
|
+
|
|
1539
|
+
ArrowDown(component, _evt) {
|
|
1540
|
+
if (component.disabled) {
|
|
1541
|
+
return;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
_evt.preventDefault();
|
|
1545
|
+
component.decrement();
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1474
1548
|
|
|
1475
1549
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
1476
1550
|
// See LICENSE in the project root for license information.
|
|
@@ -1544,14 +1618,36 @@ class AuroCounter extends i$2 {
|
|
|
1544
1618
|
|
|
1545
1619
|
connectedCallback() {
|
|
1546
1620
|
super.connectedCallback();
|
|
1547
|
-
this
|
|
1621
|
+
applyKeyboardStrategy$1(this, keyboardStrategy);
|
|
1548
1622
|
}
|
|
1549
1623
|
|
|
1550
1624
|
disconnectedCallback() {
|
|
1551
|
-
this.removeEventListener('keydown', this.handleKeyDown);
|
|
1552
1625
|
super.disconnectedCallback();
|
|
1553
1626
|
}
|
|
1554
1627
|
|
|
1628
|
+
/**
|
|
1629
|
+
* Gets the current value of the counter.
|
|
1630
|
+
* @returns {number|undefined} The current value of the counter, or undefined if the value is not set or invalid.
|
|
1631
|
+
*/
|
|
1632
|
+
get value() {
|
|
1633
|
+
return this._value;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
/**
|
|
1637
|
+
* Sets the value of the counter. If the provided value is undefined, null, or cannot be converted to a number, the internal value will be set to undefined.
|
|
1638
|
+
* @param {number|string|undefined|null} val - The value to set for the counter. Can be a number, a string that can be converted to a number, undefined, or null.
|
|
1639
|
+
*/
|
|
1640
|
+
set value(val) {
|
|
1641
|
+
const old = this._value;
|
|
1642
|
+
if (val === undefined || val === null) {
|
|
1643
|
+
this._value = undefined;
|
|
1644
|
+
} else {
|
|
1645
|
+
const num = Number(val);
|
|
1646
|
+
this._value = Number.isNaN(num) ? undefined : num;
|
|
1647
|
+
}
|
|
1648
|
+
this.requestUpdate('value', old);
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1555
1651
|
/**
|
|
1556
1652
|
* Defines reactive properties for the component.
|
|
1557
1653
|
* @returns {Object} Property configuration.
|
|
@@ -1736,29 +1832,6 @@ class AuroCounter extends i$2 {
|
|
|
1736
1832
|
this.validation.validate(this, force);
|
|
1737
1833
|
}
|
|
1738
1834
|
|
|
1739
|
-
/**
|
|
1740
|
-
* Handles the keydown event for the counter component.
|
|
1741
|
-
* @param {KeyboardEvent} event - The keyboard event object.
|
|
1742
|
-
* @returns {void}
|
|
1743
|
-
* @private
|
|
1744
|
-
*/
|
|
1745
|
-
handleKeyDown(event) {
|
|
1746
|
-
if (this.disabled) {
|
|
1747
|
-
return;
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
switch (event.key) {
|
|
1751
|
-
case 'ArrowUp':
|
|
1752
|
-
event.preventDefault();
|
|
1753
|
-
this.increment();
|
|
1754
|
-
break;
|
|
1755
|
-
case 'ArrowDown':
|
|
1756
|
-
event.preventDefault();
|
|
1757
|
-
this.decrement();
|
|
1758
|
-
break;
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
1835
|
firstUpdated() {
|
|
1763
1836
|
this.initValue();
|
|
1764
1837
|
this.setTagAttribute("auro-counter");
|
|
@@ -3979,11 +4052,10 @@ class AuroFloatingUI {
|
|
|
3979
4052
|
return;
|
|
3980
4053
|
}
|
|
3981
4054
|
|
|
3982
|
-
const { activeElement } = document;
|
|
3983
4055
|
// if focus is still inside of trigger or bib, do not close
|
|
3984
4056
|
if (
|
|
3985
|
-
this.element.
|
|
3986
|
-
this.element.
|
|
4057
|
+
this.element.matches(":focus") ||
|
|
4058
|
+
this.element.matches(":focus-within")
|
|
3987
4059
|
) {
|
|
3988
4060
|
return;
|
|
3989
4061
|
}
|
|
@@ -4822,12 +4894,83 @@ let p$2 = class p{registerComponent(t,a){customElements.get(t)||customElements.d
|
|
|
4822
4894
|
|
|
4823
4895
|
var iconVersion$1 = '9.1.2';
|
|
4824
4896
|
|
|
4897
|
+
/**
|
|
4898
|
+
* Computes display state once per keydown event.
|
|
4899
|
+
* Centralizes null-safety checks and makes the shared/modal/popover branching explicit.
|
|
4900
|
+
*
|
|
4901
|
+
* @param {HTMLElement} component - The component with a dropdown reference.
|
|
4902
|
+
* @param {Object} [options] - Optional config.
|
|
4903
|
+
* @param {HTMLElement} [options.dropdown] - Explicit dropdown reference. Falls back to component.dropdown.
|
|
4904
|
+
* @param {Function} [options.inputResolver] - Called with (component, ctx) to resolve the active input element.
|
|
4905
|
+
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
4906
|
+
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
4907
|
+
*/
|
|
4908
|
+
function createDisplayContext(component, options = {}) {
|
|
4909
|
+
const dd = options.dropdown || component.dropdown;
|
|
4910
|
+
// isPopoverVisible reflects as the `open` attribute.
|
|
4911
|
+
// It reports whether the bib is open in any mode (popover or modal).
|
|
4912
|
+
const isExpanded = Boolean(dd && dd.isPopoverVisible);
|
|
4913
|
+
const isFullscreen = Boolean(dd && dd.isBibFullscreen);
|
|
4914
|
+
|
|
4915
|
+
const ctx = {
|
|
4916
|
+
isExpanded,
|
|
4917
|
+
isModal: isFullscreen,
|
|
4918
|
+
isPopover: !isFullscreen,
|
|
4919
|
+
activeInput: null,
|
|
4920
|
+
};
|
|
4921
|
+
|
|
4922
|
+
if (options.inputResolver) {
|
|
4923
|
+
const resolvedInput = options.inputResolver(component, ctx);
|
|
4924
|
+
// Guard against resolvers returning undefined or non-HTMLElement values.
|
|
4925
|
+
ctx.activeInput = resolvedInput instanceof HTMLElement ? resolvedInput : null;
|
|
4926
|
+
}
|
|
4927
|
+
|
|
4928
|
+
return ctx;
|
|
4929
|
+
}
|
|
4930
|
+
|
|
4931
|
+
/**
|
|
4932
|
+
* Wires up a keydown listener that dispatches to strategy[evt.key] or strategy.default.
|
|
4933
|
+
* Handles both sync and async handlers.
|
|
4934
|
+
* @param {HTMLElement} component - The component to attach the listener to.
|
|
4935
|
+
* @param {Object} strategy - Map of key names to handler functions.
|
|
4936
|
+
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
4937
|
+
*/
|
|
4938
|
+
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
4939
|
+
component.addEventListener('keydown', async (evt) => {
|
|
4940
|
+
const handler = strategy[evt.key] || strategy.default;
|
|
4941
|
+
if (typeof handler === 'function') {
|
|
4942
|
+
const ctx = createDisplayContext(component, options);
|
|
4943
|
+
await handler(component, evt, ctx);
|
|
4944
|
+
}
|
|
4945
|
+
});
|
|
4946
|
+
}
|
|
4947
|
+
|
|
4825
4948
|
var styleCss$2 = i$5`: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}`;
|
|
4826
4949
|
|
|
4827
4950
|
var colorCss$2 = i$5`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
4828
4951
|
|
|
4829
4952
|
var tokensCss$1 = i$5`: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)}`;
|
|
4830
4953
|
|
|
4954
|
+
/**
|
|
4955
|
+
* Creates a keyboard strategy for dialog-specific key handling.
|
|
4956
|
+
* All other keydown behavior is left to the browser's native bubbling path.
|
|
4957
|
+
* @param {HTMLElement} bib - The dropdown bib element.
|
|
4958
|
+
* @returns {Object} Keyboard handlers keyed by `event.key`.
|
|
4959
|
+
*/
|
|
4960
|
+
// eslint-disable-next-line no-unused-vars
|
|
4961
|
+
function createDropdownBibKeyboardStrategy(bib) {
|
|
4962
|
+
return {
|
|
4963
|
+
// eslint-disable-next-line no-unused-vars
|
|
4964
|
+
Enter(_dialog, event) {
|
|
4965
|
+
// Floating UI handles Enter key to open the dropdown
|
|
4966
|
+
},
|
|
4967
|
+
// eslint-disable-next-line no-unused-vars
|
|
4968
|
+
Escape(_dialog, event) {
|
|
4969
|
+
// Floating UI handles Escape key to close the dropdown
|
|
4970
|
+
}
|
|
4971
|
+
};
|
|
4972
|
+
}
|
|
4973
|
+
|
|
4831
4974
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
4832
4975
|
// See LICENSE in the project root for license information.
|
|
4833
4976
|
/* eslint-disable max-lines */
|
|
@@ -4952,11 +5095,7 @@ class AuroDropdownBib extends i$2 {
|
|
|
4952
5095
|
},
|
|
4953
5096
|
|
|
4954
5097
|
/**
|
|
4955
|
-
*
|
|
4956
|
-
* aria-activedescendant. The dialog keyboard bridge checks this
|
|
4957
|
-
* flag so that Enter selects the highlighted option instead of
|
|
4958
|
-
* activating the focused interactive element (e.g. the trigger
|
|
4959
|
-
* button, or the bibtemplate close button in fullscreen).
|
|
5098
|
+
* Tracks whether a menu option is currently highlighted.
|
|
4960
5099
|
* @private
|
|
4961
5100
|
*/
|
|
4962
5101
|
hasActiveDescendant: {
|
|
@@ -5030,7 +5169,7 @@ class AuroDropdownBib extends i$2 {
|
|
|
5030
5169
|
|
|
5031
5170
|
const dialog = this.shadowRoot.querySelector('dialog');
|
|
5032
5171
|
this._setupCancelHandler(dialog);
|
|
5033
|
-
|
|
5172
|
+
applyKeyboardStrategy(dialog, createDropdownBibKeyboardStrategy());
|
|
5034
5173
|
|
|
5035
5174
|
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
5036
5175
|
bubbles: true,
|
|
@@ -5057,92 +5196,6 @@ class AuroDropdownBib extends i$2 {
|
|
|
5057
5196
|
});
|
|
5058
5197
|
}
|
|
5059
5198
|
|
|
5060
|
-
/**
|
|
5061
|
-
* showModal() creates a closed focus scope — keyboard events inside
|
|
5062
|
-
* the dialog's shadow DOM do NOT bubble out to the combobox/select
|
|
5063
|
-
* keydown handlers in the parent shadow DOM. This handler bridges
|
|
5064
|
-
* that gap by re-dispatching navigation keys so they cross the
|
|
5065
|
-
* shadow boundary and reach the menu navigation logic in the parent
|
|
5066
|
-
* component.
|
|
5067
|
-
*
|
|
5068
|
-
* The trade-off: intercepting these keys means native keyboard
|
|
5069
|
-
* behaviors that would normally "just work" must be manually
|
|
5070
|
-
* re-implemented here:
|
|
5071
|
-
*
|
|
5072
|
-
* - Enter on buttons: Custom elements (auro-button) don't get the
|
|
5073
|
-
* native Enter→click that <button> provides, so we call .click()
|
|
5074
|
-
* directly when Enter is pressed on a button-like element.
|
|
5075
|
-
*
|
|
5076
|
-
* - Tab: Intercepted and re-dispatched so parent components
|
|
5077
|
-
* (select/combobox) can select the active option and close the
|
|
5078
|
-
* dialog. The <dialog> provides containment and isolation
|
|
5079
|
-
* (inert background, VoiceOver focus trapping, top layer), while
|
|
5080
|
-
* the content inside is a role="listbox" navigated via
|
|
5081
|
-
* aria-activedescendant (options are not focusable). Tab keyboard
|
|
5082
|
-
* behavior follows listbox conventions (select + close) because
|
|
5083
|
-
* the dialog's native Tab trap only cycles between the close
|
|
5084
|
-
* button and browser chrome.
|
|
5085
|
-
*
|
|
5086
|
-
* - Escape: The native <dialog> fires a `cancel` event on ESC
|
|
5087
|
-
* (handled by _setupCancelHandler), so the re-dispatched Escape
|
|
5088
|
-
* is a secondary path for parent components that also listen for
|
|
5089
|
-
* Escape keydown.
|
|
5090
|
-
*
|
|
5091
|
-
* @param {HTMLDialogElement} dialog - The dialog element to attach the keyboard bridge to.
|
|
5092
|
-
* @private
|
|
5093
|
-
*/
|
|
5094
|
-
_setupKeyboardBridge(dialog) {
|
|
5095
|
-
const navKeys = new Set([
|
|
5096
|
-
'ArrowUp',
|
|
5097
|
-
'ArrowDown',
|
|
5098
|
-
'Enter',
|
|
5099
|
-
'Escape',
|
|
5100
|
-
'Tab'
|
|
5101
|
-
]);
|
|
5102
|
-
|
|
5103
|
-
dialog.addEventListener('keydown', (event) => {
|
|
5104
|
-
if (!navKeys.has(event.key)) {
|
|
5105
|
-
return;
|
|
5106
|
-
}
|
|
5107
|
-
|
|
5108
|
-
// Custom elements (auro-button) don't get the native Enter→click
|
|
5109
|
-
// behavior that <button> has. Find the button in the composed path
|
|
5110
|
-
// and click it directly — but only when no menu option is
|
|
5111
|
-
// highlighted. In fullscreen mode focus stays on the close button
|
|
5112
|
-
// while arrow keys move the active-descendant highlight through
|
|
5113
|
-
// the listbox. If the user presses Enter with an option
|
|
5114
|
-
// highlighted, the intent is to select that option, not to click
|
|
5115
|
-
// the close button. In that case we fall through and bridge the
|
|
5116
|
-
// Enter key to the parent component's keyboard strategy.
|
|
5117
|
-
if (event.key === 'Enter') {
|
|
5118
|
-
if (!this.hasActiveDescendant) {
|
|
5119
|
-
const buttonSelector = 'button, [role="button"], auro-button, [auro-button]';
|
|
5120
|
-
const btn = event.composedPath().find((el) => el.matches && el.matches(buttonSelector));
|
|
5121
|
-
if (btn) {
|
|
5122
|
-
event.preventDefault();
|
|
5123
|
-
event.stopPropagation();
|
|
5124
|
-
btn.click();
|
|
5125
|
-
return;
|
|
5126
|
-
}
|
|
5127
|
-
}
|
|
5128
|
-
}
|
|
5129
|
-
|
|
5130
|
-
event.preventDefault();
|
|
5131
|
-
event.stopPropagation();
|
|
5132
|
-
const newEvent = new KeyboardEvent('keydown', {
|
|
5133
|
-
key: event.key,
|
|
5134
|
-
code: event.code,
|
|
5135
|
-
shiftKey: event.shiftKey,
|
|
5136
|
-
altKey: event.altKey,
|
|
5137
|
-
ctrlKey: event.ctrlKey,
|
|
5138
|
-
metaKey: event.metaKey,
|
|
5139
|
-
bubbles: true,
|
|
5140
|
-
composed: true,
|
|
5141
|
-
cancelable: true
|
|
5142
|
-
});
|
|
5143
|
-
this.dispatchEvent(newEvent);
|
|
5144
|
-
});
|
|
5145
|
-
}
|
|
5146
5199
|
|
|
5147
5200
|
/**
|
|
5148
5201
|
* Blocks touch-driven page scroll while a fullscreen modal dialog is open.
|
|
@@ -5517,7 +5570,7 @@ class AuroHelpText extends i$2 {
|
|
|
5517
5570
|
}
|
|
5518
5571
|
}
|
|
5519
5572
|
|
|
5520
|
-
var formkitVersion = '
|
|
5573
|
+
var formkitVersion = '202604021512';
|
|
5521
5574
|
|
|
5522
5575
|
let AuroElement$1 = class AuroElement extends i$2 {
|
|
5523
5576
|
static get properties() {
|
|
@@ -5698,7 +5751,6 @@ class AuroDropdown extends AuroElement$1 {
|
|
|
5698
5751
|
this.appearance = 'default';
|
|
5699
5752
|
this.chevron = false;
|
|
5700
5753
|
this.disabled = false;
|
|
5701
|
-
this.disableFocusTrap = false;
|
|
5702
5754
|
this.error = false;
|
|
5703
5755
|
this.tabIndex = 0;
|
|
5704
5756
|
this.noToggle = false;
|
|
@@ -5796,9 +5848,8 @@ class AuroDropdown extends AuroElement$1 {
|
|
|
5796
5848
|
// showModal() fires asynchronously via Lit's update cycle, which
|
|
5797
5849
|
// falls outside the user activation window and causes iOS to
|
|
5798
5850
|
// dismiss the keyboard.
|
|
5799
|
-
if (this.
|
|
5800
|
-
|
|
5801
|
-
this.bibElement.value.open(useModal);
|
|
5851
|
+
if (this.bibElement && this.bibElement.value) {
|
|
5852
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
5802
5853
|
}
|
|
5803
5854
|
}
|
|
5804
5855
|
|
|
@@ -5911,14 +5962,6 @@ class AuroDropdown extends AuroElement$1 {
|
|
|
5911
5962
|
reflect: true
|
|
5912
5963
|
},
|
|
5913
5964
|
|
|
5914
|
-
/**
|
|
5915
|
-
* If declared, the focus trap inside of bib will be turned off.
|
|
5916
|
-
*/
|
|
5917
|
-
disableFocusTrap: {
|
|
5918
|
-
type: Boolean,
|
|
5919
|
-
reflect: true
|
|
5920
|
-
},
|
|
5921
|
-
|
|
5922
5965
|
/**
|
|
5923
5966
|
* @private
|
|
5924
5967
|
*/
|
|
@@ -6192,7 +6235,7 @@ class AuroDropdown extends AuroElement$1 {
|
|
|
6192
6235
|
if (this.isPopoverVisible) {
|
|
6193
6236
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
6194
6237
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
6195
|
-
const useModal = this.isBibFullscreen
|
|
6238
|
+
const useModal = this.isBibFullscreen;
|
|
6196
6239
|
this.bibElement.value.open(useModal);
|
|
6197
6240
|
} else {
|
|
6198
6241
|
this.bibElement.value.close();
|
|
@@ -6202,7 +6245,7 @@ class AuroDropdown extends AuroElement$1 {
|
|
|
6202
6245
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
6203
6246
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
6204
6247
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
6205
|
-
const useModal = this.isBibFullscreen
|
|
6248
|
+
const useModal = this.isBibFullscreen;
|
|
6206
6249
|
this.bibElement.value.close();
|
|
6207
6250
|
this.bibElement.value.open(useModal);
|
|
6208
6251
|
}
|
|
@@ -6314,7 +6357,7 @@ class AuroDropdown extends AuroElement$1 {
|
|
|
6314
6357
|
* @private
|
|
6315
6358
|
*/
|
|
6316
6359
|
updateFocusTrap() {
|
|
6317
|
-
if (this.isPopoverVisible
|
|
6360
|
+
if (this.isPopoverVisible) {
|
|
6318
6361
|
if (!this.isBibFullscreen) {
|
|
6319
6362
|
// Desktop: show() doesn't trap focus, so use FocusTrap
|
|
6320
6363
|
this.focusTrap = new FocusTrap(this.bibContent);
|
|
@@ -7514,6 +7557,7 @@ class AuroCounterGroup extends AuroElement {
|
|
|
7514
7557
|
counter.addEventListener("input", this.updateValue);
|
|
7515
7558
|
counter.addEventListener("auroFormElement-validated", this.updateValidity);
|
|
7516
7559
|
});
|
|
7560
|
+
this.updateValue();
|
|
7517
7561
|
}
|
|
7518
7562
|
|
|
7519
7563
|
/**
|
|
@@ -7644,6 +7688,8 @@ class AuroCounterGroup extends AuroElement {
|
|
|
7644
7688
|
counter.addEventListener("auroFormElement-validated", this.updateValidity);
|
|
7645
7689
|
});
|
|
7646
7690
|
|
|
7691
|
+
this.updateValue();
|
|
7692
|
+
|
|
7647
7693
|
if (this.isDropdown) {
|
|
7648
7694
|
this.configureBibtemplate();
|
|
7649
7695
|
}
|
|
@@ -7669,15 +7715,6 @@ class AuroCounterGroup extends AuroElement {
|
|
|
7669
7715
|
});
|
|
7670
7716
|
}
|
|
7671
7717
|
});
|
|
7672
|
-
|
|
7673
|
-
// Tab closes the fullscreen dialog
|
|
7674
|
-
// The dialog event bridge intercepts Tab and re-dispatches it as a
|
|
7675
|
-
// composed keydown; this listener catches the re-dispatched event.
|
|
7676
|
-
this.addEventListener('keydown', (evt) => {
|
|
7677
|
-
if (evt.key === 'Tab' && this.dropdown.isPopoverVisible && this.dropdown.isBibFullscreen) {
|
|
7678
|
-
this.dropdown.hide();
|
|
7679
|
-
}
|
|
7680
|
-
});
|
|
7681
7718
|
}
|
|
7682
7719
|
|
|
7683
7720
|
/**
|
|
@@ -7867,8 +7904,7 @@ class AuroCounterGroup extends AuroElement {
|
|
|
7867
7904
|
*/
|
|
7868
7905
|
renderCounterDropdown() {
|
|
7869
7906
|
return u$5`
|
|
7870
|
-
<${this.dropdownTag}
|
|
7871
|
-
noHideOnThisFocusLoss
|
|
7907
|
+
<${this.dropdownTag}
|
|
7872
7908
|
chevron
|
|
7873
7909
|
part="dropdown"
|
|
7874
7910
|
appearance="${this.onDark ? 'inverse' : this.appearance}"
|