@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
|
@@ -1088,7 +1088,13 @@ function guardTouchPassthrough(element) {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
|
|
1090
1090
|
/**
|
|
1091
|
-
* Restores the dropdown trigger after a fullscreen dialog closes
|
|
1091
|
+
* Restores the dropdown trigger after a fullscreen dialog closes
|
|
1092
|
+
* when focus doesn't leave the component (e.g. using Esc or Enter keys).
|
|
1093
|
+
* When leaving the component (e.g., tabbing out of the combobox after closing
|
|
1094
|
+
* the fullscreen dialog), focus restoration is handled by the browser's native
|
|
1095
|
+
* dialog focus restoration behavior, so this function only restores focus
|
|
1096
|
+
* when focus remains inside the component after the dialog closes.
|
|
1097
|
+
|
|
1092
1098
|
*
|
|
1093
1099
|
* Removes the `inert` attribute from the trigger so it is accessible again,
|
|
1094
1100
|
* and restores focus to the given target after one animation frame. The rAF
|
|
@@ -1104,8 +1110,11 @@ function guardTouchPassthrough(element) {
|
|
|
1104
1110
|
function restoreTriggerAfterClose(dropdown, focusTarget) {
|
|
1105
1111
|
dropdown.trigger.inert = false;
|
|
1106
1112
|
|
|
1113
|
+
// Wait a frame so that dialog.close() has completed and the browser's
|
|
1114
|
+
// native focus restoration has run before we attempt to focus the
|
|
1115
|
+
// trigger / input programmatically.
|
|
1107
1116
|
requestAnimationFrame(() => {
|
|
1108
|
-
if (!dropdown.isPopoverVisible) {
|
|
1117
|
+
if (!dropdown.isPopoverVisible && dropdown.trigger.contains(document.activeElement)) {
|
|
1109
1118
|
focusTarget.focus();
|
|
1110
1119
|
}
|
|
1111
1120
|
});
|
|
@@ -1122,7 +1131,7 @@ function restoreTriggerAfterClose(dropdown, focusTarget) {
|
|
|
1122
1131
|
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
1123
1132
|
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
1124
1133
|
*/
|
|
1125
|
-
function createDisplayContext(component, options = {}) {
|
|
1134
|
+
function createDisplayContext$1(component, options = {}) {
|
|
1126
1135
|
const dd = options.dropdown || component.dropdown;
|
|
1127
1136
|
// isPopoverVisible reflects as the `open` attribute.
|
|
1128
1137
|
// It reports whether the bib is open in any mode (popover or modal).
|
|
@@ -1152,11 +1161,11 @@ function createDisplayContext(component, options = {}) {
|
|
|
1152
1161
|
* @param {Object} strategy - Map of key names to handler functions.
|
|
1153
1162
|
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
1154
1163
|
*/
|
|
1155
|
-
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
1164
|
+
function applyKeyboardStrategy$1(component, strategy, options = {}) {
|
|
1156
1165
|
component.addEventListener('keydown', async (evt) => {
|
|
1157
1166
|
const handler = strategy[evt.key] || strategy.default;
|
|
1158
1167
|
if (typeof handler === 'function') {
|
|
1159
|
-
const ctx = createDisplayContext(component, options);
|
|
1168
|
+
const ctx = createDisplayContext$1(component, options);
|
|
1160
1169
|
await handler(component, evt, ctx);
|
|
1161
1170
|
}
|
|
1162
1171
|
});
|
|
@@ -1206,102 +1215,32 @@ function isClearBtnFocused(ctx, clearBtn = getClearBtn(ctx)) {
|
|
|
1206
1215
|
if (!clearBtn) {
|
|
1207
1216
|
return false;
|
|
1208
1217
|
}
|
|
1209
|
-
|
|
1218
|
+
const isFocused = Boolean(clearBtn.shadowRoot && clearBtn.shadowRoot.activeElement !== null);
|
|
1219
|
+
return isFocused;
|
|
1210
1220
|
}
|
|
1211
1221
|
|
|
1212
1222
|
const comboboxKeyboardStrategy = {
|
|
1213
|
-
|
|
1214
|
-
// If the clear button has focus, let the browser
|
|
1215
|
-
// stopPropagation prevents parent containers (e.g., forms) from treating
|
|
1216
|
-
// Enter as a submit, but we must NOT call preventDefault — that would
|
|
1217
|
-
// block the browser's built-in "Enter activates focused button" behavior.
|
|
1223
|
+
ArrowDown(component, evt, ctx) {
|
|
1224
|
+
// If the clear button has focus, let the browser handle ArrowDown normally.
|
|
1218
1225
|
if (isClearBtnFocused(ctx)) {
|
|
1219
|
-
evt.stopPropagation();
|
|
1220
1226
|
return;
|
|
1221
1227
|
}
|
|
1222
1228
|
|
|
1223
|
-
if
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
component.setClearBtnFocus();
|
|
1229
|
-
} else {
|
|
1230
|
-
// Prevent the keypress from bubbling to parent containers (e.g., forms)
|
|
1231
|
-
// which could interpret Enter as a submit or trigger other unintended behavior.
|
|
1232
|
-
// This is safe because showBib() opens the dialog programmatically,
|
|
1233
|
-
// not via event propagation.
|
|
1234
|
-
evt.preventDefault();
|
|
1235
|
-
evt.stopPropagation();
|
|
1236
|
-
component.showBib();
|
|
1237
|
-
}
|
|
1238
|
-
},
|
|
1239
|
-
|
|
1240
|
-
Tab(component, evt, ctx) {
|
|
1241
|
-
if (!ctx.isExpanded) {
|
|
1242
|
-
return;
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
// Shift+Tab moves the highlight to the first non-disabled option
|
|
1246
|
-
// without making a selection or closing the bib.
|
|
1247
|
-
if (evt.shiftKey) {
|
|
1248
|
-
evt.preventDefault();
|
|
1249
|
-
const firstActive = component.menu.menuService.menuOptions.find((option) => option.isActive);
|
|
1250
|
-
if (firstActive) {
|
|
1251
|
-
component.menu.updateActiveOption(firstActive);
|
|
1252
|
-
}
|
|
1253
|
-
return;
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
if (ctx.isModal) {
|
|
1257
|
-
if (!ctx.activeInput) {
|
|
1258
|
-
return;
|
|
1259
|
-
}
|
|
1260
|
-
const clearBtn = getClearBtn(ctx);
|
|
1261
|
-
const clearBtnHasFocus = isClearBtnFocused(ctx, clearBtn);
|
|
1262
|
-
|
|
1263
|
-
// Tab from input: if clear button exists and doesn't have focus, focus it
|
|
1264
|
-
if (clearBtn && !clearBtnHasFocus && ctx.activeInput.value) {
|
|
1265
|
-
// Force clear button container visible to work around Safari not
|
|
1266
|
-
// propagating :focus-within through shadow DOM boundaries, which
|
|
1267
|
-
// causes .wrapper:not(:focus-within) to hide .notification.clear.
|
|
1268
|
-
const clearContainer = clearBtn.closest('.clear');
|
|
1269
|
-
if (clearContainer) {
|
|
1270
|
-
clearContainer.style.display = 'flex';
|
|
1271
|
-
clearBtn.addEventListener('focusout', () => {
|
|
1272
|
-
// Delay cleanup so :focus-within settles when focus moves
|
|
1273
|
-
// to a sibling (e.g., Shift+Tab back to the input).
|
|
1274
|
-
requestAnimationFrame(() => {
|
|
1275
|
-
clearContainer.style.display = '';
|
|
1276
|
-
});
|
|
1277
|
-
}, { once: true });
|
|
1278
|
-
}
|
|
1229
|
+
// option display and navigation are prevented if there are no available options
|
|
1230
|
+
if (component.availableOptions.length > 0) {
|
|
1231
|
+
// navigate if bib is open otherwise open it
|
|
1232
|
+
if (component.dropdown.isPopoverVisible) {
|
|
1233
|
+
evt.preventDefault();
|
|
1279
1234
|
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
const nativeBtn = clearBtn.shadowRoot && clearBtn.shadowRoot.querySelector('button');
|
|
1283
|
-
if (nativeBtn) {
|
|
1284
|
-
nativeBtn.focus();
|
|
1235
|
+
if (evt.altKey || evt.metaKey) {
|
|
1236
|
+
component.activateLastEnabledAvailableOption();
|
|
1285
1237
|
} else {
|
|
1286
|
-
|
|
1238
|
+
navigateArrow(component, 'down');
|
|
1287
1239
|
}
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
// Tab from clear button (or no clear button / no value) →
|
|
1292
|
-
// select the highlighted option if any, then close
|
|
1293
|
-
if (component.optionActive) {
|
|
1294
|
-
component.menu.makeSelection();
|
|
1240
|
+
} else {
|
|
1241
|
+
component.showBib();
|
|
1295
1242
|
}
|
|
1296
|
-
component.hideBib();
|
|
1297
|
-
return;
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
// Non-fullscreen: select + close
|
|
1301
|
-
if (component.menu.optionActive && component.menu.optionActive.value) {
|
|
1302
|
-
component.menu.value = component.menu.optionActive.value;
|
|
1303
1243
|
}
|
|
1304
|
-
component.hideBib();
|
|
1305
1244
|
},
|
|
1306
1245
|
|
|
1307
1246
|
ArrowUp(component, evt, ctx) {
|
|
@@ -1310,31 +1249,85 @@ const comboboxKeyboardStrategy = {
|
|
|
1310
1249
|
return;
|
|
1311
1250
|
}
|
|
1312
1251
|
|
|
1252
|
+
// option display and navigation are prevented if there are no available options
|
|
1313
1253
|
if (component.availableOptions.length > 0) {
|
|
1314
|
-
|
|
1254
|
+
// navigate if bib is open otherwise open it
|
|
1255
|
+
if (component.dropdown.isPopoverVisible) {
|
|
1256
|
+
evt.preventDefault();
|
|
1257
|
+
|
|
1258
|
+
if (evt.altKey || evt.metaKey) {
|
|
1259
|
+
component.activateFirstEnabledAvailableOption();
|
|
1260
|
+
} else {
|
|
1261
|
+
navigateArrow(component, 'up');
|
|
1262
|
+
}
|
|
1263
|
+
} else {
|
|
1264
|
+
component.showBib();
|
|
1265
|
+
}
|
|
1315
1266
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1267
|
+
},
|
|
1268
|
+
|
|
1269
|
+
End(component, evt, ctx) {
|
|
1270
|
+
if (ctx.isExpanded) {
|
|
1319
1271
|
evt.preventDefault();
|
|
1320
|
-
|
|
1272
|
+
evt.stopPropagation();
|
|
1273
|
+
component.activateLastEnabledAvailableOption();
|
|
1321
1274
|
}
|
|
1322
1275
|
},
|
|
1323
1276
|
|
|
1324
|
-
|
|
1325
|
-
// If the clear button has focus, let the browser handle ArrowDown normally.
|
|
1277
|
+
Enter(component, evt, ctx) {
|
|
1326
1278
|
if (isClearBtnFocused(ctx)) {
|
|
1327
|
-
|
|
1328
|
-
|
|
1279
|
+
// If the clear button has focus, let the browser activate it normally.
|
|
1280
|
+
// stopPropagation prevents parent containers (e.g., forms) from treating
|
|
1281
|
+
// Enter as a submit, but we must NOT call preventDefault — that would
|
|
1282
|
+
// block the browser's built-in "Enter activates focused button" behavior.
|
|
1283
|
+
evt.stopPropagation();
|
|
1284
|
+
} else if (ctx.isExpanded && component.menu.optionActive) {
|
|
1285
|
+
component.menu.makeSelection();
|
|
1329
1286
|
|
|
1330
|
-
|
|
1287
|
+
if (ctx.isModal) {
|
|
1288
|
+
component.setTriggerInputFocus();
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
evt.preventDefault();
|
|
1292
|
+
evt.stopPropagation();
|
|
1293
|
+
} else {
|
|
1294
|
+
// Prevent the keypress from bubbling to parent containers (e.g., forms)
|
|
1295
|
+
// which could interpret Enter as a submit or trigger other unintended behavior.
|
|
1296
|
+
// This is safe because showBib() opens the dialog programmatically,
|
|
1297
|
+
// not via event propagation.
|
|
1298
|
+
evt.preventDefault();
|
|
1299
|
+
evt.stopPropagation();
|
|
1331
1300
|
component.showBib();
|
|
1332
1301
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1302
|
+
},
|
|
1303
|
+
|
|
1304
|
+
Escape(component, _evt, ctx) {
|
|
1305
|
+
if (ctx.isExpanded && ctx.isModal) {
|
|
1306
|
+
component.setTriggerInputFocus();
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
|
|
1310
|
+
Home(component, evt, ctx) {
|
|
1311
|
+
if (ctx.isExpanded) {
|
|
1336
1312
|
evt.preventDefault();
|
|
1337
|
-
|
|
1313
|
+
evt.stopPropagation();
|
|
1314
|
+
component.activateFirstEnabledAvailableOption();
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1317
|
+
|
|
1318
|
+
Tab(component, evt, ctx) {
|
|
1319
|
+
if (ctx.isExpanded && !isClearBtnFocused(ctx)) {
|
|
1320
|
+
// ClearBtn will not bubble up tab key events when it's focused, so need to manage it here when focused
|
|
1321
|
+
component.menu.makeSelection();
|
|
1322
|
+
component.hideBib();
|
|
1323
|
+
|
|
1324
|
+
// In fullscreen modal mode, closing the dialog does not
|
|
1325
|
+
// automatically restores focus to the input. In the tab case,
|
|
1326
|
+
// Explicitly move focus to the trigger's clear button so the
|
|
1327
|
+
// user can continues tabbing through the page normally.
|
|
1328
|
+
if (ctx.isModal && !evt.shiftKey) {
|
|
1329
|
+
component.setClearBtnFocus();
|
|
1330
|
+
}
|
|
1338
1331
|
}
|
|
1339
1332
|
},
|
|
1340
1333
|
};
|
|
@@ -3128,6 +3121,11 @@ class AuroFloatingUI {
|
|
|
3128
3121
|
this.clickHandler = null;
|
|
3129
3122
|
this.keyDownHandler = null;
|
|
3130
3123
|
|
|
3124
|
+
/**
|
|
3125
|
+
* @private
|
|
3126
|
+
*/
|
|
3127
|
+
this.enableKeyboardHandling = true;
|
|
3128
|
+
|
|
3131
3129
|
/**
|
|
3132
3130
|
* @private
|
|
3133
3131
|
*/
|
|
@@ -3388,11 +3386,10 @@ class AuroFloatingUI {
|
|
|
3388
3386
|
return;
|
|
3389
3387
|
}
|
|
3390
3388
|
|
|
3391
|
-
const { activeElement } = document;
|
|
3392
3389
|
// if focus is still inside of trigger or bib, do not close
|
|
3393
3390
|
if (
|
|
3394
|
-
this.element.
|
|
3395
|
-
this.element.
|
|
3391
|
+
this.element.matches(":focus") ||
|
|
3392
|
+
this.element.matches(":focus-within")
|
|
3396
3393
|
) {
|
|
3397
3394
|
return;
|
|
3398
3395
|
}
|
|
@@ -3463,7 +3460,9 @@ class AuroFloatingUI {
|
|
|
3463
3460
|
document.addEventListener("focusin", this.focusHandler);
|
|
3464
3461
|
}
|
|
3465
3462
|
|
|
3466
|
-
|
|
3463
|
+
if (this.enableKeyboardHandling) {
|
|
3464
|
+
document.addEventListener("keydown", this.keyDownHandler);
|
|
3465
|
+
}
|
|
3467
3466
|
|
|
3468
3467
|
// send this task to the end of queue to prevent conflicting
|
|
3469
3468
|
// it conflicts if showBib gets call from a button that's not this.element.trigger
|
|
@@ -3719,8 +3718,9 @@ class AuroFloatingUI {
|
|
|
3719
3718
|
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
3720
3719
|
}
|
|
3721
3720
|
|
|
3722
|
-
configure(elem, eventPrefix) {
|
|
3721
|
+
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
3723
3722
|
AuroFloatingUI.setupMousePressChecker();
|
|
3723
|
+
this.enableKeyboardHandling = enableKeyboardHandling;
|
|
3724
3724
|
|
|
3725
3725
|
this.eventPrefix = eventPrefix;
|
|
3726
3726
|
if (this.element !== elem) {
|
|
@@ -3753,7 +3753,9 @@ class AuroFloatingUI {
|
|
|
3753
3753
|
|
|
3754
3754
|
this.handleEvent = this.handleEvent.bind(this);
|
|
3755
3755
|
if (this.element.trigger) {
|
|
3756
|
-
|
|
3756
|
+
if (this.enableKeyboardHandling) {
|
|
3757
|
+
this.element.trigger.addEventListener("keydown", this.handleEvent);
|
|
3758
|
+
}
|
|
3757
3759
|
this.element.trigger.addEventListener("click", this.handleEvent);
|
|
3758
3760
|
this.element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
3759
3761
|
this.element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
@@ -4231,12 +4233,83 @@ let p$3 = class p{registerComponent(t,a){customElements.get(t)||customElements.d
|
|
|
4231
4233
|
|
|
4232
4234
|
var iconVersion$2 = '9.1.2';
|
|
4233
4235
|
|
|
4236
|
+
/**
|
|
4237
|
+
* Computes display state once per keydown event.
|
|
4238
|
+
* Centralizes null-safety checks and makes the shared/modal/popover branching explicit.
|
|
4239
|
+
*
|
|
4240
|
+
* @param {HTMLElement} component - The component with a dropdown reference.
|
|
4241
|
+
* @param {Object} [options] - Optional config.
|
|
4242
|
+
* @param {HTMLElement} [options.dropdown] - Explicit dropdown reference. Falls back to component.dropdown.
|
|
4243
|
+
* @param {Function} [options.inputResolver] - Called with (component, ctx) to resolve the active input element.
|
|
4244
|
+
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
4245
|
+
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
4246
|
+
*/
|
|
4247
|
+
function createDisplayContext(component, options = {}) {
|
|
4248
|
+
const dd = options.dropdown || component.dropdown;
|
|
4249
|
+
// isPopoverVisible reflects as the `open` attribute.
|
|
4250
|
+
// It reports whether the bib is open in any mode (popover or modal).
|
|
4251
|
+
const isExpanded = Boolean(dd && dd.isPopoverVisible);
|
|
4252
|
+
const isFullscreen = Boolean(dd && dd.isBibFullscreen);
|
|
4253
|
+
|
|
4254
|
+
const ctx = {
|
|
4255
|
+
isExpanded,
|
|
4256
|
+
isModal: isFullscreen,
|
|
4257
|
+
isPopover: !isFullscreen,
|
|
4258
|
+
activeInput: null,
|
|
4259
|
+
};
|
|
4260
|
+
|
|
4261
|
+
if (options.inputResolver) {
|
|
4262
|
+
const resolvedInput = options.inputResolver(component, ctx);
|
|
4263
|
+
// Guard against resolvers returning undefined or non-HTMLElement values.
|
|
4264
|
+
ctx.activeInput = resolvedInput instanceof HTMLElement ? resolvedInput : null;
|
|
4265
|
+
}
|
|
4266
|
+
|
|
4267
|
+
return ctx;
|
|
4268
|
+
}
|
|
4269
|
+
|
|
4270
|
+
/**
|
|
4271
|
+
* Wires up a keydown listener that dispatches to strategy[evt.key] or strategy.default.
|
|
4272
|
+
* Handles both sync and async handlers.
|
|
4273
|
+
* @param {HTMLElement} component - The component to attach the listener to.
|
|
4274
|
+
* @param {Object} strategy - Map of key names to handler functions.
|
|
4275
|
+
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
4276
|
+
*/
|
|
4277
|
+
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
4278
|
+
component.addEventListener('keydown', async (evt) => {
|
|
4279
|
+
const handler = strategy[evt.key] || strategy.default;
|
|
4280
|
+
if (typeof handler === 'function') {
|
|
4281
|
+
const ctx = createDisplayContext(component, options);
|
|
4282
|
+
await handler(component, evt, ctx);
|
|
4283
|
+
}
|
|
4284
|
+
});
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4234
4287
|
var styleCss$2$1 = css`: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}`;
|
|
4235
4288
|
|
|
4236
4289
|
var colorCss$2$1 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
4237
4290
|
|
|
4238
4291
|
var tokensCss$1$1 = css`: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)}`;
|
|
4239
4292
|
|
|
4293
|
+
/**
|
|
4294
|
+
* Creates a keyboard strategy for dialog-specific key handling.
|
|
4295
|
+
* All other keydown behavior is left to the browser's native bubbling path.
|
|
4296
|
+
* @param {HTMLElement} bib - The dropdown bib element.
|
|
4297
|
+
* @returns {Object} Keyboard handlers keyed by `event.key`.
|
|
4298
|
+
*/
|
|
4299
|
+
// eslint-disable-next-line no-unused-vars
|
|
4300
|
+
function createDropdownBibKeyboardStrategy(bib) {
|
|
4301
|
+
return {
|
|
4302
|
+
// eslint-disable-next-line no-unused-vars
|
|
4303
|
+
Enter(_dialog, event) {
|
|
4304
|
+
// Floating UI handles Enter key to open the dropdown
|
|
4305
|
+
},
|
|
4306
|
+
// eslint-disable-next-line no-unused-vars
|
|
4307
|
+
Escape(_dialog, event) {
|
|
4308
|
+
// Floating UI handles Escape key to close the dropdown
|
|
4309
|
+
}
|
|
4310
|
+
};
|
|
4311
|
+
}
|
|
4312
|
+
|
|
4240
4313
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
4241
4314
|
// See LICENSE in the project root for license information.
|
|
4242
4315
|
/* eslint-disable max-lines */
|
|
@@ -4361,11 +4434,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
4361
4434
|
},
|
|
4362
4435
|
|
|
4363
4436
|
/**
|
|
4364
|
-
*
|
|
4365
|
-
* aria-activedescendant. The dialog keyboard bridge checks this
|
|
4366
|
-
* flag so that Enter selects the highlighted option instead of
|
|
4367
|
-
* activating the focused interactive element (e.g. the trigger
|
|
4368
|
-
* button, or the bibtemplate close button in fullscreen).
|
|
4437
|
+
* Tracks whether a menu option is currently highlighted.
|
|
4369
4438
|
* @private
|
|
4370
4439
|
*/
|
|
4371
4440
|
hasActiveDescendant: {
|
|
@@ -4439,7 +4508,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
4439
4508
|
|
|
4440
4509
|
const dialog = this.shadowRoot.querySelector('dialog');
|
|
4441
4510
|
this._setupCancelHandler(dialog);
|
|
4442
|
-
|
|
4511
|
+
applyKeyboardStrategy(dialog, createDropdownBibKeyboardStrategy());
|
|
4443
4512
|
|
|
4444
4513
|
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
4445
4514
|
bubbles: true,
|
|
@@ -4466,92 +4535,6 @@ class AuroDropdownBib extends LitElement {
|
|
|
4466
4535
|
});
|
|
4467
4536
|
}
|
|
4468
4537
|
|
|
4469
|
-
/**
|
|
4470
|
-
* showModal() creates a closed focus scope — keyboard events inside
|
|
4471
|
-
* the dialog's shadow DOM do NOT bubble out to the combobox/select
|
|
4472
|
-
* keydown handlers in the parent shadow DOM. This handler bridges
|
|
4473
|
-
* that gap by re-dispatching navigation keys so they cross the
|
|
4474
|
-
* shadow boundary and reach the menu navigation logic in the parent
|
|
4475
|
-
* component.
|
|
4476
|
-
*
|
|
4477
|
-
* The trade-off: intercepting these keys means native keyboard
|
|
4478
|
-
* behaviors that would normally "just work" must be manually
|
|
4479
|
-
* re-implemented here:
|
|
4480
|
-
*
|
|
4481
|
-
* - Enter on buttons: Custom elements (auro-button) don't get the
|
|
4482
|
-
* native Enter→click that <button> provides, so we call .click()
|
|
4483
|
-
* directly when Enter is pressed on a button-like element.
|
|
4484
|
-
*
|
|
4485
|
-
* - Tab: Intercepted and re-dispatched so parent components
|
|
4486
|
-
* (select/combobox) can select the active option and close the
|
|
4487
|
-
* dialog. The <dialog> provides containment and isolation
|
|
4488
|
-
* (inert background, VoiceOver focus trapping, top layer), while
|
|
4489
|
-
* the content inside is a role="listbox" navigated via
|
|
4490
|
-
* aria-activedescendant (options are not focusable). Tab keyboard
|
|
4491
|
-
* behavior follows listbox conventions (select + close) because
|
|
4492
|
-
* the dialog's native Tab trap only cycles between the close
|
|
4493
|
-
* button and browser chrome.
|
|
4494
|
-
*
|
|
4495
|
-
* - Escape: The native <dialog> fires a `cancel` event on ESC
|
|
4496
|
-
* (handled by _setupCancelHandler), so the re-dispatched Escape
|
|
4497
|
-
* is a secondary path for parent components that also listen for
|
|
4498
|
-
* Escape keydown.
|
|
4499
|
-
*
|
|
4500
|
-
* @param {HTMLDialogElement} dialog - The dialog element to attach the keyboard bridge to.
|
|
4501
|
-
* @private
|
|
4502
|
-
*/
|
|
4503
|
-
_setupKeyboardBridge(dialog) {
|
|
4504
|
-
const navKeys = new Set([
|
|
4505
|
-
'ArrowUp',
|
|
4506
|
-
'ArrowDown',
|
|
4507
|
-
'Enter',
|
|
4508
|
-
'Escape',
|
|
4509
|
-
'Tab'
|
|
4510
|
-
]);
|
|
4511
|
-
|
|
4512
|
-
dialog.addEventListener('keydown', (event) => {
|
|
4513
|
-
if (!navKeys.has(event.key)) {
|
|
4514
|
-
return;
|
|
4515
|
-
}
|
|
4516
|
-
|
|
4517
|
-
// Custom elements (auro-button) don't get the native Enter→click
|
|
4518
|
-
// behavior that <button> has. Find the button in the composed path
|
|
4519
|
-
// and click it directly — but only when no menu option is
|
|
4520
|
-
// highlighted. In fullscreen mode focus stays on the close button
|
|
4521
|
-
// while arrow keys move the active-descendant highlight through
|
|
4522
|
-
// the listbox. If the user presses Enter with an option
|
|
4523
|
-
// highlighted, the intent is to select that option, not to click
|
|
4524
|
-
// the close button. In that case we fall through and bridge the
|
|
4525
|
-
// Enter key to the parent component's keyboard strategy.
|
|
4526
|
-
if (event.key === 'Enter') {
|
|
4527
|
-
if (!this.hasActiveDescendant) {
|
|
4528
|
-
const buttonSelector = 'button, [role="button"], auro-button, [auro-button]';
|
|
4529
|
-
const btn = event.composedPath().find((el) => el.matches && el.matches(buttonSelector));
|
|
4530
|
-
if (btn) {
|
|
4531
|
-
event.preventDefault();
|
|
4532
|
-
event.stopPropagation();
|
|
4533
|
-
btn.click();
|
|
4534
|
-
return;
|
|
4535
|
-
}
|
|
4536
|
-
}
|
|
4537
|
-
}
|
|
4538
|
-
|
|
4539
|
-
event.preventDefault();
|
|
4540
|
-
event.stopPropagation();
|
|
4541
|
-
const newEvent = new KeyboardEvent('keydown', {
|
|
4542
|
-
key: event.key,
|
|
4543
|
-
code: event.code,
|
|
4544
|
-
shiftKey: event.shiftKey,
|
|
4545
|
-
altKey: event.altKey,
|
|
4546
|
-
ctrlKey: event.ctrlKey,
|
|
4547
|
-
metaKey: event.metaKey,
|
|
4548
|
-
bubbles: true,
|
|
4549
|
-
composed: true,
|
|
4550
|
-
cancelable: true
|
|
4551
|
-
});
|
|
4552
|
-
this.dispatchEvent(newEvent);
|
|
4553
|
-
});
|
|
4554
|
-
}
|
|
4555
4538
|
|
|
4556
4539
|
/**
|
|
4557
4540
|
* Blocks touch-driven page scroll while a fullscreen modal dialog is open.
|
|
@@ -4926,7 +4909,7 @@ let AuroHelpText$2 = class AuroHelpText extends LitElement {
|
|
|
4926
4909
|
}
|
|
4927
4910
|
};
|
|
4928
4911
|
|
|
4929
|
-
var formkitVersion$2 = '
|
|
4912
|
+
var formkitVersion$2 = '202604031704';
|
|
4930
4913
|
|
|
4931
4914
|
let AuroElement$2 = class AuroElement extends LitElement {
|
|
4932
4915
|
static get properties() {
|
|
@@ -5107,7 +5090,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5107
5090
|
this.appearance = 'default';
|
|
5108
5091
|
this.chevron = false;
|
|
5109
5092
|
this.disabled = false;
|
|
5110
|
-
this.
|
|
5093
|
+
this.disableKeyboardHandling = false;
|
|
5111
5094
|
this.error = false;
|
|
5112
5095
|
this.tabIndex = 0;
|
|
5113
5096
|
this.noToggle = false;
|
|
@@ -5205,9 +5188,8 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5205
5188
|
// showModal() fires asynchronously via Lit's update cycle, which
|
|
5206
5189
|
// falls outside the user activation window and causes iOS to
|
|
5207
5190
|
// dismiss the keyboard.
|
|
5208
|
-
if (this.
|
|
5209
|
-
|
|
5210
|
-
this.bibElement.value.open(useModal);
|
|
5191
|
+
if (this.bibElement && this.bibElement.value) {
|
|
5192
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
5211
5193
|
}
|
|
5212
5194
|
}
|
|
5213
5195
|
|
|
@@ -5321,9 +5303,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5321
5303
|
},
|
|
5322
5304
|
|
|
5323
5305
|
/**
|
|
5324
|
-
* If declared, the
|
|
5306
|
+
* If declared, the dropdown will not handle keyboard events and will require the consumer to manage this behavior.
|
|
5325
5307
|
*/
|
|
5326
|
-
|
|
5308
|
+
disableKeyboardHandling: {
|
|
5327
5309
|
type: Boolean,
|
|
5328
5310
|
reflect: true
|
|
5329
5311
|
},
|
|
@@ -5601,7 +5583,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5601
5583
|
if (this.isPopoverVisible) {
|
|
5602
5584
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
5603
5585
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
5604
|
-
const useModal = this.isBibFullscreen
|
|
5586
|
+
const useModal = this.isBibFullscreen;
|
|
5605
5587
|
this.bibElement.value.open(useModal);
|
|
5606
5588
|
} else {
|
|
5607
5589
|
this.bibElement.value.close();
|
|
@@ -5611,7 +5593,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5611
5593
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
5612
5594
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
5613
5595
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
5614
|
-
const useModal = this.isBibFullscreen
|
|
5596
|
+
const useModal = this.isBibFullscreen;
|
|
5615
5597
|
this.bibElement.value.close();
|
|
5616
5598
|
this.bibElement.value.open(useModal);
|
|
5617
5599
|
}
|
|
@@ -5633,7 +5615,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5633
5615
|
|
|
5634
5616
|
firstUpdated() {
|
|
5635
5617
|
// Configure the floater to, this will generate the ID for the bib
|
|
5636
|
-
this.floater.configure(this, 'auroDropdown');
|
|
5618
|
+
this.floater.configure(this, 'auroDropdown', !this.disableKeyboardHandling);
|
|
5637
5619
|
|
|
5638
5620
|
// Prevent `contain: layout` on the dropdown host. Layout containment
|
|
5639
5621
|
// creates a containing block for position:fixed descendants (the bib),
|
|
@@ -5723,7 +5705,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5723
5705
|
* @private
|
|
5724
5706
|
*/
|
|
5725
5707
|
updateFocusTrap() {
|
|
5726
|
-
if (this.isPopoverVisible
|
|
5708
|
+
if (this.isPopoverVisible) {
|
|
5727
5709
|
if (!this.isBibFullscreen) {
|
|
5728
5710
|
// Desktop: show() doesn't trap focus, so use FocusTrap
|
|
5729
5711
|
this.focusTrap = new FocusTrap(this.bibContent);
|
|
@@ -5941,6 +5923,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5941
5923
|
aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
5942
5924
|
aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
5943
5925
|
aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
5926
|
+
aria-disabled="${ifDefined(this.disabled ? 'true' : undefined)}"
|
|
5944
5927
|
@focusin="${this.handleFocusin}"
|
|
5945
5928
|
@blur="${this.handleFocusOut}">
|
|
5946
5929
|
<div class="triggerContentWrapper" id="triggerLabel">
|
|
@@ -11660,6 +11643,12 @@ class BaseInput extends AuroElement$1 {
|
|
|
11660
11643
|
this.wrapperElement = this.shadowRoot.querySelector('.wrapper');
|
|
11661
11644
|
this.inputElement = this.renderRoot.querySelector('input');
|
|
11662
11645
|
this.labelElement = this.shadowRoot.querySelector('label');
|
|
11646
|
+
this.clearBtn = this.clearButtonRef.value;
|
|
11647
|
+
|
|
11648
|
+
// This must get moved into inputKeyboardStrategy when implemented
|
|
11649
|
+
this.clearBtn.addEventListener('keydown', (evt) => {
|
|
11650
|
+
evt.stopPropagation();
|
|
11651
|
+
});
|
|
11663
11652
|
|
|
11664
11653
|
this.patchInputEvent(this.inputElement);
|
|
11665
11654
|
|
|
@@ -12683,7 +12672,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
|
12683
12672
|
}
|
|
12684
12673
|
};
|
|
12685
12674
|
|
|
12686
|
-
var formkitVersion$1 = '
|
|
12675
|
+
var formkitVersion$1 = '202604031704';
|
|
12687
12676
|
|
|
12688
12677
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12689
12678
|
// See LICENSE in the project root for license information.
|
|
@@ -12740,6 +12729,11 @@ class AuroInput extends BaseInput {
|
|
|
12740
12729
|
* @private
|
|
12741
12730
|
*/
|
|
12742
12731
|
this.iconTag = versioning.generateTag('auro-formkit-input-icon', iconVersion$1, _$1);
|
|
12732
|
+
|
|
12733
|
+
/**
|
|
12734
|
+
* @private
|
|
12735
|
+
*/
|
|
12736
|
+
this.clearButtonRef = createRef();
|
|
12743
12737
|
}
|
|
12744
12738
|
|
|
12745
12739
|
static get styles() {
|
|
@@ -12757,6 +12751,19 @@ class AuroInput extends BaseInput {
|
|
|
12757
12751
|
];
|
|
12758
12752
|
}
|
|
12759
12753
|
|
|
12754
|
+
/**
|
|
12755
|
+
* Returns classmap configuration for the clear button visibility.
|
|
12756
|
+
* The button is hidden when the input has no value, is read-only, or is disabled.
|
|
12757
|
+
* @private
|
|
12758
|
+
* @returns {Record<string, boolean>} - Classmap object controlling clear button display state.
|
|
12759
|
+
*/
|
|
12760
|
+
get clearBtnClassMap() {
|
|
12761
|
+
return {
|
|
12762
|
+
'util_displayHidden': !this.hasValue || this.readyOnly || this.disabled
|
|
12763
|
+
};
|
|
12764
|
+
}
|
|
12765
|
+
|
|
12766
|
+
|
|
12760
12767
|
/**
|
|
12761
12768
|
* Determines if the HTML input element should be visually hidden.
|
|
12762
12769
|
* Returns true when display value content exists without focus and has a value,
|
|
@@ -13076,10 +13083,11 @@ class AuroInput extends BaseInput {
|
|
|
13076
13083
|
<${this.buttonTag}
|
|
13077
13084
|
@click="${this.handleClickClear}"
|
|
13078
13085
|
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
13079
|
-
class="notificationBtn clearBtn"
|
|
13086
|
+
class="notificationBtn clearBtn ${classMap(this.clearBtnClassMap)}"
|
|
13080
13087
|
shape="circle"
|
|
13081
13088
|
size="sm"
|
|
13082
|
-
variant="ghost"
|
|
13089
|
+
variant="ghost"
|
|
13090
|
+
${ref(this.clearButtonRef)}>
|
|
13083
13091
|
<span><slot name="ariaLabel.clear">Clear Input</slot></span>
|
|
13084
13092
|
<${this.iconTag}
|
|
13085
13093
|
aria-hidden="true"
|
|
@@ -13224,11 +13232,7 @@ class AuroInput extends BaseInput {
|
|
|
13224
13232
|
<div part="accent-right" class="accents right">
|
|
13225
13233
|
${this.renderValidationErrorIconHtml()}
|
|
13226
13234
|
${this.hasValue && this.type === 'password' ? this.renderHtmlNotificationPassword() : undefined}
|
|
13227
|
-
${this.
|
|
13228
|
-
${!this.disabled && !this.readonly ? html`
|
|
13229
|
-
${this.renderHtmlActionClear()}
|
|
13230
|
-
` : undefined}
|
|
13231
|
-
` : undefined}
|
|
13235
|
+
${this.renderHtmlActionClear()}
|
|
13232
13236
|
</div>
|
|
13233
13237
|
</div>
|
|
13234
13238
|
<div class="helpTextWrapper leftIndent rightIndent" part="inputHelpText">
|
|
@@ -13260,11 +13264,7 @@ class AuroInput extends BaseInput {
|
|
|
13260
13264
|
${this.layout.includes('right') || this.layout === "emphasized" ? html`
|
|
13261
13265
|
${this.renderValidationErrorIconHtml()}
|
|
13262
13266
|
` : undefined}
|
|
13263
|
-
${this.
|
|
13264
|
-
${!this.disabled && !this.readonly ? html`
|
|
13265
|
-
${this.renderHtmlActionClear()}
|
|
13266
|
-
` : undefined}
|
|
13267
|
-
` : undefined}
|
|
13267
|
+
${this.renderHtmlActionClear()}
|
|
13268
13268
|
</div>
|
|
13269
13269
|
</div>
|
|
13270
13270
|
<div class="${classMap(this.helpTextClasses)}" part="inputHelpText">
|
|
@@ -13292,11 +13292,7 @@ class AuroInput extends BaseInput {
|
|
|
13292
13292
|
</div>
|
|
13293
13293
|
<div class="accents right">
|
|
13294
13294
|
${this.renderValidationErrorIconHtml()}
|
|
13295
|
-
${this.
|
|
13296
|
-
${!this.disabled && !this.readonly ? html`
|
|
13297
|
-
${this.renderHtmlActionClear()}
|
|
13298
|
-
` : undefined}
|
|
13299
|
-
` : undefined}
|
|
13295
|
+
${this.renderHtmlActionClear()}
|
|
13300
13296
|
</div>
|
|
13301
13297
|
</div>
|
|
13302
13298
|
<div class="helpTextWrapper leftIndent rightIndent" part="inputHelpText">
|
|
@@ -13722,7 +13718,7 @@ class AuroBibtemplate extends LitElement {
|
|
|
13722
13718
|
}
|
|
13723
13719
|
}
|
|
13724
13720
|
|
|
13725
|
-
var formkitVersion = '
|
|
13721
|
+
var formkitVersion = '202604031704';
|
|
13726
13722
|
|
|
13727
13723
|
var styleCss$1 = css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
|
|
13728
13724
|
|
|
@@ -14201,6 +14197,7 @@ class AuroCombobox extends AuroElement {
|
|
|
14201
14197
|
|
|
14202
14198
|
/**
|
|
14203
14199
|
* Array of available options to display in the dropdown.
|
|
14200
|
+
* This array contains all non-hidden options (e.g., hidden by filtering on input value).
|
|
14204
14201
|
* @private
|
|
14205
14202
|
*/
|
|
14206
14203
|
availableOptions: {
|
|
@@ -14578,12 +14575,40 @@ class AuroCombobox extends AuroElement {
|
|
|
14578
14575
|
AuroLibraryRuntimeUtils$4.prototype.registerComponent(name, AuroCombobox);
|
|
14579
14576
|
}
|
|
14580
14577
|
|
|
14578
|
+
/**
|
|
14579
|
+
* Mark the first available (non-hidden), enabled option as `active`.
|
|
14580
|
+
* @private
|
|
14581
|
+
* @returns {void}
|
|
14582
|
+
*/
|
|
14583
|
+
activateFirstEnabledAvailableOption() {
|
|
14584
|
+
const firstEnabledOptionIndex = this.availableOptions.findIndex((opt) => !opt.disabled);
|
|
14585
|
+
this.updateActiveOption(firstEnabledOptionIndex);
|
|
14586
|
+
}
|
|
14587
|
+
|
|
14588
|
+
/**
|
|
14589
|
+
* Mark the last available (non-hidden), enabled option as `active`.
|
|
14590
|
+
* @private
|
|
14591
|
+
* @returns {void}
|
|
14592
|
+
*/
|
|
14593
|
+
activateLastEnabledAvailableOption() {
|
|
14594
|
+
let lastEnabledOptionIndex = -1;
|
|
14595
|
+
|
|
14596
|
+
// Work backwards through the available options array to find the last enabled option
|
|
14597
|
+
for (let index = this.availableOptions.length - 1; index >= 0; index -= 1) {
|
|
14598
|
+
if (!this.availableOptions[index].disabled) {
|
|
14599
|
+
lastEnabledOptionIndex = index;
|
|
14600
|
+
break;
|
|
14601
|
+
}
|
|
14602
|
+
}
|
|
14603
|
+
|
|
14604
|
+
this.updateActiveOption(lastEnabledOptionIndex);
|
|
14605
|
+
}
|
|
14606
|
+
|
|
14581
14607
|
/**
|
|
14582
14608
|
* Updates the filter for the available options based on the input value.
|
|
14583
14609
|
* @private
|
|
14584
14610
|
*/
|
|
14585
14611
|
updateFilter() {
|
|
14586
|
-
|
|
14587
14612
|
// Reset available options if noFilter is set to false after being true.
|
|
14588
14613
|
if (this.noFilter) {
|
|
14589
14614
|
this.availableOptions = [...this.options];
|
|
@@ -14702,6 +14727,10 @@ class AuroCombobox extends AuroElement {
|
|
|
14702
14727
|
if (this.value && this.input.value && !this.menu.value) {
|
|
14703
14728
|
this.syncValuesAndStates();
|
|
14704
14729
|
}
|
|
14730
|
+
|
|
14731
|
+
if (!this.availableOptions.includes(this.menu.optionActive)) {
|
|
14732
|
+
this.activateFirstEnabledAvailableOption();
|
|
14733
|
+
}
|
|
14705
14734
|
}
|
|
14706
14735
|
|
|
14707
14736
|
/**
|
|
@@ -14775,9 +14804,6 @@ class AuroCombobox extends AuroElement {
|
|
|
14775
14804
|
if (this.dropdownOpen) {
|
|
14776
14805
|
const expandedDelay = 150;
|
|
14777
14806
|
this._expandedTimeout = setTimeout(() => {
|
|
14778
|
-
if (!this.value) {
|
|
14779
|
-
this.updateActiveOption(0);
|
|
14780
|
-
}
|
|
14781
14807
|
this.triggerExpandedState = true;
|
|
14782
14808
|
}, expandedDelay);
|
|
14783
14809
|
} else {
|
|
@@ -14787,22 +14813,16 @@ class AuroCombobox extends AuroElement {
|
|
|
14787
14813
|
// Clear aria-activedescendant when dropdown closes
|
|
14788
14814
|
if (!this.dropdownOpen && this.input) {
|
|
14789
14815
|
this.input.setActiveDescendant(null);
|
|
14790
|
-
this.optionActive = null;
|
|
14791
|
-
|
|
14792
|
-
// Remove the highlighted state from all menu options so re-opening
|
|
14793
|
-
// the dropdown doesn't show a stale highlight.
|
|
14794
|
-
if (this.options) {
|
|
14795
|
-
this.options.forEach((opt) => {
|
|
14796
|
-
opt.active = false;
|
|
14797
|
-
opt.classList.remove('active');
|
|
14798
|
-
});
|
|
14799
|
-
}
|
|
14800
14816
|
|
|
14801
14817
|
// Restore pointer events on the menu in case they were disabled
|
|
14802
14818
|
// during fullscreen open to prevent touch pass-through.
|
|
14803
14819
|
this.menu.style.pointerEvents = '';
|
|
14804
14820
|
|
|
14805
|
-
|
|
14821
|
+
// When closing a fullscreen bib, restore focus to the trigger so that
|
|
14822
|
+
// keyboard navigation continues from the correct place in the page
|
|
14823
|
+
if (this.dropdown.isBibFullscreen) {
|
|
14824
|
+
restoreTriggerAfterClose(this.dropdown, this.input);
|
|
14825
|
+
}
|
|
14806
14826
|
}
|
|
14807
14827
|
|
|
14808
14828
|
if (this.dropdownOpen) {
|
|
@@ -14837,13 +14857,6 @@ class AuroCombobox extends AuroElement {
|
|
|
14837
14857
|
this.setInputFocus();
|
|
14838
14858
|
this._inFullscreenTransition = false;
|
|
14839
14859
|
});
|
|
14840
|
-
} else {
|
|
14841
|
-
// wait a frame in case the bib gets hidden immediately after showing because there is no value
|
|
14842
|
-
setTimeout(() => {
|
|
14843
|
-
if (this.componentHasFocus) {
|
|
14844
|
-
this.setInputFocus();
|
|
14845
|
-
}
|
|
14846
|
-
}, 0);
|
|
14847
14860
|
}
|
|
14848
14861
|
}
|
|
14849
14862
|
});
|
|
@@ -14893,7 +14906,25 @@ class AuroCombobox extends AuroElement {
|
|
|
14893
14906
|
setClearBtnFocus() {
|
|
14894
14907
|
const clearBtn = this.input.shadowRoot.querySelector('.clearBtn');
|
|
14895
14908
|
if (clearBtn) {
|
|
14896
|
-
|
|
14909
|
+
// Wait for the element to fully render across
|
|
14910
|
+
// multiple Lit update cycles before moving focus
|
|
14911
|
+
doubleRaf(() => {
|
|
14912
|
+
clearBtn.focus();
|
|
14913
|
+
});
|
|
14914
|
+
}
|
|
14915
|
+
}
|
|
14916
|
+
|
|
14917
|
+
/**
|
|
14918
|
+
* @private
|
|
14919
|
+
*/
|
|
14920
|
+
setTriggerInputFocus() {
|
|
14921
|
+
const input = this.input.shadowRoot.querySelector('input');
|
|
14922
|
+
if (input) {
|
|
14923
|
+
// Wait for the element to fully render across
|
|
14924
|
+
// multiple Lit update cycles before moving focus
|
|
14925
|
+
doubleRaf(() => {
|
|
14926
|
+
input.focus();
|
|
14927
|
+
});
|
|
14897
14928
|
}
|
|
14898
14929
|
}
|
|
14899
14930
|
|
|
@@ -15216,7 +15247,7 @@ class AuroCombobox extends AuroElement {
|
|
|
15216
15247
|
* @returns {void}
|
|
15217
15248
|
*/
|
|
15218
15249
|
configureCombobox() {
|
|
15219
|
-
applyKeyboardStrategy(this, comboboxKeyboardStrategy, {
|
|
15250
|
+
applyKeyboardStrategy$1(this, comboboxKeyboardStrategy, {
|
|
15220
15251
|
// In modal mode the input moves into the bib; route keyboard events to that element instead.
|
|
15221
15252
|
inputResolver: (comp, ctx) => (ctx.isModal && comp.inputInBib ? comp.inputInBib : comp.input),
|
|
15222
15253
|
});
|