@sbb-esta/lyne-elements 2.0.3 → 2.1.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/accordion/accordion.d.ts.map +1 -1
- package/accordion.js +6 -6
- package/alert/alert.js +8 -8
- package/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-button.js +4 -4
- package/autocomplete-grid/autocomplete-grid-optgroup.js +4 -4
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts +1 -1
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid-option.js +10 -10
- package/autocomplete-grid/autocomplete-grid-row.js +4 -4
- package/autocomplete.js +92 -89
- package/breadcrumb/breadcrumb-group.js +4 -4
- package/button/accent-button-link.js +9 -9
- package/button/accent-button-static.js +6 -6
- package/button/accent-button.js +6 -6
- package/button/button-link.js +7 -7
- package/button/button-static.js +7 -7
- package/button/button.js +8 -8
- package/button/common.js +1 -1
- package/button/mini-button-group.js +8 -8
- package/button/secondary-button-link.js +7 -7
- package/button/secondary-button-static.js +7 -7
- package/button/secondary-button.js +3 -3
- package/button/transparent-button-link.js +6 -6
- package/button/transparent-button-static.js +5 -5
- package/button/transparent-button.js +6 -6
- package/card/card-badge.js +9 -9
- package/card/card-button.js +5 -5
- package/card/card-link.js +7 -7
- package/checkbox/checkbox-panel.js +16 -16
- package/checkbox/checkbox.js +15 -15
- package/checkbox/common.js +3 -3
- package/clock.js +8 -8
- package/container/container/container.d.ts +1 -1
- package/container/container/container.d.ts.map +1 -1
- package/container/container.js +21 -21
- package/container/sticky-bar/sticky-bar.d.ts +1 -1
- package/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/container/sticky-bar.js +4 -4
- package/core/base-elements.js +8 -8
- package/core/controllers.js +4 -4
- package/core/datetime/date-adapter.d.ts +1 -1
- package/core/datetime/date-adapter.d.ts.map +1 -1
- package/core/datetime/native-date-adapter.d.ts +1 -1
- package/core/datetime/native-date-adapter.d.ts.map +1 -1
- package/core/datetime.js +6 -6
- package/core/dom/scroll.d.ts +1 -1
- package/core/dom/scroll.d.ts.map +1 -1
- package/core/dom.js +39 -39
- package/core/eventing.js +4 -4
- package/core/mixins.js +18 -18
- package/core/styles/core.scss +21 -2
- package/core/testing.js +14 -14
- package/core.css +18 -2
- package/custom-elements.json +364 -428
- package/datepicker/common/datepicker-association-controllers.d.ts +21 -0
- package/datepicker/common/datepicker-association-controllers.d.ts.map +1 -0
- package/datepicker/common/datepicker-button.d.ts +17 -9
- package/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/datepicker/common.d.ts +1 -0
- package/datepicker/common.d.ts.map +1 -1
- package/datepicker/common.js +130 -92
- package/datepicker/datepicker/datepicker.d.ts +19 -4
- package/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts +14 -8
- package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/datepicker/datepicker-toggle.js +108 -112
- package/datepicker/datepicker.js +95 -80
- package/development/accordion/accordion.d.ts.map +1 -1
- package/development/accordion.js +1 -1
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid-option.js +3 -3
- package/development/autocomplete.js +24 -8
- package/development/button/common.js +4 -2
- package/development/calendar.js +1 -1
- package/development/container/container/container.d.ts +1 -1
- package/development/container/container/container.d.ts.map +1 -1
- package/development/container/container.js +17 -1
- package/development/container/sticky-bar/sticky-bar.d.ts +1 -1
- package/development/container/sticky-bar/sticky-bar.d.ts.map +1 -1
- package/development/container/sticky-bar.js +9 -1
- package/development/core/datetime/date-adapter.d.ts +1 -1
- package/development/core/datetime/date-adapter.d.ts.map +1 -1
- package/development/core/datetime/native-date-adapter.d.ts +1 -1
- package/development/core/datetime/native-date-adapter.d.ts.map +1 -1
- package/development/core/datetime.js +1 -1
- package/development/core/dom/scroll.d.ts +1 -1
- package/development/core/dom/scroll.d.ts.map +1 -1
- package/development/core/dom.js +4 -4
- package/development/core/mixins.js +1 -1
- package/development/datepicker/common/datepicker-association-controllers.d.ts +21 -0
- package/development/datepicker/common/datepicker-association-controllers.d.ts.map +1 -0
- package/development/datepicker/common/datepicker-button.d.ts +17 -9
- package/development/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/development/datepicker/common.d.ts +1 -0
- package/development/datepicker/common.d.ts.map +1 -1
- package/development/datepicker/common.js +139 -90
- package/development/datepicker/datepicker/datepicker.d.ts +19 -4
- package/development/datepicker/datepicker/datepicker.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts +14 -8
- package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
- package/development/datepicker/datepicker-toggle.js +65 -69
- package/development/datepicker/datepicker.js +54 -36
- package/development/dialog/dialog/dialog.d.ts +2 -0
- package/development/dialog/dialog/dialog.d.ts.map +1 -1
- package/development/dialog/dialog.js +37 -11
- package/development/menu/menu/menu.d.ts.map +1 -1
- package/development/menu/menu.js +35 -12
- package/development/navigation/navigation/navigation.d.ts.map +1 -1
- package/development/navigation/navigation.js +15 -8
- package/development/option/option/option-base-element.d.ts +3 -2
- package/development/option/option/option-base-element.d.ts.map +1 -1
- package/development/option/option.js +15 -8
- package/development/overlay/overlay-base-element.d.ts.map +1 -1
- package/development/overlay/overlay.d.ts.map +1 -1
- package/development/overlay.js +29 -13
- package/development/popover/popover/popover.d.ts.map +1 -1
- package/development/popover/popover.js +16 -13
- package/development/select/select.d.ts +11 -0
- package/development/select/select.d.ts.map +1 -1
- package/development/select.js +60 -9
- package/development/toast/toast.d.ts.map +1 -1
- package/development/toast.js +14 -8
- package/development/toggle/toggle.js +1 -1
- package/development/train/train-wagon.js +1 -1
- package/dialog/dialog/dialog.d.ts +2 -0
- package/dialog/dialog/dialog.d.ts.map +1 -1
- package/dialog/dialog-content.js +3 -3
- package/dialog/dialog-title.js +8 -8
- package/dialog/dialog.js +59 -49
- package/divider.js +12 -12
- package/file-selector/file-selector-dropzone.js +5 -5
- package/file-selector/file-selector.js +6 -6
- package/flip-card/flip-card-details.js +4 -4
- package/flip-card/flip-card-summary.js +9 -9
- package/header/header-button.js +5 -5
- package/header/header-link.js +5 -5
- package/icon.js +36 -36
- package/link/block-link-button.js +4 -4
- package/link/block-link-static.js +9 -9
- package/link/block-link.js +4 -4
- package/link/common.js +16 -16
- package/link/link-button.js +7 -7
- package/link/link-static.js +7 -7
- package/link/link.js +4 -4
- package/link-list/common.js +12 -12
- package/loading-indicator-circle.js +11 -11
- package/map-container.js +4 -4
- package/menu/common.js +7 -7
- package/menu/menu/menu.d.ts.map +1 -1
- package/menu/menu-button.js +8 -8
- package/menu/menu-link.js +6 -6
- package/menu/menu.js +64 -42
- package/navigation/navigation/navigation.d.ts.map +1 -1
- package/navigation/navigation-button.js +4 -4
- package/navigation/navigation-link.js +7 -7
- package/navigation/navigation-list.js +4 -4
- package/navigation/navigation-marker.js +3 -3
- package/navigation/navigation.js +21 -20
- package/notification.js +17 -17
- package/option/optgroup.js +11 -11
- package/option/option/option-base-element.d.ts +3 -2
- package/option/option/option-base-element.d.ts.map +1 -1
- package/option/option.js +113 -101
- package/overlay/overlay-base-element.d.ts.map +1 -1
- package/overlay/overlay.d.ts.map +1 -1
- package/overlay.js +87 -84
- package/package.json +1 -1
- package/paginator/common.js +6 -6
- package/popover/popover/popover.d.ts.map +1 -1
- package/popover/popover.js +73 -73
- package/radio-button/radio-button-panel.js +5 -5
- package/screen-reader-only.js +5 -5
- package/select/select.d.ts +11 -0
- package/select/select.d.ts.map +1 -1
- package/select.js +111 -83
- package/slider.js +8 -8
- package/standard-theme.css +18 -2
- package/status.js +3 -3
- package/stepper/step-label.js +4 -4
- package/table/table-wrapper.js +4 -4
- package/tabs/tab-group.js +24 -24
- package/tabs/tab.js +3 -3
- package/tag/tag-group.js +7 -7
- package/teaser-product/common.js +5 -5
- package/teaser-product/teaser-product-static.js +2 -2
- package/timetable-occupancy-icon.js +3 -3
- package/timetable-occupancy.js +6 -6
- package/toast/toast.d.ts.map +1 -1
- package/toast.js +58 -54
- package/toggle/toggle-option.js +11 -11
- package/toggle-check.js +5 -5
- package/train/train.js +28 -28
package/table/table-wrapper.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __esDecorate as s, __runInitializers as c } from "tslib";
|
|
2
2
|
import { ResizeController as i } from "@lit-labs/observers/resize-controller.js";
|
|
3
|
-
import { css as p, LitElement as d, html as
|
|
4
|
-
import { customElement as
|
|
3
|
+
import { css as p, LitElement as d, html as n } from "lit";
|
|
4
|
+
import { customElement as h } from "lit/decorators.js";
|
|
5
5
|
import { SbbNegativeMixin as u } from "../core/mixins.js";
|
|
6
6
|
const w = p`*,:before,:after{box-sizing:border-box}:host{--sbb-table-wrapper-border-radius: var(--sbb-border-radius-4x);display:block}::slotted(.sbb-table){width:100%}.sbb-table-wrapper{overflow:auto;--sbb-scrollbar-thumb-width: .5rem;--sbb-scrollbar-thumb-width-hover: var(--sbb-scrollbar-thumb-width);--sbb-scrollbar-width-firefox: auto;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: var(--sbb-color-cloud);--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-table-wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-table-wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-table-wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-table-wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-table-wrapper::-webkit-scrollbar-button,.sbb-table-wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-table-wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}:host([negative]) .sbb-table-wrapper{--sbb-scrollbar-color: var(--sbb-color-white-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-white-alpha-60);--sbb-scrollbar-track-color: var(--sbb-color-iron)}:host([data-has-horizontal-scrollbar]) .sbb-table-wrapper{padding-bottom:var(--sbb-spacing-fixed-1x)}`;
|
|
7
7
|
let _ = (() => {
|
|
8
8
|
var b;
|
|
9
|
-
let e = [
|
|
9
|
+
let e = [h("sbb-table-wrapper")], l, t = [], r, o = u(d);
|
|
10
10
|
return b = class extends o {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments), this._resizeObserver = new i(this, {
|
|
@@ -22,7 +22,7 @@ let _ = (() => {
|
|
|
22
22
|
this.toggleAttribute("data-has-horizontal-scrollbar", this._tableWrapper.scrollWidth > this._tableWrapper.offsetWidth);
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
|
-
return
|
|
25
|
+
return n`<div class="sbb-table-wrapper">
|
|
26
26
|
<slot></slot>
|
|
27
27
|
</div>`;
|
|
28
28
|
}
|
package/tabs/tab-group.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var I = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var I = (a) => {
|
|
2
|
+
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var S = (
|
|
5
|
-
var y = (
|
|
4
|
+
var S = (a, r, l) => r.has(a) || I("Cannot " + l);
|
|
5
|
+
var y = (a, r, l) => (S(a, r, "read from private field"), l ? l.call(a) : r.get(a)), z = (a, r, l) => r.has(a) ? I("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, l), _ = (a, r, l, c) => (S(a, r, "write to private field"), c ? c.call(a, l) : r.set(a, l), l);
|
|
6
6
|
import { __esDecorate as m, __runInitializers as h } from "tslib";
|
|
7
7
|
import { MutationController as w } from "@lit-labs/observers/mutation-controller.js";
|
|
8
8
|
import { ResizeController as E } from "@lit-labs/observers/resize-controller.js";
|
|
@@ -20,13 +20,13 @@ const F = k`*,:before,:after{box-sizing:border-box}:host{--sbb-tab-group-animati
|
|
|
20
20
|
};
|
|
21
21
|
let B = 0, ot = (() => {
|
|
22
22
|
var b, d;
|
|
23
|
-
let
|
|
24
|
-
var f = (d = class extends
|
|
23
|
+
let a = [$("sbb-tab-group")], r, l = [], c, p = U(R), v = [], g, A, x = [], T = [];
|
|
24
|
+
var f = (d = class extends p {
|
|
25
25
|
constructor() {
|
|
26
26
|
var t;
|
|
27
27
|
super();
|
|
28
28
|
z(this, b);
|
|
29
|
-
this._tabs = (h(this,
|
|
29
|
+
this._tabs = (h(this, v), []), this._tabAttributeObserver = new w(this, {
|
|
30
30
|
target: null,
|
|
31
31
|
config: W,
|
|
32
32
|
callback: (e) => this._onTabAttributesChange(e)
|
|
@@ -39,15 +39,15 @@ let B = 0, ot = (() => {
|
|
|
39
39
|
skipInitial: !0,
|
|
40
40
|
callback: (e) => this._onTabContentElementResize(e)
|
|
41
41
|
}), this._size = P() ? "s" : "l", _(this, b, h(this, x, 0)), this._selectedTabChanged = (h(this, T), new j(this, f.events.didChange)), this._onContentSlotChange = () => {
|
|
42
|
-
var i,
|
|
42
|
+
var i, n;
|
|
43
43
|
this._tabContentElement = this.shadowRoot.querySelector("div.tab-content");
|
|
44
44
|
const e = this._getTabs().filter((s) => !this._tabs.includes(s));
|
|
45
|
-
e.length && (e.forEach((s) => this._configure(s)), this._tabs = this._tabs.concat(e), (
|
|
45
|
+
e.length && (e.forEach((s) => this._configure(s)), this._tabs = this._tabs.concat(e), (n = (i = e.find((s) => s.active)) == null ? void 0 : i.tabGroupActions) == null || n.select());
|
|
46
46
|
}, this._onTabsSlotChange = () => {
|
|
47
47
|
const e = this._getTabs();
|
|
48
|
-
e.length < this._tabs.length && (this._tabs.filter((
|
|
48
|
+
e.length < this._tabs.length && (this._tabs.filter((n) => !e.includes(n)).forEach((n) => {
|
|
49
49
|
var s;
|
|
50
|
-
(s =
|
|
50
|
+
(s = n.tab) == null || s.remove();
|
|
51
51
|
}), this._tabs = e), this._tabs.forEach((i) => i.setAttribute("data-size", this.size));
|
|
52
52
|
}, (t = this.addEventListener) == null || t.call(this, "keydown", (e) => this._handleKeyDown(e));
|
|
53
53
|
}
|
|
@@ -116,19 +116,19 @@ let B = 0, ot = (() => {
|
|
|
116
116
|
this.initialSelectedIndex >= 0 && this.initialSelectedIndex < this._tabs.length && !this._tabs[this.initialSelectedIndex].disabled ? (t = this._tabs[this.initialSelectedIndex].tabGroupActions) == null || t.select() : (i = (e = this._enabledTabs()[0]) == null ? void 0 : e.tabGroupActions) == null || i.select();
|
|
117
117
|
}
|
|
118
118
|
_onTabAttributesChange(t) {
|
|
119
|
-
var e, i,
|
|
119
|
+
var e, i, n;
|
|
120
120
|
for (const s of t) {
|
|
121
121
|
if (s.type !== "attributes")
|
|
122
122
|
return;
|
|
123
123
|
const o = s.target;
|
|
124
|
-
s.attributeName === "disabled" && (o.hasAttribute("disabled") && o !== this._selectedTab ? (e = o.tabGroupActions) == null || e.disable() : o.disabled && ((i = o.tabGroupActions) == null || i.enable())), s.attributeName === "active" && (o.hasAttribute("active") && !o.disabled ? (
|
|
124
|
+
s.attributeName === "disabled" && (o.hasAttribute("disabled") && o !== this._selectedTab ? (e = o.tabGroupActions) == null || e.disable() : o.disabled && ((i = o.tabGroupActions) == null || i.enable())), s.attributeName === "active" && (o.hasAttribute("active") && !o.disabled ? (n = o.tabGroupActions) == null || n.select() : o === this._selectedTab && o.toggleAttribute("active", !0));
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
_onTabGroupElementResize(t) {
|
|
128
128
|
for (const e of t) {
|
|
129
129
|
const i = e.target.firstElementChild.assignedElements();
|
|
130
|
-
for (const
|
|
131
|
-
|
|
130
|
+
for (const n of i)
|
|
131
|
+
n.toggleAttribute("data-has-divider", n === i[0] || n.offsetLeft === i[0].offsetLeft), this.style.setProperty("--sbb-tab-group-width", `${this._tabGroupElement.clientWidth}px`);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
_onTabContentElementResize(t) {
|
|
@@ -150,17 +150,17 @@ let B = 0, ot = (() => {
|
|
|
150
150
|
t.removeAttribute("active"), t.active = !1, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (i = t.tab) == null || i.removeAttribute("active");
|
|
151
151
|
},
|
|
152
152
|
disable: () => {
|
|
153
|
-
var i,
|
|
154
|
-
t.disabled || (t.hasAttribute("disabled") || t.toggleAttribute("disabled", !0), t.disabled = !0, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (i = t.tab) == null || i.removeAttribute("active"), t.active && (t.removeAttribute("active"), t.active = !1, (s = (
|
|
153
|
+
var i, n, s;
|
|
154
|
+
t.disabled || (t.hasAttribute("disabled") || t.toggleAttribute("disabled", !0), t.disabled = !0, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (i = t.tab) == null || i.removeAttribute("active"), t.active && (t.removeAttribute("active"), t.active = !1, (s = (n = this._enabledTabs()[0]) == null ? void 0 : n.tabGroupActions) == null || s.select()));
|
|
155
155
|
},
|
|
156
156
|
enable: () => {
|
|
157
157
|
t.disabled && (t.removeAttribute("disabled"), t.disabled = !1);
|
|
158
158
|
},
|
|
159
159
|
select: () => {
|
|
160
|
-
var i,
|
|
160
|
+
var i, n;
|
|
161
161
|
if (t !== this._selectedTab && !t.disabled) {
|
|
162
162
|
const s = this._selectedTab;
|
|
163
|
-
s && ((i = s.tabGroupActions) == null || i.deactivate(), this._tabContentResizeObserver.unobserve(s.tab)), (
|
|
163
|
+
s && ((i = s.tabGroupActions) == null || i.deactivate(), this._tabContentResizeObserver.unobserve(s.tab)), (n = t.tabGroupActions) == null || n.activate(), this._selectedTab = t, this._tabContentResizeObserver.observe(t.tab);
|
|
164
164
|
const o = this._tabs;
|
|
165
165
|
this._selectedTabChanged.emit({
|
|
166
166
|
activeIndex: o.findIndex((u) => u === t),
|
|
@@ -178,12 +178,12 @@ let B = 0, ot = (() => {
|
|
|
178
178
|
}), t.tab && (t.setAttribute("aria-controls", t.tab.id), t.tab.setAttribute("role", "tabpanel"), t.tab.toggleAttribute("active", t.active)), this._tabAttributeObserver.observe(t), t.slot = "tab-bar";
|
|
179
179
|
}
|
|
180
180
|
_handleKeyDown(t) {
|
|
181
|
-
var i,
|
|
181
|
+
var i, n, s;
|
|
182
182
|
const e = this._enabledTabs();
|
|
183
183
|
if (!(!e || // don't trap nested handling
|
|
184
184
|
t.target !== this && t.target.parentElement !== this) && N(t)) {
|
|
185
185
|
const o = e.findIndex((G) => G.active), u = K(t, o, e.length);
|
|
186
|
-
(
|
|
186
|
+
(n = (i = e[u]) == null ? void 0 : i.tabGroupActions) == null || n.select(), (s = e[u]) == null || s.focus(), t.preventDefault();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
render() {
|
|
@@ -202,12 +202,12 @@ let B = 0, ot = (() => {
|
|
|
202
202
|
`;
|
|
203
203
|
}
|
|
204
204
|
}, b = new WeakMap(), c = d, (() => {
|
|
205
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
205
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(p[Symbol.metadata] ?? null) : void 0;
|
|
206
206
|
g = [C()], A = [M(), C({ attribute: "initial-selected-index", type: Number })], m(d, null, g, { kind: "setter", name: "size", static: !1, private: !1, access: { has: (e) => "size" in e, set: (e, i) => {
|
|
207
207
|
e.size = i;
|
|
208
|
-
} }, metadata: t }, null,
|
|
208
|
+
} }, metadata: t }, null, v), m(d, null, A, { kind: "accessor", name: "initialSelectedIndex", static: !1, private: !1, access: { has: (e) => "initialSelectedIndex" in e, get: (e) => e.initialSelectedIndex, set: (e, i) => {
|
|
209
209
|
e.initialSelectedIndex = i;
|
|
210
|
-
} }, metadata: t }, x, T), m(null, r = { value: c },
|
|
210
|
+
} }, metadata: t }, x, T), m(null, r = { value: c }, a, { kind: "class", name: c.name, metadata: t }, null, l), f = c = r.value, t && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
211
211
|
})(), d.styles = F, d.events = {
|
|
212
212
|
didChange: "didChange"
|
|
213
213
|
}, h(c, l), d);
|
package/tabs/tab.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esDecorate as o, __runInitializers as b } from "tslib";
|
|
2
|
-
import { css as n, html as c, LitElement as
|
|
3
|
-
import { customElement as
|
|
2
|
+
import { css as n, html as c, LitElement as u } from "lit";
|
|
3
|
+
import { customElement as m } from "lit/decorators.js";
|
|
4
4
|
const d = n`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{display:block}:host:after,:host:before{content:" ";display:block;visibility:hidden;height:0;overflow:hidden}`;
|
|
5
5
|
let p = (() => {
|
|
6
6
|
var l;
|
|
7
|
-
let r = [
|
|
7
|
+
let r = [m("sbb-tab")], a, s = [], t, i = u;
|
|
8
8
|
return l = class extends i {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this._label = null;
|
package/tag/tag-group.js
CHANGED
|
@@ -2,8 +2,8 @@ var O = (i) => {
|
|
|
2
2
|
throw TypeError(i);
|
|
3
3
|
};
|
|
4
4
|
var D = (i, l, a) => l.has(i) || O("Cannot " + a);
|
|
5
|
-
var f = (i, l, a) => (D(i, l, "read from private field"), a ? a.call(i) : l.get(i)), _ = (i, l, a) => l.has(i) ? O("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(i) : l.set(i, a),
|
|
6
|
-
import { __runInitializers as
|
|
5
|
+
var f = (i, l, a) => (D(i, l, "read from private field"), a ? a.call(i) : l.get(i)), _ = (i, l, a) => l.has(i) ? O("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(i) : l.set(i, a), o = (i, l, a, c) => (D(i, l, "write to private field"), c ? c.call(i, a) : l.set(i, a), a);
|
|
6
|
+
import { __runInitializers as n, __esDecorate as p } from "tslib";
|
|
7
7
|
import { css as U, LitElement as j, isServer as N, html as q } from "lit";
|
|
8
8
|
import { customElement as C, property as d } from "lit/decorators.js";
|
|
9
9
|
import { forceType as T } from "../core/decorators.js";
|
|
@@ -19,7 +19,7 @@ let X = (() => {
|
|
|
19
19
|
_(this, u);
|
|
20
20
|
_(this, b);
|
|
21
21
|
_(this, h);
|
|
22
|
-
this.listChildLocalNames = (
|
|
22
|
+
this.listChildLocalNames = (n(this, g), ["sbb-tag", "div"]), o(this, u, n(this, z, "")), o(this, b, (n(this, v), n(this, x, !1))), o(this, h, (n(this, k), n(this, E, B() ? "s" : "m"))), this._value = (n(this, w), null);
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* This will be forwarded as aria-label to the inner list.
|
|
@@ -28,7 +28,7 @@ let X = (() => {
|
|
|
28
28
|
return f(this, u);
|
|
29
29
|
}
|
|
30
30
|
set listAccessibilityLabel(t) {
|
|
31
|
-
|
|
31
|
+
o(this, u, t);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* If set multiple to false, the selection is exclusive and the value is a string (or null).
|
|
@@ -40,7 +40,7 @@ let X = (() => {
|
|
|
40
40
|
return f(this, b);
|
|
41
41
|
}
|
|
42
42
|
set multiple(t) {
|
|
43
|
-
|
|
43
|
+
o(this, b, t);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Tag group size, either s or m.
|
|
@@ -50,7 +50,7 @@ let X = (() => {
|
|
|
50
50
|
return f(this, h);
|
|
51
51
|
}
|
|
52
52
|
set size(t) {
|
|
53
|
-
|
|
53
|
+
o(this, h, t);
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Value of the sbb-tag-group.
|
|
@@ -110,7 +110,7 @@ let X = (() => {
|
|
|
110
110
|
} }, metadata: t }, E, w), p(r, null, I, { kind: "setter", name: "value", static: !1, private: !1, access: { has: (e) => "value" in e, set: (e, s) => {
|
|
111
111
|
e.value = s;
|
|
112
112
|
} }, metadata: t }, null, g), p(null, l = { value: c }, i, { kind: "class", name: c.name, metadata: t }, null, a), c = l.value, t && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
113
|
-
})(), r.styles = M,
|
|
113
|
+
})(), r.styles = M, n(c, a), c;
|
|
114
114
|
})();
|
|
115
115
|
export {
|
|
116
116
|
X as SbbTagGroupElement
|
package/teaser-product/common.js
CHANGED
|
@@ -3,19 +3,19 @@ var m = (t) => {
|
|
|
3
3
|
};
|
|
4
4
|
var v = (t, e, r) => e.has(t) || m("Cannot " + r);
|
|
5
5
|
var f = (t, e, r) => (v(t, e, "read from private field"), r ? r.call(t) : e.get(t)), _ = (t, e, r) => e.has(t) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), h = (t, e, r, i) => (v(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
|
|
6
|
-
import { __esDecorate as k, __runInitializers as
|
|
6
|
+
import { __esDecorate as k, __runInitializers as d } from "tslib";
|
|
7
7
|
import { html as y, css as S } from "lit";
|
|
8
8
|
import { property as w } from "lit/decorators.js";
|
|
9
9
|
import { slotState as A } from "../core/decorators.js";
|
|
10
10
|
import { SbbNegativeMixin as z } from "../core/mixins.js";
|
|
11
11
|
const M = (t) => (() => {
|
|
12
12
|
var b, a;
|
|
13
|
-
let r = [A()], i,
|
|
13
|
+
let r = [A()], i, c = [], o, l = z(t), u, p = [], g = [];
|
|
14
14
|
return a = class extends l {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
|
-
_(this, b,
|
|
18
|
-
|
|
17
|
+
_(this, b, d(this, p, "after"));
|
|
18
|
+
d(this, g);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Whether the fully visible part of the image is aligned 'before' or 'after' the content.
|
|
@@ -46,7 +46,7 @@ const M = (t) => (() => {
|
|
|
46
46
|
const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(l[Symbol.metadata] ?? null) : void 0;
|
|
47
47
|
u = [w({ attribute: "image-alignment", reflect: !0 })], k(a, null, u, { kind: "accessor", name: "imageAlignment", static: !1, private: !1, access: { has: (n) => "imageAlignment" in n, get: (n) => n.imageAlignment, set: (n, x) => {
|
|
48
48
|
n.imageAlignment = x;
|
|
49
|
-
} }, metadata: s }, p, g), k(null, i = { value: o }, r, { kind: "class", name: o.name, metadata: s }, null,
|
|
49
|
+
} }, metadata: s }, p, g), k(null, i = { value: o }, r, { kind: "class", name: o.name, metadata: s }, null, c), o = i.value, s && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s }), d(o, c);
|
|
50
50
|
})(), o;
|
|
51
51
|
})(), O = S`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-teaser-product-background-color: var(--sbb-color-cloud);--sbb-teaser-product-background-gradient-direction: to right;--sbb-teaser-product-background: var(--sbb-teaser-product-background-color);--sbb-teaser-product-border-radius: var(--sbb-border-radius-4x);--sbb-teaser-product-content-color: var(--sbb-color-iron);--sbb-teaser-product-footer-color: var(--sbb-color-anthracite);--sbb-teaser-product-container-padding-block: var(--sbb-spacing-responsive-l);--sbb-teaser-product-min-height: 37.5rem;--sbb-teaser-product-background-gradient-start: 25%;--sbb-teaser-product-background-gradient-end: 75%}@media (min-width: 64rem){:host{--sbb-teaser-product-background: linear-gradient( var(--sbb-teaser-product-background-gradient-direction), var(--sbb-teaser-product-background-color) var(--sbb-teaser-product-background-gradient-start), transparent var(--sbb-teaser-product-background-gradient-end) )}}:host([negative]){--sbb-teaser-product-background-color: var(--sbb-color-midnight);--sbb-teaser-product-content-color: var(--sbb-color-cloud);--sbb-teaser-product-footer-color: var(--sbb-color-cloud);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-title-text-color-normal-override: var(--sbb-color-milk)}:host([image-alignment=before]){--sbb-teaser-product-background-gradient-direction: to left}.sbb-teaser-product__image-container{overflow:hidden;border-radius:var(--sbb-teaser-product-border-radius) var(--sbb-teaser-product-border-radius) 0 0}@media (min-width: 64rem){.sbb-teaser-product__image-container{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--sbb-teaser-product-border-radius)}}::slotted(p.sbb-teaser-product--spacing){margin:0}::slotted(sbb-title.sbb-teaser-product--spacing){--sbb-title-margin-block-start: 0}::slotted(:is(sbb-action-group,[data-action]).sbb-teaser-product--spacing){margin-block-start:var(--sbb-spacing-responsive-xxs)}::slotted([slot=image]){display:flex;width:100%;height:100%}@media (forced-colors: active){.sbb-teaser-product__root:after{content:"";position:absolute;display:block;top:0;right:0;bottom:0;left:0;pointer-events:none;border:var(--sbb-border-width-2x) solid CanvasText;border-radius:var(--sbb-teaser-product-border-radius)}}.sbb-action-base{display:block;position:relative;text-decoration:none}.sbb-teaser-product__container{background:var(--sbb-teaser-product-background);border-radius:0 0 var(--sbb-teaser-product-border-radius) var(--sbb-teaser-product-border-radius);padding:var(--sbb-spacing-responsive-s)}@media (min-width: 64rem){.sbb-teaser-product__container{display:grid;grid:"content ." 1fr "footnote ." auto/1fr 1fr;column-gap:var(--sbb-spacing-responsive-xxl);background:var(--sbb-teaser-product-background);border-radius:var(--sbb-teaser-product-border-radius);padding-block:var(--sbb-teaser-product-container-padding-block) 0;padding-inline:var(--sbb-spacing-responsive-xl);position:relative}:host([image-alignment=before]) .sbb-teaser-product__container{grid-template-areas:". content" ". footnote"}}.sbb-teaser-product__content{grid-area:content;align-self:center;margin:0;color:var(--sbb-teaser-product-content-color)}@media (min-width: 64rem){.sbb-teaser-product__content{align-content:center;min-height:calc(var(--sbb-teaser-product-min-height) - 2 * var(--sbb-teaser-product-container-padding-block))}}.sbb-teaser-product__footnote{grid-area:footnote;padding-block-start:var(--sbb-spacing-responsive-s);color:var(--sbb-teaser-product-footer-color);--sbb-text-font-size: var(--sbb-font-size-text-xxs);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)}:host(:not([data-slot-names~=footnote])) .sbb-teaser-product__footnote{padding-block-start:0}@media (min-width: 64rem){.sbb-teaser-product__footnote{min-height:var(--sbb-teaser-product-container-padding-block);padding-block:var(--sbb-spacing-responsive-xs)}}`;
|
|
52
52
|
export {
|
|
@@ -2,7 +2,7 @@ import { __esDecorate as i, __runInitializers as m } from "tslib";
|
|
|
2
2
|
import { customElement as c } from "lit/decorators.js";
|
|
3
3
|
import { SbbActionBaseElement as n } from "../core/base-elements.js";
|
|
4
4
|
import { SbbTeaserProductCommonElementMixin as u, teaserProductCommonStyle as b } from "./common.js";
|
|
5
|
-
let
|
|
5
|
+
let _ = (() => {
|
|
6
6
|
var e;
|
|
7
7
|
let o = [c("sbb-teaser-product-static")], r, s = [], t, l = u(n);
|
|
8
8
|
return e = class extends l {
|
|
@@ -12,5 +12,5 @@ let f = (() => {
|
|
|
12
12
|
})(), e.styles = [b], m(t, s), t;
|
|
13
13
|
})();
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
_ as SbbTeaserProductStaticElement
|
|
16
16
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var b = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var d = (t, a, c) => a.has(t) || b("Cannot " + c);
|
|
5
|
+
var _ = (t, a, c) => (d(t, a, "read from private field"), c ? c.call(t) : a.get(t)), y = (t, a, c) => a.has(t) ? b("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, c), l = (t, a, c, s) => (d(t, a, "write to private field"), s ? s.call(t, c) : a.set(t, c), c);
|
|
6
6
|
import { __runInitializers as n, __esDecorate as f } from "tslib";
|
|
7
7
|
import { customElement as A, property as C } from "lit/decorators.js";
|
|
8
8
|
import { SbbLanguageController as I, SbbMediaMatcherController as L, SbbMediaQueryForcedColors as g } from "./core/controllers.js";
|
|
@@ -27,7 +27,7 @@ let Q = (() => {
|
|
|
27
27
|
}
|
|
28
28
|
/** Wagon occupancy. */
|
|
29
29
|
get occupancy() {
|
|
30
|
-
return
|
|
30
|
+
return _(this, o);
|
|
31
31
|
}
|
|
32
32
|
set occupancy(e) {
|
|
33
33
|
l(this, o, e);
|
package/timetable-occupancy.js
CHANGED
|
@@ -4,7 +4,7 @@ var x = (s) => {
|
|
|
4
4
|
var z = (s, t, a) => t.has(s) || x("Cannot " + a);
|
|
5
5
|
var u = (s, t, a) => (z(s, t, "read from private field"), a ? a.call(s) : t.get(s)), m = (s, t, a) => t.has(s) ? x("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, a), o = (s, t, a, i) => (z(s, t, "write to private field"), i ? i.call(s, a) : t.set(s, a), a);
|
|
6
6
|
import { __runInitializers as b, __esDecorate as y } from "tslib";
|
|
7
|
-
import { css as S, LitElement as $, html as
|
|
7
|
+
import { css as S, LitElement as $, html as f, nothing as k } from "lit";
|
|
8
8
|
import { customElement as E, property as w } from "lit/decorators.js";
|
|
9
9
|
import { SbbLanguageController as I } from "./core/controllers.js";
|
|
10
10
|
import { i18nClass as D } from "./core/i18n.js";
|
|
@@ -14,8 +14,8 @@ import "./timetable-occupancy-icon.js";
|
|
|
14
14
|
const L = S`*,:before,:after{box-sizing:border-box}:host{display:inline-block;--sbb-timetable-occupancy-color: var(--sbb-color-charcoal);--sbb-icon-svg-width: .890625rem;--sbb-icon-svg-height: v0.75rem}@media (min-width: 52.5rem){:host{--sbb-icon-svg-width: 1.1875rem;--sbb-icon-svg-height: v1rem}}:host([negative]){--sbb-timetable-occupancy-color: var(--sbb-color-white)}.sbb-timetable-occupancy__list{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;align-items:center;flex-wrap:nowrap;gap:var(--sbb-spacing-fixed-2x)}.sbb-timetable-occupancy__list-item{display:flex;align-items:center;flex-wrap:nowrap;gap:var(--sbb-spacing-fixed-1x)}.sbb-timetable-occupancy__list-item-class{--sbb-text-font-size: var(--sbb-font-size-text-s);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);line-height:1;color:var(--sbb-timetable-occupancy-color)}.sbb-timetable-occupancy__list-item-icon{display:flex}`;
|
|
15
15
|
let J = (() => {
|
|
16
16
|
var l, r, n;
|
|
17
|
-
let s = [E("sbb-timetable-occupancy")], t, a = [], i,
|
|
18
|
-
return n = class extends
|
|
17
|
+
let s = [E("sbb-timetable-occupancy")], t, a = [], i, h = j($), d, _ = [], g = [], O, C = [], v = [];
|
|
18
|
+
return n = class extends h {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
21
|
m(this, l);
|
|
@@ -37,12 +37,12 @@ let J = (() => {
|
|
|
37
37
|
o(this, r, c);
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return
|
|
40
|
+
return f` ${(this.firstClassOccupancy || this.secondClassOccupancy) && f`
|
|
41
41
|
<ul
|
|
42
42
|
class="sbb-timetable-occupancy__list"
|
|
43
43
|
role=${!this.firstClassOccupancy || !this.secondClassOccupancy ? "presentation" : k}
|
|
44
44
|
>
|
|
45
|
-
${[this.firstClassOccupancy, this.secondClassOccupancy].map((c, e) => c &&
|
|
45
|
+
${[this.firstClassOccupancy, this.secondClassOccupancy].map((c, e) => c && f`
|
|
46
46
|
<li class="sbb-timetable-occupancy__list-item">
|
|
47
47
|
<span class="sbb-timetable-occupancy__list-item-class" aria-hidden="true">
|
|
48
48
|
${this.firstClassOccupancy && e === 0 ? "1" : "2"}.
|
|
@@ -62,7 +62,7 @@ let J = (() => {
|
|
|
62
62
|
`}`;
|
|
63
63
|
}
|
|
64
64
|
}, l = new WeakMap(), r = new WeakMap(), i = n, (() => {
|
|
65
|
-
const c = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
65
|
+
const c = typeof Symbol == "function" && Symbol.metadata ? Object.create(h[Symbol.metadata] ?? null) : void 0;
|
|
66
66
|
d = [w({ attribute: "first-class-occupancy" })], O = [w({ attribute: "second-class-occupancy" })], y(n, null, d, { kind: "accessor", name: "firstClassOccupancy", static: !1, private: !1, access: { has: (e) => "firstClassOccupancy" in e, get: (e) => e.firstClassOccupancy, set: (e, p) => {
|
|
67
67
|
e.firstClassOccupancy = p;
|
|
68
68
|
} }, metadata: c }, _, g), y(n, null, O, { kind: "accessor", name: "secondClassOccupancy", static: !1, private: !1, access: { has: (e) => "secondClassOccupancy" in e, get: (e) => e.secondClassOccupancy, set: (e, p) => {
|
package/toast/toast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/elements/toast/toast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAK1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAYnE,OAAO,iCAAiC,CAAC;AAEzC,KAAK,wBAAwB,GAAG,KAAK,GAAG,QAAQ,CAAC;AACjD,KAAK,0BAA0B,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,GAAG,wBAAwB,IAAI,0BAA0B,EAAE,CAAC;;AAK3F;;;;;;;;;;;;;GAaG;AACH,
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/elements/toast/toast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAK1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAYnE,OAAO,iCAAiC,CAAC;AAEzC,KAAK,wBAAwB,GAAG,KAAK,GAAG,QAAQ,CAAC;AACjD,KAAK,0BAA0B,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,GAAG,wBAAwB,IAAI,0BAA0B,EAAE,CAAC;;AAK3F;;;;;;;;;;;;;GAaG;AACH,qBAMM,eAAgB,SAAQ,oBAA4D;IACxF,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;OAGG;IACH,SAEgB,OAAO,EAAE,MAAM,CAAQ;IAEvC,6CAA6C;IAC7C,SAA6C,QAAQ,EAAE,gBAAgB,CAAmB;IAE1F,4CAA4C;IAC5C,SAEgB,WAAW,EAAE,OAAO,CAAS;IAE7C;;;OAGG;IACH,SAA4B,UAAU,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAY;IAElF,OAAO,CAAC,aAAa,CAAC,CAAgC;IACtD,OAAO,CAAC,SAAS,CAAmC;IAEpD;;;OAGG;IACH,OAAO,KAAK,KAAK,GAUhB;;IAOD;;;OAGG;IACI,IAAI,IAAI,IAAI;IAoBnB,OAAO,CAAC,wBAAwB;IAIhC;;OAEG;IACI,KAAK,IAAI,IAAI;IAkBpB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,QAAQ;IAQA,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAQ5C;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,oBAAoB;IAS5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;cAQN,MAAM,IAAI,cAAc;CAiC5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF"}
|
package/toast.js
CHANGED
|
@@ -4,30 +4,32 @@ var w = (i) => {
|
|
|
4
4
|
var $ = (i, o, e) => o.has(i) || w("Cannot " + e);
|
|
5
5
|
var u = (i, o, e) => ($(i, o, "read from private field"), e ? e.call(i) : o.get(i)), f = (i, o, e) => o.has(i) ? w("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(i) : o.set(i, e), b = (i, o, e, r) => ($(i, o, "write to private field"), r ? r.call(i, e) : o.set(i, e), e);
|
|
6
6
|
import { __esDecorate as g, __runInitializers as c } from "tslib";
|
|
7
|
-
import { css as
|
|
8
|
-
import { customElement as
|
|
7
|
+
import { css as R, html as D, nothing as L } from "lit";
|
|
8
|
+
import { customElement as K, property as _ } from "lit/decorators.js";
|
|
9
9
|
import { SbbOpenCloseBaseElement as Y } from "./core/base-elements.js";
|
|
10
10
|
import { SbbLanguageController as Z } from "./core/controllers.js";
|
|
11
|
-
import {
|
|
12
|
-
import { isFirefox as
|
|
13
|
-
import { composedPathHasAttribute as
|
|
14
|
-
import { i18nCloseAlert as
|
|
15
|
-
import { SbbHydrationMixin as
|
|
16
|
-
import { SbbIconNameMixin as
|
|
11
|
+
import { hostAttributes as j, slotState as U, forceType as P } from "./core/decorators.js";
|
|
12
|
+
import { isFirefox as H, isZeroAnimationDuration as M, isLean as F } from "./core/dom.js";
|
|
13
|
+
import { composedPathHasAttribute as X } from "./core/eventing.js";
|
|
14
|
+
import { i18nCloseAlert as q } from "./core/i18n.js";
|
|
15
|
+
import { SbbHydrationMixin as G } from "./core/mixins.js";
|
|
16
|
+
import { SbbIconNameMixin as J } from "./icon.js";
|
|
17
17
|
import "./button/transparent-button.js";
|
|
18
|
-
const
|
|
19
|
-
let
|
|
18
|
+
const Q = R`*,:before,:after{box-sizing:border-box}:host{--sbb-toast-max-width: 25rem;--sbb-toast-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-6x) );--sbb-toast-animation-timing-function: ease;--sbb-toast-color: var(--sbb-color-white);--sbb-toast-text-color: var(--sbb-color-milk);--sbb-toast-background-color: var(--sbb-color-midnight);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-toast-margin: var(--sbb-spacing-responsive-s);--sbb-toast-padding-block: var(--sbb-spacing-responsive-xxxs);--sbb-toast-padding-inline: var(--sbb-spacing-responsive-xs);--sbb-toast-border-radius: var(--sbb-border-radius-4x);--sbb-toast-container-display: none;--sbb-toast-container-position: fixed;--sbb-toast-horizontal-position: initial;--sbb-toast-vertical-position: initial;display:none}:host([data-state]:not([data-state=closed])){--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}.sbb-toast__overlay-container{position:var(--sbb-toast-container-position);pointer-events:none;top:0;right:0;bottom:0;left:0;display:var(--sbb-toast-container-display);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);padding-block:var(--sbb-toast-padding-block);padding-inline:var(--sbb-toast-padding-inline);border-radius:var(--sbb-toast-border-radius);max-width:var(--sbb-toast-max-width);display:flex;color:var(--sbb-toast-color);background-color:var(--sbb-toast-background-color)}:host([data-state=opening]) .sbb-toast{animation-name:open;animation-duration:var(--sbb-toast-animation-duration);animation-timing-function:var(--sbb-toast-animation-timing-function)}:host([data-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__icon{margin-inline-end:var(--sbb-spacing-fixed-2x);line-height:initial}:host(:not([data-slot-names~=icon],[icon-name])) .sbb-toast__icon{display:none}.sbb-toast__content{--sbb-title-line-height: var(--sbb-typo-line-height-titles);--sbb-title-margin-block-start: 0;--sbb-title-margin-block-end: 0;margin:0;margin-block:var(--sbb-title-margin-block-start) var(--sbb-title-margin-block-end);font-family:var(--sbb-typo-font-family);font-weight:700;line-height:var(--sbb-title-line-height);letter-spacing:var(--sbb-typo-letter-spacing-titles);font-size:var(--sbb-title-font-size);--sbb-title-font-size: var(--sbb-font-size-title-6);--sbb-title-line-height: var(--sbb-typo-line-height-body-text);color:var(--sbb-toast-text-color);flex:1 1 0}.sbb-toast__action{position:relative;min-width:2.5rem}:host(:not([data-slot-names~=action],[dismissible])) .sbb-toast__action{display:none}::slotted([data-sbb-button]),.sbb-toast__action-button{margin-inline:var(--sbb-spacing-fixed-2x);position:absolute;top:-.625rem}::slotted(:is(sbb-link,sbb-link-button,sbb-link-static)){margin-inline-start:var(--sbb-spacing-fixed-4x)}@keyframes open{0%{visibility:hidden;opacity:0;transform:translateY(var(--sbb-spacing-fixed-2x))}to{visibility:visible;opacity:1;transform:translateY(0)}}@keyframes close{0%{visibility:visible;opacity:1;transform:translateY(0)}to{visibility:hidden;opacity:0;transform:translateY(var(--sbb-spacing-fixed-2x))}}`, v = /* @__PURE__ */ new Set();
|
|
19
|
+
let pt = (() => {
|
|
20
20
|
var d, m, p, h, n;
|
|
21
|
-
let i = [
|
|
21
|
+
let i = [K("sbb-toast"), j({
|
|
22
|
+
popover: "manual"
|
|
23
|
+
}), U()], o, e = [], r, x = J(G(Y)), y, k = [], T = [], z, S = [], N = [], C, A = [], E = [], B, O = [], I = [];
|
|
22
24
|
return n = class extends x {
|
|
23
25
|
constructor() {
|
|
24
|
-
var
|
|
26
|
+
var t;
|
|
25
27
|
super();
|
|
26
28
|
f(this, d);
|
|
27
29
|
f(this, m);
|
|
28
30
|
f(this, p);
|
|
29
31
|
f(this, h);
|
|
30
|
-
b(this, d, c(this, k, 6e3)), b(this, m, (c(this, T), c(this, S, "bottom-center"))), b(this, p, (c(this, N), c(this, A, !1))), b(this, h, (c(this, E), c(this, O, "polite"))), this._closeTimeout = c(this, I), this._language = new Z(this), (
|
|
32
|
+
b(this, d, c(this, k, 6e3)), b(this, m, (c(this, T), c(this, S, "bottom-center"))), b(this, p, (c(this, N), c(this, A, !1))), b(this, h, (c(this, E), c(this, O, "polite"))), this._closeTimeout = c(this, I), this._language = new Z(this), (t = this.addEventListener) == null || t.call(this, "click", (s) => this._onClick(s));
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* The length of time in milliseconds to wait before automatically dismissing the toast.
|
|
@@ -36,22 +38,22 @@ let mt = (() => {
|
|
|
36
38
|
get timeout() {
|
|
37
39
|
return u(this, d);
|
|
38
40
|
}
|
|
39
|
-
set timeout(
|
|
40
|
-
b(this, d,
|
|
41
|
+
set timeout(t) {
|
|
42
|
+
b(this, d, t);
|
|
41
43
|
}
|
|
42
44
|
/** The position where to place the toast. */
|
|
43
45
|
get position() {
|
|
44
46
|
return u(this, m);
|
|
45
47
|
}
|
|
46
|
-
set position(
|
|
47
|
-
b(this, m,
|
|
48
|
+
set position(t) {
|
|
49
|
+
b(this, m, t);
|
|
48
50
|
}
|
|
49
51
|
/** Whether the toast has a close button. */
|
|
50
52
|
get dismissible() {
|
|
51
53
|
return u(this, p);
|
|
52
54
|
}
|
|
53
|
-
set dismissible(
|
|
54
|
-
b(this, p,
|
|
55
|
+
set dismissible(t) {
|
|
56
|
+
b(this, p, t);
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
59
|
* The ARIA politeness level.
|
|
@@ -60,15 +62,15 @@ let mt = (() => {
|
|
|
60
62
|
get politeness() {
|
|
61
63
|
return u(this, h);
|
|
62
64
|
}
|
|
63
|
-
set politeness(
|
|
64
|
-
b(this, h,
|
|
65
|
+
set politeness(t) {
|
|
66
|
+
b(this, h, t);
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
67
69
|
* Role of the live region. This is only for Firefox as there is a known issue where Firefox +
|
|
68
70
|
* JAWS does not read out aria-live message.
|
|
69
71
|
*/
|
|
70
72
|
get _role() {
|
|
71
|
-
if (
|
|
73
|
+
if (H) {
|
|
72
74
|
if (this.politeness === "polite")
|
|
73
75
|
return "status";
|
|
74
76
|
if (this.politeness === "assertive")
|
|
@@ -80,10 +82,11 @@ let mt = (() => {
|
|
|
80
82
|
* If there are other opened toasts in the page, close them first.
|
|
81
83
|
*/
|
|
82
84
|
open() {
|
|
83
|
-
|
|
85
|
+
var t;
|
|
86
|
+
this.state === "closed" && this.willOpen.emit() && ((t = this.showPopover) == null || t.call(this), this.state = "opening", this._closeOtherToasts(), this._isZeroAnimationDuration() && this._handleOpening());
|
|
84
87
|
}
|
|
85
88
|
_isZeroAnimationDuration() {
|
|
86
|
-
return
|
|
89
|
+
return M(this, "--sbb-toast-animation-duration");
|
|
87
90
|
}
|
|
88
91
|
/**
|
|
89
92
|
* Close the toast.
|
|
@@ -92,15 +95,16 @@ let mt = (() => {
|
|
|
92
95
|
this.state === "opened" && this.willClose.emit() && (clearTimeout(this._closeTimeout), this.state = "closing", this._isZeroAnimationDuration() && this._handleClosing());
|
|
93
96
|
}
|
|
94
97
|
_handleClosing() {
|
|
95
|
-
|
|
98
|
+
var t;
|
|
99
|
+
this.state = "closed", (t = this.hidePopover) == null || t.call(this), this.didClose.emit();
|
|
96
100
|
}
|
|
97
101
|
_handleOpening() {
|
|
98
102
|
this.state = "opened", this.didOpen.emit(), this.timeout && (this._closeTimeout = setTimeout(() => this.close(), this.timeout));
|
|
99
103
|
}
|
|
100
104
|
// Close the toast on click of any element that has the 'sbb-toast-close' attribute.
|
|
101
|
-
_onClick(
|
|
102
|
-
const
|
|
103
|
-
|
|
105
|
+
_onClick(t) {
|
|
106
|
+
const s = X(t, "sbb-toast-close", this);
|
|
107
|
+
s && !s.hasAttribute("disabled") && this.close();
|
|
104
108
|
}
|
|
105
109
|
connectedCallback() {
|
|
106
110
|
super.connectedCallback(), v.add(this);
|
|
@@ -113,32 +117,32 @@ let mt = (() => {
|
|
|
113
117
|
* To address the problem, if there is at least a root text node,
|
|
114
118
|
* we wrap the whole content in a <span> tag
|
|
115
119
|
*/
|
|
116
|
-
_onContentSlotChange(
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
120
|
+
_onContentSlotChange(t) {
|
|
121
|
+
const s = t.target.assignedNodes();
|
|
122
|
+
if (s.some((a) => a.nodeType === Node.TEXT_NODE)) {
|
|
119
123
|
const a = document.createElement("span");
|
|
120
|
-
this.appendChild(a), a.append(...
|
|
124
|
+
this.appendChild(a), a.append(...s);
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
|
-
_onActionSlotChange(
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
l.negative = !0, l.size =
|
|
127
|
-
}),
|
|
127
|
+
_onActionSlotChange(t) {
|
|
128
|
+
const s = t.target.assignedNodes();
|
|
129
|
+
s.filter((l) => l.nodeName === "SBB-TRANSPARENT-BUTTON" || l.nodeName === "SBB-TRANSPARENT-BUTTON-LINK").forEach((l) => {
|
|
130
|
+
l.negative = !0, l.size = F() ? "s" : "m";
|
|
131
|
+
}), s.filter((l) => ["SBB-LINK", "SBB-LINK-BUTTON", "SBB-LINK-STATIC"].includes(l.nodeName)).forEach((l) => {
|
|
128
132
|
l.negative = !0;
|
|
129
133
|
});
|
|
130
134
|
}
|
|
131
135
|
// In rare cases it can be that the animationEnd event is triggered twice.
|
|
132
136
|
// To avoid entering a corrupt state, exit when state is not expected.
|
|
133
|
-
_onToastAnimationEnd(
|
|
134
|
-
|
|
137
|
+
_onToastAnimationEnd(t) {
|
|
138
|
+
t.animationName === "open" && this.state === "opening" ? this._handleOpening() : t.animationName === "close" && this.state === "closing" && this._handleClosing();
|
|
135
139
|
}
|
|
136
140
|
/**
|
|
137
141
|
* Since we do not stack toasts, we force the closing on other existing opened ones
|
|
138
142
|
*/
|
|
139
143
|
_closeOtherToasts() {
|
|
140
|
-
v.forEach((
|
|
141
|
-
|
|
144
|
+
v.forEach((t) => {
|
|
145
|
+
t.getAttribute("data-state") === "opened" && t.close();
|
|
142
146
|
});
|
|
143
147
|
}
|
|
144
148
|
render() {
|
|
@@ -164,7 +168,7 @@ let mt = (() => {
|
|
|
164
168
|
icon-name="cross-small"
|
|
165
169
|
negative
|
|
166
170
|
size="m"
|
|
167
|
-
aria-label=${
|
|
171
|
+
aria-label=${q[this._language.current]}
|
|
168
172
|
sbb-toast-close
|
|
169
173
|
></sbb-transparent-button>` : L}
|
|
170
174
|
</slot>
|
|
@@ -174,18 +178,18 @@ let mt = (() => {
|
|
|
174
178
|
`;
|
|
175
179
|
}
|
|
176
180
|
}, d = new WeakMap(), m = new WeakMap(), p = new WeakMap(), h = new WeakMap(), r = n, (() => {
|
|
177
|
-
const
|
|
178
|
-
y = [
|
|
179
|
-
|
|
180
|
-
} }, metadata:
|
|
181
|
-
|
|
182
|
-
} }, metadata:
|
|
183
|
-
|
|
184
|
-
} }, metadata:
|
|
185
|
-
|
|
186
|
-
} }, metadata:
|
|
187
|
-
})(), n.styles =
|
|
181
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(x[Symbol.metadata] ?? null) : void 0;
|
|
182
|
+
y = [P(), _({ type: Number })], z = [_({ reflect: !0 })], C = [P(), _({ type: Boolean, reflect: !0 })], B = [_()], g(n, null, y, { kind: "accessor", name: "timeout", static: !1, private: !1, access: { has: (s) => "timeout" in s, get: (s) => s.timeout, set: (s, a) => {
|
|
183
|
+
s.timeout = a;
|
|
184
|
+
} }, metadata: t }, k, T), g(n, null, z, { kind: "accessor", name: "position", static: !1, private: !1, access: { has: (s) => "position" in s, get: (s) => s.position, set: (s, a) => {
|
|
185
|
+
s.position = a;
|
|
186
|
+
} }, metadata: t }, S, N), g(n, null, C, { kind: "accessor", name: "dismissible", static: !1, private: !1, access: { has: (s) => "dismissible" in s, get: (s) => s.dismissible, set: (s, a) => {
|
|
187
|
+
s.dismissible = a;
|
|
188
|
+
} }, metadata: t }, A, E), g(n, null, B, { kind: "accessor", name: "politeness", static: !1, private: !1, access: { has: (s) => "politeness" in s, get: (s) => s.politeness, set: (s, a) => {
|
|
189
|
+
s.politeness = a;
|
|
190
|
+
} }, metadata: t }, O, I), g(null, o = { value: r }, i, { kind: "class", name: r.name, metadata: t }, null, e), r = o.value, t && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
191
|
+
})(), n.styles = Q, c(r, e), r;
|
|
188
192
|
})();
|
|
189
193
|
export {
|
|
190
|
-
|
|
194
|
+
pt as SbbToastElement
|
|
191
195
|
};
|