@aurodesignsystem-dev/auro-formkit 0.0.0-pr740.9 → 0.0.0-pr750.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +6 -0
- package/components/bibtemplate/dist/index.js +25 -1
- package/components/bibtemplate/dist/registered.js +25 -1
- package/components/checkbox/demo/api.html +16 -10
- package/components/checkbox/demo/api.min.js +23 -16
- package/components/checkbox/demo/index.html +16 -10
- package/components/checkbox/demo/index.min.js +23 -16
- package/components/checkbox/demo/readme.html +16 -9
- package/components/checkbox/dist/index.js +23 -16
- package/components/checkbox/dist/registered.js +23 -16
- package/components/combobox/demo/api.html +16 -10
- package/components/combobox/demo/api.md +12 -6
- package/components/combobox/demo/api.min.js +442 -148
- package/components/combobox/demo/index.html +16 -10
- package/components/combobox/demo/index.min.js +442 -148
- package/components/combobox/demo/readme.html +16 -9
- package/components/combobox/dist/index.js +405 -136
- package/components/combobox/dist/registered.js +405 -136
- package/components/counter/demo/api.html +17 -10
- package/components/counter/demo/api.md +140 -7
- package/components/counter/demo/api.min.js +1171 -1016
- package/components/counter/demo/index.html +17 -10
- package/components/counter/demo/index.md +86 -0
- package/components/counter/demo/index.min.js +1171 -1016
- package/components/counter/demo/readme.html +16 -9
- package/components/counter/dist/auro-counter-group.d.ts +64 -23
- package/components/counter/dist/auro-counter.d.ts +10 -0
- package/components/counter/dist/index.js +1171 -1016
- package/components/counter/dist/registered.js +1171 -1016
- package/components/datepicker/demo/api.html +16 -10
- package/components/datepicker/demo/api.min.js +403 -123
- package/components/datepicker/demo/index.html +16 -10
- package/components/datepicker/demo/index.min.js +403 -123
- package/components/datepicker/demo/readme.html +16 -9
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -0
- package/components/datepicker/dist/index.js +403 -123
- package/components/datepicker/dist/registered.js +403 -123
- package/components/dropdown/demo/api.html +16 -10
- package/components/dropdown/demo/api.md +77 -269
- package/components/dropdown/demo/api.min.js +336 -96
- package/components/dropdown/demo/index.html +16 -10
- package/components/dropdown/demo/index.md +45 -363
- package/components/dropdown/demo/index.min.js +336 -96
- package/components/dropdown/demo/readme.html +16 -9
- package/components/dropdown/dist/auro-dropdown.d.ts +35 -67
- package/components/dropdown/dist/auro-dropdownBib.d.ts +0 -6
- package/components/dropdown/dist/index.js +336 -96
- package/components/dropdown/dist/registered.js +336 -96
- package/components/form/demo/api.html +16 -9
- package/components/form/demo/autocomplete.html +19 -3
- package/components/form/demo/index.html +16 -9
- package/components/form/demo/readme.html +16 -9
- package/components/form/demo/working.html +19 -13
- package/components/helptext/dist/index.js +1 -1
- package/components/helptext/dist/registered.js +1 -1
- package/components/input/demo/api.html +16 -10
- package/components/input/demo/api.md +1 -1
- package/components/input/demo/api.min.js +14 -14
- package/components/input/demo/index.html +16 -10
- package/components/input/demo/index.min.js +14 -14
- package/components/input/demo/readme.html +16 -9
- package/components/input/dist/base-input.d.ts +1 -1
- package/components/input/dist/index.js +14 -14
- package/components/input/dist/registered.js +14 -14
- package/components/menu/demo/api.html +16 -32
- package/components/menu/demo/api.md +1 -1
- package/components/menu/demo/api.min.js +37 -12
- package/components/menu/demo/index.html +16 -10
- package/components/menu/demo/index.min.js +37 -12
- package/components/menu/demo/readme.html +16 -9
- package/components/menu/dist/auro-menu.d.ts +13 -2
- package/components/menu/dist/index.js +37 -12
- package/components/menu/dist/registered.js +37 -12
- package/components/radio/demo/api.html +16 -10
- package/components/radio/demo/api.md +0 -1
- package/components/radio/demo/api.min.js +61 -76
- package/components/radio/demo/index.html +16 -10
- package/components/radio/demo/index.min.js +61 -76
- package/components/radio/demo/readme.html +16 -9
- package/components/radio/dist/auro-radio.d.ts +8 -11
- package/components/radio/dist/index.js +61 -76
- package/components/radio/dist/registered.js +61 -76
- package/components/select/demo/api.html +16 -10
- package/components/select/demo/api.js +0 -2
- package/components/select/demo/api.md +53 -51
- package/components/select/demo/api.min.js +520 -358
- package/components/select/demo/index.html +16 -11
- package/components/select/demo/index.md +6 -158
- package/components/select/demo/index.min.js +520 -346
- package/components/select/demo/readme.html +16 -9
- package/components/select/dist/auro-select.d.ts +33 -8
- package/components/select/dist/index.js +483 -334
- package/components/select/dist/registered.js +483 -334
- package/package.json +26 -25
|
@@ -689,19 +689,19 @@ class AuroFormValidation {
|
|
|
689
689
|
{
|
|
690
690
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
691
691
|
validity: 'tooShort',
|
|
692
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
692
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
693
693
|
},
|
|
694
694
|
{
|
|
695
695
|
check: (e) => e.value?.length > e.maxLength,
|
|
696
696
|
validity: 'tooLong',
|
|
697
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
697
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
698
698
|
}
|
|
699
699
|
],
|
|
700
700
|
pattern: [
|
|
701
701
|
{
|
|
702
702
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
703
703
|
validity: 'patternMismatch',
|
|
704
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
704
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
705
705
|
}
|
|
706
706
|
]
|
|
707
707
|
},
|
|
@@ -896,10 +896,10 @@ class AuroFormValidation {
|
|
|
896
896
|
if (!hasValue && elem.required && elem.touched) {
|
|
897
897
|
elem.validity = 'valueMissing';
|
|
898
898
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
899
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
899
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
900
900
|
this.validateType(elem);
|
|
901
901
|
this.validateElementAttributes(elem);
|
|
902
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
902
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
903
903
|
this.validateElementAttributes(elem);
|
|
904
904
|
}
|
|
905
905
|
}
|
|
@@ -3274,6 +3274,267 @@ class AuroFloatingUI {
|
|
|
3274
3274
|
}
|
|
3275
3275
|
}
|
|
3276
3276
|
|
|
3277
|
+
// Selectors for focusable elements
|
|
3278
|
+
const FOCUSABLE_SELECTORS = [
|
|
3279
|
+
'a[href]',
|
|
3280
|
+
'button:not([disabled])',
|
|
3281
|
+
'textarea:not([disabled])',
|
|
3282
|
+
'input:not([disabled])',
|
|
3283
|
+
'select:not([disabled])',
|
|
3284
|
+
'[role="tab"]:not([disabled])',
|
|
3285
|
+
'[role="link"]:not([disabled])',
|
|
3286
|
+
'[role="button"]:not([disabled])',
|
|
3287
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
3288
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
3289
|
+
];
|
|
3290
|
+
|
|
3291
|
+
// List of custom components that are known to be focusable
|
|
3292
|
+
const FOCUSABLE_COMPONENTS = [
|
|
3293
|
+
'auro-checkbox',
|
|
3294
|
+
'auro-radio',
|
|
3295
|
+
'auro-dropdown',
|
|
3296
|
+
'auro-button',
|
|
3297
|
+
'auro-combobox',
|
|
3298
|
+
'auro-input',
|
|
3299
|
+
'auro-counter',
|
|
3300
|
+
'auro-menu',
|
|
3301
|
+
'auro-select',
|
|
3302
|
+
'auro-datepicker',
|
|
3303
|
+
'auro-hyperlink',
|
|
3304
|
+
'auro-accordion',
|
|
3305
|
+
];
|
|
3306
|
+
|
|
3307
|
+
/**
|
|
3308
|
+
* Determines if a given element is a custom focusable component.
|
|
3309
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
3310
|
+
*
|
|
3311
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
3312
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
3313
|
+
*/
|
|
3314
|
+
function isFocusableComponent(element) {
|
|
3315
|
+
const componentName = element.tagName.toLowerCase();
|
|
3316
|
+
|
|
3317
|
+
// Guard Clause: Element is a focusable component
|
|
3318
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
3319
|
+
|
|
3320
|
+
// Guard Clause: Element is not disabled
|
|
3321
|
+
if (element.hasAttribute('disabled')) return false;
|
|
3322
|
+
|
|
3323
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
3324
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
3325
|
+
|
|
3326
|
+
// If all guard clauses pass, the element is a focusable component
|
|
3327
|
+
return true;
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
/**
|
|
3331
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3332
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3333
|
+
*
|
|
3334
|
+
* @param {HTMLElement} container The container to search within
|
|
3335
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3336
|
+
*/
|
|
3337
|
+
function getFocusableElements(container) {
|
|
3338
|
+
// Get elements in DOM order by walking the tree
|
|
3339
|
+
const orderedFocusableElements = [];
|
|
3340
|
+
|
|
3341
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
3342
|
+
const collectFocusableElements = (root) => {
|
|
3343
|
+
// Check if current element is focusable
|
|
3344
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
3345
|
+
// Check if this is a custom component that is focusable
|
|
3346
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
3347
|
+
|
|
3348
|
+
if (isComponentFocusable) {
|
|
3349
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
3350
|
+
orderedFocusableElements.push(root);
|
|
3351
|
+
return; // Skip traversing inside this component
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
// Check if the element itself matches any selector
|
|
3355
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
3356
|
+
if (root.matches?.(selector)) {
|
|
3357
|
+
orderedFocusableElements.push(root);
|
|
3358
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
// Process shadow DOM only for non-Auro components
|
|
3363
|
+
if (root.shadowRoot) {
|
|
3364
|
+
// Process shadow DOM children in order
|
|
3365
|
+
if (root.shadowRoot.children) {
|
|
3366
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
3367
|
+
collectFocusableElements(child);
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
// Process slots and their assigned nodes in order
|
|
3373
|
+
if (root.tagName === 'SLOT') {
|
|
3374
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
3375
|
+
for (const node of assignedNodes) {
|
|
3376
|
+
collectFocusableElements(node);
|
|
3377
|
+
}
|
|
3378
|
+
} else {
|
|
3379
|
+
// Process light DOM children in order
|
|
3380
|
+
if (root.children) {
|
|
3381
|
+
Array.from(root.children).forEach(child => {
|
|
3382
|
+
collectFocusableElements(child);
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
};
|
|
3388
|
+
|
|
3389
|
+
// Start the traversal from the container
|
|
3390
|
+
collectFocusableElements(container);
|
|
3391
|
+
|
|
3392
|
+
// Remove duplicates that might have been collected through different paths
|
|
3393
|
+
// while preserving order
|
|
3394
|
+
const uniqueElements = [];
|
|
3395
|
+
const seen = new Set();
|
|
3396
|
+
|
|
3397
|
+
for (const element of orderedFocusableElements) {
|
|
3398
|
+
if (!seen.has(element)) {
|
|
3399
|
+
seen.add(element);
|
|
3400
|
+
uniqueElements.push(element);
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
return uniqueElements;
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
/**
|
|
3408
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
3409
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
3410
|
+
*/
|
|
3411
|
+
class FocusTrap {
|
|
3412
|
+
/**
|
|
3413
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
3414
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
3415
|
+
*
|
|
3416
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
3417
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
3418
|
+
*/
|
|
3419
|
+
constructor(container) {
|
|
3420
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
3421
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
this.container = container;
|
|
3425
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
3426
|
+
|
|
3427
|
+
this._init();
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
/**
|
|
3431
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
3432
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
3433
|
+
*
|
|
3434
|
+
* @private
|
|
3435
|
+
*/
|
|
3436
|
+
_init() {
|
|
3437
|
+
|
|
3438
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
3439
|
+
if ('inert' in HTMLElement.prototype) {
|
|
3440
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
3441
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3444
|
+
// Track tab direction
|
|
3445
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
3446
|
+
}
|
|
3447
|
+
|
|
3448
|
+
/**
|
|
3449
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
3450
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
3451
|
+
*
|
|
3452
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
3453
|
+
* @private
|
|
3454
|
+
*/
|
|
3455
|
+
_onKeydown = (e) => {
|
|
3456
|
+
|
|
3457
|
+
if (e.key === 'Tab') {
|
|
3458
|
+
|
|
3459
|
+
// Set the tab direction based on the key pressed
|
|
3460
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
3461
|
+
|
|
3462
|
+
// Get the active element(s) in the document and shadow root
|
|
3463
|
+
// This will include the active element in the shadow DOM if it exists
|
|
3464
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
3465
|
+
let activeElement = document.activeElement;
|
|
3466
|
+
const actives = [activeElement];
|
|
3467
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
3468
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
3469
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
// Update the focusable elements
|
|
3473
|
+
const focusables = this._getFocusableElements();
|
|
3474
|
+
|
|
3475
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
3476
|
+
const focusIndex =
|
|
3477
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
3478
|
+
? focusables.length - 1
|
|
3479
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
3480
|
+
? 0
|
|
3481
|
+
: null;
|
|
3482
|
+
|
|
3483
|
+
if (focusIndex !== null) {
|
|
3484
|
+
focusables[focusIndex].focus();
|
|
3485
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
3486
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
};
|
|
3490
|
+
|
|
3491
|
+
/**
|
|
3492
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3493
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3494
|
+
*
|
|
3495
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3496
|
+
* @private
|
|
3497
|
+
*/
|
|
3498
|
+
_getFocusableElements() {
|
|
3499
|
+
// Use the imported utility function to get focusable elements
|
|
3500
|
+
const elements = getFocusableElements(this.container);
|
|
3501
|
+
|
|
3502
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
3503
|
+
return elements;
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
/**
|
|
3507
|
+
* Moves focus to the first focusable element within the container.
|
|
3508
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
3509
|
+
*/
|
|
3510
|
+
focusFirstElement() {
|
|
3511
|
+
const focusables = this._getFocusableElements();
|
|
3512
|
+
if (focusables.length) focusables[0].focus();
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
/**
|
|
3516
|
+
* Moves focus to the last focusable element within the container.
|
|
3517
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
3518
|
+
*/
|
|
3519
|
+
focusLastElement() {
|
|
3520
|
+
const focusables = this._getFocusableElements();
|
|
3521
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
/**
|
|
3525
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
3526
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
3527
|
+
*/
|
|
3528
|
+
disconnect() {
|
|
3529
|
+
|
|
3530
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
3531
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3277
3538
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3278
3539
|
// See LICENSE in the project root for license information.
|
|
3279
3540
|
|
|
@@ -3711,11 +3972,11 @@ let AuroIcon$2 = class AuroIcon extends BaseIcon$2 {
|
|
|
3711
3972
|
|
|
3712
3973
|
var iconVersion$2 = '6.1.2';
|
|
3713
3974
|
|
|
3714
|
-
var styleCss$1$2 = i$5`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){top:0;left:0
|
|
3975
|
+
var styleCss$1$2 = i$5`: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}`;
|
|
3715
3976
|
|
|
3716
3977
|
var colorCss$2$2 = i$5`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3717
3978
|
|
|
3718
|
-
var tokensCss$1$2 = i$5`: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-
|
|
3979
|
+
var tokensCss$1$2 = i$5`: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)}`;
|
|
3719
3980
|
|
|
3720
3981
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3721
3982
|
// See LICENSE in the project root for license information.
|
|
@@ -3875,17 +4136,6 @@ class AuroDropdownBib extends i$2 {
|
|
|
3875
4136
|
}
|
|
3876
4137
|
}
|
|
3877
4138
|
});
|
|
3878
|
-
|
|
3879
|
-
this.preventBodyScroll = this.preventBodyScroll.bind(this);
|
|
3880
|
-
this.addEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
3881
|
-
this.addEventListener('touchstart', this.preventBodyScroll, { passive: false });
|
|
3882
|
-
}
|
|
3883
|
-
|
|
3884
|
-
disconnectedCallback() {
|
|
3885
|
-
super.disconnectedCallback();
|
|
3886
|
-
|
|
3887
|
-
this.removeEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
3888
|
-
this.removeEventListener('touchstart', this.preventBodyScroll, { passive: false });
|
|
3889
4139
|
}
|
|
3890
4140
|
|
|
3891
4141
|
firstUpdated(changedProperties) {
|
|
@@ -3901,19 +4151,6 @@ class AuroDropdownBib extends i$2 {
|
|
|
3901
4151
|
}));
|
|
3902
4152
|
}
|
|
3903
4153
|
|
|
3904
|
-
/**
|
|
3905
|
-
* Prevents scrolling of the body when touching empty areas of the component.
|
|
3906
|
-
* @param {Event} event - The touchmove event.
|
|
3907
|
-
* @returns {void}
|
|
3908
|
-
*/
|
|
3909
|
-
preventBodyScroll(event) {
|
|
3910
|
-
// when touchmove/touchstart on empty space
|
|
3911
|
-
if (event.target === this) {
|
|
3912
|
-
event.preventDefault();
|
|
3913
|
-
event.stopImmediatePropagation();
|
|
3914
|
-
}
|
|
3915
|
-
}
|
|
3916
|
-
|
|
3917
4154
|
// function that renders the HTML and CSS into the scope of the component
|
|
3918
4155
|
render() {
|
|
3919
4156
|
const classes = {
|
|
@@ -3936,19 +4173,19 @@ var dropdownVersion$1 = '3.0.0';
|
|
|
3936
4173
|
|
|
3937
4174
|
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}`;
|
|
3938
4175
|
|
|
3939
|
-
var colorCss$1$2 = i$5`: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:
|
|
4176
|
+
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)}`;
|
|
3940
4177
|
|
|
3941
|
-
var classicColorCss = i$5
|
|
4178
|
+
var classicColorCss = i$5``;
|
|
3942
4179
|
|
|
3943
|
-
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]) .
|
|
4180
|
+
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%}`;
|
|
3944
4181
|
|
|
3945
|
-
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-direction:row
|
|
4182
|
+
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)}`;
|
|
3946
4183
|
|
|
3947
|
-
var styleSnowflakeCss = i$5`:host{display:block}.wrapper{display:flex;flex-direction:row
|
|
4184
|
+
var styleSnowflakeCss = i$5`: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)}`;
|
|
3948
4185
|
|
|
3949
4186
|
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)}`;
|
|
3950
4187
|
|
|
3951
|
-
var styleCss$6 = i$5
|
|
4188
|
+
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}`;
|
|
3952
4189
|
|
|
3953
4190
|
var tokensCss$4 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3954
4191
|
|
|
@@ -4253,10 +4490,8 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
4253
4490
|
// See LICENSE in the project root for license information.
|
|
4254
4491
|
|
|
4255
4492
|
|
|
4256
|
-
|
|
4257
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
4493
|
+
/*
|
|
4258
4494
|
* @slot - Default slot for the popover content.
|
|
4259
|
-
* @slot label - Defines the content of the label.
|
|
4260
4495
|
* @slot helpText - Defines the content of the helpText.
|
|
4261
4496
|
* @slot trigger - Defines the content of the trigger.
|
|
4262
4497
|
* @csspart trigger - The trigger content container.
|
|
@@ -4275,18 +4510,22 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4275
4510
|
this.matchWidth = false;
|
|
4276
4511
|
this.noHideOnThisFocusLoss = false;
|
|
4277
4512
|
|
|
4278
|
-
this.errorMessage =
|
|
4513
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
4279
4514
|
|
|
4280
4515
|
// Layout Config
|
|
4281
|
-
this.layout =
|
|
4282
|
-
this.shape =
|
|
4283
|
-
this.size =
|
|
4516
|
+
this.layout = undefined;
|
|
4517
|
+
this.shape = undefined;
|
|
4518
|
+
this.size = undefined;
|
|
4284
4519
|
|
|
4285
4520
|
this.parentBorder = false;
|
|
4286
4521
|
|
|
4287
4522
|
this.privateDefaults();
|
|
4288
4523
|
}
|
|
4289
4524
|
|
|
4525
|
+
/**
|
|
4526
|
+
* @private
|
|
4527
|
+
* @returns {object} Class definition for the wrapper element.
|
|
4528
|
+
*/
|
|
4290
4529
|
get commonWrapperClasses() {
|
|
4291
4530
|
return {
|
|
4292
4531
|
'trigger': true,
|
|
@@ -4304,13 +4543,10 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4304
4543
|
privateDefaults() {
|
|
4305
4544
|
this.chevron = false;
|
|
4306
4545
|
this.disabled = false;
|
|
4546
|
+
this.disableFocusTrap = false;
|
|
4307
4547
|
this.error = false;
|
|
4308
|
-
this.inset = false;
|
|
4309
|
-
this.rounded = false;
|
|
4310
4548
|
this.tabIndex = 0;
|
|
4311
4549
|
this.noToggle = false;
|
|
4312
|
-
this.a11yAutocomplete = 'none';
|
|
4313
|
-
this.labeled = true;
|
|
4314
4550
|
this.a11yRole = 'button';
|
|
4315
4551
|
this.onDark = false;
|
|
4316
4552
|
this.showTriggerBorders = true;
|
|
@@ -4406,6 +4642,18 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4406
4642
|
this.floater.showBib();
|
|
4407
4643
|
}
|
|
4408
4644
|
|
|
4645
|
+
/**
|
|
4646
|
+
* When bib is open, focus on the first element inside of bib.
|
|
4647
|
+
* If not, trigger element will get focus.
|
|
4648
|
+
*/
|
|
4649
|
+
focus() {
|
|
4650
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
4651
|
+
this.focusTrap.focusFirstElement();
|
|
4652
|
+
} else {
|
|
4653
|
+
this.trigger.focus();
|
|
4654
|
+
}
|
|
4655
|
+
}
|
|
4656
|
+
|
|
4409
4657
|
// function to define props used within the scope of this component
|
|
4410
4658
|
static get properties() {
|
|
4411
4659
|
return {
|
|
@@ -4419,6 +4667,15 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4419
4667
|
reflect: true
|
|
4420
4668
|
},
|
|
4421
4669
|
|
|
4670
|
+
/**
|
|
4671
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4672
|
+
* @default false
|
|
4673
|
+
*/
|
|
4674
|
+
disableEventShow: {
|
|
4675
|
+
type: Boolean,
|
|
4676
|
+
reflect: true
|
|
4677
|
+
},
|
|
4678
|
+
|
|
4422
4679
|
/**
|
|
4423
4680
|
* If declared, applies a border around the trigger slot.
|
|
4424
4681
|
*/
|
|
@@ -4437,17 +4694,17 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4437
4694
|
},
|
|
4438
4695
|
|
|
4439
4696
|
/**
|
|
4440
|
-
* If declared, the dropdown
|
|
4697
|
+
* If declared, the dropdown is not interactive.
|
|
4441
4698
|
*/
|
|
4442
|
-
|
|
4699
|
+
disabled: {
|
|
4443
4700
|
type: Boolean,
|
|
4444
4701
|
reflect: true
|
|
4445
4702
|
},
|
|
4446
4703
|
|
|
4447
4704
|
/**
|
|
4448
|
-
* If declared, the
|
|
4705
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
4449
4706
|
*/
|
|
4450
|
-
|
|
4707
|
+
disableFocusTrap: {
|
|
4451
4708
|
type: Boolean,
|
|
4452
4709
|
reflect: true
|
|
4453
4710
|
},
|
|
@@ -4492,22 +4749,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4492
4749
|
reflect: true
|
|
4493
4750
|
},
|
|
4494
4751
|
|
|
4495
|
-
/**
|
|
4496
|
-
* Makes the trigger to be full width of its parent container.
|
|
4497
|
-
*/
|
|
4498
|
-
fluid: {
|
|
4499
|
-
type: Boolean,
|
|
4500
|
-
reflect: true
|
|
4501
|
-
},
|
|
4502
|
-
|
|
4503
|
-
/**
|
|
4504
|
-
* If declared, will apply padding around trigger slot content.
|
|
4505
|
-
*/
|
|
4506
|
-
inset: {
|
|
4507
|
-
type: Boolean,
|
|
4508
|
-
reflect: true
|
|
4509
|
-
},
|
|
4510
|
-
|
|
4511
4752
|
/**
|
|
4512
4753
|
* If true, the dropdown bib is displayed.
|
|
4513
4754
|
*/
|
|
@@ -4551,15 +4792,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4551
4792
|
reflect: true
|
|
4552
4793
|
},
|
|
4553
4794
|
|
|
4554
|
-
/**
|
|
4555
|
-
* Defines if there is a label preset.
|
|
4556
|
-
* @private
|
|
4557
|
-
*/
|
|
4558
|
-
labeled: {
|
|
4559
|
-
type: Boolean,
|
|
4560
|
-
reflect: true
|
|
4561
|
-
},
|
|
4562
|
-
|
|
4563
4795
|
/**
|
|
4564
4796
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4565
4797
|
* @private
|
|
@@ -4620,6 +4852,9 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4620
4852
|
reflect: true
|
|
4621
4853
|
},
|
|
4622
4854
|
|
|
4855
|
+
/**
|
|
4856
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
4857
|
+
*/
|
|
4623
4858
|
onSlotChange: {
|
|
4624
4859
|
type: Function,
|
|
4625
4860
|
reflect: false
|
|
@@ -4634,14 +4869,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4634
4869
|
reflect: true
|
|
4635
4870
|
},
|
|
4636
4871
|
|
|
4637
|
-
/**
|
|
4638
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
4639
|
-
*/
|
|
4640
|
-
rounded: {
|
|
4641
|
-
type: Boolean,
|
|
4642
|
-
reflect: true
|
|
4643
|
-
},
|
|
4644
|
-
|
|
4645
4872
|
/**
|
|
4646
4873
|
* @private
|
|
4647
4874
|
*/
|
|
@@ -4656,22 +4883,14 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4656
4883
|
type: String || undefined,
|
|
4657
4884
|
attribute: false,
|
|
4658
4885
|
reflect: false
|
|
4659
|
-
},
|
|
4660
|
-
|
|
4661
|
-
/**
|
|
4662
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
4663
|
-
*/
|
|
4664
|
-
a11yAutocomplete: {
|
|
4665
|
-
type: String,
|
|
4666
|
-
attribute: false,
|
|
4667
4886
|
}
|
|
4668
4887
|
};
|
|
4669
4888
|
}
|
|
4670
4889
|
|
|
4671
4890
|
static get styles() {
|
|
4672
4891
|
return [
|
|
4673
|
-
colorCss$1$2,
|
|
4674
4892
|
tokensCss$1$2,
|
|
4893
|
+
colorCss$1$2,
|
|
4675
4894
|
|
|
4676
4895
|
// default layout
|
|
4677
4896
|
classicColorCss,
|
|
@@ -4734,6 +4953,12 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4734
4953
|
this.handleTriggerContentSlotChange();
|
|
4735
4954
|
}
|
|
4736
4955
|
|
|
4956
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
4957
|
+
this.updateFocusTrap();
|
|
4958
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
4959
|
+
this.trigger.focus();
|
|
4960
|
+
}
|
|
4961
|
+
}
|
|
4737
4962
|
}
|
|
4738
4963
|
|
|
4739
4964
|
firstUpdated() {
|
|
@@ -4754,9 +4979,6 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4754
4979
|
}
|
|
4755
4980
|
|
|
4756
4981
|
this.bibContent = this.floater.element.bib;
|
|
4757
|
-
this.bibContent.setAttribute('role', 'dialog');
|
|
4758
|
-
this.bibContent.setAttribute('aria-modal', 'true');
|
|
4759
|
-
this.bibContent.setAttribute('aria-labelledby', 'triggerLabel');
|
|
4760
4982
|
|
|
4761
4983
|
// Add the tag name as an attribute if it is different than the component name
|
|
4762
4984
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-dropdown');
|
|
@@ -4802,6 +5024,27 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
4802
5024
|
this.hasFocus = true;
|
|
4803
5025
|
}
|
|
4804
5026
|
|
|
5027
|
+
/**
|
|
5028
|
+
* @private
|
|
5029
|
+
*/
|
|
5030
|
+
updateFocusTrap() {
|
|
5031
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
5032
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
5033
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
5034
|
+
this.focusTrap.focusFirstElement();
|
|
5035
|
+
return;
|
|
5036
|
+
}
|
|
5037
|
+
|
|
5038
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
5039
|
+
if (!this.focusTrap) {
|
|
5040
|
+
return;
|
|
5041
|
+
}
|
|
5042
|
+
|
|
5043
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
5044
|
+
this.focusTrap.disconnect();
|
|
5045
|
+
this.focusTrap = undefined;
|
|
5046
|
+
}
|
|
5047
|
+
|
|
4805
5048
|
/**
|
|
4806
5049
|
* Function to support @focusout event.
|
|
4807
5050
|
* @private
|
|
@@ -5087,10 +5330,7 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
5087
5330
|
id="bib"
|
|
5088
5331
|
shape="${this.shape}"
|
|
5089
5332
|
?data-show="${this.isPopoverVisible}"
|
|
5090
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5091
|
-
?common="${this.common}"
|
|
5092
|
-
?rounded="${this.common || this.rounded}"
|
|
5093
|
-
?inset="${this.common || this.inset}">
|
|
5333
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
5094
5334
|
<div class="slotContent">
|
|
5095
5335
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5096
5336
|
</div>
|
|
@@ -7016,6 +7256,30 @@ class AuroBibtemplate extends i$2 {
|
|
|
7016
7256
|
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroBibtemplate);
|
|
7017
7257
|
}
|
|
7018
7258
|
|
|
7259
|
+
/**
|
|
7260
|
+
* Prevents scrolling of the body when touching empty areas of the component.
|
|
7261
|
+
* @param {Event} event - The touchmove event.
|
|
7262
|
+
* @returns {void}
|
|
7263
|
+
*/
|
|
7264
|
+
preventBodyScroll(event) {
|
|
7265
|
+
if (event.target === this) {
|
|
7266
|
+
event.preventDefault();
|
|
7267
|
+
}
|
|
7268
|
+
}
|
|
7269
|
+
|
|
7270
|
+
connectedCallback() {
|
|
7271
|
+
super.connectedCallback();
|
|
7272
|
+
|
|
7273
|
+
this.preventBodyScroll = this.preventBodyScroll.bind(this);
|
|
7274
|
+
this.addEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
7275
|
+
}
|
|
7276
|
+
|
|
7277
|
+
disconnectedCallback() {
|
|
7278
|
+
super.disconnectedCallback();
|
|
7279
|
+
|
|
7280
|
+
this.removeEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
7281
|
+
}
|
|
7282
|
+
|
|
7019
7283
|
onCloseButtonClick() {
|
|
7020
7284
|
this.dispatchEvent(new Event("close-click", { bubbles: true,
|
|
7021
7285
|
composed: true }));
|
|
@@ -7047,7 +7311,7 @@ class AuroBibtemplate extends i$2 {
|
|
|
7047
7311
|
<div id="bibTemplate" part="bibtemplate">
|
|
7048
7312
|
${this.isFullscreen ? u`
|
|
7049
7313
|
<div id="headerContainer">
|
|
7050
|
-
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
7314
|
+
<${this.buttonTag} id="closeButton" aria-label="Close" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
7051
7315
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
7052
7316
|
</${this.buttonTag}>
|
|
7053
7317
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
@@ -7075,7 +7339,7 @@ var bibTemplateVersion = '1.0.0';
|
|
|
7075
7339
|
|
|
7076
7340
|
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)}`;
|
|
7077
7341
|
|
|
7078
|
-
var styleCss$4 = i$5
|
|
7342
|
+
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}`;
|
|
7079
7343
|
|
|
7080
7344
|
var tokensCss$2 = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7081
7345
|
|
|
@@ -7281,68 +7545,7 @@ class AuroHelpText extends i$2 {
|
|
|
7281
7545
|
|
|
7282
7546
|
var helpTextVersion = '1.0.0';
|
|
7283
7547
|
|
|
7284
|
-
i$5
|
|
7285
|
-
|
|
7286
|
-
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)}`;
|
|
7287
|
-
|
|
7288
|
-
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)}`;
|
|
7289
|
-
|
|
7290
|
-
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7291
|
-
// See LICENSE in the project root for license information.
|
|
7292
|
-
|
|
7293
|
-
// ---------------------------------------------------------------------
|
|
7294
|
-
|
|
7295
|
-
/**
|
|
7296
|
-
* Converts value to an array.
|
|
7297
|
-
* If the value is a JSON string representing an array, it will be parsed.
|
|
7298
|
-
* If the value is already an array, it is returned.
|
|
7299
|
-
* If the value is undefined, it returns undefined.
|
|
7300
|
-
* @private
|
|
7301
|
-
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
7302
|
-
* @returns {Array|undefined} - The converted array or undefined.
|
|
7303
|
-
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
7304
|
-
* or if the value cannot be parsed into an array from a JSON string.
|
|
7305
|
-
*/
|
|
7306
|
-
function arrayConverter(value) {
|
|
7307
|
-
// Allow undefined
|
|
7308
|
-
if (value === undefined) {
|
|
7309
|
-
return undefined;
|
|
7310
|
-
}
|
|
7311
|
-
|
|
7312
|
-
// Return the value if it is already an array
|
|
7313
|
-
if (Array.isArray(value)) {
|
|
7314
|
-
return value;
|
|
7315
|
-
}
|
|
7316
|
-
|
|
7317
|
-
try {
|
|
7318
|
-
// If value is a JSON string, parse it
|
|
7319
|
-
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
7320
|
-
|
|
7321
|
-
// Check if the parsed value is an array
|
|
7322
|
-
if (Array.isArray(parsed)) {
|
|
7323
|
-
return parsed;
|
|
7324
|
-
}
|
|
7325
|
-
} catch (error) {
|
|
7326
|
-
// If JSON parsing fails, continue to throw an error below
|
|
7327
|
-
/* eslint-disable no-console */
|
|
7328
|
-
console.error('JSON parsing failed:', error);
|
|
7329
|
-
}
|
|
7330
|
-
|
|
7331
|
-
// Throw error if the input is not an array or undefined
|
|
7332
|
-
throw new Error('Invalid value: Input must be an array or undefined');
|
|
7333
|
-
}
|
|
7334
|
-
|
|
7335
|
-
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}`;
|
|
7336
|
-
|
|
7337
|
-
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)}`;
|
|
7338
|
-
|
|
7339
|
-
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}`;
|
|
7340
|
-
|
|
7341
|
-
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)}`;
|
|
7342
|
-
|
|
7343
|
-
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)}`;
|
|
7344
|
-
|
|
7345
|
-
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}`;
|
|
7548
|
+
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}`;
|
|
7346
7549
|
|
|
7347
7550
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7348
7551
|
// See LICENSE in the project root for license information.
|
|
@@ -7357,7 +7560,6 @@ var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock
|
|
|
7357
7560
|
* @slot label - Defines the content of the label.
|
|
7358
7561
|
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
7359
7562
|
* @slot helpText - Defines the content of the helpText.
|
|
7360
|
-
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
7361
7563
|
* @slot valueText - Dropdown value text display.
|
|
7362
7564
|
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
7363
7565
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
@@ -7627,6 +7829,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7627
7829
|
reflect: true
|
|
7628
7830
|
},
|
|
7629
7831
|
|
|
7832
|
+
/**
|
|
7833
|
+
* Define custom placeholder text.
|
|
7834
|
+
*/
|
|
7835
|
+
placeholder: {
|
|
7836
|
+
type: String,
|
|
7837
|
+
reflect: true
|
|
7838
|
+
},
|
|
7839
|
+
|
|
7630
7840
|
/**
|
|
7631
7841
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
7632
7842
|
*/
|
|
@@ -7673,11 +7883,12 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7673
7883
|
},
|
|
7674
7884
|
|
|
7675
7885
|
/**
|
|
7676
|
-
* Value selected for the component.
|
|
7677
|
-
* @type {String|Array<String>}
|
|
7886
|
+
* Value selected for the component.
|
|
7678
7887
|
*/
|
|
7679
7888
|
value: {
|
|
7680
|
-
type:
|
|
7889
|
+
type: String,
|
|
7890
|
+
reflect: true,
|
|
7891
|
+
attribute: 'value'
|
|
7681
7892
|
},
|
|
7682
7893
|
|
|
7683
7894
|
/**
|
|
@@ -7729,6 +7940,25 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7729
7940
|
];
|
|
7730
7941
|
}
|
|
7731
7942
|
|
|
7943
|
+
/**
|
|
7944
|
+
* Formatted value based on `multiSelect` state.
|
|
7945
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
7946
|
+
* @private
|
|
7947
|
+
* @returns {String|Array<String>}
|
|
7948
|
+
*/
|
|
7949
|
+
get formattedValue() {
|
|
7950
|
+
if (this.multiSelect) {
|
|
7951
|
+
if (!this.value) {
|
|
7952
|
+
return undefined;
|
|
7953
|
+
}
|
|
7954
|
+
if (this.value.startsWith("[")) {
|
|
7955
|
+
return JSON.parse(this.value);
|
|
7956
|
+
}
|
|
7957
|
+
return [this.value];
|
|
7958
|
+
}
|
|
7959
|
+
return this.value;
|
|
7960
|
+
}
|
|
7961
|
+
|
|
7732
7962
|
/**
|
|
7733
7963
|
* Returns classmap configuration for html5 input labels in all layouts.
|
|
7734
7964
|
* @private
|
|
@@ -7737,7 +7967,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7737
7967
|
get commonLabelClasses() {
|
|
7738
7968
|
return {
|
|
7739
7969
|
'is-disabled': this.disabled,
|
|
7740
|
-
'withValue': this.value && this.value.length > 0,
|
|
7970
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
7741
7971
|
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7742
7972
|
};
|
|
7743
7973
|
}
|
|
@@ -7763,6 +7993,21 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7763
7993
|
|
|
7764
7994
|
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
7765
7995
|
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
7996
|
+
|
|
7997
|
+
if (this.dropdown.isPopoverVisible) {
|
|
7998
|
+
// wait til the bib gets fully rendered
|
|
7999
|
+
setTimeout(() => {
|
|
8000
|
+
if (this.dropdown.isBibFullscreen) {
|
|
8001
|
+
// trigger holds the focus since menu is not a focusable element.
|
|
8002
|
+
this.dropdown.trigger.focus();
|
|
8003
|
+
|
|
8004
|
+
// default focus indicator on the first menu option
|
|
8005
|
+
if (this.menu.index < 0) {
|
|
8006
|
+
this.menu.navigateOptions('down');
|
|
8007
|
+
}
|
|
8008
|
+
}
|
|
8009
|
+
});
|
|
8010
|
+
}
|
|
7766
8011
|
});
|
|
7767
8012
|
|
|
7768
8013
|
// setting up bibtemplate
|
|
@@ -7913,46 +8158,58 @@ class AuroSelect extends AuroElement$4 {
|
|
|
7913
8158
|
configureSelect() {
|
|
7914
8159
|
|
|
7915
8160
|
this.addEventListener('keydown', (evt) => {
|
|
7916
|
-
|
|
7917
|
-
|
|
8161
|
+
// when the focus is on trigger not on close button
|
|
8162
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8163
|
+
if (evt.key === 'ArrowUp') {
|
|
8164
|
+
evt.preventDefault();
|
|
7918
8165
|
|
|
7919
|
-
|
|
8166
|
+
this.dropdown.show();
|
|
7920
8167
|
|
|
7921
|
-
|
|
7922
|
-
|
|
8168
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8169
|
+
this.menu.navigateOptions('up');
|
|
8170
|
+
}
|
|
8171
|
+
|
|
8172
|
+
return;
|
|
7923
8173
|
}
|
|
7924
8174
|
|
|
7925
|
-
|
|
7926
|
-
|
|
8175
|
+
if (evt.key === 'ArrowDown') {
|
|
8176
|
+
evt.preventDefault();
|
|
7927
8177
|
|
|
7928
|
-
|
|
7929
|
-
evt.preventDefault();
|
|
8178
|
+
this.dropdown.show();
|
|
7930
8179
|
|
|
7931
|
-
|
|
8180
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8181
|
+
this.menu.navigateOptions('down');
|
|
8182
|
+
}
|
|
7932
8183
|
|
|
7933
|
-
|
|
7934
|
-
this.menu.navigateOptions('down');
|
|
8184
|
+
return;
|
|
7935
8185
|
}
|
|
7936
8186
|
|
|
7937
|
-
|
|
7938
|
-
|
|
8187
|
+
if (evt.key === 'Enter') {
|
|
8188
|
+
if (!this.dropdown.isPopoverVisible) {
|
|
8189
|
+
evt.preventDefault();
|
|
8190
|
+
this.menu.makeSelection();
|
|
8191
|
+
}
|
|
7939
8192
|
|
|
7940
|
-
|
|
7941
|
-
if (!this.dropdown.isPopoverVisible) {
|
|
7942
|
-
evt.preventDefault();
|
|
7943
|
-
this.menu.makeSelection();
|
|
8193
|
+
return;
|
|
7944
8194
|
}
|
|
7945
|
-
|
|
7946
|
-
return;
|
|
7947
8195
|
}
|
|
7948
8196
|
|
|
7949
|
-
if (evt.key === 'Tab') {
|
|
8197
|
+
if (evt.key === 'Tab' && this.dropdown.isPopoverVisible) {
|
|
7950
8198
|
if (this.dropdown.isBibFullscreen) {
|
|
7951
8199
|
evt.preventDefault();
|
|
8200
|
+
|
|
8201
|
+
// when the focus is on trigger not on close button
|
|
8202
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8203
|
+
// `dropdown.focus` will move focus to the first focusable element in bib when it's open,
|
|
8204
|
+
// when bib it not open, it will focus onto trigger.
|
|
8205
|
+
this.dropdown.focus();
|
|
8206
|
+
} else {
|
|
8207
|
+
// when close button has the focus, move focus back to the trigger
|
|
8208
|
+
this.dropdown.trigger.focus();
|
|
8209
|
+
}
|
|
7952
8210
|
} else {
|
|
7953
8211
|
this.dropdown.hide();
|
|
7954
8212
|
}
|
|
7955
|
-
|
|
7956
8213
|
return;
|
|
7957
8214
|
}
|
|
7958
8215
|
|
|
@@ -8120,38 +8377,29 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8120
8377
|
this.configureDropdown();
|
|
8121
8378
|
this.configureMenu();
|
|
8122
8379
|
this.configureSelect();
|
|
8123
|
-
|
|
8124
|
-
// Set the initial value in auro-menu if defined
|
|
8125
|
-
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
8126
|
-
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
8127
|
-
if (this.menu) {
|
|
8128
|
-
this.menu.value = this.value;
|
|
8129
|
-
}
|
|
8130
|
-
}
|
|
8131
8380
|
}
|
|
8132
8381
|
|
|
8133
8382
|
/**
|
|
8134
8383
|
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8135
8384
|
* @param {string} value - The value to set in the menu.
|
|
8136
|
-
* @returns void
|
|
8385
|
+
* @returns {void}
|
|
8137
8386
|
* @private
|
|
8138
8387
|
*/
|
|
8139
8388
|
async updateMenuValue(value) {
|
|
8140
8389
|
if (!this.menu) return;
|
|
8141
8390
|
|
|
8391
|
+
this.menu.setAttribute('value', value);
|
|
8142
8392
|
this.menu.value = value;
|
|
8143
8393
|
await this.menu.updateComplete;
|
|
8144
8394
|
}
|
|
8145
8395
|
|
|
8146
8396
|
async updated(changedProperties) {
|
|
8147
|
-
if (changedProperties.has('multiSelect')) {
|
|
8397
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has('value')) {
|
|
8148
8398
|
this.clearSelection();
|
|
8149
8399
|
}
|
|
8150
8400
|
|
|
8151
8401
|
if (changedProperties.has('value')) {
|
|
8152
8402
|
if (this.value) {
|
|
8153
|
-
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
8154
|
-
|
|
8155
8403
|
await this.updateMenuValue(this.value);
|
|
8156
8404
|
|
|
8157
8405
|
if (this.menu) {
|
|
@@ -8177,7 +8425,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8177
8425
|
composed: true,
|
|
8178
8426
|
detail: {
|
|
8179
8427
|
optionSelected: this.optionSelected,
|
|
8180
|
-
value: this.
|
|
8428
|
+
value: this.formattedValue
|
|
8181
8429
|
}
|
|
8182
8430
|
}));
|
|
8183
8431
|
}
|
|
@@ -8236,13 +8484,13 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8236
8484
|
const selectedValue = selectedOption.value;
|
|
8237
8485
|
|
|
8238
8486
|
if (this.multiSelect) {
|
|
8239
|
-
const currentArray =
|
|
8487
|
+
const currentArray = this.formattedValue;
|
|
8240
8488
|
|
|
8241
8489
|
if (!currentArray.includes(selectedValue)) {
|
|
8242
|
-
this.value = [
|
|
8490
|
+
this.value = JSON.stringify([
|
|
8243
8491
|
...currentArray,
|
|
8244
8492
|
selectedValue
|
|
8245
|
-
];
|
|
8493
|
+
]);
|
|
8246
8494
|
}
|
|
8247
8495
|
} else {
|
|
8248
8496
|
const currentValue = this.value;
|
|
@@ -8265,12 +8513,17 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8265
8513
|
}
|
|
8266
8514
|
|
|
8267
8515
|
if (this.multiSelect) {
|
|
8268
|
-
nativeSelect.value = this.
|
|
8516
|
+
nativeSelect.value = this.multiSelect ? this.multiSelect[0] : '';
|
|
8269
8517
|
} else {
|
|
8270
8518
|
nativeSelect.value = this.value || '';
|
|
8271
8519
|
}
|
|
8272
8520
|
}
|
|
8273
8521
|
|
|
8522
|
+
/**
|
|
8523
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
8524
|
+
* @private
|
|
8525
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8526
|
+
*/
|
|
8274
8527
|
renderAriaHtml() {
|
|
8275
8528
|
return u`
|
|
8276
8529
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -8291,6 +8544,11 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8291
8544
|
`;
|
|
8292
8545
|
}
|
|
8293
8546
|
|
|
8547
|
+
/**
|
|
8548
|
+
* Returns HTML for the hidden HTML5 select.
|
|
8549
|
+
* @private
|
|
8550
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8551
|
+
*/
|
|
8294
8552
|
renderNativeSelect() {
|
|
8295
8553
|
return u`
|
|
8296
8554
|
<div class="nativeSelectWrapper util_displayHidden">
|
|
@@ -8337,7 +8595,7 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8337
8595
|
: u`
|
|
8338
8596
|
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8339
8597
|
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8340
|
-
|
|
8598
|
+
${this.errorMessage}
|
|
8341
8599
|
</p>
|
|
8342
8600
|
</${this.helpTextTag}>
|
|
8343
8601
|
`
|
|
@@ -8352,14 +8610,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8352
8610
|
*/
|
|
8353
8611
|
renderLayoutEmphasized() {
|
|
8354
8612
|
const placeholderClass = {
|
|
8355
|
-
|
|
8613
|
+
'util_displayHidden': this.value
|
|
8356
8614
|
};
|
|
8357
8615
|
|
|
8358
8616
|
const displayValueClasses = {
|
|
8359
8617
|
'displayValue': true,
|
|
8360
8618
|
'hasContent': this.hasDisplayValueContent,
|
|
8361
8619
|
'hasFocus': this.isPopoverVisible,
|
|
8362
|
-
'withValue': this.value && this.value.length > 0,
|
|
8620
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8363
8621
|
'force': this.forceDisplayValue,
|
|
8364
8622
|
};
|
|
8365
8623
|
|
|
@@ -8386,7 +8644,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8386
8644
|
.offset="${this.offset}"
|
|
8387
8645
|
.placement="${this.placement}"
|
|
8388
8646
|
chevron
|
|
8389
|
-
fluid
|
|
8390
8647
|
for="selectMenu"
|
|
8391
8648
|
layout="${this.layout}"
|
|
8392
8649
|
part="dropdown"
|
|
@@ -8403,11 +8660,9 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8403
8660
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8404
8661
|
</label>
|
|
8405
8662
|
<div class="value" id="value"></div>
|
|
8406
|
-
${
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
</div>
|
|
8410
|
-
`}
|
|
8663
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8664
|
+
${this.placeholder}
|
|
8665
|
+
</div>
|
|
8411
8666
|
</div>
|
|
8412
8667
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8413
8668
|
<slot name="displayValue"></slot>
|
|
@@ -8434,14 +8689,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8434
8689
|
*/
|
|
8435
8690
|
renderLayoutSnowflake() {
|
|
8436
8691
|
const placeholderClass = {
|
|
8437
|
-
|
|
8692
|
+
'util_displayHidden': this.value
|
|
8438
8693
|
};
|
|
8439
8694
|
|
|
8440
8695
|
const displayValueClasses = {
|
|
8441
8696
|
'displayValue': true,
|
|
8442
8697
|
'hasContent': this.hasDisplayValueContent,
|
|
8443
8698
|
'hasFocus': this.isPopoverVisible,
|
|
8444
|
-
'withValue': this.value && this.value.length > 0,
|
|
8699
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8445
8700
|
'force': this.forceDisplayValue,
|
|
8446
8701
|
};
|
|
8447
8702
|
|
|
@@ -8467,7 +8722,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8467
8722
|
.offset="${this.offset}"
|
|
8468
8723
|
.placement="${this.placement}"
|
|
8469
8724
|
chevron
|
|
8470
|
-
fluid
|
|
8471
8725
|
for="selectMenu"
|
|
8472
8726
|
layout="${this.layout}"
|
|
8473
8727
|
part="dropdown"
|
|
@@ -8484,11 +8738,9 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8484
8738
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8485
8739
|
</label>
|
|
8486
8740
|
<div class="value" id="value"></div>
|
|
8487
|
-
${
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
</div>
|
|
8491
|
-
`}
|
|
8741
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8742
|
+
${this.placeholder}
|
|
8743
|
+
</div>
|
|
8492
8744
|
</div>
|
|
8493
8745
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8494
8746
|
<slot name="displayValue"></slot>
|
|
@@ -8516,14 +8768,14 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8516
8768
|
*/
|
|
8517
8769
|
renderLayoutClassic() {
|
|
8518
8770
|
const placeholderClass = {
|
|
8519
|
-
|
|
8771
|
+
'util_displayHidden': this.value
|
|
8520
8772
|
};
|
|
8521
8773
|
|
|
8522
8774
|
const displayValueClasses = {
|
|
8523
8775
|
'displayValue': true,
|
|
8524
8776
|
'hasContent': this.hasDisplayValueContent,
|
|
8525
8777
|
'hasFocus': this.isPopoverVisible,
|
|
8526
|
-
'withValue': this.value && this.value.length > 0,
|
|
8778
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8527
8779
|
'force': this.forceDisplayValue,
|
|
8528
8780
|
};
|
|
8529
8781
|
|
|
@@ -8549,7 +8801,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8549
8801
|
.offset="${this.offset}"
|
|
8550
8802
|
.placement="${this.placement}"
|
|
8551
8803
|
chevron
|
|
8552
|
-
fluid
|
|
8553
8804
|
for="selectMenu"
|
|
8554
8805
|
layout="${this.layout}"
|
|
8555
8806
|
part="dropdown"
|
|
@@ -8566,11 +8817,9 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8566
8817
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8567
8818
|
</label>
|
|
8568
8819
|
<div class="value" id="value"></div>
|
|
8569
|
-
${
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
</div>
|
|
8573
|
-
`}
|
|
8820
|
+
<div id="placeholder" class="${e(placeholderClass)}">
|
|
8821
|
+
${this.placeholder}
|
|
8822
|
+
</div>
|
|
8574
8823
|
</div>
|
|
8575
8824
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8576
8825
|
<slot name="displayValue"></slot>
|
|
@@ -8620,106 +8869,6 @@ class AuroSelect extends AuroElement$4 {
|
|
|
8620
8869
|
|
|
8621
8870
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
8622
8871
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
8623
|
-
|
|
8624
|
-
// function that renders the HTML and CSS into the scope of the component
|
|
8625
|
-
renderBACKUP() {
|
|
8626
|
-
const placeholderClass = {
|
|
8627
|
-
hidden: this.value,
|
|
8628
|
-
};
|
|
8629
|
-
|
|
8630
|
-
return u`
|
|
8631
|
-
<div class="outerWrapper">
|
|
8632
|
-
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8633
|
-
${this.optionActive && this.options.length > 0
|
|
8634
|
-
? u`
|
|
8635
|
-
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8636
|
-
`
|
|
8637
|
-
: undefined
|
|
8638
|
-
};
|
|
8639
|
-
|
|
8640
|
-
${this.optionSelected && this.options.length > 0
|
|
8641
|
-
? u`
|
|
8642
|
-
${`${this.optionSelected.innerText} selected`}
|
|
8643
|
-
`
|
|
8644
|
-
: undefined
|
|
8645
|
-
};
|
|
8646
|
-
</div>
|
|
8647
|
-
<div id="slotHolder" aria-hidden="true">
|
|
8648
|
-
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8649
|
-
</div>
|
|
8650
|
-
<${this.dropdownTag}
|
|
8651
|
-
?autoPlacement="${this.autoPlacement}"
|
|
8652
|
-
?disabled="${this.disabled}"
|
|
8653
|
-
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8654
|
-
?matchWidth="${this.matchWidth}"
|
|
8655
|
-
?noFlip="${this.noFlip}"
|
|
8656
|
-
?onDark="${this.onDark}"
|
|
8657
|
-
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8658
|
-
.offset="${this.offset}"
|
|
8659
|
-
.placement="${this.placement}"
|
|
8660
|
-
chevron
|
|
8661
|
-
fluid
|
|
8662
|
-
for="selectMenu"
|
|
8663
|
-
layout="${this.layout}"
|
|
8664
|
-
part="dropdown"
|
|
8665
|
-
shape="${this.shape}"
|
|
8666
|
-
size="${this.size}">
|
|
8667
|
-
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
8668
|
-
<span id="placeholder"
|
|
8669
|
-
class="${e(placeholderClass)}"
|
|
8670
|
-
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
8671
|
-
>
|
|
8672
|
-
<slot name="placeholder"></slot>
|
|
8673
|
-
</span>
|
|
8674
|
-
<slot name="valueText" id="valueText"></slot>
|
|
8675
|
-
</span>
|
|
8676
|
-
|
|
8677
|
-
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8678
|
-
<slot></slot>
|
|
8679
|
-
</${this.bibtemplateTag}>
|
|
8680
|
-
<slot name="label" slot="label"></slot>
|
|
8681
|
-
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8682
|
-
<p slot="helpText">
|
|
8683
|
-
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
8684
|
-
? u`
|
|
8685
|
-
<span id="${this.uniqueId}" part="helpText">
|
|
8686
|
-
<slot name="helpText"></slot>
|
|
8687
|
-
</span>`
|
|
8688
|
-
: u`
|
|
8689
|
-
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8690
|
-
${this.errorMessage}
|
|
8691
|
-
</span>`
|
|
8692
|
-
}
|
|
8693
|
-
</p>
|
|
8694
|
-
</${this.dropdownTag}>
|
|
8695
|
-
<div class="nativeSelectWrapper">
|
|
8696
|
-
<select
|
|
8697
|
-
tabindex="-1"
|
|
8698
|
-
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
8699
|
-
name="${this.name || ''}"
|
|
8700
|
-
?disabled="${this.disabled}"
|
|
8701
|
-
?required="${this.required}"
|
|
8702
|
-
aria-hidden="true"
|
|
8703
|
-
autocomplete="${o(this.autocomplete)}"
|
|
8704
|
-
@change="${this._handleNativeSelectChange}">
|
|
8705
|
-
<option value="" ?selected="${!this.value}"></option>
|
|
8706
|
-
${this.options.map((option) => {
|
|
8707
|
-
const optionValue = option.value || option.textContent;
|
|
8708
|
-
return u`
|
|
8709
|
-
<option
|
|
8710
|
-
value="${optionValue}"
|
|
8711
|
-
?selected="${this.value === optionValue}">
|
|
8712
|
-
${option.textContent}
|
|
8713
|
-
</option>
|
|
8714
|
-
`;
|
|
8715
|
-
})}
|
|
8716
|
-
</select>
|
|
8717
|
-
</div>
|
|
8718
|
-
<!-- Help text and error message template -->
|
|
8719
|
-
${this.renderHtmlHelpText()}
|
|
8720
|
-
</div>
|
|
8721
|
-
`;
|
|
8722
|
-
}
|
|
8723
8872
|
}
|
|
8724
8873
|
|
|
8725
8874
|
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)}`;
|
|
@@ -8779,7 +8928,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
8779
8928
|
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
8780
8929
|
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
8781
8930
|
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
8782
|
-
* @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
|
|
8783
8931
|
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
8784
8932
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
8785
8933
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
@@ -8892,9 +9040,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
8892
9040
|
reflect: true,
|
|
8893
9041
|
attribute: 'multiselect'
|
|
8894
9042
|
},
|
|
9043
|
+
|
|
9044
|
+
/**
|
|
9045
|
+
* Value selected for the component.
|
|
9046
|
+
*/
|
|
8895
9047
|
value: {
|
|
8896
|
-
|
|
8897
|
-
|
|
9048
|
+
type: String,
|
|
9049
|
+
reflect: true,
|
|
9050
|
+
attribute: 'value'
|
|
8898
9051
|
},
|
|
8899
9052
|
|
|
8900
9053
|
/**
|
|
@@ -8929,6 +9082,25 @@ class AuroMenu extends AuroElement$4 {
|
|
|
8929
9082
|
AuroLibraryRuntimeUtils$6.prototype.registerComponent(name, AuroMenu);
|
|
8930
9083
|
}
|
|
8931
9084
|
|
|
9085
|
+
/**
|
|
9086
|
+
* Formatted value based on `multiSelect` state.
|
|
9087
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
9088
|
+
* @private
|
|
9089
|
+
* @returns {String|Array<String>}
|
|
9090
|
+
*/
|
|
9091
|
+
get formattedValue() {
|
|
9092
|
+
if (this.multiSelect) {
|
|
9093
|
+
if (!this.value) {
|
|
9094
|
+
return undefined;
|
|
9095
|
+
}
|
|
9096
|
+
if (this.value.startsWith("[")) {
|
|
9097
|
+
return JSON.parse(this.value);
|
|
9098
|
+
}
|
|
9099
|
+
return [this.value];
|
|
9100
|
+
}
|
|
9101
|
+
return this.value;
|
|
9102
|
+
}
|
|
9103
|
+
|
|
8932
9104
|
// Lifecycle Methods
|
|
8933
9105
|
|
|
8934
9106
|
connectedCallback() {
|
|
@@ -8971,7 +9143,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
8971
9143
|
updated(changedProperties) {
|
|
8972
9144
|
super.updated(changedProperties);
|
|
8973
9145
|
|
|
8974
|
-
if (changedProperties.has('multiSelect')) {
|
|
9146
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
|
|
8975
9147
|
// Reset selection if multiSelect mode changes
|
|
8976
9148
|
this.clearSelection();
|
|
8977
9149
|
}
|
|
@@ -8985,7 +9157,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
8985
9157
|
} else {
|
|
8986
9158
|
if (this.multiSelect) {
|
|
8987
9159
|
// In multiselect mode, this.value should be an array of strings
|
|
8988
|
-
const valueArray =
|
|
9160
|
+
const valueArray = this.formattedValue;
|
|
8989
9161
|
const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
|
|
8990
9162
|
|
|
8991
9163
|
this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
|
|
@@ -9152,14 +9324,14 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9152
9324
|
*/
|
|
9153
9325
|
handleSelectState(option) {
|
|
9154
9326
|
if (this.multiSelect) {
|
|
9155
|
-
const currentValue = this.
|
|
9327
|
+
const currentValue = this.formattedValue || [];
|
|
9156
9328
|
const currentSelected = this.optionSelected || [];
|
|
9157
9329
|
|
|
9158
9330
|
if (!currentValue.includes(option.value)) {
|
|
9159
|
-
this.value = [
|
|
9331
|
+
this.value = JSON.stringify([
|
|
9160
9332
|
...currentValue,
|
|
9161
9333
|
option.value
|
|
9162
|
-
];
|
|
9334
|
+
]);
|
|
9163
9335
|
}
|
|
9164
9336
|
if (!currentSelected.includes(option)) {
|
|
9165
9337
|
this.optionSelected = [
|
|
@@ -9182,13 +9354,15 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9182
9354
|
* @param {HTMLElement} option - The menuoption to be deselected.
|
|
9183
9355
|
*/
|
|
9184
9356
|
handleDeselectState(option) {
|
|
9185
|
-
if (this.multiSelect
|
|
9357
|
+
if (this.multiSelect) {
|
|
9186
9358
|
// Remove this option from array
|
|
9187
|
-
|
|
9359
|
+
const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
|
|
9188
9360
|
|
|
9189
9361
|
// If array is empty after removal, set back to undefined
|
|
9190
|
-
if (
|
|
9362
|
+
if (newFormattedValue && newFormattedValue.length === 0) {
|
|
9191
9363
|
this.value = undefined;
|
|
9364
|
+
} else {
|
|
9365
|
+
this.value = JSON.stringify(newFormattedValue);
|
|
9192
9366
|
}
|
|
9193
9367
|
|
|
9194
9368
|
this.optionSelected = this.optionSelected.filter((val) => val !== option);
|
|
@@ -9539,7 +9713,7 @@ class AuroMenu extends AuroElement$4 {
|
|
|
9539
9713
|
}
|
|
9540
9714
|
}
|
|
9541
9715
|
|
|
9542
|
-
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) +
|
|
9716
|
+
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}`;
|
|
9543
9717
|
|
|
9544
9718
|
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)}`;
|
|
9545
9719
|
|