@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
|
@@ -649,19 +649,19 @@ class AuroFormValidation {
|
|
|
649
649
|
{
|
|
650
650
|
check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
|
|
651
651
|
validity: 'tooShort',
|
|
652
|
-
message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
|
|
652
|
+
message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
|
|
653
653
|
},
|
|
654
654
|
{
|
|
655
655
|
check: (e) => e.value?.length > e.maxLength,
|
|
656
656
|
validity: 'tooLong',
|
|
657
|
-
message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
|
|
657
|
+
message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
|
|
658
658
|
}
|
|
659
659
|
],
|
|
660
660
|
pattern: [
|
|
661
661
|
{
|
|
662
662
|
check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
|
|
663
663
|
validity: 'patternMismatch',
|
|
664
|
-
message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
|
|
664
|
+
message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
|
|
665
665
|
}
|
|
666
666
|
]
|
|
667
667
|
},
|
|
@@ -856,10 +856,10 @@ class AuroFormValidation {
|
|
|
856
856
|
if (!hasValue && elem.required && elem.touched) {
|
|
857
857
|
elem.validity = 'valueMissing';
|
|
858
858
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
859
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
859
|
+
} else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
860
860
|
this.validateType(elem);
|
|
861
861
|
this.validateElementAttributes(elem);
|
|
862
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
862
|
+
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
863
863
|
this.validateElementAttributes(elem);
|
|
864
864
|
}
|
|
865
865
|
}
|
|
@@ -3228,6 +3228,267 @@ class AuroFloatingUI {
|
|
|
3228
3228
|
}
|
|
3229
3229
|
}
|
|
3230
3230
|
|
|
3231
|
+
// Selectors for focusable elements
|
|
3232
|
+
const FOCUSABLE_SELECTORS = [
|
|
3233
|
+
'a[href]',
|
|
3234
|
+
'button:not([disabled])',
|
|
3235
|
+
'textarea:not([disabled])',
|
|
3236
|
+
'input:not([disabled])',
|
|
3237
|
+
'select:not([disabled])',
|
|
3238
|
+
'[role="tab"]:not([disabled])',
|
|
3239
|
+
'[role="link"]:not([disabled])',
|
|
3240
|
+
'[role="button"]:not([disabled])',
|
|
3241
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
3242
|
+
'[contenteditable]:not([contenteditable="false"])'
|
|
3243
|
+
];
|
|
3244
|
+
|
|
3245
|
+
// List of custom components that are known to be focusable
|
|
3246
|
+
const FOCUSABLE_COMPONENTS = [
|
|
3247
|
+
'auro-checkbox',
|
|
3248
|
+
'auro-radio',
|
|
3249
|
+
'auro-dropdown',
|
|
3250
|
+
'auro-button',
|
|
3251
|
+
'auro-combobox',
|
|
3252
|
+
'auro-input',
|
|
3253
|
+
'auro-counter',
|
|
3254
|
+
'auro-menu',
|
|
3255
|
+
'auro-select',
|
|
3256
|
+
'auro-datepicker',
|
|
3257
|
+
'auro-hyperlink',
|
|
3258
|
+
'auro-accordion',
|
|
3259
|
+
];
|
|
3260
|
+
|
|
3261
|
+
/**
|
|
3262
|
+
* Determines if a given element is a custom focusable component.
|
|
3263
|
+
* Returns true if the element matches a known focusable component and is not disabled.
|
|
3264
|
+
*
|
|
3265
|
+
* @param {HTMLElement} element The element to check for focusability.
|
|
3266
|
+
* @returns {boolean} True if the element is a focusable custom component, false otherwise.
|
|
3267
|
+
*/
|
|
3268
|
+
function isFocusableComponent(element) {
|
|
3269
|
+
const componentName = element.tagName.toLowerCase();
|
|
3270
|
+
|
|
3271
|
+
// Guard Clause: Element is a focusable component
|
|
3272
|
+
if (!FOCUSABLE_COMPONENTS.some((name) => element.hasAttribute(name) || componentName === name)) return false;
|
|
3273
|
+
|
|
3274
|
+
// Guard Clause: Element is not disabled
|
|
3275
|
+
if (element.hasAttribute('disabled')) return false;
|
|
3276
|
+
|
|
3277
|
+
// Guard Clause: The element is a hyperlink and has no href attribute
|
|
3278
|
+
if (componentName.match("hyperlink") && !element.hasAttribute('href')) return false;
|
|
3279
|
+
|
|
3280
|
+
// If all guard clauses pass, the element is a focusable component
|
|
3281
|
+
return true;
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
/**
|
|
3285
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3286
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3287
|
+
*
|
|
3288
|
+
* @param {HTMLElement} container The container to search within
|
|
3289
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3290
|
+
*/
|
|
3291
|
+
function getFocusableElements(container) {
|
|
3292
|
+
// Get elements in DOM order by walking the tree
|
|
3293
|
+
const orderedFocusableElements = [];
|
|
3294
|
+
|
|
3295
|
+
// Define a recursive function to collect focusable elements in DOM order
|
|
3296
|
+
const collectFocusableElements = (root) => {
|
|
3297
|
+
// Check if current element is focusable
|
|
3298
|
+
if (root.nodeType === Node.ELEMENT_NODE) {
|
|
3299
|
+
// Check if this is a custom component that is focusable
|
|
3300
|
+
const isComponentFocusable = isFocusableComponent(root);
|
|
3301
|
+
|
|
3302
|
+
if (isComponentFocusable) {
|
|
3303
|
+
// Add the component itself as a focusable element and don't traverse its shadow DOM
|
|
3304
|
+
orderedFocusableElements.push(root);
|
|
3305
|
+
return; // Skip traversing inside this component
|
|
3306
|
+
}
|
|
3307
|
+
|
|
3308
|
+
// Check if the element itself matches any selector
|
|
3309
|
+
for (const selector of FOCUSABLE_SELECTORS) {
|
|
3310
|
+
if (root.matches?.(selector)) {
|
|
3311
|
+
orderedFocusableElements.push(root);
|
|
3312
|
+
break; // Once we know it's focusable, no need to check other selectors
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
|
|
3316
|
+
// Process shadow DOM only for non-Auro components
|
|
3317
|
+
if (root.shadowRoot) {
|
|
3318
|
+
// Process shadow DOM children in order
|
|
3319
|
+
if (root.shadowRoot.children) {
|
|
3320
|
+
Array.from(root.shadowRoot.children).forEach(child => {
|
|
3321
|
+
collectFocusableElements(child);
|
|
3322
|
+
});
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
|
|
3326
|
+
// Process slots and their assigned nodes in order
|
|
3327
|
+
if (root.tagName === 'SLOT') {
|
|
3328
|
+
const assignedNodes = root.assignedNodes({ flatten: true });
|
|
3329
|
+
for (const node of assignedNodes) {
|
|
3330
|
+
collectFocusableElements(node);
|
|
3331
|
+
}
|
|
3332
|
+
} else {
|
|
3333
|
+
// Process light DOM children in order
|
|
3334
|
+
if (root.children) {
|
|
3335
|
+
Array.from(root.children).forEach(child => {
|
|
3336
|
+
collectFocusableElements(child);
|
|
3337
|
+
});
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
};
|
|
3342
|
+
|
|
3343
|
+
// Start the traversal from the container
|
|
3344
|
+
collectFocusableElements(container);
|
|
3345
|
+
|
|
3346
|
+
// Remove duplicates that might have been collected through different paths
|
|
3347
|
+
// while preserving order
|
|
3348
|
+
const uniqueElements = [];
|
|
3349
|
+
const seen = new Set();
|
|
3350
|
+
|
|
3351
|
+
for (const element of orderedFocusableElements) {
|
|
3352
|
+
if (!seen.has(element)) {
|
|
3353
|
+
seen.add(element);
|
|
3354
|
+
uniqueElements.push(element);
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
|
|
3358
|
+
return uniqueElements;
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3361
|
+
/**
|
|
3362
|
+
* FocusTrap manages keyboard focus within a specified container element, ensuring that focus does not leave the container when tabbing.
|
|
3363
|
+
* It is commonly used for modal dialogs or overlays to improve accessibility by trapping focus within interactive UI components.
|
|
3364
|
+
*/
|
|
3365
|
+
class FocusTrap {
|
|
3366
|
+
/**
|
|
3367
|
+
* Creates a new FocusTrap instance for the given container element.
|
|
3368
|
+
* Initializes event listeners and prepares the container for focus management.
|
|
3369
|
+
*
|
|
3370
|
+
* @param {HTMLElement} container The DOM element to trap focus within.
|
|
3371
|
+
* @throws {Error} If the provided container is not a valid HTMLElement.
|
|
3372
|
+
*/
|
|
3373
|
+
constructor(container) {
|
|
3374
|
+
if (!container || !(container instanceof HTMLElement)) {
|
|
3375
|
+
throw new Error("FocusTrap requires a valid HTMLElement.");
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
this.container = container;
|
|
3379
|
+
this.tabDirection = 'forward'; // or 'backward'
|
|
3380
|
+
|
|
3381
|
+
this._init();
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
/**
|
|
3385
|
+
* Initializes the focus trap by setting up event listeners and attributes on the container.
|
|
3386
|
+
* Prepares the container for focus management, including support for shadow DOM and inert attributes.
|
|
3387
|
+
*
|
|
3388
|
+
* @private
|
|
3389
|
+
*/
|
|
3390
|
+
_init() {
|
|
3391
|
+
|
|
3392
|
+
// Add inert attribute to prevent focusing programmatically as well (if supported)
|
|
3393
|
+
if ('inert' in HTMLElement.prototype) {
|
|
3394
|
+
this.container.inert = false; // Ensure the container isn't inert
|
|
3395
|
+
this.container.setAttribute('data-focus-trap-container', true); // Mark for identification
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
// Track tab direction
|
|
3399
|
+
this.container.addEventListener('keydown', this._onKeydown);
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
/**
|
|
3403
|
+
* Handles keydown events to manage tab navigation within the container.
|
|
3404
|
+
* Ensures that focus wraps around when reaching the first or last focusable element.
|
|
3405
|
+
*
|
|
3406
|
+
* @param {KeyboardEvent} e The keyboard event triggered by user interaction.
|
|
3407
|
+
* @private
|
|
3408
|
+
*/
|
|
3409
|
+
_onKeydown = (e) => {
|
|
3410
|
+
|
|
3411
|
+
if (e.key === 'Tab') {
|
|
3412
|
+
|
|
3413
|
+
// Set the tab direction based on the key pressed
|
|
3414
|
+
this.tabDirection = e.shiftKey ? 'backward' : 'forward';
|
|
3415
|
+
|
|
3416
|
+
// Get the active element(s) in the document and shadow root
|
|
3417
|
+
// This will include the active element in the shadow DOM if it exists
|
|
3418
|
+
// Active element may be inside the shadow DOM depending on delegatesFocus, so we need to check both
|
|
3419
|
+
let activeElement = document.activeElement;
|
|
3420
|
+
const actives = [activeElement];
|
|
3421
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
3422
|
+
actives.push(activeElement.shadowRoot.activeElement);
|
|
3423
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
// Update the focusable elements
|
|
3427
|
+
const focusables = this._getFocusableElements();
|
|
3428
|
+
|
|
3429
|
+
// If we're at either end of the focusable elements, wrap around to the other end
|
|
3430
|
+
const focusIndex =
|
|
3431
|
+
(actives.includes(focusables[0]) || actives.includes(this.container)) && this.tabDirection === 'backward'
|
|
3432
|
+
? focusables.length - 1
|
|
3433
|
+
: actives.includes(focusables[focusables.length - 1]) && this.tabDirection === 'forward'
|
|
3434
|
+
? 0
|
|
3435
|
+
: null;
|
|
3436
|
+
|
|
3437
|
+
if (focusIndex !== null) {
|
|
3438
|
+
focusables[focusIndex].focus();
|
|
3439
|
+
e.preventDefault(); // Prevent default tab behavior
|
|
3440
|
+
e.stopPropagation(); // Stop the event from bubbling up
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
};
|
|
3444
|
+
|
|
3445
|
+
/**
|
|
3446
|
+
* Retrieves all focusable elements within the container in DOM order, including those in shadow DOM and slots.
|
|
3447
|
+
* Returns a unique, ordered array of elements that can receive focus.
|
|
3448
|
+
*
|
|
3449
|
+
* @returns {Array<HTMLElement>} An array of focusable elements within the container.
|
|
3450
|
+
* @private
|
|
3451
|
+
*/
|
|
3452
|
+
_getFocusableElements() {
|
|
3453
|
+
// Use the imported utility function to get focusable elements
|
|
3454
|
+
const elements = getFocusableElements(this.container);
|
|
3455
|
+
|
|
3456
|
+
// Filter out any elements with the 'focus-bookend' class
|
|
3457
|
+
return elements;
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3460
|
+
/**
|
|
3461
|
+
* Moves focus to the first focusable element within the container.
|
|
3462
|
+
* Useful for setting initial focus when activating the focus trap.
|
|
3463
|
+
*/
|
|
3464
|
+
focusFirstElement() {
|
|
3465
|
+
const focusables = this._getFocusableElements();
|
|
3466
|
+
if (focusables.length) focusables[0].focus();
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
/**
|
|
3470
|
+
* Moves focus to the last focusable element within the container.
|
|
3471
|
+
* Useful for setting focus when deactivating or cycling focus in reverse.
|
|
3472
|
+
*/
|
|
3473
|
+
focusLastElement() {
|
|
3474
|
+
const focusables = this._getFocusableElements();
|
|
3475
|
+
if (focusables.length) focusables[focusables.length - 1].focus();
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
/**
|
|
3479
|
+
* Removes event listeners and attributes added by the focus trap.
|
|
3480
|
+
* Call this method to clean up when the focus trap is no longer needed.
|
|
3481
|
+
*/
|
|
3482
|
+
disconnect() {
|
|
3483
|
+
|
|
3484
|
+
if (this.container.hasAttribute('data-focus-trap-container')) {
|
|
3485
|
+
this.container.removeAttribute('data-focus-trap-container');
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
this.container.removeEventListener('keydown', this._onKeydown);
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
|
|
3231
3492
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3232
3493
|
// See LICENSE in the project root for license information.
|
|
3233
3494
|
|
|
@@ -3665,11 +3926,11 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
3665
3926
|
|
|
3666
3927
|
var iconVersion$1 = '6.1.2';
|
|
3667
3928
|
|
|
3668
|
-
var styleCss$1$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){top:0;left:0
|
|
3929
|
+
var styleCss$1$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}`;
|
|
3669
3930
|
|
|
3670
3931
|
var colorCss$2$1 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3671
3932
|
|
|
3672
|
-
var tokensCss$1$1 = css`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-
|
|
3933
|
+
var tokensCss$1$1 = css`:host(:not([ondark])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
|
|
3673
3934
|
|
|
3674
3935
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
3675
3936
|
// See LICENSE in the project root for license information.
|
|
@@ -3829,17 +4090,6 @@ class AuroDropdownBib extends LitElement {
|
|
|
3829
4090
|
}
|
|
3830
4091
|
}
|
|
3831
4092
|
});
|
|
3832
|
-
|
|
3833
|
-
this.preventBodyScroll = this.preventBodyScroll.bind(this);
|
|
3834
|
-
this.addEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
3835
|
-
this.addEventListener('touchstart', this.preventBodyScroll, { passive: false });
|
|
3836
|
-
}
|
|
3837
|
-
|
|
3838
|
-
disconnectedCallback() {
|
|
3839
|
-
super.disconnectedCallback();
|
|
3840
|
-
|
|
3841
|
-
this.removeEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
3842
|
-
this.removeEventListener('touchstart', this.preventBodyScroll, { passive: false });
|
|
3843
4093
|
}
|
|
3844
4094
|
|
|
3845
4095
|
firstUpdated(changedProperties) {
|
|
@@ -3855,19 +4105,6 @@ class AuroDropdownBib extends LitElement {
|
|
|
3855
4105
|
}));
|
|
3856
4106
|
}
|
|
3857
4107
|
|
|
3858
|
-
/**
|
|
3859
|
-
* Prevents scrolling of the body when touching empty areas of the component.
|
|
3860
|
-
* @param {Event} event - The touchmove event.
|
|
3861
|
-
* @returns {void}
|
|
3862
|
-
*/
|
|
3863
|
-
preventBodyScroll(event) {
|
|
3864
|
-
// when touchmove/touchstart on empty space
|
|
3865
|
-
if (event.target === this) {
|
|
3866
|
-
event.preventDefault();
|
|
3867
|
-
event.stopImmediatePropagation();
|
|
3868
|
-
}
|
|
3869
|
-
}
|
|
3870
|
-
|
|
3871
4108
|
// function that renders the HTML and CSS into the scope of the component
|
|
3872
4109
|
render() {
|
|
3873
4110
|
const classes = {
|
|
@@ -3890,19 +4127,19 @@ var dropdownVersion$1 = '3.0.0';
|
|
|
3890
4127
|
|
|
3891
4128
|
var shapeSizeCss = css`.wrapper{overflow:hidden}.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:58px;max-height:58px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
3892
4129
|
|
|
3893
|
-
var colorCss$1$1 = css`:host .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus,:host(:not([ondark])) .wrapper:
|
|
4130
|
+
var colorCss$1$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([ondark])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:focus-within,:host(:not([ondark])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([onDark])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([ondark])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]) .label{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:focus-within,:host([onDark]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([ondark][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}`;
|
|
3894
4131
|
|
|
3895
|
-
var classicColorCss = css
|
|
4132
|
+
var classicColorCss = css``;
|
|
3896
4133
|
|
|
3897
|
-
var classicLayoutCss = css`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .
|
|
4134
|
+
var classicLayoutCss = css`:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) .label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}@media(hover: hover){:host([layout*=classic]) .wrapper:hover{cursor:pointer}}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
3898
4135
|
|
|
3899
|
-
var styleEmphasizedCss = css`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex-direction:row
|
|
4136
|
+
var styleEmphasizedCss = css`:host{display:block}.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3900
4137
|
|
|
3901
|
-
var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex-direction:row
|
|
4138
|
+
var styleSnowflakeCss = css`:host{display:block}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([layout*=snowflake]) .leftIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}.layout-snowflake .chevron,.layout-snowflake-left .chevron,.layout-snowflake-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3902
4139
|
|
|
3903
4140
|
var colorCss$5 = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
3904
4141
|
|
|
3905
|
-
var styleCss$6 = css
|
|
4142
|
+
var styleCss$6 = css`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
3906
4143
|
|
|
3907
4144
|
var tokensCss$4 = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
3908
4145
|
|
|
@@ -4207,10 +4444,8 @@ let AuroElement$2 = class AuroElement extends LitElement {
|
|
|
4207
4444
|
// See LICENSE in the project root for license information.
|
|
4208
4445
|
|
|
4209
4446
|
|
|
4210
|
-
|
|
4211
|
-
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
4447
|
+
/*
|
|
4212
4448
|
* @slot - Default slot for the popover content.
|
|
4213
|
-
* @slot label - Defines the content of the label.
|
|
4214
4449
|
* @slot helpText - Defines the content of the helpText.
|
|
4215
4450
|
* @slot trigger - Defines the content of the trigger.
|
|
4216
4451
|
* @csspart trigger - The trigger content container.
|
|
@@ -4229,18 +4464,22 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4229
4464
|
this.matchWidth = false;
|
|
4230
4465
|
this.noHideOnThisFocusLoss = false;
|
|
4231
4466
|
|
|
4232
|
-
this.errorMessage =
|
|
4467
|
+
this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
|
|
4233
4468
|
|
|
4234
4469
|
// Layout Config
|
|
4235
|
-
this.layout =
|
|
4236
|
-
this.shape =
|
|
4237
|
-
this.size =
|
|
4470
|
+
this.layout = undefined;
|
|
4471
|
+
this.shape = undefined;
|
|
4472
|
+
this.size = undefined;
|
|
4238
4473
|
|
|
4239
4474
|
this.parentBorder = false;
|
|
4240
4475
|
|
|
4241
4476
|
this.privateDefaults();
|
|
4242
4477
|
}
|
|
4243
4478
|
|
|
4479
|
+
/**
|
|
4480
|
+
* @private
|
|
4481
|
+
* @returns {object} Class definition for the wrapper element.
|
|
4482
|
+
*/
|
|
4244
4483
|
get commonWrapperClasses() {
|
|
4245
4484
|
return {
|
|
4246
4485
|
'trigger': true,
|
|
@@ -4258,13 +4497,10 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4258
4497
|
privateDefaults() {
|
|
4259
4498
|
this.chevron = false;
|
|
4260
4499
|
this.disabled = false;
|
|
4500
|
+
this.disableFocusTrap = false;
|
|
4261
4501
|
this.error = false;
|
|
4262
|
-
this.inset = false;
|
|
4263
|
-
this.rounded = false;
|
|
4264
4502
|
this.tabIndex = 0;
|
|
4265
4503
|
this.noToggle = false;
|
|
4266
|
-
this.a11yAutocomplete = 'none';
|
|
4267
|
-
this.labeled = true;
|
|
4268
4504
|
this.a11yRole = 'button';
|
|
4269
4505
|
this.onDark = false;
|
|
4270
4506
|
this.showTriggerBorders = true;
|
|
@@ -4360,6 +4596,18 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4360
4596
|
this.floater.showBib();
|
|
4361
4597
|
}
|
|
4362
4598
|
|
|
4599
|
+
/**
|
|
4600
|
+
* When bib is open, focus on the first element inside of bib.
|
|
4601
|
+
* If not, trigger element will get focus.
|
|
4602
|
+
*/
|
|
4603
|
+
focus() {
|
|
4604
|
+
if (this.isPopoverVisible && this.focusTrap) {
|
|
4605
|
+
this.focusTrap.focusFirstElement();
|
|
4606
|
+
} else {
|
|
4607
|
+
this.trigger.focus();
|
|
4608
|
+
}
|
|
4609
|
+
}
|
|
4610
|
+
|
|
4363
4611
|
// function to define props used within the scope of this component
|
|
4364
4612
|
static get properties() {
|
|
4365
4613
|
return {
|
|
@@ -4373,6 +4621,15 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4373
4621
|
reflect: true
|
|
4374
4622
|
},
|
|
4375
4623
|
|
|
4624
|
+
/**
|
|
4625
|
+
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4626
|
+
* @default false
|
|
4627
|
+
*/
|
|
4628
|
+
disableEventShow: {
|
|
4629
|
+
type: Boolean,
|
|
4630
|
+
reflect: true
|
|
4631
|
+
},
|
|
4632
|
+
|
|
4376
4633
|
/**
|
|
4377
4634
|
* If declared, applies a border around the trigger slot.
|
|
4378
4635
|
*/
|
|
@@ -4391,17 +4648,17 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4391
4648
|
},
|
|
4392
4649
|
|
|
4393
4650
|
/**
|
|
4394
|
-
* If declared, the dropdown
|
|
4651
|
+
* If declared, the dropdown is not interactive.
|
|
4395
4652
|
*/
|
|
4396
|
-
|
|
4653
|
+
disabled: {
|
|
4397
4654
|
type: Boolean,
|
|
4398
4655
|
reflect: true
|
|
4399
4656
|
},
|
|
4400
4657
|
|
|
4401
4658
|
/**
|
|
4402
|
-
* If declared, the
|
|
4659
|
+
* If declared, the focus trap inside of bib will be turned off.
|
|
4403
4660
|
*/
|
|
4404
|
-
|
|
4661
|
+
disableFocusTrap: {
|
|
4405
4662
|
type: Boolean,
|
|
4406
4663
|
reflect: true
|
|
4407
4664
|
},
|
|
@@ -4446,22 +4703,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4446
4703
|
reflect: true
|
|
4447
4704
|
},
|
|
4448
4705
|
|
|
4449
|
-
/**
|
|
4450
|
-
* Makes the trigger to be full width of its parent container.
|
|
4451
|
-
*/
|
|
4452
|
-
fluid: {
|
|
4453
|
-
type: Boolean,
|
|
4454
|
-
reflect: true
|
|
4455
|
-
},
|
|
4456
|
-
|
|
4457
|
-
/**
|
|
4458
|
-
* If declared, will apply padding around trigger slot content.
|
|
4459
|
-
*/
|
|
4460
|
-
inset: {
|
|
4461
|
-
type: Boolean,
|
|
4462
|
-
reflect: true
|
|
4463
|
-
},
|
|
4464
|
-
|
|
4465
4706
|
/**
|
|
4466
4707
|
* If true, the dropdown bib is displayed.
|
|
4467
4708
|
*/
|
|
@@ -4505,15 +4746,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4505
4746
|
reflect: true
|
|
4506
4747
|
},
|
|
4507
4748
|
|
|
4508
|
-
/**
|
|
4509
|
-
* Defines if there is a label preset.
|
|
4510
|
-
* @private
|
|
4511
|
-
*/
|
|
4512
|
-
labeled: {
|
|
4513
|
-
type: Boolean,
|
|
4514
|
-
reflect: true
|
|
4515
|
-
},
|
|
4516
|
-
|
|
4517
4749
|
/**
|
|
4518
4750
|
* Defines if the trigger should size based on the parent element providing the border UI.
|
|
4519
4751
|
* @private
|
|
@@ -4574,6 +4806,9 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4574
4806
|
reflect: true
|
|
4575
4807
|
},
|
|
4576
4808
|
|
|
4809
|
+
/**
|
|
4810
|
+
* If declared, and a function is set, that function will execute when the slot content is updated.
|
|
4811
|
+
*/
|
|
4577
4812
|
onSlotChange: {
|
|
4578
4813
|
type: Function,
|
|
4579
4814
|
reflect: false
|
|
@@ -4588,14 +4823,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4588
4823
|
reflect: true
|
|
4589
4824
|
},
|
|
4590
4825
|
|
|
4591
|
-
/**
|
|
4592
|
-
* If declared, will apply border-radius to trigger and default slots.
|
|
4593
|
-
*/
|
|
4594
|
-
rounded: {
|
|
4595
|
-
type: Boolean,
|
|
4596
|
-
reflect: true
|
|
4597
|
-
},
|
|
4598
|
-
|
|
4599
4826
|
/**
|
|
4600
4827
|
* @private
|
|
4601
4828
|
*/
|
|
@@ -4610,22 +4837,14 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4610
4837
|
type: String || undefined,
|
|
4611
4838
|
attribute: false,
|
|
4612
4839
|
reflect: false
|
|
4613
|
-
},
|
|
4614
|
-
|
|
4615
|
-
/**
|
|
4616
|
-
* The value for the aria-autocomplete attribute of the trigger element.
|
|
4617
|
-
*/
|
|
4618
|
-
a11yAutocomplete: {
|
|
4619
|
-
type: String,
|
|
4620
|
-
attribute: false,
|
|
4621
4840
|
}
|
|
4622
4841
|
};
|
|
4623
4842
|
}
|
|
4624
4843
|
|
|
4625
4844
|
static get styles() {
|
|
4626
4845
|
return [
|
|
4627
|
-
colorCss$1$1,
|
|
4628
4846
|
tokensCss$1$1,
|
|
4847
|
+
colorCss$1$1,
|
|
4629
4848
|
|
|
4630
4849
|
// default layout
|
|
4631
4850
|
classicColorCss,
|
|
@@ -4688,6 +4907,12 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4688
4907
|
this.handleTriggerContentSlotChange();
|
|
4689
4908
|
}
|
|
4690
4909
|
|
|
4910
|
+
if (changedProperties.has('isPopoverVisible')) {
|
|
4911
|
+
this.updateFocusTrap();
|
|
4912
|
+
if (!this.isPopoverVisible && this.hasFocus) {
|
|
4913
|
+
this.trigger.focus();
|
|
4914
|
+
}
|
|
4915
|
+
}
|
|
4691
4916
|
}
|
|
4692
4917
|
|
|
4693
4918
|
firstUpdated() {
|
|
@@ -4708,9 +4933,6 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4708
4933
|
}
|
|
4709
4934
|
|
|
4710
4935
|
this.bibContent = this.floater.element.bib;
|
|
4711
|
-
this.bibContent.setAttribute('role', 'dialog');
|
|
4712
|
-
this.bibContent.setAttribute('aria-modal', 'true');
|
|
4713
|
-
this.bibContent.setAttribute('aria-labelledby', 'triggerLabel');
|
|
4714
4936
|
|
|
4715
4937
|
// Add the tag name as an attribute if it is different than the component name
|
|
4716
4938
|
this.runtimeUtils.handleComponentTagRename(this, 'auro-dropdown');
|
|
@@ -4756,6 +4978,27 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
4756
4978
|
this.hasFocus = true;
|
|
4757
4979
|
}
|
|
4758
4980
|
|
|
4981
|
+
/**
|
|
4982
|
+
* @private
|
|
4983
|
+
*/
|
|
4984
|
+
updateFocusTrap() {
|
|
4985
|
+
// If the dropdown is open, create a focus trap and focus the first element
|
|
4986
|
+
if (this.isPopoverVisible && !this.disableFocusTrap) {
|
|
4987
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4988
|
+
this.focusTrap.focusFirstElement();
|
|
4989
|
+
return;
|
|
4990
|
+
}
|
|
4991
|
+
|
|
4992
|
+
// Guard Clause: Ensure there is a focus trap currently active before continuing
|
|
4993
|
+
if (!this.focusTrap) {
|
|
4994
|
+
return;
|
|
4995
|
+
}
|
|
4996
|
+
|
|
4997
|
+
// If the dropdown is not open, disconnect the focus trap if it exists
|
|
4998
|
+
this.focusTrap.disconnect();
|
|
4999
|
+
this.focusTrap = undefined;
|
|
5000
|
+
}
|
|
5001
|
+
|
|
4759
5002
|
/**
|
|
4760
5003
|
* Function to support @focusout event.
|
|
4761
5004
|
* @private
|
|
@@ -5041,10 +5284,7 @@ class AuroDropdown extends AuroElement$2 {
|
|
|
5041
5284
|
id="bib"
|
|
5042
5285
|
shape="${this.shape}"
|
|
5043
5286
|
?data-show="${this.isPopoverVisible}"
|
|
5044
|
-
?isfullscreen="${this.isBibFullscreen}"
|
|
5045
|
-
?common="${this.common}"
|
|
5046
|
-
?rounded="${this.common || this.rounded}"
|
|
5047
|
-
?inset="${this.common || this.inset}">
|
|
5287
|
+
?isfullscreen="${this.isBibFullscreen}">
|
|
5048
5288
|
<div class="slotContent">
|
|
5049
5289
|
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
5050
5290
|
</div>
|
|
@@ -6970,6 +7210,30 @@ class AuroBibtemplate extends LitElement {
|
|
|
6970
7210
|
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroBibtemplate);
|
|
6971
7211
|
}
|
|
6972
7212
|
|
|
7213
|
+
/**
|
|
7214
|
+
* Prevents scrolling of the body when touching empty areas of the component.
|
|
7215
|
+
* @param {Event} event - The touchmove event.
|
|
7216
|
+
* @returns {void}
|
|
7217
|
+
*/
|
|
7218
|
+
preventBodyScroll(event) {
|
|
7219
|
+
if (event.target === this) {
|
|
7220
|
+
event.preventDefault();
|
|
7221
|
+
}
|
|
7222
|
+
}
|
|
7223
|
+
|
|
7224
|
+
connectedCallback() {
|
|
7225
|
+
super.connectedCallback();
|
|
7226
|
+
|
|
7227
|
+
this.preventBodyScroll = this.preventBodyScroll.bind(this);
|
|
7228
|
+
this.addEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
7229
|
+
}
|
|
7230
|
+
|
|
7231
|
+
disconnectedCallback() {
|
|
7232
|
+
super.disconnectedCallback();
|
|
7233
|
+
|
|
7234
|
+
this.removeEventListener('touchmove', this.preventBodyScroll, { passive: false });
|
|
7235
|
+
}
|
|
7236
|
+
|
|
6973
7237
|
onCloseButtonClick() {
|
|
6974
7238
|
this.dispatchEvent(new Event("close-click", { bubbles: true,
|
|
6975
7239
|
composed: true }));
|
|
@@ -7001,7 +7265,7 @@ class AuroBibtemplate extends LitElement {
|
|
|
7001
7265
|
<div id="bibTemplate" part="bibtemplate">
|
|
7002
7266
|
${this.isFullscreen ? html`
|
|
7003
7267
|
<div id="headerContainer">
|
|
7004
|
-
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
7268
|
+
<${this.buttonTag} id="closeButton" aria-label="Close" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
7005
7269
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
7006
7270
|
</${this.buttonTag}>
|
|
7007
7271
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
@@ -7029,7 +7293,7 @@ var bibTemplateVersion = '1.0.0';
|
|
|
7029
7293
|
|
|
7030
7294
|
var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
|
|
7031
7295
|
|
|
7032
|
-
var styleCss$1 = css
|
|
7296
|
+
var styleCss$1 = css`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
|
|
7033
7297
|
|
|
7034
7298
|
var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
|
|
7035
7299
|
|
|
@@ -7235,68 +7499,7 @@ class AuroHelpText extends LitElement {
|
|
|
7235
7499
|
|
|
7236
7500
|
var helpTextVersion = '1.0.0';
|
|
7237
7501
|
|
|
7238
|
-
css
|
|
7239
|
-
|
|
7240
|
-
css`: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)}`;
|
|
7241
|
-
|
|
7242
|
-
css`: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)}`;
|
|
7243
|
-
|
|
7244
|
-
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7245
|
-
// See LICENSE in the project root for license information.
|
|
7246
|
-
|
|
7247
|
-
// ---------------------------------------------------------------------
|
|
7248
|
-
|
|
7249
|
-
/**
|
|
7250
|
-
* Converts value to an array.
|
|
7251
|
-
* If the value is a JSON string representing an array, it will be parsed.
|
|
7252
|
-
* If the value is already an array, it is returned.
|
|
7253
|
-
* If the value is undefined, it returns undefined.
|
|
7254
|
-
* @private
|
|
7255
|
-
* @param {any} value - The value to be converted. Can be a string, array, or undefined.
|
|
7256
|
-
* @returns {Array|undefined} - The converted array or undefined.
|
|
7257
|
-
* @throws {Error} - Throws an error if the value is not an array, undefined,
|
|
7258
|
-
* or if the value cannot be parsed into an array from a JSON string.
|
|
7259
|
-
*/
|
|
7260
|
-
function arrayConverter(value) {
|
|
7261
|
-
// Allow undefined
|
|
7262
|
-
if (value === undefined) {
|
|
7263
|
-
return undefined;
|
|
7264
|
-
}
|
|
7265
|
-
|
|
7266
|
-
// Return the value if it is already an array
|
|
7267
|
-
if (Array.isArray(value)) {
|
|
7268
|
-
return value;
|
|
7269
|
-
}
|
|
7270
|
-
|
|
7271
|
-
try {
|
|
7272
|
-
// If value is a JSON string, parse it
|
|
7273
|
-
const parsed = typeof value === 'string' ? JSON.parse(value) : value;
|
|
7274
|
-
|
|
7275
|
-
// Check if the parsed value is an array
|
|
7276
|
-
if (Array.isArray(parsed)) {
|
|
7277
|
-
return parsed;
|
|
7278
|
-
}
|
|
7279
|
-
} catch (error) {
|
|
7280
|
-
// If JSON parsing fails, continue to throw an error below
|
|
7281
|
-
/* eslint-disable no-console */
|
|
7282
|
-
console.error('JSON parsing failed:', error);
|
|
7283
|
-
}
|
|
7284
|
-
|
|
7285
|
-
// Throw error if the input is not an array or undefined
|
|
7286
|
-
throw new Error('Invalid value: Input must be an array or undefined');
|
|
7287
|
-
}
|
|
7288
|
-
|
|
7289
|
-
css`: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}`;
|
|
7290
|
-
|
|
7291
|
-
css`: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)}`;
|
|
7292
|
-
|
|
7293
|
-
css`: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}`;
|
|
7294
|
-
|
|
7295
|
-
css`: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)}`;
|
|
7296
|
-
|
|
7297
|
-
css`: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)}`;
|
|
7298
|
-
|
|
7299
|
-
var styleCss = css`.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}`;
|
|
7502
|
+
var styleCss = css`.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}`;
|
|
7300
7503
|
|
|
7301
7504
|
// Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
7302
7505
|
// See LICENSE in the project root for license information.
|
|
@@ -7311,7 +7514,6 @@ var styleCss = css`.util_displayInline{display:inline}.util_displayInlineBlock{d
|
|
|
7311
7514
|
* @slot label - Defines the content of the label.
|
|
7312
7515
|
* @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
|
|
7313
7516
|
* @slot helpText - Defines the content of the helpText.
|
|
7314
|
-
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
7315
7517
|
* @slot valueText - Dropdown value text display.
|
|
7316
7518
|
* @slot displayValue - Allows custom HTML content to display the selected value when select is not focused.
|
|
7317
7519
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
@@ -7581,6 +7783,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7581
7783
|
reflect: true
|
|
7582
7784
|
},
|
|
7583
7785
|
|
|
7786
|
+
/**
|
|
7787
|
+
* Define custom placeholder text.
|
|
7788
|
+
*/
|
|
7789
|
+
placeholder: {
|
|
7790
|
+
type: String,
|
|
7791
|
+
reflect: true
|
|
7792
|
+
},
|
|
7793
|
+
|
|
7584
7794
|
/**
|
|
7585
7795
|
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
7586
7796
|
*/
|
|
@@ -7627,11 +7837,12 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7627
7837
|
},
|
|
7628
7838
|
|
|
7629
7839
|
/**
|
|
7630
|
-
* Value selected for the component.
|
|
7631
|
-
* @type {String|Array<String>}
|
|
7840
|
+
* Value selected for the component.
|
|
7632
7841
|
*/
|
|
7633
7842
|
value: {
|
|
7634
|
-
type:
|
|
7843
|
+
type: String,
|
|
7844
|
+
reflect: true,
|
|
7845
|
+
attribute: 'value'
|
|
7635
7846
|
},
|
|
7636
7847
|
|
|
7637
7848
|
/**
|
|
@@ -7683,6 +7894,25 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7683
7894
|
];
|
|
7684
7895
|
}
|
|
7685
7896
|
|
|
7897
|
+
/**
|
|
7898
|
+
* Formatted value based on `multiSelect` state.
|
|
7899
|
+
* Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
|
|
7900
|
+
* @private
|
|
7901
|
+
* @returns {String|Array<String>}
|
|
7902
|
+
*/
|
|
7903
|
+
get formattedValue() {
|
|
7904
|
+
if (this.multiSelect) {
|
|
7905
|
+
if (!this.value) {
|
|
7906
|
+
return undefined;
|
|
7907
|
+
}
|
|
7908
|
+
if (this.value.startsWith("[")) {
|
|
7909
|
+
return JSON.parse(this.value);
|
|
7910
|
+
}
|
|
7911
|
+
return [this.value];
|
|
7912
|
+
}
|
|
7913
|
+
return this.value;
|
|
7914
|
+
}
|
|
7915
|
+
|
|
7686
7916
|
/**
|
|
7687
7917
|
* Returns classmap configuration for html5 input labels in all layouts.
|
|
7688
7918
|
* @private
|
|
@@ -7691,7 +7921,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7691
7921
|
get commonLabelClasses() {
|
|
7692
7922
|
return {
|
|
7693
7923
|
'is-disabled': this.disabled,
|
|
7694
|
-
'withValue': this.value && this.value.length > 0,
|
|
7924
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
7695
7925
|
'util_displayHiddenVisually': this.hasDisplayValueContent && !this.hasFocus && this.value && this.value.length > 0
|
|
7696
7926
|
};
|
|
7697
7927
|
}
|
|
@@ -7717,6 +7947,21 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7717
7947
|
|
|
7718
7948
|
this.dropdown.addEventListener('auroDropdown-toggled', () => {
|
|
7719
7949
|
this.isPopoverVisible = this.dropdown.isPopoverVisible;
|
|
7950
|
+
|
|
7951
|
+
if (this.dropdown.isPopoverVisible) {
|
|
7952
|
+
// wait til the bib gets fully rendered
|
|
7953
|
+
setTimeout(() => {
|
|
7954
|
+
if (this.dropdown.isBibFullscreen) {
|
|
7955
|
+
// trigger holds the focus since menu is not a focusable element.
|
|
7956
|
+
this.dropdown.trigger.focus();
|
|
7957
|
+
|
|
7958
|
+
// default focus indicator on the first menu option
|
|
7959
|
+
if (this.menu.index < 0) {
|
|
7960
|
+
this.menu.navigateOptions('down');
|
|
7961
|
+
}
|
|
7962
|
+
}
|
|
7963
|
+
});
|
|
7964
|
+
}
|
|
7720
7965
|
});
|
|
7721
7966
|
|
|
7722
7967
|
// setting up bibtemplate
|
|
@@ -7867,46 +8112,58 @@ class AuroSelect extends AuroElement$3 {
|
|
|
7867
8112
|
configureSelect() {
|
|
7868
8113
|
|
|
7869
8114
|
this.addEventListener('keydown', (evt) => {
|
|
7870
|
-
|
|
7871
|
-
|
|
8115
|
+
// when the focus is on trigger not on close button
|
|
8116
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8117
|
+
if (evt.key === 'ArrowUp') {
|
|
8118
|
+
evt.preventDefault();
|
|
7872
8119
|
|
|
7873
|
-
|
|
8120
|
+
this.dropdown.show();
|
|
7874
8121
|
|
|
7875
|
-
|
|
7876
|
-
|
|
8122
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8123
|
+
this.menu.navigateOptions('up');
|
|
8124
|
+
}
|
|
8125
|
+
|
|
8126
|
+
return;
|
|
7877
8127
|
}
|
|
7878
8128
|
|
|
7879
|
-
|
|
7880
|
-
|
|
8129
|
+
if (evt.key === 'ArrowDown') {
|
|
8130
|
+
evt.preventDefault();
|
|
7881
8131
|
|
|
7882
|
-
|
|
7883
|
-
evt.preventDefault();
|
|
8132
|
+
this.dropdown.show();
|
|
7884
8133
|
|
|
7885
|
-
|
|
8134
|
+
if (this.dropdown.isPopoverVisible) {
|
|
8135
|
+
this.menu.navigateOptions('down');
|
|
8136
|
+
}
|
|
7886
8137
|
|
|
7887
|
-
|
|
7888
|
-
this.menu.navigateOptions('down');
|
|
8138
|
+
return;
|
|
7889
8139
|
}
|
|
7890
8140
|
|
|
7891
|
-
|
|
7892
|
-
|
|
8141
|
+
if (evt.key === 'Enter') {
|
|
8142
|
+
if (!this.dropdown.isPopoverVisible) {
|
|
8143
|
+
evt.preventDefault();
|
|
8144
|
+
this.menu.makeSelection();
|
|
8145
|
+
}
|
|
7893
8146
|
|
|
7894
|
-
|
|
7895
|
-
if (!this.dropdown.isPopoverVisible) {
|
|
7896
|
-
evt.preventDefault();
|
|
7897
|
-
this.menu.makeSelection();
|
|
8147
|
+
return;
|
|
7898
8148
|
}
|
|
7899
|
-
|
|
7900
|
-
return;
|
|
7901
8149
|
}
|
|
7902
8150
|
|
|
7903
|
-
if (evt.key === 'Tab') {
|
|
8151
|
+
if (evt.key === 'Tab' && this.dropdown.isPopoverVisible) {
|
|
7904
8152
|
if (this.dropdown.isBibFullscreen) {
|
|
7905
8153
|
evt.preventDefault();
|
|
8154
|
+
|
|
8155
|
+
// when the focus is on trigger not on close button
|
|
8156
|
+
if (this.dropdown.shadowRoot.activeElement === this.dropdown.trigger) {
|
|
8157
|
+
// `dropdown.focus` will move focus to the first focusable element in bib when it's open,
|
|
8158
|
+
// when bib it not open, it will focus onto trigger.
|
|
8159
|
+
this.dropdown.focus();
|
|
8160
|
+
} else {
|
|
8161
|
+
// when close button has the focus, move focus back to the trigger
|
|
8162
|
+
this.dropdown.trigger.focus();
|
|
8163
|
+
}
|
|
7906
8164
|
} else {
|
|
7907
8165
|
this.dropdown.hide();
|
|
7908
8166
|
}
|
|
7909
|
-
|
|
7910
8167
|
return;
|
|
7911
8168
|
}
|
|
7912
8169
|
|
|
@@ -8074,38 +8331,29 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8074
8331
|
this.configureDropdown();
|
|
8075
8332
|
this.configureMenu();
|
|
8076
8333
|
this.configureSelect();
|
|
8077
|
-
|
|
8078
|
-
// Set the initial value in auro-menu if defined
|
|
8079
|
-
if (this.hasAttribute('value') && this.getAttribute('value').length > 0) {
|
|
8080
|
-
this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
|
|
8081
|
-
if (this.menu) {
|
|
8082
|
-
this.menu.value = this.value;
|
|
8083
|
-
}
|
|
8084
|
-
}
|
|
8085
8334
|
}
|
|
8086
8335
|
|
|
8087
8336
|
/**
|
|
8088
8337
|
* Update the menu value. With checks for menu existence. Awaits value update.
|
|
8089
8338
|
* @param {string} value - The value to set in the menu.
|
|
8090
|
-
* @returns void
|
|
8339
|
+
* @returns {void}
|
|
8091
8340
|
* @private
|
|
8092
8341
|
*/
|
|
8093
8342
|
async updateMenuValue(value) {
|
|
8094
8343
|
if (!this.menu) return;
|
|
8095
8344
|
|
|
8345
|
+
this.menu.setAttribute('value', value);
|
|
8096
8346
|
this.menu.value = value;
|
|
8097
8347
|
await this.menu.updateComplete;
|
|
8098
8348
|
}
|
|
8099
8349
|
|
|
8100
8350
|
async updated(changedProperties) {
|
|
8101
|
-
if (changedProperties.has('multiSelect')) {
|
|
8351
|
+
if (changedProperties.has('multiSelect') && !changedProperties.has('value')) {
|
|
8102
8352
|
this.clearSelection();
|
|
8103
8353
|
}
|
|
8104
8354
|
|
|
8105
8355
|
if (changedProperties.has('value')) {
|
|
8106
8356
|
if (this.value) {
|
|
8107
|
-
this.value = this.multiSelect ? arrayConverter(this.value) : this.value;
|
|
8108
|
-
|
|
8109
8357
|
await this.updateMenuValue(this.value);
|
|
8110
8358
|
|
|
8111
8359
|
if (this.menu) {
|
|
@@ -8131,7 +8379,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8131
8379
|
composed: true,
|
|
8132
8380
|
detail: {
|
|
8133
8381
|
optionSelected: this.optionSelected,
|
|
8134
|
-
value: this.
|
|
8382
|
+
value: this.formattedValue
|
|
8135
8383
|
}
|
|
8136
8384
|
}));
|
|
8137
8385
|
}
|
|
@@ -8190,13 +8438,13 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8190
8438
|
const selectedValue = selectedOption.value;
|
|
8191
8439
|
|
|
8192
8440
|
if (this.multiSelect) {
|
|
8193
|
-
const currentArray =
|
|
8441
|
+
const currentArray = this.formattedValue;
|
|
8194
8442
|
|
|
8195
8443
|
if (!currentArray.includes(selectedValue)) {
|
|
8196
|
-
this.value = [
|
|
8444
|
+
this.value = JSON.stringify([
|
|
8197
8445
|
...currentArray,
|
|
8198
8446
|
selectedValue
|
|
8199
|
-
];
|
|
8447
|
+
]);
|
|
8200
8448
|
}
|
|
8201
8449
|
} else {
|
|
8202
8450
|
const currentValue = this.value;
|
|
@@ -8219,12 +8467,17 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8219
8467
|
}
|
|
8220
8468
|
|
|
8221
8469
|
if (this.multiSelect) {
|
|
8222
|
-
nativeSelect.value = this.
|
|
8470
|
+
nativeSelect.value = this.multiSelect ? this.multiSelect[0] : '';
|
|
8223
8471
|
} else {
|
|
8224
8472
|
nativeSelect.value = this.value || '';
|
|
8225
8473
|
}
|
|
8226
8474
|
}
|
|
8227
8475
|
|
|
8476
|
+
/**
|
|
8477
|
+
* Returns HTML for the hidden a11y screen reader content.
|
|
8478
|
+
* @private
|
|
8479
|
+
* @returns {html} - Returns HTML for the hidden a11y screen reader content.
|
|
8480
|
+
*/
|
|
8228
8481
|
renderAriaHtml() {
|
|
8229
8482
|
return html`
|
|
8230
8483
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -8245,6 +8498,11 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8245
8498
|
`;
|
|
8246
8499
|
}
|
|
8247
8500
|
|
|
8501
|
+
/**
|
|
8502
|
+
* Returns HTML for the hidden HTML5 select.
|
|
8503
|
+
* @private
|
|
8504
|
+
* @returns {html} - Returns HTML for the hidden HTML5 select.
|
|
8505
|
+
*/
|
|
8248
8506
|
renderNativeSelect() {
|
|
8249
8507
|
return html`
|
|
8250
8508
|
<div class="nativeSelectWrapper util_displayHidden">
|
|
@@ -8291,7 +8549,7 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8291
8549
|
: html`
|
|
8292
8550
|
<${this.helpTextTag} error ?onDark="${this.onDark}">
|
|
8293
8551
|
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8294
|
-
|
|
8552
|
+
${this.errorMessage}
|
|
8295
8553
|
</p>
|
|
8296
8554
|
</${this.helpTextTag}>
|
|
8297
8555
|
`
|
|
@@ -8306,14 +8564,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8306
8564
|
*/
|
|
8307
8565
|
renderLayoutEmphasized() {
|
|
8308
8566
|
const placeholderClass = {
|
|
8309
|
-
|
|
8567
|
+
'util_displayHidden': this.value
|
|
8310
8568
|
};
|
|
8311
8569
|
|
|
8312
8570
|
const displayValueClasses = {
|
|
8313
8571
|
'displayValue': true,
|
|
8314
8572
|
'hasContent': this.hasDisplayValueContent,
|
|
8315
8573
|
'hasFocus': this.isPopoverVisible,
|
|
8316
|
-
'withValue': this.value && this.value.length > 0,
|
|
8574
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8317
8575
|
'force': this.forceDisplayValue,
|
|
8318
8576
|
};
|
|
8319
8577
|
|
|
@@ -8340,7 +8598,6 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8340
8598
|
.offset="${this.offset}"
|
|
8341
8599
|
.placement="${this.placement}"
|
|
8342
8600
|
chevron
|
|
8343
|
-
fluid
|
|
8344
8601
|
for="selectMenu"
|
|
8345
8602
|
layout="${this.layout}"
|
|
8346
8603
|
part="dropdown"
|
|
@@ -8357,11 +8614,9 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8357
8614
|
${this.required ? undefined : html`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8358
8615
|
</label>
|
|
8359
8616
|
<div class="value" id="value"></div>
|
|
8360
|
-
${
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
</div>
|
|
8364
|
-
`}
|
|
8617
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8618
|
+
${this.placeholder}
|
|
8619
|
+
</div>
|
|
8365
8620
|
</div>
|
|
8366
8621
|
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8367
8622
|
<slot name="displayValue"></slot>
|
|
@@ -8388,14 +8643,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8388
8643
|
*/
|
|
8389
8644
|
renderLayoutSnowflake() {
|
|
8390
8645
|
const placeholderClass = {
|
|
8391
|
-
|
|
8646
|
+
'util_displayHidden': this.value
|
|
8392
8647
|
};
|
|
8393
8648
|
|
|
8394
8649
|
const displayValueClasses = {
|
|
8395
8650
|
'displayValue': true,
|
|
8396
8651
|
'hasContent': this.hasDisplayValueContent,
|
|
8397
8652
|
'hasFocus': this.isPopoverVisible,
|
|
8398
|
-
'withValue': this.value && this.value.length > 0,
|
|
8653
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8399
8654
|
'force': this.forceDisplayValue,
|
|
8400
8655
|
};
|
|
8401
8656
|
|
|
@@ -8421,7 +8676,6 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8421
8676
|
.offset="${this.offset}"
|
|
8422
8677
|
.placement="${this.placement}"
|
|
8423
8678
|
chevron
|
|
8424
|
-
fluid
|
|
8425
8679
|
for="selectMenu"
|
|
8426
8680
|
layout="${this.layout}"
|
|
8427
8681
|
part="dropdown"
|
|
@@ -8438,11 +8692,9 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8438
8692
|
${this.required ? undefined : html`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8439
8693
|
</label>
|
|
8440
8694
|
<div class="value" id="value"></div>
|
|
8441
|
-
${
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
</div>
|
|
8445
|
-
`}
|
|
8695
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8696
|
+
${this.placeholder}
|
|
8697
|
+
</div>
|
|
8446
8698
|
</div>
|
|
8447
8699
|
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8448
8700
|
<slot name="displayValue"></slot>
|
|
@@ -8470,14 +8722,14 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8470
8722
|
*/
|
|
8471
8723
|
renderLayoutClassic() {
|
|
8472
8724
|
const placeholderClass = {
|
|
8473
|
-
|
|
8725
|
+
'util_displayHidden': this.value
|
|
8474
8726
|
};
|
|
8475
8727
|
|
|
8476
8728
|
const displayValueClasses = {
|
|
8477
8729
|
'displayValue': true,
|
|
8478
8730
|
'hasContent': this.hasDisplayValueContent,
|
|
8479
8731
|
'hasFocus': this.isPopoverVisible,
|
|
8480
|
-
'withValue': this.value && this.value.length > 0,
|
|
8732
|
+
'withValue': this.placeholder || (this.value && this.value.length > 0), // eslint-disable-line no-extra-parens
|
|
8481
8733
|
'force': this.forceDisplayValue,
|
|
8482
8734
|
};
|
|
8483
8735
|
|
|
@@ -8503,7 +8755,6 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8503
8755
|
.offset="${this.offset}"
|
|
8504
8756
|
.placement="${this.placement}"
|
|
8505
8757
|
chevron
|
|
8506
|
-
fluid
|
|
8507
8758
|
for="selectMenu"
|
|
8508
8759
|
layout="${this.layout}"
|
|
8509
8760
|
part="dropdown"
|
|
@@ -8520,11 +8771,9 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8520
8771
|
${this.required ? undefined : html`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8521
8772
|
</label>
|
|
8522
8773
|
<div class="value" id="value"></div>
|
|
8523
|
-
${
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
</div>
|
|
8527
|
-
`}
|
|
8774
|
+
<div id="placeholder" class="${classMap(placeholderClass)}">
|
|
8775
|
+
${this.placeholder}
|
|
8776
|
+
</div>
|
|
8528
8777
|
</div>
|
|
8529
8778
|
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8530
8779
|
<slot name="displayValue"></slot>
|
|
@@ -8574,106 +8823,6 @@ class AuroSelect extends AuroElement$3 {
|
|
|
8574
8823
|
|
|
8575
8824
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
8576
8825
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
8577
|
-
|
|
8578
|
-
// function that renders the HTML and CSS into the scope of the component
|
|
8579
|
-
renderBACKUP() {
|
|
8580
|
-
const placeholderClass = {
|
|
8581
|
-
hidden: this.value,
|
|
8582
|
-
};
|
|
8583
|
-
|
|
8584
|
-
return html`
|
|
8585
|
-
<div class="outerWrapper">
|
|
8586
|
-
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
8587
|
-
${this.optionActive && this.options.length > 0
|
|
8588
|
-
? html`
|
|
8589
|
-
${`${this.optionActive.innerText}, option ${this.options.indexOf(this.optionActive) + 1} of ${this.options.length}`}
|
|
8590
|
-
`
|
|
8591
|
-
: undefined
|
|
8592
|
-
};
|
|
8593
|
-
|
|
8594
|
-
${this.optionSelected && this.options.length > 0
|
|
8595
|
-
? html`
|
|
8596
|
-
${`${this.optionSelected.innerText} selected`}
|
|
8597
|
-
`
|
|
8598
|
-
: undefined
|
|
8599
|
-
};
|
|
8600
|
-
</div>
|
|
8601
|
-
<div id="slotHolder" aria-hidden="true">
|
|
8602
|
-
<slot name="bib.fullscreen.headline" @slotchange="${this.handleSlotChange}"></slot>
|
|
8603
|
-
</div>
|
|
8604
|
-
<${this.dropdownTag}
|
|
8605
|
-
?autoPlacement="${this.autoPlacement}"
|
|
8606
|
-
?disabled="${this.disabled}"
|
|
8607
|
-
?error="${this.validity !== undefined && this.validity !== 'valid'}"
|
|
8608
|
-
?matchWidth="${this.matchWidth}"
|
|
8609
|
-
?noFlip="${this.noFlip}"
|
|
8610
|
-
?onDark="${this.onDark}"
|
|
8611
|
-
.fullscreenBreakpoint="${this.fullscreenBreakpoint}"
|
|
8612
|
-
.offset="${this.offset}"
|
|
8613
|
-
.placement="${this.placement}"
|
|
8614
|
-
chevron
|
|
8615
|
-
fluid
|
|
8616
|
-
for="selectMenu"
|
|
8617
|
-
layout="${this.layout}"
|
|
8618
|
-
part="dropdown"
|
|
8619
|
-
shape="${this.shape}"
|
|
8620
|
-
size="${this.size}">
|
|
8621
|
-
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
8622
|
-
<span id="placeholder"
|
|
8623
|
-
class="${classMap(placeholderClass)}"
|
|
8624
|
-
?aria-hidden="${this.optionSelected && this.optionSelected.length ? 'true' : false}"
|
|
8625
|
-
>
|
|
8626
|
-
<slot name="placeholder"></slot>
|
|
8627
|
-
</span>
|
|
8628
|
-
<slot name="valueText" id="valueText"></slot>
|
|
8629
|
-
</span>
|
|
8630
|
-
|
|
8631
|
-
<${this.bibtemplateTag} ?large="${this.largeFullscreenHeadline}" @close-click="${this.hideBib}">
|
|
8632
|
-
<slot></slot>
|
|
8633
|
-
</${this.bibtemplateTag}>
|
|
8634
|
-
<slot name="label" slot="label"></slot>
|
|
8635
|
-
${this.required ? undefined : html`<slot name="optionalLabel"> (optional)</slot>`}
|
|
8636
|
-
<p slot="helpText">
|
|
8637
|
-
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
8638
|
-
? html`
|
|
8639
|
-
<span id="${this.uniqueId}" part="helpText">
|
|
8640
|
-
<slot name="helpText"></slot>
|
|
8641
|
-
</span>`
|
|
8642
|
-
: html`
|
|
8643
|
-
<span id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
8644
|
-
${this.errorMessage}
|
|
8645
|
-
</span>`
|
|
8646
|
-
}
|
|
8647
|
-
</p>
|
|
8648
|
-
</${this.dropdownTag}>
|
|
8649
|
-
<div class="nativeSelectWrapper">
|
|
8650
|
-
<select
|
|
8651
|
-
tabindex="-1"
|
|
8652
|
-
id="${`native-select-${this.id || this.uniqueId}`}"
|
|
8653
|
-
name="${this.name || ''}"
|
|
8654
|
-
?disabled="${this.disabled}"
|
|
8655
|
-
?required="${this.required}"
|
|
8656
|
-
aria-hidden="true"
|
|
8657
|
-
autocomplete="${ifDefined$1(this.autocomplete)}"
|
|
8658
|
-
@change="${this._handleNativeSelectChange}">
|
|
8659
|
-
<option value="" ?selected="${!this.value}"></option>
|
|
8660
|
-
${this.options.map((option) => {
|
|
8661
|
-
const optionValue = option.value || option.textContent;
|
|
8662
|
-
return html`
|
|
8663
|
-
<option
|
|
8664
|
-
value="${optionValue}"
|
|
8665
|
-
?selected="${this.value === optionValue}">
|
|
8666
|
-
${option.textContent}
|
|
8667
|
-
</option>
|
|
8668
|
-
`;
|
|
8669
|
-
})}
|
|
8670
|
-
</select>
|
|
8671
|
-
</div>
|
|
8672
|
-
<!-- Help text and error message template -->
|
|
8673
|
-
${this.renderHtmlHelpText()}
|
|
8674
|
-
</div>
|
|
8675
|
-
`;
|
|
8676
|
-
}
|
|
8677
8826
|
}
|
|
8678
8827
|
|
|
8679
8828
|
AuroSelect.register();
|