@aurodesignsystem-dev/auro-formkit 0.0.0-pr740.9 → 0.0.0-pr750.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +6 -0
- package/components/bibtemplate/dist/index.js +25 -1
- package/components/bibtemplate/dist/registered.js +25 -1
- package/components/checkbox/demo/api.html +16 -10
- package/components/checkbox/demo/api.min.js +23 -16
- package/components/checkbox/demo/index.html +16 -10
- package/components/checkbox/demo/index.min.js +23 -16
- package/components/checkbox/demo/readme.html +16 -9
- package/components/checkbox/dist/index.js +23 -16
- package/components/checkbox/dist/registered.js +23 -16
- package/components/combobox/demo/api.html +16 -10
- package/components/combobox/demo/api.md +12 -6
- package/components/combobox/demo/api.min.js +442 -148
- package/components/combobox/demo/index.html +16 -10
- package/components/combobox/demo/index.min.js +442 -148
- package/components/combobox/demo/readme.html +16 -9
- package/components/combobox/dist/index.js +405 -136
- package/components/combobox/dist/registered.js +405 -136
- package/components/counter/demo/api.html +17 -10
- package/components/counter/demo/api.md +140 -7
- package/components/counter/demo/api.min.js +1171 -1016
- package/components/counter/demo/index.html +17 -10
- package/components/counter/demo/index.md +86 -0
- package/components/counter/demo/index.min.js +1171 -1016
- package/components/counter/demo/readme.html +16 -9
- package/components/counter/dist/auro-counter-group.d.ts +64 -23
- package/components/counter/dist/auro-counter.d.ts +10 -0
- package/components/counter/dist/index.js +1171 -1016
- package/components/counter/dist/registered.js +1171 -1016
- package/components/datepicker/demo/api.html +16 -10
- package/components/datepicker/demo/api.min.js +403 -123
- package/components/datepicker/demo/index.html +16 -10
- package/components/datepicker/demo/index.min.js +403 -123
- package/components/datepicker/demo/readme.html +16 -9
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -0
- package/components/datepicker/dist/index.js +403 -123
- package/components/datepicker/dist/registered.js +403 -123
- package/components/dropdown/demo/api.html +16 -10
- package/components/dropdown/demo/api.md +77 -269
- package/components/dropdown/demo/api.min.js +336 -96
- package/components/dropdown/demo/index.html +16 -10
- package/components/dropdown/demo/index.md +45 -363
- package/components/dropdown/demo/index.min.js +336 -96
- package/components/dropdown/demo/readme.html +16 -9
- package/components/dropdown/dist/auro-dropdown.d.ts +35 -67
- package/components/dropdown/dist/auro-dropdownBib.d.ts +0 -6
- package/components/dropdown/dist/index.js +336 -96
- package/components/dropdown/dist/registered.js +336 -96
- package/components/form/demo/api.html +16 -9
- package/components/form/demo/autocomplete.html +19 -3
- package/components/form/demo/index.html +16 -9
- package/components/form/demo/readme.html +16 -9
- package/components/form/demo/working.html +19 -13
- package/components/helptext/dist/index.js +1 -1
- package/components/helptext/dist/registered.js +1 -1
- package/components/input/demo/api.html +16 -10
- package/components/input/demo/api.md +1 -1
- package/components/input/demo/api.min.js +14 -14
- package/components/input/demo/index.html +16 -10
- package/components/input/demo/index.min.js +14 -14
- package/components/input/demo/readme.html +16 -9
- package/components/input/dist/base-input.d.ts +1 -1
- package/components/input/dist/index.js +14 -14
- package/components/input/dist/registered.js +14 -14
- package/components/menu/demo/api.html +16 -32
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/api.min.js +37 -12
- package/components/menu/demo/index.html +16 -10
- package/components/menu/demo/index.min.js +37 -12
- package/components/menu/demo/readme.html +16 -9
- package/components/menu/dist/auro-menu.d.ts +13 -2
- package/components/menu/dist/index.js +37 -12
- package/components/menu/dist/registered.js +37 -12
- package/components/radio/demo/api.html +16 -10
- package/components/radio/demo/api.md +0 -1
- package/components/radio/demo/api.min.js +61 -76
- package/components/radio/demo/index.html +16 -10
- package/components/radio/demo/index.min.js +61 -76
- package/components/radio/demo/readme.html +16 -9
- package/components/radio/dist/auro-radio.d.ts +8 -11
- package/components/radio/dist/index.js +61 -76
- package/components/radio/dist/registered.js +61 -76
- package/components/select/demo/api.html +16 -10
- package/components/select/demo/api.js +0 -2
- package/components/select/demo/api.md +53 -51
- package/components/select/demo/api.min.js +520 -358
- package/components/select/demo/index.html +16 -11
- package/components/select/demo/index.md +6 -158
- package/components/select/demo/index.min.js +520 -346
- package/components/select/demo/readme.html +16 -9
- package/components/select/dist/auro-select.d.ts +33 -8
- package/components/select/dist/index.js +483 -334
- package/components/select/dist/registered.js +483 -334
- package/package.json +26 -25
|
@@ -2241,6 +2241,267 @@ class AuroFloatingUI {
|
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
2243
|
|
|
2244
|
+
// Selectors for focusable elements
|
|
2245
|
+
const FOCUSABLE_SELECTORS = [
|
|
2246
|
+
'a[href]',
|
|
2247
|
+
'button:not([disabled])',
|
|
2248
|
+
'textarea:not([disabled])',
|
|
2249
|
+
'input:not([disabled])',
|
|
2250
|
+
'select:not([disabled])',
|
|
2251
|
+
'[role="tab"]:not([disabled])',
|
|
2252
|
+
'[role="link"]:not([disabled])',
|
|
2253
|
+
'[role="button"]:not([disabled])',
|
|
2254
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
2255
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
2256
|
+
];
|
|
2257
|
+
|
|
2258
|
+
// List of custom components that are known to be focusable
|
|
2259
|
+
const FOCUSABLE_COMPONENTS = [
|
|
2260
|
+
'auro-checkbox',
|
|
2261
|
+
'auro-radio',
|
|
2262
|
+
'auro-dropdown',
|
|
2263
|
+
'auro-button',
|
|
2264
|
+
'auro-combobox',
|
|
2265
|
+
'auro-input',
|
|
2266
|
+
'auro-counter',
|
|
2267
|
+
'auro-menu',
|
|
2268
|
+
'auro-select',
|
|
2269
|
+
'auro-datepicker',
|
|
2270
|
+
'auro-hyperlink',
|
|
2271
|
+
'auro-accordion',
|
|
2272
|
+
];
|
|
2273
|
+
|
|
2274
|
+
/**
|
|
2275
|
+
* Determines if a given element is a custom focusable component.
|
|
2276
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
2277
|
+
*
|
|
2278
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
2279
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
2280
|
+
*/
|
|
2281
|
+
function isFocusableComponent(element) {
|
|
2282
|
+
const componentName = element.tagName.toLowerCase();
|
|
2283
|
+
|
|
2284
|
+
// Guard Clause: Element is a focusable component
|
|
2285
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
2286
|
+
|
|
2287
|
+
// Guard Clause: Element is not disabled
|
|
2288
|
+
if (element.hasAttribute('disabled')) return false;
|
|
2289
|
+
|
|
2290
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
2291
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
2292
|
+
|
|
2293
|
+
// If all guard clauses pass, the element is a focusable component
|
|
2294
|
+
return true;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
/**
|
|
2298
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2299
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
2300
|
+
*
|
|
2301
|
+
* @param {HTMLElement} container The container to search within
|
|
2302
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2303
|
+
*/
|
|
2304
|
+
function getFocusableElements(container) {
|
|
2305
|
+
// Get elements in DOM order by walking the tree
|
|
2306
|
+
const orderedFocusableElements = [];
|
|
2307
|
+
|
|
2308
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
2309
|
+
const collectFocusableElements = (root) => {
|
|
2310
|
+
// Check if current element is focusable
|
|
2311
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
2312
|
+
// Check if this is a custom component that is focusable
|
|
2313
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
2314
|
+
|
|
2315
|
+
if (isComponentFocusable) {
|
|
2316
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
2317
|
+
orderedFocusableElements.push(root);
|
|
2318
|
+
return; // Skip traversing inside this component
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
// Check if the element itself matches any selector
|
|
2322
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
2323
|
+
if (root.matches?.(selector)) {
|
|
2324
|
+
orderedFocusableElements.push(root);
|
|
2325
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
// Process shadow DOM only for non-Auro components
|
|
2330
|
+
if (root.shadowRoot) {
|
|
2331
|
+
// Process shadow DOM children in order
|
|
2332
|
+
if (root.shadowRoot.children) {
|
|
2333
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
2334
|
+
collectFocusableElements(child);
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
// Process slots and their assigned nodes in order
|
|
2340
|
+
if (root.tagName === 'SLOT') {
|
|
2341
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
2342
|
+
for (const node of assignedNodes) {
|
|
2343
|
+
collectFocusableElements(node);
|
|
2344
|
+
}
|
|
2345
|
+
} else {
|
|
2346
|
+
// Process light DOM children in order
|
|
2347
|
+
if (root.children) {
|
|
2348
|
+
Array.from(root.children).forEach(child => {
|
|
2349
|
+
collectFocusableElements(child);
|
|
2350
|
+
});
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
};
|
|
2355
|
+
|
|
2356
|
+
// Start the traversal from the container
|
|
2357
|
+
collectFocusableElements(container);
|
|
2358
|
+
|
|
2359
|
+
// Remove duplicates that might have been collected through different paths
|
|
2360
|
+
// while preserving order
|
|
2361
|
+
const uniqueElements = [];
|
|
2362
|
+
const seen = new Set();
|
|
2363
|
+
|
|
2364
|
+
for (const element of orderedFocusableElements) {
|
|
2365
|
+
if (!seen.has(element)) {
|
|
2366
|
+
seen.add(element);
|
|
2367
|
+
uniqueElements.push(element);
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
return uniqueElements;
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
/**
|
|
2375
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
2376
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
2377
|
+
*/
|
|
2378
|
+
class FocusTrap {
|
|
2379
|
+
/**
|
|
2380
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
2381
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
2382
|
+
*
|
|
2383
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
2384
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
2385
|
+
*/
|
|
2386
|
+
constructor(container) {
|
|
2387
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
2388
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
this.container = container;
|
|
2392
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
2393
|
+
|
|
2394
|
+
this._init();
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
/**
|
|
2398
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
2399
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
2400
|
+
*
|
|
2401
|
+
* @private
|
|
2402
|
+
*/
|
|
2403
|
+
_init() {
|
|
2404
|
+
|
|
2405
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
2406
|
+
if ('inert' in HTMLElement.prototype) {
|
|
2407
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
2408
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
// Track tab direction
|
|
2412
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
/**
|
|
2416
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
2417
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
2418
|
+
*
|
|
2419
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
2420
|
+
* @private
|
|
2421
|
+
*/
|
|
2422
|
+
_onKeydown = (e) => {
|
|
2423
|
+
|
|
2424
|
+
if (e.key === 'Tab') {
|
|
2425
|
+
|
|
2426
|
+
// Set the tab direction based on the key pressed
|
|
2427
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
2428
|
+
|
|
2429
|
+
// Get the active element(s) in the document and shadow root
|
|
2430
|
+
// This will include the active element in the shadow DOM if it exists
|
|
2431
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
2432
|
+
let activeElement = document.activeElement;
|
|
2433
|
+
const actives = [activeElement];
|
|
2434
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
2435
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
2436
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
// Update the focusable elements
|
|
2440
|
+
const focusables = this._getFocusableElements();
|
|
2441
|
+
|
|
2442
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
2443
|
+
const focusIndex =
|
|
2444
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
2445
|
+
? focusables.length - 1
|
|
2446
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
2447
|
+
? 0
|
|
2448
|
+
: null;
|
|
2449
|
+
|
|
2450
|
+
if (focusIndex !== null) {
|
|
2451
|
+
focusables[focusIndex].focus();
|
|
2452
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
2453
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
|
|
2458
|
+
/**
|
|
2459
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2460
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
2461
|
+
*
|
|
2462
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2463
|
+
* @private
|
|
2464
|
+
*/
|
|
2465
|
+
_getFocusableElements() {
|
|
2466
|
+
// Use the imported utility function to get focusable elements
|
|
2467
|
+
const elements = getFocusableElements(this.container);
|
|
2468
|
+
|
|
2469
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
2470
|
+
return elements;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
/**
|
|
2474
|
+
* Moves focus to the first focusable element within the container.
|
|
2475
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
2476
|
+
*/
|
|
2477
|
+
focusFirstElement() {
|
|
2478
|
+
const focusables = this._getFocusableElements();
|
|
2479
|
+
if (focusables.length) focusables[0].focus();
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
/**
|
|
2483
|
+
* Moves focus to the last focusable element within the container.
|
|
2484
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
2485
|
+
*/
|
|
2486
|
+
focusLastElement() {
|
|
2487
|
+
const focusables = this._getFocusableElements();
|
|
2488
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
/**
|
|
2492
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
2493
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
2494
|
+
*/
|
|
2495
|
+
disconnect() {
|
|
2496
|
+
|
|
2497
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
2498
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2244
2505
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2245
2506
|
// See LICENSE in the project root for license information.
|
|
2246
2507
|
|
|
@@ -2678,11 +2939,11 @@ class AuroIcon extends BaseIcon {
|
|
|
2678
2939
|
|
|
2679
2940
|
var iconVersion = '6.1.2';
|
|
2680
2941
|
|
|
2681
|
-
var styleCss$1 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){top:0;left:0
|
|
2942
|
+
var styleCss$1 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}: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([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}: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}.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}`;
|
|
2682
2943
|
|
|
2683
2944
|
var colorCss$2 = 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)}`;
|
|
2684
2945
|
|
|
2685
|
-
var tokensCss$1 = css`:host(:not([ondark])){--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-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-
|
|
2946
|
+
var tokensCss$1 = css`:host(:not([ondark])){--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-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]){--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-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)}`;
|
|
2686
2947
|
|
|
2687
2948
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2688
2949
|
// See LICENSE in the project root for license information.
|
|
@@ -2842,17 +3103,6 @@ class AuroDropdownBib extends LitElement {
|
|
|
2842
3103
|
}
|
|
2843
3104
|
}
|
|
2844
3105
|
});
|
|
2845
|
-
|
|
2846
|
-
this.preventBodyScroll = this.preventBodyScroll.bind(this);
|
|
2847
|
-
this.addEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
2848
|
-
this.addEventListener('touchstart', this.preventBodyScroll, { passive: false });
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
disconnectedCallback() {
|
|
2852
|
-
super.disconnectedCallback();
|
|
2853
|
-
|
|
2854
|
-
this.removeEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
2855
|
-
this.removeEventListener('touchstart', this.preventBodyScroll, { passive: false });
|
|
2856
3106
|
}
|
|
2857
3107
|
|
|
2858
3108
|
firstUpdated(changedProperties) {
|
|
@@ -2868,19 +3118,6 @@ class AuroDropdownBib extends LitElement {
|
|
|
2868
3118
|
}));
|
|
2869
3119
|
}
|
|
2870
3120
|
|
|
2871
|
-
/**
|
|
2872
|
-
* Prevents scrolling of the body when touching empty areas of the component.
|
|
2873
|
-
* @param {Event} event - The touchmove event.
|
|
2874
|
-
* @returns {void}
|
|
2875
|
-
*/
|
|
2876
|
-
preventBodyScroll(event) {
|
|
2877
|
-
// when touchmove/touchstart on empty space
|
|
2878
|
-
if (event.target === this) {
|
|
2879
|
-
event.preventDefault();
|
|
2880
|
-
event.stopImmediatePropagation();
|
|
2881
|
-
}
|
|
2882
|
-
}
|
|
2883
|
-
|
|
2884
3121
|
// function that renders the HTML and CSS into the scope of the component
|
|
2885
3122
|
render() {
|
|
2886
3123
|
const classes = {
|
|
@@ -2903,19 +3140,19 @@ var dropdownVersion = '3.0.0';
|
|
|
2903
3140
|
|
|
2904
3141
|
var shapeSizeCss = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
2905
3142
|
|
|
2906
|
-
var colorCss$1 = css`:host .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus,:host(:not([ondark])) .wrapper:
|
|
3143
|
+
var colorCss$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}`;
|
|
2907
3144
|
|
|
2908
|
-
var classicColorCss = css
|
|
3145
|
+
var classicColorCss = css``;
|
|
2909
3146
|
|
|
2910
|
-
var classicLayoutCss = css`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .
|
|
3147
|
+
var classicLayoutCss = css`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
2911
3148
|
|
|
2912
|
-
var styleEmphasizedCss = css`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex-direction:row
|
|
3149
|
+
var styleEmphasizedCss = css`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
2913
3150
|
|
|
2914
|
-
var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex-direction:row
|
|
3151
|
+
var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=snowflake]) .leftIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
2915
3152
|
|
|
2916
3153
|
var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
2917
3154
|
|
|
2918
|
-
var styleCss = css
|
|
3155
|
+
var styleCss = css`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
2919
3156
|
|
|
2920
3157
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
2921
3158
|
|
|
@@ -3220,10 +3457,8 @@ class AuroElement extends LitElement {
|
|
|
3220
3457
|
// See LICENSE in the project root for license information.
|
|
3221
3458
|
|
|
3222
3459
|
|
|
3223
|
-
|
|
3224
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
3460
|
+
/*
|
|
3225
3461
|
* @slot - Default slot for the popover content.
|
|
3226
|
-
* @slot label - Defines the content of the label.
|
|
3227
3462
|
* @slot helpText - Defines the content of the helpText.
|
|
3228
3463
|
* @slot trigger - Defines the content of the trigger.
|
|
3229
3464
|
* @csspart trigger - The trigger content container.
|
|
@@ -3242,18 +3477,22 @@ class AuroDropdown extends AuroElement {
|
|
|
3242
3477
|
this.matchWidth = false;
|
|
3243
3478
|
this.noHideOnThisFocusLoss = false;
|
|
3244
3479
|
|
|
3245
|
-
this.errorMessage =
|
|
3480
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
3246
3481
|
|
|
3247
3482
|
// Layout Config
|
|
3248
|
-
this.layout =
|
|
3249
|
-
this.shape =
|
|
3250
|
-
this.size =
|
|
3483
|
+
this.layout = undefined;
|
|
3484
|
+
this.shape = undefined;
|
|
3485
|
+
this.size = undefined;
|
|
3251
3486
|
|
|
3252
3487
|
this.parentBorder = false;
|
|
3253
3488
|
|
|
3254
3489
|
this.privateDefaults();
|
|
3255
3490
|
}
|
|
3256
3491
|
|
|
3492
|
+
/**
|
|
3493
|
+
* @private
|
|
3494
|
+
* @returns {object} Class definition for the wrapper element.
|
|
3495
|
+
*/
|
|
3257
3496
|
get commonWrapperClasses() {
|
|
3258
3497
|
return {
|
|
3259
3498
|
'trigger': true,
|
|
@@ -3271,13 +3510,10 @@ class AuroDropdown extends AuroElement {
|
|
|
3271
3510
|
privateDefaults() {
|
|
3272
3511
|
this.chevron = false;
|
|
3273
3512
|
this.disabled = false;
|
|
3513
|
+
this.disableFocusTrap = false;
|
|
3274
3514
|
this.error = false;
|
|
3275
|
-
this.inset = false;
|
|
3276
|
-
this.rounded = false;
|
|
3277
3515
|
this.tabIndex = 0;
|
|
3278
3516
|
this.noToggle = false;
|
|
3279
|
-
this.a11yAutocomplete = 'none';
|
|
3280
|
-
this.labeled = true;
|
|
3281
3517
|
this.a11yRole = 'button';
|
|
3282
3518
|
this.onDark = false;
|
|
3283
3519
|
this.showTriggerBorders = true;
|
|
@@ -3373,6 +3609,18 @@ class AuroDropdown extends AuroElement {
|
|
|
3373
3609
|
this.floater.showBib();
|
|
3374
3610
|
}
|
|
3375
3611
|
|
|
3612
|
+
/**
|
|
3613
|
+
* When bib is open, focus on the first element inside of bib.
|
|
3614
|
+
* If not, trigger element will get focus.
|
|
3615
|
+
*/
|
|
3616
|
+
focus() {
|
|
3617
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
3618
|
+
this.focusTrap.focusFirstElement();
|
|
3619
|
+
} else {
|
|
3620
|
+
this.trigger.focus();
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3376
3624
|
// function to define props used within the scope of this component
|
|
3377
3625
|
static get properties() {
|
|
3378
3626
|
return {
|
|
@@ -3386,6 +3634,15 @@ class AuroDropdown extends AuroElement {
|
|
|
3386
3634
|
reflect: true
|
|
3387
3635
|
},
|
|
3388
3636
|
|
|
3637
|
+
/**
|
|
3638
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
3639
|
+
* @default false
|
|
3640
|
+
*/
|
|
3641
|
+
disableEventShow: {
|
|
3642
|
+
type: Boolean,
|
|
3643
|
+
reflect: true
|
|
3644
|
+
},
|
|
3645
|
+
|
|
3389
3646
|
/**
|
|
3390
3647
|
* If declared, applies a border around the trigger slot.
|
|
3391
3648
|
*/
|
|
@@ -3404,17 +3661,17 @@ class AuroDropdown extends AuroElement {
|
|
|
3404
3661
|
},
|
|
3405
3662
|
|
|
3406
3663
|
/**
|
|
3407
|
-
* If declared, the dropdown
|
|
3664
|
+
* If declared, the dropdown is not interactive.
|
|
3408
3665
|
*/
|
|
3409
|
-
|
|
3666
|
+
disabled: {
|
|
3410
3667
|
type: Boolean,
|
|
3411
3668
|
reflect: true
|
|
3412
3669
|
},
|
|
3413
3670
|
|
|
3414
3671
|
/**
|
|
3415
|
-
* If declared, the
|
|
3672
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
3416
3673
|
*/
|
|
3417
|
-
|
|
3674
|
+
disableFocusTrap: {
|
|
3418
3675
|
type: Boolean,
|
|
3419
3676
|
reflect: true
|
|
3420
3677
|
},
|
|
@@ -3459,22 +3716,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3459
3716
|
reflect: true
|
|
3460
3717
|
},
|
|
3461
3718
|
|
|
3462
|
-
/**
|
|
3463
|
-
* Makes the trigger to be full width of its parent container.
|
|
3464
|
-
*/
|
|
3465
|
-
fluid: {
|
|
3466
|
-
type: Boolean,
|
|
3467
|
-
reflect: true
|
|
3468
|
-
},
|
|
3469
|
-
|
|
3470
|
-
/**
|
|
3471
|
-
* If declared, will apply padding around trigger slot content.
|
|
3472
|
-
*/
|
|
3473
|
-
inset: {
|
|
3474
|
-
type: Boolean,
|
|
3475
|
-
reflect: true
|
|
3476
|
-
},
|
|
3477
|
-
|
|
3478
3719
|
/**
|
|
3479
3720
|
* If true, the dropdown bib is displayed.
|
|
3480
3721
|
*/
|
|
@@ -3518,15 +3759,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3518
3759
|
reflect: true
|
|
3519
3760
|
},
|
|
3520
3761
|
|
|
3521
|
-
/**
|
|
3522
|
-
* Defines if there is a label preset.
|
|
3523
|
-
* @private
|
|
3524
|
-
*/
|
|
3525
|
-
labeled: {
|
|
3526
|
-
type: Boolean,
|
|
3527
|
-
reflect: true
|
|
3528
|
-
},
|
|
3529
|
-
|
|
3530
3762
|
/**
|
|
3531
3763
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
3532
3764
|
* @private
|
|
@@ -3587,6 +3819,9 @@ class AuroDropdown extends AuroElement {
|
|
|
3587
3819
|
reflect: true
|
|
3588
3820
|
},
|
|
3589
3821
|
|
|
3822
|
+
/**
|
|
3823
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
3824
|
+
*/
|
|
3590
3825
|
onSlotChange: {
|
|
3591
3826
|
type: Function,
|
|
3592
3827
|
reflect: false
|
|
@@ -3601,14 +3836,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3601
3836
|
reflect: true
|
|
3602
3837
|
},
|
|
3603
3838
|
|
|
3604
|
-
/**
|
|
3605
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
3606
|
-
*/
|
|
3607
|
-
rounded: {
|
|
3608
|
-
type: Boolean,
|
|
3609
|
-
reflect: true
|
|
3610
|
-
},
|
|
3611
|
-
|
|
3612
3839
|
/**
|
|
3613
3840
|
* @private
|
|
3614
3841
|
*/
|
|
@@ -3623,22 +3850,14 @@ class AuroDropdown extends AuroElement {
|
|
|
3623
3850
|
type: String || undefined,
|
|
3624
3851
|
attribute: false,
|
|
3625
3852
|
reflect: false
|
|
3626
|
-
},
|
|
3627
|
-
|
|
3628
|
-
/**
|
|
3629
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
3630
|
-
*/
|
|
3631
|
-
a11yAutocomplete: {
|
|
3632
|
-
type: String,
|
|
3633
|
-
attribute: false,
|
|
3634
3853
|
}
|
|
3635
3854
|
};
|
|
3636
3855
|
}
|
|
3637
3856
|
|
|
3638
3857
|
static get styles() {
|
|
3639
3858
|
return [
|
|
3640
|
-
colorCss$1,
|
|
3641
3859
|
tokensCss$1,
|
|
3860
|
+
colorCss$1,
|
|
3642
3861
|
|
|
3643
3862
|
// default layout
|
|
3644
3863
|
classicColorCss,
|
|
@@ -3701,6 +3920,12 @@ class AuroDropdown extends AuroElement {
|
|
|
3701
3920
|
this.handleTriggerContentSlotChange();
|
|
3702
3921
|
}
|
|
3703
3922
|
|
|
3923
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
3924
|
+
this.updateFocusTrap();
|
|
3925
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
3926
|
+
this.trigger.focus();
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3704
3929
|
}
|
|
3705
3930
|
|
|
3706
3931
|
firstUpdated() {
|
|
@@ -3721,9 +3946,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3721
3946
|
}
|
|
3722
3947
|
|
|
3723
3948
|
this.bibContent = this.floater.element.bib;
|
|
3724
|
-
this.bibContent.setAttribute('role', 'dialog');
|
|
3725
|
-
this.bibContent.setAttribute('aria-modal', 'true');
|
|
3726
|
-
this.bibContent.setAttribute('aria-labelledby', 'triggerLabel');
|
|
3727
3949
|
|
|
3728
3950
|
// Add the tag name as an attribute if it is different than the component name
|
|
3729
3951
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-dropdown');
|
|
@@ -3769,6 +3991,27 @@ class AuroDropdown extends AuroElement {
|
|
|
3769
3991
|
this.hasFocus = true;
|
|
3770
3992
|
}
|
|
3771
3993
|
|
|
3994
|
+
/**
|
|
3995
|
+
* @private
|
|
3996
|
+
*/
|
|
3997
|
+
updateFocusTrap() {
|
|
3998
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
3999
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
4000
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4001
|
+
this.focusTrap.focusFirstElement();
|
|
4002
|
+
return;
|
|
4003
|
+
}
|
|
4004
|
+
|
|
4005
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
4006
|
+
if (!this.focusTrap) {
|
|
4007
|
+
return;
|
|
4008
|
+
}
|
|
4009
|
+
|
|
4010
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
4011
|
+
this.focusTrap.disconnect();
|
|
4012
|
+
this.focusTrap = undefined;
|
|
4013
|
+
}
|
|
4014
|
+
|
|
3772
4015
|
/**
|
|
3773
4016
|
* Function to support @focusout event.
|
|
3774
4017
|
* @private
|
|
@@ -4054,10 +4297,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4054
4297
|
id="bib"
|
|
4055
4298
|
shape="${this.shape}"
|
|
4056
4299
|
?data-show="${this.isPopoverVisible}"
|
|
4057
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
4058
|
-
?common="${this.common}"
|
|
4059
|
-
?rounded="${this.common || this.rounded}"
|
|
4060
|
-
?inset="${this.common || this.inset}">
|
|
4300
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
4061
4301
|
<div class="slotContent">
|
|
4062
4302
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4063
4303
|
</div>
|
|
@@ -16,17 +16,24 @@
|
|
|
16
16
|
<head>
|
|
17
17
|
<meta charset="UTF-8" />
|
|
18
18
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
-
<title>Auro Web Component
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/auro-classic/CSSCustomProperties.css"
|
|
26
|
-
|
|
19
|
+
<title>Auro Web Component Demo | auro-form</title>
|
|
20
|
+
|
|
21
|
+
<!-- Prism.js Stylesheet -->
|
|
22
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
|
|
23
|
+
|
|
24
|
+
<!-- Legacy reference is still needed to support auro-form's use of legacy token values at this time -->
|
|
25
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
26
|
+
|
|
27
|
+
<!-- Design Token Alaska Theme -->
|
|
28
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
+
|
|
30
|
+
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
+
|
|
33
|
+
<!-- Demo Specific Styles -->
|
|
27
34
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
|
|
28
35
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
|
|
29
|
-
|
|
36
|
+
</head>
|
|
30
37
|
<body class="auro-markdown">
|
|
31
38
|
<main></main>
|
|
32
39
|
|