@aurodesignsystem-dev/auro-formkit 0.0.0-pr741.0 → 0.0.0-pr750.1
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/index.js +1 -1
- package/components/bibtemplate/dist/registered.js +1 -1
- package/components/checkbox/demo/api.html +16 -10
- package/components/checkbox/demo/api.min.js +11 -11
- package/components/checkbox/demo/index.html +16 -10
- package/components/checkbox/demo/index.min.js +11 -11
- package/components/checkbox/demo/readme.html +16 -9
- package/components/checkbox/dist/index.js +11 -11
- package/components/checkbox/dist/registered.js +11 -11
- package/components/combobox/demo/api.html +16 -10
- package/components/combobox/demo/api.md +12 -6
- package/components/combobox/demo/api.min.js +411 -103
- package/components/combobox/demo/index.html +16 -10
- package/components/combobox/demo/index.min.js +411 -103
- package/components/combobox/demo/readme.html +16 -9
- package/components/combobox/dist/index.js +374 -91
- package/components/combobox/dist/registered.js +374 -91
- package/components/counter/demo/api.html +16 -10
- package/components/counter/demo/api.md +140 -7
- package/components/counter/demo/api.min.js +1145 -987
- package/components/counter/demo/index.html +16 -10
- package/components/counter/demo/index.md +82 -0
- package/components/counter/demo/index.min.js +1145 -987
- 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 +1145 -987
- package/components/counter/dist/registered.js +1145 -987
- package/components/datepicker/demo/api.html +16 -10
- package/components/datepicker/demo/api.min.js +374 -91
- package/components/datepicker/demo/index.html +16 -10
- package/components/datepicker/demo/index.min.js +374 -91
- package/components/datepicker/demo/readme.html +16 -9
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -0
- package/components/datepicker/dist/index.js +374 -91
- package/components/datepicker/dist/registered.js +374 -91
- package/components/dropdown/demo/api.html +16 -10
- package/components/dropdown/demo/api.md +77 -267
- package/components/dropdown/demo/api.min.js +331 -64
- package/components/dropdown/demo/index.html +16 -10
- package/components/dropdown/demo/index.md +45 -363
- package/components/dropdown/demo/index.min.js +331 -64
- package/components/dropdown/demo/readme.html +16 -9
- package/components/dropdown/dist/auro-dropdown.d.ts +35 -67
- package/components/dropdown/dist/index.js +331 -64
- package/components/dropdown/dist/registered.js +331 -64
- 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 +491 -326
- package/components/select/demo/index.html +16 -11
- package/components/select/demo/index.md +6 -158
- package/components/select/demo/index.min.js +491 -314
- package/components/select/demo/readme.html +16 -9
- package/components/select/dist/auro-select.d.ts +33 -8
- package/components/select/dist/index.js +454 -302
- package/components/select/dist/registered.js +454 -302
- package/package.json +26 -25
|
@@ -90,17 +90,6 @@ function auroMenuLoadingExample() {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function valueTextExample() {
|
|
94
|
-
const onValueTextSelectInput = (e) => {
|
|
95
|
-
const valueText = e.target.querySelector("[slot=valueText]");
|
|
96
|
-
|
|
97
|
-
valueText.textContent = e.detail.optionSelected.dataset.display;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const select = document.querySelector("#valueTextExample");
|
|
101
|
-
select.addEventListener('input', onValueTextSelectInput);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
93
|
/**
|
|
105
94
|
* @license
|
|
106
95
|
* Copyright 2019 Google LLC
|
|
@@ -792,19 +781,19 @@ class AuroFormValidation {
|
|
|
792
781
|
{
|
|
793
782
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
794
783
|
validity: 'tooShort',
|
|
795
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
784
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
796
785
|
},
|
|
797
786
|
{
|
|
798
787
|
check: (e) => e.value?.length > e.maxLength,
|
|
799
788
|
validity: 'tooLong',
|
|
800
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
789
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
801
790
|
}
|
|
802
791
|
],
|
|
803
792
|
pattern: [
|
|
804
793
|
{
|
|
805
794
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
806
795
|
validity: 'patternMismatch',
|
|
807
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
796
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
808
797
|
}
|
|
809
798
|
]
|
|
810
799
|
},
|
|
@@ -999,10 +988,10 @@ class AuroFormValidation {
|
|
|
999
988
|
if (!hasValue && elem.required && elem.touched) {
|
|
1000
989
|
elem.validity = 'valueMissing';
|
|
1001
990
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
1002
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
991
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
1003
992
|
this.validateType(elem);
|
|
1004
993
|
this.validateElementAttributes(elem);
|
|
1005
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
994
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1006
995
|
this.validateElementAttributes(elem);
|
|
1007
996
|
}
|
|
1008
997
|
}
|
|
@@ -3377,6 +3366,267 @@ class AuroFloatingUI {
|
|
|
3377
3366
|
}
|
|
3378
3367
|
}
|
|
3379
3368
|
|
|
3369
|
+
// Selectors for focusable elements
|
|
3370
|
+
const FOCUSABLE_SELECTORS = [
|
|
3371
|
+
'a[href]',
|
|
3372
|
+
'button:not([disabled])',
|
|
3373
|
+
'textarea:not([disabled])',
|
|
3374
|
+
'input:not([disabled])',
|
|
3375
|
+
'select:not([disabled])',
|
|
3376
|
+
'[role="tab"]:not([disabled])',
|
|
3377
|
+
'[role="link"]:not([disabled])',
|
|
3378
|
+
'[role="button"]:not([disabled])',
|
|
3379
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
3380
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
3381
|
+
];
|
|
3382
|
+
|
|
3383
|
+
// List of custom components that are known to be focusable
|
|
3384
|
+
const FOCUSABLE_COMPONENTS = [
|
|
3385
|
+
'auro-checkbox',
|
|
3386
|
+
'auro-radio',
|
|
3387
|
+
'auro-dropdown',
|
|
3388
|
+
'auro-button',
|
|
3389
|
+
'auro-combobox',
|
|
3390
|
+
'auro-input',
|
|
3391
|
+
'auro-counter',
|
|
3392
|
+
'auro-menu',
|
|
3393
|
+
'auro-select',
|
|
3394
|
+
'auro-datepicker',
|
|
3395
|
+
'auro-hyperlink',
|
|
3396
|
+
'auro-accordion',
|
|
3397
|
+
];
|
|
3398
|
+
|
|
3399
|
+
/**
|
|
3400
|
+
* Determines if a given element is a custom focusable component.
|
|
3401
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
3402
|
+
*
|
|
3403
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
3404
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
3405
|
+
*/
|
|
3406
|
+
function isFocusableComponent(element) {
|
|
3407
|
+
const componentName = element.tagName.toLowerCase();
|
|
3408
|
+
|
|
3409
|
+
// Guard Clause: Element is a focusable component
|
|
3410
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
3411
|
+
|
|
3412
|
+
// Guard Clause: Element is not disabled
|
|
3413
|
+
if (element.hasAttribute('disabled')) return false;
|
|
3414
|
+
|
|
3415
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
3416
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
3417
|
+
|
|
3418
|
+
// If all guard clauses pass, the element is a focusable component
|
|
3419
|
+
return true;
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
/**
|
|
3423
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3424
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3425
|
+
*
|
|
3426
|
+
* @param {HTMLElement} container The container to search within
|
|
3427
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3428
|
+
*/
|
|
3429
|
+
function getFocusableElements(container) {
|
|
3430
|
+
// Get elements in DOM order by walking the tree
|
|
3431
|
+
const orderedFocusableElements = [];
|
|
3432
|
+
|
|
3433
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
3434
|
+
const collectFocusableElements = (root) => {
|
|
3435
|
+
// Check if current element is focusable
|
|
3436
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
3437
|
+
// Check if this is a custom component that is focusable
|
|
3438
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
3439
|
+
|
|
3440
|
+
if (isComponentFocusable) {
|
|
3441
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
3442
|
+
orderedFocusableElements.push(root);
|
|
3443
|
+
return; // Skip traversing inside this component
|
|
3444
|
+
}
|
|
3445
|
+
|
|
3446
|
+
// Check if the element itself matches any selector
|
|
3447
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
3448
|
+
if (root.matches?.(selector)) {
|
|
3449
|
+
orderedFocusableElements.push(root);
|
|
3450
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
3451
|
+
}
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3454
|
+
// Process shadow DOM only for non-Auro components
|
|
3455
|
+
if (root.shadowRoot) {
|
|
3456
|
+
// Process shadow DOM children in order
|
|
3457
|
+
if (root.shadowRoot.children) {
|
|
3458
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
3459
|
+
collectFocusableElements(child);
|
|
3460
|
+
});
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
// Process slots and their assigned nodes in order
|
|
3465
|
+
if (root.tagName === 'SLOT') {
|
|
3466
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
3467
|
+
for (const node of assignedNodes) {
|
|
3468
|
+
collectFocusableElements(node);
|
|
3469
|
+
}
|
|
3470
|
+
} else {
|
|
3471
|
+
// Process light DOM children in order
|
|
3472
|
+
if (root.children) {
|
|
3473
|
+
Array.from(root.children).forEach(child => {
|
|
3474
|
+
collectFocusableElements(child);
|
|
3475
|
+
});
|
|
3476
|
+
}
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
};
|
|
3480
|
+
|
|
3481
|
+
// Start the traversal from the container
|
|
3482
|
+
collectFocusableElements(container);
|
|
3483
|
+
|
|
3484
|
+
// Remove duplicates that might have been collected through different paths
|
|
3485
|
+
// while preserving order
|
|
3486
|
+
const uniqueElements = [];
|
|
3487
|
+
const seen = new Set();
|
|
3488
|
+
|
|
3489
|
+
for (const element of orderedFocusableElements) {
|
|
3490
|
+
if (!seen.has(element)) {
|
|
3491
|
+
seen.add(element);
|
|
3492
|
+
uniqueElements.push(element);
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
return uniqueElements;
|
|
3497
|
+
}
|
|
3498
|
+
|
|
3499
|
+
/**
|
|
3500
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
3501
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
3502
|
+
*/
|
|
3503
|
+
class FocusTrap {
|
|
3504
|
+
/**
|
|
3505
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
3506
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
3507
|
+
*
|
|
3508
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
3509
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
3510
|
+
*/
|
|
3511
|
+
constructor(container) {
|
|
3512
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
3513
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3516
|
+
this.container = container;
|
|
3517
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
3518
|
+
|
|
3519
|
+
this._init();
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
/**
|
|
3523
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
3524
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
3525
|
+
*
|
|
3526
|
+
* @private
|
|
3527
|
+
*/
|
|
3528
|
+
_init() {
|
|
3529
|
+
|
|
3530
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
3531
|
+
if ('inert' in HTMLElement.prototype) {
|
|
3532
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
3533
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
// Track tab direction
|
|
3537
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
/**
|
|
3541
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
3542
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
3543
|
+
*
|
|
3544
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
3545
|
+
* @private
|
|
3546
|
+
*/
|
|
3547
|
+
_onKeydown = (e) => {
|
|
3548
|
+
|
|
3549
|
+
if (e.key === 'Tab') {
|
|
3550
|
+
|
|
3551
|
+
// Set the tab direction based on the key pressed
|
|
3552
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
3553
|
+
|
|
3554
|
+
// Get the active element(s) in the document and shadow root
|
|
3555
|
+
// This will include the active element in the shadow DOM if it exists
|
|
3556
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
3557
|
+
let activeElement = document.activeElement;
|
|
3558
|
+
const actives = [activeElement];
|
|
3559
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
3560
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
3561
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
3562
|
+
}
|
|
3563
|
+
|
|
3564
|
+
// Update the focusable elements
|
|
3565
|
+
const focusables = this._getFocusableElements();
|
|
3566
|
+
|
|
3567
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
3568
|
+
const focusIndex =
|
|
3569
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
3570
|
+
? focusables.length - 1
|
|
3571
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
3572
|
+
? 0
|
|
3573
|
+
: null;
|
|
3574
|
+
|
|
3575
|
+
if (focusIndex !== null) {
|
|
3576
|
+
focusables[focusIndex].focus();
|
|
3577
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
3578
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
};
|
|
3582
|
+
|
|
3583
|
+
/**
|
|
3584
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3585
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3586
|
+
*
|
|
3587
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3588
|
+
* @private
|
|
3589
|
+
*/
|
|
3590
|
+
_getFocusableElements() {
|
|
3591
|
+
// Use the imported utility function to get focusable elements
|
|
3592
|
+
const elements = getFocusableElements(this.container);
|
|
3593
|
+
|
|
3594
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
3595
|
+
return elements;
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
/**
|
|
3599
|
+
* Moves focus to the first focusable element within the container.
|
|
3600
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
3601
|
+
*/
|
|
3602
|
+
focusFirstElement() {
|
|
3603
|
+
const focusables = this._getFocusableElements();
|
|
3604
|
+
if (focusables.length) focusables[0].focus();
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
/**
|
|
3608
|
+
* Moves focus to the last focusable element within the container.
|
|
3609
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
3610
|
+
*/
|
|
3611
|
+
focusLastElement() {
|
|
3612
|
+
const focusables = this._getFocusableElements();
|
|
3613
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
3614
|
+
}
|
|
3615
|
+
|
|
3616
|
+
/**
|
|
3617
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
3618
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
3619
|
+
*/
|
|
3620
|
+
disconnect() {
|
|
3621
|
+
|
|
3622
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
3623
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
3624
|
+
}
|
|
3625
|
+
|
|
3626
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3380
3630
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3381
3631
|
// See LICENSE in the project root for license information.
|
|
3382
3632
|
|
|
@@ -4015,11 +4265,11 @@ var dropdownVersion$1 = '3.0.0';
|
|
|
4015
4265
|
|
|
4016
4266
|
var shapeSizeCss = i$5`.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}`;
|
|
4017
4267
|
|
|
4018
|
-
var colorCss$1$2 = i$5`: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)}`;
|
|
4268
|
+
var colorCss$1$2 = i$5`: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)}`;
|
|
4019
4269
|
|
|
4020
4270
|
var classicColorCss = i$5``;
|
|
4021
4271
|
|
|
4022
|
-
var classicLayoutCss = i$5`: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([
|
|
4272
|
+
var classicLayoutCss = i$5`: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%}`;
|
|
4023
4273
|
|
|
4024
4274
|
var styleEmphasizedCss = i$5`: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)}`;
|
|
4025
4275
|
|
|
@@ -4027,7 +4277,7 @@ var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex:1;fle
|
|
|
4027
4277
|
|
|
4028
4278
|
var colorCss$5 = i$5`: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)}`;
|
|
4029
4279
|
|
|
4030
|
-
var styleCss$6 = i$5
|
|
4280
|
+
var styleCss$6 = i$5`: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}`;
|
|
4031
4281
|
|
|
4032
4282
|
var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
4033
4283
|
|
|
@@ -4332,10 +4582,8 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
4332
4582
|
// See LICENSE in the project root for license information.
|
|
4333
4583
|
|
|
4334
4584
|
|
|
4335
|
-
|
|
4336
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
4585
|
+
/*
|
|
4337
4586
|
* @slot - Default slot for the popover content.
|
|
4338
|
-
* @slot label - Defines the content of the label.
|
|
4339
4587
|
* @slot helpText - Defines the content of the helpText.
|
|
4340
4588
|
* @slot trigger - Defines the content of the trigger.
|
|
4341
4589
|
* @csspart trigger - The trigger content container.
|
|
@@ -4354,18 +4602,22 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4354
4602
|
this.matchWidth = false;
|
|
4355
4603
|
this.noHideOnThisFocusLoss = false;
|
|
4356
4604
|
|
|
4357
|
-
this.errorMessage =
|
|
4605
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
4358
4606
|
|
|
4359
4607
|
// Layout Config
|
|
4360
|
-
this.layout =
|
|
4361
|
-
this.shape =
|
|
4362
|
-
this.size =
|
|
4608
|
+
this.layout = undefined;
|
|
4609
|
+
this.shape = undefined;
|
|
4610
|
+
this.size = undefined;
|
|
4363
4611
|
|
|
4364
4612
|
this.parentBorder = false;
|
|
4365
4613
|
|
|
4366
4614
|
this.privateDefaults();
|
|
4367
4615
|
}
|
|
4368
4616
|
|
|
4617
|
+
/**
|
|
4618
|
+
* @private
|
|
4619
|
+
* @returns {object} Class definition for the wrapper element.
|
|
4620
|
+
*/
|
|
4369
4621
|
get commonWrapperClasses() {
|
|
4370
4622
|
return {
|
|
4371
4623
|
'trigger': true,
|
|
@@ -4383,13 +4635,10 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4383
4635
|
privateDefaults() {
|
|
4384
4636
|
this.chevron = false;
|
|
4385
4637
|
this.disabled = false;
|
|
4638
|
+
this.disableFocusTrap = false;
|
|
4386
4639
|
this.error = false;
|
|
4387
|
-
this.inset = false;
|
|
4388
|
-
this.rounded = false;
|
|
4389
4640
|
this.tabIndex = 0;
|
|
4390
4641
|
this.noToggle = false;
|
|
4391
|
-
this.a11yAutocomplete = 'none';
|
|
4392
|
-
this.labeled = true;
|
|
4393
4642
|
this.a11yRole = 'button';
|
|
4394
4643
|
this.onDark = false;
|
|
4395
4644
|
this.showTriggerBorders = true;
|
|
@@ -4485,6 +4734,18 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4485
4734
|
this.floater.showBib();
|
|
4486
4735
|
}
|
|
4487
4736
|
|
|
4737
|
+
/**
|
|
4738
|
+
* When bib is open, focus on the first element inside of bib.
|
|
4739
|
+
* If not, trigger element will get focus.
|
|
4740
|
+
*/
|
|
4741
|
+
focus() {
|
|
4742
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
4743
|
+
this.focusTrap.focusFirstElement();
|
|
4744
|
+
} else {
|
|
4745
|
+
this.trigger.focus();
|
|
4746
|
+
}
|
|
4747
|
+
}
|
|
4748
|
+
|
|
4488
4749
|
// function to define props used within the scope of this component
|
|
4489
4750
|
static get properties() {
|
|
4490
4751
|
return {
|
|
@@ -4498,6 +4759,15 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4498
4759
|
reflect: true
|
|
4499
4760
|
},
|
|
4500
4761
|
|
|
4762
|
+
/**
|
|
4763
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4764
|
+
* @default false
|
|
4765
|
+
*/
|
|
4766
|
+
disableEventShow: {
|
|
4767
|
+
type: Boolean,
|
|
4768
|
+
reflect: true
|
|
4769
|
+
},
|
|
4770
|
+
|
|
4501
4771
|
/**
|
|
4502
4772
|
* If declared, applies a border around the trigger slot.
|
|
4503
4773
|
*/
|
|
@@ -4516,17 +4786,17 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4516
4786
|
},
|
|
4517
4787
|
|
|
4518
4788
|
/**
|
|
4519
|
-
* If declared, the dropdown
|
|
4789
|
+
* If declared, the dropdown is not interactive.
|
|
4520
4790
|
*/
|
|
4521
|
-
|
|
4791
|
+
disabled: {
|
|
4522
4792
|
type: Boolean,
|
|
4523
4793
|
reflect: true
|
|
4524
4794
|
},
|
|
4525
4795
|
|
|
4526
4796
|
/**
|
|
4527
|
-
* If declared, the
|
|
4797
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
4528
4798
|
*/
|
|
4529
|
-
|
|
4799
|
+
disableFocusTrap: {
|
|
4530
4800
|
type: Boolean,
|
|
4531
4801
|
reflect: true
|
|
4532
4802
|
},
|
|
@@ -4571,22 +4841,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4571
4841
|
reflect: true
|
|
4572
4842
|
},
|
|
4573
4843
|
|
|
4574
|
-
/**
|
|
4575
|
-
* Makes the trigger to be full width of its parent container.
|
|
4576
|
-
*/
|
|
4577
|
-
fluid: {
|
|
4578
|
-
type: Boolean,
|
|
4579
|
-
reflect: true
|
|
4580
|
-
},
|
|
4581
|
-
|
|
4582
|
-
/**
|
|
4583
|
-
* If declared, will apply padding around trigger slot content.
|
|
4584
|
-
*/
|
|
4585
|
-
inset: {
|
|
4586
|
-
type: Boolean,
|
|
4587
|
-
reflect: true
|
|
4588
|
-
},
|
|
4589
|
-
|
|
4590
4844
|
/**
|
|
4591
4845
|
* If true, the dropdown bib is displayed.
|
|
4592
4846
|
*/
|
|
@@ -4630,15 +4884,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4630
4884
|
reflect: true
|
|
4631
4885
|
},
|
|
4632
4886
|
|
|
4633
|
-
/**
|
|
4634
|
-
* Defines if there is a label preset.
|
|
4635
|
-
* @private
|
|
4636
|
-
*/
|
|
4637
|
-
labeled: {
|
|
4638
|
-
type: Boolean,
|
|
4639
|
-
reflect: true
|
|
4640
|
-
},
|
|
4641
|
-
|
|
4642
4887
|
/**
|
|
4643
4888
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4644
4889
|
* @private
|
|
@@ -4699,6 +4944,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4699
4944
|
reflect: true
|
|
4700
4945
|
},
|
|
4701
4946
|
|
|
4947
|
+
/**
|
|
4948
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
4949
|
+
*/
|
|
4702
4950
|
onSlotChange: {
|
|
4703
4951
|
type: Function,
|
|
4704
4952
|
reflect: false
|
|
@@ -4713,14 +4961,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4713
4961
|
reflect: true
|
|
4714
4962
|
},
|
|
4715
4963
|
|
|
4716
|
-
/**
|
|
4717
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
4718
|
-
*/
|
|
4719
|
-
rounded: {
|
|
4720
|
-
type: Boolean,
|
|
4721
|
-
reflect: true
|
|
4722
|
-
},
|
|
4723
|
-
|
|
4724
4964
|
/**
|
|
4725
4965
|
* @private
|
|
4726
4966
|
*/
|
|
@@ -4735,22 +4975,14 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4735
4975
|
type: String || undefined,
|
|
4736
4976
|
attribute: false,
|
|
4737
4977
|
reflect: false
|
|
4738
|
-
},
|
|
4739
|
-
|
|
4740
|
-
/**
|
|
4741
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
4742
|
-
*/
|
|
4743
|
-
a11yAutocomplete: {
|
|
4744
|
-
type: String,
|
|
4745
|
-
attribute: false,
|
|
4746
4978
|
}
|
|
4747
4979
|
};
|
|
4748
4980
|
}
|
|
4749
4981
|
|
|
4750
4982
|
static get styles() {
|
|
4751
4983
|
return [
|
|
4752
|
-
colorCss$1$2,
|
|
4753
4984
|
tokensCss$1$2,
|
|
4985
|
+
colorCss$1$2,
|
|
4754
4986
|
|
|
4755
4987
|
// default layout
|
|
4756
4988
|
classicColorCss,
|
|
@@ -4813,6 +5045,12 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4813
5045
|
this.handleTriggerContentSlotChange();
|
|
4814
5046
|
}
|
|
4815
5047
|
|
|
5048
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
5049
|
+
this.updateFocusTrap();
|
|
5050
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
5051
|
+
this.trigger.focus();
|
|
5052
|
+
}
|
|
5053
|
+
}
|
|
4816
5054
|
}
|
|
4817
5055
|
|
|
4818
5056
|
firstUpdated() {
|
|
@@ -4878,6 +5116,27 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4878
5116
|
this.hasFocus = true;
|
|
4879
5117
|
}
|
|
4880
5118
|
|
|
5119
|
+
/**
|
|
5120
|
+
* @private
|
|
5121
|
+
*/
|
|
5122
|
+
updateFocusTrap() {
|
|
5123
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
5124
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
5125
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
5126
|
+
this.focusTrap.focusFirstElement();
|
|
5127
|
+
return;
|
|
5128
|
+
}
|
|
5129
|
+
|
|
5130
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
5131
|
+
if (!this.focusTrap) {
|
|
5132
|
+
return;
|
|
5133
|
+
}
|
|
5134
|
+
|
|
5135
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
5136
|
+
this.focusTrap.disconnect();
|
|
5137
|
+
this.focusTrap = undefined;
|
|
5138
|
+
}
|
|
5139
|
+
|
|
4881
5140
|
/**
|
|
4882
5141
|
* Function to support @focusout event.
|
|
4883
5142
|
* @private
|
|
@@ -5163,10 +5422,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
5163
5422
|
id="bib"
|
|
5164
5423
|
shape="${this.shape}"
|
|
5165
5424
|
?data-show="${this.isPopoverVisible}"
|
|
5166
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5167
|
-
?common="${this.common}"
|
|
5168
|
-
?rounded="${this.common || this.rounded}"
|
|
5169
|
-
?inset="${this.common || this.inset}">
|
|
5425
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
5170
5426
|
<div class="slotContent">
|
|
5171
5427
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5172
5428
|
</div>
|
|
@@ -7147,7 +7403,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
7147
7403
|
<div id="bibTemplate" part="bibtemplate">
|
|
7148
7404
|
${this.isFullscreen ? u`
|
|
7149
7405
|
<div id="headerContainer">
|
|
7150
|
-
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
7406
|
+
<${this.buttonTag} id="closeButton" aria-label="Close" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
7151
7407
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
7152
7408
|
</${this.buttonTag}>
|
|
7153
7409
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
@@ -7175,7 +7431,7 @@ var bibTemplateVersion = '1.0.0';
|
|
|
7175
7431
|
|
|
7176
7432
|
var colorCss$3 = i$5`: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)}`;
|
|
7177
7433
|
|
|
7178
|
-
var styleCss$4 = i$5
|
|
7434
|
+
var styleCss$4 = i$5`: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}`;
|
|
7179
7435
|
|
|
7180
7436
|
var tokensCss$2 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7181
7437
|
|
|
@@ -7381,68 +7637,7 @@ class AuroHelpText extends i$2 {
|
|
|
7381
7637
|
|
|
7382
7638
|
var helpTextVersion = '1.0.0';
|
|
7383
7639
|
|
|
7384
|
-
i$5
|
|
7385
|
-
|
|
7386
|
-
i$5`:host ::slotted(hr){border-top-color:var(--ds-auro-menu-divider-color)}[loadingplaceholder] slot[name=loadingIcon]{color:var(--ds-auro-menu-loader-color)}[loadingplaceholder] slot[name=loadingText]{color:var(--ds-auro-menu-loader-text-color)}`;
|
|
7387
|
-
|
|
7388
|
-
i$5`:host{--ds-auro-menu-divider-color: var(--ds-basic-color-border-divider, rgba(0, 0, 0, 0.15));--ds-auro-menu-loader-color: var(--ds-basic-color-brand-primary, #01426a);--ds-auro-menu-loader-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-menuoption-container-color: transparent;--ds-auro-menuoption-container-border-color: var(--ds-auro-menuoption-container-color);--ds-auro-menuoption-icon-color: transparent;--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}`;
|
|
7389
|
-
|
|
7390
|
-
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7391
|
-
// See LICENSE in the project root for license information.
|
|
7392
|
-
|
|
7393
|
-
// ---------------------------------------------------------------------
|
|
7394
|
-
|
|
7395
|
-
/**
|
|
7396
|
-
* Converts value to an array.
|
|
7397
|
-
* If the value is a JSON string representing an array, it will be parsed.
|
|
7398
|
-
* If the value is already an array, it is returned.
|
|
7399
|
-
* If the value is undefined, it returns undefined.
|
|
7400
|
-
* @private
|
|
7401
|
-
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
7402
|
-
* @returns {Array|undefined} - The converted array or undefined.
|
|
7403
|
-
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
7404
|
-
* or if the value cannot be parsed into an array from a JSON string.
|
|
7405
|
-
*/
|
|
7406
|
-
function arrayConverter(value) {
|
|
7407
|
-
// Allow undefined
|
|
7408
|
-
if (value === undefined) {
|
|
7409
|
-
return undefined;
|
|
7410
|
-
}
|
|
7411
|
-
|
|
7412
|
-
// Return the value if it is already an array
|
|
7413
|
-
if (Array.isArray(value)) {
|
|
7414
|
-
return value;
|
|
7415
|
-
}
|
|
7416
|
-
|
|
7417
|
-
try {
|
|
7418
|
-
// If value is a JSON string, parse it
|
|
7419
|
-
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
7420
|
-
|
|
7421
|
-
// Check if the parsed value is an array
|
|
7422
|
-
if (Array.isArray(parsed)) {
|
|
7423
|
-
return parsed;
|
|
7424
|
-
}
|
|
7425
|
-
} catch (error) {
|
|
7426
|
-
// If JSON parsing fails, continue to throw an error below
|
|
7427
|
-
/* eslint-disable no-console */
|
|
7428
|
-
console.error('JSON parsing failed:', error);
|
|
7429
|
-
}
|
|
7430
|
-
|
|
7431
|
-
// Throw error if the input is not an array or undefined
|
|
7432
|
-
throw new Error('Invalid value: Input must be an array or undefined');
|
|
7433
|
-
}
|
|
7434
|
-
|
|
7435
|
-
i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + 24px + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
7436
|
-
|
|
7437
|
-
i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
7438
|
-
|
|
7439
|
-
i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, 0.75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem) !important;width:var(--ds-auro-icon-size, 1.5rem) !important;height:var(--ds-auro-icon-size, 1.5rem) !important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, 0.25rem);line-height:1.8}`;
|
|
7440
|
-
|
|
7441
|
-
i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color:#02426D;--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}`;
|
|
7442
|
-
|
|
7443
|
-
i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
7444
|
-
|
|
7445
|
-
var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent,:host([layout*=snowflake]) .triggerContent{padding:0 8px 0 24px}:host([layout*=classic]) .triggerContent{padding:0 8px}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host([layout*=classic]) label.withValue{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([layout*=classic]) .value{height:auto;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
|
|
7640
|
+
var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}.mainContent{position:relative;display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:var(--ds-size-50, 0.25rem)}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent,:host([layout*=snowflake]) .triggerContent{padding:0 var(--ds-size-50, 0.25rem) 0 var(--ds-size-150, 0.75rem)}:host([layout*=snowflake]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=emphasized]) [auro-dropdown] label.withValue{font-size:var(--ds-text-body-size-xs);line-height:20px}:host([layout*=classic]) .triggerContent{padding:0 var(--ds-size-50, 0.25rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{cursor:text;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host([layout*=classic]) label.withValue{font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([layout*=classic]) .value{height:auto;font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
|
|
7446
7641
|
|
|
7447
7642
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7448
7643
|
// See LICENSE in the project root for license information.
|
|
@@ -7457,7 +7652,6 @@ var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock
|
|
|
7457
7652
|
* @slot label - Defines the content of the label.
|
|
7458
7653
|
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
7459
7654
|
* @slot helpText - Defines the content of the helpText.
|
|
7460
|
-
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
7461
7655
|
* @slot valueText - Dropdown value text display.
|
|
7462
7656
|
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
7463
7657
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
@@ -7727,6 +7921,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7727
7921
|
reflect: true
|
|
7728
7922
|
},
|
|
7729
7923
|
|
|
7924
|
+
/**
|
|
7925
|
+
* Define custom placeholder text.
|
|
7926
|
+
*/
|
|
7927
|
+
placeholder: {
|
|
7928
|
+
type: String,
|
|
7929
|
+
reflect: true
|
|
7930
|
+
},
|
|
7931
|
+
|
|
7730
7932
|
/**
|
|
7731
7933
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
7732
7934
|
*/
|
|
@@ -7773,11 +7975,12 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7773
7975
|
},
|
|
7774
7976
|
|
|
7775
7977
|
/**
|
|
7776
|
-
* Value selected for the component.
|
|
7777
|
-
* @type {String|Array<String>}
|
|
7978
|
+
* Value selected for the component.
|
|
7778
7979
|
*/
|
|
7779
7980
|
value: {
|
|
7780
|
-
type:
|
|
7981
|
+
type: String,
|
|
7982
|
+
reflect: true,
|
|
7983
|
+
attribute: 'value'
|
|
7781
7984
|
},
|
|
7782
7985
|
|
|
7783
7986
|
/**
|
|
@@ -7829,6 +8032,25 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7829
8032
|
];
|
|
7830
8033
|
}
|
|
7831
8034
|
|
|
8035
|
+
/**
|
|
8036
|
+
* Formatted value based on `multiSelect` state.
|
|
8037
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
8038
|
+
* @private
|
|
8039
|
+
* @returns {String|Array<String>}
|
|
8040
|
+
*/
|
|
8041
|
+
get formattedValue() {
|
|
8042
|
+
if (this.multiSelect) {
|
|
8043
|
+
if (!this.value) {
|
|
8044
|
+
return undefined;
|
|
8045
|
+
}
|
|
8046
|
+
if (this.value.startsWith("[")) {
|
|
8047
|
+
return JSON.parse(this.value);
|
|
8048
|
+
}
|
|
8049
|
+
return [this.value];
|
|
8050
|
+
}
|
|
8051
|
+
return this.value;
|
|
8052
|
+
}
|
|
8053
|
+
|
|
7832
8054
|
/**
|
|
7833
8055
|
* Returns classmap configuration for html5 input labels in all layouts.
|
|
7834
8056
|
* @private
|
|
@@ -7837,7 +8059,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7837
8059
|
get commonLabelClasses() {
|
|
7838
8060
|
return {
|
|
7839
8061
|
'is-disabled': this.disabled,
|
|
7840
|
-
'withValue': this.value && this.value.length > 0,
|
|
8062
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
7841
8063
|
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7842
8064
|
};
|
|
7843
8065
|
}
|
|
@@ -7863,6 +8085,21 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7863
8085
|
|
|
7864
8086
|
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
7865
8087
|
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
8088
|
+
|
|
8089
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8090
|
+
// wait til the bib gets fully rendered
|
|
8091
|
+
setTimeout(() => {
|
|
8092
|
+
if (this.dropdown.isBibFullscreen) {
|
|
8093
|
+
// trigger holds the focus since menu is not a focusable element.
|
|
8094
|
+
this.dropdown.trigger.focus();
|
|
8095
|
+
|
|
8096
|
+
// default focus indicator on the first menu option
|
|
8097
|
+
if (this.menu.index < 0) {
|
|
8098
|
+
this.menu.navigateOptions('down');
|
|
8099
|
+
}
|
|
8100
|
+
}
|
|
8101
|
+
});
|
|
8102
|
+
}
|
|
7866
8103
|
});
|
|
7867
8104
|
|
|
7868
8105
|
// setting up bibtemplate
|
|
@@ -8013,46 +8250,58 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8013
8250
|
configureSelect() {
|
|
8014
8251
|
|
|
8015
8252
|
this.addEventListener('keydown', (evt) => {
|
|
8016
|
-
|
|
8017
|
-
|
|
8253
|
+
// when the focus is on trigger not on close button
|
|
8254
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8255
|
+
if (evt.key === 'ArrowUp') {
|
|
8256
|
+
evt.preventDefault();
|
|
8018
8257
|
|
|
8019
|
-
|
|
8258
|
+
this.dropdown.show();
|
|
8020
8259
|
|
|
8021
|
-
|
|
8022
|
-
|
|
8260
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8261
|
+
this.menu.navigateOptions('up');
|
|
8262
|
+
}
|
|
8263
|
+
|
|
8264
|
+
return;
|
|
8023
8265
|
}
|
|
8024
8266
|
|
|
8025
|
-
|
|
8026
|
-
|
|
8267
|
+
if (evt.key === 'ArrowDown') {
|
|
8268
|
+
evt.preventDefault();
|
|
8027
8269
|
|
|
8028
|
-
|
|
8029
|
-
evt.preventDefault();
|
|
8270
|
+
this.dropdown.show();
|
|
8030
8271
|
|
|
8031
|
-
|
|
8272
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8273
|
+
this.menu.navigateOptions('down');
|
|
8274
|
+
}
|
|
8032
8275
|
|
|
8033
|
-
|
|
8034
|
-
this.menu.navigateOptions('down');
|
|
8276
|
+
return;
|
|
8035
8277
|
}
|
|
8036
8278
|
|
|
8037
|
-
|
|
8038
|
-
|
|
8279
|
+
if (evt.key === 'Enter') {
|
|
8280
|
+
if (!this.dropdown.isPopoverVisible) {
|
|
8281
|
+
evt.preventDefault();
|
|
8282
|
+
this.menu.makeSelection();
|
|
8283
|
+
}
|
|
8039
8284
|
|
|
8040
|
-
|
|
8041
|
-
if (!this.dropdown.isPopoverVisible) {
|
|
8042
|
-
evt.preventDefault();
|
|
8043
|
-
this.menu.makeSelection();
|
|
8285
|
+
return;
|
|
8044
8286
|
}
|
|
8045
|
-
|
|
8046
|
-
return;
|
|
8047
8287
|
}
|
|
8048
8288
|
|
|
8049
|
-
if (evt.key === 'Tab') {
|
|
8289
|
+
if (evt.key === 'Tab' && this.dropdown.isPopoverVisible) {
|
|
8050
8290
|
if (this.dropdown.isBibFullscreen) {
|
|
8051
8291
|
evt.preventDefault();
|
|
8292
|
+
|
|
8293
|
+
// when the focus is on trigger not on close button
|
|
8294
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8295
|
+
// `dropdown.focus` will move focus to the first focusable element in bib when it's open,
|
|
8296
|
+
// when bib it not open, it will focus onto trigger.
|
|
8297
|
+
this.dropdown.focus();
|
|
8298
|
+
} else {
|
|
8299
|
+
// when close button has the focus, move focus back to the trigger
|
|
8300
|
+
this.dropdown.trigger.focus();
|
|
8301
|
+
}
|
|
8052
8302
|
} else {
|
|
8053
8303
|
this.dropdown.hide();
|
|
8054
8304
|
}
|
|
8055
|
-
|
|
8056
8305
|
return;
|
|
8057
8306
|
}
|
|
8058
8307
|
|
|
@@ -8220,38 +8469,29 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8220
8469
|
this.configureDropdown();
|
|
8221
8470
|
this.configureMenu();
|
|
8222
8471
|
this.configureSelect();
|
|
8223
|
-
|
|
8224
|
-
// Set the initial value in auro-menu if defined
|
|
8225
|
-
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
8226
|
-
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
8227
|
-
if (this.menu) {
|
|
8228
|
-
this.menu.value = this.value;
|
|
8229
|
-
}
|
|
8230
|
-
}
|
|
8231
8472
|
}
|
|
8232
8473
|
|
|
8233
8474
|
/**
|
|
8234
8475
|
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8235
8476
|
* @param {string} value - The value to set in the menu.
|
|
8236
|
-
* @returns void
|
|
8477
|
+
* @returns {void}
|
|
8237
8478
|
* @private
|
|
8238
8479
|
*/
|
|
8239
8480
|
async updateMenuValue(value) {
|
|
8240
8481
|
if (!this.menu) return;
|
|
8241
8482
|
|
|
8483
|
+
this.menu.setAttribute('value', value);
|
|
8242
8484
|
this.menu.value = value;
|
|
8243
8485
|
await this.menu.updateComplete;
|
|
8244
8486
|
}
|
|
8245
8487
|
|
|
8246
8488
|
async updated(changedProperties) {
|
|
8247
|
-
if (changedProperties.has('multiSelect')) {
|
|
8489
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has('value')) {
|
|
8248
8490
|
this.clearSelection();
|
|
8249
8491
|
}
|
|
8250
8492
|
|
|
8251
8493
|
if (changedProperties.has('value')) {
|
|
8252
8494
|
if (this.value) {
|
|
8253
|
-
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
8254
|
-
|
|
8255
8495
|
await this.updateMenuValue(this.value);
|
|
8256
8496
|
|
|
8257
8497
|
if (this.menu) {
|
|
@@ -8277,7 +8517,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8277
8517
|
composed: true,
|
|
8278
8518
|
detail: {
|
|
8279
8519
|
optionSelected: this.optionSelected,
|
|
8280
|
-
value: this.
|
|
8520
|
+
value: this.formattedValue
|
|
8281
8521
|
}
|
|
8282
8522
|
}));
|
|
8283
8523
|
}
|
|
@@ -8336,13 +8576,13 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8336
8576
|
const selectedValue = selectedOption.value;
|
|
8337
8577
|
|
|
8338
8578
|
if (this.multiSelect) {
|
|
8339
|
-
const currentArray =
|
|
8579
|
+
const currentArray = this.formattedValue;
|
|
8340
8580
|
|
|
8341
8581
|
if (!currentArray.includes(selectedValue)) {
|
|
8342
|
-
this.value = [
|
|
8582
|
+
this.value = JSON.stringify([
|
|
8343
8583
|
...currentArray,
|
|
8344
8584
|
selectedValue
|
|
8345
|
-
];
|
|
8585
|
+
]);
|
|
8346
8586
|
}
|
|
8347
8587
|
} else {
|
|
8348
8588
|
const currentValue = this.value;
|
|
@@ -8365,12 +8605,17 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8365
8605
|
}
|
|
8366
8606
|
|
|
8367
8607
|
if (this.multiSelect) {
|
|
8368
|
-
nativeSelect.value = this.
|
|
8608
|
+
nativeSelect.value = this.multiSelect ? this.multiSelect[0] : '';
|
|
8369
8609
|
} else {
|
|
8370
8610
|
nativeSelect.value = this.value || '';
|
|
8371
8611
|
}
|
|
8372
8612
|
}
|
|
8373
8613
|
|
|
8614
|
+
/**
|
|
8615
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
8616
|
+
* @private
|
|
8617
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8618
|
+
*/
|
|
8374
8619
|
renderAriaHtml() {
|
|
8375
8620
|
return u`
|
|
8376
8621
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -8391,6 +8636,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8391
8636
|
`;
|
|
8392
8637
|
}
|
|
8393
8638
|
|
|
8639
|
+
/**
|
|
8640
|
+
* Returns HTML for the hidden HTML5 select.
|
|
8641
|
+
* @private
|
|
8642
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8643
|
+
*/
|
|
8394
8644
|
renderNativeSelect() {
|
|
8395
8645
|
return u`
|
|
8396
8646
|
<div class="nativeSelectWrapper util_displayHidden">
|
|
@@ -8437,7 +8687,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8437
8687
|
: u`
|
|
8438
8688
|
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8439
8689
|
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8440
|
-
|
|
8690
|
+
${this.errorMessage}
|
|
8441
8691
|
</p>
|
|
8442
8692
|
</${this.helpTextTag}>
|
|
8443
8693
|
`
|
|
@@ -8452,14 +8702,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8452
8702
|
*/
|
|
8453
8703
|
renderLayoutEmphasized() {
|
|
8454
8704
|
const placeholderClass = {
|
|
8455
|
-
|
|
8705
|
+
'util_displayHidden': this.value
|
|
8456
8706
|
};
|
|
8457
8707
|
|
|
8458
8708
|
const displayValueClasses = {
|
|
8459
8709
|
'displayValue': true,
|
|
8460
8710
|
'hasContent': this.hasDisplayValueContent,
|
|
8461
8711
|
'hasFocus': this.isPopoverVisible,
|
|
8462
|
-
'withValue': this.value && this.value.length > 0,
|
|
8712
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8463
8713
|
'force': this.forceDisplayValue,
|
|
8464
8714
|
};
|
|
8465
8715
|
|
|
@@ -8486,7 +8736,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8486
8736
|
.offset="${this.offset}"
|
|
8487
8737
|
.placement="${this.placement}"
|
|
8488
8738
|
chevron
|
|
8489
|
-
fluid
|
|
8490
8739
|
for="selectMenu"
|
|
8491
8740
|
layout="${this.layout}"
|
|
8492
8741
|
part="dropdown"
|
|
@@ -8503,11 +8752,9 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8503
8752
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8504
8753
|
</label>
|
|
8505
8754
|
<div class="value" id="value"></div>
|
|
8506
|
-
${
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
</div>
|
|
8510
|
-
`}
|
|
8755
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8756
|
+
${this.placeholder}
|
|
8757
|
+
</div>
|
|
8511
8758
|
</div>
|
|
8512
8759
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8513
8760
|
<slot name="displayValue"></slot>
|
|
@@ -8534,14 +8781,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8534
8781
|
*/
|
|
8535
8782
|
renderLayoutSnowflake() {
|
|
8536
8783
|
const placeholderClass = {
|
|
8537
|
-
|
|
8784
|
+
'util_displayHidden': this.value
|
|
8538
8785
|
};
|
|
8539
8786
|
|
|
8540
8787
|
const displayValueClasses = {
|
|
8541
8788
|
'displayValue': true,
|
|
8542
8789
|
'hasContent': this.hasDisplayValueContent,
|
|
8543
8790
|
'hasFocus': this.isPopoverVisible,
|
|
8544
|
-
'withValue': this.value && this.value.length > 0,
|
|
8791
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8545
8792
|
'force': this.forceDisplayValue,
|
|
8546
8793
|
};
|
|
8547
8794
|
|
|
@@ -8567,7 +8814,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8567
8814
|
.offset="${this.offset}"
|
|
8568
8815
|
.placement="${this.placement}"
|
|
8569
8816
|
chevron
|
|
8570
|
-
fluid
|
|
8571
8817
|
for="selectMenu"
|
|
8572
8818
|
layout="${this.layout}"
|
|
8573
8819
|
part="dropdown"
|
|
@@ -8584,11 +8830,9 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8584
8830
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8585
8831
|
</label>
|
|
8586
8832
|
<div class="value" id="value"></div>
|
|
8587
|
-
${
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
</div>
|
|
8591
|
-
`}
|
|
8833
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8834
|
+
${this.placeholder}
|
|
8835
|
+
</div>
|
|
8592
8836
|
</div>
|
|
8593
8837
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8594
8838
|
<slot name="displayValue"></slot>
|
|
@@ -8616,14 +8860,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8616
8860
|
*/
|
|
8617
8861
|
renderLayoutClassic() {
|
|
8618
8862
|
const placeholderClass = {
|
|
8619
|
-
|
|
8863
|
+
'util_displayHidden': this.value
|
|
8620
8864
|
};
|
|
8621
8865
|
|
|
8622
8866
|
const displayValueClasses = {
|
|
8623
8867
|
'displayValue': true,
|
|
8624
8868
|
'hasContent': this.hasDisplayValueContent,
|
|
8625
8869
|
'hasFocus': this.isPopoverVisible,
|
|
8626
|
-
'withValue': this.value && this.value.length > 0,
|
|
8870
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8627
8871
|
'force': this.forceDisplayValue,
|
|
8628
8872
|
};
|
|
8629
8873
|
|
|
@@ -8649,7 +8893,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8649
8893
|
.offset="${this.offset}"
|
|
8650
8894
|
.placement="${this.placement}"
|
|
8651
8895
|
chevron
|
|
8652
|
-
fluid
|
|
8653
8896
|
for="selectMenu"
|
|
8654
8897
|
layout="${this.layout}"
|
|
8655
8898
|
part="dropdown"
|
|
@@ -8666,11 +8909,9 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8666
8909
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8667
8910
|
</label>
|
|
8668
8911
|
<div class="value" id="value"></div>
|
|
8669
|
-
${
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
</div>
|
|
8673
|
-
`}
|
|
8912
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8913
|
+
${this.placeholder}
|
|
8914
|
+
</div>
|
|
8674
8915
|
</div>
|
|
8675
8916
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8676
8917
|
<slot name="displayValue"></slot>
|
|
@@ -8720,106 +8961,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8720
8961
|
|
|
8721
8962
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
8722
8963
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
8723
|
-
|
|
8724
|
-
// function that renders the HTML and CSS into the scope of the component
|
|
8725
|
-
renderBACKUP() {
|
|
8726
|
-
const placeholderClass = {
|
|
8727
|
-
hidden: this.value,
|
|
8728
|
-
};
|
|
8729
|
-
|
|
8730
|
-
return u`
|
|
8731
|
-
<div class="outerWrapper">
|
|
8732
|
-
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8733
|
-
${this.optionActive && this.options.length > 0
|
|
8734
|
-
? u`
|
|
8735
|
-
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8736
|
-
`
|
|
8737
|
-
: undefined
|
|
8738
|
-
};
|
|
8739
|
-
|
|
8740
|
-
${this.optionSelected && this.options.length > 0
|
|
8741
|
-
? u`
|
|
8742
|
-
${`${this.optionSelected.innerText} selected`}
|
|
8743
|
-
`
|
|
8744
|
-
: undefined
|
|
8745
|
-
};
|
|
8746
|
-
</div>
|
|
8747
|
-
<div id="slotHolder" aria-hidden="true">
|
|
8748
|
-
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8749
|
-
</div>
|
|
8750
|
-
<${this.dropdownTag}
|
|
8751
|
-
?autoPlacement="${this.autoPlacement}"
|
|
8752
|
-
?disabled="${this.disabled}"
|
|
8753
|
-
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8754
|
-
?matchWidth="${this.matchWidth}"
|
|
8755
|
-
?noFlip="${this.noFlip}"
|
|
8756
|
-
?onDark="${this.onDark}"
|
|
8757
|
-
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8758
|
-
.offset="${this.offset}"
|
|
8759
|
-
.placement="${this.placement}"
|
|
8760
|
-
chevron
|
|
8761
|
-
fluid
|
|
8762
|
-
for="selectMenu"
|
|
8763
|
-
layout="${this.layout}"
|
|
8764
|
-
part="dropdown"
|
|
8765
|
-
shape="${this.shape}"
|
|
8766
|
-
size="${this.size}">
|
|
8767
|
-
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
8768
|
-
<span id="placeholder"
|
|
8769
|
-
class="${e(placeholderClass)}"
|
|
8770
|
-
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
8771
|
-
>
|
|
8772
|
-
<slot name="placeholder"></slot>
|
|
8773
|
-
</span>
|
|
8774
|
-
<slot name="valueText" id="valueText"></slot>
|
|
8775
|
-
</span>
|
|
8776
|
-
|
|
8777
|
-
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8778
|
-
<slot></slot>
|
|
8779
|
-
</${this.bibtemplateTag}>
|
|
8780
|
-
<slot name="label" slot="label"></slot>
|
|
8781
|
-
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8782
|
-
<p slot="helpText">
|
|
8783
|
-
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
8784
|
-
? u`
|
|
8785
|
-
<span id="${this.uniqueId}" part="helpText">
|
|
8786
|
-
<slot name="helpText"></slot>
|
|
8787
|
-
</span>`
|
|
8788
|
-
: u`
|
|
8789
|
-
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8790
|
-
${this.errorMessage}
|
|
8791
|
-
</span>`
|
|
8792
|
-
}
|
|
8793
|
-
</p>
|
|
8794
|
-
</${this.dropdownTag}>
|
|
8795
|
-
<div class="nativeSelectWrapper">
|
|
8796
|
-
<select
|
|
8797
|
-
tabindex="-1"
|
|
8798
|
-
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
8799
|
-
name="${this.name || ''}"
|
|
8800
|
-
?disabled="${this.disabled}"
|
|
8801
|
-
?required="${this.required}"
|
|
8802
|
-
aria-hidden="true"
|
|
8803
|
-
autocomplete="${o(this.autocomplete)}"
|
|
8804
|
-
@change="${this._handleNativeSelectChange}">
|
|
8805
|
-
<option value="" ?selected="${!this.value}"></option>
|
|
8806
|
-
${this.options.map((option) => {
|
|
8807
|
-
const optionValue = option.value || option.textContent;
|
|
8808
|
-
return u`
|
|
8809
|
-
<option
|
|
8810
|
-
value="${optionValue}"
|
|
8811
|
-
?selected="${this.value === optionValue}">
|
|
8812
|
-
${option.textContent}
|
|
8813
|
-
</option>
|
|
8814
|
-
`;
|
|
8815
|
-
})}
|
|
8816
|
-
</select>
|
|
8817
|
-
</div>
|
|
8818
|
-
<!-- Help text and error message template -->
|
|
8819
|
-
${this.renderHtmlHelpText()}
|
|
8820
|
-
</div>
|
|
8821
|
-
`;
|
|
8822
|
-
}
|
|
8823
8964
|
}
|
|
8824
8965
|
|
|
8825
8966
|
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}:host{display:block;vertical-align:middle}:host .wrapper{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0}:host ::slotted(hr){box-sizing:content-box !important;height:0 !important;overflow:visible !important;margin:var(--ds-size-100, 0.5rem) 0 !important;border-width:0 !important;border-top-width:1px !important;border-top-style:solid !important}:host [loadingplaceholder].empty{opacity:0;position:absolute}:host [loadingplaceholder] slot[name=loadingIcon]{vertical-align:middle;line-height:1;display:inline-block}:host [loadingplaceholder] slot[name=loadingIcon]::slotted(*){margin-right:var(--ds-size-150, 0.75rem)}:host([root]){overflow-y:auto}:host([root]) .wrapper[class*=-lg]{padding:var(--ds-size-150, 0.75rem)}:host([root]) .wrapper[class*=-xl]{padding:var(--ds-size-200, 1rem)}`;
|
|
@@ -8879,7 +9020,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
8879
9020
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
8880
9021
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
8881
9022
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
8882
|
-
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
8883
9023
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
8884
9024
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
8885
9025
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -8992,9 +9132,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
8992
9132
|
reflect: true,
|
|
8993
9133
|
attribute: 'multiselect'
|
|
8994
9134
|
},
|
|
9135
|
+
|
|
9136
|
+
/**
|
|
9137
|
+
* Value selected for the component.
|
|
9138
|
+
*/
|
|
8995
9139
|
value: {
|
|
8996
|
-
|
|
8997
|
-
|
|
9140
|
+
type: String,
|
|
9141
|
+
reflect: true,
|
|
9142
|
+
attribute: 'value'
|
|
8998
9143
|
},
|
|
8999
9144
|
|
|
9000
9145
|
/**
|
|
@@ -9029,6 +9174,25 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9029
9174
|
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
9030
9175
|
}
|
|
9031
9176
|
|
|
9177
|
+
/**
|
|
9178
|
+
* Formatted value based on `multiSelect` state.
|
|
9179
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
9180
|
+
* @private
|
|
9181
|
+
* @returns {String|Array<String>}
|
|
9182
|
+
*/
|
|
9183
|
+
get formattedValue() {
|
|
9184
|
+
if (this.multiSelect) {
|
|
9185
|
+
if (!this.value) {
|
|
9186
|
+
return undefined;
|
|
9187
|
+
}
|
|
9188
|
+
if (this.value.startsWith("[")) {
|
|
9189
|
+
return JSON.parse(this.value);
|
|
9190
|
+
}
|
|
9191
|
+
return [this.value];
|
|
9192
|
+
}
|
|
9193
|
+
return this.value;
|
|
9194
|
+
}
|
|
9195
|
+
|
|
9032
9196
|
// Lifecycle Methods
|
|
9033
9197
|
|
|
9034
9198
|
connectedCallback() {
|
|
@@ -9071,7 +9235,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9071
9235
|
updated(changedProperties) {
|
|
9072
9236
|
super.updated(changedProperties);
|
|
9073
9237
|
|
|
9074
|
-
if (changedProperties.has('multiSelect')) {
|
|
9238
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
9075
9239
|
// Reset selection if multiSelect mode changes
|
|
9076
9240
|
this.clearSelection();
|
|
9077
9241
|
}
|
|
@@ -9085,7 +9249,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9085
9249
|
} else {
|
|
9086
9250
|
if (this.multiSelect) {
|
|
9087
9251
|
// In multiselect mode, this.value should be an array of strings
|
|
9088
|
-
const valueArray =
|
|
9252
|
+
const valueArray = this.formattedValue;
|
|
9089
9253
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
9090
9254
|
|
|
9091
9255
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -9252,14 +9416,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9252
9416
|
*/
|
|
9253
9417
|
handleSelectState(option) {
|
|
9254
9418
|
if (this.multiSelect) {
|
|
9255
|
-
const currentValue = this.
|
|
9419
|
+
const currentValue = this.formattedValue || [];
|
|
9256
9420
|
const currentSelected = this.optionSelected || [];
|
|
9257
9421
|
|
|
9258
9422
|
if (!currentValue.includes(option.value)) {
|
|
9259
|
-
this.value = [
|
|
9423
|
+
this.value = JSON.stringify([
|
|
9260
9424
|
...currentValue,
|
|
9261
9425
|
option.value
|
|
9262
|
-
];
|
|
9426
|
+
]);
|
|
9263
9427
|
}
|
|
9264
9428
|
if (!currentSelected.includes(option)) {
|
|
9265
9429
|
this.optionSelected = [
|
|
@@ -9282,13 +9446,15 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9282
9446
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
9283
9447
|
*/
|
|
9284
9448
|
handleDeselectState(option) {
|
|
9285
|
-
if (this.multiSelect
|
|
9449
|
+
if (this.multiSelect) {
|
|
9286
9450
|
// Remove this option from array
|
|
9287
|
-
|
|
9451
|
+
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
9288
9452
|
|
|
9289
9453
|
// If array is empty after removal, set back to undefined
|
|
9290
|
-
if (
|
|
9454
|
+
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
9291
9455
|
this.value = undefined;
|
|
9456
|
+
} else {
|
|
9457
|
+
this.value = JSON.stringify(newFormattedValue);
|
|
9292
9458
|
}
|
|
9293
9459
|
|
|
9294
9460
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
@@ -9639,7 +9805,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9639
9805
|
}
|
|
9640
9806
|
}
|
|
9641
9807
|
|
|
9642
|
-
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) +
|
|
9808
|
+
var styleCss$1 = i$5`:host{cursor:pointer;user-select:none}:host .wrapper{display:flex;align-items:center;padding-right:var(--ds-size-200, 1rem);padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-150, 0.75rem) + var(--ds-size-100, 0.5rem));padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-50, 0.25rem);-webkit-tap-highlight-color:transparent}:host .wrapper[class*=shape-box],:host .wrapper[class*=shape-snowflake]{border-radius:unset}:host .wrapper[class*=shape-pill]{border-radius:30px}:host .wrapper[class*=-lg]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-75, 0.375rem);padding-bottom:var(--ds-size-75, 0.375rem);padding-right:var(--ds-size-150, 0.75rem)}:host .wrapper[class*=-lg]:not(:last-child){margin-bottom:var(--ds-size-50, 0.25rem)}:host .wrapper[class*=-xl]{font-size:var(--ds-text-body-size-lg, 1.125rem);line-height:var(--ds-text-body-height-lg, 1.625rem);padding-top:var(--ds-size-100, 0.5rem);padding-bottom:var(--ds-size-100, 0.5rem);padding-right:var(--ds-size-200, 1rem)}:host .wrapper[class*=-xl]:not(:last-child){margin-bottom:var(--ds-size-100, 0.5rem)}:host slot{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host [auro-icon]{--ds-auro-icon-size: var(--ds-size-300, 1.5rem);margin-right:var(--ds-size-150, 0.75rem);margin-left:var(--ds-size-100, 0.5rem)}:host ::slotted(.nestingSpacer){display:inline-block;width:var(--ds-size-300, 1.5rem)}:host ::slotted(strong){font-weight:700}:host([loadingplaceholder]) .wrapper{padding-left:calc(var(--ds-size-150, 0.75rem) + var(--ds-size-150, 0.75rem) + var(--ds-size-100, 0.5rem))}:host([selected]) .wrapper{padding-left:0}:host([nocheckmark]) .wrapper{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-lg]{padding-left:var(--ds-size-150, 0.75rem)}:host([nocheckmark]) .wrapper[class*=-xl]{padding-left:var(--ds-size-200, 1rem)}:host([hidden]){display:none}:host([static]){pointer-events:none}:host([disabled]:hover){cursor:auto}:host([disabled]){user-select:none;pointer-events:none}`;
|
|
9643
9809
|
|
|
9644
9810
|
var colorCss$1 = i$5`:host .wrapper{border:1px solid var(--ds-auro-menuoption-container-border-color);background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color)}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-basic-color-surface-neutral-subtle, #f7f7f7)}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected, #01426a);--ds-auro-menuoption-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([selected]):host(:hover),:host([selected]):host(.active){--ds-auro-menuoption-container-color: var(--ds-advanced-color-state-selected-hover, #00274a)}`;
|
|
9645
9811
|
|
|
@@ -10205,7 +10371,6 @@ function initExamples(initCount) {
|
|
|
10205
10371
|
inDialogExample();
|
|
10206
10372
|
resetStateExample();
|
|
10207
10373
|
auroMenuLoadingExample();
|
|
10208
|
-
valueTextExample();
|
|
10209
10374
|
} catch (err) {
|
|
10210
10375
|
if (initCount <= 20) {
|
|
10211
10376
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|