@aurodesignsystem/auro-formkit 4.0.0 → 4.0.2
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/CHANGELOG.md +2 -23
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +1 -0
- package/components/bibtemplate/dist/index.js +158 -6
- package/components/bibtemplate/dist/registered.js +158 -6
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.md +2 -2
- package/components/checkbox/demo/api.min.js +24 -20
- package/components/checkbox/demo/index.md +2 -2
- package/components/checkbox/demo/index.min.js +24 -20
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox.d.ts +2 -2
- package/components/checkbox/dist/index.js +24 -20
- package/components/checkbox/dist/registered.js +24 -20
- package/components/combobox/demo/api.min.js +707 -133
- package/components/combobox/demo/index.min.js +707 -133
- package/components/combobox/dist/auro-combobox.d.ts +0 -8
- package/components/combobox/dist/index.js +627 -123
- package/components/combobox/dist/registered.js +627 -123
- package/components/counter/demo/api.min.js +583 -43
- package/components/counter/demo/index.min.js +583 -43
- package/components/counter/dist/index.js +583 -43
- package/components/counter/dist/registered.js +583 -43
- package/components/datepicker/demo/api.min.js +866 -75
- package/components/datepicker/demo/index.min.js +866 -75
- package/components/datepicker/dist/index.js +866 -75
- package/components/datepicker/dist/registered.js +866 -75
- package/components/dropdown/demo/api.min.js +153 -16
- package/components/dropdown/demo/index.min.js +153 -16
- package/components/dropdown/dist/auro-dropdownBib.d.ts +8 -0
- package/components/dropdown/dist/index.js +153 -16
- package/components/dropdown/dist/registered.js +153 -16
- package/components/input/demo/api.min.js +263 -12
- package/components/input/demo/index.min.js +263 -12
- package/components/input/dist/index.js +263 -12
- package/components/input/dist/registered.js +263 -12
- package/components/menu/demo/api.min.js +76 -6
- package/components/menu/demo/index.min.js +76 -6
- package/components/menu/dist/index.js +76 -6
- package/components/menu/dist/registered.js +76 -6
- package/components/radio/demo/api.min.js +4 -3
- package/components/radio/demo/index.min.js +4 -3
- package/components/radio/dist/index.js +4 -3
- package/components/radio/dist/registered.js +4 -3
- package/components/select/demo/api.min.js +403 -49
- package/components/select/demo/index.min.js +403 -49
- package/components/select/dist/auro-select.d.ts +0 -1
- package/components/select/dist/index.js +325 -41
- package/components/select/dist/registered.js +325 -41
- package/package.json +3 -3
|
@@ -63,7 +63,7 @@ const t$1=globalThis,e$3=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.na
|
|
|
63
63
|
|
|
64
64
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
65
65
|
|
|
66
|
-
let AuroLibraryRuntimeUtils$
|
|
66
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
67
67
|
|
|
68
68
|
/* eslint-disable jsdoc/require-param */
|
|
69
69
|
|
|
@@ -1658,8 +1658,28 @@ class AuroFloatingUI {
|
|
|
1658
1658
|
if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
|
|
1659
1659
|
AuroFloatingUI.isMousePressHandlerInitialized = true;
|
|
1660
1660
|
|
|
1661
|
+
// Track timeout for isMousePressed reset to avoid race conditions
|
|
1662
|
+
if (!AuroFloatingUI._mousePressedTimeout) {
|
|
1663
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
1664
|
+
}
|
|
1661
1665
|
const mouseEventGlobalHandler = (event) => {
|
|
1662
|
-
|
|
1666
|
+
const isPressed = event.type === 'mousedown';
|
|
1667
|
+
if (isPressed) {
|
|
1668
|
+
// Clear any pending timeout to prevent race condition
|
|
1669
|
+
if (AuroFloatingUI._mousePressedTimeout !== null) {
|
|
1670
|
+
clearTimeout(AuroFloatingUI._mousePressedTimeout);
|
|
1671
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
1672
|
+
}
|
|
1673
|
+
if (!AuroFloatingUI.isMousePressed) {
|
|
1674
|
+
AuroFloatingUI.isMousePressed = true;
|
|
1675
|
+
}
|
|
1676
|
+
} else if (AuroFloatingUI.isMousePressed && !isPressed) {
|
|
1677
|
+
// Schedule reset and track timeout ID
|
|
1678
|
+
AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
|
|
1679
|
+
AuroFloatingUI.isMousePressed = false;
|
|
1680
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
1681
|
+
}, 0);
|
|
1682
|
+
}
|
|
1663
1683
|
};
|
|
1664
1684
|
|
|
1665
1685
|
window.addEventListener('mousedown', mouseEventGlobalHandler);
|
|
@@ -1786,6 +1806,7 @@ class AuroFloatingUI {
|
|
|
1786
1806
|
|
|
1787
1807
|
// Compute the position of the bib
|
|
1788
1808
|
computePosition(this.element.trigger, this.element.bib, {
|
|
1809
|
+
strategy: this.element.floaterConfig?.strategy || 'fixed',
|
|
1789
1810
|
placement: this.element.floaterConfig?.placement,
|
|
1790
1811
|
middleware: middleware || []
|
|
1791
1812
|
}).then(({ x, y }) => { // eslint-disable-line id-length
|
|
@@ -1920,8 +1941,9 @@ class AuroFloatingUI {
|
|
|
1920
1941
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
1921
1942
|
return;
|
|
1922
1943
|
}
|
|
1923
|
-
|
|
1924
|
-
if
|
|
1944
|
+
|
|
1945
|
+
// if fullscreen bib is in fullscreen mode, do not close
|
|
1946
|
+
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
1925
1947
|
return;
|
|
1926
1948
|
}
|
|
1927
1949
|
|
|
@@ -2222,8 +2244,6 @@ class AuroFloatingUI {
|
|
|
2222
2244
|
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
2223
2245
|
}
|
|
2224
2246
|
|
|
2225
|
-
document.body.append(this.element.bib);
|
|
2226
|
-
|
|
2227
2247
|
this.regenerateBibId();
|
|
2228
2248
|
this.handleTriggerTabIndex();
|
|
2229
2249
|
|
|
@@ -2473,6 +2493,76 @@ var tokensCss$2 = i$3`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-d
|
|
|
2473
2493
|
|
|
2474
2494
|
var colorCss$3 = i$3`: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)}`;
|
|
2475
2495
|
|
|
2496
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2497
|
+
// See LICENSE in the project root for license information.
|
|
2498
|
+
|
|
2499
|
+
// ---------------------------------------------------------------------
|
|
2500
|
+
|
|
2501
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
2502
|
+
|
|
2503
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
2504
|
+
|
|
2505
|
+
/* eslint-disable jsdoc/require-param */
|
|
2506
|
+
|
|
2507
|
+
/**
|
|
2508
|
+
* This will register a new custom element with the browser.
|
|
2509
|
+
* @param {String} name - The name of the custom element.
|
|
2510
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
2511
|
+
* @returns {void}
|
|
2512
|
+
*/
|
|
2513
|
+
registerComponent(name, componentClass) {
|
|
2514
|
+
if (!customElements.get(name)) {
|
|
2515
|
+
customElements.define(name, class extends componentClass {});
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
2521
|
+
* @returns {void}
|
|
2522
|
+
*/
|
|
2523
|
+
closestElement(
|
|
2524
|
+
selector, // selector like in .closest()
|
|
2525
|
+
base = this, // extra functionality to skip a parent
|
|
2526
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
2527
|
+
!el || el === document || el === window
|
|
2528
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
2529
|
+
: found
|
|
2530
|
+
? found // found a selector INside this element
|
|
2531
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
2532
|
+
) {
|
|
2533
|
+
return __Closest(base);
|
|
2534
|
+
}
|
|
2535
|
+
/* eslint-enable jsdoc/require-param */
|
|
2536
|
+
|
|
2537
|
+
/**
|
|
2538
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
2539
|
+
* @param {Object} elem - The element to check.
|
|
2540
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
2541
|
+
* @returns {void}
|
|
2542
|
+
*/
|
|
2543
|
+
handleComponentTagRename(elem, tagName) {
|
|
2544
|
+
const tag = tagName.toLowerCase();
|
|
2545
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
2546
|
+
|
|
2547
|
+
if (elemTag !== tag) {
|
|
2548
|
+
elem.setAttribute(tag, true);
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
/**
|
|
2553
|
+
* Validates if an element is a specific Auro component.
|
|
2554
|
+
* @param {Object} elem - The element to validate.
|
|
2555
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
2556
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
2557
|
+
*/
|
|
2558
|
+
elementMatch(elem, tagName) {
|
|
2559
|
+
const tag = tagName.toLowerCase();
|
|
2560
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
2561
|
+
|
|
2562
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
2563
|
+
}
|
|
2564
|
+
};
|
|
2565
|
+
|
|
2476
2566
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2477
2567
|
// See LICENSE in the project root for license information.
|
|
2478
2568
|
|
|
@@ -2642,7 +2732,7 @@ class AuroIcon extends BaseIcon {
|
|
|
2642
2732
|
|
|
2643
2733
|
var iconVersion = '6.1.2';
|
|
2644
2734
|
|
|
2645
|
-
var styleCss$2 = i$3`:host{position:
|
|
2735
|
+
var styleCss$2 = i$3`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}: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}`;
|
|
2646
2736
|
|
|
2647
2737
|
var colorCss$2 = i$3`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2648
2738
|
|
|
@@ -2652,7 +2742,6 @@ var tokensCss$1 = i$3`:host{--ds-auro-dropdown-label-text-color: var(--ds-basic-
|
|
|
2652
2742
|
// See LICENSE in the project root for license information.
|
|
2653
2743
|
|
|
2654
2744
|
|
|
2655
|
-
|
|
2656
2745
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
2657
2746
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
2658
2747
|
'xl',
|
|
@@ -2677,7 +2766,7 @@ class AuroDropdownBib extends i$1 {
|
|
|
2677
2766
|
*/
|
|
2678
2767
|
this._mobileBreakpointValue = undefined;
|
|
2679
2768
|
|
|
2680
|
-
AuroLibraryRuntimeUtils$
|
|
2769
|
+
AuroLibraryRuntimeUtils$2.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
2681
2770
|
}
|
|
2682
2771
|
|
|
2683
2772
|
static get styles() {
|
|
@@ -2722,6 +2811,13 @@ class AuroDropdownBib extends i$1 {
|
|
|
2722
2811
|
type: Boolean,
|
|
2723
2812
|
reflect: true
|
|
2724
2813
|
},
|
|
2814
|
+
|
|
2815
|
+
/**
|
|
2816
|
+
* A reference to the associated bib template element.
|
|
2817
|
+
*/
|
|
2818
|
+
bibTemplate: {
|
|
2819
|
+
type: Object
|
|
2820
|
+
}
|
|
2725
2821
|
};
|
|
2726
2822
|
}
|
|
2727
2823
|
|
|
@@ -2754,9 +2850,50 @@ class AuroDropdownBib extends i$1 {
|
|
|
2754
2850
|
}
|
|
2755
2851
|
}
|
|
2756
2852
|
});
|
|
2853
|
+
|
|
2854
|
+
if (this.bibTemplate) {
|
|
2855
|
+
// If the bib template is found, set the fullscreen attribute
|
|
2856
|
+
if (this.isFullscreen) {
|
|
2857
|
+
this.bibTemplate.setAttribute('isFullscreen', 'true');
|
|
2858
|
+
} else {
|
|
2859
|
+
this.bibTemplate.removeAttribute('isFullscreen');
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2757
2862
|
}
|
|
2758
2863
|
}
|
|
2759
2864
|
|
|
2865
|
+
connectedCallback() {
|
|
2866
|
+
super.connectedCallback();
|
|
2867
|
+
|
|
2868
|
+
// Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
|
|
2869
|
+
this.addEventListener('auro-bibtemplate-connected', (event) => {
|
|
2870
|
+
const bibTemplate = event.detail.element;
|
|
2871
|
+
this.bibTemplate = bibTemplate;
|
|
2872
|
+
|
|
2873
|
+
if (bibTemplate) {
|
|
2874
|
+
// If the bib template is found, set the fullscreen attribute
|
|
2875
|
+
if (this.isFullscreen) {
|
|
2876
|
+
bibTemplate.setAttribute('isFullscreen', 'true');
|
|
2877
|
+
} else {
|
|
2878
|
+
bibTemplate.removeAttribute('isFullscreen');
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
firstUpdated(changedProperties) {
|
|
2885
|
+
super.firstUpdated(changedProperties);
|
|
2886
|
+
|
|
2887
|
+
// Dispatch a custom event when the component is connected
|
|
2888
|
+
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
2889
|
+
bubbles: true,
|
|
2890
|
+
composed: true,
|
|
2891
|
+
detail: {
|
|
2892
|
+
element: this
|
|
2893
|
+
}
|
|
2894
|
+
}));
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2760
2897
|
// function that renders the HTML and CSS into the scope of the component
|
|
2761
2898
|
render() {
|
|
2762
2899
|
return u$1`
|
|
@@ -3066,7 +3203,7 @@ class AuroDropdown extends i$1 {
|
|
|
3066
3203
|
/**
|
|
3067
3204
|
* @private
|
|
3068
3205
|
*/
|
|
3069
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
3206
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
3070
3207
|
|
|
3071
3208
|
/**
|
|
3072
3209
|
* @private
|
|
@@ -3395,7 +3532,7 @@ class AuroDropdown extends i$1 {
|
|
|
3395
3532
|
*
|
|
3396
3533
|
*/
|
|
3397
3534
|
static register(name = "auro-dropdown") {
|
|
3398
|
-
AuroLibraryRuntimeUtils$
|
|
3535
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroDropdown);
|
|
3399
3536
|
}
|
|
3400
3537
|
|
|
3401
3538
|
/**
|
|
@@ -3712,8 +3849,7 @@ class AuroDropdown extends i$1 {
|
|
|
3712
3849
|
* @param {Event} event - The event object representing the slot change.
|
|
3713
3850
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
3714
3851
|
*/
|
|
3715
|
-
handleDefaultSlot(
|
|
3716
|
-
[...event.target.assignedNodes()].forEach((node) => this.bibContent.append(node));
|
|
3852
|
+
handleDefaultSlot() {
|
|
3717
3853
|
|
|
3718
3854
|
if (this.onSlotChange) {
|
|
3719
3855
|
this.onSlotChange();
|
|
@@ -3785,9 +3921,7 @@ class AuroDropdown extends i$1 {
|
|
|
3785
3921
|
<${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
|
|
3786
3922
|
<slot name="helpText"></slot>
|
|
3787
3923
|
</${this.helpTextTag}>
|
|
3788
|
-
|
|
3789
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
3790
|
-
</div>
|
|
3924
|
+
|
|
3791
3925
|
<div id="bibSizer" part="size"></div>
|
|
3792
3926
|
<${this.dropdownBibTag}
|
|
3793
3927
|
id="bib"
|
|
@@ -3797,6 +3931,9 @@ class AuroDropdown extends i$1 {
|
|
|
3797
3931
|
?rounded="${this.common || this.rounded}"
|
|
3798
3932
|
?inset="${this.common || this.inset}"
|
|
3799
3933
|
>
|
|
3934
|
+
<div class="slotContent">
|
|
3935
|
+
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
3936
|
+
</div>
|
|
3800
3937
|
</${this.dropdownBibTag}>
|
|
3801
3938
|
</div>
|
|
3802
3939
|
`;
|
|
@@ -38,7 +38,7 @@ const t$1=globalThis,e$3=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.na
|
|
|
38
38
|
|
|
39
39
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
40
40
|
|
|
41
|
-
let AuroLibraryRuntimeUtils$
|
|
41
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
42
42
|
|
|
43
43
|
/* eslint-disable jsdoc/require-param */
|
|
44
44
|
|
|
@@ -1633,8 +1633,28 @@ class AuroFloatingUI {
|
|
|
1633
1633
|
if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
|
|
1634
1634
|
AuroFloatingUI.isMousePressHandlerInitialized = true;
|
|
1635
1635
|
|
|
1636
|
+
// Track timeout for isMousePressed reset to avoid race conditions
|
|
1637
|
+
if (!AuroFloatingUI._mousePressedTimeout) {
|
|
1638
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
1639
|
+
}
|
|
1636
1640
|
const mouseEventGlobalHandler = (event) => {
|
|
1637
|
-
|
|
1641
|
+
const isPressed = event.type === 'mousedown';
|
|
1642
|
+
if (isPressed) {
|
|
1643
|
+
// Clear any pending timeout to prevent race condition
|
|
1644
|
+
if (AuroFloatingUI._mousePressedTimeout !== null) {
|
|
1645
|
+
clearTimeout(AuroFloatingUI._mousePressedTimeout);
|
|
1646
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
1647
|
+
}
|
|
1648
|
+
if (!AuroFloatingUI.isMousePressed) {
|
|
1649
|
+
AuroFloatingUI.isMousePressed = true;
|
|
1650
|
+
}
|
|
1651
|
+
} else if (AuroFloatingUI.isMousePressed && !isPressed) {
|
|
1652
|
+
// Schedule reset and track timeout ID
|
|
1653
|
+
AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
|
|
1654
|
+
AuroFloatingUI.isMousePressed = false;
|
|
1655
|
+
AuroFloatingUI._mousePressedTimeout = null;
|
|
1656
|
+
}, 0);
|
|
1657
|
+
}
|
|
1638
1658
|
};
|
|
1639
1659
|
|
|
1640
1660
|
window.addEventListener('mousedown', mouseEventGlobalHandler);
|
|
@@ -1761,6 +1781,7 @@ class AuroFloatingUI {
|
|
|
1761
1781
|
|
|
1762
1782
|
// Compute the position of the bib
|
|
1763
1783
|
computePosition(this.element.trigger, this.element.bib, {
|
|
1784
|
+
strategy: this.element.floaterConfig?.strategy || 'fixed',
|
|
1764
1785
|
placement: this.element.floaterConfig?.placement,
|
|
1765
1786
|
middleware: middleware || []
|
|
1766
1787
|
}).then(({ x, y }) => { // eslint-disable-line id-length
|
|
@@ -1895,8 +1916,9 @@ class AuroFloatingUI {
|
|
|
1895
1916
|
if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
|
|
1896
1917
|
return;
|
|
1897
1918
|
}
|
|
1898
|
-
|
|
1899
|
-
if
|
|
1919
|
+
|
|
1920
|
+
// if fullscreen bib is in fullscreen mode, do not close
|
|
1921
|
+
if (this.element.bib.hasAttribute('isfullscreen')) {
|
|
1900
1922
|
return;
|
|
1901
1923
|
}
|
|
1902
1924
|
|
|
@@ -2197,8 +2219,6 @@ class AuroFloatingUI {
|
|
|
2197
2219
|
this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
|
|
2198
2220
|
}
|
|
2199
2221
|
|
|
2200
|
-
document.body.append(this.element.bib);
|
|
2201
|
-
|
|
2202
2222
|
this.regenerateBibId();
|
|
2203
2223
|
this.handleTriggerTabIndex();
|
|
2204
2224
|
|
|
@@ -2448,6 +2468,76 @@ var tokensCss$2 = i$3`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-d
|
|
|
2448
2468
|
|
|
2449
2469
|
var colorCss$3 = i$3`: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)}`;
|
|
2450
2470
|
|
|
2471
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
2472
|
+
// See LICENSE in the project root for license information.
|
|
2473
|
+
|
|
2474
|
+
// ---------------------------------------------------------------------
|
|
2475
|
+
|
|
2476
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
2477
|
+
|
|
2478
|
+
let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
|
|
2479
|
+
|
|
2480
|
+
/* eslint-disable jsdoc/require-param */
|
|
2481
|
+
|
|
2482
|
+
/**
|
|
2483
|
+
* This will register a new custom element with the browser.
|
|
2484
|
+
* @param {String} name - The name of the custom element.
|
|
2485
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
2486
|
+
* @returns {void}
|
|
2487
|
+
*/
|
|
2488
|
+
registerComponent(name, componentClass) {
|
|
2489
|
+
if (!customElements.get(name)) {
|
|
2490
|
+
customElements.define(name, class extends componentClass {});
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
/**
|
|
2495
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
2496
|
+
* @returns {void}
|
|
2497
|
+
*/
|
|
2498
|
+
closestElement(
|
|
2499
|
+
selector, // selector like in .closest()
|
|
2500
|
+
base = this, // extra functionality to skip a parent
|
|
2501
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
2502
|
+
!el || el === document || el === window
|
|
2503
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
2504
|
+
: found
|
|
2505
|
+
? found // found a selector INside this element
|
|
2506
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
2507
|
+
) {
|
|
2508
|
+
return __Closest(base);
|
|
2509
|
+
}
|
|
2510
|
+
/* eslint-enable jsdoc/require-param */
|
|
2511
|
+
|
|
2512
|
+
/**
|
|
2513
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
2514
|
+
* @param {Object} elem - The element to check.
|
|
2515
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
2516
|
+
* @returns {void}
|
|
2517
|
+
*/
|
|
2518
|
+
handleComponentTagRename(elem, tagName) {
|
|
2519
|
+
const tag = tagName.toLowerCase();
|
|
2520
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
2521
|
+
|
|
2522
|
+
if (elemTag !== tag) {
|
|
2523
|
+
elem.setAttribute(tag, true);
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* Validates if an element is a specific Auro component.
|
|
2529
|
+
* @param {Object} elem - The element to validate.
|
|
2530
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
2531
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
2532
|
+
*/
|
|
2533
|
+
elementMatch(elem, tagName) {
|
|
2534
|
+
const tag = tagName.toLowerCase();
|
|
2535
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
2536
|
+
|
|
2537
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
2538
|
+
}
|
|
2539
|
+
};
|
|
2540
|
+
|
|
2451
2541
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2452
2542
|
// See LICENSE in the project root for license information.
|
|
2453
2543
|
|
|
@@ -2617,7 +2707,7 @@ class AuroIcon extends BaseIcon {
|
|
|
2617
2707
|
|
|
2618
2708
|
var iconVersion = '6.1.2';
|
|
2619
2709
|
|
|
2620
|
-
var styleCss$2 = i$3`:host{position:
|
|
2710
|
+
var styleCss$2 = i$3`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}.container{display:inline-block;overflow:auto;box-sizing:border-box;margin:var(--ds-size-50, 0.25rem) 0}: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}`;
|
|
2621
2711
|
|
|
2622
2712
|
var colorCss$2 = i$3`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2623
2713
|
|
|
@@ -2627,7 +2717,6 @@ var tokensCss$1 = i$3`:host{--ds-auro-dropdown-label-text-color: var(--ds-basic-
|
|
|
2627
2717
|
// See LICENSE in the project root for license information.
|
|
2628
2718
|
|
|
2629
2719
|
|
|
2630
|
-
|
|
2631
2720
|
const DESIGN_TOKEN_BREAKPOINT_PREFIX = '--ds-grid-breakpoint-';
|
|
2632
2721
|
const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
2633
2722
|
'xl',
|
|
@@ -2652,7 +2741,7 @@ class AuroDropdownBib extends i$1 {
|
|
|
2652
2741
|
*/
|
|
2653
2742
|
this._mobileBreakpointValue = undefined;
|
|
2654
2743
|
|
|
2655
|
-
AuroLibraryRuntimeUtils$
|
|
2744
|
+
AuroLibraryRuntimeUtils$2.prototype.handleComponentTagRename(this, 'auro-dropdownbib');
|
|
2656
2745
|
}
|
|
2657
2746
|
|
|
2658
2747
|
static get styles() {
|
|
@@ -2697,6 +2786,13 @@ class AuroDropdownBib extends i$1 {
|
|
|
2697
2786
|
type: Boolean,
|
|
2698
2787
|
reflect: true
|
|
2699
2788
|
},
|
|
2789
|
+
|
|
2790
|
+
/**
|
|
2791
|
+
* A reference to the associated bib template element.
|
|
2792
|
+
*/
|
|
2793
|
+
bibTemplate: {
|
|
2794
|
+
type: Object
|
|
2795
|
+
}
|
|
2700
2796
|
};
|
|
2701
2797
|
}
|
|
2702
2798
|
|
|
@@ -2729,9 +2825,50 @@ class AuroDropdownBib extends i$1 {
|
|
|
2729
2825
|
}
|
|
2730
2826
|
}
|
|
2731
2827
|
});
|
|
2828
|
+
|
|
2829
|
+
if (this.bibTemplate) {
|
|
2830
|
+
// If the bib template is found, set the fullscreen attribute
|
|
2831
|
+
if (this.isFullscreen) {
|
|
2832
|
+
this.bibTemplate.setAttribute('isFullscreen', 'true');
|
|
2833
|
+
} else {
|
|
2834
|
+
this.bibTemplate.removeAttribute('isFullscreen');
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2732
2837
|
}
|
|
2733
2838
|
}
|
|
2734
2839
|
|
|
2840
|
+
connectedCallback() {
|
|
2841
|
+
super.connectedCallback();
|
|
2842
|
+
|
|
2843
|
+
// Listen for the auro-bibtemplate-connected event to set the fullscreen attribute
|
|
2844
|
+
this.addEventListener('auro-bibtemplate-connected', (event) => {
|
|
2845
|
+
const bibTemplate = event.detail.element;
|
|
2846
|
+
this.bibTemplate = bibTemplate;
|
|
2847
|
+
|
|
2848
|
+
if (bibTemplate) {
|
|
2849
|
+
// If the bib template is found, set the fullscreen attribute
|
|
2850
|
+
if (this.isFullscreen) {
|
|
2851
|
+
bibTemplate.setAttribute('isFullscreen', 'true');
|
|
2852
|
+
} else {
|
|
2853
|
+
bibTemplate.removeAttribute('isFullscreen');
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
});
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
firstUpdated(changedProperties) {
|
|
2860
|
+
super.firstUpdated(changedProperties);
|
|
2861
|
+
|
|
2862
|
+
// Dispatch a custom event when the component is connected
|
|
2863
|
+
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
2864
|
+
bubbles: true,
|
|
2865
|
+
composed: true,
|
|
2866
|
+
detail: {
|
|
2867
|
+
element: this
|
|
2868
|
+
}
|
|
2869
|
+
}));
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2735
2872
|
// function that renders the HTML and CSS into the scope of the component
|
|
2736
2873
|
render() {
|
|
2737
2874
|
return u$1`
|
|
@@ -3041,7 +3178,7 @@ class AuroDropdown extends i$1 {
|
|
|
3041
3178
|
/**
|
|
3042
3179
|
* @private
|
|
3043
3180
|
*/
|
|
3044
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
3181
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
3045
3182
|
|
|
3046
3183
|
/**
|
|
3047
3184
|
* @private
|
|
@@ -3370,7 +3507,7 @@ class AuroDropdown extends i$1 {
|
|
|
3370
3507
|
*
|
|
3371
3508
|
*/
|
|
3372
3509
|
static register(name = "auro-dropdown") {
|
|
3373
|
-
AuroLibraryRuntimeUtils$
|
|
3510
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroDropdown);
|
|
3374
3511
|
}
|
|
3375
3512
|
|
|
3376
3513
|
/**
|
|
@@ -3687,8 +3824,7 @@ class AuroDropdown extends i$1 {
|
|
|
3687
3824
|
* @param {Event} event - The event object representing the slot change.
|
|
3688
3825
|
* @fires Function#onSlotChange - Optional callback invoked when the slot content changes.
|
|
3689
3826
|
*/
|
|
3690
|
-
handleDefaultSlot(
|
|
3691
|
-
[...event.target.assignedNodes()].forEach((node) => this.bibContent.append(node));
|
|
3827
|
+
handleDefaultSlot() {
|
|
3692
3828
|
|
|
3693
3829
|
if (this.onSlotChange) {
|
|
3694
3830
|
this.onSlotChange();
|
|
@@ -3760,9 +3896,7 @@ class AuroDropdown extends i$1 {
|
|
|
3760
3896
|
<${this.helpTextTag} part="helpText" ?onDark=${this.onDark} ?error="${this.error}">
|
|
3761
3897
|
<slot name="helpText"></slot>
|
|
3762
3898
|
</${this.helpTextTag}>
|
|
3763
|
-
|
|
3764
|
-
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
3765
|
-
</div>
|
|
3899
|
+
|
|
3766
3900
|
<div id="bibSizer" part="size"></div>
|
|
3767
3901
|
<${this.dropdownBibTag}
|
|
3768
3902
|
id="bib"
|
|
@@ -3772,6 +3906,9 @@ class AuroDropdown extends i$1 {
|
|
|
3772
3906
|
?rounded="${this.common || this.rounded}"
|
|
3773
3907
|
?inset="${this.common || this.inset}"
|
|
3774
3908
|
>
|
|
3909
|
+
<div class="slotContent">
|
|
3910
|
+
<slot @slotchange="${this.handleDefaultSlot}"></slot>
|
|
3911
|
+
</div>
|
|
3775
3912
|
</${this.dropdownBibTag}>
|
|
3776
3913
|
</div>
|
|
3777
3914
|
`;
|
|
@@ -33,6 +33,12 @@ export class AuroDropdownBib extends LitElement {
|
|
|
33
33
|
type: BooleanConstructor;
|
|
34
34
|
reflect: boolean;
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* A reference to the associated bib template element.
|
|
38
|
+
*/
|
|
39
|
+
bibTemplate: {
|
|
40
|
+
type: ObjectConstructor;
|
|
41
|
+
};
|
|
36
42
|
};
|
|
37
43
|
/**
|
|
38
44
|
* @private
|
|
@@ -41,6 +47,8 @@ export class AuroDropdownBib extends LitElement {
|
|
|
41
47
|
set mobileFullscreenBreakpoint(value: string);
|
|
42
48
|
get mobileFullscreenBreakpoint(): string;
|
|
43
49
|
updated(changedProperties: any): void;
|
|
50
|
+
bibTemplate: any;
|
|
51
|
+
firstUpdated(changedProperties: any): void;
|
|
44
52
|
render(): import("lit-html").TemplateResult;
|
|
45
53
|
}
|
|
46
54
|
import { LitElement } from "lit";
|