@aurodesignsystem-dev/auro-popover 0.0.0-pr141.3 → 0.0.0-pr145.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/demo/api.min.js +147 -35
- package/demo/index.min.js +147 -35
- package/dist/{auro-popover-DTAnB1se.js → auro-popover-CUbr53m1.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +1 -1
package/demo/api.min.js
CHANGED
|
@@ -2233,6 +2233,9 @@ class AuroPopover extends i {
|
|
|
2233
2233
|
super.disconnectedCallback();
|
|
2234
2234
|
this.removeEventListener("touchstart", this._onTouchStart);
|
|
2235
2235
|
|
|
2236
|
+
// Stop re-running the accessibility setup before cleaning up its output.
|
|
2237
|
+
this._a11yObserver?.disconnect();
|
|
2238
|
+
|
|
2236
2239
|
if (this.trigger) {
|
|
2237
2240
|
// Remove listeners attached to the trigger element.
|
|
2238
2241
|
if (this._onTriggerMouseEnter) {
|
|
@@ -2331,6 +2334,8 @@ class AuroPopover extends i {
|
|
|
2331
2334
|
|
|
2332
2335
|
// If the trigger is not keyboard accessible, make it focusable automatically.
|
|
2333
2336
|
// Set up aria-description so screen readers announce popover content on focus.
|
|
2337
|
+
// The setup re-runs whenever the trigger or its shadow DOM changes, so a trigger
|
|
2338
|
+
// that renders after this point, such as auro-button, is picked up.
|
|
2334
2339
|
this._setupAccessibility();
|
|
2335
2340
|
|
|
2336
2341
|
// Set up Popper instance, event listeners, and keyboard/mouse handlers.
|
|
@@ -2451,34 +2456,145 @@ class AuroPopover extends i {
|
|
|
2451
2456
|
}
|
|
2452
2457
|
|
|
2453
2458
|
/**
|
|
2454
|
-
*
|
|
2459
|
+
* Applies the accessibility setup to the trigger and keeps it current.
|
|
2460
|
+
*
|
|
2461
|
+
* A `MutationObserver` watches the trigger's light DOM and the open shadow roots of
|
|
2462
|
+
* the trigger and its hyphenated custom element descendants, and re-runs the setup
|
|
2463
|
+
* when nodes are added or removed. This covers a trigger that renders after the
|
|
2464
|
+
* popover, such as an `auro-button` parsed in the same pass, and content added or
|
|
2465
|
+
* removed later. For a custom element that isn't defined yet, the setup re-runs
|
|
2466
|
+
* once `customElements.whenDefined()` resolves. The observer doesn't watch
|
|
2467
|
+
* attribute changes, such as a descendant's `tabindex`.
|
|
2468
|
+
* @private
|
|
2469
|
+
* @returns {void}
|
|
2470
|
+
*/
|
|
2471
|
+
_setupAccessibility() {
|
|
2472
|
+
const slot = this.shadowRoot.querySelector("slot:not([name])");
|
|
2473
|
+
|
|
2474
|
+
// Keep aria-description in sync if slot content changes after first render.
|
|
2475
|
+
this._onSlotChange = () => {
|
|
2476
|
+
const text = this._getSlotText();
|
|
2477
|
+
|
|
2478
|
+
for (const target of this._ariaDescriptionTargets) {
|
|
2479
|
+
target?.setAttribute("aria-description", text);
|
|
2480
|
+
}
|
|
2481
|
+
};
|
|
2482
|
+
slot.addEventListener("slotchange", this._onSlotChange);
|
|
2483
|
+
|
|
2484
|
+
// The observer only sees added and removed nodes, so the attribute writes made
|
|
2485
|
+
// by _updateAccessibility() do not retrigger it.
|
|
2486
|
+
this._a11yObserver = new MutationObserver(() => {
|
|
2487
|
+
this._updateAccessibility();
|
|
2488
|
+
this._observeTrigger();
|
|
2489
|
+
});
|
|
2490
|
+
|
|
2491
|
+
this._updateAccessibility();
|
|
2492
|
+
this._observeTrigger();
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* Observes the trigger's light DOM and the open shadow root of each hyphenated
|
|
2497
|
+
* custom element in it, including the trigger itself. Shadow roots nested inside
|
|
2498
|
+
* those shadow roots aren't observed. Calling `observe()` again on a node already
|
|
2499
|
+
* being observed is harmless.
|
|
2500
|
+
*
|
|
2501
|
+
* A custom element that isn't defined yet has no shadow root to observe, and its
|
|
2502
|
+
* upgrade and first render aren't mutations the observer can see. The setup
|
|
2503
|
+
* re-runs once the element is defined.
|
|
2504
|
+
* @private
|
|
2505
|
+
* @returns {void}
|
|
2506
|
+
*/
|
|
2507
|
+
_observeTrigger() {
|
|
2508
|
+
// Structure only. Watching attributes such as tabindex would let this
|
|
2509
|
+
// component's own tabindex changes feed back into the observer, and loop
|
|
2510
|
+
// with a trigger that manages its inner button's tabindex.
|
|
2511
|
+
const options = { childList: true, subtree: true };
|
|
2512
|
+
const nodes = [this.trigger, ...this.trigger.querySelectorAll("*")];
|
|
2513
|
+
|
|
2514
|
+
this._pendingDefinitions ??= new Set();
|
|
2515
|
+
|
|
2516
|
+
for (const node of nodes) {
|
|
2517
|
+
this._a11yObserver.observe(node, options);
|
|
2518
|
+
|
|
2519
|
+
if (!node.localName.includes("-")) continue;
|
|
2520
|
+
|
|
2521
|
+
if (node.shadowRoot) {
|
|
2522
|
+
this._a11yObserver.observe(node.shadowRoot, options);
|
|
2523
|
+
} else if (
|
|
2524
|
+
!customElements.get(node.localName) &&
|
|
2525
|
+
!this._pendingDefinitions.has(node.localName)
|
|
2526
|
+
) {
|
|
2527
|
+
this._pendingDefinitions.add(node.localName);
|
|
2528
|
+
customElements.whenDefined(node.localName).then(() => {
|
|
2529
|
+
this._pendingDefinitions.delete(node.localName);
|
|
2530
|
+
|
|
2531
|
+
// The popover may have been removed while waiting.
|
|
2532
|
+
if (this.isConnected && this._a11yObserver) {
|
|
2533
|
+
this._updateAccessibility();
|
|
2534
|
+
this._observeTrigger();
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
/**
|
|
2542
|
+
* Gets the popover's slotted text as a single trimmed string.
|
|
2543
|
+
* @private
|
|
2544
|
+
* @returns {string} The slotted text, with whitespace collapsed.
|
|
2545
|
+
*/
|
|
2546
|
+
_getSlotText() {
|
|
2547
|
+
return this.shadowRoot
|
|
2548
|
+
.querySelector("slot:not([name])")
|
|
2549
|
+
.assignedNodes({ flatten: true })
|
|
2550
|
+
.map((n) => n.textContent ?? "")
|
|
2551
|
+
.join(" ")
|
|
2552
|
+
.replace(/\s+/g, " ")
|
|
2553
|
+
.trim();
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
/**
|
|
2557
|
+
* Sets up auto-tabindex and `aria-description` on the trigger element.
|
|
2558
|
+
* Safe to run repeatedly: it removes what it added earlier if the trigger has
|
|
2559
|
+
* since gained focusable content, and moves `aria-description` to the new targets.
|
|
2455
2560
|
*
|
|
2456
2561
|
* Auto-tabindex: ensures non-focusable triggers are keyboard accessible.
|
|
2457
2562
|
* Covers native elements, such as `<abbr>` and `<span>`, and custom elements whose
|
|
2458
2563
|
* shadow DOM contains no focusable descendant, such as `auro-icon`.
|
|
2459
2564
|
*
|
|
2460
|
-
*
|
|
2461
|
-
* - Natively focusable elements (tabIndex >= 0): `<button>`, `<a href>`, `<input>`, and so on.
|
|
2565
|
+
* The component skips elements that are already accessible via the tab order:
|
|
2566
|
+
* - Natively focusable elements (`tabIndex >= 0`): `<button>`, `<a href>`, `<input>`, and so on.
|
|
2462
2567
|
* - Custom elements whose shadow DOM contains a focusable descendant (for example, `auro-button`
|
|
2463
|
-
* has an inner `<button>`): adding tabindex to the host would create a double tab stop.
|
|
2464
|
-
* - Elements where the author has explicitly set tabindex
|
|
2568
|
+
* has an inner `<button>`): adding `tabindex` to the host would create a double tab stop.
|
|
2569
|
+
* - Elements where the author has explicitly set `tabindex`: their intent is respected.
|
|
2465
2570
|
*
|
|
2466
|
-
*
|
|
2467
|
-
*
|
|
2468
|
-
*
|
|
2469
|
-
*
|
|
2470
|
-
*
|
|
2571
|
+
* A trigger that hasn't rendered yet, or whose custom element isn't defined yet, is
|
|
2572
|
+
* briefly given `tabindex="0"` on the first run. The setup re-runs once its shadow
|
|
2573
|
+
* DOM appears or the element is defined, and the component removes the `tabindex`
|
|
2574
|
+
* it added.
|
|
2575
|
+
*
|
|
2576
|
+
* Known limitation: custom elements with a closed shadow root (`mode: 'closed'`) can't
|
|
2577
|
+
* be inspected, because `shadowRoot` returns `null`. If such an element has an internal focusable
|
|
2578
|
+
* descendant and a host `tabIndex` of `-1`, the component adds `tabindex="0"`, potentially
|
|
2579
|
+
* creating a double tab stop. Elements using `delegatesFocus` avoid this because the
|
|
2580
|
+
* browser reflects a non-negative `tabIndex` on the host.
|
|
2471
2581
|
*
|
|
2472
2582
|
* `aria-description` (ARIA 1.3): embeds the popover content string directly on
|
|
2473
|
-
* the
|
|
2583
|
+
* the element that receives focus, so screen readers announce it on focus. That is
|
|
2584
|
+
* the trigger itself. For a wrapper trigger, or a custom element trigger whose
|
|
2585
|
+
* shadow DOM holds the focusable control, such as the inner `<button>` of
|
|
2586
|
+
* `auro-button`, it is the focusable element inside the trigger. Preferred over
|
|
2474
2587
|
* `aria-describedby` (cross-shadow ID lookup fails) and `aria-live` (`display:none`
|
|
2475
2588
|
* removes the region from the accessibility tree).
|
|
2476
2589
|
*
|
|
2477
2590
|
* @private
|
|
2478
2591
|
* @returns {void}
|
|
2479
2592
|
*/
|
|
2480
|
-
|
|
2481
|
-
|
|
2593
|
+
_updateAccessibility() {
|
|
2594
|
+
// A tabindex this component added earlier is not native focusability.
|
|
2595
|
+
const ownTabIndex =
|
|
2596
|
+
this._addedTabIndex && this.trigger.getAttribute("tabindex") === "0";
|
|
2597
|
+
const isNativelyFocusable = this.trigger.tabIndex >= 0 && !ownTabIndex;
|
|
2482
2598
|
const focusableSelector =
|
|
2483
2599
|
'button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]:not([contenteditable="false"]), summary, iframe, audio[controls], video[controls]';
|
|
2484
2600
|
|
|
@@ -2540,27 +2656,25 @@ class AuroPopover extends i {
|
|
|
2540
2656
|
].some(isReachable);
|
|
2541
2657
|
}
|
|
2542
2658
|
|
|
2543
|
-
|
|
2659
|
+
const needsTabIndex =
|
|
2544
2660
|
!isNativelyFocusable &&
|
|
2545
2661
|
!hasInternalFocus &&
|
|
2546
|
-
!this.trigger.hasAttribute("tabindex")
|
|
2547
|
-
|
|
2662
|
+
(ownTabIndex || !this.trigger.hasAttribute("tabindex"));
|
|
2663
|
+
|
|
2664
|
+
if (needsTabIndex && !ownTabIndex) {
|
|
2548
2665
|
this.trigger.setAttribute("tabindex", "0");
|
|
2549
2666
|
this._addedTabIndex = true;
|
|
2667
|
+
} else if (!needsTabIndex && ownTabIndex) {
|
|
2668
|
+
// The trigger gained focusable content since tabindex was added.
|
|
2669
|
+
this.trigger.removeAttribute("tabindex");
|
|
2670
|
+
this._addedTabIndex = false;
|
|
2550
2671
|
}
|
|
2551
2672
|
|
|
2552
2673
|
// Set up aria-description on the appropriate focusable element(s).
|
|
2553
2674
|
// NOTE: aria-description is defined in the ARIA 1.3 spec. It is well-supported
|
|
2554
2675
|
// in modern browsers and screen readers (Chrome 92+, Firefox 92+, Safari 15.4+)
|
|
2555
2676
|
// but may be unfamiliar — do not replace with aria-describedby.
|
|
2556
|
-
const
|
|
2557
|
-
const getSlotText = () =>
|
|
2558
|
-
slot
|
|
2559
|
-
.assignedNodes({ flatten: true })
|
|
2560
|
-
.map((n) => n.textContent ?? "")
|
|
2561
|
-
.join(" ")
|
|
2562
|
-
.replace(/\s+/g, " ")
|
|
2563
|
-
.trim();
|
|
2677
|
+
const previousTargets = this._ariaDescriptionTargets ?? [];
|
|
2564
2678
|
|
|
2565
2679
|
// Determine which elements should receive aria-description.
|
|
2566
2680
|
// When the trigger is a non-focusable wrapper around focusable content
|
|
@@ -2623,21 +2737,19 @@ class AuroPopover extends i {
|
|
|
2623
2737
|
this._ariaDescriptionTargets.push(this.trigger);
|
|
2624
2738
|
}
|
|
2625
2739
|
|
|
2626
|
-
|
|
2740
|
+
// Drop the description from elements that are no longer targets, such as the
|
|
2741
|
+
// host once the trigger's inner button has rendered.
|
|
2742
|
+
for (const previous of previousTargets) {
|
|
2743
|
+
if (!this._ariaDescriptionTargets.includes(previous)) {
|
|
2744
|
+
previous.removeAttribute("aria-description");
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
const description = this._getSlotText();
|
|
2627
2749
|
|
|
2628
2750
|
for (const target of this._ariaDescriptionTargets) {
|
|
2629
2751
|
target.setAttribute("aria-description", description);
|
|
2630
2752
|
}
|
|
2631
|
-
|
|
2632
|
-
// Keep aria-description in sync if slot content changes after first render.
|
|
2633
|
-
this._onSlotChange = () => {
|
|
2634
|
-
const text = getSlotText();
|
|
2635
|
-
|
|
2636
|
-
for (const target of this._ariaDescriptionTargets) {
|
|
2637
|
-
target?.setAttribute("aria-description", text);
|
|
2638
|
-
}
|
|
2639
|
-
};
|
|
2640
|
-
slot.addEventListener("slotchange", this._onSlotChange);
|
|
2641
2753
|
}
|
|
2642
2754
|
|
|
2643
2755
|
/**
|
package/demo/index.min.js
CHANGED
|
@@ -2226,6 +2226,9 @@ class AuroPopover extends i {
|
|
|
2226
2226
|
super.disconnectedCallback();
|
|
2227
2227
|
this.removeEventListener("touchstart", this._onTouchStart);
|
|
2228
2228
|
|
|
2229
|
+
// Stop re-running the accessibility setup before cleaning up its output.
|
|
2230
|
+
this._a11yObserver?.disconnect();
|
|
2231
|
+
|
|
2229
2232
|
if (this.trigger) {
|
|
2230
2233
|
// Remove listeners attached to the trigger element.
|
|
2231
2234
|
if (this._onTriggerMouseEnter) {
|
|
@@ -2324,6 +2327,8 @@ class AuroPopover extends i {
|
|
|
2324
2327
|
|
|
2325
2328
|
// If the trigger is not keyboard accessible, make it focusable automatically.
|
|
2326
2329
|
// Set up aria-description so screen readers announce popover content on focus.
|
|
2330
|
+
// The setup re-runs whenever the trigger or its shadow DOM changes, so a trigger
|
|
2331
|
+
// that renders after this point, such as auro-button, is picked up.
|
|
2327
2332
|
this._setupAccessibility();
|
|
2328
2333
|
|
|
2329
2334
|
// Set up Popper instance, event listeners, and keyboard/mouse handlers.
|
|
@@ -2444,34 +2449,145 @@ class AuroPopover extends i {
|
|
|
2444
2449
|
}
|
|
2445
2450
|
|
|
2446
2451
|
/**
|
|
2447
|
-
*
|
|
2452
|
+
* Applies the accessibility setup to the trigger and keeps it current.
|
|
2453
|
+
*
|
|
2454
|
+
* A `MutationObserver` watches the trigger's light DOM and the open shadow roots of
|
|
2455
|
+
* the trigger and its hyphenated custom element descendants, and re-runs the setup
|
|
2456
|
+
* when nodes are added or removed. This covers a trigger that renders after the
|
|
2457
|
+
* popover, such as an `auro-button` parsed in the same pass, and content added or
|
|
2458
|
+
* removed later. For a custom element that isn't defined yet, the setup re-runs
|
|
2459
|
+
* once `customElements.whenDefined()` resolves. The observer doesn't watch
|
|
2460
|
+
* attribute changes, such as a descendant's `tabindex`.
|
|
2461
|
+
* @private
|
|
2462
|
+
* @returns {void}
|
|
2463
|
+
*/
|
|
2464
|
+
_setupAccessibility() {
|
|
2465
|
+
const slot = this.shadowRoot.querySelector("slot:not([name])");
|
|
2466
|
+
|
|
2467
|
+
// Keep aria-description in sync if slot content changes after first render.
|
|
2468
|
+
this._onSlotChange = () => {
|
|
2469
|
+
const text = this._getSlotText();
|
|
2470
|
+
|
|
2471
|
+
for (const target of this._ariaDescriptionTargets) {
|
|
2472
|
+
target?.setAttribute("aria-description", text);
|
|
2473
|
+
}
|
|
2474
|
+
};
|
|
2475
|
+
slot.addEventListener("slotchange", this._onSlotChange);
|
|
2476
|
+
|
|
2477
|
+
// The observer only sees added and removed nodes, so the attribute writes made
|
|
2478
|
+
// by _updateAccessibility() do not retrigger it.
|
|
2479
|
+
this._a11yObserver = new MutationObserver(() => {
|
|
2480
|
+
this._updateAccessibility();
|
|
2481
|
+
this._observeTrigger();
|
|
2482
|
+
});
|
|
2483
|
+
|
|
2484
|
+
this._updateAccessibility();
|
|
2485
|
+
this._observeTrigger();
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* Observes the trigger's light DOM and the open shadow root of each hyphenated
|
|
2490
|
+
* custom element in it, including the trigger itself. Shadow roots nested inside
|
|
2491
|
+
* those shadow roots aren't observed. Calling `observe()` again on a node already
|
|
2492
|
+
* being observed is harmless.
|
|
2493
|
+
*
|
|
2494
|
+
* A custom element that isn't defined yet has no shadow root to observe, and its
|
|
2495
|
+
* upgrade and first render aren't mutations the observer can see. The setup
|
|
2496
|
+
* re-runs once the element is defined.
|
|
2497
|
+
* @private
|
|
2498
|
+
* @returns {void}
|
|
2499
|
+
*/
|
|
2500
|
+
_observeTrigger() {
|
|
2501
|
+
// Structure only. Watching attributes such as tabindex would let this
|
|
2502
|
+
// component's own tabindex changes feed back into the observer, and loop
|
|
2503
|
+
// with a trigger that manages its inner button's tabindex.
|
|
2504
|
+
const options = { childList: true, subtree: true };
|
|
2505
|
+
const nodes = [this.trigger, ...this.trigger.querySelectorAll("*")];
|
|
2506
|
+
|
|
2507
|
+
this._pendingDefinitions ??= new Set();
|
|
2508
|
+
|
|
2509
|
+
for (const node of nodes) {
|
|
2510
|
+
this._a11yObserver.observe(node, options);
|
|
2511
|
+
|
|
2512
|
+
if (!node.localName.includes("-")) continue;
|
|
2513
|
+
|
|
2514
|
+
if (node.shadowRoot) {
|
|
2515
|
+
this._a11yObserver.observe(node.shadowRoot, options);
|
|
2516
|
+
} else if (
|
|
2517
|
+
!customElements.get(node.localName) &&
|
|
2518
|
+
!this._pendingDefinitions.has(node.localName)
|
|
2519
|
+
) {
|
|
2520
|
+
this._pendingDefinitions.add(node.localName);
|
|
2521
|
+
customElements.whenDefined(node.localName).then(() => {
|
|
2522
|
+
this._pendingDefinitions.delete(node.localName);
|
|
2523
|
+
|
|
2524
|
+
// The popover may have been removed while waiting.
|
|
2525
|
+
if (this.isConnected && this._a11yObserver) {
|
|
2526
|
+
this._updateAccessibility();
|
|
2527
|
+
this._observeTrigger();
|
|
2528
|
+
}
|
|
2529
|
+
});
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
/**
|
|
2535
|
+
* Gets the popover's slotted text as a single trimmed string.
|
|
2536
|
+
* @private
|
|
2537
|
+
* @returns {string} The slotted text, with whitespace collapsed.
|
|
2538
|
+
*/
|
|
2539
|
+
_getSlotText() {
|
|
2540
|
+
return this.shadowRoot
|
|
2541
|
+
.querySelector("slot:not([name])")
|
|
2542
|
+
.assignedNodes({ flatten: true })
|
|
2543
|
+
.map((n) => n.textContent ?? "")
|
|
2544
|
+
.join(" ")
|
|
2545
|
+
.replace(/\s+/g, " ")
|
|
2546
|
+
.trim();
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
/**
|
|
2550
|
+
* Sets up auto-tabindex and `aria-description` on the trigger element.
|
|
2551
|
+
* Safe to run repeatedly: it removes what it added earlier if the trigger has
|
|
2552
|
+
* since gained focusable content, and moves `aria-description` to the new targets.
|
|
2448
2553
|
*
|
|
2449
2554
|
* Auto-tabindex: ensures non-focusable triggers are keyboard accessible.
|
|
2450
2555
|
* Covers native elements, such as `<abbr>` and `<span>`, and custom elements whose
|
|
2451
2556
|
* shadow DOM contains no focusable descendant, such as `auro-icon`.
|
|
2452
2557
|
*
|
|
2453
|
-
*
|
|
2454
|
-
* - Natively focusable elements (tabIndex >= 0): `<button>`, `<a href>`, `<input>`, and so on.
|
|
2558
|
+
* The component skips elements that are already accessible via the tab order:
|
|
2559
|
+
* - Natively focusable elements (`tabIndex >= 0`): `<button>`, `<a href>`, `<input>`, and so on.
|
|
2455
2560
|
* - Custom elements whose shadow DOM contains a focusable descendant (for example, `auro-button`
|
|
2456
|
-
* has an inner `<button>`): adding tabindex to the host would create a double tab stop.
|
|
2457
|
-
* - Elements where the author has explicitly set tabindex
|
|
2561
|
+
* has an inner `<button>`): adding `tabindex` to the host would create a double tab stop.
|
|
2562
|
+
* - Elements where the author has explicitly set `tabindex`: their intent is respected.
|
|
2458
2563
|
*
|
|
2459
|
-
*
|
|
2460
|
-
*
|
|
2461
|
-
*
|
|
2462
|
-
*
|
|
2463
|
-
*
|
|
2564
|
+
* A trigger that hasn't rendered yet, or whose custom element isn't defined yet, is
|
|
2565
|
+
* briefly given `tabindex="0"` on the first run. The setup re-runs once its shadow
|
|
2566
|
+
* DOM appears or the element is defined, and the component removes the `tabindex`
|
|
2567
|
+
* it added.
|
|
2568
|
+
*
|
|
2569
|
+
* Known limitation: custom elements with a closed shadow root (`mode: 'closed'`) can't
|
|
2570
|
+
* be inspected, because `shadowRoot` returns `null`. If such an element has an internal focusable
|
|
2571
|
+
* descendant and a host `tabIndex` of `-1`, the component adds `tabindex="0"`, potentially
|
|
2572
|
+
* creating a double tab stop. Elements using `delegatesFocus` avoid this because the
|
|
2573
|
+
* browser reflects a non-negative `tabIndex` on the host.
|
|
2464
2574
|
*
|
|
2465
2575
|
* `aria-description` (ARIA 1.3): embeds the popover content string directly on
|
|
2466
|
-
* the
|
|
2576
|
+
* the element that receives focus, so screen readers announce it on focus. That is
|
|
2577
|
+
* the trigger itself. For a wrapper trigger, or a custom element trigger whose
|
|
2578
|
+
* shadow DOM holds the focusable control, such as the inner `<button>` of
|
|
2579
|
+
* `auro-button`, it is the focusable element inside the trigger. Preferred over
|
|
2467
2580
|
* `aria-describedby` (cross-shadow ID lookup fails) and `aria-live` (`display:none`
|
|
2468
2581
|
* removes the region from the accessibility tree).
|
|
2469
2582
|
*
|
|
2470
2583
|
* @private
|
|
2471
2584
|
* @returns {void}
|
|
2472
2585
|
*/
|
|
2473
|
-
|
|
2474
|
-
|
|
2586
|
+
_updateAccessibility() {
|
|
2587
|
+
// A tabindex this component added earlier is not native focusability.
|
|
2588
|
+
const ownTabIndex =
|
|
2589
|
+
this._addedTabIndex && this.trigger.getAttribute("tabindex") === "0";
|
|
2590
|
+
const isNativelyFocusable = this.trigger.tabIndex >= 0 && !ownTabIndex;
|
|
2475
2591
|
const focusableSelector =
|
|
2476
2592
|
'button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]:not([contenteditable="false"]), summary, iframe, audio[controls], video[controls]';
|
|
2477
2593
|
|
|
@@ -2533,27 +2649,25 @@ class AuroPopover extends i {
|
|
|
2533
2649
|
].some(isReachable);
|
|
2534
2650
|
}
|
|
2535
2651
|
|
|
2536
|
-
|
|
2652
|
+
const needsTabIndex =
|
|
2537
2653
|
!isNativelyFocusable &&
|
|
2538
2654
|
!hasInternalFocus &&
|
|
2539
|
-
!this.trigger.hasAttribute("tabindex")
|
|
2540
|
-
|
|
2655
|
+
(ownTabIndex || !this.trigger.hasAttribute("tabindex"));
|
|
2656
|
+
|
|
2657
|
+
if (needsTabIndex && !ownTabIndex) {
|
|
2541
2658
|
this.trigger.setAttribute("tabindex", "0");
|
|
2542
2659
|
this._addedTabIndex = true;
|
|
2660
|
+
} else if (!needsTabIndex && ownTabIndex) {
|
|
2661
|
+
// The trigger gained focusable content since tabindex was added.
|
|
2662
|
+
this.trigger.removeAttribute("tabindex");
|
|
2663
|
+
this._addedTabIndex = false;
|
|
2543
2664
|
}
|
|
2544
2665
|
|
|
2545
2666
|
// Set up aria-description on the appropriate focusable element(s).
|
|
2546
2667
|
// NOTE: aria-description is defined in the ARIA 1.3 spec. It is well-supported
|
|
2547
2668
|
// in modern browsers and screen readers (Chrome 92+, Firefox 92+, Safari 15.4+)
|
|
2548
2669
|
// but may be unfamiliar — do not replace with aria-describedby.
|
|
2549
|
-
const
|
|
2550
|
-
const getSlotText = () =>
|
|
2551
|
-
slot
|
|
2552
|
-
.assignedNodes({ flatten: true })
|
|
2553
|
-
.map((n) => n.textContent ?? "")
|
|
2554
|
-
.join(" ")
|
|
2555
|
-
.replace(/\s+/g, " ")
|
|
2556
|
-
.trim();
|
|
2670
|
+
const previousTargets = this._ariaDescriptionTargets ?? [];
|
|
2557
2671
|
|
|
2558
2672
|
// Determine which elements should receive aria-description.
|
|
2559
2673
|
// When the trigger is a non-focusable wrapper around focusable content
|
|
@@ -2616,21 +2730,19 @@ class AuroPopover extends i {
|
|
|
2616
2730
|
this._ariaDescriptionTargets.push(this.trigger);
|
|
2617
2731
|
}
|
|
2618
2732
|
|
|
2619
|
-
|
|
2733
|
+
// Drop the description from elements that are no longer targets, such as the
|
|
2734
|
+
// host once the trigger's inner button has rendered.
|
|
2735
|
+
for (const previous of previousTargets) {
|
|
2736
|
+
if (!this._ariaDescriptionTargets.includes(previous)) {
|
|
2737
|
+
previous.removeAttribute("aria-description");
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
const description = this._getSlotText();
|
|
2620
2742
|
|
|
2621
2743
|
for (const target of this._ariaDescriptionTargets) {
|
|
2622
2744
|
target.setAttribute("aria-description", description);
|
|
2623
2745
|
}
|
|
2624
|
-
|
|
2625
|
-
// Keep aria-description in sync if slot content changes after first render.
|
|
2626
|
-
this._onSlotChange = () => {
|
|
2627
|
-
const text = getSlotText();
|
|
2628
|
-
|
|
2629
|
-
for (const target of this._ariaDescriptionTargets) {
|
|
2630
|
-
target?.setAttribute("aria-description", text);
|
|
2631
|
-
}
|
|
2632
|
-
};
|
|
2633
|
-
slot.addEventListener("slotchange", this._onSlotChange);
|
|
2634
2746
|
}
|
|
2635
2747
|
|
|
2636
2748
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{css as e,LitElement as t,html as i}from"lit";class s{registerComponent(e,t){customElements.get(e)||customElements.define(e,class extends t{})}closestElement(e,t=this,i=(t,s=t&&t.closest(e))=>t&&t!==document&&t!==window?s||i(t.getRootNode().host):null){return i(t)}handleComponentTagRename(e,t){const i=t.toLowerCase();e.tagName.toLowerCase()!==i&&e.setAttribute(i,!0)}elementMatch(e,t){const i=t.toLowerCase();return e.tagName.toLowerCase()===i||e.hasAttribute(i)}getSlotText(e,t){const i=e.shadowRoot?.querySelector(`slot[name="${t}"]`);return(i?.assignedNodes({flatten:!0})||[]).map(e=>e.textContent?.trim()).join(" ").trim()||null}}var r="top",o="bottom",n="right",a="left",l="auto",c=[r,o,n,a],p="start",d="end",f="viewport",h="popper",u=c.reduce(function(e,t){return e.concat([t+"-"+p,t+"-"+d])},[]),m=[].concat(c,[l]).reduce(function(e,t){return e.concat([t,t+"-"+p,t+"-"+d])},[]),g=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function v(e){return e?(e.nodeName||"").toLowerCase():null}function y(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function w(e){return e instanceof y(e).Element||e instanceof Element}function b(e){return e instanceof y(e).HTMLElement||e instanceof HTMLElement}function x(e){return"undefined"!=typeof ShadowRoot&&(e instanceof y(e).ShadowRoot||e instanceof ShadowRoot)}var S={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},s=t.attributes[e]||{},r=t.elements[e];b(r)&&v(r)&&(Object.assign(r.style,i),Object.keys(s).forEach(function(e){var t=s[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var s=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});b(s)&&v(s)&&(Object.assign(s.style,o),Object.keys(r).forEach(function(e){s.removeAttribute(e)}))})}},requires:["computeStyles"]};function _(e){return e.split("-")[0]}var z=Math.max,A=Math.min,k=Math.round;function O(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function T(){return!/^((?!chrome|android).)*safari/i.test(O())}function M(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var s=e.getBoundingClientRect(),r=1,o=1;t&&b(e)&&(r=e.offsetWidth>0&&k(s.width)/e.offsetWidth||1,o=e.offsetHeight>0&&k(s.height)/e.offsetHeight||1);var n=(w(e)?y(e):window).visualViewport,a=!T()&&i,l=(s.left+(a&&n?n.offsetLeft:0))/r,c=(s.top+(a&&n?n.offsetTop:0))/o,p=s.width/r,d=s.height/o;return{width:p,height:d,top:c,right:l+p,bottom:c+d,left:l,x:l,y:c}}function B(e){var t=M(e),i=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:s}}function E(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&x(i)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function R(e){return y(e).getComputedStyle(e)}function H(e){return["table","td","th"].indexOf(v(e))>=0}function L(e){return((w(e)?e.ownerDocument:e.document)||window.document).documentElement}function C(e){return"html"===v(e)?e:e.assignedSlot||e.parentNode||(x(e)?e.host:null)||L(e)}function N(e){return b(e)&&"fixed"!==R(e).position?e.offsetParent:null}function P(e){for(var t=y(e),i=N(e);i&&H(i)&&"static"===R(i).position;)i=N(i);return i&&("html"===v(i)||"body"===v(i)&&"static"===R(i).position)?t:i||function(e){var t=/firefox/i.test(O());if(/Trident/i.test(O())&&b(e)&&"fixed"===R(e).position)return null;var i=C(e);for(x(i)&&(i=i.host);b(i)&&["html","body"].indexOf(v(i))<0;){var s=R(i);if("none"!==s.transform||"none"!==s.perspective||"paint"===s.contain||-1!==["transform","perspective"].indexOf(s.willChange)||t&&"filter"===s.willChange||t&&s.filter&&"none"!==s.filter)return i;i=i.parentNode}return null}(e)||t}function D(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function I(e,t,i){return z(e,A(t,i))}function F(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function j(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}var U={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,s=e.name,l=e.options,p=i.elements.arrow,d=i.modifiersData.popperOffsets,f=_(i.placement),h=D(f),u=[a,n].indexOf(f)>=0?"height":"width";if(p&&d){var m=function(e,t){return F("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:j(e,c))}(l.padding,i),g=B(p),v="y"===h?r:a,y="y"===h?o:n,w=i.rects.reference[u]+i.rects.reference[h]-d[h]-i.rects.popper[u],b=d[h]-i.rects.reference[h],x=P(p),S=x?"y"===h?x.clientHeight||0:x.clientWidth||0:0,z=w/2-b/2,A=m[v],k=S-g[u]-m[y],O=S/2-g[u]/2+z,T=I(A,O,k),M=h;i.modifiersData[s]=((t={})[M]=T,t.centerOffset=T-O,t)}},effect:function(e){var t=e.state,i=e.options.element,s=void 0===i?"[data-popper-arrow]":i;null!=s&&("string"!=typeof s||(s=t.elements.popper.querySelector(s)))&&E(t.elements.popper,s)&&(t.elements.arrow=s)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function q(e){return e.split("-")[1]}var V={top:"auto",right:"auto",bottom:"auto",left:"auto"};function W(e){var t,i=e.popper,s=e.popperRect,l=e.placement,c=e.variation,p=e.offsets,f=e.position,h=e.gpuAcceleration,u=e.adaptive,m=e.roundOffsets,g=e.isFixed,v=p.x,w=void 0===v?0:v,b=p.y,x=void 0===b?0:b,S="function"==typeof m?m({x:w,y:x}):{x:w,y:x};w=S.x,x=S.y;var _=p.hasOwnProperty("x"),z=p.hasOwnProperty("y"),A=a,O=r,T=window;if(u){var M=P(i),B="clientHeight",E="clientWidth";if(M===y(i)&&"static"!==R(M=L(i)).position&&"absolute"===f&&(B="scrollHeight",E="scrollWidth"),l===r||(l===a||l===n)&&c===d)O=o,x-=(g&&M===T&&T.visualViewport?T.visualViewport.height:M[B])-s.height,x*=h?1:-1;if(l===a||(l===r||l===o)&&c===d)A=n,w-=(g&&M===T&&T.visualViewport?T.visualViewport.width:M[E])-s.width,w*=h?1:-1}var H,C=Object.assign({position:f},u&&V),N=!0===m?function(e,t){var i=e.x,s=e.y,r=t.devicePixelRatio||1;return{x:k(i*r)/r||0,y:k(s*r)/r||0}}({x:w,y:x},y(i)):{x:w,y:x};return w=N.x,x=N.y,h?Object.assign({},C,((H={})[O]=z?"0":"",H[A]=_?"0":"",H.transform=(T.devicePixelRatio||1)<=1?"translate("+w+"px, "+x+"px)":"translate3d("+w+"px, "+x+"px, 0)",H)):Object.assign({},C,((t={})[O]=z?x+"px":"",t[A]=_?w+"px":"",t.transform="",t))}var X={passive:!0};var $={left:"right",right:"left",bottom:"top",top:"bottom"};function G(e){return e.replace(/left|right|bottom|top/g,function(e){return $[e]})}var K={start:"end",end:"start"};function Y(e){return e.replace(/start|end/g,function(e){return K[e]})}function J(e){var t=y(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return M(L(e)).left+J(e).scrollLeft}function Z(e){var t=R(e),i=t.overflow,s=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+s)}function ee(e){return["html","body","#document"].indexOf(v(e))>=0?e.ownerDocument.body:b(e)&&Z(e)?e:ee(C(e))}function te(e,t){var i;void 0===t&&(t=[]);var s=ee(e),r=s===(null==(i=e.ownerDocument)?void 0:i.body),o=y(s),n=r?[o].concat(o.visualViewport||[],Z(s)?s:[]):s,a=t.concat(n);return r?a:a.concat(te(C(n)))}function ie(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function se(e,t,i){return t===f?ie(function(e,t){var i=y(e),s=L(e),r=i.visualViewport,o=s.clientWidth,n=s.clientHeight,a=0,l=0;if(r){o=r.width,n=r.height;var c=T();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:n,x:a+Q(e),y:l}}(e,i)):w(t)?function(e,t){var i=M(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):ie(function(e){var t,i=L(e),s=J(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=z(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),n=z(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Q(e),l=-s.scrollTop;return"rtl"===R(r||i).direction&&(a+=z(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:n,x:a,y:l}}(L(e)))}function re(e,t,i,s){var r="clippingParents"===t?function(e){var t=te(C(e)),i=["absolute","fixed"].indexOf(R(e).position)>=0&&b(e)?P(e):e;return w(i)?t.filter(function(e){return w(e)&&E(e,i)&&"body"!==v(e)}):[]}(e):[].concat(t),o=[].concat(r,[i]),n=o[0],a=o.reduce(function(t,i){var r=se(e,i,s);return t.top=z(r.top,t.top),t.right=A(r.right,t.right),t.bottom=A(r.bottom,t.bottom),t.left=z(r.left,t.left),t},se(e,n,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function oe(e){var t,i=e.reference,s=e.element,l=e.placement,c=l?_(l):null,f=l?q(l):null,h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2;switch(c){case r:t={x:h,y:i.y-s.height};break;case o:t={x:h,y:i.y+i.height};break;case n:t={x:i.x+i.width,y:u};break;case a:t={x:i.x-s.width,y:u};break;default:t={x:i.x,y:i.y}}var m=c?D(c):null;if(null!=m){var g="y"===m?"height":"width";switch(f){case p:t[m]=t[m]-(i[g]/2-s[g]/2);break;case d:t[m]=t[m]+(i[g]/2-s[g]/2)}}return t}function ne(e,t){void 0===t&&(t={});var i=t,s=i.placement,a=void 0===s?e.placement:s,l=i.strategy,p=void 0===l?e.strategy:l,d=i.boundary,u=void 0===d?"clippingParents":d,m=i.rootBoundary,g=void 0===m?f:m,v=i.elementContext,y=void 0===v?h:v,b=i.altBoundary,x=void 0!==b&&b,S=i.padding,_=void 0===S?0:S,z=F("number"!=typeof _?_:j(_,c)),A=y===h?"reference":h,k=e.rects.popper,O=e.elements[x?A:y],T=re(w(O)?O:O.contextElement||L(e.elements.popper),u,g,p),B=M(e.elements.reference),E=oe({reference:B,element:k,placement:a}),R=ie(Object.assign({},k,E)),H=y===h?R:B,C={top:T.top-H.top+z.top,bottom:H.bottom-T.bottom+z.bottom,left:T.left-H.left+z.left,right:H.right-T.right+z.right},N=e.modifiersData.offset;if(y===h&&N){var P=N[a];Object.keys(C).forEach(function(e){var t=[n,o].indexOf(e)>=0?1:-1,i=[r,o].indexOf(e)>=0?"y":"x";C[e]+=P[i]*t})}return C}function ae(e,t){void 0===t&&(t={});var i=t,s=i.placement,r=i.boundary,o=i.rootBoundary,n=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,p=void 0===l?m:l,d=q(s),f=d?a?u:u.filter(function(e){return q(e)===d}):c,h=f.filter(function(e){return p.indexOf(e)>=0});0===h.length&&(h=f);var g=h.reduce(function(t,i){return t[i]=ne(e,{placement:i,boundary:r,rootBoundary:o,padding:n})[_(i)],t},{});return Object.keys(g).sort(function(e,t){return g[e]-g[t]})}var le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var c=i.mainAxis,d=void 0===c||c,f=i.altAxis,h=void 0===f||f,u=i.fallbackPlacements,m=i.padding,g=i.boundary,v=i.rootBoundary,y=i.altBoundary,w=i.flipVariations,b=void 0===w||w,x=i.allowedAutoPlacements,S=t.options.placement,z=_(S),A=u||(z===S||!b?[G(S)]:function(e){if(_(e)===l)return[];var t=G(e);return[Y(e),t,Y(t)]}(S)),k=[S].concat(A).reduce(function(e,i){return e.concat(_(i)===l?ae(t,{placement:i,boundary:g,rootBoundary:v,padding:m,flipVariations:b,allowedAutoPlacements:x}):i)},[]),O=t.rects.reference,T=t.rects.popper,M=new Map,B=!0,E=k[0],R=0;R<k.length;R++){var H=k[R],L=_(H),C=q(H)===p,N=[r,o].indexOf(L)>=0,P=N?"width":"height",D=ne(t,{placement:H,boundary:g,rootBoundary:v,altBoundary:y,padding:m}),I=N?C?n:a:C?o:r;O[P]>T[P]&&(I=G(I));var F=G(I),j=[];if(d&&j.push(D[L]<=0),h&&j.push(D[I]<=0,D[F]<=0),j.every(function(e){return e})){E=H,B=!1;break}M.set(H,j)}if(B)for(var U=function(e){var t=k.find(function(t){var i=M.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},V=b?3:1;V>0;V--){if("break"===U(V))break}t.placement!==E&&(t.modifiersData[s]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ce(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function pe(e){return[r,n,o,a].some(function(t){return e[t]>=0})}var de={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,s=e.name,o=i.offset,l=void 0===o?[0,0]:o,c=m.reduce(function(e,i){return e[i]=function(e,t,i){var s=_(e),o=[a,r].indexOf(s)>=0?-1:1,l="function"==typeof i?i(Object.assign({},t,{placement:e})):i,c=l[0],p=l[1];return c=c||0,p=(p||0)*o,[a,n].indexOf(s)>=0?{x:p,y:c}:{x:c,y:p}}(i,t.rects,l),e},{}),p=c[t.placement],d=p.x,f=p.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=f),t.modifiersData[s]=c}};var fe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,s=e.name,l=i.mainAxis,c=void 0===l||l,d=i.altAxis,f=void 0!==d&&d,h=i.boundary,u=i.rootBoundary,m=i.altBoundary,g=i.padding,v=i.tether,y=void 0===v||v,w=i.tetherOffset,b=void 0===w?0:w,x=ne(t,{boundary:h,rootBoundary:u,padding:g,altBoundary:m}),S=_(t.placement),k=q(t.placement),O=!k,T=D(S),M="x"===T?"y":"x",E=t.modifiersData.popperOffsets,R=t.rects.reference,H=t.rects.popper,L="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,C="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(E){if(c){var j,U="y"===T?r:a,V="y"===T?o:n,W="y"===T?"height":"width",X=E[T],$=X+x[U],G=X-x[V],K=y?-H[W]/2:0,Y=k===p?R[W]:H[W],J=k===p?-H[W]:-R[W],Q=t.elements.arrow,Z=y&&Q?B(Q):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[U],ie=ee[V],se=I(0,R[W],Z[W]),re=O?R[W]/2-K-se-te-C.mainAxis:Y-se-te-C.mainAxis,oe=O?-R[W]/2+K+se+ie+C.mainAxis:J+se+ie+C.mainAxis,ae=t.elements.arrow&&P(t.elements.arrow),le=ae?"y"===T?ae.clientTop||0:ae.clientLeft||0:0,ce=null!=(j=null==N?void 0:N[T])?j:0,pe=X+oe-ce,de=I(y?A($,X+re-ce-le):$,X,y?z(G,pe):G);E[T]=de,F[T]=de-X}if(f){var fe,he="x"===T?r:a,ue="x"===T?o:n,me=E[M],ge="y"===M?"height":"width",ve=me+x[he],ye=me-x[ue],we=-1!==[r,a].indexOf(S),be=null!=(fe=null==N?void 0:N[M])?fe:0,xe=we?ve:me-R[ge]-H[ge]-be+C.altAxis,Se=we?me+R[ge]+H[ge]-be-C.altAxis:ye,_e=y&&we?function(e,t,i){var s=I(e,t,i);return s>i?i:s}(xe,me,Se):I(y?xe:ve,me,y?Se:ye);E[M]=_e,F[M]=_e-me}t.modifiersData[s]=F}},requiresIfExists:["offset"]};function he(e,t,i){void 0===i&&(i=!1);var s,r,o=b(t),n=b(t)&&function(e){var t=e.getBoundingClientRect(),i=k(t.width)/e.offsetWidth||1,s=k(t.height)/e.offsetHeight||1;return 1!==i||1!==s}(t),a=L(t),l=M(e,n,i),c={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(o||!o&&!i)&&(("body"!==v(t)||Z(a))&&(c=(s=t)!==y(s)&&b(s)?{scrollLeft:(r=s).scrollLeft,scrollTop:r.scrollTop}:J(s)),b(t)?((p=M(t,!0)).x+=t.clientLeft,p.y+=t.clientTop):a&&(p.x=Q(a))),{x:l.left+c.scrollLeft-p.x,y:l.top+c.scrollTop-p.y,width:l.width,height:l.height}}function ue(e){var t=new Map,i=new Set,s=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var s=t.get(e);s&&r(s)}}),s.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||r(e)}),s}var me={placement:"bottom",modifiers:[],strategy:"absolute"};function ge(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function ve(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,s=void 0===i?[]:i,r=t.defaultOptions,o=void 0===r?me:r;return function(e,t,i){void 0===i&&(i=o);var r,n,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},me,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,p={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;d(),a.options=Object.assign({},o,a.options,r),a.scrollParents={reference:w(e)?te(e):e.contextElement?te(e.contextElement):[],popper:te(t)};var n,c,f=function(e){var t=ue(e);return g.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}((n=[].concat(s,a.options.modifiers),c=n.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return a.orderedModifiers=f.filter(function(e){return e.enabled}),a.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,s=void 0===i?{}:i,r=e.effect;if("function"==typeof r){var o=r({state:a,name:t,instance:p,options:s}),n=function(){};l.push(o||n)}}),p.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,i=e.popper;if(ge(t,i)){a.rects={reference:he(t,P(i),"fixed"===a.options.strategy),popper:B(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(e){return a.modifiersData[e.name]=Object.assign({},e.data)});for(var s=0;s<a.orderedModifiers.length;s++)if(!0!==a.reset){var r=a.orderedModifiers[s],o=r.fn,n=r.options,l=void 0===n?{}:n,d=r.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:p})||a)}else a.reset=!1,s=-1}}},update:(r=function(){return new Promise(function(e){p.forceUpdate(),e(a)})},function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(r())})})),n}),destroy:function(){d(),c=!0}};if(!ge(e,t))return p;function d(){l.forEach(function(e){return e()}),l=[]}return p.setOptions(i).then(function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)}),p}}var ye=ve({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,s=e.options,r=s.scroll,o=void 0===r||r,n=s.resize,a=void 0===n||n,l=y(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(e){e.addEventListener("scroll",i.update,X)}),a&&l.addEventListener("resize",i.update,X),function(){o&&c.forEach(function(e){e.removeEventListener("scroll",i.update,X)}),a&&l.removeEventListener("resize",i.update,X)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=oe({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,s=i.gpuAcceleration,r=void 0===s||s,o=i.adaptive,n=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:_(t.placement),variation:q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,W(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,W(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},S,de,le,fe,U,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,s=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,n=ne(t,{elementContext:"reference"}),a=ne(t,{altBoundary:!0}),l=ce(n,s),c=ce(a,r,o),p=pe(l),d=pe(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":d})}}]});function we(e){if(!e||"function"!=typeof e.showPopover)return!1;try{return e.matches(":popover-open")}catch{return!1}}class be{constructor(e,t,i,s){this.anchor=e,this.popover=t,this.boundaryElement=this.setBoundary(s),this.options={placement:i,visibleClass:"data-show"},this.popover.classList.remove(this.options.visibleClass)}setBoundary(e){return"string"==typeof e?document.querySelector(e)||document.body:e||document.body}show(){if(this.popper&&this.popper.destroy(),this.popover.isConnected&&"function"==typeof this.popover.showPopover&&!we(this.popover))try{this.popover.showPopover()}catch{}const e=we(this.popover);this.popper=ye(this.anchor,this.popover,{tooltip:this.anchor,placement:this.options.placement,strategy:e?"fixed":"absolute",modifiers:[{name:"viewportReferenceForTopLayer",phase:"beforeRead",enabled:!0,fn:({state:e})=>{if(!we(e.elements.popper))return;const t=e.elements.reference;if(!t||"function"!=typeof t.getBoundingClientRect)return;const i=t.getBoundingClientRect();e.rects.reference={x:i.left,y:i.top,width:i.width,height:i.height}}},{name:"offset",options:{offset:[0,18]}},{name:"preventOverflow",options:{mainAxis:!0,boundary:this.boundaryElement,rootBoundary:"document",padding:16}}]})}triggerUpdate(){this.popper.update()}hide(){if(this.popover.isConnected&&"function"==typeof this.popover.hidePopover&&we(this.popover))try{this.popover.hidePopover()}catch{}this.popover.classList.remove(this.options.visibleClass)}}var xe=e`::slotted(*):not([onDark]),::slotted(*):not([appearance=inverse]){color:var(--ds-auro-popover-text-color)}.popover{background-color:var(--ds-auro-popover-container-color);box-shadow:var(--ds-auro-popover-boxshadow-color)}.arrow:before{background-color:var(--ds-auro-popover-container-color);box-shadow:2px 2px 1px 0 var(--ds-auro-popover-boxshadow-color)}
|
|
1
|
+
import{css as e,LitElement as t,html as i}from"lit";class s{registerComponent(e,t){customElements.get(e)||customElements.define(e,class extends t{})}closestElement(e,t=this,i=(t,s=t&&t.closest(e))=>t&&t!==document&&t!==window?s||i(t.getRootNode().host):null){return i(t)}handleComponentTagRename(e,t){const i=t.toLowerCase();e.tagName.toLowerCase()!==i&&e.setAttribute(i,!0)}elementMatch(e,t){const i=t.toLowerCase();return e.tagName.toLowerCase()===i||e.hasAttribute(i)}getSlotText(e,t){const i=e.shadowRoot?.querySelector(`slot[name="${t}"]`);return(i?.assignedNodes({flatten:!0})||[]).map(e=>e.textContent?.trim()).join(" ").trim()||null}}var r="top",o="bottom",n="right",a="left",l="auto",c=[r,o,n,a],d="start",p="end",f="viewport",h="popper",u=c.reduce(function(e,t){return e.concat([t+"-"+d,t+"-"+p])},[]),m=[].concat(c,[l]).reduce(function(e,t){return e.concat([t,t+"-"+d,t+"-"+p])},[]),g=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function v(e){return e?(e.nodeName||"").toLowerCase():null}function y(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function w(e){return e instanceof y(e).Element||e instanceof Element}function b(e){return e instanceof y(e).HTMLElement||e instanceof HTMLElement}function x(e){return"undefined"!=typeof ShadowRoot&&(e instanceof y(e).ShadowRoot||e instanceof ShadowRoot)}var S={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},s=t.attributes[e]||{},r=t.elements[e];b(r)&&v(r)&&(Object.assign(r.style,i),Object.keys(s).forEach(function(e){var t=s[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var s=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});b(s)&&v(s)&&(Object.assign(s.style,o),Object.keys(r).forEach(function(e){s.removeAttribute(e)}))})}},requires:["computeStyles"]};function _(e){return e.split("-")[0]}var z=Math.max,A=Math.min,O=Math.round;function T(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function k(){return!/^((?!chrome|android).)*safari/i.test(T())}function M(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var s=e.getBoundingClientRect(),r=1,o=1;t&&b(e)&&(r=e.offsetWidth>0&&O(s.width)/e.offsetWidth||1,o=e.offsetHeight>0&&O(s.height)/e.offsetHeight||1);var n=(w(e)?y(e):window).visualViewport,a=!k()&&i,l=(s.left+(a&&n?n.offsetLeft:0))/r,c=(s.top+(a&&n?n.offsetTop:0))/o,d=s.width/r,p=s.height/o;return{width:d,height:p,top:c,right:l+d,bottom:c+p,left:l,x:l,y:c}}function R(e){var t=M(e),i=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:s}}function B(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&x(i)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function E(e){return y(e).getComputedStyle(e)}function L(e){return["table","td","th"].indexOf(v(e))>=0}function C(e){return((w(e)?e.ownerDocument:e.document)||window.document).documentElement}function H(e){return"html"===v(e)?e:e.assignedSlot||e.parentNode||(x(e)?e.host:null)||C(e)}function N(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=y(e),i=N(e);i&&L(i)&&"static"===E(i).position;)i=N(i);return i&&("html"===v(i)||"body"===v(i)&&"static"===E(i).position)?t:i||function(e){var t=/firefox/i.test(T());if(/Trident/i.test(T())&&b(e)&&"fixed"===E(e).position)return null;var i=H(e);for(x(i)&&(i=i.host);b(i)&&["html","body"].indexOf(v(i))<0;){var s=E(i);if("none"!==s.transform||"none"!==s.perspective||"paint"===s.contain||-1!==["transform","perspective"].indexOf(s.willChange)||t&&"filter"===s.willChange||t&&s.filter&&"none"!==s.filter)return i;i=i.parentNode}return null}(e)||t}function P(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function I(e,t,i){return z(e,A(t,i))}function F(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function j(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}var q={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,s=e.name,l=e.options,d=i.elements.arrow,p=i.modifiersData.popperOffsets,f=_(i.placement),h=P(f),u=[a,n].indexOf(f)>=0?"height":"width";if(d&&p){var m=function(e,t){return F("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:j(e,c))}(l.padding,i),g=R(d),v="y"===h?r:a,y="y"===h?o:n,w=i.rects.reference[u]+i.rects.reference[h]-p[h]-i.rects.popper[u],b=p[h]-i.rects.reference[h],x=D(d),S=x?"y"===h?x.clientHeight||0:x.clientWidth||0:0,z=w/2-b/2,A=m[v],O=S-g[u]-m[y],T=S/2-g[u]/2+z,k=I(A,T,O),M=h;i.modifiersData[s]=((t={})[M]=k,t.centerOffset=k-T,t)}},effect:function(e){var t=e.state,i=e.options.element,s=void 0===i?"[data-popper-arrow]":i;null!=s&&("string"!=typeof s||(s=t.elements.popper.querySelector(s)))&&B(t.elements.popper,s)&&(t.elements.arrow=s)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function U(e){return e.split("-")[1]}var V={top:"auto",right:"auto",bottom:"auto",left:"auto"};function W(e){var t,i=e.popper,s=e.popperRect,l=e.placement,c=e.variation,d=e.offsets,f=e.position,h=e.gpuAcceleration,u=e.adaptive,m=e.roundOffsets,g=e.isFixed,v=d.x,w=void 0===v?0:v,b=d.y,x=void 0===b?0:b,S="function"==typeof m?m({x:w,y:x}):{x:w,y:x};w=S.x,x=S.y;var _=d.hasOwnProperty("x"),z=d.hasOwnProperty("y"),A=a,T=r,k=window;if(u){var M=D(i),R="clientHeight",B="clientWidth";if(M===y(i)&&"static"!==E(M=C(i)).position&&"absolute"===f&&(R="scrollHeight",B="scrollWidth"),l===r||(l===a||l===n)&&c===p)T=o,x-=(g&&M===k&&k.visualViewport?k.visualViewport.height:M[R])-s.height,x*=h?1:-1;if(l===a||(l===r||l===o)&&c===p)A=n,w-=(g&&M===k&&k.visualViewport?k.visualViewport.width:M[B])-s.width,w*=h?1:-1}var L,H=Object.assign({position:f},u&&V),N=!0===m?function(e,t){var i=e.x,s=e.y,r=t.devicePixelRatio||1;return{x:O(i*r)/r||0,y:O(s*r)/r||0}}({x:w,y:x},y(i)):{x:w,y:x};return w=N.x,x=N.y,h?Object.assign({},H,((L={})[T]=z?"0":"",L[A]=_?"0":"",L.transform=(k.devicePixelRatio||1)<=1?"translate("+w+"px, "+x+"px)":"translate3d("+w+"px, "+x+"px, 0)",L)):Object.assign({},H,((t={})[T]=z?x+"px":"",t[A]=_?w+"px":"",t.transform="",t))}var X={passive:!0};var $={left:"right",right:"left",bottom:"top",top:"bottom"};function G(e){return e.replace(/left|right|bottom|top/g,function(e){return $[e]})}var K={start:"end",end:"start"};function Y(e){return e.replace(/start|end/g,function(e){return K[e]})}function J(e){var t=y(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return M(C(e)).left+J(e).scrollLeft}function Z(e){var t=E(e),i=t.overflow,s=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+s)}function ee(e){return["html","body","#document"].indexOf(v(e))>=0?e.ownerDocument.body:b(e)&&Z(e)?e:ee(H(e))}function te(e,t){var i;void 0===t&&(t=[]);var s=ee(e),r=s===(null==(i=e.ownerDocument)?void 0:i.body),o=y(s),n=r?[o].concat(o.visualViewport||[],Z(s)?s:[]):s,a=t.concat(n);return r?a:a.concat(te(H(n)))}function ie(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function se(e,t,i){return t===f?ie(function(e,t){var i=y(e),s=C(e),r=i.visualViewport,o=s.clientWidth,n=s.clientHeight,a=0,l=0;if(r){o=r.width,n=r.height;var c=k();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:n,x:a+Q(e),y:l}}(e,i)):w(t)?function(e,t){var i=M(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):ie(function(e){var t,i=C(e),s=J(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=z(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),n=z(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Q(e),l=-s.scrollTop;return"rtl"===E(r||i).direction&&(a+=z(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:n,x:a,y:l}}(C(e)))}function re(e,t,i,s){var r="clippingParents"===t?function(e){var t=te(H(e)),i=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return w(i)?t.filter(function(e){return w(e)&&B(e,i)&&"body"!==v(e)}):[]}(e):[].concat(t),o=[].concat(r,[i]),n=o[0],a=o.reduce(function(t,i){var r=se(e,i,s);return t.top=z(r.top,t.top),t.right=A(r.right,t.right),t.bottom=A(r.bottom,t.bottom),t.left=z(r.left,t.left),t},se(e,n,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function oe(e){var t,i=e.reference,s=e.element,l=e.placement,c=l?_(l):null,f=l?U(l):null,h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2;switch(c){case r:t={x:h,y:i.y-s.height};break;case o:t={x:h,y:i.y+i.height};break;case n:t={x:i.x+i.width,y:u};break;case a:t={x:i.x-s.width,y:u};break;default:t={x:i.x,y:i.y}}var m=c?P(c):null;if(null!=m){var g="y"===m?"height":"width";switch(f){case d:t[m]=t[m]-(i[g]/2-s[g]/2);break;case p:t[m]=t[m]+(i[g]/2-s[g]/2)}}return t}function ne(e,t){void 0===t&&(t={});var i=t,s=i.placement,a=void 0===s?e.placement:s,l=i.strategy,d=void 0===l?e.strategy:l,p=i.boundary,u=void 0===p?"clippingParents":p,m=i.rootBoundary,g=void 0===m?f:m,v=i.elementContext,y=void 0===v?h:v,b=i.altBoundary,x=void 0!==b&&b,S=i.padding,_=void 0===S?0:S,z=F("number"!=typeof _?_:j(_,c)),A=y===h?"reference":h,O=e.rects.popper,T=e.elements[x?A:y],k=re(w(T)?T:T.contextElement||C(e.elements.popper),u,g,d),R=M(e.elements.reference),B=oe({reference:R,element:O,placement:a}),E=ie(Object.assign({},O,B)),L=y===h?E:R,H={top:k.top-L.top+z.top,bottom:L.bottom-k.bottom+z.bottom,left:k.left-L.left+z.left,right:L.right-k.right+z.right},N=e.modifiersData.offset;if(y===h&&N){var D=N[a];Object.keys(H).forEach(function(e){var t=[n,o].indexOf(e)>=0?1:-1,i=[r,o].indexOf(e)>=0?"y":"x";H[e]+=D[i]*t})}return H}function ae(e,t){void 0===t&&(t={});var i=t,s=i.placement,r=i.boundary,o=i.rootBoundary,n=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,d=void 0===l?m:l,p=U(s),f=p?a?u:u.filter(function(e){return U(e)===p}):c,h=f.filter(function(e){return d.indexOf(e)>=0});0===h.length&&(h=f);var g=h.reduce(function(t,i){return t[i]=ne(e,{placement:i,boundary:r,rootBoundary:o,padding:n})[_(i)],t},{});return Object.keys(g).sort(function(e,t){return g[e]-g[t]})}var le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var c=i.mainAxis,p=void 0===c||c,f=i.altAxis,h=void 0===f||f,u=i.fallbackPlacements,m=i.padding,g=i.boundary,v=i.rootBoundary,y=i.altBoundary,w=i.flipVariations,b=void 0===w||w,x=i.allowedAutoPlacements,S=t.options.placement,z=_(S),A=u||(z===S||!b?[G(S)]:function(e){if(_(e)===l)return[];var t=G(e);return[Y(e),t,Y(t)]}(S)),O=[S].concat(A).reduce(function(e,i){return e.concat(_(i)===l?ae(t,{placement:i,boundary:g,rootBoundary:v,padding:m,flipVariations:b,allowedAutoPlacements:x}):i)},[]),T=t.rects.reference,k=t.rects.popper,M=new Map,R=!0,B=O[0],E=0;E<O.length;E++){var L=O[E],C=_(L),H=U(L)===d,N=[r,o].indexOf(C)>=0,D=N?"width":"height",P=ne(t,{placement:L,boundary:g,rootBoundary:v,altBoundary:y,padding:m}),I=N?H?n:a:H?o:r;T[D]>k[D]&&(I=G(I));var F=G(I),j=[];if(p&&j.push(P[C]<=0),h&&j.push(P[I]<=0,P[F]<=0),j.every(function(e){return e})){B=L,R=!1;break}M.set(L,j)}if(R)for(var q=function(e){var t=O.find(function(t){var i=M.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return B=t,"break"},V=b?3:1;V>0;V--){if("break"===q(V))break}t.placement!==B&&(t.modifiersData[s]._skip=!0,t.placement=B,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ce(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function de(e){return[r,n,o,a].some(function(t){return e[t]>=0})}var pe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,s=e.name,o=i.offset,l=void 0===o?[0,0]:o,c=m.reduce(function(e,i){return e[i]=function(e,t,i){var s=_(e),o=[a,r].indexOf(s)>=0?-1:1,l="function"==typeof i?i(Object.assign({},t,{placement:e})):i,c=l[0],d=l[1];return c=c||0,d=(d||0)*o,[a,n].indexOf(s)>=0?{x:d,y:c}:{x:c,y:d}}(i,t.rects,l),e},{}),d=c[t.placement],p=d.x,f=d.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=p,t.modifiersData.popperOffsets.y+=f),t.modifiersData[s]=c}};var fe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,s=e.name,l=i.mainAxis,c=void 0===l||l,p=i.altAxis,f=void 0!==p&&p,h=i.boundary,u=i.rootBoundary,m=i.altBoundary,g=i.padding,v=i.tether,y=void 0===v||v,w=i.tetherOffset,b=void 0===w?0:w,x=ne(t,{boundary:h,rootBoundary:u,padding:g,altBoundary:m}),S=_(t.placement),O=U(t.placement),T=!O,k=P(S),M="x"===k?"y":"x",B=t.modifiersData.popperOffsets,E=t.rects.reference,L=t.rects.popper,C="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,H="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(B){if(c){var j,q="y"===k?r:a,V="y"===k?o:n,W="y"===k?"height":"width",X=B[k],$=X+x[q],G=X-x[V],K=y?-L[W]/2:0,Y=O===d?E[W]:L[W],J=O===d?-L[W]:-E[W],Q=t.elements.arrow,Z=y&&Q?R(Q):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[q],ie=ee[V],se=I(0,E[W],Z[W]),re=T?E[W]/2-K-se-te-H.mainAxis:Y-se-te-H.mainAxis,oe=T?-E[W]/2+K+se+ie+H.mainAxis:J+se+ie+H.mainAxis,ae=t.elements.arrow&&D(t.elements.arrow),le=ae?"y"===k?ae.clientTop||0:ae.clientLeft||0:0,ce=null!=(j=null==N?void 0:N[k])?j:0,de=X+oe-ce,pe=I(y?A($,X+re-ce-le):$,X,y?z(G,de):G);B[k]=pe,F[k]=pe-X}if(f){var fe,he="x"===k?r:a,ue="x"===k?o:n,me=B[M],ge="y"===M?"height":"width",ve=me+x[he],ye=me-x[ue],we=-1!==[r,a].indexOf(S),be=null!=(fe=null==N?void 0:N[M])?fe:0,xe=we?ve:me-E[ge]-L[ge]-be+H.altAxis,Se=we?me+E[ge]+L[ge]-be-H.altAxis:ye,_e=y&&we?function(e,t,i){var s=I(e,t,i);return s>i?i:s}(xe,me,Se):I(y?xe:ve,me,y?Se:ye);B[M]=_e,F[M]=_e-me}t.modifiersData[s]=F}},requiresIfExists:["offset"]};function he(e,t,i){void 0===i&&(i=!1);var s,r,o=b(t),n=b(t)&&function(e){var t=e.getBoundingClientRect(),i=O(t.width)/e.offsetWidth||1,s=O(t.height)/e.offsetHeight||1;return 1!==i||1!==s}(t),a=C(t),l=M(e,n,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(o||!o&&!i)&&(("body"!==v(t)||Z(a))&&(c=(s=t)!==y(s)&&b(s)?{scrollLeft:(r=s).scrollLeft,scrollTop:r.scrollTop}:J(s)),b(t)?((d=M(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):a&&(d.x=Q(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function ue(e){var t=new Map,i=new Set,s=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var s=t.get(e);s&&r(s)}}),s.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||r(e)}),s}var me={placement:"bottom",modifiers:[],strategy:"absolute"};function ge(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function ve(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,s=void 0===i?[]:i,r=t.defaultOptions,o=void 0===r?me:r;return function(e,t,i){void 0===i&&(i=o);var r,n,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},me,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,d={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;p(),a.options=Object.assign({},o,a.options,r),a.scrollParents={reference:w(e)?te(e):e.contextElement?te(e.contextElement):[],popper:te(t)};var n,c,f=function(e){var t=ue(e);return g.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}((n=[].concat(s,a.options.modifiers),c=n.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return a.orderedModifiers=f.filter(function(e){return e.enabled}),a.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,s=void 0===i?{}:i,r=e.effect;if("function"==typeof r){var o=r({state:a,name:t,instance:d,options:s}),n=function(){};l.push(o||n)}}),d.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,i=e.popper;if(ge(t,i)){a.rects={reference:he(t,D(i),"fixed"===a.options.strategy),popper:R(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(e){return a.modifiersData[e.name]=Object.assign({},e.data)});for(var s=0;s<a.orderedModifiers.length;s++)if(!0!==a.reset){var r=a.orderedModifiers[s],o=r.fn,n=r.options,l=void 0===n?{}:n,p=r.name;"function"==typeof o&&(a=o({state:a,options:l,name:p,instance:d})||a)}else a.reset=!1,s=-1}}},update:(r=function(){return new Promise(function(e){d.forceUpdate(),e(a)})},function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(r())})})),n}),destroy:function(){p(),c=!0}};if(!ge(e,t))return d;function p(){l.forEach(function(e){return e()}),l=[]}return d.setOptions(i).then(function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)}),d}}var ye=ve({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,s=e.options,r=s.scroll,o=void 0===r||r,n=s.resize,a=void 0===n||n,l=y(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(e){e.addEventListener("scroll",i.update,X)}),a&&l.addEventListener("resize",i.update,X),function(){o&&c.forEach(function(e){e.removeEventListener("scroll",i.update,X)}),a&&l.removeEventListener("resize",i.update,X)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=oe({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,s=i.gpuAcceleration,r=void 0===s||s,o=i.adaptive,n=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:_(t.placement),variation:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,W(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,W(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},S,pe,le,fe,q,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,s=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,n=ne(t,{elementContext:"reference"}),a=ne(t,{altBoundary:!0}),l=ce(n,s),c=ce(a,r,o),d=de(l),p=de(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}}]});function we(e){if(!e||"function"!=typeof e.showPopover)return!1;try{return e.matches(":popover-open")}catch{return!1}}class be{constructor(e,t,i,s){this.anchor=e,this.popover=t,this.boundaryElement=this.setBoundary(s),this.options={placement:i,visibleClass:"data-show"},this.popover.classList.remove(this.options.visibleClass)}setBoundary(e){return"string"==typeof e?document.querySelector(e)||document.body:e||document.body}show(){if(this.popper&&this.popper.destroy(),this.popover.isConnected&&"function"==typeof this.popover.showPopover&&!we(this.popover))try{this.popover.showPopover()}catch{}const e=we(this.popover);this.popper=ye(this.anchor,this.popover,{tooltip:this.anchor,placement:this.options.placement,strategy:e?"fixed":"absolute",modifiers:[{name:"viewportReferenceForTopLayer",phase:"beforeRead",enabled:!0,fn:({state:e})=>{if(!we(e.elements.popper))return;const t=e.elements.reference;if(!t||"function"!=typeof t.getBoundingClientRect)return;const i=t.getBoundingClientRect();e.rects.reference={x:i.left,y:i.top,width:i.width,height:i.height}}},{name:"offset",options:{offset:[0,18]}},{name:"preventOverflow",options:{mainAxis:!0,boundary:this.boundaryElement,rootBoundary:"document",padding:16}}]})}triggerUpdate(){this.popper.update()}hide(){if(this.popover.isConnected&&"function"==typeof this.popover.hidePopover&&we(this.popover))try{this.popover.hidePopover()}catch{}this.popover.classList.remove(this.options.visibleClass)}}var xe=e`::slotted(*):not([onDark]),::slotted(*):not([appearance=inverse]){color:var(--ds-auro-popover-text-color)}.popover{background-color:var(--ds-auro-popover-container-color);box-shadow:var(--ds-auro-popover-boxshadow-color)}.arrow:before{background-color:var(--ds-auro-popover-container-color);box-shadow:2px 2px 1px 0 var(--ds-auro-popover-boxshadow-color)}
|
|
2
2
|
`,Se=e`.body-default{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-default-font-size, 1rem);font-variant-ligatures:none;font-weight:var(--wcss-body-default-weight, );line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-default-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-default-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-default-emphasized-font-size, 1rem);font-variant-ligatures:none;font-weight:var(--wcss-body-default-emphasized-weight, );line-height:var(--wcss-body-default-emphasized-line-height, 1.5rem)}.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-lg-font-size, 1.125rem);font-variant-ligatures:none;font-weight:var(--wcss-body-lg-weight, );line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-lg,.body-lg-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-lg-emphasized-font-size, 1.125rem);font-variant-ligatures:none;font-weight:var(--wcss-body-lg-emphasized-weight, );line-height:var(--wcss-body-lg-emphasized-line-height, 1.625rem)}.body-sm{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-sm-font-size, .875rem);font-variant-ligatures:none;font-weight:var(--wcss-body-sm-weight, );line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-sm-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-sm-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-sm-emphasized-font-size, .875rem);font-variant-ligatures:none;font-weight:var(--wcss-body-sm-emphasized-weight, );line-height:var(--wcss-body-sm-emphasized-line-height, 1.25rem)}.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-xs-font-size, .75rem);font-variant-ligatures:none;font-weight:var(--wcss-body-xs-weight, );line-height:var(--wcss-body-xs-line-height, 1rem)}.body-xs,.body-xs-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-xs-emphasized-font-size, .75rem);font-variant-ligatures:none;font-weight:var(--wcss-body-xs-emphasized-weight, );line-height:var(--wcss-body-xs-emphasized-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, .625rem);font-variant-ligatures:none;font-weight:var(--wcss-body-2xs-weight, );line-height:var(--wcss-body-2xs-line-height, .875rem)}.body-2xs,.body-2xs-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-2xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-emphasized-font-size, .625rem);font-variant-ligatures:none;font-weight:var(--wcss-body-2xs-emphasized-weight, );line-height:var(--wcss-body-2xs-emphasized-line-height, .875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-variant-ligatures:none;font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-variant-ligatures:none;font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-variant-ligatures:none;font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-variant-ligatures:none;font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-variant-ligatures:none;font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-variant-ligatures:none;font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-xs-weight, 300);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-2xs-weight, 300);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, .05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, .05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, .05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, .05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, .05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, .1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(.875rem, 1.1666666667vw, .875rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, .1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host(:not([data-show])) .popover,:host([disabled]) .popover,:host([addspace]) :host(:not([data-show])) .popover{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}::slotted(*){white-space:normal}::slotted(*:hover){cursor:pointer}[data-trigger-placement]::slotted(*:hover){position:relative}[data-trigger-placement]::slotted(*:hover):before{position:absolute;left:0;display:block;width:100%;height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem));content:""}[data-trigger-placement^=top]::slotted(*:hover):before{top:calc(-1 * (var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem)))}[data-trigger-placement^=bottom]::slotted(*:hover):before{bottom:calc(-1 * (var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem)))}:host([data-show]) .popover{z-index:var(--ds-depth-tooltip, 400)}:host([removespace]) .popover{margin:calc(-1 * (var(--ds-size-50, .25rem) + 1px)) 0!important}:host([addspace]) .popover{margin:var(--ds-size-200, 1rem) 0!important}:host([addspace]) [data-trigger-placement]::slotted(*:hover):before{height:var(--ds-size-500, 2.5rem)}:host([addspace]) [data-trigger-placement^=top]::slotted(*:hover):before{top:calc(-1 * var(--ds-size-500, 2.5rem))}:host([addspace]) [data-trigger-placement^=bottom]::slotted(*:hover):before{bottom:calc(-1 * var(--ds-size-500, 2.5rem))}.popover{display:inline-block;max-width:calc(100% - var(--ds-size-400, 2rem));border:0;overflow:visible;border-radius:var(--ds-border-radius, .375rem)}@media screen and (min-width:576px){.popover{max-width:50%}}@media screen and (min-width:768px){.popover{max-width:40%}}@media screen and (min-width:1024px){.popover{max-width:27rem}}[data-popper-placement^=top]>.arrow{bottom:calc(-1 * (var(--ds-size-100, .5rem) + var(--ds-size-25, .125rem)))}[data-popper-placement^=top]>.arrow:before{top:calc(-1 * var(--ds-size-200, 1rem));left:calc(-1 * var(--ds-size-75, .375rem));transform:rotate(45deg)}[data-popper-placement^=bottom]>.arrow{top:calc(-1 * (var(--ds-size-100, .5rem) + var(--ds-size-25, .125rem)))}[data-popper-placement^=bottom]>.arrow:before{top:var(--ds-size-50, .25rem);right:calc(-1 * var(--ds-size-200, 1rem));transform:rotate(-135deg)}.arrow{position:relative;margin-top:-var(--ds-size-100,.5rem)}.arrow:before{position:absolute;width:var(--ds-size-150, .75rem);height:var(--ds-size-150, .75rem);content:""}
|
|
3
3
|
`,_e=e`:host{--ds-auro-popover-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, .15));--ds-auro-popover-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-popover-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}
|
|
4
|
-
`;class ze extends t{constructor(){super(),this.placement="top",this.isPopoverVisible=!1,this._onTouchStart=null,this._onTriggerMouseEnter=null,this._onTriggerMouseLeave=null,this._onTriggerFocus=null,this._onTriggerBlur=null,this._onTriggerKeydown=null,this._onHidePopover=null,this._onBodyMouseover=null,this._onSlotChange=null,this._addedTabIndex=!1}_initializeDefaults(){this.runtimeUtils=new s}static get properties(){return{addSpace:{type:Boolean,reflect:!0,attribute:"addspace"},boundary:{type:String},disabled:{type:Boolean,reflect:!0},for:{type:String,reflect:!0},placement:{type:String},removeSpace:{type:Boolean,reflect:!0,attribute:"removespace"},isPopoverVisible:{type:Boolean,reflect:!0,attribute:"data-show",converter:{fromAttribute:e=>null!==e,toAttribute:e=>e?"true":null}}}}static get styles(){return[e`${Se}`,e`${xe}`,e`${_e}`]}static register(e="auro-popover"){s.prototype.registerComponent(e,ze)}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","none"),this._initializeDefaults(),this._onTouchStart||(this._onTouchStart=()=>{this.toggle()}),this.addEventListener("touchstart",this._onTouchStart)}disconnectedCallback(){if(super.disconnectedCallback(),this.removeEventListener("touchstart",this._onTouchStart),this.trigger){this._onTriggerMouseEnter&&this._eventTarget.removeEventListener("mouseenter",this._onTriggerMouseEnter),this._onTriggerMouseLeave&&this._eventTarget.removeEventListener("mouseleave",this._onTriggerMouseLeave),this._onTriggerFocus&&this.trigger.removeEventListener("focusin",this._onTriggerFocus),this._onTriggerBlur&&this.trigger.removeEventListener("focusout",this._onTriggerBlur),this._onTriggerKeydown&&this.trigger.removeEventListener("keydown",this._onTriggerKeydown),this._onSlotChange&&this.shadowRoot?.querySelector("slot:not([name])")?.removeEventListener("slotchange",this._onSlotChange);for(const e of this._ariaDescriptionTargets||[this.trigger])e.removeAttribute("aria-description");this._addedTabIndex&&"0"===this.trigger.getAttribute("tabindex")&&this.trigger.removeAttribute("tabindex")}this._onHidePopover&&this.removeEventListener("hidePopover",this._onHidePopover),this._onBodyMouseover&&document.body.removeEventListener("mouseover",this._onBodyMouseover),this.popper?.popper&&"function"==typeof this.popper.popper.destroy&&(this.popper.popper.destroy(),this.popper.popper=null)}firstUpdated(){this.runtimeUtils.handleComponentTagRename(this,"auro-popover"),this.for&&(this.trigger=document.querySelector(`#${this.for}`)||this.getRootNode().querySelector(`#${this.for}`)),this.trigger||([this.trigger]=this.shadowRoot.querySelector('slot[name="trigger"]').assignedElements()),this.trigger&&(this._setupAccessibility(),this._setupEventListeners(),this.isPopoverVisible&&this.popper&&(this.disabled?this.isPopoverVisible=!1:(this.popper.show(),document.body.addEventListener("mouseover",this._onBodyMouseover))))}_setupEventListeners(){this.auroPopover=this.shadowRoot.querySelector("#popover"),this.popper=new be(this.trigger,this.auroPopover,this.placement,this.boundary),this._onBodyMouseover=e=>this.handleMouseoverEvent(e),this._onTriggerMouseEnter=()=>{this.toggleShow()},this._onTriggerMouseLeave=()=>{this.toggleHide()},this._onTriggerFocus=()=>{this.toggleShow()},this._onTriggerBlur=e=>{let t=e.relatedTarget,i=!1;for(;t;){if(this.trigger.contains(t)||this.contains(t)){i=!0;break}const e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}i||this.toggleHide()},this._onTriggerKeydown=e=>{const t=e.key.toLowerCase();if(this.isPopoverVisible&&("tab"!==t&&"escape"!==t||this.toggleHide())," "===t||"enter"===t){if(e.target!==this.trigger&&!this._addedTabIndex)return;" "===t&&this._addedTabIndex&&e.preventDefault(),this.toggle()}},this._onHidePopover=()=>{this.toggleHide()},this._eventTarget=this.trigger.parentElement.localName===this.localName?this:this.trigger,this._eventTarget.addEventListener("mouseenter",this._onTriggerMouseEnter),this._eventTarget.addEventListener("mouseleave",this._onTriggerMouseLeave),this.trigger.addEventListener("keydown",this._onTriggerKeydown),this.trigger.addEventListener("focusin",this._onTriggerFocus),this.trigger.addEventListener("focusout",this._onTriggerBlur),this.addEventListener("hidePopover",this._onHidePopover)}_setupAccessibility(){const e=this.trigger.tabIndex>=0,
|
|
4
|
+
`;class ze extends t{constructor(){super(),this.placement="top",this.isPopoverVisible=!1,this._onTouchStart=null,this._onTriggerMouseEnter=null,this._onTriggerMouseLeave=null,this._onTriggerFocus=null,this._onTriggerBlur=null,this._onTriggerKeydown=null,this._onHidePopover=null,this._onBodyMouseover=null,this._onSlotChange=null,this._addedTabIndex=!1}_initializeDefaults(){this.runtimeUtils=new s}static get properties(){return{addSpace:{type:Boolean,reflect:!0,attribute:"addspace"},boundary:{type:String},disabled:{type:Boolean,reflect:!0},for:{type:String,reflect:!0},placement:{type:String},removeSpace:{type:Boolean,reflect:!0,attribute:"removespace"},isPopoverVisible:{type:Boolean,reflect:!0,attribute:"data-show",converter:{fromAttribute:e=>null!==e,toAttribute:e=>e?"true":null}}}}static get styles(){return[e`${Se}`,e`${xe}`,e`${_e}`]}static register(e="auro-popover"){s.prototype.registerComponent(e,ze)}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","none"),this._initializeDefaults(),this._onTouchStart||(this._onTouchStart=()=>{this.toggle()}),this.addEventListener("touchstart",this._onTouchStart)}disconnectedCallback(){if(super.disconnectedCallback(),this.removeEventListener("touchstart",this._onTouchStart),this._a11yObserver?.disconnect(),this.trigger){this._onTriggerMouseEnter&&this._eventTarget.removeEventListener("mouseenter",this._onTriggerMouseEnter),this._onTriggerMouseLeave&&this._eventTarget.removeEventListener("mouseleave",this._onTriggerMouseLeave),this._onTriggerFocus&&this.trigger.removeEventListener("focusin",this._onTriggerFocus),this._onTriggerBlur&&this.trigger.removeEventListener("focusout",this._onTriggerBlur),this._onTriggerKeydown&&this.trigger.removeEventListener("keydown",this._onTriggerKeydown),this._onSlotChange&&this.shadowRoot?.querySelector("slot:not([name])")?.removeEventListener("slotchange",this._onSlotChange);for(const e of this._ariaDescriptionTargets||[this.trigger])e.removeAttribute("aria-description");this._addedTabIndex&&"0"===this.trigger.getAttribute("tabindex")&&this.trigger.removeAttribute("tabindex")}this._onHidePopover&&this.removeEventListener("hidePopover",this._onHidePopover),this._onBodyMouseover&&document.body.removeEventListener("mouseover",this._onBodyMouseover),this.popper?.popper&&"function"==typeof this.popper.popper.destroy&&(this.popper.popper.destroy(),this.popper.popper=null)}firstUpdated(){this.runtimeUtils.handleComponentTagRename(this,"auro-popover"),this.for&&(this.trigger=document.querySelector(`#${this.for}`)||this.getRootNode().querySelector(`#${this.for}`)),this.trigger||([this.trigger]=this.shadowRoot.querySelector('slot[name="trigger"]').assignedElements()),this.trigger&&(this._setupAccessibility(),this._setupEventListeners(),this.isPopoverVisible&&this.popper&&(this.disabled?this.isPopoverVisible=!1:(this.popper.show(),document.body.addEventListener("mouseover",this._onBodyMouseover))))}_setupEventListeners(){this.auroPopover=this.shadowRoot.querySelector("#popover"),this.popper=new be(this.trigger,this.auroPopover,this.placement,this.boundary),this._onBodyMouseover=e=>this.handleMouseoverEvent(e),this._onTriggerMouseEnter=()=>{this.toggleShow()},this._onTriggerMouseLeave=()=>{this.toggleHide()},this._onTriggerFocus=()=>{this.toggleShow()},this._onTriggerBlur=e=>{let t=e.relatedTarget,i=!1;for(;t;){if(this.trigger.contains(t)||this.contains(t)){i=!0;break}const e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}i||this.toggleHide()},this._onTriggerKeydown=e=>{const t=e.key.toLowerCase();if(this.isPopoverVisible&&("tab"!==t&&"escape"!==t||this.toggleHide())," "===t||"enter"===t){if(e.target!==this.trigger&&!this._addedTabIndex)return;" "===t&&this._addedTabIndex&&e.preventDefault(),this.toggle()}},this._onHidePopover=()=>{this.toggleHide()},this._eventTarget=this.trigger.parentElement.localName===this.localName?this:this.trigger,this._eventTarget.addEventListener("mouseenter",this._onTriggerMouseEnter),this._eventTarget.addEventListener("mouseleave",this._onTriggerMouseLeave),this.trigger.addEventListener("keydown",this._onTriggerKeydown),this.trigger.addEventListener("focusin",this._onTriggerFocus),this.trigger.addEventListener("focusout",this._onTriggerBlur),this.addEventListener("hidePopover",this._onHidePopover)}_setupAccessibility(){const e=this.shadowRoot.querySelector("slot:not([name])");this._onSlotChange=()=>{const e=this._getSlotText();for(const t of this._ariaDescriptionTargets)t?.setAttribute("aria-description",e)},e.addEventListener("slotchange",this._onSlotChange),this._a11yObserver=new MutationObserver(()=>{this._updateAccessibility(),this._observeTrigger()}),this._updateAccessibility(),this._observeTrigger()}_observeTrigger(){const e={childList:!0,subtree:!0},t=[this.trigger,...this.trigger.querySelectorAll("*")];this._pendingDefinitions??=new Set;for(const i of t)this._a11yObserver.observe(i,e),i.localName.includes("-")&&(i.shadowRoot?this._a11yObserver.observe(i.shadowRoot,e):customElements.get(i.localName)||this._pendingDefinitions.has(i.localName)||(this._pendingDefinitions.add(i.localName),customElements.whenDefined(i.localName).then(()=>{this._pendingDefinitions.delete(i.localName),this.isConnected&&this._a11yObserver&&(this._updateAccessibility(),this._observeTrigger())})))}_getSlotText(){return this.shadowRoot.querySelector("slot:not([name])").assignedNodes({flatten:!0}).map(e=>e.textContent??"").join(" ").replace(/\s+/g," ").trim()}_updateAccessibility(){const e=this._addedTabIndex&&"0"===this.trigger.getAttribute("tabindex"),t=this.trigger.tabIndex>=0&&!e,i='button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]:not([contenteditable="false"]), summary, iframe, audio[controls], video[controls]',s=e=>{if(e.tabIndex<0)return!1;let t=e;for(;t;){if(t.closest("[hidden], [inert]"))return!1;const e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!0};let r=[...this.trigger.querySelectorAll(i)].some(s);if(!r){const e=this.trigger.querySelectorAll("*");for(const t of e)if(t.localName.includes("-")&&(t.tabIndex>=0||t.shadowRoot&&[...t.shadowRoot.querySelectorAll(i)].some(s))){r=!0;break}}!r&&this.trigger.localName.includes("-")&&this.trigger.shadowRoot&&(r=[...this.trigger.shadowRoot.querySelectorAll(i)].some(s));const o=!t&&!r&&(e||!this.trigger.hasAttribute("tabindex"));o&&!e?(this.trigger.setAttribute("tabindex","0"),this._addedTabIndex=!0):!o&&e&&(this.trigger.removeAttribute("tabindex"),this._addedTabIndex=!1);const n=this._ariaDescriptionTargets??[];if(this._ariaDescriptionTargets=[],!t&&r){const e=[...this.trigger.querySelectorAll(i)].filter(s);this._ariaDescriptionTargets.push(...e);const t=this.trigger.querySelectorAll("*");for(const r of t)if(r.localName.includes("-")&&!e.includes(r))if(r.tabIndex>=0)this._ariaDescriptionTargets.push(r);else if(r.shadowRoot){const e=[...r.shadowRoot.querySelectorAll(i)].filter(s);for(const t of e)this._ariaDescriptionTargets.push(t)}if(0===this._ariaDescriptionTargets.length){if(this.trigger.localName.includes("-")&&this.trigger.shadowRoot){const e=[...this.trigger.shadowRoot.querySelectorAll(i)].filter(s);this._ariaDescriptionTargets.push(...e)}0===this._ariaDescriptionTargets.length&&this._ariaDescriptionTargets.push(this.trigger)}}else this._ariaDescriptionTargets.push(this.trigger);for(const e of n)this._ariaDescriptionTargets.includes(e)||e.removeAttribute("aria-description");const a=this._getSlotText();for(const e of this._ariaDescriptionTargets)e.setAttribute("aria-description",a)}toggle(){this.popper&&(this.isPopoverVisible?this.toggleHide():this.toggleShow())}toggleHide(){this.isPopoverVisible=!1}toggleShow(){this.popper&&!this.disabled&&(this.isPopoverVisible=!0)}handleMouseoverEvent(e){this.isPopoverVisible&&!e.composedPath().includes(this)&&this.toggleHide()}updated(e){if(e.has("boundary")&&this.popper&&(this.popper.boundaryElement=this.popper.setBoundary(this.boundary)),e.has("isPopoverVisible")&&this.popper)if(this.isPopoverVisible){if(this.disabled)return void(this.isPopoverVisible=!1);this.popper.show(),document.body.addEventListener("mouseover",this._onBodyMouseover)}else this._onBodyMouseover&&document.body.removeEventListener("mouseover",this._onBodyMouseover),this.popper.hide();e.has("disabled")&&this.disabled&&this.isPopoverVisible&&(this.isPopoverVisible=!1)}render(){return i`
|
|
5
5
|
<div
|
|
6
6
|
id="popover"
|
|
7
7
|
class="popover util_insetLg body-default"
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as AuroPopover}from"./auro-popover-
|
|
1
|
+
export{A as AuroPopover}from"./auro-popover-CUbr53m1.js";import"lit";
|
package/dist/registered.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as r}from"./auro-popover-
|
|
1
|
+
import{A as r}from"./auro-popover-CUbr53m1.js";import"lit";r.register();
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"================================================================================"
|
|
8
8
|
],
|
|
9
9
|
"name": "@aurodesignsystem-dev/auro-popover",
|
|
10
|
-
"version": "0.0.0-
|
|
10
|
+
"version": "0.0.0-pr145.0",
|
|
11
11
|
"description": "auro-popover HTML custom element",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|