@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
|
@@ -2282,6 +2282,267 @@ class AuroFloatingUI {
|
|
|
2282
2282
|
}
|
|
2283
2283
|
}
|
|
2284
2284
|
|
|
2285
|
+
// Selectors for focusable elements
|
|
2286
|
+
const FOCUSABLE_SELECTORS = [
|
|
2287
|
+
'a[href]',
|
|
2288
|
+
'button:not([disabled])',
|
|
2289
|
+
'textarea:not([disabled])',
|
|
2290
|
+
'input:not([disabled])',
|
|
2291
|
+
'select:not([disabled])',
|
|
2292
|
+
'[role="tab"]:not([disabled])',
|
|
2293
|
+
'[role="link"]:not([disabled])',
|
|
2294
|
+
'[role="button"]:not([disabled])',
|
|
2295
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
2296
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
2297
|
+
];
|
|
2298
|
+
|
|
2299
|
+
// List of custom components that are known to be focusable
|
|
2300
|
+
const FOCUSABLE_COMPONENTS = [
|
|
2301
|
+
'auro-checkbox',
|
|
2302
|
+
'auro-radio',
|
|
2303
|
+
'auro-dropdown',
|
|
2304
|
+
'auro-button',
|
|
2305
|
+
'auro-combobox',
|
|
2306
|
+
'auro-input',
|
|
2307
|
+
'auro-counter',
|
|
2308
|
+
'auro-menu',
|
|
2309
|
+
'auro-select',
|
|
2310
|
+
'auro-datepicker',
|
|
2311
|
+
'auro-hyperlink',
|
|
2312
|
+
'auro-accordion',
|
|
2313
|
+
];
|
|
2314
|
+
|
|
2315
|
+
/**
|
|
2316
|
+
* Determines if a given element is a custom focusable component.
|
|
2317
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
2318
|
+
*
|
|
2319
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
2320
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
2321
|
+
*/
|
|
2322
|
+
function isFocusableComponent(element) {
|
|
2323
|
+
const componentName = element.tagName.toLowerCase();
|
|
2324
|
+
|
|
2325
|
+
// Guard Clause: Element is a focusable component
|
|
2326
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
2327
|
+
|
|
2328
|
+
// Guard Clause: Element is not disabled
|
|
2329
|
+
if (element.hasAttribute('disabled')) return false;
|
|
2330
|
+
|
|
2331
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
2332
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
2333
|
+
|
|
2334
|
+
// If all guard clauses pass, the element is a focusable component
|
|
2335
|
+
return true;
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
/**
|
|
2339
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2340
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
2341
|
+
*
|
|
2342
|
+
* @param {HTMLElement} container The container to search within
|
|
2343
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2344
|
+
*/
|
|
2345
|
+
function getFocusableElements(container) {
|
|
2346
|
+
// Get elements in DOM order by walking the tree
|
|
2347
|
+
const orderedFocusableElements = [];
|
|
2348
|
+
|
|
2349
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
2350
|
+
const collectFocusableElements = (root) => {
|
|
2351
|
+
// Check if current element is focusable
|
|
2352
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
2353
|
+
// Check if this is a custom component that is focusable
|
|
2354
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
2355
|
+
|
|
2356
|
+
if (isComponentFocusable) {
|
|
2357
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
2358
|
+
orderedFocusableElements.push(root);
|
|
2359
|
+
return; // Skip traversing inside this component
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
// Check if the element itself matches any selector
|
|
2363
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
2364
|
+
if (root.matches?.(selector)) {
|
|
2365
|
+
orderedFocusableElements.push(root);
|
|
2366
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
// Process shadow DOM only for non-Auro components
|
|
2371
|
+
if (root.shadowRoot) {
|
|
2372
|
+
// Process shadow DOM children in order
|
|
2373
|
+
if (root.shadowRoot.children) {
|
|
2374
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
2375
|
+
collectFocusableElements(child);
|
|
2376
|
+
});
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
// Process slots and their assigned nodes in order
|
|
2381
|
+
if (root.tagName === 'SLOT') {
|
|
2382
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
2383
|
+
for (const node of assignedNodes) {
|
|
2384
|
+
collectFocusableElements(node);
|
|
2385
|
+
}
|
|
2386
|
+
} else {
|
|
2387
|
+
// Process light DOM children in order
|
|
2388
|
+
if (root.children) {
|
|
2389
|
+
Array.from(root.children).forEach(child => {
|
|
2390
|
+
collectFocusableElements(child);
|
|
2391
|
+
});
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
};
|
|
2396
|
+
|
|
2397
|
+
// Start the traversal from the container
|
|
2398
|
+
collectFocusableElements(container);
|
|
2399
|
+
|
|
2400
|
+
// Remove duplicates that might have been collected through different paths
|
|
2401
|
+
// while preserving order
|
|
2402
|
+
const uniqueElements = [];
|
|
2403
|
+
const seen = new Set();
|
|
2404
|
+
|
|
2405
|
+
for (const element of orderedFocusableElements) {
|
|
2406
|
+
if (!seen.has(element)) {
|
|
2407
|
+
seen.add(element);
|
|
2408
|
+
uniqueElements.push(element);
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
return uniqueElements;
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
/**
|
|
2416
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
2417
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
2418
|
+
*/
|
|
2419
|
+
class FocusTrap {
|
|
2420
|
+
/**
|
|
2421
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
2422
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
2423
|
+
*
|
|
2424
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
2425
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
2426
|
+
*/
|
|
2427
|
+
constructor(container) {
|
|
2428
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
2429
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
this.container = container;
|
|
2433
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
2434
|
+
|
|
2435
|
+
this._init();
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
/**
|
|
2439
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
2440
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
2441
|
+
*
|
|
2442
|
+
* @private
|
|
2443
|
+
*/
|
|
2444
|
+
_init() {
|
|
2445
|
+
|
|
2446
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
2447
|
+
if ('inert' in HTMLElement.prototype) {
|
|
2448
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
2449
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
// Track tab direction
|
|
2453
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
2458
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
2459
|
+
*
|
|
2460
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
2461
|
+
* @private
|
|
2462
|
+
*/
|
|
2463
|
+
_onKeydown = (e) => {
|
|
2464
|
+
|
|
2465
|
+
if (e.key === 'Tab') {
|
|
2466
|
+
|
|
2467
|
+
// Set the tab direction based on the key pressed
|
|
2468
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
2469
|
+
|
|
2470
|
+
// Get the active element(s) in the document and shadow root
|
|
2471
|
+
// This will include the active element in the shadow DOM if it exists
|
|
2472
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
2473
|
+
let activeElement = document.activeElement;
|
|
2474
|
+
const actives = [activeElement];
|
|
2475
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
2476
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
2477
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
// Update the focusable elements
|
|
2481
|
+
const focusables = this._getFocusableElements();
|
|
2482
|
+
|
|
2483
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
2484
|
+
const focusIndex =
|
|
2485
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
2486
|
+
? focusables.length - 1
|
|
2487
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
2488
|
+
? 0
|
|
2489
|
+
: null;
|
|
2490
|
+
|
|
2491
|
+
if (focusIndex !== null) {
|
|
2492
|
+
focusables[focusIndex].focus();
|
|
2493
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
2494
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
};
|
|
2498
|
+
|
|
2499
|
+
/**
|
|
2500
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2501
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
2502
|
+
*
|
|
2503
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2504
|
+
* @private
|
|
2505
|
+
*/
|
|
2506
|
+
_getFocusableElements() {
|
|
2507
|
+
// Use the imported utility function to get focusable elements
|
|
2508
|
+
const elements = getFocusableElements(this.container);
|
|
2509
|
+
|
|
2510
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
2511
|
+
return elements;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
/**
|
|
2515
|
+
* Moves focus to the first focusable element within the container.
|
|
2516
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
2517
|
+
*/
|
|
2518
|
+
focusFirstElement() {
|
|
2519
|
+
const focusables = this._getFocusableElements();
|
|
2520
|
+
if (focusables.length) focusables[0].focus();
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
/**
|
|
2524
|
+
* Moves focus to the last focusable element within the container.
|
|
2525
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
2526
|
+
*/
|
|
2527
|
+
focusLastElement() {
|
|
2528
|
+
const focusables = this._getFocusableElements();
|
|
2529
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
/**
|
|
2533
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
2534
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
2535
|
+
*/
|
|
2536
|
+
disconnect() {
|
|
2537
|
+
|
|
2538
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
2539
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2285
2546
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2286
2547
|
// See LICENSE in the project root for license information.
|
|
2287
2548
|
|
|
@@ -2725,11 +2986,11 @@ class AuroIcon extends BaseIcon {
|
|
|
2725
2986
|
|
|
2726
2987
|
var iconVersion = '6.1.2';
|
|
2727
2988
|
|
|
2728
|
-
var styleCss$1 = i$2`: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
|
|
2989
|
+
var styleCss$1 = i$2`: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}`;
|
|
2729
2990
|
|
|
2730
2991
|
var colorCss$2 = i$2`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2731
2992
|
|
|
2732
|
-
var tokensCss$1 = i$2`: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-
|
|
2993
|
+
var tokensCss$1 = i$2`: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)}`;
|
|
2733
2994
|
|
|
2734
2995
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2735
2996
|
// See LICENSE in the project root for license information.
|
|
@@ -2889,17 +3150,6 @@ class AuroDropdownBib extends i {
|
|
|
2889
3150
|
}
|
|
2890
3151
|
}
|
|
2891
3152
|
});
|
|
2892
|
-
|
|
2893
|
-
this.preventBodyScroll = this.preventBodyScroll.bind(this);
|
|
2894
|
-
this.addEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
2895
|
-
this.addEventListener('touchstart', this.preventBodyScroll, { passive: false });
|
|
2896
|
-
}
|
|
2897
|
-
|
|
2898
|
-
disconnectedCallback() {
|
|
2899
|
-
super.disconnectedCallback();
|
|
2900
|
-
|
|
2901
|
-
this.removeEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
2902
|
-
this.removeEventListener('touchstart', this.preventBodyScroll, { passive: false });
|
|
2903
3153
|
}
|
|
2904
3154
|
|
|
2905
3155
|
firstUpdated(changedProperties) {
|
|
@@ -2915,19 +3165,6 @@ class AuroDropdownBib extends i {
|
|
|
2915
3165
|
}));
|
|
2916
3166
|
}
|
|
2917
3167
|
|
|
2918
|
-
/**
|
|
2919
|
-
* Prevents scrolling of the body when touching empty areas of the component.
|
|
2920
|
-
* @param {Event} event - The touchmove event.
|
|
2921
|
-
* @returns {void}
|
|
2922
|
-
*/
|
|
2923
|
-
preventBodyScroll(event) {
|
|
2924
|
-
// when touchmove/touchstart on empty space
|
|
2925
|
-
if (event.target === this) {
|
|
2926
|
-
event.preventDefault();
|
|
2927
|
-
event.stopImmediatePropagation();
|
|
2928
|
-
}
|
|
2929
|
-
}
|
|
2930
|
-
|
|
2931
3168
|
// function that renders the HTML and CSS into the scope of the component
|
|
2932
3169
|
render() {
|
|
2933
3170
|
const classes = {
|
|
@@ -2950,19 +3187,19 @@ var dropdownVersion = '3.0.0';
|
|
|
2950
3187
|
|
|
2951
3188
|
var shapeSizeCss = i$2`.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}`;
|
|
2952
3189
|
|
|
2953
|
-
var colorCss$1 = i$2`: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:
|
|
3190
|
+
var colorCss$1 = i$2`: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)}`;
|
|
2954
3191
|
|
|
2955
|
-
var classicColorCss = i$2
|
|
3192
|
+
var classicColorCss = i$2``;
|
|
2956
3193
|
|
|
2957
|
-
var classicLayoutCss = i$2`: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]) .
|
|
3194
|
+
var classicLayoutCss = i$2`: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%}`;
|
|
2958
3195
|
|
|
2959
|
-
var styleEmphasizedCss = i$2`: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
|
|
3196
|
+
var styleEmphasizedCss = i$2`: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)}`;
|
|
2960
3197
|
|
|
2961
|
-
var styleSnowflakeCss = i$2`:host{display:block}.wrapper{display:flex;flex-direction:row
|
|
3198
|
+
var styleSnowflakeCss = i$2`: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)}`;
|
|
2962
3199
|
|
|
2963
3200
|
var colorCss = i$2`: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)}`;
|
|
2964
3201
|
|
|
2965
|
-
var styleCss = i$2
|
|
3202
|
+
var styleCss = i$2`: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}`;
|
|
2966
3203
|
|
|
2967
3204
|
var tokensCss = i$2`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
2968
3205
|
|
|
@@ -3267,10 +3504,8 @@ class AuroElement extends i {
|
|
|
3267
3504
|
// See LICENSE in the project root for license information.
|
|
3268
3505
|
|
|
3269
3506
|
|
|
3270
|
-
|
|
3271
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
3507
|
+
/*
|
|
3272
3508
|
* @slot - Default slot for the popover content.
|
|
3273
|
-
* @slot label - Defines the content of the label.
|
|
3274
3509
|
* @slot helpText - Defines the content of the helpText.
|
|
3275
3510
|
* @slot trigger - Defines the content of the trigger.
|
|
3276
3511
|
* @csspart trigger - The trigger content container.
|
|
@@ -3289,18 +3524,22 @@ class AuroDropdown extends AuroElement {
|
|
|
3289
3524
|
this.matchWidth = false;
|
|
3290
3525
|
this.noHideOnThisFocusLoss = false;
|
|
3291
3526
|
|
|
3292
|
-
this.errorMessage =
|
|
3527
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
3293
3528
|
|
|
3294
3529
|
// Layout Config
|
|
3295
|
-
this.layout =
|
|
3296
|
-
this.shape =
|
|
3297
|
-
this.size =
|
|
3530
|
+
this.layout = undefined;
|
|
3531
|
+
this.shape = undefined;
|
|
3532
|
+
this.size = undefined;
|
|
3298
3533
|
|
|
3299
3534
|
this.parentBorder = false;
|
|
3300
3535
|
|
|
3301
3536
|
this.privateDefaults();
|
|
3302
3537
|
}
|
|
3303
3538
|
|
|
3539
|
+
/**
|
|
3540
|
+
* @private
|
|
3541
|
+
* @returns {object} Class definition for the wrapper element.
|
|
3542
|
+
*/
|
|
3304
3543
|
get commonWrapperClasses() {
|
|
3305
3544
|
return {
|
|
3306
3545
|
'trigger': true,
|
|
@@ -3318,13 +3557,10 @@ class AuroDropdown extends AuroElement {
|
|
|
3318
3557
|
privateDefaults() {
|
|
3319
3558
|
this.chevron = false;
|
|
3320
3559
|
this.disabled = false;
|
|
3560
|
+
this.disableFocusTrap = false;
|
|
3321
3561
|
this.error = false;
|
|
3322
|
-
this.inset = false;
|
|
3323
|
-
this.rounded = false;
|
|
3324
3562
|
this.tabIndex = 0;
|
|
3325
3563
|
this.noToggle = false;
|
|
3326
|
-
this.a11yAutocomplete = 'none';
|
|
3327
|
-
this.labeled = true;
|
|
3328
3564
|
this.a11yRole = 'button';
|
|
3329
3565
|
this.onDark = false;
|
|
3330
3566
|
this.showTriggerBorders = true;
|
|
@@ -3420,6 +3656,18 @@ class AuroDropdown extends AuroElement {
|
|
|
3420
3656
|
this.floater.showBib();
|
|
3421
3657
|
}
|
|
3422
3658
|
|
|
3659
|
+
/**
|
|
3660
|
+
* When bib is open, focus on the first element inside of bib.
|
|
3661
|
+
* If not, trigger element will get focus.
|
|
3662
|
+
*/
|
|
3663
|
+
focus() {
|
|
3664
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
3665
|
+
this.focusTrap.focusFirstElement();
|
|
3666
|
+
} else {
|
|
3667
|
+
this.trigger.focus();
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3423
3671
|
// function to define props used within the scope of this component
|
|
3424
3672
|
static get properties() {
|
|
3425
3673
|
return {
|
|
@@ -3433,6 +3681,15 @@ class AuroDropdown extends AuroElement {
|
|
|
3433
3681
|
reflect: true
|
|
3434
3682
|
},
|
|
3435
3683
|
|
|
3684
|
+
/**
|
|
3685
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
3686
|
+
* @default false
|
|
3687
|
+
*/
|
|
3688
|
+
disableEventShow: {
|
|
3689
|
+
type: Boolean,
|
|
3690
|
+
reflect: true
|
|
3691
|
+
},
|
|
3692
|
+
|
|
3436
3693
|
/**
|
|
3437
3694
|
* If declared, applies a border around the trigger slot.
|
|
3438
3695
|
*/
|
|
@@ -3451,17 +3708,17 @@ class AuroDropdown extends AuroElement {
|
|
|
3451
3708
|
},
|
|
3452
3709
|
|
|
3453
3710
|
/**
|
|
3454
|
-
* If declared, the dropdown
|
|
3711
|
+
* If declared, the dropdown is not interactive.
|
|
3455
3712
|
*/
|
|
3456
|
-
|
|
3713
|
+
disabled: {
|
|
3457
3714
|
type: Boolean,
|
|
3458
3715
|
reflect: true
|
|
3459
3716
|
},
|
|
3460
3717
|
|
|
3461
3718
|
/**
|
|
3462
|
-
* If declared, the
|
|
3719
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
3463
3720
|
*/
|
|
3464
|
-
|
|
3721
|
+
disableFocusTrap: {
|
|
3465
3722
|
type: Boolean,
|
|
3466
3723
|
reflect: true
|
|
3467
3724
|
},
|
|
@@ -3506,22 +3763,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3506
3763
|
reflect: true
|
|
3507
3764
|
},
|
|
3508
3765
|
|
|
3509
|
-
/**
|
|
3510
|
-
* Makes the trigger to be full width of its parent container.
|
|
3511
|
-
*/
|
|
3512
|
-
fluid: {
|
|
3513
|
-
type: Boolean,
|
|
3514
|
-
reflect: true
|
|
3515
|
-
},
|
|
3516
|
-
|
|
3517
|
-
/**
|
|
3518
|
-
* If declared, will apply padding around trigger slot content.
|
|
3519
|
-
*/
|
|
3520
|
-
inset: {
|
|
3521
|
-
type: Boolean,
|
|
3522
|
-
reflect: true
|
|
3523
|
-
},
|
|
3524
|
-
|
|
3525
3766
|
/**
|
|
3526
3767
|
* If true, the dropdown bib is displayed.
|
|
3527
3768
|
*/
|
|
@@ -3565,15 +3806,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3565
3806
|
reflect: true
|
|
3566
3807
|
},
|
|
3567
3808
|
|
|
3568
|
-
/**
|
|
3569
|
-
* Defines if there is a label preset.
|
|
3570
|
-
* @private
|
|
3571
|
-
*/
|
|
3572
|
-
labeled: {
|
|
3573
|
-
type: Boolean,
|
|
3574
|
-
reflect: true
|
|
3575
|
-
},
|
|
3576
|
-
|
|
3577
3809
|
/**
|
|
3578
3810
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
3579
3811
|
* @private
|
|
@@ -3634,6 +3866,9 @@ class AuroDropdown extends AuroElement {
|
|
|
3634
3866
|
reflect: true
|
|
3635
3867
|
},
|
|
3636
3868
|
|
|
3869
|
+
/**
|
|
3870
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
3871
|
+
*/
|
|
3637
3872
|
onSlotChange: {
|
|
3638
3873
|
type: Function,
|
|
3639
3874
|
reflect: false
|
|
@@ -3648,14 +3883,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3648
3883
|
reflect: true
|
|
3649
3884
|
},
|
|
3650
3885
|
|
|
3651
|
-
/**
|
|
3652
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
3653
|
-
*/
|
|
3654
|
-
rounded: {
|
|
3655
|
-
type: Boolean,
|
|
3656
|
-
reflect: true
|
|
3657
|
-
},
|
|
3658
|
-
|
|
3659
3886
|
/**
|
|
3660
3887
|
* @private
|
|
3661
3888
|
*/
|
|
@@ -3670,22 +3897,14 @@ class AuroDropdown extends AuroElement {
|
|
|
3670
3897
|
type: String || undefined,
|
|
3671
3898
|
attribute: false,
|
|
3672
3899
|
reflect: false
|
|
3673
|
-
},
|
|
3674
|
-
|
|
3675
|
-
/**
|
|
3676
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
3677
|
-
*/
|
|
3678
|
-
a11yAutocomplete: {
|
|
3679
|
-
type: String,
|
|
3680
|
-
attribute: false,
|
|
3681
3900
|
}
|
|
3682
3901
|
};
|
|
3683
3902
|
}
|
|
3684
3903
|
|
|
3685
3904
|
static get styles() {
|
|
3686
3905
|
return [
|
|
3687
|
-
colorCss$1,
|
|
3688
3906
|
tokensCss$1,
|
|
3907
|
+
colorCss$1,
|
|
3689
3908
|
|
|
3690
3909
|
// default layout
|
|
3691
3910
|
classicColorCss,
|
|
@@ -3748,6 +3967,12 @@ class AuroDropdown extends AuroElement {
|
|
|
3748
3967
|
this.handleTriggerContentSlotChange();
|
|
3749
3968
|
}
|
|
3750
3969
|
|
|
3970
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
3971
|
+
this.updateFocusTrap();
|
|
3972
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
3973
|
+
this.trigger.focus();
|
|
3974
|
+
}
|
|
3975
|
+
}
|
|
3751
3976
|
}
|
|
3752
3977
|
|
|
3753
3978
|
firstUpdated() {
|
|
@@ -3768,9 +3993,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3768
3993
|
}
|
|
3769
3994
|
|
|
3770
3995
|
this.bibContent = this.floater.element.bib;
|
|
3771
|
-
this.bibContent.setAttribute('role', 'dialog');
|
|
3772
|
-
this.bibContent.setAttribute('aria-modal', 'true');
|
|
3773
|
-
this.bibContent.setAttribute('aria-labelledby', 'triggerLabel');
|
|
3774
3996
|
|
|
3775
3997
|
// Add the tag name as an attribute if it is different than the component name
|
|
3776
3998
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-dropdown');
|
|
@@ -3816,6 +4038,27 @@ class AuroDropdown extends AuroElement {
|
|
|
3816
4038
|
this.hasFocus = true;
|
|
3817
4039
|
}
|
|
3818
4040
|
|
|
4041
|
+
/**
|
|
4042
|
+
* @private
|
|
4043
|
+
*/
|
|
4044
|
+
updateFocusTrap() {
|
|
4045
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
4046
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
4047
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4048
|
+
this.focusTrap.focusFirstElement();
|
|
4049
|
+
return;
|
|
4050
|
+
}
|
|
4051
|
+
|
|
4052
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
4053
|
+
if (!this.focusTrap) {
|
|
4054
|
+
return;
|
|
4055
|
+
}
|
|
4056
|
+
|
|
4057
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
4058
|
+
this.focusTrap.disconnect();
|
|
4059
|
+
this.focusTrap = undefined;
|
|
4060
|
+
}
|
|
4061
|
+
|
|
3819
4062
|
/**
|
|
3820
4063
|
* Function to support @focusout event.
|
|
3821
4064
|
* @private
|
|
@@ -4101,10 +4344,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4101
4344
|
id="bib"
|
|
4102
4345
|
shape="${this.shape}"
|
|
4103
4346
|
?data-show="${this.isPopoverVisible}"
|
|
4104
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
4105
|
-
?common="${this.common}"
|
|
4106
|
-
?rounded="${this.common || this.rounded}"
|
|
4107
|
-
?inset="${this.common || this.inset}">
|
|
4347
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
4108
4348
|
<div class="slotContent">
|
|
4109
4349
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4110
4350
|
</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-dropdown</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-dropdown'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
|
|