@sbb-esta/lyne-elements 3.8.0 → 3.9.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/core/base-elements/open-close-base-element.d.ts +2 -0
- package/core/base-elements/open-close-base-element.d.ts.map +1 -1
- package/core/base-elements/open-close-base-element.js +4 -0
- package/core/controllers/escapable-overlay-controller.js +3 -3
- package/core/controllers/inert-controller.d.ts +8 -1
- package/core/controllers/inert-controller.d.ts.map +1 -1
- package/core/controllers/inert-controller.js +25 -13
- package/core/overlay/position.d.ts +20 -0
- package/core/overlay/position.d.ts.map +1 -1
- package/core/overlay/position.js +34 -23
- package/core/overlay.js +11 -10
- package/core/styles/core.scss +7 -0
- package/core.css +6 -0
- package/custom-elements.json +612 -138
- package/development/core/base-elements/open-close-base-element.d.ts +2 -0
- package/development/core/base-elements/open-close-base-element.d.ts.map +1 -1
- package/development/core/base-elements/open-close-base-element.js +5 -1
- package/development/core/controllers/escapable-overlay-controller.js +2 -2
- package/development/core/controllers/inert-controller.d.ts +8 -1
- package/development/core/controllers/inert-controller.d.ts.map +1 -1
- package/development/core/controllers/inert-controller.js +49 -30
- package/development/core/overlay/position.d.ts +20 -0
- package/development/core/overlay/position.d.ts.map +1 -1
- package/development/core/overlay/position.js +41 -1
- package/development/core/overlay.js +2 -1
- package/development/menu/common/menu-action-common.d.ts.map +1 -1
- package/development/menu/common/menu-action-common.js +20 -3
- package/development/menu/menu/menu.component.d.ts +21 -10
- package/development/menu/menu/menu.component.d.ts.map +1 -1
- package/development/menu/menu/menu.component.js +203 -61
- package/development/option/option/option.component.js +4 -2
- package/development/tabs/tab/tab.component.d.ts +10 -4
- package/development/tabs/tab/tab.component.d.ts.map +1 -1
- package/development/tabs/tab/tab.component.js +15 -16
- package/development/tabs/tab-group/tab-group.component.d.ts +15 -14
- package/development/tabs/tab-group/tab-group.component.d.ts.map +1 -1
- package/development/tabs/tab-group/tab-group.component.js +46 -175
- package/development/tabs/tab-label/tab-label.component.d.ts +21 -2
- package/development/tabs/tab-label/tab-label.component.d.ts.map +1 -1
- package/development/tabs/tab-label/tab-label.component.js +91 -6
- package/development/tooltip/tooltip.component.d.ts +6 -6
- package/development/tooltip/tooltip.component.d.ts.map +1 -1
- package/development/tooltip/tooltip.component.js +14 -7
- package/menu/common/menu-action-common.d.ts.map +1 -1
- package/menu/common/menu-action-common.js +15 -12
- package/menu/menu/menu.component.d.ts +21 -10
- package/menu/menu/menu.component.d.ts.map +1 -1
- package/menu/menu/menu.component.js +144 -80
- package/off-brand-theme.css +6 -0
- package/option/option/option.component.js +1 -1
- package/package.json +1 -1
- package/safety-theme.css +6 -0
- package/standard-theme.css +6 -0
- package/tabs/tab/tab.component.d.ts +10 -4
- package/tabs/tab/tab.component.d.ts.map +1 -1
- package/tabs/tab/tab.component.js +22 -24
- package/tabs/tab-group/tab-group.component.d.ts +15 -14
- package/tabs/tab-group/tab-group.component.d.ts.map +1 -1
- package/tabs/tab-group/tab-group.component.js +68 -122
- package/tabs/tab-label/tab-label.component.d.ts +21 -2
- package/tabs/tab-label/tab-label.component.d.ts.map +1 -1
- package/tabs/tab-label/tab-label.component.js +88 -46
- package/tooltip/tooltip.component.d.ts +6 -6
- package/tooltip/tooltip.component.d.ts.map +1 -1
- package/tooltip/tooltip.component.js +59 -54
|
@@ -23,20 +23,20 @@ export declare class SbbTooltipElement extends SbbTooltipElement_base {
|
|
|
23
23
|
* Open the tooltip after a given delay in milliseconds.
|
|
24
24
|
* Global configuration is used as default, if not set.
|
|
25
25
|
*
|
|
26
|
-
* @default
|
|
26
|
+
* @default null
|
|
27
27
|
*/
|
|
28
|
-
set openDelay(value: number);
|
|
28
|
+
set openDelay(value: number | null);
|
|
29
29
|
get openDelay(): number;
|
|
30
|
-
private _openDelay
|
|
30
|
+
private _openDelay;
|
|
31
31
|
/**
|
|
32
32
|
* Close the tooltip after a given delay in milliseconds.
|
|
33
33
|
* Global configuration is used as default, if not set.
|
|
34
34
|
*
|
|
35
|
-
* @default
|
|
35
|
+
* @default null
|
|
36
36
|
*/
|
|
37
|
-
set closeDelay(value: number);
|
|
37
|
+
set closeDelay(value: number | null);
|
|
38
38
|
get closeDelay(): number;
|
|
39
|
-
private _closeDelay
|
|
39
|
+
private _closeDelay;
|
|
40
40
|
/**
|
|
41
41
|
* Automatically close the tooltip after it has been open by long press.
|
|
42
42
|
* Global configuration is used as default, if not set.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.component.d.ts","sourceRoot":"","sources":["../../../src/elements/tooltip/tooltip.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAIb,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;;AA6BnE;;;;;;;GAOG;AACH,qBAEM,iBAAkB,SAAQ,sBAAyC;IACvE,gBAAgC,IAAI,aAAa;IACjD,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAU;IAUvC;;;;OAIG;IACH,SAEgB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAQ;IAEnD;;;;;OAKG;IACH,IACW,SAAS,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tooltip.component.d.ts","sourceRoot":"","sources":["../../../src/elements/tooltip/tooltip.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAIb,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;;AA6BnE;;;;;;;GAOG;AACH,qBAEM,iBAAkB,SAAQ,sBAAyC;IACvE,gBAAgC,IAAI,aAAa;IACjD,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAU;IAUvC;;;;OAIG;IACH,SAEgB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAQ;IAEnD;;;;;OAKG;IACH,IACW,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAExC;IACD,IAAW,SAAS,IAAI,MAAM,CAE7B;IACD,OAAO,CAAC,UAAU,CAAuB;IAEzC;;;;;OAKG;IACH,IACW,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAEzC;IACD,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,OAAO,CAAC,WAAW,CAAuB;IAE1C;;;;;OAKG;IACH,IACW,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAE3C;IACD,IAAW,mBAAmB,IAAI,MAAM,CAEvC;IACD,OAAO,CAAC,oBAAoB,CAAC,CAAS;IAEtC,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAEnC,OAAO,CAAC,eAAe,CAA4B;IACnD,OAAO,CAAC,uBAAuB,CAAC,CAAkB;IAClD,OAAO,CAAC,oBAAoB,CAAmB;IAC/C,OAAO,CAAC,2BAA2B,CAA2C;IAC9E,OAAO,CAAC,YAAY,CAAC,CAAgC;IACrD,OAAO,CAAC,aAAa,CAAC,CAAgC;IACtD,OAAO,CAAC,qBAAqB,CAAC,CAAgC;IAC9D,OAAO,CAAC,sBAAsB,CAAC,CAAgC;;IAwB/D,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAmCvC,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAM5C,OAAO,CAAC,MAAM,CAAC,qBAAqB;IA2BpB,iBAAiB,IAAI,IAAI;IAYzB,oBAAoB,IAAI,IAAI;IAM5B,aAAa,CAC3B,IAAI,CAAC,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,IAAI;cAWY,YAAY,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;IAKjE,IAAI,IAAI,IAAI;IAsBZ,KAAK,IAAI,IAAI;IAgBpB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,OAAO;IAgBf,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,wBAAwB;IA0DhC,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,sBAAsB;cAKX,MAAM,IAAI,cAAc;CAW5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,aAAa,EAAE,iBAAiB,CAAC;KAClC;CACF"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var E = (s) => {
|
|
2
|
+
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var O = (
|
|
5
|
-
var
|
|
4
|
+
var O = (s, i, a) => i.has(s) || E("Cannot " + a);
|
|
5
|
+
var w = (s, i, a) => (O(s, i, "read from private field"), a ? a.call(s) : i.get(s)), P = (s, i, a) => i.has(s) ? E("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, a), u = (s, i, a, r) => (O(s, i, "write to private field"), r ? r.call(s, a) : i.set(s, a), a);
|
|
6
6
|
import { __esDecorate as b, __runInitializers as h } from "tslib";
|
|
7
|
-
import { css as
|
|
8
|
-
import { customElement as
|
|
9
|
-
import { ref as
|
|
10
|
-
import { SbbOpenCloseBaseElement as
|
|
7
|
+
import { css as k, isServer as A, html as S } from "lit";
|
|
8
|
+
import { customElement as z, property as c } from "lit/decorators.js";
|
|
9
|
+
import { ref as N } from "lit/directives/ref.js";
|
|
10
|
+
import { SbbOpenCloseBaseElement as I } from "../core/base-elements.js";
|
|
11
11
|
import { readConfig as g } from "../core/config.js";
|
|
12
|
-
import { SbbEscapableOverlayController as
|
|
12
|
+
import { SbbEscapableOverlayController as M } from "../core/controllers.js";
|
|
13
13
|
import { idReference as H } from "../core/decorators.js";
|
|
14
|
-
import { queueDomContentLoaded as F, addToListAttribute as
|
|
15
|
-
import { SbbDisabledMixin as
|
|
16
|
-
import { sbbOverlayOutsidePointerEventListener as
|
|
17
|
-
const
|
|
18
|
-
let
|
|
19
|
-
var n,
|
|
20
|
-
let
|
|
21
|
-
return
|
|
14
|
+
import { queueDomContentLoaded as F, addToListAttribute as U, removeFromListAttribute as Z, isZeroAnimationDuration as $, isAndroid as q, isIOS as R } from "../core/dom.js";
|
|
15
|
+
import { SbbDisabledMixin as B } from "../core/mixins.js";
|
|
16
|
+
import { sbbOverlayOutsidePointerEventListener as L, getElementPosition as W } from "../core/overlay.js";
|
|
17
|
+
const j = k`*,:before,:after{box-sizing:border-box}:host{--sbb-tooltip-position: absolute;--sbb-tooltip-position-x: 0;--sbb-tooltip-position-y: 0;--sbb-tooltip-pointer-events: all;--sbb-tooltip-max-width: min( 25rem, calc(100% - var(--sbb-spacing-fixed-2x)) );--sbb-tooltip-border-color: var(--sbb-background-color-1-inverted);--sbb-tooltip-border-radius: var(--sbb-border-radius-8x);--sbb-tooltip-padding: var(--sbb-spacing-fixed-2x) var(--sbb-spacing-fixed-4x);--sbb-tooltip-background-color: var(--sbb-background-color-1-inverted);--sbb-tooltip-color: var(--sbb-color-2-inverted);--sbb-tooltip-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-tooltip-animation-easing: ease-out;--sbb-tooltip-animation-translate: 0 var(--sbb-spacing-fixed-2x);display:none;position:fixed;inset:0;z-index:var(--sbb-tooltip-z-index, var(--sbb-overlay-default-z-index))}:host([data-state]:not([data-state=closed])){display:block;--sbb-tooltip-animation-name: open}:host([data-state][data-state=closing]){--sbb-tooltip-animation-name: close;--sbb-tooltip-pointer-events: none}:host([data-position=below]){--sbb-tooltip-hover-patch-inset: calc(-1 * var(--sbb-spacing-fixed-4x)) 0}:host([data-position=above]){--sbb-tooltip-hover-patch-inset: 0 calc(-1 * var(--sbb-spacing-fixed-4x))}.sbb-tooltip{box-shadow:var(--sbb-shadow-elevation-level-5-shadow-2-offset-x) var(--sbb-shadow-elevation-level-5-shadow-2-offset-y) var(--sbb-shadow-elevation-level-5-shadow-2-blur) var(--sbb-shadow-elevation-level-5-shadow-2-spread) var(--sbb-shadow-color-soft-2),var(--sbb-shadow-elevation-level-5-shadow-1-offset-x) var(--sbb-shadow-elevation-level-5-shadow-1-offset-y) var(--sbb-shadow-elevation-level-5-shadow-1-blur) var(--sbb-shadow-elevation-level-5-shadow-1-spread) var(--sbb-shadow-color-soft-1);--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);position:var(--sbb-tooltip-position);pointer-events:var(--sbb-tooltip-pointer-events);top:var(--sbb-tooltip-position-y);bottom:unset;left:var(--sbb-tooltip-position-x);right:unset;border:var(--sbb-border-width-1x) solid var(--sbb-tooltip-border-color);border-radius:var(--sbb-tooltip-border-radius);padding:var(--sbb-tooltip-padding);max-width:var(--sbb-tooltip-max-width);width:max-content;color:var(--sbb-tooltip-color);background-color:var(--sbb-tooltip-background-color);outline:none;animation-name:var(--sbb-tooltip-animation-name);animation-duration:var(--sbb-tooltip-animation-duration);animation-timing-function:var(--sbb-tooltip-animation-easing)}.sbb-tooltip:before{content:"";display:block;position:absolute;inset:0;z-index:-1;background-color:transparent;inset-block:var(--sbb-tooltip-hover-patch-inset)}@keyframes open{0%{opacity:0;translate:var(--sbb-tooltip-animation-translate)}to{opacity:1;translate:0}}@keyframes close{0%{opacity:1;translate:0}to{opacity:0;translate:var(--sbb-tooltip-animation-translate)}}`, G = 500, V = 8, Y = 16, J = q || R, m = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
let K = 0, pt = (() => {
|
|
19
|
+
var n, l;
|
|
20
|
+
let s = [z("sbb-tooltip")], i, a = [], r, v = B(I), p = [], _, y = [], f = [], T, C, x;
|
|
21
|
+
return l = class extends v {
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
24
|
-
|
|
25
|
-
u(this, n, (h(this, p), h(this,
|
|
24
|
+
P(this, n);
|
|
25
|
+
u(this, n, (h(this, p), h(this, y, null))), this._openDelay = (h(this, f), null), this._closeDelay = null, this._triggerElement = null, this._escapableOverlayController = new M(this), this.addEventListener("mouseleave", (t) => {
|
|
26
26
|
(this.state === "opened" || this.state === "opening") && (!t.relatedTarget || !this._triggerElement?.contains(t.relatedTarget)) && this._delayedClose();
|
|
27
27
|
}, { passive: !0 }), this.addEventListener("overlayOutsidePointer", () => this.close(), { passive: !0 });
|
|
28
28
|
}
|
|
@@ -32,7 +32,7 @@ let J = 0, bt = (() => {
|
|
|
32
32
|
* For attribute usage, provide an id reference.
|
|
33
33
|
*/
|
|
34
34
|
get trigger() {
|
|
35
|
-
return
|
|
35
|
+
return w(this, n);
|
|
36
36
|
}
|
|
37
37
|
set trigger(t) {
|
|
38
38
|
u(this, n, t);
|
|
@@ -41,10 +41,10 @@ let J = 0, bt = (() => {
|
|
|
41
41
|
* Open the tooltip after a given delay in milliseconds.
|
|
42
42
|
* Global configuration is used as default, if not set.
|
|
43
43
|
*
|
|
44
|
-
* @default
|
|
44
|
+
* @default null
|
|
45
45
|
*/
|
|
46
46
|
set openDelay(t) {
|
|
47
|
-
this._openDelay =
|
|
47
|
+
this._openDelay = t;
|
|
48
48
|
}
|
|
49
49
|
get openDelay() {
|
|
50
50
|
return this._openDelay ?? g().tooltip?.openDelay ?? 0;
|
|
@@ -53,10 +53,10 @@ let J = 0, bt = (() => {
|
|
|
53
53
|
* Close the tooltip after a given delay in milliseconds.
|
|
54
54
|
* Global configuration is used as default, if not set.
|
|
55
55
|
*
|
|
56
|
-
* @default
|
|
56
|
+
* @default null
|
|
57
57
|
*/
|
|
58
58
|
set closeDelay(t) {
|
|
59
|
-
this._closeDelay =
|
|
59
|
+
this._closeDelay = t;
|
|
60
60
|
}
|
|
61
61
|
get closeDelay() {
|
|
62
62
|
return this._closeDelay ?? g().tooltip?.closeDelay ?? 0;
|
|
@@ -74,15 +74,20 @@ let J = 0, bt = (() => {
|
|
|
74
74
|
return this._longPressCloseDelay ?? g().tooltip?.longPressCloseDelay ?? 1500;
|
|
75
75
|
}
|
|
76
76
|
static _initializeTooltipOutlet() {
|
|
77
|
-
this._tooltipOutlet = document.createElement("div"), this._tooltipOutlet.classList.add("sbb-overlay-outlet"), document.body.appendChild(this._tooltipOutlet)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
this._tooltipOutlet = document.createElement("div"), this._tooltipOutlet.classList.add("sbb-overlay-outlet"), document.body.appendChild(this._tooltipOutlet);
|
|
78
|
+
const t = /* @__PURE__ */ new Map([
|
|
79
|
+
["sbb-tooltip-open-delay", "open-delay"],
|
|
80
|
+
["sbb-tooltip-close-delay", "close-delay"]
|
|
81
|
+
]);
|
|
82
|
+
new MutationObserver((e) => {
|
|
83
|
+
for (const o of e)
|
|
84
|
+
if (o.type === "attributes")
|
|
85
|
+
this._handleTooltipTrigger(o.target);
|
|
86
|
+
else if (o.type === "childList")
|
|
87
|
+
for (const d of [...o.addedNodes, ...o.removedNodes].filter((D) => D.nodeType === D.ELEMENT_NODE))
|
|
88
|
+
this._handleTooltipTrigger(d), this._findAndHandleTooltipTriggers(d);
|
|
84
89
|
}).observe(document.documentElement, {
|
|
85
|
-
attributeFilter: ["sbb-tooltip"],
|
|
90
|
+
attributeFilter: ["sbb-tooltip", ...t.keys()],
|
|
86
91
|
childList: !0,
|
|
87
92
|
subtree: !0
|
|
88
93
|
}), this._findAndHandleTooltipTriggers(document.body);
|
|
@@ -93,16 +98,16 @@ let J = 0, bt = (() => {
|
|
|
93
98
|
static _handleTooltipTrigger(t) {
|
|
94
99
|
const e = t.getAttribute("sbb-tooltip");
|
|
95
100
|
let o = m.get(t);
|
|
96
|
-
e && t.isConnected ? (o || (o = document.createElement("sbb-tooltip"), m.set(t, o), this._tooltipOutlet.appendChild(o), o.trigger = t), o.textContent = e) : o && (m.delete(t), o._destroy());
|
|
101
|
+
e && t.isConnected ? (o || (o = document.createElement("sbb-tooltip"), m.set(t, o), this._tooltipOutlet.appendChild(o), o.trigger = t), o.textContent = e, o.openDelay = t.hasAttribute("sbb-tooltip-open-delay") ? +t.getAttribute("sbb-tooltip-open-delay") : null, o.closeDelay = t.hasAttribute("sbb-tooltip-close-delay") ? +t.getAttribute("sbb-tooltip-close-delay") : null) : o && (m.delete(t), o._destroy());
|
|
97
102
|
}
|
|
98
103
|
connectedCallback() {
|
|
99
|
-
super.connectedCallback(), this.popover = "manual", this.id ||= `sbb-tooltip-${++
|
|
104
|
+
super.connectedCallback(), this.popover = "manual", this.id ||= `sbb-tooltip-${++K}`, this.state = "closed", L.connect(this), this.hasUpdated && this.trigger && this._attach(this.trigger);
|
|
100
105
|
}
|
|
101
106
|
disconnectedCallback() {
|
|
102
|
-
super.disconnectedCallback(),
|
|
107
|
+
super.disconnectedCallback(), L.disconnect(this), this._detach();
|
|
103
108
|
}
|
|
104
109
|
requestUpdate(t, e, o) {
|
|
105
|
-
super.requestUpdate(t, e, o), !
|
|
110
|
+
super.requestUpdate(t, e, o), !A && (!t || t === "trigger") && this.hasUpdated && this._attach(this.trigger);
|
|
106
111
|
}
|
|
107
112
|
firstUpdated(t) {
|
|
108
113
|
super.firstUpdated(t), this._attach(this.trigger);
|
|
@@ -129,10 +134,10 @@ let J = 0, bt = (() => {
|
|
|
129
134
|
t.animationName === "open" && this.state === "opening" ? this._handleOpening() : t.animationName === "close" && this.state === "closing" && this._handleClosing();
|
|
130
135
|
}
|
|
131
136
|
_attach(t) {
|
|
132
|
-
this._triggerElement && this._detach(), this._triggerElement = t, this._triggerElement && (
|
|
137
|
+
this._triggerElement && this._detach(), this._triggerElement = t, this._triggerElement && (U(this._triggerElement, "aria-describedby", this.id), this._addTriggerEventHandlers());
|
|
133
138
|
}
|
|
134
139
|
_detach() {
|
|
135
|
-
this._triggerAbortController?.abort(), this._openStateController?.abort(), this._resetOpenCloseTimeout(), clearTimeout(this._longPressOpenTimeout), clearTimeout(this._longPressCloseTimeout), this._triggerElement && (
|
|
140
|
+
this._triggerAbortController?.abort(), this._openStateController?.abort(), this._resetOpenCloseTimeout(), clearTimeout(this._longPressOpenTimeout), clearTimeout(this._longPressCloseTimeout), this._triggerElement && (Z(this._triggerElement, "aria-describedby", this.id), this._triggerElement = null);
|
|
136
141
|
}
|
|
137
142
|
_destroy() {
|
|
138
143
|
this._detach(), this.remove();
|
|
@@ -140,9 +145,9 @@ let J = 0, bt = (() => {
|
|
|
140
145
|
_setTooltipPosition() {
|
|
141
146
|
if (!this.overlay || !this._triggerElement)
|
|
142
147
|
return;
|
|
143
|
-
const t =
|
|
144
|
-
verticalOffset:
|
|
145
|
-
horizontalOffset:
|
|
148
|
+
const t = W(this.overlay, this._triggerElement, this, {
|
|
149
|
+
verticalOffset: V,
|
|
150
|
+
horizontalOffset: Y,
|
|
146
151
|
centered: !0,
|
|
147
152
|
responsiveHeight: !0
|
|
148
153
|
});
|
|
@@ -157,11 +162,11 @@ let J = 0, bt = (() => {
|
|
|
157
162
|
signal: this._triggerAbortController.signal,
|
|
158
163
|
passive: !0
|
|
159
164
|
};
|
|
160
|
-
|
|
165
|
+
J || (t.addEventListener("mouseenter", () => this._delayedOpen(), e), t.addEventListener("mouseleave", (o) => {
|
|
161
166
|
const d = o.relatedTarget;
|
|
162
167
|
(!d || d !== this) && this._delayedClose();
|
|
163
168
|
}, e), t.addEventListener("blur", () => this.close(), e), t.addEventListener("focus", () => this._delayedOpen(), e)), t.addEventListener("touchstart", () => {
|
|
164
|
-
clearTimeout(this._longPressOpenTimeout), clearTimeout(this._longPressCloseTimeout), this._longPressOpenTimeout = setTimeout(() => this.open(),
|
|
169
|
+
clearTimeout(this._longPressOpenTimeout), clearTimeout(this._longPressCloseTimeout), this._longPressOpenTimeout = setTimeout(() => this.open(), G);
|
|
165
170
|
}, e), t.addEventListener("touchend", () => {
|
|
166
171
|
clearTimeout(this._longPressOpenTimeout), this._longPressCloseTimeout = setTimeout(() => this.close(), this.longPressCloseDelay);
|
|
167
172
|
}, e), t.addEventListener("touchcancel", () => {
|
|
@@ -181,35 +186,35 @@ let J = 0, bt = (() => {
|
|
|
181
186
|
});
|
|
182
187
|
}
|
|
183
188
|
_isZeroAnimationDuration() {
|
|
184
|
-
return
|
|
189
|
+
return $(this, "--sbb-tooltip-animation-duration");
|
|
185
190
|
}
|
|
186
191
|
_resetOpenCloseTimeout() {
|
|
187
192
|
clearTimeout(this._openTimeout), clearTimeout(this._closeTimeout);
|
|
188
193
|
}
|
|
189
194
|
render() {
|
|
190
|
-
return
|
|
195
|
+
return S`
|
|
191
196
|
<div
|
|
192
197
|
@animationend=${this._onTooltipAnimationEnd}
|
|
193
198
|
class="sbb-tooltip"
|
|
194
|
-
${
|
|
199
|
+
${N((t) => this.overlay = t)}
|
|
195
200
|
>
|
|
196
201
|
<slot></slot>
|
|
197
202
|
</div>
|
|
198
203
|
`;
|
|
199
204
|
}
|
|
200
|
-
}, n = new WeakMap(),
|
|
205
|
+
}, n = new WeakMap(), r = l, (() => {
|
|
201
206
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(v[Symbol.metadata] ?? null) : void 0;
|
|
202
|
-
_ = [H(), c()], T = [c({ attribute: "open-delay", type: Number })], C = [c({ attribute: "close-delay", type: Number })],
|
|
207
|
+
_ = [H(), c()], T = [c({ attribute: "open-delay", type: Number })], C = [c({ attribute: "close-delay", type: Number })], x = [c({ attribute: "long-press-close-delay", type: Number })], b(l, null, _, { kind: "accessor", name: "trigger", static: !1, private: !1, access: { has: (e) => "trigger" in e, get: (e) => e.trigger, set: (e, o) => {
|
|
203
208
|
e.trigger = o;
|
|
204
|
-
} }, metadata: t },
|
|
209
|
+
} }, metadata: t }, y, f), b(l, null, T, { kind: "setter", name: "openDelay", static: !1, private: !1, access: { has: (e) => "openDelay" in e, set: (e, o) => {
|
|
205
210
|
e.openDelay = o;
|
|
206
|
-
} }, metadata: t }, null, p), b(
|
|
211
|
+
} }, metadata: t }, null, p), b(l, null, C, { kind: "setter", name: "closeDelay", static: !1, private: !1, access: { has: (e) => "closeDelay" in e, set: (e, o) => {
|
|
207
212
|
e.closeDelay = o;
|
|
208
|
-
} }, metadata: t }, null, p), b(
|
|
213
|
+
} }, metadata: t }, null, p), b(l, null, x, { kind: "setter", name: "longPressCloseDelay", static: !1, private: !1, access: { has: (e) => "longPressCloseDelay" in e, set: (e, o) => {
|
|
209
214
|
e.longPressCloseDelay = o;
|
|
210
|
-
} }, metadata: t }, null, p), b(null,
|
|
211
|
-
})(),
|
|
215
|
+
} }, metadata: t }, null, p), b(null, i = { value: r }, s, { kind: "class", name: r.name, metadata: t }, null, a), r = i.value, t && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
216
|
+
})(), l.role = "tooltip", l.styles = j, A || F(() => r._initializeTooltipOutlet()), h(r, a), r;
|
|
212
217
|
})();
|
|
213
218
|
export {
|
|
214
|
-
|
|
219
|
+
pt as SbbTooltipElement
|
|
215
220
|
};
|