@sbb-esta/lyne-elements 0.52.1 → 0.52.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion.js +54 -54
- package/action-group.js +3 -3
- package/alert/alert-group.js +22 -22
- package/alert/alert.js +22 -22
- package/autocomplete.js +126 -126
- package/breadcrumb/breadcrumb-group.js +60 -60
- package/breadcrumb/breadcrumb.js +17 -17
- package/calendar.js +423 -423
- package/card/card-badge.js +17 -17
- package/card/card.js +2 -2
- package/card/common.js +30 -30
- package/checkbox/checkbox-group.js +17 -17
- package/checkbox/checkbox.js +34 -34
- package/clock.js +83 -83
- package/container/sticky-bar.js +16 -16
- package/core/a11y.js +91 -91
- package/core/base-elements.js +86 -86
- package/core/controllers.js +40 -40
- package/core/datetime.js +32 -32
- package/core/dom.js +26 -26
- package/core/eventing.js +33 -33
- package/core/mixins.js +122 -122
- package/core/testing.js +29 -29
- package/datepicker/common.js +55 -55
- package/datepicker/datepicker-toggle.js +94 -94
- package/datepicker/datepicker.js +144 -144
- package/dialog/dialog-title.js +20 -20
- package/dialog/dialog.js +66 -66
- package/expansion-panel/expansion-panel-header.js +20 -20
- package/expansion-panel/expansion-panel.js +60 -60
- package/file-selector.js +91 -91
- package/form-field/form-field-clear.js +12 -12
- package/form-field/form-field.js +111 -111
- package/header/header.js +53 -53
- package/icon.js +107 -107
- package/image.js +87 -87
- package/journey-header.js +29 -29
- package/map-container.js +23 -23
- package/menu/menu.js +91 -91
- package/navigation/common.js +16 -16
- package/navigation/navigation-marker.js +34 -34
- package/navigation/navigation-section.js +83 -83
- package/navigation/navigation.js +87 -87
- package/notification.js +52 -52
- package/option/optgroup.js +45 -45
- package/option/option.js +108 -108
- package/overlay.js +5 -5
- package/package.json +1 -1
- package/popover/popover.js +110 -110
- package/radio-button/radio-button-group.js +93 -93
- package/radio-button/radio-button.js +84 -84
- package/select.js +178 -178
- package/selection-panel.js +44 -44
- package/slider.js +58 -58
- package/status.js +6 -6
- package/stepper/step-label.js +19 -19
- package/stepper/step.js +31 -31
- package/stepper/stepper.js +46 -46
- package/tabs/tab-group.js +67 -67
- package/tag/tag-group.js +8 -8
- package/tag/tag.js +27 -27
- package/teaser-paid.js +12 -12
- package/time-input.js +73 -73
- package/timetable-occupancy-icon.js +26 -26
- package/timetable-occupancy.js +9 -9
- package/toast.js +38 -38
- package/toggle/toggle-option.js +33 -33
- package/toggle/toggle.js +46 -46
- package/train/train-formation.js +36 -36
- package/train/train-wagon.js +30 -30
- package/train/train.js +13 -13
package/image.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { css as y, LitElement as
|
|
2
|
-
import { property as s, eventOptions as
|
|
3
|
-
import { ref as
|
|
1
|
+
import { css as y, LitElement as _, html as d, nothing as l } from "lit";
|
|
2
|
+
import { property as s, eventOptions as k, customElement as v } from "lit/decorators.js";
|
|
3
|
+
import { ref as $ } from "lit/directives/ref.js";
|
|
4
4
|
import { hostContext as x } from "./core/dom.js";
|
|
5
|
-
const w = 0, S = 359, P = 360, M = 599, z = 600,
|
|
6
|
-
var
|
|
7
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
8
|
-
(
|
|
9
|
-
return i && n &&
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
5
|
+
const w = 0, S = 359, P = 360, M = 599, z = 600, C = 839, B = 840, L = 1023, O = 1024, Q = 1279, F = 1280, D = 1439, E = 1440, T = 2579, I = 16, R = y`*,:before,:after{box-sizing:border-box}:host{--sbb-image-border-radius: var(--sbb-border-radius-4x);--sbb-image-aspect-ratio: auto;--sbb-image-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) );display:block}:host([aspect-ratio="1-1"]){--sbb-image-aspect-ratio: 1 / 1}:host([aspect-ratio="1-2"]){--sbb-image-aspect-ratio: 1 / 2}:host([aspect-ratio="2-1"]){--sbb-image-aspect-ratio: 2 / 1}:host([aspect-ratio="2-3"]){--sbb-image-aspect-ratio: 2 / 3}:host([aspect-ratio="3-2"]){--sbb-image-aspect-ratio: 3 / 2}:host([aspect-ratio="3-4"]){--sbb-image-aspect-ratio: 3 / 4}:host([aspect-ratio="4-3"]){--sbb-image-aspect-ratio: 4 / 3}:host([aspect-ratio="4-5"]){--sbb-image-aspect-ratio: 4 / 5}:host([aspect-ratio="5-4"]){--sbb-image-aspect-ratio: 5 / 4}:host([aspect-ratio="16-9"]){--sbb-image-aspect-ratio: 16 / 9}:host([aspect-ratio="9-16"]){--sbb-image-aspect-ratio: 9 / 16}:host([data-teaser]){--sbb-image-aspect-ratio: 1 / 1}@media (min-width: 37.5rem){:host([data-teaser]){--sbb-image-aspect-ratio: 16 / 9}}:host(:is([border-radius=none],[data-teaser])){--sbb-image-border-radius: 0}:host([border-radius=round]:not([data-teaser])){--sbb-image-border-radius: var(--sbb-border-radius-infinity)}.sbb-image__figure{margin:0}.sbb-image__img{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.000001}:host([data-loaded]) .sbb-image__img{opacity:.999999}:host([data-loaded]) .sbb-image__blurred{opacity:0}:is(.sbb-image__img,.sbb-image__blurred){width:100%;height:100%;object-fit:cover;transition:opacity var(--sbb-image-animation-duration) var(--sbb-animation-easing)}.sbb-image__wrapper{position:relative;overflow:hidden;max-width:100%;border-radius:var(--sbb-image-border-radius);aspect-ratio:var(--sbb-image-aspect-ratio)}.sbb-image__caption{--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);margin-block-start:var(--sbb-spacing-fixed-4x)}`;
|
|
6
|
+
var h = Object.freeze, u = Object.defineProperty, A = Object.getOwnPropertyDescriptor, o = (e, t, r, i) => {
|
|
7
|
+
for (var n = i > 1 ? void 0 : i ? A(t, r) : t, p = e.length - 1, b; p >= 0; p--)
|
|
8
|
+
(b = e[p]) && (n = (i ? b(t, r, n) : b(n)) || n);
|
|
9
|
+
return i && n && u(t, r, n), n;
|
|
10
|
+
}, U = (e, t) => h(u(e, "raw", { value: h(e.slice()) })), g;
|
|
11
|
+
const H = (e) => {
|
|
12
|
+
if (!e || e.length === 0)
|
|
13
13
|
return [];
|
|
14
|
-
let
|
|
14
|
+
let t;
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
t = JSON.parse(e);
|
|
17
17
|
} catch {
|
|
18
18
|
return [];
|
|
19
19
|
}
|
|
20
|
-
if (!
|
|
20
|
+
if (!t.breakpoints || t.breakpoints.length === 0)
|
|
21
21
|
return [];
|
|
22
|
-
if (!Array.isArray(
|
|
22
|
+
if (!Array.isArray(t.breakpoints))
|
|
23
23
|
return [];
|
|
24
24
|
let r = !1, i = !1;
|
|
25
25
|
const n = ["image", "mediaQueries"];
|
|
26
|
-
return
|
|
27
|
-
const
|
|
28
|
-
|
|
26
|
+
return t.breakpoints.forEach((p) => {
|
|
27
|
+
const b = Object.keys(p);
|
|
28
|
+
b.forEach((m) => {
|
|
29
29
|
n.includes(m) || (r = !0);
|
|
30
30
|
}), n.forEach((m) => {
|
|
31
|
-
|
|
31
|
+
b.includes(m) || (i = !0);
|
|
32
32
|
});
|
|
33
|
-
}), r || i ? [] :
|
|
34
|
-
},
|
|
33
|
+
}), r || i ? [] : t.breakpoints;
|
|
34
|
+
}, j = {
|
|
35
35
|
once: !0,
|
|
36
36
|
passive: !0
|
|
37
|
-
},
|
|
38
|
-
"sbb-breakpoint-zero-min":
|
|
39
|
-
"sbb-breakpoint-zero-max":
|
|
40
|
-
"sbb-breakpoint-micro-min":
|
|
41
|
-
"sbb-breakpoint-micro-max":
|
|
42
|
-
"sbb-breakpoint-small-min":
|
|
43
|
-
"sbb-breakpoint-small-max":
|
|
44
|
-
"sbb-breakpoint-medium-min":
|
|
45
|
-
"sbb-breakpoint-medium-max":
|
|
46
|
-
"sbb-breakpoint-large-min":
|
|
47
|
-
"sbb-breakpoint-large-max":
|
|
48
|
-
"sbb-breakpoint-wide-min":
|
|
49
|
-
"sbb-breakpoint-wide-max":
|
|
50
|
-
"sbb-breakpoint-ultra-min":
|
|
51
|
-
"sbb-breakpoint-ultra-max":
|
|
37
|
+
}, c = (e) => e / I, V = {
|
|
38
|
+
"sbb-breakpoint-zero-min": c(w),
|
|
39
|
+
"sbb-breakpoint-zero-max": c(S),
|
|
40
|
+
"sbb-breakpoint-micro-min": c(P),
|
|
41
|
+
"sbb-breakpoint-micro-max": c(M),
|
|
42
|
+
"sbb-breakpoint-small-min": c(z),
|
|
43
|
+
"sbb-breakpoint-small-max": c(C),
|
|
44
|
+
"sbb-breakpoint-medium-min": c(B),
|
|
45
|
+
"sbb-breakpoint-medium-max": c(L),
|
|
46
|
+
"sbb-breakpoint-large-min": c(O),
|
|
47
|
+
"sbb-breakpoint-large-max": c(Q),
|
|
48
|
+
"sbb-breakpoint-wide-min": c(F),
|
|
49
|
+
"sbb-breakpoint-wide-max": c(D),
|
|
50
|
+
"sbb-breakpoint-ultra-min": c(E),
|
|
51
|
+
"sbb-breakpoint-ultra-max": c(T)
|
|
52
52
|
};
|
|
53
|
-
let a = class extends
|
|
53
|
+
let a = class extends _ {
|
|
54
54
|
constructor() {
|
|
55
|
-
super(...arguments), this.
|
|
55
|
+
super(...arguments), this._config = {
|
|
56
56
|
nonRetinaQuality: "45",
|
|
57
57
|
retinaQuality: "20"
|
|
58
58
|
}, this.skipLqip = !1, this.copyrightHolder = "Organization", this.customFocalPoint = !1, this.decoding = "auto", this.focalPointDebug = !1, this.focalPointX = 1, this.focalPointY = 1, this.importance = "high", this.loading = "eager", this.borderRadius = "default", this.aspectRatio = "16-9";
|
|
59
59
|
}
|
|
60
60
|
/** Whether the image is finished loading or failed to load. */
|
|
61
61
|
get complete() {
|
|
62
|
-
var
|
|
63
|
-
return ((r = (
|
|
62
|
+
var e, t, r;
|
|
63
|
+
return ((r = (t = (e = this.shadowRoot) == null ? void 0 : e.querySelector) == null ? void 0 : t.call(e, ".sbb-image__img")) == null ? void 0 : r.complete) ?? !1;
|
|
64
64
|
}
|
|
65
65
|
connectedCallback() {
|
|
66
66
|
super.connectedCallback(), this.toggleAttribute(
|
|
@@ -68,34 +68,34 @@ let a = class extends k {
|
|
|
68
68
|
!!x("sbb-teaser-hero", this) || !!this.closest("sbb-teaser-paid")
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
updated(
|
|
72
|
-
super.updated(
|
|
71
|
+
updated(e) {
|
|
72
|
+
super.updated(e), this._captionElement && (this._linksInCaption = this._captionElement.querySelectorAll("a"), this._linksInCaption && this._addFocusAbilityToLinksInCaption());
|
|
73
73
|
}
|
|
74
|
-
async firstUpdated(
|
|
75
|
-
super.firstUpdated(
|
|
74
|
+
async firstUpdated(e) {
|
|
75
|
+
super.firstUpdated(e), await this.updateComplete, this.complete && this.toggleAttribute("data-loaded", !0);
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
_logPerformanceMarks() {
|
|
78
78
|
this.performanceMark && (performance.clearMarks(this.performanceMark), performance.mark(this.performanceMark));
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
return
|
|
80
|
+
_matchMediaQueryDesignToken(e) {
|
|
81
|
+
const t = V[e];
|
|
82
|
+
return t ? `${t}rem` : "";
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
var
|
|
86
|
-
(
|
|
87
|
-
|
|
84
|
+
_addFocusAbilityToLinksInCaption() {
|
|
85
|
+
var e;
|
|
86
|
+
(e = this._linksInCaption) == null || e.forEach((t) => {
|
|
87
|
+
t.removeAttribute("tabindex");
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
if (!
|
|
90
|
+
_prepareImageUrl(e, t = !1) {
|
|
91
|
+
if (!e || e === "")
|
|
92
92
|
return "";
|
|
93
|
-
const r = !!
|
|
94
|
-
return
|
|
93
|
+
const r = !!e.match(/^\w+:\/\//), i = r ? new URL(e) : new URL(`http://noop/${e}`);
|
|
94
|
+
return t ? (i.searchParams.append("blur", "100"), i.searchParams.append("w", "100"), i.searchParams.append("h", "56")) : i.searchParams.append("auto", "format,compress,cs=tinysrgb"), this.customFocalPoint && (i.searchParams.append("fit", "crop"), i.searchParams.append("crop", "focalpoint"), i.searchParams.append("fp-x", this.focalPointX.toString(10)), i.searchParams.append("fp-y", this.focalPointY.toString(10)), i.searchParams.append("fp-z", "1")), this.focalPointDebug && i.searchParams.append("fp-debug", "true"), r ? i.href : i.pathname.substring(1) + i.search;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
let
|
|
98
|
-
return this.pictureSizesConfig ?
|
|
96
|
+
_preparePictureSizeConfigs() {
|
|
97
|
+
let e;
|
|
98
|
+
return this.pictureSizesConfig ? e = this.pictureSizesConfig : e = `{
|
|
99
99
|
"breakpoints": [
|
|
100
100
|
{
|
|
101
101
|
"image": {
|
|
@@ -146,25 +146,25 @@ let a = class extends k {
|
|
|
146
146
|
]
|
|
147
147
|
}
|
|
148
148
|
]
|
|
149
|
-
}`,
|
|
149
|
+
}`, H(e);
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
let
|
|
153
|
-
return
|
|
151
|
+
_createMediaQueryString(e) {
|
|
152
|
+
let t = "";
|
|
153
|
+
return e.forEach((r) => {
|
|
154
154
|
const i = r.conditionFeature;
|
|
155
155
|
let n;
|
|
156
|
-
r.conditionFeatureValue.lyneDesignToken ? n = this.
|
|
156
|
+
r.conditionFeatureValue.lyneDesignToken ? n = this._matchMediaQueryDesignToken(r.conditionFeatureValue.value) : n = r.conditionFeatureValue.value;
|
|
157
157
|
const p = r.conditionOperator ? ` ${r.conditionOperator} ` : "";
|
|
158
|
-
|
|
159
|
-
}),
|
|
158
|
+
t += `(${i}: ${n})${p}`;
|
|
159
|
+
}), t;
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
this.
|
|
161
|
+
_imageLoaded() {
|
|
162
|
+
this._logPerformanceMarks(), this.toggleAttribute("data-loaded", !0), this.dispatchEvent(new Event("load"));
|
|
163
163
|
}
|
|
164
164
|
render() {
|
|
165
|
-
let { caption:
|
|
166
|
-
const r = this.
|
|
167
|
-
this.loading === "lazy" && (this.decoding = "async", this.importance = "low"), this.copyright && (
|
|
165
|
+
let { caption: e } = this, t = "";
|
|
166
|
+
const r = this._prepareImageUrl(this.imageSrc, !0), i = this._prepareImageUrl(this.imageSrc, !1);
|
|
167
|
+
this.loading === "lazy" && (this.decoding = "async", this.importance = "low"), this.copyright && (e = `${this.caption} ©${this.copyright}`, t = `{
|
|
168
168
|
"@context": "https://schema.org",
|
|
169
169
|
"@type": "Photograph",
|
|
170
170
|
"image": "${this.imageSrc}",
|
|
@@ -173,11 +173,11 @@ let a = class extends k {
|
|
|
173
173
|
"name": "${this.copyright}"
|
|
174
174
|
}
|
|
175
175
|
}`);
|
|
176
|
-
const n = this.
|
|
177
|
-
return
|
|
176
|
+
const n = this._preparePictureSizeConfigs();
|
|
177
|
+
return d`
|
|
178
178
|
<figure class="sbb-image__figure">
|
|
179
179
|
<div class="sbb-image__wrapper">
|
|
180
|
-
${this.skipLqip ? l :
|
|
180
|
+
${this.skipLqip ? l : d`<img
|
|
181
181
|
alt=""
|
|
182
182
|
class="sbb-image__blurred"
|
|
183
183
|
src=${r}
|
|
@@ -190,18 +190,18 @@ let a = class extends k {
|
|
|
190
190
|
<picture>
|
|
191
191
|
<!-- render picture element sources -->
|
|
192
192
|
${n.map((p) => {
|
|
193
|
-
const
|
|
193
|
+
const b = p.image.height, m = p.image.width, f = this._createMediaQueryString(p.mediaQueries);
|
|
194
194
|
return [
|
|
195
|
-
|
|
195
|
+
d` <source
|
|
196
196
|
media=${`${f}`}
|
|
197
197
|
sizes=${`${m}px`}
|
|
198
|
-
srcset=${`${i}&w=${m}&h=${
|
|
198
|
+
srcset=${`${i}&w=${m}&h=${b}&q=${this._config.nonRetinaQuality} ${m}w, ${i}&w=${m * 2}&h=${b * 2}&q=${this._config.retinaQuality} ${m * 2}w`}
|
|
199
199
|
></source>`
|
|
200
200
|
];
|
|
201
201
|
})}
|
|
202
202
|
<img
|
|
203
203
|
alt=${this.alt || ""}
|
|
204
|
-
@load=${this.
|
|
204
|
+
@load=${this._imageLoaded}
|
|
205
205
|
@error=${() => this.dispatchEvent(new Event("error"))}
|
|
206
206
|
class="sbb-image__img"
|
|
207
207
|
src=${this.imageSrc}
|
|
@@ -213,19 +213,19 @@ let a = class extends k {
|
|
|
213
213
|
/>
|
|
214
214
|
</picture>
|
|
215
215
|
</div>
|
|
216
|
-
${
|
|
216
|
+
${e ? d`<figcaption
|
|
217
217
|
class="sbb-image__caption"
|
|
218
|
-
.innerHTML=${
|
|
219
|
-
${
|
|
220
|
-
this.
|
|
218
|
+
.innerHTML=${e}
|
|
219
|
+
${$((p) => {
|
|
220
|
+
this._captionElement = p;
|
|
221
221
|
})}
|
|
222
222
|
></figcaption>` : l}
|
|
223
|
-
${
|
|
223
|
+
${t ? d(g || (g = U(['<script type="application/ld+json" .innerHTML=', "><\/script>"])), t) : l}
|
|
224
224
|
</figure>
|
|
225
225
|
`;
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
|
-
a.styles =
|
|
228
|
+
a.styles = R;
|
|
229
229
|
a.events = {
|
|
230
230
|
error: "error",
|
|
231
231
|
load: "load"
|
|
@@ -282,10 +282,10 @@ o([
|
|
|
282
282
|
s({ attribute: "aspect-ratio", reflect: !0 })
|
|
283
283
|
], a.prototype, "aspectRatio", 2);
|
|
284
284
|
o([
|
|
285
|
-
|
|
286
|
-
], a.prototype, "
|
|
285
|
+
k(j)
|
|
286
|
+
], a.prototype, "_imageLoaded", 1);
|
|
287
287
|
a = o([
|
|
288
|
-
|
|
288
|
+
v("sbb-image")
|
|
289
289
|
], a);
|
|
290
290
|
export {
|
|
291
291
|
a as SbbImageElement
|
package/journey-header.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as g, LitElement as m, html as p, nothing as c } from "lit";
|
|
2
|
+
import { property as t, customElement as d } from "lit/decorators.js";
|
|
3
3
|
import { SbbLanguageController as u } from "./core/controllers.js";
|
|
4
|
-
import { getDocumentWritingMode as
|
|
4
|
+
import { getDocumentWritingMode as h } from "./core/dom.js";
|
|
5
5
|
import { i18nConnectionFrom as y, i18nConnectionTo as f, i18nConnectionRoundtrip as v } from "./core/i18n.js";
|
|
6
|
-
import { SbbNegativeMixin as
|
|
6
|
+
import { SbbNegativeMixin as _ } from "./core/mixins.js";
|
|
7
7
|
import "./icon.js";
|
|
8
8
|
import "./screen-reader-only.js";
|
|
9
9
|
import "./title.js";
|
|
10
|
-
const
|
|
11
|
-
var
|
|
12
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
10
|
+
const x = g`*,:before,:after{box-sizing:border-box}:host{--sbb-journey-header-gap: var(--sbb-spacing-fixed-1x);display:block}:host([id]){scroll-margin-block-start:var(--sbb-spacing-fixed-10x)}sbb-title{margin:0}sbb-icon{min-width:var(--sbb-size-icon-ui-small)}.sbb-journey-header{display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--sbb-journey-header-gap);width:fit-content}.sbb-journey-header[dir=rtl] sbb-icon{transform:rotate(-180deg)}`;
|
|
11
|
+
var $ = Object.defineProperty, j = Object.getOwnPropertyDescriptor, n = (s, o, a, i) => {
|
|
12
|
+
for (var r = i > 1 ? void 0 : i ? j(o, a) : o, b = s.length - 1, l; b >= 0; b--)
|
|
13
13
|
(l = s[b]) && (r = (i ? l(o, a, r) : l(r)) || r);
|
|
14
|
-
return i && r &&
|
|
14
|
+
return i && r && $(o, a, r), r;
|
|
15
15
|
};
|
|
16
|
-
const
|
|
16
|
+
const w = /* @__PURE__ */ new Map([
|
|
17
17
|
["s", "6"],
|
|
18
18
|
["m", "5"],
|
|
19
19
|
["l", "4"]
|
|
20
20
|
]);
|
|
21
|
-
let e = class extends
|
|
21
|
+
let e = class extends _(m) {
|
|
22
22
|
constructor() {
|
|
23
|
-
super(...arguments), this.level = "3", this.size = "m", this.
|
|
23
|
+
super(...arguments), this.level = "3", this.size = "m", this._language = new u(this);
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
26
|
const s = this.roundTrip ? "arrows-long-right-left-small" : "arrow-long-right-small";
|
|
@@ -28,23 +28,23 @@ let e = class extends x(d) {
|
|
|
28
28
|
<sbb-title
|
|
29
29
|
level=${this.level || c}
|
|
30
30
|
?negative=${this.negative}
|
|
31
|
-
visual-level=${
|
|
31
|
+
visual-level=${w.get(this.size)}
|
|
32
32
|
>
|
|
33
|
-
<span class="sbb-journey-header" dir=${
|
|
33
|
+
<span class="sbb-journey-header" dir=${h()}>
|
|
34
34
|
<span class="sbb-journey-header__origin">
|
|
35
35
|
<sbb-screen-reader-only>
|
|
36
|
-
${y[this.
|
|
36
|
+
${y[this._language.current]}
|
|
37
37
|
</sbb-screen-reader-only>
|
|
38
38
|
${this.origin}
|
|
39
39
|
</span>
|
|
40
40
|
<sbb-icon name=${s}></sbb-icon>
|
|
41
41
|
<span class="sbb-journey-header__destination">
|
|
42
42
|
<sbb-screen-reader-only>
|
|
43
|
-
${f[this.
|
|
43
|
+
${f[this._language.current]}
|
|
44
44
|
</sbb-screen-reader-only>
|
|
45
45
|
${this.destination}
|
|
46
46
|
${this.roundTrip ? p` <sbb-screen-reader-only>
|
|
47
|
-
${v(this.origin)[this.
|
|
47
|
+
${v(this.origin)[this._language.current]}
|
|
48
48
|
</sbb-screen-reader-only>` : c}
|
|
49
49
|
</span>
|
|
50
50
|
</span>
|
|
@@ -52,24 +52,24 @@ let e = class extends x(d) {
|
|
|
52
52
|
`;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
e.styles =
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
e.styles = x;
|
|
56
|
+
n([
|
|
57
|
+
t()
|
|
58
58
|
], e.prototype, "origin", 2);
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
n([
|
|
60
|
+
t()
|
|
61
61
|
], e.prototype, "destination", 2);
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
n([
|
|
63
|
+
t({ attribute: "round-trip", type: Boolean })
|
|
64
64
|
], e.prototype, "roundTrip", 2);
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
n([
|
|
66
|
+
t()
|
|
67
67
|
], e.prototype, "level", 2);
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
n([
|
|
69
|
+
t({ reflect: !0 })
|
|
70
70
|
], e.prototype, "size", 2);
|
|
71
|
-
e =
|
|
72
|
-
|
|
71
|
+
e = n([
|
|
72
|
+
d("sbb-journey-header")
|
|
73
73
|
], e);
|
|
74
74
|
export {
|
|
75
75
|
e as SbbJourneyHeaderElement
|
package/map-container.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { css as m, LitElement as p, html as
|
|
1
|
+
import { css as m, LitElement as p, html as n, nothing as l } from "lit";
|
|
2
2
|
import { property as h, state as u, customElement as v } from "lit/decorators.js";
|
|
3
3
|
import { ref as d } from "lit/directives/ref.js";
|
|
4
4
|
import { SbbLanguageController as g } from "./core/controllers.js";
|
|
5
|
-
import { i18nMapContainerButtonLabel as
|
|
6
|
-
import { AgnosticIntersectionObserver as
|
|
5
|
+
import { i18nMapContainerButtonLabel as _ } from "./core/i18n.js";
|
|
6
|
+
import { AgnosticIntersectionObserver as w } from "./core/observers.js";
|
|
7
7
|
import "./button/tertiary-button.js";
|
|
8
8
|
const f = m`*,:before,:after{box-sizing:border-box}:host{--sbb-map-container-map-height-zero: 18.4375rem;--sbb-map-container-map-height-small: 20rem;--sbb-map-container-sidebar-width: 25rem;--sbb-map-container-sidebar-background-color: var(--sbb-color-white);--sbb-map-container-map-height: calc( var(--sbb-map-container-map-height-zero) + var(--sbb-border-radius-4x) );--sbb-map-container-border-radius: var(--sbb-border-radius-4x);--sbb-map-container-animation-duration: var(--sbb-animation-duration-4x);display:block}@media (min-width: 37.5rem){:host{--sbb-map-container-map-height: calc( var(--sbb-map-container-map-height-small) + var(--sbb-map-container-border-radius) )}}@media (min-width: 80rem){:host{--sbb-map-container-sidebar-width: 30rem}}.sbb-map-container{display:grid;grid-template-rows:auto auto;height:100%}@media (min-width: 52.5rem){.sbb-map-container{grid-template-columns:max(var(--sbb-map-container-sidebar-width)) calc(100% - var(--sbb-map-container-sidebar-width));height:calc(100vh - var(--sbb-map-container-margin-start, var(--sbb-header-height)));overflow:hidden}}.sbb-map-container__sidebar-button{position:fixed;left:50%;inset-block-end:var(--sbb-spacing-fixed-5x);visibility:hidden;opacity:0;transform:translate(-50%) translateY(calc(100% + var(--sbb-spacing-fixed-5x)));transition:opacity var(--sbb-map-container-animation-duration) var(--sbb-animation-easing),visibility var(--sbb-map-container-animation-duration) var(--sbb-animation-easing) var(--sbb-map-container-animation-duration),transform var(--sbb-map-container-animation-duration) var(--sbb-animation-easing)}:host([data-scroll-up-button-visible]) .sbb-map-container__sidebar-button{transition:visibility var(--sbb-map-container-animation-duration) var(--sbb-animation-easing),opacity var(--sbb-map-container-animation-duration) var(--sbb-animation-easing),transform var(--sbb-map-container-animation-duration) ease-out;visibility:visible;opacity:1;transform:translate(-50%) translateY(0)}@media (min-width: 52.5rem){.sbb-map-container__sidebar-button{display:none}}.sbb-map-container__sidebar{--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);grid-column:1/3;grid-row:2/3;width:100%;height:calc(100% + var(--sbb-map-container-border-radius));overflow:hidden auto;position:relative;z-index:2;border-start-end-radius:var(--sbb-map-container-border-radius);border-start-start-radius:var(--sbb-map-container-border-radius);margin-block-start:calc(var(--sbb-map-container-border-radius) * -1);background-color:var(--sbb-map-container-sidebar-background-color)}.sbb-map-container__sidebar::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-map-container__sidebar::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-map-container__sidebar::-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-map-container__sidebar::-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-map-container__sidebar::-webkit-scrollbar-button,.sbb-map-container__sidebar::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-map-container__sidebar{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}@media (min-width: 52.5rem){.sbb-map-container__sidebar{grid-column:1/2;grid-row:1/3;border-radius:0;margin-block-start:0;border-block-start:var(--sbb-border-width-1x) solid var(--sbb-color-cloud)}}.sbb-map-container__map{position:sticky;inset-block-start:0;inset-inline:0;z-index:1;grid-row:1/2;grid-column:1/3;height:var(--sbb-map-container-map-height)}@media (min-width: 52.5rem){.sbb-map-container__map{grid-row:1/3;grid-column:2/3;height:100%;position:relative}}`;
|
|
9
|
-
var k = Object.defineProperty,
|
|
10
|
-
for (var a = b > 1 ? void 0 : b ?
|
|
11
|
-
(
|
|
9
|
+
var k = Object.defineProperty, y = Object.getOwnPropertyDescriptor, c = (r, t, i, b) => {
|
|
10
|
+
for (var a = b > 1 ? void 0 : b ? y(t, i) : t, s = r.length - 1, e; s >= 0; s--)
|
|
11
|
+
(e = r[s]) && (a = (b ? e(t, i, a) : e(a)) || a);
|
|
12
12
|
return b && a && k(t, i, a), a;
|
|
13
13
|
};
|
|
14
14
|
let o = class extends p {
|
|
15
15
|
constructor() {
|
|
16
|
-
super(...arguments), this.hideScrollUpButton = !1, this.
|
|
17
|
-
(r) => this.
|
|
16
|
+
super(...arguments), this.hideScrollUpButton = !1, this._scrollUpButtonVisible = !1, this._language = new g(this), this._observer = new w(
|
|
17
|
+
(r) => this._toggleButtonVisibilityOnIntersect(r)
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Button click callback to trigger the scroll to container top
|
|
22
22
|
* @private
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
_onScrollButtonClick() {
|
|
25
25
|
this.scrollIntoView({ behavior: "smooth" });
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
@@ -29,44 +29,44 @@ let o = class extends p {
|
|
|
29
29
|
* @param entries
|
|
30
30
|
* @private
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
_toggleButtonVisibilityOnIntersect(r) {
|
|
33
33
|
r.forEach((t) => {
|
|
34
34
|
const i = !t.isIntersecting;
|
|
35
|
-
this.toggleAttribute("data-scroll-up-button-visible", i), this.
|
|
35
|
+
this.toggleAttribute("data-scroll-up-button-visible", i), this._scrollUpButtonVisible = i;
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
connectedCallback() {
|
|
39
|
-
super.connectedCallback(), this.
|
|
39
|
+
super.connectedCallback(), this._updateIntersectionObserver();
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
this.
|
|
41
|
+
_updateIntersectionObserver() {
|
|
42
|
+
this._observer.disconnect(), !this.hideScrollUpButton && this._intersector && this._observer.observe(this._intersector);
|
|
43
43
|
}
|
|
44
44
|
disconnectedCallback() {
|
|
45
|
-
super.disconnectedCallback(), this.
|
|
45
|
+
super.disconnectedCallback(), this._observer.disconnect();
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return
|
|
48
|
+
return n`
|
|
49
49
|
<div class="sbb-map-container">
|
|
50
50
|
<div class="sbb-map-container__sidebar">
|
|
51
|
-
${this.hideScrollUpButton ? l :
|
|
51
|
+
${this.hideScrollUpButton ? l : n`<span
|
|
52
52
|
${d((r) => {
|
|
53
|
-
this.
|
|
53
|
+
this._intersector !== r && (this._intersector = r, this._updateIntersectionObserver());
|
|
54
54
|
})}
|
|
55
55
|
></span>`}
|
|
56
56
|
|
|
57
57
|
<slot></slot>
|
|
58
58
|
|
|
59
|
-
${this.hideScrollUpButton ? l :
|
|
59
|
+
${this.hideScrollUpButton ? l : n`<sbb-tertiary-button
|
|
60
60
|
class="sbb-map-container__sidebar-button"
|
|
61
61
|
size="l"
|
|
62
62
|
icon-name="location-pin-map-small"
|
|
63
63
|
type="button"
|
|
64
|
-
@click=${() => this.
|
|
64
|
+
@click=${() => this._onScrollButtonClick()}
|
|
65
65
|
${d((r) => {
|
|
66
|
-
r && (r.inert = !this.
|
|
66
|
+
r && (r.inert = !this._scrollUpButtonVisible);
|
|
67
67
|
})}
|
|
68
68
|
>
|
|
69
|
-
${
|
|
69
|
+
${_[this._language.current]}
|
|
70
70
|
</sbb-tertiary-button>`}
|
|
71
71
|
</div>
|
|
72
72
|
<div class="sbb-map-container__map">
|
|
@@ -82,7 +82,7 @@ c([
|
|
|
82
82
|
], o.prototype, "hideScrollUpButton", 2);
|
|
83
83
|
c([
|
|
84
84
|
u()
|
|
85
|
-
], o.prototype, "
|
|
85
|
+
], o.prototype, "_scrollUpButtonVisible", 2);
|
|
86
86
|
o = c([
|
|
87
87
|
v("sbb-map-container")
|
|
88
88
|
], o);
|