@aurodesignsystem-dev/auro-formkit 0.0.0-pr1408.15 → 0.0.0-pr1408.17
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 +320 -282
- package/components/combobox/demo/index.min.js +320 -282
- package/components/combobox/demo/keyboardBehavior.md +9 -36
- package/components/combobox/dist/auro-combobox.d.ts +17 -0
- package/components/combobox/dist/comboboxKeyboardStrategy.d.ts +6 -3
- package/components/combobox/dist/index.js +286 -255
- package/components/combobox/dist/registered.js +286 -255
- package/components/counter/demo/api.md +1 -1
- package/components/counter/demo/api.min.js +202 -146
- package/components/counter/demo/index.min.js +202 -146
- package/components/counter/dist/auro-counter.d.ts +11 -8
- package/components/counter/dist/index.js +202 -146
- package/components/counter/dist/keyboardStrategy.d.ts +4 -0
- package/components/counter/dist/registered.js +202 -146
- package/components/datepicker/demo/api.min.js +148 -137
- package/components/datepicker/demo/index.min.js +148 -137
- package/components/datepicker/dist/index.js +143 -132
- package/components/datepicker/dist/registered.js +143 -132
- package/components/dropdown/demo/api.md +29 -29
- package/components/dropdown/demo/api.min.js +117 -121
- package/components/dropdown/demo/index.min.js +117 -121
- 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 +101 -109
- package/components/dropdown/dist/registered.js +101 -109
- package/components/form/demo/api.min.js +958 -788
- package/components/form/demo/index.min.js +958 -788
- package/components/form/demo/keyboardBehavior.md +0 -0
- package/components/input/demo/api.min.js +102 -77
- package/components/input/demo/index.min.js +102 -77
- package/components/input/demo/keyboardBehavior.md +0 -0
- package/components/input/dist/auro-input.d.ts +11 -0
- package/components/input/dist/base-input.d.ts +1 -0
- package/components/input/dist/index.js +32 -18
- package/components/input/dist/registered.js +32 -18
- 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 +225 -166
- package/components/select/demo/index.min.js +225 -166
- package/components/select/demo/keyboardBehavior.md +3 -3
- package/components/select/dist/index.js +191 -139
- package/components/select/dist/registered.js +191 -139
- package/components/select/dist/selectKeyboardStrategy.d.ts +5 -2
- package/custom-elements.json +1547 -1466
- package/package.json +8 -6
|
@@ -1202,7 +1202,13 @@ function guardTouchPassthrough(element) {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
|
|
1204
1204
|
/**
|
|
1205
|
-
* Restores the dropdown trigger after a fullscreen dialog closes
|
|
1205
|
+
* Restores the dropdown trigger after a fullscreen dialog closes
|
|
1206
|
+
* when focus doesn't leave the component (e.g. using Esc or Enter keys).
|
|
1207
|
+
* When leaving the component (e.g., tabbing out of the combobox after closing
|
|
1208
|
+
* the fullscreen dialog), focus restoration is handled by the browser's native
|
|
1209
|
+
* dialog focus restoration behavior, so this function only restores focus
|
|
1210
|
+
* when focus remains inside the component after the dialog closes.
|
|
1211
|
+
|
|
1206
1212
|
*
|
|
1207
1213
|
* Removes the `inert` attribute from the trigger so it is accessible again,
|
|
1208
1214
|
* and restores focus to the given target after one animation frame. The rAF
|
|
@@ -1218,8 +1224,11 @@ function guardTouchPassthrough(element) {
|
|
|
1218
1224
|
function restoreTriggerAfterClose(dropdown, focusTarget) {
|
|
1219
1225
|
dropdown.trigger.inert = false;
|
|
1220
1226
|
|
|
1227
|
+
// Wait a frame so that dialog.close() has completed and the browser's
|
|
1228
|
+
// native focus restoration has run before we attempt to focus the
|
|
1229
|
+
// trigger / input programmatically.
|
|
1221
1230
|
requestAnimationFrame(() => {
|
|
1222
|
-
if (!dropdown.isPopoverVisible) {
|
|
1231
|
+
if (!dropdown.isPopoverVisible && dropdown.trigger.contains(document.activeElement)) {
|
|
1223
1232
|
focusTarget.focus();
|
|
1224
1233
|
}
|
|
1225
1234
|
});
|
|
@@ -1242,7 +1251,7 @@ function restoreTriggerAfterClose(dropdown, focusTarget) {
|
|
|
1242
1251
|
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
1243
1252
|
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
1244
1253
|
*/
|
|
1245
|
-
function createDisplayContext(component, options = {}) {
|
|
1254
|
+
function createDisplayContext$1(component, options = {}) {
|
|
1246
1255
|
const dd = options.dropdown || component.dropdown;
|
|
1247
1256
|
// isPopoverVisible reflects as the `open` attribute.
|
|
1248
1257
|
// It reports whether the bib is open in any mode (popover or modal).
|
|
@@ -1272,11 +1281,11 @@ function createDisplayContext(component, options = {}) {
|
|
|
1272
1281
|
* @param {Object} strategy - Map of key names to handler functions.
|
|
1273
1282
|
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
1274
1283
|
*/
|
|
1275
|
-
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
1284
|
+
function applyKeyboardStrategy$1(component, strategy, options = {}) {
|
|
1276
1285
|
component.addEventListener('keydown', async (evt) => {
|
|
1277
1286
|
const handler = strategy[evt.key] || strategy.default;
|
|
1278
1287
|
if (typeof handler === 'function') {
|
|
1279
|
-
const ctx = createDisplayContext(component, options);
|
|
1288
|
+
const ctx = createDisplayContext$1(component, options);
|
|
1280
1289
|
await handler(component, evt, ctx);
|
|
1281
1290
|
}
|
|
1282
1291
|
});
|
|
@@ -1326,102 +1335,32 @@ function isClearBtnFocused(ctx, clearBtn = getClearBtn(ctx)) {
|
|
|
1326
1335
|
if (!clearBtn) {
|
|
1327
1336
|
return false;
|
|
1328
1337
|
}
|
|
1329
|
-
|
|
1338
|
+
const isFocused = Boolean(clearBtn.shadowRoot && clearBtn.shadowRoot.activeElement !== null);
|
|
1339
|
+
return isFocused;
|
|
1330
1340
|
}
|
|
1331
1341
|
|
|
1332
1342
|
const comboboxKeyboardStrategy = {
|
|
1333
|
-
|
|
1334
|
-
// If the clear button has focus, let the browser
|
|
1335
|
-
// stopPropagation prevents parent containers (e.g., forms) from treating
|
|
1336
|
-
// Enter as a submit, but we must NOT call preventDefault — that would
|
|
1337
|
-
// block the browser's built-in "Enter activates focused button" behavior.
|
|
1343
|
+
ArrowDown(component, evt, ctx) {
|
|
1344
|
+
// If the clear button has focus, let the browser handle ArrowDown normally.
|
|
1338
1345
|
if (isClearBtnFocused(ctx)) {
|
|
1339
|
-
evt.stopPropagation();
|
|
1340
1346
|
return;
|
|
1341
1347
|
}
|
|
1342
1348
|
|
|
1343
|
-
if
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
component.setClearBtnFocus();
|
|
1349
|
-
} else {
|
|
1350
|
-
// Prevent the keypress from bubbling to parent containers (e.g., forms)
|
|
1351
|
-
// which could interpret Enter as a submit or trigger other unintended behavior.
|
|
1352
|
-
// This is safe because showBib() opens the dialog programmatically,
|
|
1353
|
-
// not via event propagation.
|
|
1354
|
-
evt.preventDefault();
|
|
1355
|
-
evt.stopPropagation();
|
|
1356
|
-
component.showBib();
|
|
1357
|
-
}
|
|
1358
|
-
},
|
|
1359
|
-
|
|
1360
|
-
Tab(component, evt, ctx) {
|
|
1361
|
-
if (!ctx.isExpanded) {
|
|
1362
|
-
return;
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
// Shift+Tab moves the highlight to the first non-disabled option
|
|
1366
|
-
// without making a selection or closing the bib.
|
|
1367
|
-
if (evt.shiftKey) {
|
|
1368
|
-
evt.preventDefault();
|
|
1369
|
-
const firstActive = component.menu.menuService.menuOptions.find((option) => option.isActive);
|
|
1370
|
-
if (firstActive) {
|
|
1371
|
-
component.menu.updateActiveOption(firstActive);
|
|
1372
|
-
}
|
|
1373
|
-
return;
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
|
-
if (ctx.isModal) {
|
|
1377
|
-
if (!ctx.activeInput) {
|
|
1378
|
-
return;
|
|
1379
|
-
}
|
|
1380
|
-
const clearBtn = getClearBtn(ctx);
|
|
1381
|
-
const clearBtnHasFocus = isClearBtnFocused(ctx, clearBtn);
|
|
1382
|
-
|
|
1383
|
-
// Tab from input: if clear button exists and doesn't have focus, focus it
|
|
1384
|
-
if (clearBtn && !clearBtnHasFocus && ctx.activeInput.value) {
|
|
1385
|
-
// Force clear button container visible to work around Safari not
|
|
1386
|
-
// propagating :focus-within through shadow DOM boundaries, which
|
|
1387
|
-
// causes .wrapper:not(:focus-within) to hide .notification.clear.
|
|
1388
|
-
const clearContainer = clearBtn.closest('.clear');
|
|
1389
|
-
if (clearContainer) {
|
|
1390
|
-
clearContainer.style.display = 'flex';
|
|
1391
|
-
clearBtn.addEventListener('focusout', () => {
|
|
1392
|
-
// Delay cleanup so :focus-within settles when focus moves
|
|
1393
|
-
// to a sibling (e.g., Shift+Tab back to the input).
|
|
1394
|
-
requestAnimationFrame(() => {
|
|
1395
|
-
clearContainer.style.display = '';
|
|
1396
|
-
});
|
|
1397
|
-
}, { once: true });
|
|
1398
|
-
}
|
|
1349
|
+
// option display and navigation are prevented if there are no available options
|
|
1350
|
+
if (component.availableOptions.length > 0) {
|
|
1351
|
+
// navigate if bib is open otherwise open it
|
|
1352
|
+
if (component.dropdown.isPopoverVisible) {
|
|
1353
|
+
evt.preventDefault();
|
|
1399
1354
|
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
const nativeBtn = clearBtn.shadowRoot && clearBtn.shadowRoot.querySelector('button');
|
|
1403
|
-
if (nativeBtn) {
|
|
1404
|
-
nativeBtn.focus();
|
|
1355
|
+
if (evt.altKey || evt.metaKey) {
|
|
1356
|
+
component.activateLastEnabledAvailableOption();
|
|
1405
1357
|
} else {
|
|
1406
|
-
|
|
1358
|
+
navigateArrow(component, 'down');
|
|
1407
1359
|
}
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
// Tab from clear button (or no clear button / no value) →
|
|
1412
|
-
// select the highlighted option if any, then close
|
|
1413
|
-
if (component.optionActive) {
|
|
1414
|
-
component.menu.makeSelection();
|
|
1360
|
+
} else {
|
|
1361
|
+
component.showBib();
|
|
1415
1362
|
}
|
|
1416
|
-
component.hideBib();
|
|
1417
|
-
return;
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
// Non-fullscreen: select + close
|
|
1421
|
-
if (component.menu.optionActive && component.menu.optionActive.value) {
|
|
1422
|
-
component.menu.value = component.menu.optionActive.value;
|
|
1423
1363
|
}
|
|
1424
|
-
component.hideBib();
|
|
1425
1364
|
},
|
|
1426
1365
|
|
|
1427
1366
|
ArrowUp(component, evt, ctx) {
|
|
@@ -1430,31 +1369,85 @@ const comboboxKeyboardStrategy = {
|
|
|
1430
1369
|
return;
|
|
1431
1370
|
}
|
|
1432
1371
|
|
|
1372
|
+
// option display and navigation are prevented if there are no available options
|
|
1433
1373
|
if (component.availableOptions.length > 0) {
|
|
1434
|
-
|
|
1374
|
+
// navigate if bib is open otherwise open it
|
|
1375
|
+
if (component.dropdown.isPopoverVisible) {
|
|
1376
|
+
evt.preventDefault();
|
|
1377
|
+
|
|
1378
|
+
if (evt.altKey || evt.metaKey) {
|
|
1379
|
+
component.activateFirstEnabledAvailableOption();
|
|
1380
|
+
} else {
|
|
1381
|
+
navigateArrow(component, 'up');
|
|
1382
|
+
}
|
|
1383
|
+
} else {
|
|
1384
|
+
component.showBib();
|
|
1385
|
+
}
|
|
1435
1386
|
}
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1387
|
+
},
|
|
1388
|
+
|
|
1389
|
+
End(component, evt, ctx) {
|
|
1390
|
+
if (ctx.isExpanded) {
|
|
1439
1391
|
evt.preventDefault();
|
|
1440
|
-
|
|
1392
|
+
evt.stopPropagation();
|
|
1393
|
+
component.activateLastEnabledAvailableOption();
|
|
1441
1394
|
}
|
|
1442
1395
|
},
|
|
1443
1396
|
|
|
1444
|
-
|
|
1445
|
-
// If the clear button has focus, let the browser handle ArrowDown normally.
|
|
1397
|
+
Enter(component, evt, ctx) {
|
|
1446
1398
|
if (isClearBtnFocused(ctx)) {
|
|
1447
|
-
|
|
1448
|
-
|
|
1399
|
+
// If the clear button has focus, let the browser activate it normally.
|
|
1400
|
+
// stopPropagation prevents parent containers (e.g., forms) from treating
|
|
1401
|
+
// Enter as a submit, but we must NOT call preventDefault — that would
|
|
1402
|
+
// block the browser's built-in "Enter activates focused button" behavior.
|
|
1403
|
+
evt.stopPropagation();
|
|
1404
|
+
} else if (ctx.isExpanded && component.menu.optionActive) {
|
|
1405
|
+
component.menu.makeSelection();
|
|
1449
1406
|
|
|
1450
|
-
|
|
1407
|
+
if (ctx.isModal) {
|
|
1408
|
+
component.setTriggerInputFocus();
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
evt.preventDefault();
|
|
1412
|
+
evt.stopPropagation();
|
|
1413
|
+
} else {
|
|
1414
|
+
// Prevent the keypress from bubbling to parent containers (e.g., forms)
|
|
1415
|
+
// which could interpret Enter as a submit or trigger other unintended behavior.
|
|
1416
|
+
// This is safe because showBib() opens the dialog programmatically,
|
|
1417
|
+
// not via event propagation.
|
|
1418
|
+
evt.preventDefault();
|
|
1419
|
+
evt.stopPropagation();
|
|
1451
1420
|
component.showBib();
|
|
1452
1421
|
}
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1422
|
+
},
|
|
1423
|
+
|
|
1424
|
+
Escape(component, _evt, ctx) {
|
|
1425
|
+
if (ctx.isExpanded && ctx.isModal) {
|
|
1426
|
+
component.setTriggerInputFocus();
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
|
|
1430
|
+
Home(component, evt, ctx) {
|
|
1431
|
+
if (ctx.isExpanded) {
|
|
1456
1432
|
evt.preventDefault();
|
|
1457
|
-
|
|
1433
|
+
evt.stopPropagation();
|
|
1434
|
+
component.activateFirstEnabledAvailableOption();
|
|
1435
|
+
}
|
|
1436
|
+
},
|
|
1437
|
+
|
|
1438
|
+
Tab(component, evt, ctx) {
|
|
1439
|
+
if (ctx.isExpanded && !isClearBtnFocused(ctx)) {
|
|
1440
|
+
// ClearBtn will not bubble up tab key events when it's focused, so need to manage it here when focused
|
|
1441
|
+
component.menu.makeSelection();
|
|
1442
|
+
component.hideBib();
|
|
1443
|
+
|
|
1444
|
+
// In fullscreen modal mode, closing the dialog does not
|
|
1445
|
+
// automatically restores focus to the input. In the tab case,
|
|
1446
|
+
// Explicitly move focus to the trigger's clear button so the
|
|
1447
|
+
// user can continues tabbing through the page normally.
|
|
1448
|
+
if (ctx.isModal && !evt.shiftKey) {
|
|
1449
|
+
component.setClearBtnFocus();
|
|
1450
|
+
}
|
|
1458
1451
|
}
|
|
1459
1452
|
},
|
|
1460
1453
|
};
|
|
@@ -3272,6 +3265,11 @@ class AuroFloatingUI {
|
|
|
3272
3265
|
this.clickHandler = null;
|
|
3273
3266
|
this.keyDownHandler = null;
|
|
3274
3267
|
|
|
3268
|
+
/**
|
|
3269
|
+
* @private
|
|
3270
|
+
*/
|
|
3271
|
+
this.enableKeyboardHandling = true;
|
|
3272
|
+
|
|
3275
3273
|
/**
|
|
3276
3274
|
* @private
|
|
3277
3275
|
*/
|
|
@@ -3532,11 +3530,10 @@ class AuroFloatingUI {
|
|
|
3532
3530
|
return;
|
|
3533
3531
|
}
|
|
3534
3532
|
|
|
3535
|
-
const { activeElement } = document;
|
|
3536
3533
|
// if focus is still inside of trigger or bib, do not close
|
|
3537
3534
|
if (
|
|
3538
|
-
this.element.
|
|
3539
|
-
this.element.
|
|
3535
|
+
this.element.matches(":focus") ||
|
|
3536
|
+
this.element.matches(":focus-within")
|
|
3540
3537
|
) {
|
|
3541
3538
|
return;
|
|
3542
3539
|
}
|
|
@@ -3607,7 +3604,9 @@ class AuroFloatingUI {
|
|
|
3607
3604
|
document.addEventListener("focusin", this.focusHandler);
|
|
3608
3605
|
}
|
|
3609
3606
|
|
|
3610
|
-
|
|
3607
|
+
if (this.enableKeyboardHandling) {
|
|
3608
|
+
document.addEventListener("keydown", this.keyDownHandler);
|
|
3609
|
+
}
|
|
3611
3610
|
|
|
3612
3611
|
// send this task to the end of queue to prevent conflicting
|
|
3613
3612
|
// it conflicts if showBib gets call from a button that's not this.element.trigger
|
|
@@ -3863,8 +3862,9 @@ class AuroFloatingUI {
|
|
|
3863
3862
|
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
3864
3863
|
}
|
|
3865
3864
|
|
|
3866
|
-
configure(elem, eventPrefix) {
|
|
3865
|
+
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
3867
3866
|
AuroFloatingUI.setupMousePressChecker();
|
|
3867
|
+
this.enableKeyboardHandling = enableKeyboardHandling;
|
|
3868
3868
|
|
|
3869
3869
|
this.eventPrefix = eventPrefix;
|
|
3870
3870
|
if (this.element !== elem) {
|
|
@@ -3897,7 +3897,9 @@ class AuroFloatingUI {
|
|
|
3897
3897
|
|
|
3898
3898
|
this.handleEvent = this.handleEvent.bind(this);
|
|
3899
3899
|
if (this.element.trigger) {
|
|
3900
|
-
|
|
3900
|
+
if (this.enableKeyboardHandling) {
|
|
3901
|
+
this.element.trigger.addEventListener("keydown", this.handleEvent);
|
|
3902
|
+
}
|
|
3901
3903
|
this.element.trigger.addEventListener("click", this.handleEvent);
|
|
3902
3904
|
this.element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
3903
3905
|
this.element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
@@ -4375,12 +4377,83 @@ let p$4 = class p{registerComponent(t,a){customElements.get(t)||customElements.d
|
|
|
4375
4377
|
|
|
4376
4378
|
var iconVersion$3 = '9.1.2';
|
|
4377
4379
|
|
|
4380
|
+
/**
|
|
4381
|
+
* Computes display state once per keydown event.
|
|
4382
|
+
* Centralizes null-safety checks and makes the shared/modal/popover branching explicit.
|
|
4383
|
+
*
|
|
4384
|
+
* @param {HTMLElement} component - The component with a dropdown reference.
|
|
4385
|
+
* @param {Object} [options] - Optional config.
|
|
4386
|
+
* @param {HTMLElement} [options.dropdown] - Explicit dropdown reference. Falls back to component.dropdown.
|
|
4387
|
+
* @param {Function} [options.inputResolver] - Called with (component, ctx) to resolve the active input element.
|
|
4388
|
+
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
4389
|
+
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
4390
|
+
*/
|
|
4391
|
+
function createDisplayContext(component, options = {}) {
|
|
4392
|
+
const dd = options.dropdown || component.dropdown;
|
|
4393
|
+
// isPopoverVisible reflects as the `open` attribute.
|
|
4394
|
+
// It reports whether the bib is open in any mode (popover or modal).
|
|
4395
|
+
const isExpanded = Boolean(dd && dd.isPopoverVisible);
|
|
4396
|
+
const isFullscreen = Boolean(dd && dd.isBibFullscreen);
|
|
4397
|
+
|
|
4398
|
+
const ctx = {
|
|
4399
|
+
isExpanded,
|
|
4400
|
+
isModal: isFullscreen,
|
|
4401
|
+
isPopover: !isFullscreen,
|
|
4402
|
+
activeInput: null,
|
|
4403
|
+
};
|
|
4404
|
+
|
|
4405
|
+
if (options.inputResolver) {
|
|
4406
|
+
const resolvedInput = options.inputResolver(component, ctx);
|
|
4407
|
+
// Guard against resolvers returning undefined or non-HTMLElement values.
|
|
4408
|
+
ctx.activeInput = resolvedInput instanceof HTMLElement ? resolvedInput : null;
|
|
4409
|
+
}
|
|
4410
|
+
|
|
4411
|
+
return ctx;
|
|
4412
|
+
}
|
|
4413
|
+
|
|
4414
|
+
/**
|
|
4415
|
+
* Wires up a keydown listener that dispatches to strategy[evt.key] or strategy.default.
|
|
4416
|
+
* Handles both sync and async handlers.
|
|
4417
|
+
* @param {HTMLElement} component - The component to attach the listener to.
|
|
4418
|
+
* @param {Object} strategy - Map of key names to handler functions.
|
|
4419
|
+
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
4420
|
+
*/
|
|
4421
|
+
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
4422
|
+
component.addEventListener('keydown', async (evt) => {
|
|
4423
|
+
const handler = strategy[evt.key] || strategy.default;
|
|
4424
|
+
if (typeof handler === 'function') {
|
|
4425
|
+
const ctx = createDisplayContext(component, options);
|
|
4426
|
+
await handler(component, evt, ctx);
|
|
4427
|
+
}
|
|
4428
|
+
});
|
|
4429
|
+
}
|
|
4430
|
+
|
|
4378
4431
|
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}`;
|
|
4379
4432
|
|
|
4380
4433
|
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)}`;
|
|
4381
4434
|
|
|
4382
4435
|
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)}`;
|
|
4383
4436
|
|
|
4437
|
+
/**
|
|
4438
|
+
* Creates a keyboard strategy for dialog-specific key handling.
|
|
4439
|
+
* All other keydown behavior is left to the browser's native bubbling path.
|
|
4440
|
+
* @param {HTMLElement} bib - The dropdown bib element.
|
|
4441
|
+
* @returns {Object} Keyboard handlers keyed by `event.key`.
|
|
4442
|
+
*/
|
|
4443
|
+
// eslint-disable-next-line no-unused-vars
|
|
4444
|
+
function createDropdownBibKeyboardStrategy(bib) {
|
|
4445
|
+
return {
|
|
4446
|
+
// eslint-disable-next-line no-unused-vars
|
|
4447
|
+
Enter(_dialog, event) {
|
|
4448
|
+
// Floating UI handles Enter key to open the dropdown
|
|
4449
|
+
},
|
|
4450
|
+
// eslint-disable-next-line no-unused-vars
|
|
4451
|
+
Escape(_dialog, event) {
|
|
4452
|
+
// Floating UI handles Escape key to close the dropdown
|
|
4453
|
+
}
|
|
4454
|
+
};
|
|
4455
|
+
}
|
|
4456
|
+
|
|
4384
4457
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
4385
4458
|
// See LICENSE in the project root for license information.
|
|
4386
4459
|
/* eslint-disable max-lines */
|
|
@@ -4505,11 +4578,7 @@ class AuroDropdownBib extends i$4 {
|
|
|
4505
4578
|
},
|
|
4506
4579
|
|
|
4507
4580
|
/**
|
|
4508
|
-
*
|
|
4509
|
-
* aria-activedescendant. The dialog keyboard bridge checks this
|
|
4510
|
-
* flag so that Enter selects the highlighted option instead of
|
|
4511
|
-
* activating the focused interactive element (e.g. the trigger
|
|
4512
|
-
* button, or the bibtemplate close button in fullscreen).
|
|
4581
|
+
* Tracks whether a menu option is currently highlighted.
|
|
4513
4582
|
* @private
|
|
4514
4583
|
*/
|
|
4515
4584
|
hasActiveDescendant: {
|
|
@@ -4583,7 +4652,7 @@ class AuroDropdownBib extends i$4 {
|
|
|
4583
4652
|
|
|
4584
4653
|
const dialog = this.shadowRoot.querySelector('dialog');
|
|
4585
4654
|
this._setupCancelHandler(dialog);
|
|
4586
|
-
|
|
4655
|
+
applyKeyboardStrategy(dialog, createDropdownBibKeyboardStrategy());
|
|
4587
4656
|
|
|
4588
4657
|
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
4589
4658
|
bubbles: true,
|
|
@@ -4610,92 +4679,6 @@ class AuroDropdownBib extends i$4 {
|
|
|
4610
4679
|
});
|
|
4611
4680
|
}
|
|
4612
4681
|
|
|
4613
|
-
/**
|
|
4614
|
-
* showModal() creates a closed focus scope — keyboard events inside
|
|
4615
|
-
* the dialog's shadow DOM do NOT bubble out to the combobox/select
|
|
4616
|
-
* keydown handlers in the parent shadow DOM. This handler bridges
|
|
4617
|
-
* that gap by re-dispatching navigation keys so they cross the
|
|
4618
|
-
* shadow boundary and reach the menu navigation logic in the parent
|
|
4619
|
-
* component.
|
|
4620
|
-
*
|
|
4621
|
-
* The trade-off: intercepting these keys means native keyboard
|
|
4622
|
-
* behaviors that would normally "just work" must be manually
|
|
4623
|
-
* re-implemented here:
|
|
4624
|
-
*
|
|
4625
|
-
* - Enter on buttons: Custom elements (auro-button) don't get the
|
|
4626
|
-
* native Enter→click that <button> provides, so we call .click()
|
|
4627
|
-
* directly when Enter is pressed on a button-like element.
|
|
4628
|
-
*
|
|
4629
|
-
* - Tab: Intercepted and re-dispatched so parent components
|
|
4630
|
-
* (select/combobox) can select the active option and close the
|
|
4631
|
-
* dialog. The <dialog> provides containment and isolation
|
|
4632
|
-
* (inert background, VoiceOver focus trapping, top layer), while
|
|
4633
|
-
* the content inside is a role="listbox" navigated via
|
|
4634
|
-
* aria-activedescendant (options are not focusable). Tab keyboard
|
|
4635
|
-
* behavior follows listbox conventions (select + close) because
|
|
4636
|
-
* the dialog's native Tab trap only cycles between the close
|
|
4637
|
-
* button and browser chrome.
|
|
4638
|
-
*
|
|
4639
|
-
* - Escape: The native <dialog> fires a `cancel` event on ESC
|
|
4640
|
-
* (handled by _setupCancelHandler), so the re-dispatched Escape
|
|
4641
|
-
* is a secondary path for parent components that also listen for
|
|
4642
|
-
* Escape keydown.
|
|
4643
|
-
*
|
|
4644
|
-
* @param {HTMLDialogElement} dialog - The dialog element to attach the keyboard bridge to.
|
|
4645
|
-
* @private
|
|
4646
|
-
*/
|
|
4647
|
-
_setupKeyboardBridge(dialog) {
|
|
4648
|
-
const navKeys = new Set([
|
|
4649
|
-
'ArrowUp',
|
|
4650
|
-
'ArrowDown',
|
|
4651
|
-
'Enter',
|
|
4652
|
-
'Escape',
|
|
4653
|
-
'Tab'
|
|
4654
|
-
]);
|
|
4655
|
-
|
|
4656
|
-
dialog.addEventListener('keydown', (event) => {
|
|
4657
|
-
if (!navKeys.has(event.key)) {
|
|
4658
|
-
return;
|
|
4659
|
-
}
|
|
4660
|
-
|
|
4661
|
-
// Custom elements (auro-button) don't get the native Enter→click
|
|
4662
|
-
// behavior that <button> has. Find the button in the composed path
|
|
4663
|
-
// and click it directly — but only when no menu option is
|
|
4664
|
-
// highlighted. In fullscreen mode focus stays on the close button
|
|
4665
|
-
// while arrow keys move the active-descendant highlight through
|
|
4666
|
-
// the listbox. If the user presses Enter with an option
|
|
4667
|
-
// highlighted, the intent is to select that option, not to click
|
|
4668
|
-
// the close button. In that case we fall through and bridge the
|
|
4669
|
-
// Enter key to the parent component's keyboard strategy.
|
|
4670
|
-
if (event.key === 'Enter') {
|
|
4671
|
-
if (!this.hasActiveDescendant) {
|
|
4672
|
-
const buttonSelector = 'button, [role="button"], auro-button, [auro-button]';
|
|
4673
|
-
const btn = event.composedPath().find((el) => el.matches && el.matches(buttonSelector));
|
|
4674
|
-
if (btn) {
|
|
4675
|
-
event.preventDefault();
|
|
4676
|
-
event.stopPropagation();
|
|
4677
|
-
btn.click();
|
|
4678
|
-
return;
|
|
4679
|
-
}
|
|
4680
|
-
}
|
|
4681
|
-
}
|
|
4682
|
-
|
|
4683
|
-
event.preventDefault();
|
|
4684
|
-
event.stopPropagation();
|
|
4685
|
-
const newEvent = new KeyboardEvent('keydown', {
|
|
4686
|
-
key: event.key,
|
|
4687
|
-
code: event.code,
|
|
4688
|
-
shiftKey: event.shiftKey,
|
|
4689
|
-
altKey: event.altKey,
|
|
4690
|
-
ctrlKey: event.ctrlKey,
|
|
4691
|
-
metaKey: event.metaKey,
|
|
4692
|
-
bubbles: true,
|
|
4693
|
-
composed: true,
|
|
4694
|
-
cancelable: true
|
|
4695
|
-
});
|
|
4696
|
-
this.dispatchEvent(newEvent);
|
|
4697
|
-
});
|
|
4698
|
-
}
|
|
4699
4682
|
|
|
4700
4683
|
/**
|
|
4701
4684
|
* Blocks touch-driven page scroll while a fullscreen modal dialog is open.
|
|
@@ -5070,7 +5053,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
|
|
|
5070
5053
|
}
|
|
5071
5054
|
};
|
|
5072
5055
|
|
|
5073
|
-
var formkitVersion$2 = '
|
|
5056
|
+
var formkitVersion$2 = '202604031704';
|
|
5074
5057
|
|
|
5075
5058
|
let AuroElement$2 = class AuroElement extends i$4 {
|
|
5076
5059
|
static get properties() {
|
|
@@ -5251,7 +5234,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5251
5234
|
this.appearance = 'default';
|
|
5252
5235
|
this.chevron = false;
|
|
5253
5236
|
this.disabled = false;
|
|
5254
|
-
this.
|
|
5237
|
+
this.disableKeyboardHandling = false;
|
|
5255
5238
|
this.error = false;
|
|
5256
5239
|
this.tabIndex = 0;
|
|
5257
5240
|
this.noToggle = false;
|
|
@@ -5349,9 +5332,8 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5349
5332
|
// showModal() fires asynchronously via Lit's update cycle, which
|
|
5350
5333
|
// falls outside the user activation window and causes iOS to
|
|
5351
5334
|
// dismiss the keyboard.
|
|
5352
|
-
if (this.
|
|
5353
|
-
|
|
5354
|
-
this.bibElement.value.open(useModal);
|
|
5335
|
+
if (this.bibElement && this.bibElement.value) {
|
|
5336
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
5355
5337
|
}
|
|
5356
5338
|
}
|
|
5357
5339
|
|
|
@@ -5465,9 +5447,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5465
5447
|
},
|
|
5466
5448
|
|
|
5467
5449
|
/**
|
|
5468
|
-
* If declared, the
|
|
5450
|
+
* If declared, the dropdown will not handle keyboard events and will require the consumer to manage this behavior.
|
|
5469
5451
|
*/
|
|
5470
|
-
|
|
5452
|
+
disableKeyboardHandling: {
|
|
5471
5453
|
type: Boolean,
|
|
5472
5454
|
reflect: true
|
|
5473
5455
|
},
|
|
@@ -5745,7 +5727,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5745
5727
|
if (this.isPopoverVisible) {
|
|
5746
5728
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
5747
5729
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
5748
|
-
const useModal = this.isBibFullscreen
|
|
5730
|
+
const useModal = this.isBibFullscreen;
|
|
5749
5731
|
this.bibElement.value.open(useModal);
|
|
5750
5732
|
} else {
|
|
5751
5733
|
this.bibElement.value.close();
|
|
@@ -5755,7 +5737,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5755
5737
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
5756
5738
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
5757
5739
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
5758
|
-
const useModal = this.isBibFullscreen
|
|
5740
|
+
const useModal = this.isBibFullscreen;
|
|
5759
5741
|
this.bibElement.value.close();
|
|
5760
5742
|
this.bibElement.value.open(useModal);
|
|
5761
5743
|
}
|
|
@@ -5777,7 +5759,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5777
5759
|
|
|
5778
5760
|
firstUpdated() {
|
|
5779
5761
|
// Configure the floater to, this will generate the ID for the bib
|
|
5780
|
-
this.floater.configure(this, 'auroDropdown');
|
|
5762
|
+
this.floater.configure(this, 'auroDropdown', !this.disableKeyboardHandling);
|
|
5781
5763
|
|
|
5782
5764
|
// Prevent `contain: layout` on the dropdown host. Layout containment
|
|
5783
5765
|
// creates a containing block for position:fixed descendants (the bib),
|
|
@@ -5867,7 +5849,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5867
5849
|
* @private
|
|
5868
5850
|
*/
|
|
5869
5851
|
updateFocusTrap() {
|
|
5870
|
-
if (this.isPopoverVisible
|
|
5852
|
+
if (this.isPopoverVisible) {
|
|
5871
5853
|
if (!this.isBibFullscreen) {
|
|
5872
5854
|
// Desktop: show() doesn't trap focus, so use FocusTrap
|
|
5873
5855
|
this.focusTrap = new FocusTrap(this.bibContent);
|
|
@@ -6085,6 +6067,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
6085
6067
|
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
6086
6068
|
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
6087
6069
|
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
6070
|
+
aria-disabled="${o(this.disabled ? 'true' : undefined)}"
|
|
6088
6071
|
@focusin="${this.handleFocusin}"
|
|
6089
6072
|
@blur="${this.handleFocusOut}">
|
|
6090
6073
|
<div class="triggerContentWrapper" id="triggerLabel">
|
|
@@ -11811,6 +11794,12 @@ class BaseInput extends AuroElement$1 {
|
|
|
11811
11794
|
this.wrapperElement = this.shadowRoot.querySelector('.wrapper');
|
|
11812
11795
|
this.inputElement = this.renderRoot.querySelector('input');
|
|
11813
11796
|
this.labelElement = this.shadowRoot.querySelector('label');
|
|
11797
|
+
this.clearBtn = this.clearButtonRef.value;
|
|
11798
|
+
|
|
11799
|
+
// This must get moved into inputKeyboardStrategy when implemented
|
|
11800
|
+
this.clearBtn.addEventListener('keydown', (evt) => {
|
|
11801
|
+
evt.stopPropagation();
|
|
11802
|
+
});
|
|
11814
11803
|
|
|
11815
11804
|
this.patchInputEvent(this.inputElement);
|
|
11816
11805
|
|
|
@@ -12834,7 +12823,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
|
|
|
12834
12823
|
}
|
|
12835
12824
|
};
|
|
12836
12825
|
|
|
12837
|
-
var formkitVersion$1 = '
|
|
12826
|
+
var formkitVersion$1 = '202604031704';
|
|
12838
12827
|
|
|
12839
12828
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12840
12829
|
// See LICENSE in the project root for license information.
|
|
@@ -12891,6 +12880,11 @@ class AuroInput extends BaseInput {
|
|
|
12891
12880
|
* @private
|
|
12892
12881
|
*/
|
|
12893
12882
|
this.iconTag = versioning.generateTag('auro-formkit-input-icon', iconVersion$2, _$2);
|
|
12883
|
+
|
|
12884
|
+
/**
|
|
12885
|
+
* @private
|
|
12886
|
+
*/
|
|
12887
|
+
this.clearButtonRef = e$1();
|
|
12894
12888
|
}
|
|
12895
12889
|
|
|
12896
12890
|
static get styles() {
|
|
@@ -12908,6 +12902,19 @@ class AuroInput extends BaseInput {
|
|
|
12908
12902
|
];
|
|
12909
12903
|
}
|
|
12910
12904
|
|
|
12905
|
+
/**
|
|
12906
|
+
* Returns classmap configuration for the clear button visibility.
|
|
12907
|
+
* The button is hidden when the input has no value, is read-only, or is disabled.
|
|
12908
|
+
* @private
|
|
12909
|
+
* @returns {Record<string, boolean>} - Classmap object controlling clear button display state.
|
|
12910
|
+
*/
|
|
12911
|
+
get clearBtnClassMap() {
|
|
12912
|
+
return {
|
|
12913
|
+
'util_displayHidden': !this.hasValue || this.readyOnly || this.disabled
|
|
12914
|
+
};
|
|
12915
|
+
}
|
|
12916
|
+
|
|
12917
|
+
|
|
12911
12918
|
/**
|
|
12912
12919
|
* Determines if the HTML input element should be visually hidden.
|
|
12913
12920
|
* Returns true when display value content exists without focus and has a value,
|
|
@@ -13227,10 +13234,11 @@ class AuroInput extends BaseInput {
|
|
|
13227
13234
|
<${this.buttonTag}
|
|
13228
13235
|
@click="${this.handleClickClear}"
|
|
13229
13236
|
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
13230
|
-
class="notificationBtn clearBtn"
|
|
13237
|
+
class="notificationBtn clearBtn ${e$3(this.clearBtnClassMap)}"
|
|
13231
13238
|
shape="circle"
|
|
13232
13239
|
size="sm"
|
|
13233
|
-
variant="ghost"
|
|
13240
|
+
variant="ghost"
|
|
13241
|
+
${n$2(this.clearButtonRef)}>
|
|
13234
13242
|
<span><slot name="ariaLabel.clear">Clear Input</slot></span>
|
|
13235
13243
|
<${this.iconTag}
|
|
13236
13244
|
aria-hidden="true"
|
|
@@ -13375,11 +13383,7 @@ class AuroInput extends BaseInput {
|
|
|
13375
13383
|
<div part="accent-right" class="accents right">
|
|
13376
13384
|
${this.renderValidationErrorIconHtml()}
|
|
13377
13385
|
${this.hasValue && this.type === 'password' ? this.renderHtmlNotificationPassword() : undefined}
|
|
13378
|
-
${this.
|
|
13379
|
-
${!this.disabled && !this.readonly ? u$7`
|
|
13380
|
-
${this.renderHtmlActionClear()}
|
|
13381
|
-
` : undefined}
|
|
13382
|
-
` : undefined}
|
|
13386
|
+
${this.renderHtmlActionClear()}
|
|
13383
13387
|
</div>
|
|
13384
13388
|
</div>
|
|
13385
13389
|
<div class="helpTextWrapper leftIndent rightIndent" part="inputHelpText">
|
|
@@ -13411,11 +13415,7 @@ class AuroInput extends BaseInput {
|
|
|
13411
13415
|
${this.layout.includes('right') || this.layout === "emphasized" ? u$7`
|
|
13412
13416
|
${this.renderValidationErrorIconHtml()}
|
|
13413
13417
|
` : undefined}
|
|
13414
|
-
${this.
|
|
13415
|
-
${!this.disabled && !this.readonly ? u$7`
|
|
13416
|
-
${this.renderHtmlActionClear()}
|
|
13417
|
-
` : undefined}
|
|
13418
|
-
` : undefined}
|
|
13418
|
+
${this.renderHtmlActionClear()}
|
|
13419
13419
|
</div>
|
|
13420
13420
|
</div>
|
|
13421
13421
|
<div class="${e$3(this.helpTextClasses)}" part="inputHelpText">
|
|
@@ -13443,11 +13443,7 @@ class AuroInput extends BaseInput {
|
|
|
13443
13443
|
</div>
|
|
13444
13444
|
<div class="accents right">
|
|
13445
13445
|
${this.renderValidationErrorIconHtml()}
|
|
13446
|
-
${this.
|
|
13447
|
-
${!this.disabled && !this.readonly ? u$7`
|
|
13448
|
-
${this.renderHtmlActionClear()}
|
|
13449
|
-
` : undefined}
|
|
13450
|
-
` : undefined}
|
|
13446
|
+
${this.renderHtmlActionClear()}
|
|
13451
13447
|
</div>
|
|
13452
13448
|
</div>
|
|
13453
13449
|
<div class="helpTextWrapper leftIndent rightIndent" part="inputHelpText">
|
|
@@ -13873,7 +13869,7 @@ class AuroBibtemplate extends i$4 {
|
|
|
13873
13869
|
}
|
|
13874
13870
|
}
|
|
13875
13871
|
|
|
13876
|
-
var formkitVersion = '
|
|
13872
|
+
var formkitVersion = '202604031704';
|
|
13877
13873
|
|
|
13878
13874
|
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}`;
|
|
13879
13875
|
|
|
@@ -14352,6 +14348,7 @@ class AuroCombobox extends AuroElement {
|
|
|
14352
14348
|
|
|
14353
14349
|
/**
|
|
14354
14350
|
* Array of available options to display in the dropdown.
|
|
14351
|
+
* This array contains all non-hidden options (e.g., hidden by filtering on input value).
|
|
14355
14352
|
* @private
|
|
14356
14353
|
*/
|
|
14357
14354
|
availableOptions: {
|
|
@@ -14729,12 +14726,40 @@ class AuroCombobox extends AuroElement {
|
|
|
14729
14726
|
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroCombobox);
|
|
14730
14727
|
}
|
|
14731
14728
|
|
|
14729
|
+
/**
|
|
14730
|
+
* Mark the first available (non-hidden), enabled option as `active`.
|
|
14731
|
+
* @private
|
|
14732
|
+
* @returns {void}
|
|
14733
|
+
*/
|
|
14734
|
+
activateFirstEnabledAvailableOption() {
|
|
14735
|
+
const firstEnabledOptionIndex = this.availableOptions.findIndex((opt) => !opt.disabled);
|
|
14736
|
+
this.updateActiveOption(firstEnabledOptionIndex);
|
|
14737
|
+
}
|
|
14738
|
+
|
|
14739
|
+
/**
|
|
14740
|
+
* Mark the last available (non-hidden), enabled option as `active`.
|
|
14741
|
+
* @private
|
|
14742
|
+
* @returns {void}
|
|
14743
|
+
*/
|
|
14744
|
+
activateLastEnabledAvailableOption() {
|
|
14745
|
+
let lastEnabledOptionIndex = -1;
|
|
14746
|
+
|
|
14747
|
+
// Work backwards through the available options array to find the last enabled option
|
|
14748
|
+
for (let index = this.availableOptions.length - 1; index >= 0; index -= 1) {
|
|
14749
|
+
if (!this.availableOptions[index].disabled) {
|
|
14750
|
+
lastEnabledOptionIndex = index;
|
|
14751
|
+
break;
|
|
14752
|
+
}
|
|
14753
|
+
}
|
|
14754
|
+
|
|
14755
|
+
this.updateActiveOption(lastEnabledOptionIndex);
|
|
14756
|
+
}
|
|
14757
|
+
|
|
14732
14758
|
/**
|
|
14733
14759
|
* Updates the filter for the available options based on the input value.
|
|
14734
14760
|
* @private
|
|
14735
14761
|
*/
|
|
14736
14762
|
updateFilter() {
|
|
14737
|
-
|
|
14738
14763
|
// Reset available options if noFilter is set to false after being true.
|
|
14739
14764
|
if (this.noFilter) {
|
|
14740
14765
|
this.availableOptions = [...this.options];
|
|
@@ -14853,6 +14878,10 @@ class AuroCombobox extends AuroElement {
|
|
|
14853
14878
|
if (this.value && this.input.value && !this.menu.value) {
|
|
14854
14879
|
this.syncValuesAndStates();
|
|
14855
14880
|
}
|
|
14881
|
+
|
|
14882
|
+
if (!this.availableOptions.includes(this.menu.optionActive)) {
|
|
14883
|
+
this.activateFirstEnabledAvailableOption();
|
|
14884
|
+
}
|
|
14856
14885
|
}
|
|
14857
14886
|
|
|
14858
14887
|
/**
|
|
@@ -14926,9 +14955,6 @@ class AuroCombobox extends AuroElement {
|
|
|
14926
14955
|
if (this.dropdownOpen) {
|
|
14927
14956
|
const expandedDelay = 150;
|
|
14928
14957
|
this._expandedTimeout = setTimeout(() => {
|
|
14929
|
-
if (!this.value) {
|
|
14930
|
-
this.updateActiveOption(0);
|
|
14931
|
-
}
|
|
14932
14958
|
this.triggerExpandedState = true;
|
|
14933
14959
|
}, expandedDelay);
|
|
14934
14960
|
} else {
|
|
@@ -14938,22 +14964,16 @@ class AuroCombobox extends AuroElement {
|
|
|
14938
14964
|
// Clear aria-activedescendant when dropdown closes
|
|
14939
14965
|
if (!this.dropdownOpen && this.input) {
|
|
14940
14966
|
this.input.setActiveDescendant(null);
|
|
14941
|
-
this.optionActive = null;
|
|
14942
|
-
|
|
14943
|
-
// Remove the highlighted state from all menu options so re-opening
|
|
14944
|
-
// the dropdown doesn't show a stale highlight.
|
|
14945
|
-
if (this.options) {
|
|
14946
|
-
this.options.forEach((opt) => {
|
|
14947
|
-
opt.active = false;
|
|
14948
|
-
opt.classList.remove('active');
|
|
14949
|
-
});
|
|
14950
|
-
}
|
|
14951
14967
|
|
|
14952
14968
|
// Restore pointer events on the menu in case they were disabled
|
|
14953
14969
|
// during fullscreen open to prevent touch pass-through.
|
|
14954
14970
|
this.menu.style.pointerEvents = '';
|
|
14955
14971
|
|
|
14956
|
-
|
|
14972
|
+
// When closing a fullscreen bib, restore focus to the trigger so that
|
|
14973
|
+
// keyboard navigation continues from the correct place in the page
|
|
14974
|
+
if (this.dropdown.isBibFullscreen) {
|
|
14975
|
+
restoreTriggerAfterClose(this.dropdown, this.input);
|
|
14976
|
+
}
|
|
14957
14977
|
}
|
|
14958
14978
|
|
|
14959
14979
|
if (this.dropdownOpen) {
|
|
@@ -14988,13 +15008,6 @@ class AuroCombobox extends AuroElement {
|
|
|
14988
15008
|
this.setInputFocus();
|
|
14989
15009
|
this._inFullscreenTransition = false;
|
|
14990
15010
|
});
|
|
14991
|
-
} else {
|
|
14992
|
-
// wait a frame in case the bib gets hidden immediately after showing because there is no value
|
|
14993
|
-
setTimeout(() => {
|
|
14994
|
-
if (this.componentHasFocus) {
|
|
14995
|
-
this.setInputFocus();
|
|
14996
|
-
}
|
|
14997
|
-
}, 0);
|
|
14998
15011
|
}
|
|
14999
15012
|
}
|
|
15000
15013
|
});
|
|
@@ -15044,7 +15057,25 @@ class AuroCombobox extends AuroElement {
|
|
|
15044
15057
|
setClearBtnFocus() {
|
|
15045
15058
|
const clearBtn = this.input.shadowRoot.querySelector('.clearBtn');
|
|
15046
15059
|
if (clearBtn) {
|
|
15047
|
-
|
|
15060
|
+
// Wait for the element to fully render across
|
|
15061
|
+
// multiple Lit update cycles before moving focus
|
|
15062
|
+
doubleRaf(() => {
|
|
15063
|
+
clearBtn.focus();
|
|
15064
|
+
});
|
|
15065
|
+
}
|
|
15066
|
+
}
|
|
15067
|
+
|
|
15068
|
+
/**
|
|
15069
|
+
* @private
|
|
15070
|
+
*/
|
|
15071
|
+
setTriggerInputFocus() {
|
|
15072
|
+
const input = this.input.shadowRoot.querySelector('input');
|
|
15073
|
+
if (input) {
|
|
15074
|
+
// Wait for the element to fully render across
|
|
15075
|
+
// multiple Lit update cycles before moving focus
|
|
15076
|
+
doubleRaf(() => {
|
|
15077
|
+
input.focus();
|
|
15078
|
+
});
|
|
15048
15079
|
}
|
|
15049
15080
|
}
|
|
15050
15081
|
|
|
@@ -15367,7 +15398,7 @@ class AuroCombobox extends AuroElement {
|
|
|
15367
15398
|
* @returns {void}
|
|
15368
15399
|
*/
|
|
15369
15400
|
configureCombobox() {
|
|
15370
|
-
applyKeyboardStrategy(this, comboboxKeyboardStrategy, {
|
|
15401
|
+
applyKeyboardStrategy$1(this, comboboxKeyboardStrategy, {
|
|
15371
15402
|
// In modal mode the input moves into the bib; route keyboard events to that element instead.
|
|
15372
15403
|
inputResolver: (comp, ctx) => (ctx.isModal && comp.inputInBib ? comp.inputInBib : comp.input),
|
|
15373
15404
|
});
|
|
@@ -16376,7 +16407,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
16376
16407
|
});
|
|
16377
16408
|
|
|
16378
16409
|
return u$7`
|
|
16379
|
-
<div class="${classes}">
|
|
16410
|
+
<div class="${classes}" aria-disabled="${this.disabled ? 'true' : 'false'}">
|
|
16380
16411
|
${this.selected && !this.noCheckmark
|
|
16381
16412
|
? this.generateIconHtml(checkmarkIcon.svg)
|
|
16382
16413
|
: undefined}
|
|
@@ -17147,10 +17178,10 @@ class AuroMenu extends AuroElement {
|
|
|
17147
17178
|
|
|
17148
17179
|
// Event Bindings
|
|
17149
17180
|
|
|
17150
|
-
/**
|
|
17151
|
-
|
|
17152
|
-
|
|
17153
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
17181
|
+
// /**
|
|
17182
|
+
// * @private
|
|
17183
|
+
// */
|
|
17184
|
+
// this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
17154
17185
|
|
|
17155
17186
|
|
|
17156
17187
|
/**
|
|
@@ -17499,7 +17530,7 @@ class AuroMenu extends AuroElement {
|
|
|
17499
17530
|
|
|
17500
17531
|
this.provideContext();
|
|
17501
17532
|
|
|
17502
|
-
this.addEventListener('keydown', this.handleKeyDown);
|
|
17533
|
+
// this.addEventListener('keydown', this.handleKeyDown);
|
|
17503
17534
|
this.addEventListener('auroMenuOption-click', this.handleMouseSelect);
|
|
17504
17535
|
this.addEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
17505
17536
|
this.addEventListener('slotchange', this.handleSlotChange);
|
|
@@ -17507,7 +17538,7 @@ class AuroMenu extends AuroElement {
|
|
|
17507
17538
|
}
|
|
17508
17539
|
|
|
17509
17540
|
disconnectedCallback() {
|
|
17510
|
-
this.removeEventListener('keydown', this.handleKeyDown);
|
|
17541
|
+
// this.removeEventListener('keydown', this.handleKeyDown);
|
|
17511
17542
|
this.removeEventListener('auroMenuOption-click', this.handleMouseSelect);
|
|
17512
17543
|
this.removeEventListener('auroMenuOption-mouseover', this.handleOptionHover);
|
|
17513
17544
|
this.removeEventListener('slotchange', this.handleSlotChange);
|
|
@@ -17648,26 +17679,33 @@ class AuroMenu extends AuroElement {
|
|
|
17648
17679
|
|
|
17649
17680
|
// Event Handlers
|
|
17650
17681
|
|
|
17651
|
-
/**
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
handleKeyDown(event) {
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
|
|
17669
|
-
|
|
17670
|
-
|
|
17682
|
+
// /**
|
|
17683
|
+
// * Handles keyboard navigation.
|
|
17684
|
+
// * @private
|
|
17685
|
+
// * @param {KeyboardEvent} event - Event object from the browser.
|
|
17686
|
+
// */
|
|
17687
|
+
// handleKeyDown(event) {
|
|
17688
|
+
// // Update to Chris keyboard handler
|
|
17689
|
+
// // We have a new "navigateArrow" function in that handler, maybe that replaces those keys here?
|
|
17690
|
+
// event.preventDefault();
|
|
17691
|
+
// switch (event.key) {
|
|
17692
|
+
// case "ArrowDown":
|
|
17693
|
+
// console.warn("ArrowDown key is pressed and heard from menu");
|
|
17694
|
+
// this.menuService.highlightNext();
|
|
17695
|
+
// break;
|
|
17696
|
+
// case "ArrowUp":
|
|
17697
|
+
// console.warn("ArrowUp key is pressed and heard from menu");
|
|
17698
|
+
// this.menuService.highlightPrevious();
|
|
17699
|
+
// break;
|
|
17700
|
+
// case "Tab":
|
|
17701
|
+
// case "Enter":
|
|
17702
|
+
// this.menuService.selectHighlightedOption();
|
|
17703
|
+
// // Does this need to get separated into two cases to handle the different expected behavior of tab vs enter?
|
|
17704
|
+
// break;
|
|
17705
|
+
// default:
|
|
17706
|
+
// break;
|
|
17707
|
+
// }
|
|
17708
|
+
// }
|
|
17671
17709
|
|
|
17672
17710
|
/**
|
|
17673
17711
|
* Navigates the menu options in the specified direction.
|