@sbb-esta/lyne-elements 0.52.0 → 0.52.1
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/breadcrumb-group.d.ts.map +1 -1
- package/breadcrumb/breadcrumb-group.js +70 -69
- 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 +87 -88
- package/core/controllers.js +40 -40
- package/core/datetime.js +34 -36
- package/core/dom.js +26 -26
- package/core/eventing.js +33 -33
- package/core/mixins.js +122 -122
- package/core/overlay/overlay.d.ts.map +1 -1
- package/core/overlay.js +55 -50
- package/core/testing/event-spy.d.ts +1 -1
- package/core/testing/wait-for-image-ready.d.ts +4 -0
- package/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/core/testing.d.ts +1 -0
- package/core/testing.d.ts.map +1 -1
- package/core/testing.js +42 -31
- package/custom-elements.json +70 -4
- package/datepicker/common.js +55 -55
- package/datepicker/datepicker-toggle.js +94 -94
- package/datepicker/datepicker.js +144 -144
- package/development/accordion.js +2 -3
- package/development/action-group.js +2 -3
- package/development/alert/alert-group.js +2 -3
- package/development/alert/alert.js +2 -3
- package/development/autocomplete.js +2 -3
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/development/breadcrumb/breadcrumb-group.js +5 -5
- package/development/breadcrumb/breadcrumb.js +2 -3
- package/development/button/button-link.js +2 -3
- package/development/button/button-static.js +2 -3
- package/development/button/button.js +2 -3
- package/development/button/common.js +2 -3
- package/development/button/mini-button.js +2 -3
- package/development/button/secondary-button-link.js +2 -3
- package/development/button/secondary-button-static.js +2 -3
- package/development/button/secondary-button.js +2 -3
- package/development/button/tertiary-button-link.js +2 -3
- package/development/button/tertiary-button-static.js +2 -3
- package/development/button/tertiary-button.js +2 -3
- package/development/button/transparent-button-link.js +2 -3
- package/development/button/transparent-button-static.js +2 -3
- package/development/button/transparent-button.js +2 -3
- package/development/calendar.js +2 -3
- package/development/card/card-badge.js +2 -3
- package/development/card/card-button.js +2 -3
- package/development/card/card-link.js +2 -3
- package/development/card/card.js +2 -3
- package/development/card/common.js +2 -3
- package/development/checkbox/checkbox-group.js +2 -3
- package/development/checkbox/checkbox.js +2 -3
- package/development/chip.js +2 -3
- package/development/clock.js +2 -3
- package/development/container/container.js +2 -3
- package/development/container/sticky-bar.js +2 -3
- package/development/core/base-elements.js +4 -7
- package/development/core/mixins.js +7 -13
- package/development/core/overlay/overlay.d.ts.map +1 -1
- package/development/core/overlay.js +9 -3
- package/development/core/testing/event-spy.d.ts +1 -1
- package/development/core/testing/wait-for-image-ready.d.ts +4 -0
- package/development/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/development/core/testing.d.ts +1 -0
- package/development/core/testing.d.ts.map +1 -1
- package/development/core/testing.js +17 -1
- package/development/datepicker/common.js +2 -3
- package/development/datepicker/datepicker-next-day.js +2 -3
- package/development/datepicker/datepicker-previous-day.js +2 -3
- package/development/datepicker/datepicker-toggle.js +2 -3
- package/development/datepicker/datepicker.js +2 -3
- package/development/dialog/dialog-actions.js +2 -3
- package/development/dialog/dialog-content.js +2 -3
- package/development/dialog/dialog-title.js +2 -3
- package/development/dialog/dialog.js +2 -3
- package/development/divider.js +2 -3
- package/development/expansion-panel/expansion-panel-content.js +2 -3
- package/development/expansion-panel/expansion-panel-header.js +2 -3
- package/development/expansion-panel/expansion-panel.js +2 -3
- package/development/file-selector.js +2 -3
- package/development/footer.js +2 -3
- package/development/form-error.js +2 -3
- package/development/form-field/form-field-clear.js +2 -3
- package/development/form-field/form-field.js +2 -3
- package/development/header/common.js +2 -3
- package/development/header/header-button.js +2 -3
- package/development/header/header-link.js +2 -3
- package/development/header/header.js +2 -3
- package/development/icon.js +4 -7
- package/development/image/image.d.ts +12 -3
- package/development/image/image.d.ts.map +1 -1
- package/development/image.js +41 -24
- package/development/journey-header.js +2 -3
- package/development/lead-container.js +2 -3
- package/development/link/block-link-button.js +2 -3
- package/development/link/block-link-static.js +2 -3
- package/development/link/block-link.js +2 -3
- package/development/link/common.js +3 -5
- package/development/link/link-button.js +2 -3
- package/development/link/link-static.js +2 -3
- package/development/link/link.js +2 -3
- package/development/link-list.js +2 -3
- package/development/loading-indicator.js +2 -3
- package/development/logo.js +2 -3
- package/development/map-container.js +2 -3
- package/development/menu/common.js +2 -3
- package/development/menu/menu-button.js +2 -3
- package/development/menu/menu-link.js +2 -3
- package/development/menu/menu.js +2 -3
- package/development/message.js +2 -3
- package/development/navigation/common.js +2 -3
- package/development/navigation/navigation-button.js +2 -3
- package/development/navigation/navigation-link.js +2 -3
- package/development/navigation/navigation-list.js +2 -3
- package/development/navigation/navigation-marker.js +2 -3
- package/development/navigation/navigation-section.js +2 -3
- package/development/navigation/navigation.js +2 -3
- package/development/notification.js +2 -3
- package/development/option/optgroup.js +2 -3
- package/development/option/option.js +2 -3
- package/development/overlay.js +3 -5
- package/development/popover/popover-trigger.js +2 -3
- package/development/popover/popover.js +2 -3
- package/development/radio-button/radio-button-group.js +2 -3
- package/development/radio-button/radio-button.js +2 -3
- package/development/screen-reader-only.js +2 -3
- package/development/select.js +2 -3
- package/development/selection-panel.js +2 -3
- package/development/signet.js +2 -3
- package/development/skiplink-list.js +2 -3
- package/development/slider.js +2 -3
- package/development/status.js +2 -3
- package/development/stepper/step-label.js +2 -3
- package/development/stepper/step.js +2 -3
- package/development/stepper/stepper/stepper.d.ts +1 -1
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +5 -6
- package/development/tabs/tab-group.js +2 -3
- package/development/tabs/tab-title.js +2 -3
- package/development/tag/tag-group.js +2 -3
- package/development/tag/tag.js +2 -3
- package/development/teaser-hero.js +2 -3
- package/development/teaser-paid.js +2 -3
- package/development/teaser.js +2 -3
- package/development/time-input.js +2 -3
- package/development/timetable-occupancy-icon.js +2 -3
- package/development/timetable-occupancy.js +2 -3
- package/development/title.js +3 -5
- package/development/toast.js +2 -3
- package/development/toggle/toggle-option.js +3 -5
- package/development/toggle/toggle.js +2 -3
- package/development/toggle-check.js +10 -3
- package/development/train/train-blocked-passage.js +2 -3
- package/development/train/train-formation.js +2 -3
- package/development/train/train-wagon.js +2 -3
- package/development/train/train.js +2 -3
- package/development/visual-checkbox.js +2 -3
- 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/image.d.ts +12 -3
- package/image/image.d.ts.map +1 -1
- package/image.js +118 -105
- 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/stepper.d.ts +1 -1
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +48 -48
- 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/toggle-check.js +14 -14
- package/train/train-formation.js +36 -37
- package/train/train-wagon.js +30 -30
- package/train/train.js +13 -13
package/image.js
CHANGED
|
@@ -1,84 +1,101 @@
|
|
|
1
|
-
import { css as y, LitElement as k, html as
|
|
2
|
-
import { property as s, eventOptions as
|
|
3
|
-
import { ref as
|
|
1
|
+
import { css as y, LitElement as k, html as h, nothing as l } from "lit";
|
|
2
|
+
import { property as s, eventOptions as v, customElement as $ } 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
|
|
6
|
-
var
|
|
7
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
8
|
-
(c =
|
|
9
|
-
return i && n &&
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
5
|
+
const w = 0, S = 359, P = 360, M = 599, z = 600, B = 839, O = 840, F = 1023, D = 1024, Q = 1279, C = 1280, E = 1439, L = 1440, j = 2579, R = 16, H = 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 d = Object.freeze, g = Object.defineProperty, T = Object.getOwnPropertyDescriptor, o = (t, e, r, i) => {
|
|
7
|
+
for (var n = i > 1 ? void 0 : i ? T(e, r) : e, p = t.length - 1, c; p >= 0; p--)
|
|
8
|
+
(c = t[p]) && (n = (i ? c(e, r, n) : c(n)) || n);
|
|
9
|
+
return i && n && g(e, r, n), n;
|
|
10
|
+
}, A = (t, e) => d(g(t, "raw", { value: d(t.slice()) })), u;
|
|
11
|
+
const V = (t) => {
|
|
12
|
+
if (!t || t.length === 0)
|
|
13
13
|
return [];
|
|
14
|
-
let
|
|
14
|
+
let e;
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
e = JSON.parse(t);
|
|
17
17
|
} catch {
|
|
18
18
|
return [];
|
|
19
19
|
}
|
|
20
|
-
if (!
|
|
20
|
+
if (!e.breakpoints || e.breakpoints.length === 0)
|
|
21
21
|
return [];
|
|
22
|
-
if (!Array.isArray(
|
|
22
|
+
if (!Array.isArray(e.breakpoints))
|
|
23
23
|
return [];
|
|
24
|
-
let
|
|
24
|
+
let r = !1, i = !1;
|
|
25
25
|
const n = ["image", "mediaQueries"];
|
|
26
|
-
return
|
|
26
|
+
return e.breakpoints.forEach((p) => {
|
|
27
27
|
const c = Object.keys(p);
|
|
28
28
|
c.forEach((m) => {
|
|
29
|
-
n.includes(m) || (
|
|
29
|
+
n.includes(m) || (r = !0);
|
|
30
30
|
}), n.forEach((m) => {
|
|
31
31
|
c.includes(m) || (i = !0);
|
|
32
32
|
});
|
|
33
|
-
}),
|
|
34
|
-
},
|
|
33
|
+
}), r || i ? [] : e.breakpoints;
|
|
34
|
+
}, q = {
|
|
35
35
|
once: !0,
|
|
36
36
|
passive: !0
|
|
37
|
-
}, b = (
|
|
38
|
-
"sbb-breakpoint-zero-min": b(
|
|
39
|
-
"sbb-breakpoint-zero-max": b(
|
|
40
|
-
"sbb-breakpoint-micro-min": b(
|
|
37
|
+
}, b = (t) => t / R, U = {
|
|
38
|
+
"sbb-breakpoint-zero-min": b(w),
|
|
39
|
+
"sbb-breakpoint-zero-max": b(S),
|
|
40
|
+
"sbb-breakpoint-micro-min": b(P),
|
|
41
41
|
"sbb-breakpoint-micro-max": b(M),
|
|
42
42
|
"sbb-breakpoint-small-min": b(z),
|
|
43
43
|
"sbb-breakpoint-small-max": b(B),
|
|
44
|
-
"sbb-breakpoint-medium-min": b(
|
|
45
|
-
"sbb-breakpoint-medium-max": b(
|
|
46
|
-
"sbb-breakpoint-large-min": b(
|
|
44
|
+
"sbb-breakpoint-medium-min": b(O),
|
|
45
|
+
"sbb-breakpoint-medium-max": b(F),
|
|
46
|
+
"sbb-breakpoint-large-min": b(D),
|
|
47
47
|
"sbb-breakpoint-large-max": b(Q),
|
|
48
|
-
"sbb-breakpoint-wide-min": b(
|
|
49
|
-
"sbb-breakpoint-wide-max": b(
|
|
50
|
-
"sbb-breakpoint-ultra-min": b(
|
|
51
|
-
"sbb-breakpoint-ultra-max": b(
|
|
48
|
+
"sbb-breakpoint-wide-min": b(C),
|
|
49
|
+
"sbb-breakpoint-wide-max": b(E),
|
|
50
|
+
"sbb-breakpoint-ultra-min": b(L),
|
|
51
|
+
"sbb-breakpoint-ultra-max": b(j)
|
|
52
52
|
};
|
|
53
53
|
let a = class extends k {
|
|
54
54
|
constructor() {
|
|
55
|
-
super(...arguments), this.
|
|
55
|
+
super(...arguments), this.c = {
|
|
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
|
+
get complete() {
|
|
62
|
+
var t, e, r;
|
|
63
|
+
return ((r = (e = (t = this.shadowRoot) == null ? void 0 : t.querySelector) == null ? void 0 : e.call(t, ".sbb-image__img")) == null ? void 0 : r.complete) ?? !1;
|
|
64
|
+
}
|
|
65
|
+
connectedCallback() {
|
|
66
|
+
super.connectedCallback(), this.toggleAttribute(
|
|
67
|
+
"data-teaser",
|
|
68
|
+
!!x("sbb-teaser-hero", this) || !!this.closest("sbb-teaser-paid")
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
updated(t) {
|
|
72
|
+
super.updated(t), this.a && (this.b = this.a.querySelectorAll("a"), this.b && this.e());
|
|
73
|
+
}
|
|
74
|
+
async firstUpdated(t) {
|
|
75
|
+
super.firstUpdated(t), await this.updateComplete, this.complete && this.toggleAttribute("data-loaded", !0);
|
|
76
|
+
}
|
|
77
|
+
f() {
|
|
61
78
|
this.performanceMark && (performance.clearMarks(this.performanceMark), performance.mark(this.performanceMark));
|
|
62
79
|
}
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
return
|
|
80
|
+
g(t) {
|
|
81
|
+
const e = U[t];
|
|
82
|
+
return e ? `${e}rem` : "";
|
|
66
83
|
}
|
|
67
|
-
|
|
68
|
-
var
|
|
69
|
-
(
|
|
70
|
-
|
|
84
|
+
e() {
|
|
85
|
+
var t;
|
|
86
|
+
(t = this.b) == null || t.forEach((e) => {
|
|
87
|
+
e.removeAttribute("tabindex");
|
|
71
88
|
});
|
|
72
89
|
}
|
|
73
|
-
|
|
74
|
-
if (!
|
|
90
|
+
d(t, e = !1) {
|
|
91
|
+
if (!t || t === "")
|
|
75
92
|
return "";
|
|
76
|
-
const
|
|
77
|
-
return
|
|
93
|
+
const r = !!t.match(/^\w+:\/\//), i = r ? new URL(t) : new URL(`http://noop/${t}`);
|
|
94
|
+
return e ? (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;
|
|
78
95
|
}
|
|
79
|
-
|
|
80
|
-
let
|
|
81
|
-
return this.pictureSizesConfig ?
|
|
96
|
+
h() {
|
|
97
|
+
let t;
|
|
98
|
+
return this.pictureSizesConfig ? t = this.pictureSizesConfig : t = `{
|
|
82
99
|
"breakpoints": [
|
|
83
100
|
{
|
|
84
101
|
"image": {
|
|
@@ -129,28 +146,25 @@ let a = class extends k {
|
|
|
129
146
|
]
|
|
130
147
|
}
|
|
131
148
|
]
|
|
132
|
-
}`,
|
|
149
|
+
}`, V(t);
|
|
133
150
|
}
|
|
134
|
-
|
|
135
|
-
let
|
|
136
|
-
return
|
|
137
|
-
const i =
|
|
151
|
+
i(t) {
|
|
152
|
+
let e = "";
|
|
153
|
+
return t.forEach((r) => {
|
|
154
|
+
const i = r.conditionFeature;
|
|
138
155
|
let n;
|
|
139
|
-
|
|
140
|
-
const p =
|
|
141
|
-
|
|
142
|
-
}),
|
|
156
|
+
r.conditionFeatureValue.lyneDesignToken ? n = this.g(r.conditionFeatureValue.value) : n = r.conditionFeatureValue.value;
|
|
157
|
+
const p = r.conditionOperator ? ` ${r.conditionOperator} ` : "";
|
|
158
|
+
e += `(${i}: ${n})${p}`;
|
|
159
|
+
}), e;
|
|
143
160
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"data-teaser",
|
|
147
|
-
!!x("sbb-teaser-hero", this) || !!this.closest("sbb-teaser-paid")
|
|
148
|
-
);
|
|
161
|
+
j() {
|
|
162
|
+
this.f(), this.toggleAttribute("data-loaded", !0), this.dispatchEvent(new Event("load"));
|
|
149
163
|
}
|
|
150
164
|
render() {
|
|
151
|
-
let { caption:
|
|
152
|
-
const
|
|
153
|
-
this.loading === "lazy" && (this.decoding = "async", this.importance = "low"), this.copyright && (
|
|
165
|
+
let { caption: t } = this, e = "";
|
|
166
|
+
const r = this.d(this.imageSrc, !0), i = this.d(this.imageSrc, !1);
|
|
167
|
+
this.loading === "lazy" && (this.decoding = "async", this.importance = "low"), this.copyright && (t = `${this.caption} ©${this.copyright}`, e = `{
|
|
154
168
|
"@context": "https://schema.org",
|
|
155
169
|
"@type": "Photograph",
|
|
156
170
|
"image": "${this.imageSrc}",
|
|
@@ -159,14 +173,14 @@ let a = class extends k {
|
|
|
159
173
|
"name": "${this.copyright}"
|
|
160
174
|
}
|
|
161
175
|
}`);
|
|
162
|
-
const n = this.
|
|
163
|
-
return
|
|
176
|
+
const n = this.h();
|
|
177
|
+
return h`
|
|
164
178
|
<figure class="sbb-image__figure">
|
|
165
179
|
<div class="sbb-image__wrapper">
|
|
166
|
-
${this.skipLqip ? l :
|
|
180
|
+
${this.skipLqip ? l : h`<img
|
|
167
181
|
alt=""
|
|
168
182
|
class="sbb-image__blurred"
|
|
169
|
-
src=${
|
|
183
|
+
src=${r}
|
|
170
184
|
width="1000"
|
|
171
185
|
height="562"
|
|
172
186
|
loading=${this.loading ?? l}
|
|
@@ -176,18 +190,19 @@ let a = class extends k {
|
|
|
176
190
|
<picture>
|
|
177
191
|
<!-- render picture element sources -->
|
|
178
192
|
${n.map((p) => {
|
|
179
|
-
const c = p.image.height, m = p.image.width, f = this.
|
|
193
|
+
const c = p.image.height, m = p.image.width, f = this.i(p.mediaQueries);
|
|
180
194
|
return [
|
|
181
|
-
|
|
195
|
+
h` <source
|
|
182
196
|
media=${`${f}`}
|
|
183
197
|
sizes=${`${m}px`}
|
|
184
|
-
srcset=${`${i}&w=${m}&h=${c}&q=${this.
|
|
198
|
+
srcset=${`${i}&w=${m}&h=${c}&q=${this.c.nonRetinaQuality} ${m}w, ${i}&w=${m * 2}&h=${c * 2}&q=${this.c.retinaQuality} ${m * 2}w`}
|
|
185
199
|
></source>`
|
|
186
200
|
];
|
|
187
201
|
})}
|
|
188
202
|
<img
|
|
189
203
|
alt=${this.alt || ""}
|
|
190
|
-
@load=${this.
|
|
204
|
+
@load=${this.j}
|
|
205
|
+
@error=${() => this.dispatchEvent(new Event("error"))}
|
|
191
206
|
class="sbb-image__img"
|
|
192
207
|
src=${this.imageSrc}
|
|
193
208
|
width="1000"
|
|
@@ -198,80 +213,78 @@ let a = class extends k {
|
|
|
198
213
|
/>
|
|
199
214
|
</picture>
|
|
200
215
|
</div>
|
|
201
|
-
${
|
|
216
|
+
${t ? h`<figcaption
|
|
202
217
|
class="sbb-image__caption"
|
|
203
|
-
.innerHTML=${
|
|
204
|
-
${
|
|
205
|
-
this.
|
|
218
|
+
.innerHTML=${t}
|
|
219
|
+
${_((p) => {
|
|
220
|
+
this.a = p;
|
|
206
221
|
})}
|
|
207
222
|
></figcaption>` : l}
|
|
208
|
-
${
|
|
223
|
+
${e ? h(u || (u = A(['<script type="application/ld+json" .innerHTML=', "><\/script>"])), e) : l}
|
|
209
224
|
</figure>
|
|
210
225
|
`;
|
|
211
226
|
}
|
|
212
|
-
updated(e) {
|
|
213
|
-
super.updated(e), this._captionElement && (this._linksInCaption = this._captionElement.querySelectorAll("a"), this._linksInCaption && this._addFocusAbilityToLinksInCaption());
|
|
214
|
-
}
|
|
215
|
-
_imageLoaded() {
|
|
216
|
-
this._logPerformanceMarks(), this.toggleAttribute("data-loaded", !0);
|
|
217
|
-
}
|
|
218
227
|
};
|
|
219
|
-
a.styles =
|
|
220
|
-
|
|
228
|
+
a.styles = H;
|
|
229
|
+
a.events = {
|
|
230
|
+
error: "error",
|
|
231
|
+
load: "load"
|
|
232
|
+
};
|
|
233
|
+
o([
|
|
221
234
|
s()
|
|
222
235
|
], a.prototype, "alt", 2);
|
|
223
|
-
|
|
236
|
+
o([
|
|
224
237
|
s({ attribute: "skip-lqip", type: Boolean })
|
|
225
238
|
], a.prototype, "skipLqip", 2);
|
|
226
|
-
|
|
239
|
+
o([
|
|
227
240
|
s()
|
|
228
241
|
], a.prototype, "caption", 2);
|
|
229
|
-
|
|
242
|
+
o([
|
|
230
243
|
s()
|
|
231
244
|
], a.prototype, "copyright", 2);
|
|
232
|
-
|
|
245
|
+
o([
|
|
233
246
|
s({ attribute: "copyright-holder" })
|
|
234
247
|
], a.prototype, "copyrightHolder", 2);
|
|
235
|
-
|
|
248
|
+
o([
|
|
236
249
|
s({ attribute: "custom-focal-point", type: Boolean })
|
|
237
250
|
], a.prototype, "customFocalPoint", 2);
|
|
238
|
-
|
|
251
|
+
o([
|
|
239
252
|
s()
|
|
240
253
|
], a.prototype, "decoding", 2);
|
|
241
|
-
|
|
254
|
+
o([
|
|
242
255
|
s({ attribute: "focal-point-debug", type: Boolean })
|
|
243
256
|
], a.prototype, "focalPointDebug", 2);
|
|
244
|
-
|
|
257
|
+
o([
|
|
245
258
|
s({ attribute: "focal-point-x", type: Number })
|
|
246
259
|
], a.prototype, "focalPointX", 2);
|
|
247
|
-
|
|
260
|
+
o([
|
|
248
261
|
s({ attribute: "focal-point-y", type: Number })
|
|
249
262
|
], a.prototype, "focalPointY", 2);
|
|
250
|
-
|
|
263
|
+
o([
|
|
251
264
|
s({ attribute: "image-src" })
|
|
252
265
|
], a.prototype, "imageSrc", 2);
|
|
253
|
-
|
|
266
|
+
o([
|
|
254
267
|
s()
|
|
255
268
|
], a.prototype, "importance", 2);
|
|
256
|
-
|
|
269
|
+
o([
|
|
257
270
|
s()
|
|
258
271
|
], a.prototype, "loading", 2);
|
|
259
|
-
|
|
272
|
+
o([
|
|
260
273
|
s({ attribute: "performance-mark" })
|
|
261
274
|
], a.prototype, "performanceMark", 2);
|
|
262
|
-
|
|
275
|
+
o([
|
|
263
276
|
s({ attribute: "picture-sizes-config" })
|
|
264
277
|
], a.prototype, "pictureSizesConfig", 2);
|
|
265
|
-
|
|
278
|
+
o([
|
|
266
279
|
s({ attribute: "border-radius", reflect: !0 })
|
|
267
280
|
], a.prototype, "borderRadius", 2);
|
|
268
|
-
|
|
281
|
+
o([
|
|
269
282
|
s({ attribute: "aspect-ratio", reflect: !0 })
|
|
270
283
|
], a.prototype, "aspectRatio", 2);
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
], a.prototype, "
|
|
274
|
-
a =
|
|
284
|
+
o([
|
|
285
|
+
v(q)
|
|
286
|
+
], a.prototype, "j", 1);
|
|
287
|
+
a = o([
|
|
275
288
|
$("sbb-image")
|
|
276
289
|
], a);
|
|
277
290
|
export {
|
package/journey-header.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as m, LitElement as d, html as p, nothing as c } from "lit";
|
|
2
|
+
import { property as n, customElement as h } from "lit/decorators.js";
|
|
3
3
|
import { SbbLanguageController as u } from "./core/controllers.js";
|
|
4
|
-
import { getDocumentWritingMode as
|
|
4
|
+
import { getDocumentWritingMode as g } 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 x } 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 $ = m`*,: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 j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, t = (s, o, a, i) => {
|
|
12
|
+
for (var r = i > 1 ? void 0 : i ? w(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 && j(o, a, r), r;
|
|
15
15
|
};
|
|
16
|
-
const
|
|
16
|
+
const _ = /* @__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 x(d) {
|
|
22
22
|
constructor() {
|
|
23
|
-
super(...arguments), this.level = "3", this.size = "m", this.
|
|
23
|
+
super(...arguments), this.level = "3", this.size = "m", this.a = 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 _(m) {
|
|
|
28
28
|
<sbb-title
|
|
29
29
|
level=${this.level || c}
|
|
30
30
|
?negative=${this.negative}
|
|
31
|
-
visual-level=${
|
|
31
|
+
visual-level=${_.get(this.size)}
|
|
32
32
|
>
|
|
33
|
-
<span class="sbb-journey-header" dir=${
|
|
33
|
+
<span class="sbb-journey-header" dir=${g()}>
|
|
34
34
|
<span class="sbb-journey-header__origin">
|
|
35
35
|
<sbb-screen-reader-only>
|
|
36
|
-
${y[this.
|
|
36
|
+
${y[this.a.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.a.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.a.current]}
|
|
48
48
|
</sbb-screen-reader-only>` : c}
|
|
49
49
|
</span>
|
|
50
50
|
</span>
|
|
@@ -52,24 +52,24 @@ let e = class extends _(m) {
|
|
|
52
52
|
`;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
e.styles =
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
e.styles = $;
|
|
56
|
+
t([
|
|
57
|
+
n()
|
|
58
58
|
], e.prototype, "origin", 2);
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
t([
|
|
60
|
+
n()
|
|
61
61
|
], e.prototype, "destination", 2);
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
t([
|
|
63
|
+
n({ attribute: "round-trip", type: Boolean })
|
|
64
64
|
], e.prototype, "roundTrip", 2);
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
t([
|
|
66
|
+
n()
|
|
67
67
|
], e.prototype, "level", 2);
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
t([
|
|
69
|
+
n({ reflect: !0 })
|
|
70
70
|
], e.prototype, "size", 2);
|
|
71
|
-
e =
|
|
72
|
-
|
|
71
|
+
e = t([
|
|
72
|
+
h("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 e, 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 w } from "./core/i18n.js";
|
|
6
|
+
import { AgnosticIntersectionObserver as _ } 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, x = Object.getOwnPropertyDescriptor, c = (r, t, i, b) => {
|
|
10
|
+
for (var a = b > 1 ? void 0 : b ? x(t, i) : t, s = r.length - 1, n; s >= 0; s--)
|
|
11
|
+
(n = r[s]) && (a = (b ? n(t, i, a) : n(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.c = !1, this.e = new g(this), this.b = new _(
|
|
17
|
+
(r) => this.f(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
|
+
g() {
|
|
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
|
+
f(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.c = i;
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
connectedCallback() {
|
|
39
|
-
super.connectedCallback(), this.
|
|
39
|
+
super.connectedCallback(), this.d();
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
this.
|
|
41
|
+
d() {
|
|
42
|
+
this.b.disconnect(), !this.hideScrollUpButton && this.a && this.b.observe(this.a);
|
|
43
43
|
}
|
|
44
44
|
disconnectedCallback() {
|
|
45
|
-
super.disconnectedCallback(), this.
|
|
45
|
+
super.disconnectedCallback(), this.b.disconnect();
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return
|
|
48
|
+
return e`
|
|
49
49
|
<div class="sbb-map-container">
|
|
50
50
|
<div class="sbb-map-container__sidebar">
|
|
51
|
-
${this.hideScrollUpButton ? l :
|
|
51
|
+
${this.hideScrollUpButton ? l : e`<span
|
|
52
52
|
${d((r) => {
|
|
53
|
-
this.
|
|
53
|
+
this.a !== r && (this.a = r, this.d());
|
|
54
54
|
})}
|
|
55
55
|
></span>`}
|
|
56
56
|
|
|
57
57
|
<slot></slot>
|
|
58
58
|
|
|
59
|
-
${this.hideScrollUpButton ? l :
|
|
59
|
+
${this.hideScrollUpButton ? l : e`<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.g()}
|
|
65
65
|
${d((r) => {
|
|
66
|
-
r && (r.inert = !this.
|
|
66
|
+
r && (r.inert = !this.c);
|
|
67
67
|
})}
|
|
68
68
|
>
|
|
69
|
-
${
|
|
69
|
+
${w[this.e.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, "c", 2);
|
|
86
86
|
o = c([
|
|
87
87
|
v("sbb-map-container")
|
|
88
88
|
], o);
|