@sbb-esta/lyne-elements-dev 5.0.0-next.3-dev.1779890843 → 5.0.0-next.3-dev.1779895144
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/{block-link-common-C_rUmc2u.js → block-link-common-BZZ4NhPD.js} +1 -1
- package/core/styles/mixins/_typo.scss +37 -41
- package/core.js +24 -25
- package/custom-elements.json +1460 -377
- package/development/{block-link-common-C0XzZIvS.js → block-link-common-DCKM3jJQ.js} +2 -2
- package/development/core.d.ts +0 -1
- package/development/core.d.ts.map +1 -1
- package/development/core.js +1 -2
- package/development/dialog-title.component-DyItyahT.js +1 -1
- package/development/icon/icon-base.js +1 -1
- package/development/icon/icon.component.js +1 -1
- package/development/icon-base-Cq6DxOUh.js +163 -0
- package/development/icon.js +1 -1
- package/development/icon.pure.js +1 -1
- package/development/journey-header.component-tBukBhVq.js +1 -1
- package/development/link/common/block-link-common.js +1 -1
- package/development/link.js +1 -1
- package/development/link.pure.js +1 -1
- package/development/navigation/common/navigation-action-common.d.ts.map +1 -1
- package/development/navigation/navigation/navigation.component.d.ts +0 -1
- package/development/navigation/navigation/navigation.component.d.ts.map +1 -1
- package/development/navigation/navigation/navigation.component.js +1 -1
- package/development/navigation/navigation-section/navigation-section.component.d.ts +0 -1
- package/development/navigation/navigation-section/navigation-section.component.d.ts.map +1 -1
- package/development/navigation/navigation-section/navigation-section.component.js +1 -1
- package/development/navigation-action-common-BdJOaItd.js +1 -1
- package/development/{navigation-section.component-DhMQspKb.js → navigation-section.component-34GEIPaN.js} +2 -5
- package/development/{navigation.component-BOBqdfXo.js → navigation.component-CqQuaq7V.js} +2 -5
- package/development/navigation.js +2 -2
- package/development/navigation.pure.js +2 -2
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay/overlay-base-element.js +3 -3
- package/development/popover/popover/popover.component.d.ts +54 -0
- package/development/popover/popover/popover.component.d.ts.map +1 -0
- package/development/popover/popover/popover.component.js +2 -0
- package/development/popover/{popover.component.d.ts → popover-base/popover-base.d.ts} +2 -59
- package/development/popover/popover-base/popover-base.d.ts.map +1 -0
- package/development/popover/popover-base/popover-base.js +2 -0
- package/development/popover/popover-close-button/popover-close-button.component.d.ts +21 -0
- package/development/popover/popover-close-button/popover-close-button.component.d.ts.map +1 -0
- package/development/popover/popover-close-button/popover-close-button.component.js +30 -0
- package/development/popover-base-BcIAVXWF.js +288 -0
- package/development/popover.component-CMR0eV2t.js +233 -0
- package/development/popover.js +6 -3
- package/development/popover.pure.d.ts +3 -1
- package/development/popover.pure.d.ts.map +1 -1
- package/development/popover.pure.js +4 -2
- package/development/title-base-DPAFIjFK.js +1 -1
- package/development/title.component-BSrkZhnI.js +1 -1
- package/development/toast/toast.component.d.ts.map +1 -1
- package/development/toast/toast.component.js +1 -1
- package/development/{toast.component-DowxkGr4.js → toast.component-BgGWVr4o.js} +3 -4
- package/development/toast.js +1 -1
- package/development/toast.pure.js +1 -1
- package/icon/icon-base.js +1 -1
- package/icon/icon.component.js +1 -1
- package/{icon-base-CK1oqnO4.js → icon-base-TSCmR5QC.js} +1 -1
- package/icon.js +1 -1
- package/icon.pure.js +1 -1
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/link/common/block-link-common.js +1 -1
- package/link.js +1 -1
- package/link.pure.js +1 -1
- package/navigation/navigation/navigation.component.js +1 -1
- package/navigation/navigation-section/navigation-section.component.js +1 -1
- package/{navigation-section.component-c4XBLFsl.js → navigation-section.component-DPgBlCf8.js} +1 -4
- package/{navigation.component-pRBja4z3.js → navigation.component-CY_9Q6dT.js} +1 -4
- package/navigation.js +2 -2
- package/navigation.pure.js +2 -2
- package/overlay/overlay-base-element.js +2 -2
- package/package.json +2 -2
- package/popover/popover/popover.component.js +2 -0
- package/popover/popover-base/popover-base.js +2 -0
- package/popover/popover-close-button/popover-close-button.component.js +20 -0
- package/popover-base-DlSa-ajc.js +181 -0
- package/popover.component-BHg4Qtqd.js +158 -0
- package/popover.js +5 -4
- package/popover.pure.js +4 -2
- package/toast/toast.component.js +1 -1
- package/{toast.component-Lbh5sa_U.js → toast.component-Dlr0Koxu.js} +22 -23
- package/toast.js +1 -1
- package/toast.pure.js +1 -1
- package/core/eventing/composed-path-has-attribute.js +0 -7
- package/development/core/eventing/composed-path-has-attribute.d.ts +0 -10
- package/development/core/eventing/composed-path-has-attribute.d.ts.map +0 -1
- package/development/core/eventing/composed-path-has-attribute.js +0 -19
- package/development/icon-base-Cz7F4MJ9.js +0 -163
- package/development/popover/popover.component.d.ts.map +0 -1
- package/development/popover/popover.component.js +0 -2
- package/development/popover.component-DtIhw37L.js +0 -578
- package/popover/popover.component.js +0 -2
- package/popover.component-DrLx8J07.js +0 -385
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../navigation.component-
|
|
1
|
+
import { t as e } from "../../navigation.component-CY_9Q6dT.js";
|
|
2
2
|
export { e as SbbNavigationElement };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../navigation-section.component-
|
|
1
|
+
import { t as e } from "../../navigation-section.component-DPgBlCf8.js";
|
|
2
2
|
export { e as SbbNavigationSectionElement };
|
package/{navigation-section.component-c4XBLFsl.js → navigation-section.component-DPgBlCf8.js}
RENAMED
|
@@ -119,7 +119,7 @@ var T = ":host{--sbb-navigation-section-animation-duration: var( --sbb-disable-a
|
|
|
119
119
|
super(), this.#e = t(this, O, ""), this.#t = (t(this, k), t(this, j, null)), this.#n = (t(this, M), t(this, P, "")), this.#r = (t(this, F), t(this, L, "")), this._firstLevelNavigation = (t(this, R), null), this._triggerElement = null, this._language = new l(this), this._focusTrapController = new c(this), this._lastKeydownEvent = null, this._mediaMatcherController = new u(this, { [d]: (e) => {
|
|
120
120
|
this.state !== "closed" && this._setNavigationInert(e);
|
|
121
121
|
} }), this._handleNavigationSectionClose = (e) => {
|
|
122
|
-
e.composedPath().
|
|
122
|
+
e.composedPath().some((e, t, n) => e instanceof HTMLElement && t < n.indexOf(this) && (e.nodeName === "A" || !e.hasAttribute("disabled") && (e.hasAttribute("sbb-navigation-close") || e.hasAttribute("sbb-navigation-section-close")))) && this.close();
|
|
123
123
|
}, this.addEventListener?.("keydown", (e) => {
|
|
124
124
|
this._lastKeydownEvent = e;
|
|
125
125
|
}), this.addEventListener?.("focusout", (e) => {
|
|
@@ -166,9 +166,6 @@ var T = ":host{--sbb-navigation-section-animation-duration: var( --sbb-disable-a
|
|
|
166
166
|
_attachWindowEvents() {
|
|
167
167
|
this._windowEventsController = new AbortController(), window.addEventListener("keydown", (e) => this._onKeydownEvent(e), { signal: this._windowEventsController.signal }), window.addEventListener("click", this._handleNavigationSectionClose, { signal: this._windowEventsController.signal });
|
|
168
168
|
}
|
|
169
|
-
_isCloseElement(e) {
|
|
170
|
-
return e.nodeName === "A" || !e.hasAttribute("disabled") && (e.hasAttribute("sbb-navigation-close") || e.hasAttribute("sbb-navigation-section-close"));
|
|
171
|
-
}
|
|
172
169
|
_isBelowLarge() {
|
|
173
170
|
return this._mediaMatcherController.matches(d) ?? !1;
|
|
174
171
|
}
|
|
@@ -148,10 +148,7 @@ var E = ":host{--sbb-navigation-animation-duration: var( --sbb-disable-animation
|
|
|
148
148
|
Array.from(this.querySelectorAll(":is(sbb-navigation-button, sbb-navigation-link):is(:state(action-active),[state--action-active]):not(.sbb-active)"))?.forEach((e) => e.marker?.reset());
|
|
149
149
|
}
|
|
150
150
|
_handleNavigationClose(e) {
|
|
151
|
-
e.composedPath().
|
|
152
|
-
}
|
|
153
|
-
_isCloseElement(e) {
|
|
154
|
-
return e.nodeName === "A" || e.hasAttribute("sbb-navigation-close") && !e.hasAttribute("disabled");
|
|
151
|
+
e.composedPath().some((e, t, n) => e instanceof HTMLElement && t < n.indexOf(this) && (e.nodeName === "A" || e.hasAttribute("sbb-navigation-close") && !e.hasAttribute("disabled"))) && this.close();
|
|
155
152
|
}
|
|
156
153
|
_onNavigationResize() {
|
|
157
154
|
this.state === "opened" && (this._resizeObserverTimeout && clearTimeout(this._resizeObserverTimeout), this.internals.states.add("resize-disable-animation"), this._resizeObserverTimeout = setTimeout(() => this.internals.states.delete("resize-disable-animation"), D));
|
package/navigation.js
CHANGED
|
@@ -3,8 +3,8 @@ import { SbbNavigationButtonElement as t } from "./navigation/navigation-button/
|
|
|
3
3
|
import { SbbNavigationLinkElement as n } from "./navigation/navigation-link/navigation-link.component.js";
|
|
4
4
|
import { t as r } from "./navigation-list.component-Bkmh_wqm.js";
|
|
5
5
|
import { t as i } from "./navigation-marker.component-CCXJWsN1.js";
|
|
6
|
-
import { t as a } from "./navigation-section.component-
|
|
7
|
-
import { t as o } from "./navigation.component-
|
|
6
|
+
import { t as a } from "./navigation-section.component-DPgBlCf8.js";
|
|
7
|
+
import { t as o } from "./navigation.component-CY_9Q6dT.js";
|
|
8
8
|
import "./navigation.pure.js";
|
|
9
9
|
o.define(), t.define(), n.define(), r.define(), i.define(), a.define();
|
|
10
10
|
//#endregion
|
package/navigation.pure.js
CHANGED
|
@@ -3,6 +3,6 @@ import { SbbNavigationButtonElement as t } from "./navigation/navigation-button/
|
|
|
3
3
|
import { SbbNavigationLinkElement as n } from "./navigation/navigation-link/navigation-link.component.js";
|
|
4
4
|
import { t as r } from "./navigation-list.component-Bkmh_wqm.js";
|
|
5
5
|
import { t as i } from "./navigation-marker.component-CCXJWsN1.js";
|
|
6
|
-
import { t as a } from "./navigation-section.component-
|
|
7
|
-
import { t as o } from "./navigation.component-
|
|
6
|
+
import { t as a } from "./navigation-section.component-DPgBlCf8.js";
|
|
7
|
+
import { t as o } from "./navigation.component-CY_9Q6dT.js";
|
|
8
8
|
export { e as SbbNavigationActionCommonElementMixin, t as SbbNavigationButtonElement, o as SbbNavigationElement, n as SbbNavigationLinkElement, r as SbbNavigationListElement, i as SbbNavigationMarkerElement, a as SbbNavigationSectionElement };
|
|
@@ -129,8 +129,8 @@ var x = [], S = (() => {
|
|
|
129
129
|
e > -1 && x.splice(e, 1);
|
|
130
130
|
}
|
|
131
131
|
closeOnSbbOverlayCloseClick(e) {
|
|
132
|
-
let t = e.composedPath().
|
|
133
|
-
|
|
132
|
+
let t = e.composedPath().find((e, t, n) => e instanceof HTMLElement && t < n.indexOf(this) && (e.hasAttribute(this.closeAttribute) || e.localName === this.closeTag) && !e.hasAttribute("disabled") && (e.closest(this.localName) === this || (this.shadowRoot?.contains(e) ?? !1)));
|
|
133
|
+
t && x.length && x[x.length - 1]._close(null, t);
|
|
134
134
|
}
|
|
135
135
|
removeAriaLiveRefContent() {
|
|
136
136
|
this._ariaLiveRef && (this._ariaLiveRef.textContent = "");
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbb-esta/lyne-elements-dev",
|
|
3
|
-
"version": "5.0.0-next.3-dev.
|
|
3
|
+
"version": "5.0.0-next.3-dev.1779895144",
|
|
4
4
|
"description": "Lyne Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design system",
|
|
7
7
|
"web components",
|
|
8
8
|
"lit",
|
|
9
|
-
"https://github.com/sbb-design-systems/lyne-components/commit/
|
|
9
|
+
"https://github.com/sbb-design-systems/lyne-components/commit/63cf10b5b2c5105ed18a225f9cf62d0717043c21"
|
|
10
10
|
],
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "lit";
|
|
2
|
+
import { SbbLanguageController as e, i18nClosePopover as t } from "../../core.js";
|
|
3
|
+
import { SbbSecondaryButtonElement as n } from "../../button.pure.js";
|
|
4
|
+
//#region src/elements/popover/popover-close-button/popover-close-button.component.ts
|
|
5
|
+
var r = class extends n {
|
|
6
|
+
static {
|
|
7
|
+
this.elementName = "sbb-popover-close-button";
|
|
8
|
+
}
|
|
9
|
+
constructor() {
|
|
10
|
+
super(), this._languageController = new e(this).withHandler(() => this.internals.ariaLabel = t[this._languageController.current]), this.size = "s";
|
|
11
|
+
}
|
|
12
|
+
renderTemplate() {
|
|
13
|
+
return super.renderIconSlot();
|
|
14
|
+
}
|
|
15
|
+
renderIconName() {
|
|
16
|
+
return super.renderIconName() || "cross-small";
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as SbbPopoverCloseButtonElement };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { __esDecorate as e, __runInitializers as t } from "tslib";
|
|
2
|
+
import { html as n, isServer as r, unsafeCSS as i } from "lit";
|
|
3
|
+
import { property as a } from "lit/decorators.js";
|
|
4
|
+
import { IS_FOCUSABLE_QUERY as o, SbbEscapableOverlayController as s, SbbFocusTrapController as c, SbbOpenCloseBaseElement as l, getElementPosition as u, idReference as d, isEventOnElement as f, isZeroAnimationDuration as p, popoverResetStyles as m, removeAriaOverlayTriggerProperties as h, setAriaOverlayTriggerProperties as g } from "./core.js";
|
|
5
|
+
import { ResizeController as _ } from "@lit-labs/observers/resize-controller.js";
|
|
6
|
+
import { ref as v } from "lit/directives/ref.js";
|
|
7
|
+
//#region src/elements/popover/popover-base/popover-base.scss?inline
|
|
8
|
+
var y = ":host{--sbb-focus-outline-color: var(--sbb-focus-outline-color-default);--sbb-focus-outline-color: light-dark( var(--sbb-focus-outline-color-default), var(--sbb-focus-outline-color-dark) );--sbb-popover-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--_sbb-popover-inset: 0 auto auto 0;--_sbb-popover-translate: 0 var(--sbb-spacing-fixed-2x);--_sbb-popover-box-shadow: var(--sbb-box-shadow-level-9-hard);outline:none!important;display:none}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){--_sbb-popover-inset: 0;display:block}:host(:is(:state(position-above),[state--position-above])){--_sbb-popover-translate: 0 calc(var(--sbb-spacing-fixed-2x) * -1)}.sbb-popover:after,.sbb-popover__content:before{content:\"\";position:absolute;display:block;width:var(--sbb-popover-arrow-size);height:var(--sbb-popover-arrow-size);left:var(--_sbb-popover-arrow-position-x, 0);bottom:calc(100% - var(--sbb-popover-arrow-size) / 2);background-color:var(--sbb-popover-background);border-radius:var(--sbb-border-radius-2x) 0;rotate:45deg}.sbb-popover__container{position:fixed;inset:var(--_sbb-popover-inset);pointer-events:none;z-index:var(--sbb-popover-z-index, var(--sbb-overlay-default-z-index))}.sbb-popover{display:none;position:var(--sbb-popover-position, absolute);top:var(--_sbb-popover-position-y, 0);bottom:unset;left:var(--_sbb-popover-position-x, 0);right:unset;background-color:var(--sbb-popover-background);max-width:var(--sbb-popover-max-width);width:max-content;padding:0;box-shadow:var(--_sbb-popover-box-shadow);border:none;border-radius:var(--sbb-popover-border-radius);outline:none;pointer-events:all}:host(:focus-visible) .sbb-popover{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))) .sbb-popover{display:block;animation-name:open;animation-duration:var(--sbb-popover-animation-duration);animation-timing-function:var(--sbb-popover-animation-easing)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-popover{pointer-events:none;animation-name:close;animation-duration:var(--sbb-popover-animation-duration);animation-timing-function:var(--sbb-popover-animation-easing)}.sbb-popover:after{z-index:-1;box-shadow:var(--_sbb-popover-box-shadow)}@media(forced-colors:active){.sbb-popover:after{outline:var(--sbb-border-width-1x) solid CanvasText}}:host(:is(:state(position-above),[state--position-above])) .sbb-popover:after{top:calc(100% - var(--sbb-popover-arrow-size) / 2)}@media(forced-colors:active){.sbb-popover{outline:var(--sbb-border-width-1x) solid CanvasText}}.sbb-popover:before{content:\"\";display:block;position:absolute;inset:0;z-index:-1;background-color:transparent}:host(:is(:state(position-below),[state--position-below])) .sbb-popover:before{inset-block-start:calc(-1 * var(--sbb-spacing-fixed-6x))}:host(:is(:state(position-above),[state--position-above])) .sbb-popover:before{inset-block-end:calc(-1 * var(--sbb-spacing-fixed-6x))}.sbb-popover__content{border-radius:var(--sbb-popover-border-radius);padding:var(--sbb-popover-padding);outline:none;background-color:var(--sbb-popover-background)}.sbb-popover__content:before{clip-path:polygon(100% 0,0% 0%,0% 100%)}:host(:is(:state(position-above),[state--position-above])) .sbb-popover__content:before{top:calc(100% - var(--sbb-popover-arrow-size) / 2);clip-path:polygon(100% 0,100% 100%,0% 100%)}@keyframes open{0%{opacity:0;translate:var(--_sbb-popover-translate)}to{opacity:1;translate:0}}@keyframes close{0%{opacity:1;translate:0}to{opacity:0;translate:var(--_sbb-popover-translate)}}", b = 16, x = 32, S = /* @__PURE__ */ new Set(), C = class extends Event {
|
|
9
|
+
get closeTarget() {
|
|
10
|
+
return this._closeTarget;
|
|
11
|
+
}
|
|
12
|
+
constructor(e, { closeTarget: t, cancelable: n }) {
|
|
13
|
+
super(e, { cancelable: n }), this._closeTarget = t;
|
|
14
|
+
}
|
|
15
|
+
}, w = (() => {
|
|
16
|
+
let w = l, T, E = [], D = [];
|
|
17
|
+
return class extends w {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.#e = t(this, E, null), this._nextFocusedElement = t(this, D), this._skipCloseFocus = !1, this._resizeController = new _(this, {
|
|
20
|
+
target: null,
|
|
21
|
+
callback: () => this._setPopoverPosition()
|
|
22
|
+
}), this._escapableOverlayController = new s(this), this._focusTrapController = new c(this), this._blurTimeout = null, this._pointerDownListener = (e) => {
|
|
23
|
+
this._isPointerDownEventOnPopover = f(this.overlay, e);
|
|
24
|
+
}, this._closeOnBackdropClick = (e) => {
|
|
25
|
+
let t = e.composedPath();
|
|
26
|
+
!this._isPointerDownEventOnPopover && !f(this.overlay, e) && (!this.trigger || !t.includes(this.trigger)) && (this._nextFocusedElement = t.filter((e) => e instanceof window.HTMLElement).find((e) => e.matches(o)), clearTimeout(this.closeTimeout), this.close());
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static {
|
|
30
|
+
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(w[Symbol.metadata] ?? null) : void 0;
|
|
31
|
+
T = [d(), a()], e(this, null, T, {
|
|
32
|
+
kind: "accessor",
|
|
33
|
+
name: "trigger",
|
|
34
|
+
static: !1,
|
|
35
|
+
private: !1,
|
|
36
|
+
access: {
|
|
37
|
+
has: (e) => "trigger" in e,
|
|
38
|
+
get: (e) => e.trigger,
|
|
39
|
+
set: (e, t) => {
|
|
40
|
+
e.trigger = t;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
metadata: t
|
|
44
|
+
}, E, D), t && Object.defineProperty(this, Symbol.metadata, {
|
|
45
|
+
enumerable: !0,
|
|
46
|
+
configurable: !0,
|
|
47
|
+
writable: !0,
|
|
48
|
+
value: t
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
static {
|
|
52
|
+
this.styles = [m, i(y)];
|
|
53
|
+
}
|
|
54
|
+
#e;
|
|
55
|
+
get trigger() {
|
|
56
|
+
return this.#e;
|
|
57
|
+
}
|
|
58
|
+
set trigger(e) {
|
|
59
|
+
this.#e = e;
|
|
60
|
+
}
|
|
61
|
+
open() {
|
|
62
|
+
if (!(this.state !== "closed" && this.state !== "closing" || !this.overlay || !this.dispatchBeforeOpenEvent())) {
|
|
63
|
+
for (let e of S) (e.state === "opened" || e.state === "opening") && e.close();
|
|
64
|
+
this.showPopover?.(), this.state = "opening", this.inert = !0, this._setPopoverPosition(), this._attachWindowEvents(), this._escapableOverlayController.connect(), this._nextFocusedElement = void 0, this._skipCloseFocus = !1, this._triggerElement && (this._triggerElement.ariaExpanded = "true"), this._isZeroAnimationDuration() && this._handleOpening();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
close(e) {
|
|
68
|
+
this.state !== "opened" && this.state !== "opening" || (this._popoverCloseElement = e, this.dispatchBeforeCloseEvent({ closeTarget: e ?? null }) && (this.state = "closing", this.inert = !0, this._triggerElement && (this._triggerElement.ariaExpanded = "false"), this._isZeroAnimationDuration() && this._handleClosing()));
|
|
69
|
+
}
|
|
70
|
+
_isZeroAnimationDuration() {
|
|
71
|
+
return p(this, "--sbb-popover-animation-duration");
|
|
72
|
+
}
|
|
73
|
+
_handleClosing() {
|
|
74
|
+
this.state = "closed", this.hidePopover?.(), this.overlay && (this._resizeController.unobserve(this.overlay), this.overlay.firstElementChild?.scrollTo(0, 0)), this.removeAttribute("tabindex"), this._skipCloseFocus || (this._nextFocusedElement || this._triggerElement)?.focus(), this._escapableOverlayController.disconnect(), this._openStateController?.abort(), this._focusTrapController.enabled = !1, this.dispatchCloseEvent({ closeTarget: this._popoverCloseElement ?? null });
|
|
75
|
+
}
|
|
76
|
+
_handleOpening() {
|
|
77
|
+
this.state = "opened", this.inert = !1, this._setPopoverFocus(), this._focusTrapController.enabled = !0, this.overlay && this._resizeController.observe(this.overlay), this.dispatchOpenEvent();
|
|
78
|
+
}
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
this.popover = "manual", super.connectedCallback(), this.state = "closed", S.add(this), this.hasUpdated && this._configureTrigger();
|
|
81
|
+
}
|
|
82
|
+
requestUpdate(e, t, n) {
|
|
83
|
+
super.requestUpdate(e, t, n), !r && (!e || e === "trigger" || e === "hoverTrigger") && this.hasUpdated && this._configureTrigger();
|
|
84
|
+
}
|
|
85
|
+
firstUpdated(e) {
|
|
86
|
+
super.firstUpdated(e), this._configureTrigger();
|
|
87
|
+
}
|
|
88
|
+
disconnectedCallback() {
|
|
89
|
+
super.disconnectedCallback(), this._triggerElement = null, this._triggerAbortController?.abort(), this._openStateController?.abort(), S.delete(this), this._blurTimeout && clearTimeout(this._blurTimeout);
|
|
90
|
+
}
|
|
91
|
+
_configureTrigger() {
|
|
92
|
+
if (!r) {
|
|
93
|
+
if (this.hydrationRequired) {
|
|
94
|
+
this.hydrationComplete.then(() => this._configureTrigger());
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.configureTrigger(this._triggerElement ?? null);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
configureTrigger(e) {
|
|
101
|
+
this._triggerAbortController?.abort(), h(this._triggerElement), this._triggerElement = this.trigger, this._triggerElement && (g(this, this._triggerElement, "dialog", this.state), this._triggerAbortController = new AbortController(), this.registerTriggerListeners(this._triggerAbortController.signal));
|
|
102
|
+
}
|
|
103
|
+
registerTriggerListeners(e) {
|
|
104
|
+
this._triggerElement.addEventListener("click", () => this.open(), { signal: e });
|
|
105
|
+
}
|
|
106
|
+
_attachWindowEvents() {
|
|
107
|
+
this._openStateController = new AbortController(), document.addEventListener("scroll", () => this._setPopoverPosition(), {
|
|
108
|
+
passive: !0,
|
|
109
|
+
signal: this._openStateController.signal,
|
|
110
|
+
capture: !0
|
|
111
|
+
}), window.addEventListener("resize", () => this._setPopoverPosition(), {
|
|
112
|
+
passive: !0,
|
|
113
|
+
signal: this._openStateController.signal
|
|
114
|
+
}), window.addEventListener("pointerdown", this._pointerDownListener, { signal: this._openStateController.signal }), window.addEventListener("pointerup", this._closeOnBackdropClick, { signal: this._openStateController.signal });
|
|
115
|
+
}
|
|
116
|
+
_closeOnSbbPopoverCloseClick(e) {
|
|
117
|
+
let t = e.composedPath().find((e, t, n) => e instanceof HTMLElement && t < n.indexOf(this) && (e.hasAttribute("sbb-popover-close") || e.localName === "sbb-popover-close-button") && !e.hasAttribute("disabled"));
|
|
118
|
+
t && (clearTimeout(this.closeTimeout), this.close(t));
|
|
119
|
+
}
|
|
120
|
+
_onPopoverAnimationEnd(e) {
|
|
121
|
+
e.animationName === "open" && this.state === "opening" ? this._handleOpening() : e.animationName === "close" && this.state === "closing" && this._handleClosing();
|
|
122
|
+
}
|
|
123
|
+
_setPopoverFocus() {
|
|
124
|
+
!this._focusTrapController.focusInitialElement() && this._openStateController && (this.setAttribute("tabindex", "0"), this.focus(), this.addEventListener("blur", (e) => {
|
|
125
|
+
this._blurTimeout = setTimeout(() => {
|
|
126
|
+
if (document.visibilityState !== "hidden") {
|
|
127
|
+
if (this.removeAttribute("tabindex"), this.contains(e.relatedTarget) || e.relatedTarget === this.trigger) return;
|
|
128
|
+
(this.state === "opened" || this.state === "opening") && (this._skipCloseFocus = !0), this.close();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}, { signal: this._openStateController.signal }));
|
|
132
|
+
}
|
|
133
|
+
_setPopoverPosition() {
|
|
134
|
+
if (!this.overlay || !this._triggerElement) return;
|
|
135
|
+
let e = u(this.overlay, this._triggerElement, this.shadowRoot.querySelector(".sbb-popover__container"), {
|
|
136
|
+
verticalOffset: b,
|
|
137
|
+
horizontalOffset: x,
|
|
138
|
+
centered: !0,
|
|
139
|
+
responsiveHeight: !0
|
|
140
|
+
}), t = e.alignment.vertical;
|
|
141
|
+
for (let e of ["above", "below"]) this.toggleState(`position-${e}`, e === t);
|
|
142
|
+
let n = this._triggerElement.getBoundingClientRect().left - e.left + this._triggerElement.clientWidth / 2 - 8;
|
|
143
|
+
this.style.setProperty("--_sbb-popover-position-x", `${e.left}px`), this.style.setProperty("--_sbb-popover-position-y", `${e.top}px`), this.style.setProperty("--_sbb-popover-arrow-position-x", `${n}px`), this.style.setProperty("--_sbb-popover-max-height", e.maxHeight);
|
|
144
|
+
}
|
|
145
|
+
dispatchBeforeCloseEvent(e) {
|
|
146
|
+
let t = e?.closeTarget ?? null;
|
|
147
|
+
return this.dispatchEvent(new C("beforeclose", {
|
|
148
|
+
closeTarget: t,
|
|
149
|
+
cancelable: !0
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
dispatchCloseEvent(e) {
|
|
153
|
+
let t = e?.closeTarget ?? null;
|
|
154
|
+
return this.dispatchEvent(new C("close", {
|
|
155
|
+
closeTarget: t,
|
|
156
|
+
cancelable: !1
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
render() {
|
|
160
|
+
return n`
|
|
161
|
+
<div class="sbb-popover__container">
|
|
162
|
+
<div
|
|
163
|
+
@animationend=${this._onPopoverAnimationEnd}
|
|
164
|
+
class="sbb-popover"
|
|
165
|
+
role="tooltip"
|
|
166
|
+
${v((e) => this.overlay = e)}
|
|
167
|
+
>
|
|
168
|
+
<div
|
|
169
|
+
@click=${(e) => this._closeOnSbbPopoverCloseClick(e)}
|
|
170
|
+
class="sbb-popover__content"
|
|
171
|
+
>
|
|
172
|
+
${this.renderContent()}
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
`;
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
})();
|
|
180
|
+
//#endregion
|
|
181
|
+
export { C as n, w as t };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { __esDecorate as e, __runInitializers as t } from "tslib";
|
|
2
|
+
import { html as n, isServer as r, unsafeCSS as i } from "lit";
|
|
3
|
+
import { property as a, state as o } from "lit/decorators.js";
|
|
4
|
+
import { SbbMediaQueryPointerCoarse as s, forceType as c, isFakeMousedownFromScreenReader as l, readConfig as u, sbbInputModalityDetector as d, scrollbarStyles as f, ɵstateController as p } from "./core.js";
|
|
5
|
+
import { SbbPopoverBaseElement as m } from "./popover/popover-base/popover-base.js";
|
|
6
|
+
//#region src/elements/popover/popover/popover.scss?inline
|
|
7
|
+
var h = ":host{--_sbb-popover-half-padding: calc(.5 * var(--sbb-popover-padding));position:relative}:host(:is(:state(has-close-button),[state--has-close-button])){--_sbb-popover-close-button-min-height: calc( var(--sbb-button-min-height-size-s) + 2 * var(--sbb-popover-padding) );--_sbb-popover-close-button-min-width: calc( var(--_sbb-popover-close-button-min-height) - var(--_sbb-popover-half-padding) )}.sbb-popover__content{padding-block:var(--_sbb-popover-half-padding);padding-inline:var(--_sbb-popover-half-padding) var(--_sbb-popover-close-button-min-width, var(--_sbb-popover-half-padding));min-height:var(--_sbb-popover-close-button-min-height)}.sbb-popover__scrollable-content{display:block;padding-inline:var(--_sbb-popover-half-padding);padding-block:var(--_sbb-popover-half-padding);max-height:calc(var(--_sbb-popover-max-height) - var(--sbb-spacing-fixed-1x));overflow:auto}::slotted(sbb-popover-close-button){position:absolute;inset:var(--sbb-popover-padding) var(--sbb-popover-padding) auto auto}", g = r ? !1 : matchMedia(s).matches, _ = (() => {
|
|
8
|
+
let r = m, s = [], _, v = [], y = [], b, x, S, C = [], w = [];
|
|
9
|
+
return class extends r {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.#e = (t(this, s), t(this, v, !1)), this._openDelay = t(this, y), this.#t = t(this, C, !1), this._openTimeout = t(this, w), this._overlayAbortController = null, this._onTriggerMouseEnter = () => {
|
|
12
|
+
this.state === "closed" || this.state === "closing" ? this._openTimeout = setTimeout(() => {
|
|
13
|
+
d.reset(), this.open();
|
|
14
|
+
}, this.openDelay) : clearTimeout(this.closeTimeout);
|
|
15
|
+
}, this._onTriggerMouseLeave = () => {
|
|
16
|
+
this.state === "opened" || this.state === "opening" ? this.closeTimeout = setTimeout(() => this.close(), this.closeDelay) : clearTimeout(this._openTimeout);
|
|
17
|
+
}, this._onOverlayMouseEnter = () => {
|
|
18
|
+
this.state !== "opening" && clearTimeout(this.closeTimeout);
|
|
19
|
+
}, this._onOverlayMouseLeave = () => {
|
|
20
|
+
this.state !== "opening" && (this.closeTimeout = setTimeout(() => this.close(), this.closeDelay));
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static {
|
|
24
|
+
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(r[Symbol.metadata] ?? null) : void 0;
|
|
25
|
+
_ = [c(), a({
|
|
26
|
+
attribute: "hover-trigger",
|
|
27
|
+
type: Boolean
|
|
28
|
+
})], b = [a({
|
|
29
|
+
attribute: "open-delay",
|
|
30
|
+
type: Number
|
|
31
|
+
})], x = [a({
|
|
32
|
+
attribute: "close-delay",
|
|
33
|
+
type: Number
|
|
34
|
+
})], S = [o()], e(this, null, _, {
|
|
35
|
+
kind: "accessor",
|
|
36
|
+
name: "hoverTrigger",
|
|
37
|
+
static: !1,
|
|
38
|
+
private: !1,
|
|
39
|
+
access: {
|
|
40
|
+
has: (e) => "hoverTrigger" in e,
|
|
41
|
+
get: (e) => e.hoverTrigger,
|
|
42
|
+
set: (e, t) => {
|
|
43
|
+
e.hoverTrigger = t;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
metadata: t
|
|
47
|
+
}, v, y), e(this, null, b, {
|
|
48
|
+
kind: "setter",
|
|
49
|
+
name: "openDelay",
|
|
50
|
+
static: !1,
|
|
51
|
+
private: !1,
|
|
52
|
+
access: {
|
|
53
|
+
has: (e) => "openDelay" in e,
|
|
54
|
+
set: (e, t) => {
|
|
55
|
+
e.openDelay = t;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
metadata: t
|
|
59
|
+
}, null, s), e(this, null, x, {
|
|
60
|
+
kind: "setter",
|
|
61
|
+
name: "closeDelay",
|
|
62
|
+
static: !1,
|
|
63
|
+
private: !1,
|
|
64
|
+
access: {
|
|
65
|
+
has: (e) => "closeDelay" in e,
|
|
66
|
+
set: (e, t) => {
|
|
67
|
+
e.closeDelay = t;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
metadata: t
|
|
71
|
+
}, null, s), e(this, null, S, {
|
|
72
|
+
kind: "accessor",
|
|
73
|
+
name: "_hoverTrigger",
|
|
74
|
+
static: !1,
|
|
75
|
+
private: !1,
|
|
76
|
+
access: {
|
|
77
|
+
has: (e) => "_hoverTrigger" in e,
|
|
78
|
+
get: (e) => e._hoverTrigger,
|
|
79
|
+
set: (e, t) => {
|
|
80
|
+
e._hoverTrigger = t;
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
metadata: t
|
|
84
|
+
}, C, w), t && Object.defineProperty(this, Symbol.metadata, {
|
|
85
|
+
enumerable: !0,
|
|
86
|
+
configurable: !0,
|
|
87
|
+
writable: !0,
|
|
88
|
+
value: t
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
static {
|
|
92
|
+
this.elementName = "sbb-popover";
|
|
93
|
+
}
|
|
94
|
+
static {
|
|
95
|
+
this.styles = [f, i(h)];
|
|
96
|
+
}
|
|
97
|
+
#e;
|
|
98
|
+
get hoverTrigger() {
|
|
99
|
+
return this.#e;
|
|
100
|
+
}
|
|
101
|
+
set hoverTrigger(e) {
|
|
102
|
+
this.#e = e;
|
|
103
|
+
}
|
|
104
|
+
set openDelay(e) {
|
|
105
|
+
this._openDelay = +e;
|
|
106
|
+
}
|
|
107
|
+
get openDelay() {
|
|
108
|
+
return this._openDelay ?? u().popover?.openDelay ?? 0;
|
|
109
|
+
}
|
|
110
|
+
set closeDelay(e) {
|
|
111
|
+
this._closeDelay = +e;
|
|
112
|
+
}
|
|
113
|
+
get closeDelay() {
|
|
114
|
+
return this._closeDelay ?? u().popover?.closeDelay ?? 0;
|
|
115
|
+
}
|
|
116
|
+
#t;
|
|
117
|
+
get _hoverTrigger() {
|
|
118
|
+
return this.#t;
|
|
119
|
+
}
|
|
120
|
+
set _hoverTrigger(e) {
|
|
121
|
+
this.#t = e;
|
|
122
|
+
}
|
|
123
|
+
configureTrigger(e) {
|
|
124
|
+
let t = this.hoverTrigger && !g;
|
|
125
|
+
this.trigger === e && t === this._hoverTrigger || (this._hoverTrigger !== t && (this._hoverTrigger = t, this.toggleState("hover-trigger", this._hoverTrigger), this._registerOverlayListeners()), super.configureTrigger(e));
|
|
126
|
+
}
|
|
127
|
+
_registerOverlayListeners() {
|
|
128
|
+
this._overlayAbortController?.abort(), this._hoverTrigger && (this._overlayAbortController = new AbortController(), this.overlay?.addEventListener("mouseenter", () => this._onOverlayMouseEnter(), { signal: this._overlayAbortController.signal }), this.overlay?.addEventListener("mouseleave", () => this._onOverlayMouseLeave(), { signal: this._overlayAbortController.signal }));
|
|
129
|
+
}
|
|
130
|
+
registerTriggerListeners(e) {
|
|
131
|
+
this._hoverTrigger && this.trigger ? (this.trigger.addEventListener("mouseenter", this._onTriggerMouseEnter, { signal: e }), this.trigger.addEventListener("mouseleave", this._onTriggerMouseLeave, { signal: e }), this.trigger.addEventListener("keydown", (e) => {
|
|
132
|
+
(e.code === "Space" || e.code === "Enter") && this.open();
|
|
133
|
+
}, { signal: e }), this.trigger.addEventListener("mousedown", (e) => {
|
|
134
|
+
l(e) && this.open();
|
|
135
|
+
}, { signal: e })) : super.registerTriggerListeners(e);
|
|
136
|
+
}
|
|
137
|
+
firstUpdated(e) {
|
|
138
|
+
super.firstUpdated(e), this._registerOverlayListeners();
|
|
139
|
+
}
|
|
140
|
+
open() {
|
|
141
|
+
super.open(), this.hoverTrigger && this.trigger && p(this.trigger).add("force-hover");
|
|
142
|
+
}
|
|
143
|
+
close() {
|
|
144
|
+
super.close(), p(this.trigger)?.delete("force-hover");
|
|
145
|
+
}
|
|
146
|
+
renderContent() {
|
|
147
|
+
return n`
|
|
148
|
+
<span class="sbb-popover__scrollable-content sbb-scrollbar">
|
|
149
|
+
<slot
|
|
150
|
+
@slotchange=${() => this.toggleState("has-close-button", !!this.querySelector("sbb-popover-close-button"))}
|
|
151
|
+
></slot>
|
|
152
|
+
</span>
|
|
153
|
+
`;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
})();
|
|
157
|
+
//#endregion
|
|
158
|
+
export { _ as t };
|
package/popover.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { n as e,
|
|
1
|
+
import { n as e, t } from "./popover-base-DlSa-ajc.js";
|
|
2
|
+
import { t as n } from "./popover.component-BHg4Qtqd.js";
|
|
3
|
+
import { SbbPopoverCloseButtonElement as r } from "./popover/popover-close-button/popover-close-button.component.js";
|
|
2
4
|
import "./popover.pure.js";
|
|
3
|
-
|
|
4
|
-
t.define();
|
|
5
|
+
n.define(), r.define();
|
|
5
6
|
//#endregion
|
|
6
|
-
export {
|
|
7
|
+
export { t as SbbPopoverBaseElement, r as SbbPopoverCloseButtonElement, e as SbbPopoverCloseEvent, n as SbbPopoverElement };
|
package/popover.pure.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { n as e,
|
|
2
|
-
|
|
1
|
+
import { n as e, t } from "./popover-base-DlSa-ajc.js";
|
|
2
|
+
import { t as n } from "./popover.component-BHg4Qtqd.js";
|
|
3
|
+
import { SbbPopoverCloseButtonElement as r } from "./popover/popover-close-button/popover-close-button.component.js";
|
|
4
|
+
export { t as SbbPopoverBaseElement, r as SbbPopoverCloseButtonElement, e as SbbPopoverCloseEvent, n as SbbPopoverElement };
|
package/toast/toast.component.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../toast.component-
|
|
1
|
+
import { t as e } from "../toast.component-Dlr0Koxu.js";
|
|
2
2
|
export { e as SbbToastElement };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { __esDecorate as e, __runInitializers as t } from "tslib";
|
|
2
2
|
import { html as n, nothing as r, unsafeCSS as i } from "lit";
|
|
3
3
|
import { property as a } from "lit/decorators.js";
|
|
4
|
-
import { SbbDarkModeController as o, SbbLanguageController as s, SbbOpenCloseBaseElement as c, SbbReadonlyMixin as l,
|
|
5
|
-
import { SbbTransparentButtonElement as
|
|
6
|
-
import { SbbDividerElement as
|
|
7
|
-
import { SbbIconNameMixin as
|
|
4
|
+
import { SbbDarkModeController as o, SbbLanguageController as s, SbbOpenCloseBaseElement as c, SbbReadonlyMixin as l, forceType as u, i18nCloseAlert as d, isZeroAnimationDuration as f, popoverResetStyles as p } from "./core.js";
|
|
5
|
+
import { SbbTransparentButtonElement as m } from "./button.pure.js";
|
|
6
|
+
import { SbbDividerElement as h } from "./divider.pure.js";
|
|
7
|
+
import { SbbIconNameMixin as g } from "./icon.pure.js";
|
|
8
8
|
//#region src/elements/toast/toast.scss?inline
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
return class extends
|
|
9
|
+
var _ = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-6x) );--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);display:none}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){--sbb-toast-container-display: flex;display:block}:host([position=bottom-left]),:host([position=bottom-start]){--sbb-toast-horizontal-position: flex-start;--sbb-toast-vertical-position: flex-end}:host([position=bottom-center]){--sbb-toast-horizontal-position: center;--sbb-toast-vertical-position: flex-end}:host([position=bottom-right]),:host([position=bottom-end]){--sbb-toast-horizontal-position: flex-end;--sbb-toast-vertical-position: flex-end}:host([position=top-left]),:host([position=top-start]){--sbb-toast-horizontal-position: flex-start;--sbb-toast-vertical-position: flex-start}:host([position=top-center]){--sbb-toast-horizontal-position: center;--sbb-toast-vertical-position: flex-start}:host([position=top-right]),:host([position=top-end]){--sbb-toast-horizontal-position: flex-end;--sbb-toast-vertical-position: flex-start}:host(:is(:state(dark),[state--dark])){--sbb-focus-outline-color: var(--sbb-focus-outline-color-default)}.sbb-toast__overlay-container{position:var(--sbb-toast-container-position);pointer-events:none;inset:0;display:var(--sbb-toast-container-display, none);justify-content:var(--sbb-toast-horizontal-position);align-items:var(--sbb-toast-vertical-position)}.sbb-toast{z-index:var(--sbb-toast-z-index, var(--sbb-overlay-default-z-index));pointer-events:auto;margin:var(--sbb-toast-margin);border-radius:var(--sbb-toast-border-radius);max-width:var(--sbb-toast-max-width);display:flex;color:var(--sbb-toast-text-color);background-color:var(--sbb-toast-background-color)}:host(:is(:state(state-opening),[state--state-opening])) .sbb-toast{animation-name:open;animation-duration:var(--sbb-toast-animation-duration);animation-timing-function:var(--sbb-toast-animation-timing-function)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-toast{animation-name:close;animation-duration:var(--sbb-toast-animation-duration);animation-timing-function:var(--sbb-toast-animation-timing-function)}.sbb-toast-wrapper{display:flex;align-items:center;gap:var(--sbb-toast-gap);padding-block:var(--sbb-toast-padding-block);padding-inline:var(--sbb-toast-padding-inline)}slot:not([name=icon]),.sbb-toast__close{color-scheme:only light}.sbb-toast__content{font-weight:700;font-size:var(--sbb-heading-font-size-6);letter-spacing:var(--sbb-typo-letter-spacing-heading);flex:1 1 0}.sbb-toast__close{display:flex;align-items:center}.sbb-toast__close-divider{padding-block:var(--sbb-toast-padding-block)}.sbb-toast__close-button{margin-inline:var(--sbb-spacing-responsive-xxxs)}@keyframes open{0%{visibility:hidden;opacity:0;translate:0 var(--sbb-spacing-fixed-2x)}to{visibility:visible;opacity:1;translate:0}}@keyframes close{0%{visibility:visible;opacity:1;translate:0}to{visibility:hidden;opacity:0;translate:0 var(--sbb-spacing-fixed-2x)}}", v = /* @__PURE__ */ new Set(), y = (() => {
|
|
10
|
+
let y = g(l(c)), b, x = [], S = [], C, w = [], T = [], E, D = [], O = [];
|
|
11
|
+
return class extends y {
|
|
12
12
|
static {
|
|
13
|
-
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
14
|
-
|
|
13
|
+
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(y[Symbol.metadata] ?? null) : void 0;
|
|
14
|
+
b = [u(), a({ type: Number })], C = [a({ reflect: !0 })], E = [a()], e(this, null, b, {
|
|
15
15
|
kind: "accessor",
|
|
16
16
|
name: "timeout",
|
|
17
17
|
static: !1,
|
|
@@ -24,7 +24,7 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
metadata: t
|
|
27
|
-
},
|
|
27
|
+
}, x, S), e(this, null, C, {
|
|
28
28
|
kind: "accessor",
|
|
29
29
|
name: "position",
|
|
30
30
|
static: !1,
|
|
@@ -37,7 +37,7 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
metadata: t
|
|
40
|
-
},
|
|
40
|
+
}, w, T), e(this, null, E, {
|
|
41
41
|
kind: "accessor",
|
|
42
42
|
name: "politeness",
|
|
43
43
|
static: !1,
|
|
@@ -50,7 +50,7 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
metadata: t
|
|
53
|
-
},
|
|
53
|
+
}, D, O), t && Object.defineProperty(this, Symbol.metadata, {
|
|
54
54
|
enumerable: !0,
|
|
55
55
|
configurable: !0,
|
|
56
56
|
writable: !0,
|
|
@@ -61,10 +61,10 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
61
61
|
this.elementName = "sbb-toast";
|
|
62
62
|
}
|
|
63
63
|
static {
|
|
64
|
-
this.elementDependencies = [
|
|
64
|
+
this.elementDependencies = [m, h];
|
|
65
65
|
}
|
|
66
66
|
static {
|
|
67
|
-
this.styles = [
|
|
67
|
+
this.styles = [p, i(_)];
|
|
68
68
|
}
|
|
69
69
|
#e;
|
|
70
70
|
get timeout() {
|
|
@@ -88,15 +88,15 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
88
88
|
this.#n = e;
|
|
89
89
|
}
|
|
90
90
|
constructor() {
|
|
91
|
-
super(), this.#e = t(this,
|
|
91
|
+
super(), this.#e = t(this, x, 0), this.#t = (t(this, S), t(this, w, "bottom-center")), this.#n = (t(this, T), t(this, D, "polite")), this._closeTimeout = t(this, O), this._language = new s(this), this._darkModeController = new o(this, () => {
|
|
92
92
|
this._syncSlottedElements(), this.requestUpdate();
|
|
93
93
|
}), this.addEventListener?.("click", (e) => this._onClick(e));
|
|
94
94
|
}
|
|
95
95
|
connectedCallback() {
|
|
96
|
-
this.popover = "manual", super.connectedCallback(),
|
|
96
|
+
this.popover = "manual", super.connectedCallback(), v.add(this);
|
|
97
97
|
}
|
|
98
98
|
disconnectedCallback() {
|
|
99
|
-
super.disconnectedCallback(), clearTimeout(this._closeTimeout),
|
|
99
|
+
super.disconnectedCallback(), clearTimeout(this._closeTimeout), v.delete(this);
|
|
100
100
|
}
|
|
101
101
|
willUpdate(e) {
|
|
102
102
|
super.willUpdate(e), e.has("politeness") && (this.internals.ariaLive = this.politeness);
|
|
@@ -117,11 +117,10 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
_onClick(e) {
|
|
120
|
-
|
|
121
|
-
t && !t.hasAttribute("disabled") && this.close();
|
|
120
|
+
e.composedPath().some((e, t, n) => e instanceof HTMLElement && t < n.indexOf(this) && e.hasAttribute("sbb-toast-close") && !e.hasAttribute("disabled")) && this.close();
|
|
122
121
|
}
|
|
123
122
|
_isZeroAnimationDuration() {
|
|
124
|
-
return
|
|
123
|
+
return f(this, "--sbb-toast-animation-duration");
|
|
125
124
|
}
|
|
126
125
|
_onContentSlotChange(e) {
|
|
127
126
|
let t = e.target.assignedNodes();
|
|
@@ -142,7 +141,7 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
142
141
|
e.animationName === "open" && this.state === "opening" ? this._handleOpening() : e.animationName === "close" && this.state === "closing" && this._handleClosing();
|
|
143
142
|
}
|
|
144
143
|
_closeOtherToasts() {
|
|
145
|
-
|
|
144
|
+
v.forEach((e) => {
|
|
146
145
|
(e.state === "opened" || e.state === "opening") && e.close();
|
|
147
146
|
});
|
|
148
147
|
}
|
|
@@ -170,7 +169,7 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
170
169
|
class="sbb-toast__close-button"
|
|
171
170
|
icon-name="cross-small"
|
|
172
171
|
?negative=${this._isLightMode()}
|
|
173
|
-
aria-label=${
|
|
172
|
+
aria-label=${d[this._language.current]}
|
|
174
173
|
sbb-toast-close
|
|
175
174
|
></sbb-transparent-button>`}
|
|
176
175
|
</div>
|
|
@@ -181,4 +180,4 @@ var v = ":host{--sbb-toast-animation-duration: var( --sbb-disable-animation-dura
|
|
|
181
180
|
};
|
|
182
181
|
})();
|
|
183
182
|
//#endregion
|
|
184
|
-
export {
|
|
183
|
+
export { y as t };
|
package/toast.js
CHANGED