@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.6 → 0.0.0-pr624.61
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 +12 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1214 -83
- package/components/bibtemplate/dist/registered.js +1214 -83
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.html +16 -10
- package/components/checkbox/demo/api.md +47 -14
- package/components/checkbox/demo/api.min.js +65 -42
- package/components/checkbox/demo/index.html +16 -10
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +65 -42
- package/components/checkbox/demo/readme.html +16 -9
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
- package/components/checkbox/dist/index.js +65 -42
- package/components/checkbox/dist/registered.js +65 -42
- package/components/combobox/demo/api.html +16 -10
- package/components/combobox/demo/api.md +113 -8
- package/components/combobox/demo/api.min.js +3052 -926
- package/components/combobox/demo/index.html +16 -10
- package/components/combobox/demo/index.md +6 -30
- package/components/combobox/demo/index.min.js +3052 -926
- package/components/combobox/demo/readme.html +16 -9
- package/components/combobox/dist/auro-combobox.d.ts +42 -8
- package/components/combobox/dist/index.js +2773 -743
- package/components/combobox/dist/registered.js +2773 -743
- package/components/counter/demo/api.html +17 -10
- package/components/counter/demo/api.md +156 -21
- package/components/counter/demo/api.min.js +6728 -4118
- package/components/counter/demo/index.html +17 -10
- package/components/counter/demo/index.md +185 -34
- package/components/counter/demo/index.min.js +6728 -4118
- package/components/counter/demo/readme.html +16 -9
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/auro-counter-group.d.ts +151 -11
- package/components/counter/dist/auro-counter.d.ts +16 -0
- package/components/counter/dist/helptextVersion.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +6728 -4118
- package/components/counter/dist/registered.js +6728 -4118
- package/components/datepicker/demo/api.html +16 -10
- package/components/datepicker/demo/api.md +25 -16
- package/components/datepicker/demo/api.min.js +11540 -7985
- package/components/datepicker/demo/index.html +16 -10
- package/components/datepicker/demo/index.md +71 -4
- package/components/datepicker/demo/index.min.js +11540 -7985
- package/components/datepicker/demo/readme.html +16 -9
- package/components/datepicker/dist/auro-datepicker.d.ts +89 -11
- package/components/datepicker/dist/buttonVersion.d.ts +1 -1
- package/components/datepicker/dist/iconVersion.d.ts +2 -0
- package/components/datepicker/dist/index.js +11603 -8048
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +11603 -8048
- package/components/dropdown/demo/api.html +16 -10
- package/components/dropdown/demo/api.md +81 -274
- package/components/dropdown/demo/api.min.js +429 -195
- package/components/dropdown/demo/index.html +16 -10
- package/components/dropdown/demo/index.md +92 -362
- package/components/dropdown/demo/index.min.js +429 -195
- package/components/dropdown/demo/readme.html +16 -9
- package/components/dropdown/dist/auro-dropdown.d.ts +41 -76
- package/components/dropdown/dist/auro-dropdownBib.d.ts +14 -0
- package/components/dropdown/dist/index.js +429 -195
- package/components/dropdown/dist/registered.js +429 -195
- package/components/form/demo/api.html +16 -9
- package/components/form/demo/api.min.js +1 -1
- package/components/form/demo/autocomplete.html +19 -3
- package/components/form/demo/index.html +16 -9
- package/components/form/demo/index.min.js +1 -1
- package/components/form/demo/readme.html +16 -9
- package/components/form/demo/working.html +19 -13
- package/components/form/dist/index.js +1 -1
- package/components/form/dist/registered.js +1 -1
- package/components/helptext/dist/index.js +2 -2
- package/components/helptext/dist/registered.js +2 -2
- package/components/input/README.md +5 -2
- package/components/input/demo/api.html +16 -10
- package/components/input/demo/api.md +228 -130
- package/components/input/demo/api.min.js +853 -241
- package/components/input/demo/index.html +16 -10
- package/components/input/demo/index.md +48 -32
- package/components/input/demo/index.min.js +853 -241
- package/components/input/demo/readme.html +16 -9
- package/components/input/demo/readme.md +5 -2
- package/components/input/dist/auro-input.d.ts +3 -3
- package/components/input/dist/base-input.d.ts +38 -10
- package/components/input/dist/buttonVersion.d.ts +1 -1
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +853 -241
- package/components/input/dist/registered.js +853 -241
- package/components/layoutElement/dist/index.js +13 -10
- package/components/menu/demo/api.html +32 -10
- package/components/menu/demo/api.md +69 -8
- package/components/menu/demo/api.min.js +238 -47
- package/components/menu/demo/index.html +16 -10
- package/components/menu/demo/index.min.js +238 -47
- package/components/menu/demo/readme.html +16 -9
- package/components/menu/dist/auro-menu.d.ts +41 -7
- package/components/menu/dist/auro-menuoption.d.ts +15 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +238 -47
- package/components/menu/dist/registered.js +238 -47
- package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
- package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
- package/components/radio/demo/api.html +16 -10
- package/components/radio/demo/api.md +7 -8
- package/components/radio/demo/api.min.js +88 -90
- package/components/radio/demo/index.html +16 -10
- package/components/radio/demo/index.min.js +88 -90
- package/components/radio/demo/readme.html +16 -9
- package/components/radio/dist/auro-radio-group.d.ts +1 -1
- package/components/radio/dist/auro-radio.d.ts +9 -12
- package/components/radio/dist/index.js +88 -90
- package/components/radio/dist/registered.js +88 -90
- package/components/select/demo/api.html +16 -10
- package/components/select/demo/api.js +0 -2
- package/components/select/demo/api.md +104 -57
- package/components/select/demo/api.min.js +2123 -644
- package/components/select/demo/index.html +16 -11
- package/components/select/demo/index.md +45 -158
- package/components/select/demo/index.min.js +2123 -632
- package/components/select/demo/readme.html +16 -9
- package/components/select/dist/auro-select.d.ts +57 -16
- package/components/select/dist/index.js +2047 -652
- package/components/select/dist/registered.js +2047 -652
- package/package.json +29 -26
- /package/components/{datepicker/dist/styles/emphasized/style-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
- /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/color-css.d.ts +0 -0
- /package/components/{dropdown/dist/styles/default → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
- /package/components/dropdown/dist/styles/{default → classic}/bibColors-css.d.ts +0 -0
- /package/components/dropdown/dist/styles/{default → classic}/bibStyles-css.d.ts +0 -0
- /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
- /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menu-css.d.ts → default/color-menu-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{style-menuoption-css.d.ts → default/color-menuoption-css.d.ts} +0 -0
- /package/components/menu/dist/styles/{tokens-css.d.ts → default/style-menu-css.d.ts} +0 -0
|
@@ -1755,7 +1755,7 @@ class AuroFloatingUI {
|
|
|
1755
1755
|
*/
|
|
1756
1756
|
mirrorSize() {
|
|
1757
1757
|
// mirror the boxsize from bibSizer
|
|
1758
|
-
if (this.element.bibSizer) {
|
|
1758
|
+
if (this.element.bibSizer && this.element.matchWidth) {
|
|
1759
1759
|
const sizerStyle = window.getComputedStyle(this.element.bibSizer);
|
|
1760
1760
|
const bibContent = this.element.bib.shadowRoot.querySelector(".container");
|
|
1761
1761
|
if (sizerStyle.width !== '0px') {
|
|
@@ -1967,13 +1967,13 @@ class AuroFloatingUI {
|
|
|
1967
1967
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
1968
1968
|
return;
|
|
1969
1969
|
}
|
|
1970
|
-
|
|
1970
|
+
|
|
1971
1971
|
// if fullscreen bib is in fullscreen mode, do not close
|
|
1972
1972
|
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
1973
1973
|
return;
|
|
1974
1974
|
}
|
|
1975
1975
|
|
|
1976
|
-
this.hideBib();
|
|
1976
|
+
this.hideBib("keydown");
|
|
1977
1977
|
}
|
|
1978
1978
|
|
|
1979
1979
|
setupHideHandlers() {
|
|
@@ -1998,7 +1998,7 @@ class AuroFloatingUI {
|
|
|
1998
1998
|
document.expandedAuroFormkitDropdown = null;
|
|
1999
1999
|
document.expandedAuroFloater = this;
|
|
2000
2000
|
} else {
|
|
2001
|
-
this.hideBib();
|
|
2001
|
+
this.hideBib("click");
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
2004
|
};
|
|
@@ -2011,7 +2011,7 @@ class AuroFloatingUI {
|
|
|
2011
2011
|
// if something else is open, let it handle itself
|
|
2012
2012
|
return;
|
|
2013
2013
|
}
|
|
2014
|
-
this.hideBib();
|
|
2014
|
+
this.hideBib("keydown");
|
|
2015
2015
|
}
|
|
2016
2016
|
};
|
|
2017
2017
|
|
|
@@ -2094,7 +2094,11 @@ class AuroFloatingUI {
|
|
|
2094
2094
|
}
|
|
2095
2095
|
}
|
|
2096
2096
|
|
|
2097
|
-
|
|
2097
|
+
/**
|
|
2098
|
+
* Hides the floating UI element.
|
|
2099
|
+
* @param {String} eventType - The event type that triggered the hiding action.
|
|
2100
|
+
*/
|
|
2101
|
+
hideBib(eventType = "unknown") {
|
|
2098
2102
|
if (!this.element.disabled && !this.element.noToggle) {
|
|
2099
2103
|
this.lockScroll(false);
|
|
2100
2104
|
this.element.triggerChevron?.removeAttribute('data-expanded');
|
|
@@ -2105,7 +2109,7 @@ class AuroFloatingUI {
|
|
|
2105
2109
|
if (this.showing) {
|
|
2106
2110
|
this.cleanupHideHandlers();
|
|
2107
2111
|
this.showing = false;
|
|
2108
|
-
this.dispatchEventDropdownToggle();
|
|
2112
|
+
this.dispatchEventDropdownToggle(eventType);
|
|
2109
2113
|
}
|
|
2110
2114
|
}
|
|
2111
2115
|
document.expandedAuroFloater = null;
|
|
@@ -2114,11 +2118,13 @@ class AuroFloatingUI {
|
|
|
2114
2118
|
/**
|
|
2115
2119
|
* @private
|
|
2116
2120
|
* @returns {void} Dispatches event with an object showing the state of the dropdown.
|
|
2121
|
+
* @param {String} eventType - The event type that triggered the toggle action.
|
|
2117
2122
|
*/
|
|
2118
|
-
dispatchEventDropdownToggle() {
|
|
2123
|
+
dispatchEventDropdownToggle(eventType) {
|
|
2119
2124
|
const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
|
|
2120
2125
|
detail: {
|
|
2121
2126
|
expanded: this.showing,
|
|
2127
|
+
eventType: eventType || "unknown",
|
|
2122
2128
|
},
|
|
2123
2129
|
composed: true
|
|
2124
2130
|
});
|
|
@@ -2128,7 +2134,7 @@ class AuroFloatingUI {
|
|
|
2128
2134
|
|
|
2129
2135
|
handleClick() {
|
|
2130
2136
|
if (this.element.isPopoverVisible) {
|
|
2131
|
-
this.hideBib();
|
|
2137
|
+
this.hideBib("click");
|
|
2132
2138
|
} else {
|
|
2133
2139
|
this.showBib();
|
|
2134
2140
|
}
|
|
@@ -2151,8 +2157,9 @@ class AuroFloatingUI {
|
|
|
2151
2157
|
// Space is included as it's expected behavior for interactive elements
|
|
2152
2158
|
|
|
2153
2159
|
const origin = event.composedPath()[0];
|
|
2154
|
-
if (event.key === 'Enter' || (
|
|
2155
|
-
|
|
2160
|
+
if (event.key === 'Enter' || event.key === ' ' && (!origin || origin.tagName !== "INPUT")) {
|
|
2161
|
+
|
|
2162
|
+
event.preventDefault();
|
|
2156
2163
|
this.handleClick();
|
|
2157
2164
|
}
|
|
2158
2165
|
break;
|
|
@@ -2163,7 +2170,7 @@ class AuroFloatingUI {
|
|
|
2163
2170
|
break;
|
|
2164
2171
|
case 'mouseleave':
|
|
2165
2172
|
if (this.element.hoverToggle) {
|
|
2166
|
-
this.hideBib();
|
|
2173
|
+
this.hideBib("mouseleave");
|
|
2167
2174
|
}
|
|
2168
2175
|
break;
|
|
2169
2176
|
case 'focus':
|
|
@@ -2306,6 +2313,267 @@ class AuroFloatingUI {
|
|
|
2306
2313
|
}
|
|
2307
2314
|
}
|
|
2308
2315
|
|
|
2316
|
+
// Selectors for focusable elements
|
|
2317
|
+
const FOCUSABLE_SELECTORS = [
|
|
2318
|
+
'a[href]',
|
|
2319
|
+
'button:not([disabled])',
|
|
2320
|
+
'textarea:not([disabled])',
|
|
2321
|
+
'input:not([disabled])',
|
|
2322
|
+
'select:not([disabled])',
|
|
2323
|
+
'[role="tab"]:not([disabled])',
|
|
2324
|
+
'[role="link"]:not([disabled])',
|
|
2325
|
+
'[role="button"]:not([disabled])',
|
|
2326
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
2327
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
2328
|
+
];
|
|
2329
|
+
|
|
2330
|
+
// List of custom components that are known to be focusable
|
|
2331
|
+
const FOCUSABLE_COMPONENTS = [
|
|
2332
|
+
'auro-checkbox',
|
|
2333
|
+
'auro-radio',
|
|
2334
|
+
'auro-dropdown',
|
|
2335
|
+
'auro-button',
|
|
2336
|
+
'auro-combobox',
|
|
2337
|
+
'auro-input',
|
|
2338
|
+
'auro-counter',
|
|
2339
|
+
'auro-menu',
|
|
2340
|
+
'auro-select',
|
|
2341
|
+
'auro-datepicker',
|
|
2342
|
+
'auro-hyperlink',
|
|
2343
|
+
'auro-accordion',
|
|
2344
|
+
];
|
|
2345
|
+
|
|
2346
|
+
/**
|
|
2347
|
+
* Determines if a given element is a custom focusable component.
|
|
2348
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
2349
|
+
*
|
|
2350
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
2351
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
2352
|
+
*/
|
|
2353
|
+
function isFocusableComponent(element) {
|
|
2354
|
+
const componentName = element.tagName.toLowerCase();
|
|
2355
|
+
|
|
2356
|
+
// Guard Clause: Element is a focusable component
|
|
2357
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
2358
|
+
|
|
2359
|
+
// Guard Clause: Element is not disabled
|
|
2360
|
+
if (element.hasAttribute('disabled')) return false;
|
|
2361
|
+
|
|
2362
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
2363
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
2364
|
+
|
|
2365
|
+
// If all guard clauses pass, the element is a focusable component
|
|
2366
|
+
return true;
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
/**
|
|
2370
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2371
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
2372
|
+
*
|
|
2373
|
+
* @param {HTMLElement} container The container to search within
|
|
2374
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2375
|
+
*/
|
|
2376
|
+
function getFocusableElements(container) {
|
|
2377
|
+
// Get elements in DOM order by walking the tree
|
|
2378
|
+
const orderedFocusableElements = [];
|
|
2379
|
+
|
|
2380
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
2381
|
+
const collectFocusableElements = (root) => {
|
|
2382
|
+
// Check if current element is focusable
|
|
2383
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
2384
|
+
// Check if this is a custom component that is focusable
|
|
2385
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
2386
|
+
|
|
2387
|
+
if (isComponentFocusable) {
|
|
2388
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
2389
|
+
orderedFocusableElements.push(root);
|
|
2390
|
+
return; // Skip traversing inside this component
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
// Check if the element itself matches any selector
|
|
2394
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
2395
|
+
if (root.matches?.(selector)) {
|
|
2396
|
+
orderedFocusableElements.push(root);
|
|
2397
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
// Process shadow DOM only for non-Auro components
|
|
2402
|
+
if (root.shadowRoot) {
|
|
2403
|
+
// Process shadow DOM children in order
|
|
2404
|
+
if (root.shadowRoot.children) {
|
|
2405
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
2406
|
+
collectFocusableElements(child);
|
|
2407
|
+
});
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
// Process slots and their assigned nodes in order
|
|
2412
|
+
if (root.tagName === 'SLOT') {
|
|
2413
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
2414
|
+
for (const node of assignedNodes) {
|
|
2415
|
+
collectFocusableElements(node);
|
|
2416
|
+
}
|
|
2417
|
+
} else {
|
|
2418
|
+
// Process light DOM children in order
|
|
2419
|
+
if (root.children) {
|
|
2420
|
+
Array.from(root.children).forEach(child => {
|
|
2421
|
+
collectFocusableElements(child);
|
|
2422
|
+
});
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
};
|
|
2427
|
+
|
|
2428
|
+
// Start the traversal from the container
|
|
2429
|
+
collectFocusableElements(container);
|
|
2430
|
+
|
|
2431
|
+
// Remove duplicates that might have been collected through different paths
|
|
2432
|
+
// while preserving order
|
|
2433
|
+
const uniqueElements = [];
|
|
2434
|
+
const seen = new Set();
|
|
2435
|
+
|
|
2436
|
+
for (const element of orderedFocusableElements) {
|
|
2437
|
+
if (!seen.has(element)) {
|
|
2438
|
+
seen.add(element);
|
|
2439
|
+
uniqueElements.push(element);
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
return uniqueElements;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
/**
|
|
2447
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
2448
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
2449
|
+
*/
|
|
2450
|
+
class FocusTrap {
|
|
2451
|
+
/**
|
|
2452
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
2453
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
2454
|
+
*
|
|
2455
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
2456
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
2457
|
+
*/
|
|
2458
|
+
constructor(container) {
|
|
2459
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
2460
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
this.container = container;
|
|
2464
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
2465
|
+
|
|
2466
|
+
this._init();
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
/**
|
|
2470
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
2471
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
2472
|
+
*
|
|
2473
|
+
* @private
|
|
2474
|
+
*/
|
|
2475
|
+
_init() {
|
|
2476
|
+
|
|
2477
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
2478
|
+
if ('inert' in HTMLElement.prototype) {
|
|
2479
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
2480
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
// Track tab direction
|
|
2484
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
/**
|
|
2488
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
2489
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
2490
|
+
*
|
|
2491
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
2492
|
+
* @private
|
|
2493
|
+
*/
|
|
2494
|
+
_onKeydown = (e) => {
|
|
2495
|
+
|
|
2496
|
+
if (e.key === 'Tab') {
|
|
2497
|
+
|
|
2498
|
+
// Set the tab direction based on the key pressed
|
|
2499
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
2500
|
+
|
|
2501
|
+
// Get the active element(s) in the document and shadow root
|
|
2502
|
+
// This will include the active element in the shadow DOM if it exists
|
|
2503
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
2504
|
+
let activeElement = document.activeElement;
|
|
2505
|
+
const actives = [activeElement];
|
|
2506
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
2507
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
2508
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
// Update the focusable elements
|
|
2512
|
+
const focusables = this._getFocusableElements();
|
|
2513
|
+
|
|
2514
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
2515
|
+
const focusIndex =
|
|
2516
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
2517
|
+
? focusables.length - 1
|
|
2518
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
2519
|
+
? 0
|
|
2520
|
+
: null;
|
|
2521
|
+
|
|
2522
|
+
if (focusIndex !== null) {
|
|
2523
|
+
focusables[focusIndex].focus();
|
|
2524
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
2525
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
};
|
|
2529
|
+
|
|
2530
|
+
/**
|
|
2531
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
2532
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
2533
|
+
*
|
|
2534
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
2535
|
+
* @private
|
|
2536
|
+
*/
|
|
2537
|
+
_getFocusableElements() {
|
|
2538
|
+
// Use the imported utility function to get focusable elements
|
|
2539
|
+
const elements = getFocusableElements(this.container);
|
|
2540
|
+
|
|
2541
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
2542
|
+
return elements;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
/**
|
|
2546
|
+
* Moves focus to the first focusable element within the container.
|
|
2547
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
2548
|
+
*/
|
|
2549
|
+
focusFirstElement() {
|
|
2550
|
+
const focusables = this._getFocusableElements();
|
|
2551
|
+
if (focusables.length) focusables[0].focus();
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* Moves focus to the last focusable element within the container.
|
|
2556
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
2557
|
+
*/
|
|
2558
|
+
focusLastElement() {
|
|
2559
|
+
const focusables = this._getFocusableElements();
|
|
2560
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
/**
|
|
2564
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
2565
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
2566
|
+
*/
|
|
2567
|
+
disconnect() {
|
|
2568
|
+
|
|
2569
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
2570
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2309
2577
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2310
2578
|
// See LICENSE in the project root for license information.
|
|
2311
2579
|
|
|
@@ -2698,8 +2966,12 @@ class AuroIcon extends BaseIcon {
|
|
|
2698
2966
|
async firstUpdated() {
|
|
2699
2967
|
await super.firstUpdated();
|
|
2700
2968
|
|
|
2701
|
-
|
|
2702
|
-
|
|
2969
|
+
/**
|
|
2970
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
2971
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
2972
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
2973
|
+
*/
|
|
2974
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
2703
2975
|
const svgDesc = this.svg.querySelector('desc');
|
|
2704
2976
|
|
|
2705
2977
|
if (svgDesc) {
|
|
@@ -2745,11 +3017,11 @@ class AuroIcon extends BaseIcon {
|
|
|
2745
3017
|
|
|
2746
3018
|
var iconVersion = '6.1.2';
|
|
2747
3019
|
|
|
2748
|
-
var styleCss$1 = i$2`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}.container{
|
|
3020
|
+
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}`;
|
|
2749
3021
|
|
|
2750
3022
|
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)}`;
|
|
2751
3023
|
|
|
2752
|
-
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:
|
|
3024
|
+
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)}`;
|
|
2753
3025
|
|
|
2754
3026
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2755
3027
|
// See LICENSE in the project root for license information.
|
|
@@ -2770,7 +3042,7 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
2770
3042
|
*/
|
|
2771
3043
|
|
|
2772
3044
|
class AuroDropdownBib extends i {
|
|
2773
|
-
|
|
3045
|
+
// not extending AuroElement because Bib needs only `shape` prop
|
|
2774
3046
|
constructor() {
|
|
2775
3047
|
super();
|
|
2776
3048
|
|
|
@@ -2780,6 +3052,9 @@ class AuroDropdownBib extends i {
|
|
|
2780
3052
|
this._mobileBreakpointValue = undefined;
|
|
2781
3053
|
|
|
2782
3054
|
AuroLibraryRuntimeUtils$2.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
3055
|
+
|
|
3056
|
+
this.shape = "rounded";
|
|
3057
|
+
this.matchWidth = false;
|
|
2783
3058
|
}
|
|
2784
3059
|
|
|
2785
3060
|
static get styles() {
|
|
@@ -2817,6 +3092,15 @@ class AuroDropdownBib extends i {
|
|
|
2817
3092
|
reflect: true
|
|
2818
3093
|
},
|
|
2819
3094
|
|
|
3095
|
+
/**
|
|
3096
|
+
* If declared, the bib width will match the trigger width.
|
|
3097
|
+
* @private
|
|
3098
|
+
*/
|
|
3099
|
+
matchWidth: {
|
|
3100
|
+
type: Boolean,
|
|
3101
|
+
reflect: true
|
|
3102
|
+
},
|
|
3103
|
+
|
|
2820
3104
|
/**
|
|
2821
3105
|
* If declared, will apply border-radius to the bib.
|
|
2822
3106
|
*/
|
|
@@ -2830,6 +3114,11 @@ class AuroDropdownBib extends i {
|
|
|
2830
3114
|
*/
|
|
2831
3115
|
bibTemplate: {
|
|
2832
3116
|
type: Object
|
|
3117
|
+
},
|
|
3118
|
+
|
|
3119
|
+
shape: {
|
|
3120
|
+
type: String,
|
|
3121
|
+
reflect: true
|
|
2833
3122
|
}
|
|
2834
3123
|
};
|
|
2835
3124
|
}
|
|
@@ -2909,8 +3198,16 @@ class AuroDropdownBib extends i {
|
|
|
2909
3198
|
|
|
2910
3199
|
// function that renders the HTML and CSS into the scope of the component
|
|
2911
3200
|
render() {
|
|
3201
|
+
const classes = {
|
|
3202
|
+
container: true
|
|
3203
|
+
};
|
|
3204
|
+
|
|
3205
|
+
// Since this class does not inherit from AuroElement, we apply the shape-related class within the `render` function,
|
|
3206
|
+
// mimicking the class naming convention used in AuroElement.resetShapeClasses.
|
|
3207
|
+
classes[`shape-${this.shape}`] = true;
|
|
3208
|
+
|
|
2912
3209
|
return u$1`
|
|
2913
|
-
<div class="
|
|
3210
|
+
<div class="${e$2(classes)}" part="bibContainer">
|
|
2914
3211
|
<slot></slot>
|
|
2915
3212
|
</div>
|
|
2916
3213
|
`;
|
|
@@ -2919,21 +3216,21 @@ class AuroDropdownBib extends i {
|
|
|
2919
3216
|
|
|
2920
3217
|
var dropdownVersion = '3.0.0';
|
|
2921
3218
|
|
|
2922
|
-
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}.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;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}.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;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}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;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}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;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}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:
|
|
3219
|
+
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}`;
|
|
2923
3220
|
|
|
2924
|
-
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:
|
|
3221
|
+
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)}`;
|
|
2925
3222
|
|
|
2926
|
-
var classicColorCss = i$2
|
|
3223
|
+
var classicColorCss = i$2``;
|
|
2927
3224
|
|
|
2928
|
-
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]) .
|
|
3225
|
+
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%}`;
|
|
2929
3226
|
|
|
2930
|
-
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
|
|
3227
|
+
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)}`;
|
|
2931
3228
|
|
|
2932
|
-
var styleSnowflakeCss = i$2`:host{display:block}.wrapper{display:flex;flex
|
|
3229
|
+
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)}`;
|
|
2933
3230
|
|
|
2934
|
-
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-
|
|
3231
|
+
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)}`;
|
|
2935
3232
|
|
|
2936
|
-
var styleCss = i$2
|
|
3233
|
+
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}`;
|
|
2937
3234
|
|
|
2938
3235
|
var tokensCss = i$2`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
2939
3236
|
|
|
@@ -3174,18 +3471,21 @@ class AuroElement extends i {
|
|
|
3174
3471
|
}
|
|
3175
3472
|
|
|
3176
3473
|
resetShapeClasses() {
|
|
3177
|
-
|
|
3178
|
-
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
3474
|
+
const wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
3179
3475
|
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3476
|
+
if (wrapper) {
|
|
3477
|
+
wrapper.classList.forEach((className) => {
|
|
3478
|
+
if (className.startsWith('shape-')) {
|
|
3479
|
+
wrapper.classList.remove(className);
|
|
3480
|
+
}
|
|
3481
|
+
});
|
|
3186
3482
|
|
|
3187
|
-
|
|
3188
|
-
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
if (this.shape && this.size) {
|
|
3486
|
+
wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
3487
|
+
} else {
|
|
3488
|
+
wrapper.classList.add('shape-none');
|
|
3189
3489
|
}
|
|
3190
3490
|
}
|
|
3191
3491
|
|
|
@@ -3235,10 +3535,8 @@ class AuroElement extends i {
|
|
|
3235
3535
|
// See LICENSE in the project root for license information.
|
|
3236
3536
|
|
|
3237
3537
|
|
|
3238
|
-
|
|
3239
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
3538
|
+
/*
|
|
3240
3539
|
* @slot - Default slot for the popover content.
|
|
3241
|
-
* @slot label - Defines the content of the label.
|
|
3242
3540
|
* @slot helpText - Defines the content of the helpText.
|
|
3243
3541
|
* @slot trigger - Defines the content of the trigger.
|
|
3244
3542
|
* @csspart trigger - The trigger content container.
|
|
@@ -3257,23 +3555,25 @@ class AuroDropdown extends AuroElement {
|
|
|
3257
3555
|
this.matchWidth = false;
|
|
3258
3556
|
this.noHideOnThisFocusLoss = false;
|
|
3259
3557
|
|
|
3260
|
-
this.errorMessage =
|
|
3558
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
3261
3559
|
|
|
3262
3560
|
// Layout Config
|
|
3263
|
-
this.layout =
|
|
3264
|
-
this.shape =
|
|
3265
|
-
this.size =
|
|
3561
|
+
this.layout = undefined;
|
|
3562
|
+
this.shape = undefined;
|
|
3563
|
+
this.size = undefined;
|
|
3564
|
+
|
|
3266
3565
|
this.parentBorder = false;
|
|
3267
3566
|
|
|
3268
|
-
|
|
3269
|
-
|
|
3567
|
+
/** @private */
|
|
3568
|
+
this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
|
|
3270
3569
|
|
|
3271
|
-
|
|
3272
|
-
return {
|
|
3273
|
-
// 'withValue': this.value && this.value.length > 0
|
|
3274
|
-
};
|
|
3570
|
+
this.privateDefaults();
|
|
3275
3571
|
}
|
|
3276
3572
|
|
|
3573
|
+
/**
|
|
3574
|
+
* @private
|
|
3575
|
+
* @returns {object} Class definition for the wrapper element.
|
|
3576
|
+
*/
|
|
3277
3577
|
get commonWrapperClasses() {
|
|
3278
3578
|
return {
|
|
3279
3579
|
'trigger': true,
|
|
@@ -3291,13 +3591,10 @@ class AuroDropdown extends AuroElement {
|
|
|
3291
3591
|
privateDefaults() {
|
|
3292
3592
|
this.chevron = false;
|
|
3293
3593
|
this.disabled = false;
|
|
3594
|
+
this.disableFocusTrap = false;
|
|
3294
3595
|
this.error = false;
|
|
3295
|
-
this.inset = false;
|
|
3296
|
-
this.rounded = false;
|
|
3297
3596
|
this.tabIndex = 0;
|
|
3298
3597
|
this.noToggle = false;
|
|
3299
|
-
this.a11yAutocomplete = 'none';
|
|
3300
|
-
this.labeled = true;
|
|
3301
3598
|
this.a11yRole = 'button';
|
|
3302
3599
|
this.onDark = false;
|
|
3303
3600
|
this.showTriggerBorders = true;
|
|
@@ -3393,6 +3690,18 @@ class AuroDropdown extends AuroElement {
|
|
|
3393
3690
|
this.floater.showBib();
|
|
3394
3691
|
}
|
|
3395
3692
|
|
|
3693
|
+
/**
|
|
3694
|
+
* When bib is open, focus on the first element inside of bib.
|
|
3695
|
+
* If not, trigger element will get focus.
|
|
3696
|
+
*/
|
|
3697
|
+
focus() {
|
|
3698
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
3699
|
+
this.focusTrap.focusFirstElement();
|
|
3700
|
+
} else {
|
|
3701
|
+
this.trigger.focus();
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3396
3705
|
// function to define props used within the scope of this component
|
|
3397
3706
|
static get properties() {
|
|
3398
3707
|
return {
|
|
@@ -3406,6 +3715,15 @@ class AuroDropdown extends AuroElement {
|
|
|
3406
3715
|
reflect: true
|
|
3407
3716
|
},
|
|
3408
3717
|
|
|
3718
|
+
/**
|
|
3719
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
3720
|
+
* @default false
|
|
3721
|
+
*/
|
|
3722
|
+
disableEventShow: {
|
|
3723
|
+
type: Boolean,
|
|
3724
|
+
reflect: true
|
|
3725
|
+
},
|
|
3726
|
+
|
|
3409
3727
|
/**
|
|
3410
3728
|
* If declared, applies a border around the trigger slot.
|
|
3411
3729
|
*/
|
|
@@ -3424,17 +3742,17 @@ class AuroDropdown extends AuroElement {
|
|
|
3424
3742
|
},
|
|
3425
3743
|
|
|
3426
3744
|
/**
|
|
3427
|
-
* If declared, the dropdown
|
|
3745
|
+
* If declared, the dropdown is not interactive.
|
|
3428
3746
|
*/
|
|
3429
|
-
|
|
3747
|
+
disabled: {
|
|
3430
3748
|
type: Boolean,
|
|
3431
3749
|
reflect: true
|
|
3432
3750
|
},
|
|
3433
3751
|
|
|
3434
3752
|
/**
|
|
3435
|
-
* If declared, the
|
|
3753
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
3436
3754
|
*/
|
|
3437
|
-
|
|
3755
|
+
disableFocusTrap: {
|
|
3438
3756
|
type: Boolean,
|
|
3439
3757
|
reflect: true
|
|
3440
3758
|
},
|
|
@@ -3479,22 +3797,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3479
3797
|
reflect: true
|
|
3480
3798
|
},
|
|
3481
3799
|
|
|
3482
|
-
/**
|
|
3483
|
-
* Makes the trigger to be full width of its parent container.
|
|
3484
|
-
*/
|
|
3485
|
-
fluid: {
|
|
3486
|
-
type: Boolean,
|
|
3487
|
-
reflect: true
|
|
3488
|
-
},
|
|
3489
|
-
|
|
3490
|
-
/**
|
|
3491
|
-
* If declared, will apply padding around trigger slot content.
|
|
3492
|
-
*/
|
|
3493
|
-
inset: {
|
|
3494
|
-
type: Boolean,
|
|
3495
|
-
reflect: true
|
|
3496
|
-
},
|
|
3497
|
-
|
|
3498
3800
|
/**
|
|
3499
3801
|
* If true, the dropdown bib is displayed.
|
|
3500
3802
|
*/
|
|
@@ -3538,15 +3840,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3538
3840
|
reflect: true
|
|
3539
3841
|
},
|
|
3540
3842
|
|
|
3541
|
-
/**
|
|
3542
|
-
* Defines if there is a label preset.
|
|
3543
|
-
* @private
|
|
3544
|
-
*/
|
|
3545
|
-
labeled: {
|
|
3546
|
-
type: Boolean,
|
|
3547
|
-
reflect: true
|
|
3548
|
-
},
|
|
3549
|
-
|
|
3550
3843
|
/**
|
|
3551
3844
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
3552
3845
|
* @private
|
|
@@ -3607,6 +3900,9 @@ class AuroDropdown extends AuroElement {
|
|
|
3607
3900
|
reflect: true
|
|
3608
3901
|
},
|
|
3609
3902
|
|
|
3903
|
+
/**
|
|
3904
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
3905
|
+
*/
|
|
3610
3906
|
onSlotChange: {
|
|
3611
3907
|
type: Function,
|
|
3612
3908
|
reflect: false
|
|
@@ -3621,14 +3917,6 @@ class AuroDropdown extends AuroElement {
|
|
|
3621
3917
|
reflect: true
|
|
3622
3918
|
},
|
|
3623
3919
|
|
|
3624
|
-
/**
|
|
3625
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
3626
|
-
*/
|
|
3627
|
-
rounded: {
|
|
3628
|
-
type: Boolean,
|
|
3629
|
-
reflect: true
|
|
3630
|
-
},
|
|
3631
|
-
|
|
3632
3920
|
/**
|
|
3633
3921
|
* @private
|
|
3634
3922
|
*/
|
|
@@ -3643,22 +3931,14 @@ class AuroDropdown extends AuroElement {
|
|
|
3643
3931
|
type: String || undefined,
|
|
3644
3932
|
attribute: false,
|
|
3645
3933
|
reflect: false
|
|
3646
|
-
},
|
|
3647
|
-
|
|
3648
|
-
/**
|
|
3649
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
3650
|
-
*/
|
|
3651
|
-
a11yAutocomplete: {
|
|
3652
|
-
type: String,
|
|
3653
|
-
attribute: false,
|
|
3654
3934
|
}
|
|
3655
3935
|
};
|
|
3656
3936
|
}
|
|
3657
3937
|
|
|
3658
3938
|
static get styles() {
|
|
3659
3939
|
return [
|
|
3660
|
-
colorCss$1,
|
|
3661
3940
|
tokensCss$1,
|
|
3941
|
+
colorCss$1,
|
|
3662
3942
|
|
|
3663
3943
|
// default layout
|
|
3664
3944
|
classicColorCss,
|
|
@@ -3720,13 +4000,27 @@ class AuroDropdown extends AuroElement {
|
|
|
3720
4000
|
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
3721
4001
|
this.handleTriggerContentSlotChange();
|
|
3722
4002
|
}
|
|
4003
|
+
}
|
|
3723
4004
|
|
|
4005
|
+
/**
|
|
4006
|
+
* Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
|
|
4007
|
+
* @private
|
|
4008
|
+
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
4009
|
+
*/
|
|
4010
|
+
handleDropdownToggle(event) {
|
|
4011
|
+
this.updateFocusTrap();
|
|
4012
|
+
this.isPopoverVisible = event.detail.expanded;
|
|
4013
|
+
const eventType = event.detail.eventType || "unknown";
|
|
4014
|
+
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4015
|
+
this.trigger.focus();
|
|
4016
|
+
}
|
|
3724
4017
|
}
|
|
3725
4018
|
|
|
3726
4019
|
firstUpdated() {
|
|
3727
4020
|
|
|
3728
4021
|
// Configure the floater to, this will generate the ID for the bib
|
|
3729
4022
|
this.floater.configure(this, 'auroDropdown');
|
|
4023
|
+
this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
|
|
3730
4024
|
|
|
3731
4025
|
/**
|
|
3732
4026
|
* @description Let subscribers know that the dropdown ID ha been generated and added.
|
|
@@ -3786,6 +4080,27 @@ class AuroDropdown extends AuroElement {
|
|
|
3786
4080
|
this.hasFocus = true;
|
|
3787
4081
|
}
|
|
3788
4082
|
|
|
4083
|
+
/**
|
|
4084
|
+
* @private
|
|
4085
|
+
*/
|
|
4086
|
+
updateFocusTrap() {
|
|
4087
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
4088
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
4089
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4090
|
+
this.focusTrap.focusFirstElement();
|
|
4091
|
+
return;
|
|
4092
|
+
}
|
|
4093
|
+
|
|
4094
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
4095
|
+
if (!this.focusTrap) {
|
|
4096
|
+
return;
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
4100
|
+
this.focusTrap.disconnect();
|
|
4101
|
+
this.focusTrap = undefined;
|
|
4102
|
+
}
|
|
4103
|
+
|
|
3789
4104
|
/**
|
|
3790
4105
|
* Function to support @focusout event.
|
|
3791
4106
|
* @private
|
|
@@ -3946,14 +4261,13 @@ class AuroDropdown extends AuroElement {
|
|
|
3946
4261
|
* @returns {void}
|
|
3947
4262
|
*/
|
|
3948
4263
|
handleTriggerContentSlotChange(event) {
|
|
3949
|
-
|
|
3950
4264
|
this.floater.handleTriggerTabIndex();
|
|
3951
4265
|
|
|
3952
4266
|
// Get the trigger
|
|
3953
4267
|
const trigger = this.shadowRoot.querySelector('#trigger');
|
|
3954
4268
|
|
|
3955
4269
|
// Get the trigger slot
|
|
3956
|
-
const triggerSlot = this.shadowRoot.querySelector('.
|
|
4270
|
+
const triggerSlot = this.shadowRoot.querySelector('.triggerContentWrapper slot');
|
|
3957
4271
|
|
|
3958
4272
|
// If there's a trigger slot
|
|
3959
4273
|
if (triggerSlot) {
|
|
@@ -4016,7 +4330,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4016
4330
|
*
|
|
4017
4331
|
* @private
|
|
4018
4332
|
* @method handleDefaultSlot
|
|
4019
|
-
* @param {Event} event - The event object representing the slot change.
|
|
4020
4333
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
4021
4334
|
*/
|
|
4022
4335
|
handleDefaultSlot() {
|
|
@@ -4026,29 +4339,6 @@ class AuroDropdown extends AuroElement {
|
|
|
4026
4339
|
}
|
|
4027
4340
|
}
|
|
4028
4341
|
|
|
4029
|
-
/**
|
|
4030
|
-
* @private
|
|
4031
|
-
* @method handleLabelSlotChange
|
|
4032
|
-
* @param {event} event - The event object representing the slot change.
|
|
4033
|
-
* @description Handles the slot change event for the label slot.
|
|
4034
|
-
*/
|
|
4035
|
-
handleLabelSlotChange (event) {
|
|
4036
|
-
|
|
4037
|
-
// Get the nodes from the event
|
|
4038
|
-
const nodes = event.target.assignedNodes();
|
|
4039
|
-
|
|
4040
|
-
// Guard clause for no nodes
|
|
4041
|
-
if (!nodes) {
|
|
4042
|
-
return;
|
|
4043
|
-
}
|
|
4044
|
-
|
|
4045
|
-
// Convert the nodes to a measurable array so we can get the length
|
|
4046
|
-
const nodesArr = Array.from(nodes);
|
|
4047
|
-
|
|
4048
|
-
// If the nodes array has a length, the dropdown is labeled
|
|
4049
|
-
this.labeled = nodesArr.length > 0;
|
|
4050
|
-
}
|
|
4051
|
-
|
|
4052
4342
|
/**
|
|
4053
4343
|
* Returns HTML for the common portion of the layouts.
|
|
4054
4344
|
* @private
|
|
@@ -4063,22 +4353,17 @@ class AuroDropdown extends AuroElement {
|
|
|
4063
4353
|
class="${e$2(this.commonWrapperClasses)}" part="wrapper"
|
|
4064
4354
|
tabindex="${this.tabIndex}"
|
|
4065
4355
|
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4066
|
-
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4067
|
-
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4356
|
+
aria-expanded="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4357
|
+
aria-controls="${o(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4068
4358
|
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4069
4359
|
@focusin="${this.handleFocusin}"
|
|
4070
4360
|
@blur="${this.handleFocusOut}">
|
|
4071
|
-
<div class="triggerContentWrapper">
|
|
4072
|
-
<
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
<div class="triggerContent">
|
|
4076
|
-
<slot
|
|
4077
|
-
name="trigger"
|
|
4078
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4079
|
-
</div>
|
|
4361
|
+
<div class="triggerContentWrapper" id="triggerLabel">
|
|
4362
|
+
<slot
|
|
4363
|
+
name="trigger"
|
|
4364
|
+
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4080
4365
|
</div>
|
|
4081
|
-
${this.chevron
|
|
4366
|
+
${this.chevron ? u$1`
|
|
4082
4367
|
<div
|
|
4083
4368
|
id="showStateIcon"
|
|
4084
4369
|
class="chevron"
|
|
@@ -4099,11 +4384,9 @@ class AuroDropdown extends AuroElement {
|
|
|
4099
4384
|
<div id="bibSizer" part="size"></div>
|
|
4100
4385
|
<${this.dropdownBibTag}
|
|
4101
4386
|
id="bib"
|
|
4387
|
+
shape="${this.shape}"
|
|
4102
4388
|
?data-show="${this.isPopoverVisible}"
|
|
4103
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
4104
|
-
?common="${this.common}"
|
|
4105
|
-
?rounded="${this.common || this.rounded}"
|
|
4106
|
-
?inset="${this.common || this.inset}">
|
|
4389
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
4107
4390
|
<div class="slotContent">
|
|
4108
4391
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4109
4392
|
</div>
|
|
@@ -4118,62 +4401,13 @@ class AuroDropdown extends AuroElement {
|
|
|
4118
4401
|
* @returns {html} - Returns HTML for the classic layout.
|
|
4119
4402
|
*/
|
|
4120
4403
|
renderLayoutClassic() {
|
|
4404
|
+
// TODO: check with Doug why this was never used?
|
|
4405
|
+
const helpTextClasses = {
|
|
4406
|
+
'helpText': true
|
|
4407
|
+
};
|
|
4121
4408
|
|
|
4122
4409
|
return u$1`
|
|
4123
|
-
|
|
4124
|
-
<div
|
|
4125
|
-
id="trigger"
|
|
4126
|
-
class="trigger"
|
|
4127
|
-
part="trigger"
|
|
4128
|
-
tabindex="${this.tabIndex}"
|
|
4129
|
-
?showBorder="${this.showTriggerBorders}"
|
|
4130
|
-
role="${o(this.triggerContentFocusable ? undefined : this.a11yRole)}"
|
|
4131
|
-
aria-expanded="${o(this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4132
|
-
aria-controls="${o(this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4133
|
-
aria-labelledby="${o(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4134
|
-
>
|
|
4135
|
-
<div class="triggerContentWrapper">
|
|
4136
|
-
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
4137
|
-
<slot name="label" @slotchange="${this.handleLabelSlotChange}"></slot>
|
|
4138
|
-
</label>
|
|
4139
|
-
<div class="triggerContent">
|
|
4140
|
-
<slot
|
|
4141
|
-
name="trigger"
|
|
4142
|
-
@slotchange="${this.handleTriggerContentSlotChange}"></slot>
|
|
4143
|
-
</div>
|
|
4144
|
-
</div>
|
|
4145
|
-
${this.chevron || this.common ? u$1`
|
|
4146
|
-
<div
|
|
4147
|
-
id="showStateIcon"
|
|
4148
|
-
part="chevron">
|
|
4149
|
-
<${this.iconTag}
|
|
4150
|
-
category="interface"
|
|
4151
|
-
name="chevron-down"
|
|
4152
|
-
?onDark="${this.onDark}"
|
|
4153
|
-
variant="${this.disabled ? 'disabled' : 'muted'}">
|
|
4154
|
-
>
|
|
4155
|
-
</${this.iconTag}>
|
|
4156
|
-
</div>
|
|
4157
|
-
` : undefined }
|
|
4158
|
-
</div>
|
|
4159
|
-
<${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
|
|
4160
|
-
<slot name="helpText"></slot>
|
|
4161
|
-
</${this.helpTextTag}>
|
|
4162
|
-
|
|
4163
|
-
<div id="bibSizer" part="size"></div>
|
|
4164
|
-
<${this.dropdownBibTag}
|
|
4165
|
-
id="bib"
|
|
4166
|
-
?data-show="${this.isPopoverVisible}"
|
|
4167
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
4168
|
-
?common="${this.common}"
|
|
4169
|
-
?rounded="${this.common || this.rounded}"
|
|
4170
|
-
?inset="${this.common || this.inset}"
|
|
4171
|
-
>
|
|
4172
|
-
<div class="slotContent">
|
|
4173
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
4174
|
-
</div>
|
|
4175
|
-
</${this.dropdownBibTag}>
|
|
4176
|
-
</div>
|
|
4410
|
+
${this.renderBasicHtml(helpTextClasses)}
|
|
4177
4411
|
`;
|
|
4178
4412
|
}
|
|
4179
4413
|
|