@sbb-esta/lyne-elements-experimental 2.11.0 → 2.11.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/core/datetime/date-helper.js +142 -142
- package/core/timetable/access-leg-helper.js +49 -52
- package/core/timetable/timetable-helper.js +7 -8
- package/custom-elements.json +106 -35
- package/development/core/datetime/date-helper.js +10 -10
- package/development/core/timetable/access-leg-helper.js +12 -15
- package/development/core/timetable/timetable-helper.js +6 -7
- package/development/{differenceInMinutes-CHSyWiQs.js → differenceInMinutes-D5Nj8Stc.js} +3 -3
- package/development/{format-D0-yhzi4.js → format-BQfaa1ZT.js} +22 -26
- package/development/{isValid-Bo4R7iA7.js → isValid-DvieCZVi.js} +3 -3
- package/development/journey-summary/journey-summary.component.js +4 -5
- package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/development/pearl-chain/pearl-chain.component.js +28 -39
- package/development/pearl-chain-time/pearl-chain-time.component.js +5 -6
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
- package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
- package/development/seat-reservation/common/mapper/mapper.d.ts +5 -5
- package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
- package/development/seat-reservation/common/mapper/mapper.js +17 -19
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
- package/development/seat-reservation/common/svgs.js +1 -1
- package/development/seat-reservation/common/translations/i18n.js +2 -3
- package/development/seat-reservation/common/types.d.ts +71 -0
- package/development/seat-reservation/common/types.d.ts.map +1 -0
- package/development/seat-reservation/common/types.js +2 -0
- package/development/seat-reservation/common.d.ts +6 -3
- package/development/seat-reservation/common.d.ts.map +1 -1
- package/development/seat-reservation/common.js +3 -7
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +4 -3
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +27 -38
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation/{seat-reservation-scoped-component → seat-reservation-scoped}/seat-reservation-scoped.component.js +6 -7
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts +5 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped.js +5 -0
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +4 -4
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +20 -27
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
- package/development/seat-reservation/seat-reservation-area.d.ts +3 -0
- package/development/seat-reservation/seat-reservation-area.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +2 -3
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +7 -8
- package/development/seat-reservation/seat-reservation-graphic.d.ts +3 -0
- package/development/seat-reservation/seat-reservation-graphic.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +6 -5
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +7 -11
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts +3 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -3
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts +3 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-navigation.d.ts +6 -0
- package/development/seat-reservation/seat-reservation-navigation.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation.js +7 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -2
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +5 -6
- package/development/seat-reservation/seat-reservation-place-control.d.ts +3 -0
- package/development/seat-reservation/seat-reservation-place-control.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation.d.ts +5 -71
- package/development/seat-reservation/seat-reservation.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation.js +4 -2
- package/development/seat-reservation.d.ts +5 -0
- package/development/seat-reservation.d.ts.map +1 -1
- package/development/seat-reservation.js +26 -3
- package/development/timetable-duration/timetable-duration.component.js +1 -1
- package/development/timetable-row/timetable-row.component.js +58 -89
- package/differenceInMinutes-CP_C5onR.js +23 -0
- package/{format-Dg8rkk7h.js → format-lqeCzmzS.js} +438 -442
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/isValid-Ceq2O0NQ.js +45 -0
- package/journey-summary/journey-summary.component.js +3 -4
- package/package.json +47 -2
- package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/pearl-chain/pearl-chain.component.js +78 -95
- package/pearl-chain-time/pearl-chain-time.component.js +44 -45
- package/seat-reservation/common/mapper/mapper.d.ts +5 -5
- package/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
- package/seat-reservation/common/mapper/mapper.js +50 -54
- package/seat-reservation/common/translations/i18n.js +5 -6
- package/seat-reservation/common/types.d.ts +71 -0
- package/seat-reservation/common/types.d.ts.map +1 -0
- package/seat-reservation/common/types.js +1 -0
- package/seat-reservation/common.d.ts +6 -3
- package/seat-reservation/common.d.ts.map +1 -1
- package/seat-reservation/common.js +11 -15
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +4 -3
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +107 -118
- package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation/{seat-reservation-scoped-component → seat-reservation-scoped}/seat-reservation-scoped.component.js +40 -41
- package/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts +5 -0
- package/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts.map +1 -0
- package/seat-reservation/seat-reservation/{seat-reservation-scoped-component.js → seat-reservation-scoped.js} +1 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts +4 -4
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.js +82 -91
- package/seat-reservation/seat-reservation-area.d.ts +3 -0
- package/seat-reservation/seat-reservation-area.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +15 -18
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +58 -59
- package/seat-reservation/seat-reservation-graphic.d.ts +3 -0
- package/seat-reservation/seat-reservation-graphic.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +6 -5
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +71 -75
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts +3 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +12 -13
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts +3 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation.d.ts +6 -0
- package/seat-reservation/seat-reservation-navigation.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-navigation.js +6 -0
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -2
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +24 -25
- package/seat-reservation/seat-reservation-place-control.d.ts +3 -0
- package/seat-reservation/seat-reservation-place-control.d.ts.map +1 -1
- package/seat-reservation/seat-reservation.d.ts +5 -71
- package/seat-reservation/seat-reservation.d.ts.map +1 -1
- package/seat-reservation/seat-reservation.js +6 -4
- package/seat-reservation.d.ts +5 -0
- package/seat-reservation.d.ts.map +1 -1
- package/seat-reservation.js +27 -4
- package/timetable-row/timetable-row.component.js +207 -247
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts +0 -2
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.js +0 -5
- package/differenceInMinutes-BMqUZdhj.js +0 -23
- package/isValid-DJ69OMZJ.js +0 -45
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.d.ts.map +0 -1
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts +0 -2
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts.map +0 -1
- /package/development/seat-reservation/seat-reservation/{seat-reservation-scoped-component → seat-reservation-scoped}/seat-reservation-scoped.component.d.ts +0 -0
- /package/seat-reservation/seat-reservation/{seat-reservation-scoped-component → seat-reservation-scoped}/seat-reservation-scoped.component.d.ts +0 -0
|
@@ -1,81 +1,80 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var F = (s) => {
|
|
2
|
+
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __runInitializers as h, __esDecorate as
|
|
7
|
-
import { SbbLanguageController as
|
|
8
|
-
import { forceType as
|
|
9
|
-
import { css as
|
|
10
|
-
import { customElement as
|
|
11
|
-
import { classMap as
|
|
12
|
-
import { mapIconToSvg as
|
|
4
|
+
var G = (s, i, r) => i.has(s) || F("Cannot " + r);
|
|
5
|
+
var l = (s, i, r) => (G(s, i, "read from private field"), r ? r.call(s) : i.get(s)), g = (s, i, r) => i.has(s) ? F("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, r), o = (s, i, r, c) => (G(s, i, "write to private field"), c ? c.call(s, r) : i.set(s, r), r);
|
|
6
|
+
import { __runInitializers as h, __esDecorate as b } from "tslib";
|
|
7
|
+
import { SbbLanguageController as q } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
|
+
import { forceType as f } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
+
import { css as H, LitElement as J, html as z } from "lit";
|
|
10
|
+
import { customElement as K, property as w } from "lit/decorators.js";
|
|
11
|
+
import { classMap as Q } from "lit/directives/class-map.js";
|
|
12
|
+
import { mapIconToSvg as V, getI18nSeatReservation as W } from "../common.js";
|
|
13
13
|
import "@sbb-esta/lyne-elements/icon.js";
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
var v, p, _, d, u,
|
|
17
|
-
let
|
|
18
|
-
return
|
|
14
|
+
const X = H`*,:before,:after{box-sizing:border-box}:host{--sbb-reservation-graphic-width: 16;--sbb-reservation-graphic-height: 16;--sbb-reservation-graphic-rotation: 0;--sbb-reservation-graphic-inverse-rotation: 0}.sbb-sr-icon,.sbb-sr-graphic{--sbb-icon-svg-width: calc(var(--sbb-reservation-graphic-width) * .0625rem);--sbb-icon-svg-height: calc(var(--sbb-reservation-graphic-height) * .0625rem);display:flex;justify-content:center;align-items:center;width:calc(var(--sbb-reservation-graphic-width) * .0625rem);height:calc(var(--sbb-reservation-graphic-height) * .0625rem);transform-origin:center;rotate:calc(var(--sbb-reservation-graphic-rotation) * 1deg)}.sbb-sr-icon{color:var(--sbb-color-granite)}.sbb-sr-graphic svg{width:100%;height:100%}.sbb-sr-graphic svg .fix-rotation-inverse{transform-origin:center;rotate:calc(var(--sbb-reservation-graphic-inverse-rotation) * 1deg)}@media (forced-colors: active){.sbb-sr-graphic svg:not(.color-immutable) [fill]:not([fill=none]){fill:currentcolor}.sbb-sr-graphic .no-bg{fill:transparent}}`;
|
|
15
|
+
let ht = (() => {
|
|
16
|
+
var m, v, p, _, d, u, a;
|
|
17
|
+
let s = [K("sbb-seat-reservation-graphic")], i, r = [], c, R = J, x, S = [], I = [], N, $ = [], E = [], k, j = [], D = [], O, C = [], L = [], T, A = [], M = [], P, U = [], B = [];
|
|
18
|
+
return a = class extends R {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
o(this,
|
|
21
|
+
g(this, m);
|
|
22
|
+
g(this, v);
|
|
23
|
+
g(this, p);
|
|
24
|
+
g(this, _);
|
|
25
|
+
g(this, d);
|
|
26
|
+
g(this, u);
|
|
27
|
+
o(this, m, h(this, S, "")), o(this, v, (h(this, I), h(this, $, !1))), o(this, p, (h(this, E), h(this, j, 0))), o(this, _, (h(this, D), h(this, C, 0))), o(this, d, (h(this, L), h(this, A, null))), o(this, u, (h(this, M), h(this, U, null))), this._language = (h(this, B), new q(this));
|
|
28
28
|
}
|
|
29
29
|
/** Name of the SVG graphic to be displayed. */
|
|
30
30
|
get name() {
|
|
31
|
-
return
|
|
31
|
+
return l(this, m);
|
|
32
32
|
}
|
|
33
33
|
set name(t) {
|
|
34
|
-
o(this,
|
|
34
|
+
o(this, m, t);
|
|
35
35
|
}
|
|
36
36
|
/** if true, scale the graphic content of the given element non-uniformly if necessary */
|
|
37
37
|
get stretch() {
|
|
38
|
-
return
|
|
38
|
+
return l(this, v);
|
|
39
39
|
}
|
|
40
40
|
set stretch(t) {
|
|
41
|
-
o(this,
|
|
41
|
+
o(this, v, t);
|
|
42
42
|
}
|
|
43
43
|
/** handles the rotation of the SVG graphic */
|
|
44
44
|
get rotation() {
|
|
45
|
-
return
|
|
45
|
+
return l(this, p);
|
|
46
46
|
}
|
|
47
47
|
set rotation(t) {
|
|
48
|
-
o(this,
|
|
48
|
+
o(this, p, t);
|
|
49
49
|
}
|
|
50
50
|
/** Inverse rotation for part of an SVG that can be rotated opposite to the normal rotation */
|
|
51
51
|
get inverseRotation() {
|
|
52
|
-
return
|
|
52
|
+
return l(this, _);
|
|
53
53
|
}
|
|
54
54
|
set inverseRotation(t) {
|
|
55
|
-
o(this,
|
|
55
|
+
o(this, _, t);
|
|
56
56
|
}
|
|
57
57
|
/** width of the svg in pixels (without unit) */
|
|
58
58
|
get width() {
|
|
59
|
-
return
|
|
59
|
+
return l(this, d);
|
|
60
60
|
}
|
|
61
61
|
set width(t) {
|
|
62
|
-
o(this,
|
|
62
|
+
o(this, d, t);
|
|
63
63
|
}
|
|
64
64
|
/** height of the svg in pixels (without unit) */
|
|
65
65
|
get height() {
|
|
66
|
-
return
|
|
66
|
+
return l(this, u);
|
|
67
67
|
}
|
|
68
68
|
set height(t) {
|
|
69
|
-
o(this,
|
|
69
|
+
o(this, u, t);
|
|
70
70
|
}
|
|
71
71
|
willUpdate(t) {
|
|
72
|
-
|
|
73
|
-
super.willUpdate(t), t.has("width") && this.width && ((e = this.style) == null || e.setProperty("--sbb-reservation-graphic-width", `${this.width}`)), t.has("height") && this.height && ((s = this.style) == null || s.setProperty("--sbb-reservation-graphic-height", `${this.height}`)), t.has("rotation") && ((l = this.style) == null || l.setProperty("--sbb-reservation-graphic-rotation", `${this.rotation}`)), t.has("inverseRotation") && ((j = this.style) == null || j.setProperty("--sbb-reservation-graphic-inverse-rotation", `${this.inverseRotation}`));
|
|
72
|
+
super.willUpdate(t), t.has("width") && this.width && this.style?.setProperty("--sbb-reservation-graphic-width", `${this.width}`), t.has("height") && this.height && this.style?.setProperty("--sbb-reservation-graphic-height", `${this.height}`), t.has("rotation") && this.style?.setProperty("--sbb-reservation-graphic-rotation", `${this.rotation}`), t.has("inverseRotation") && this.style?.setProperty("--sbb-reservation-graphic-inverse-rotation", `${this.inverseRotation}`);
|
|
74
73
|
}
|
|
75
74
|
render() {
|
|
76
|
-
const t =
|
|
77
|
-
return !
|
|
78
|
-
class="${
|
|
75
|
+
const t = V[this.name];
|
|
76
|
+
return !t?.svg && !t?.svgName ? null : z`<span
|
|
77
|
+
class="${Q({
|
|
79
78
|
"sbb-sr-icon": !!t.svgName,
|
|
80
79
|
"sbb-sr-graphic": !!t.svg
|
|
81
80
|
})}"
|
|
@@ -83,31 +82,31 @@ let ct = (() => {
|
|
|
83
82
|
${t.svgName ? z` <sbb-icon
|
|
84
83
|
name="${t.svgName || ""}"
|
|
85
84
|
aria-hidden="false"
|
|
86
|
-
aria-label="${
|
|
85
|
+
aria-label="${W(t.svgName, this._language.current)}"
|
|
87
86
|
></sbb-icon>` : z`${this._getSvgElement(t.svg)}`}
|
|
88
87
|
</span>`;
|
|
89
88
|
}
|
|
90
89
|
_getSvgElement(t) {
|
|
91
|
-
const e = new DOMParser(),
|
|
92
|
-
return this.stretch &&
|
|
90
|
+
const e = new DOMParser(), n = t || "<svg></svg>", y = e.parseFromString(n, "image/svg+xml").firstElementChild;
|
|
91
|
+
return this.stretch && y?.nodeName.toLowerCase() === "svg" && y.setAttribute("preserveAspectRatio", "none"), y;
|
|
93
92
|
}
|
|
94
|
-
},
|
|
93
|
+
}, m = new WeakMap(), v = new WeakMap(), p = new WeakMap(), _ = new WeakMap(), d = new WeakMap(), u = new WeakMap(), c = a, (() => {
|
|
95
94
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(R[Symbol.metadata] ?? null) : void 0;
|
|
96
|
-
x = [
|
|
97
|
-
e.name =
|
|
98
|
-
} }, metadata: t }, S, I),
|
|
99
|
-
e.stretch =
|
|
100
|
-
} }, metadata: t }, $,
|
|
101
|
-
e.rotation =
|
|
102
|
-
} }, metadata: t },
|
|
103
|
-
e.inverseRotation =
|
|
104
|
-
} }, metadata: t },
|
|
105
|
-
e.width =
|
|
106
|
-
} }, metadata: t },
|
|
107
|
-
e.height =
|
|
108
|
-
} }, metadata: t },
|
|
109
|
-
})(),
|
|
95
|
+
x = [f(), w({ attribute: "name" })], N = [f(), w({ attribute: "stretch", type: Boolean })], k = [f(), w({ attribute: "rotation", type: Number })], O = [f(), w({ attribute: "inverse-roration", type: Number })], T = [f(), w({ attribute: "width", type: Number })], P = [f(), w({ attribute: "height", type: Number })], b(a, null, x, { kind: "accessor", name: "name", static: !1, private: !1, access: { has: (e) => "name" in e, get: (e) => e.name, set: (e, n) => {
|
|
96
|
+
e.name = n;
|
|
97
|
+
} }, metadata: t }, S, I), b(a, null, N, { kind: "accessor", name: "stretch", static: !1, private: !1, access: { has: (e) => "stretch" in e, get: (e) => e.stretch, set: (e, n) => {
|
|
98
|
+
e.stretch = n;
|
|
99
|
+
} }, metadata: t }, $, E), b(a, null, k, { kind: "accessor", name: "rotation", static: !1, private: !1, access: { has: (e) => "rotation" in e, get: (e) => e.rotation, set: (e, n) => {
|
|
100
|
+
e.rotation = n;
|
|
101
|
+
} }, metadata: t }, j, D), b(a, null, O, { kind: "accessor", name: "inverseRotation", static: !1, private: !1, access: { has: (e) => "inverseRotation" in e, get: (e) => e.inverseRotation, set: (e, n) => {
|
|
102
|
+
e.inverseRotation = n;
|
|
103
|
+
} }, metadata: t }, C, L), b(a, null, T, { kind: "accessor", name: "width", static: !1, private: !1, access: { has: (e) => "width" in e, get: (e) => e.width, set: (e, n) => {
|
|
104
|
+
e.width = n;
|
|
105
|
+
} }, metadata: t }, A, M), b(a, null, P, { kind: "accessor", name: "height", static: !1, private: !1, access: { has: (e) => "height" in e, get: (e) => e.height, set: (e, n) => {
|
|
106
|
+
e.height = n;
|
|
107
|
+
} }, metadata: t }, U, B), b(null, i = { value: c }, s, { kind: "class", name: c.name, metadata: t }, null, r), c = i.value, t && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
108
|
+
})(), a.styles = X, h(c, r), c;
|
|
110
109
|
})();
|
|
111
110
|
export {
|
|
112
|
-
|
|
111
|
+
ht as SbbSeatReservationGraphicElement
|
|
113
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-reservation-graphic.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/seat-reservation/seat-reservation-graphic.ts"],"names":[],"mappings":"AAAA,cAAc,kEAAkE,CAAC"}
|
|
1
|
+
{"version":3,"file":"seat-reservation-graphic.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/seat-reservation/seat-reservation-graphic.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,kEAAkE,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { EventEmitter } from '@sbb-esta/lyne-elements/core/eventing.js';
|
|
2
2
|
import { CSSResultGroup, PropertyValues, TemplateResult, LitElement } from 'lit';
|
|
3
|
-
import { PlaceTravelClass } from '../../
|
|
3
|
+
import { PlaceTravelClass } from '../../common.js';
|
|
4
|
+
export type SelectCoachEventDetails = number;
|
|
4
5
|
/**
|
|
5
6
|
* This component will display the navigation coach item for Seat reservation.
|
|
6
7
|
*
|
|
7
|
-
* @event {CustomEvent<
|
|
8
|
-
* @event {CustomEvent<
|
|
8
|
+
* @event {CustomEvent<SelectCoachEventDetails>} selectCoach - Emits when a coach within the navigation was selected and returns the clicked coach nav index
|
|
9
|
+
* @event {CustomEvent<void>} focusCoach - Emits when a nav coach has the focus
|
|
9
10
|
*/
|
|
10
11
|
export declare class SbbSeatReservationNavigationCoachElement extends LitElement {
|
|
11
12
|
static styles: CSSResultGroup;
|
|
@@ -34,8 +35,8 @@ export declare class SbbSeatReservationNavigationCoachElement extends LitElement
|
|
|
34
35
|
accessor vertical: boolean;
|
|
35
36
|
private _language;
|
|
36
37
|
/** Emits when a coach within the navigation was selected */
|
|
37
|
-
protected selectNavCoach: EventEmitter
|
|
38
|
-
protected focusNavCoach: EventEmitter
|
|
38
|
+
protected selectNavCoach: EventEmitter<SelectCoachEventDetails>;
|
|
39
|
+
protected focusNavCoach: EventEmitter<void>;
|
|
39
40
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
40
41
|
/**
|
|
41
42
|
* Render a maximum of 3 of the service sign icons (slice(0,3)) regardless of the input from Backend,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-reservation-navigation-coach.component.d.ts","sourceRoot":"","sources":["../../../../../src/elements-experimental/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,KAAK,cAAc,EAAW,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAC7F,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"seat-reservation-navigation-coach.component.d.ts","sourceRoot":"","sources":["../../../../../src/elements-experimental/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,KAAK,cAAc,EAAW,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAC7F,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,OAAO,+CAA+C,CAAC;AACvD,OAAO,4CAA4C,CAAC;AAIpD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE7C;;;;;GAKG;AACH,qBAEM,wCAAyC,SAAQ,UAAU;IAC/D,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;;MAGlB;IAEX,sEAAsE;IACtE,SAEgB,OAAO,EAAE,MAAM,CAAM;IAErC,2FAA2F;IAC3F,SACgB,WAAW,EAAE,MAAM,EAAE,CAAM;IAG3C,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAG1C,SAEgB,OAAO,EAAE,OAAO,CAAS;IAEzC,SAEgB,KAAK,EAAE,MAAM,CAAK;IAElC,gCAAgC;IAChC,SACgB,WAAW,EAAE,gBAAgB,EAAE,CAAiB;IAEhE,+CAA+C;IAC/C,SAEgB,UAAU,EAAE,OAAO,CAAS;IAE5C,kDAAkD;IAClD,SAEgB,KAAK,EAAE,OAAO,CAAS;IAEvC,iDAAiD;IACjD,SAEgB,IAAI,EAAE,OAAO,CAAS;IAEtC,mCAAmC;IACnC,SAEgB,OAAO,EAAE,OAAO,CAAS;IAEzC,6DAA6D;IAC7D,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAE1C,OAAO,CAAC,SAAS,CAAmC;IAEpD,4DAA4D;IAC5D,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC,uBAAuB,CAAC,CAG7D;IACF,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,IAAI,CAAC,CAGzC;cAEiB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAuB5E;;;;;;OAMG;cACgB,MAAM,IAAI,cAAc;IAyB3C,OAAO,CAAC,oBAAoB;IAwB5B,OAAO,CAAC,kBAAkB;IA4B1B,OAAO,CAAC,kCAAkC;IA4B1C,OAAO,CAAC,gCAAgC;IAYxC;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,2BAA2B;CASpC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,uCAAuC,EAAE,wCAAwC,CAAC;KACnF;CACF"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
var
|
|
1
|
+
var bt = (o) => {
|
|
2
2
|
throw TypeError(o);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var l = (o, n, c) => (
|
|
4
|
+
var dt = (o, n, c) => n.has(o) || bt("Cannot " + c);
|
|
5
|
+
var l = (o, n, c) => (dt(o, n, "read from private field"), c ? c.call(o) : n.get(o)), b = (o, n, c) => n.has(o) ? bt("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(o) : n.set(o, c), s = (o, n, c, h) => (dt(o, n, "write to private field"), h ? h.call(o, c) : n.set(o, c), c);
|
|
6
6
|
import { __runInitializers as i, __esDecorate as d } from "tslib";
|
|
7
7
|
import { SbbLanguageController as ut } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
8
|
import { forceType as _ } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
-
import { EventEmitter as
|
|
10
|
-
import { css as mt, LitElement as ft, nothing as
|
|
9
|
+
import { EventEmitter as vt } from "@sbb-esta/lyne-elements/core/eventing.js";
|
|
10
|
+
import { css as mt, LitElement as ft, nothing as E, html as g } from "lit";
|
|
11
11
|
import { customElement as pt, property as v } from "lit/decorators.js";
|
|
12
|
-
import { classMap as
|
|
13
|
-
import { getI18nSeatReservation as
|
|
12
|
+
import { classMap as ht } from "lit/directives/class-map.js";
|
|
13
|
+
import { getI18nSeatReservation as w } from "../../common/translations.js";
|
|
14
14
|
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
15
15
|
import "../seat-reservation-navigation-services.js";
|
|
16
16
|
const xt = mt`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-navigation-travelclass-spacing: .625rem;--sbb-seat-reservation-navigation-btn-outline-color: var(--sbb-color-granite);--sbb-seat-reservation-navigation-btn-outline-width: var(--sbb-border-width-1x);--sbb-seat-reservation-navigation-btn-background-color: var(--sbb-color-white);--sbb-seat-reservation-navigation-btn-outline-color-selected: var(--sbb-color-black);--sbb-seat-reservation-navigation-btn-outline-width-hover: var(--sbb-border-width-2x);--sbb-seat-reservation-navigation-btn-background-color-hover: var(--sbb-color-cloud)}.sbb-sr-navigation__item-coach{display:flex;flex-direction:column;gap:var(--sbb-spacing-fixed-2x);width:var(--sbb-train-formation-wagon-width);list-style-type:none}.sbb-sr-navigation__item-coach.first-coach .sbb-sr-navigation--first-class,.sbb-sr-navigation__item-coach.last-coach .sbb-sr-navigation--first-class{width:calc(100% - 1.125rem)}.sbb-sr-navigation__item-coach.first-coach .sbb-sr-navigation__ctrl-button:not(.sbb-seat-reservation-navigation-driver-area){border-start-start-radius:var(--sbb-border-radius-8x);border-end-start-radius:var(--sbb-border-radius-8x)}.sbb-sr-navigation__item-coach.first-coach .sbb-sr-navigation--first-class{margin-inline-start:var(--sbb-seat-reservation-navigation-travelclass-spacing)}.sbb-sr-navigation__item-coach.last-coach .sbb-sr-navigation__ctrl-button:not(.sbb-sr-navigation-driver-area){border-start-end-radius:var(--sbb-border-radius-8x);border-end-end-radius:var(--sbb-border-radius-8x)}.sbb-sr-navigation__item-coach.last-coach .sbb-sr-navigation__additional-information{padding-inline-end:var(--sbb-seat-reservation-navigation-travelclass-spacing)}.sbb-sr-navigation__item-coach.last-coach .sbb-sr-navigation--first-class{margin-inline-end:var(--sbb-seat-reservation-navigation-travelclass-spacing)}.sbb-sr-navigation__item-coach.vertical-coach{flex-direction:row}.sbb-sr-navigation__ctrl-button{-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;margin:0;outline:none;border:none;border-radius:0;padding:0;background:none;-webkit-tap-highlight-color:transparent;color:inherit;display:flex;flex-direction:column;justify-content:center;height:2.25rem;position:relative;outline:var(--sbb-seat-reservation-navigation-btn-outline-width) solid var(--sbb-seat-reservation-navigation-btn-outline-color);border-radius:var(--sbb-border-radius-2x);background-color:var(--sbb-seat-reservation-navigation-btn-background-color);cursor:pointer}.sbb-sr-navigation__ctrl-button.sbb-sr-navigation-driver-area{border-radius:var(--sbb-border-radius-8x);cursor:initial}.sbb-sr-navigation__item-coach--selected .sbb-sr-navigation__ctrl-button,.sbb-sr-navigation__ctrl-button:focus-visible:not([disabled],:disabled,.sbb-sr-navigation-driver-area),.sbb-sr-navigation__ctrl-button:hover:not([disabled],:disabled,.sbb-sr-navigation-driver-area){--sbb-seat-reservation-navigation-btn-outline-width: var( --sbb-seat-reservation-navigation-btn-outline-width-hover );--sbb-seat-reservation-navigation-btn-outline-color: var(--sbb-color-black)}.sbb-sr-navigation__ctrl-button:focus-visible:not([disabled],:disabled){--sbb-seat-reservation-navigation-btn-background-color: var(--sbb-color-silver)}.sbb-sr-navigation__ctrl-button:focus-visible:not([disabled],:disabled) .sbb-sr-navigation__item-coach-travelclass{background-color:var(--sbb-color-metal)}.sbb-sr-navigation__ctrl-button:focus-visible:not([disabled],:disabled) .sbb-sr-navigation__item-coach-number{color:var(--sbb-color-anthracite)}.sbb-sr-navigation__item-coach--selected .sbb-sr-navigation__ctrl-button{--sbb-seat-reservation-navigation-btn-background-color: var(--sbb-color-milk)}.sbb-sr-navigation__item-coach--selected .sbb-sr-navigation__ctrl-button .sbb-sr-navigation__item-coach-travelclass{background-color:var(--sbb-color-black)}.sbb-sr-navigation__item-coach--selected .sbb-sr-navigation__ctrl-button .sbb-sr-navigation__item-coach-number{color:var(--sbb-color-black)}.sbb-sr-navigation__ctrl-button:hover:not([disabled],:disabled,.sbb-sr-navigation-driver-area){--sbb-seat-reservation-navigation-btn-background-color: var(--sbb-color-cloud)}.sbb-sr-navigation__ctrl-button:hover:not([disabled],:disabled,.sbb-sr-navigation-driver-area) .sbb-sr-navigation__item-coach-travelclass{background-color:var(--sbb-color-smoke)}.sbb-sr-navigation__ctrl-button:hover:not([disabled],:disabled,.sbb-sr-navigation-driver-area) .sbb-sr-navigation__item-coach-number{color:var(--sbb-color-iron)}.sbb-sr-navigation__ctrl-button:is([disabled],:disabled){--sbb-seat-reservation-navigation-btn-background-color: var(--sbb-color-white);--sbb-seat-reservation-navigation-btn-outline-color: var(--sbb-color-platinum);cursor:unset;pointer-events:unset}.sbb-sr-navigation__ctrl-button:is([disabled],:disabled) .sbb-sr-navigation__item-coach-travelclass{background-color:var(--sbb-color-graphite)}.sbb-sr-navigation__ctrl-button:is([disabled],:disabled) .sbb-sr-navigation__item-coach-number{color:var(--sbb-color-graphite)}.sbb-sr-navigation__additional-information{display:flex;justify-content:space-between;align-items:center;flex:1;column-gap:var(--sbb-spacing-fixed-2x);padding-inline:1rem 1rem;font-family:var(--sbb-typo-font-family);font-weight:700;color:var(--sbb-color-granite)}@media (forced-colors: active){.sbb-sr-navigation__additional-information{color:var(--sbb-color-milk)}}.sbb-sr-navigation__item-coach-number{color:var(--sbb-color-granite)}@media (forced-colors: active){.sbb-sr-navigation__item-coach-number{color:var(--sbb-color-granite)}}@media (forced-colors: active) and (forced-colors: active){.sbb-sr-navigation__item-coach-number{color:inherit}}.sbb-sr-navigation__item-coach-number .sbb-sr-navigation__item-coach-travelclass{background-color:var(--sbb-color-charcoal)}.sbb-sr-navigation--first-class{width:calc(100% - .5rem);position:absolute;inset-block-start:.1875rem;inset-inline-start:.25rem;border:var(--sbb-border-width-1x) solid transparent;border-radius:var(--sbb-border-radius-1x);margin:auto;background-color:var(--sbb-color-lemon)}.sbb-sr-navigation__item-coach-travelclass{display:flex;align-items:center;justify-content:center;min-height:1.25rem;min-width:1.25rem;border-radius:var(--sbb-border-radius-1x);text-align:center;background-color:var(--sbb-color-granite);color:var(--sbb-color-white)}.sbb-sr-navigation__item-coach.vertical-coach .sbb-sr-navigation__ctrl-button{flex-direction:row-reverse;height:5rem;min-width:2.25rem}.sbb-sr-navigation__item-coach.vertical-coach .sbb-sr-navigation__additional-information{flex-direction:column-reverse;padding-block:1rem 1rem;padding-inline-start:unset;padding-inline-end:unset}.sbb-sr-navigation__item-coach.vertical-coach .sbb-sr-navigation--first-class{height:calc(100% - .5rem);width:initial;inset-inline-end:.1875rem;inset-block-start:.25rem;inset-inline-start:initial}.sbb-sr-navigation__item-coach.vertical-coach.first-coach .sbb-sr-navigation--first-class,.sbb-sr-navigation__item-coach.vertical-coach.last-coach .sbb-sr-navigation--first-class{height:calc(100% - 1.125rem)}.sbb-sr-navigation__item-coach.vertical-coach.first-coach:not(.last-coach) .sbb-sr-navigation__ctrl-button:not(.sbb-sr-navigation-driver-area){border-start-end-radius:var(--sbb-border-radius-8x);border-end-start-radius:var(--sbb-border-radius-2x)}.sbb-sr-navigation__item-coach.vertical-coach.first-coach:not(.last-coach) .sbb-sr-navigation--first-class{margin-block-start:var(--sbb-seat-reservation-navigation-travelclass-spacing);margin-inline-start:initial}.sbb-sr-navigation__item-coach.vertical-coach.last-coach:not(.first-coach) .sbb-sr-navigation__ctrl-button:not(.sbb-sr-navigation-driver-area){border-start-end-radius:var(--sbb-border-radius-2x);border-end-start-radius:var(--sbb-border-radius-8x)}.sbb-sr-navigation__item-coach.vertical-coach.last-coach:not(.first-coach) .sbb-sr-navigation--first-class{margin-block-end:var(--sbb-seat-reservation-navigation-travelclass-spacing);margin-inline-end:initial}.sbb-sr-navigation__item-coach.vertical-coach .sbb-sr-navigation-driver-area{height:5rem;min-width:2.25rem}`, yt = 3;
|
|
17
17
|
let Rt = (() => {
|
|
18
|
-
var m, f, p, x, y, C, I, k, S, A,
|
|
19
|
-
let o = [pt("sbb-seat-reservation-navigation-coach")], n, c = [], h,
|
|
20
|
-
var
|
|
18
|
+
var u, m, f, p, x, y, C, I, k, S, A, r;
|
|
19
|
+
let o = [pt("sbb-seat-reservation-navigation-coach")], n, c = [], h, N = ft, B, $ = [], T = [], R, D = [], O = [], L, V = [], j = [], H, G = [], K = [], U, q = [], F = [], M, Y = [], P = [], X, J = [], Q = [], W, Z = [], tt = [], at, et = [], st = [], it, rt = [], ot = [], nt, ct = [], lt = [];
|
|
20
|
+
var z = (r = class extends N {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
|
+
b(this, u);
|
|
23
24
|
b(this, m);
|
|
24
25
|
b(this, f);
|
|
25
26
|
b(this, p);
|
|
@@ -30,94 +31,92 @@ let Rt = (() => {
|
|
|
30
31
|
b(this, k);
|
|
31
32
|
b(this, S);
|
|
32
33
|
b(this, A);
|
|
33
|
-
|
|
34
|
-
s(this, m, i(this, T, "")), s(this, f, (i(this, R), i(this, O, []))), s(this, p, (i(this, L), i(this, j, !1))), s(this, x, (i(this, H), i(this, K, !1))), s(this, y, (i(this, U), i(this, F, 0))), s(this, C, (i(this, M), i(this, P, ["ANY_CLASS"]))), s(this, I, (i(this, X), i(this, Q, !1))), s(this, k, (i(this, W), i(this, tt, !1))), s(this, S, (i(this, at), i(this, st, !1))), s(this, A, (i(this, it), i(this, ot, !1))), s(this, w, (i(this, nt), i(this, lt, !1))), this._language = (i(this, bt), new ut(this)), this.selectNavCoach = new ht(this, N.events.selectCoach), this.focusNavCoach = new ht(this, N.events.focusCoach);
|
|
34
|
+
s(this, u, i(this, $, "")), s(this, m, (i(this, T), i(this, D, []))), s(this, f, (i(this, O), i(this, V, !1))), s(this, p, (i(this, j), i(this, G, !1))), s(this, x, (i(this, K), i(this, q, 0))), s(this, y, (i(this, F), i(this, Y, ["ANY_CLASS"]))), s(this, C, (i(this, P), i(this, J, !1))), s(this, I, (i(this, Q), i(this, Z, !1))), s(this, k, (i(this, tt), i(this, et, !1))), s(this, S, (i(this, st), i(this, rt, !1))), s(this, A, (i(this, ot), i(this, ct, !1))), this._language = (i(this, lt), new ut(this)), this.selectNavCoach = new vt(this, z.events.selectCoach), this.focusNavCoach = new vt(this, z.events.focusCoach);
|
|
35
35
|
}
|
|
36
36
|
/** Coach ID, which is used to identify the coach in the navigation */
|
|
37
37
|
get coachId() {
|
|
38
|
-
return l(this,
|
|
38
|
+
return l(this, u);
|
|
39
39
|
}
|
|
40
40
|
set coachId(a) {
|
|
41
|
-
s(this,
|
|
41
|
+
s(this, u, a);
|
|
42
42
|
}
|
|
43
43
|
/** Coach service property ids, which are used to display the services in the navigation */
|
|
44
44
|
get propertyIds() {
|
|
45
|
-
return l(this,
|
|
45
|
+
return l(this, m);
|
|
46
46
|
}
|
|
47
47
|
set propertyIds(a) {
|
|
48
|
-
s(this,
|
|
48
|
+
s(this, m, a);
|
|
49
49
|
}
|
|
50
50
|
/* pre-selected Coach index property */
|
|
51
51
|
get selected() {
|
|
52
|
-
return l(this,
|
|
52
|
+
return l(this, f);
|
|
53
53
|
}
|
|
54
54
|
set selected(a) {
|
|
55
|
-
s(this,
|
|
55
|
+
s(this, f, a);
|
|
56
56
|
}
|
|
57
57
|
/* focus Coach index property */
|
|
58
58
|
get focused() {
|
|
59
|
-
return l(this,
|
|
59
|
+
return l(this, p);
|
|
60
60
|
}
|
|
61
61
|
set focused(a) {
|
|
62
|
-
s(this,
|
|
62
|
+
s(this, p, a);
|
|
63
63
|
}
|
|
64
64
|
get index() {
|
|
65
|
-
return l(this,
|
|
65
|
+
return l(this, x);
|
|
66
66
|
}
|
|
67
67
|
set index(a) {
|
|
68
|
-
s(this,
|
|
68
|
+
s(this, x, a);
|
|
69
69
|
}
|
|
70
70
|
/** Travel class of the coach */
|
|
71
71
|
get travelClass() {
|
|
72
|
-
return l(this,
|
|
72
|
+
return l(this, y);
|
|
73
73
|
}
|
|
74
74
|
set travelClass(a) {
|
|
75
|
-
s(this,
|
|
75
|
+
s(this, y, a);
|
|
76
76
|
}
|
|
77
77
|
/** If the coach is a driver/restricted area */
|
|
78
78
|
get driverArea() {
|
|
79
|
-
return l(this,
|
|
79
|
+
return l(this, C);
|
|
80
80
|
}
|
|
81
81
|
set driverArea(a) {
|
|
82
|
-
s(this,
|
|
82
|
+
s(this, C, a);
|
|
83
83
|
}
|
|
84
84
|
/** If the coach is the first in the navigation */
|
|
85
85
|
get first() {
|
|
86
|
-
return l(this,
|
|
86
|
+
return l(this, I);
|
|
87
87
|
}
|
|
88
88
|
set first(a) {
|
|
89
|
-
s(this,
|
|
89
|
+
s(this, I, a);
|
|
90
90
|
}
|
|
91
91
|
/** If the coach is the last in the navigation */
|
|
92
92
|
get last() {
|
|
93
|
-
return l(this,
|
|
93
|
+
return l(this, k);
|
|
94
94
|
}
|
|
95
95
|
set last(a) {
|
|
96
|
-
s(this,
|
|
96
|
+
s(this, k, a);
|
|
97
97
|
}
|
|
98
98
|
/** Disable the coach navigation */
|
|
99
99
|
get disable() {
|
|
100
|
-
return l(this,
|
|
100
|
+
return l(this, S);
|
|
101
101
|
}
|
|
102
102
|
set disable(a) {
|
|
103
|
-
s(this,
|
|
103
|
+
s(this, S, a);
|
|
104
104
|
}
|
|
105
105
|
/** If the coach navigation should be displayed vertically */
|
|
106
106
|
get vertical() {
|
|
107
|
-
return l(this,
|
|
107
|
+
return l(this, A);
|
|
108
108
|
}
|
|
109
109
|
set vertical(a) {
|
|
110
|
-
s(this,
|
|
110
|
+
s(this, A, a);
|
|
111
111
|
}
|
|
112
112
|
willUpdate(a) {
|
|
113
|
-
var t, e;
|
|
114
113
|
if (super.willUpdate(a), a.has("selected")) {
|
|
115
|
-
const
|
|
116
|
-
this.selected &&
|
|
114
|
+
const t = this.shadowRoot?.querySelector(".sbb-sr-navigation__ctrl-button");
|
|
115
|
+
this.selected && t && (t.focus(), this.focusNavCoach.emit());
|
|
117
116
|
}
|
|
118
117
|
if (a.has("focused") && this.focused) {
|
|
119
|
-
const
|
|
120
|
-
|
|
118
|
+
const t = this.shadowRoot?.querySelector(".sbb-sr-navigation__ctrl-button");
|
|
119
|
+
t && t.focus();
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
/**
|
|
@@ -128,10 +127,9 @@ let Rt = (() => {
|
|
|
128
127
|
* @protected
|
|
129
128
|
*/
|
|
130
129
|
render() {
|
|
131
|
-
|
|
132
|
-
return this.propertyIds = this.propertyIds.filter((t) => t !== "ANY_SEAT").slice(0, yt), u`
|
|
130
|
+
return this.propertyIds = this.propertyIds.filter((a) => a !== "ANY_SEAT").slice(0, yt), g`
|
|
133
131
|
<div
|
|
134
|
-
class="${
|
|
132
|
+
class="${ht({
|
|
135
133
|
"sbb-sr-navigation__item-coach": !0,
|
|
136
134
|
"last-coach": this.last,
|
|
137
135
|
"first-coach": this.first,
|
|
@@ -140,19 +138,19 @@ let Rt = (() => {
|
|
|
140
138
|
})}"
|
|
141
139
|
>
|
|
142
140
|
${this._getNavigationButton()}
|
|
143
|
-
${
|
|
141
|
+
${this.propertyIds?.length ? g`<sbb-seat-reservation-navigation-services
|
|
144
142
|
?vertical="${this.vertical}"
|
|
145
143
|
.propertyIds="${this.propertyIds}"
|
|
146
|
-
></sbb-seat-reservation-navigation-services>` :
|
|
144
|
+
></sbb-seat-reservation-navigation-services>` : E}
|
|
147
145
|
</div>
|
|
148
146
|
`;
|
|
149
147
|
}
|
|
150
148
|
_getNavigationButton() {
|
|
151
149
|
const a = this._getCoachServiceClassNumber(), t = this._getTitleDescriptionNavCoachButton(a), e = this._getAriaDescriptionCoachServices();
|
|
152
|
-
return
|
|
150
|
+
return g` <button
|
|
153
151
|
type="button"
|
|
154
152
|
?disabled="${this.disable}"
|
|
155
|
-
class="${
|
|
153
|
+
class="${ht({
|
|
156
154
|
"sbb-sr-navigation__ctrl-button": !0,
|
|
157
155
|
"sbb-sr-navigation-driver-area": this.driverArea
|
|
158
156
|
})}"
|
|
@@ -167,38 +165,37 @@ let Rt = (() => {
|
|
|
167
165
|
>`;
|
|
168
166
|
}
|
|
169
167
|
_getBtnInformation(a) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
${
|
|
173
|
-
|
|
174
|
-
${this.coachId ? u`<div class="sbb-sr-navigation__item-coach-number" aria-hidden="true">
|
|
168
|
+
return this.driverArea ? null : g`
|
|
169
|
+
${a === 1 ? g`<span class="sbb-sr-navigation--first-class"></span>` : E}
|
|
170
|
+
${this.travelClass?.length > 0 || this.coachId ? g`<div class="sbb-sr-navigation__additional-information">
|
|
171
|
+
${this.coachId ? g`<div class="sbb-sr-navigation__item-coach-number" aria-hidden="true">
|
|
175
172
|
${this.coachId}
|
|
176
|
-
</div>` :
|
|
173
|
+
</div>` : E}
|
|
177
174
|
<div
|
|
178
|
-
${a ??
|
|
175
|
+
${a ?? E}
|
|
179
176
|
class="sbb-sr-navigation__item-coach-travelclass"
|
|
180
177
|
aria-hidden="true"
|
|
181
178
|
>
|
|
182
179
|
${a}
|
|
183
180
|
</div>
|
|
184
|
-
</div>` :
|
|
181
|
+
</div>` : E}
|
|
185
182
|
`;
|
|
186
183
|
}
|
|
187
184
|
_getTitleDescriptionNavCoachButton(a) {
|
|
188
185
|
if (this.driverArea)
|
|
189
|
-
return
|
|
186
|
+
return w("NAVIGATE_COACH_BLOCKED", this._language.current, [
|
|
190
187
|
this.coachId
|
|
191
188
|
]);
|
|
192
|
-
let t =
|
|
189
|
+
let t = w("NAVIGATE_TO_COACH", this._language.current, [this.coachId]);
|
|
193
190
|
if (a) {
|
|
194
|
-
const
|
|
191
|
+
const _t = w(a === 1 ? "SERVICE_CLASS_FIRST" : "SERVICE_CLASS_SECOND", this._language.current), gt = w("NAVIGATE_TO_COACH_SERVICE_CLASS_SUB", this._language.current, [_t]);
|
|
195
192
|
t = t.concat(gt);
|
|
196
193
|
}
|
|
197
194
|
return t;
|
|
198
195
|
}
|
|
199
196
|
_getAriaDescriptionCoachServices() {
|
|
200
197
|
let a = null;
|
|
201
|
-
return this.propertyIds.length && (a =
|
|
198
|
+
return this.propertyIds.length && (a = w("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", a += this.propertyIds.map((t) => w(t, this._language.current)).join()), a;
|
|
202
199
|
}
|
|
203
200
|
/**
|
|
204
201
|
* emits the index of the coach array for the main navigation.
|
|
@@ -209,39 +206,38 @@ let Rt = (() => {
|
|
|
209
206
|
this.driverArea || this.selectNavCoach.emit(a);
|
|
210
207
|
}
|
|
211
208
|
_getCoachServiceClassNumber() {
|
|
212
|
-
|
|
213
|
-
return (a = this.travelClass) != null && a.includes("FIRST") ? 1 : (t = this.travelClass) != null && t.includes("SECOND") ? 2 : null;
|
|
209
|
+
return this.travelClass?.includes("FIRST") ? 1 : this.travelClass?.includes("SECOND") ? 2 : null;
|
|
214
210
|
}
|
|
215
|
-
}, m = new WeakMap(), f = new WeakMap(), p = new WeakMap(), x = new WeakMap(), y = new WeakMap(), C = new WeakMap(), I = new WeakMap(), k = new WeakMap(), S = new WeakMap(), A = new WeakMap(),
|
|
216
|
-
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
217
|
-
|
|
211
|
+
}, u = new WeakMap(), m = new WeakMap(), f = new WeakMap(), p = new WeakMap(), x = new WeakMap(), y = new WeakMap(), C = new WeakMap(), I = new WeakMap(), k = new WeakMap(), S = new WeakMap(), A = new WeakMap(), h = r, (() => {
|
|
212
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(N[Symbol.metadata] ?? null) : void 0;
|
|
213
|
+
B = [_(), v({ attribute: "coach-id" })], R = [v({ attribute: "property-ids", type: Array })], L = [_(), v({ type: Boolean })], H = [_(), v({ type: Boolean })], U = [_(), v({ type: Number })], M = [v({ attribute: "travel-class", type: Array })], X = [_(), v({ attribute: "driver-area", type: Boolean })], W = [_(), v({ type: Boolean })], at = [_(), v({ type: Boolean })], it = [_(), v({ attribute: "disable", type: Boolean })], nt = [_(), v({ type: Boolean })], d(r, null, B, { kind: "accessor", name: "coachId", static: !1, private: !1, access: { has: (t) => "coachId" in t, get: (t) => t.coachId, set: (t, e) => {
|
|
218
214
|
t.coachId = e;
|
|
219
|
-
} }, metadata: a }, T
|
|
215
|
+
} }, metadata: a }, $, T), d(r, null, R, { kind: "accessor", name: "propertyIds", static: !1, private: !1, access: { has: (t) => "propertyIds" in t, get: (t) => t.propertyIds, set: (t, e) => {
|
|
220
216
|
t.propertyIds = e;
|
|
221
|
-
} }, metadata: a },
|
|
217
|
+
} }, metadata: a }, D, O), d(r, null, L, { kind: "accessor", name: "selected", static: !1, private: !1, access: { has: (t) => "selected" in t, get: (t) => t.selected, set: (t, e) => {
|
|
222
218
|
t.selected = e;
|
|
223
|
-
} }, metadata: a },
|
|
219
|
+
} }, metadata: a }, V, j), d(r, null, H, { kind: "accessor", name: "focused", static: !1, private: !1, access: { has: (t) => "focused" in t, get: (t) => t.focused, set: (t, e) => {
|
|
224
220
|
t.focused = e;
|
|
225
|
-
} }, metadata: a },
|
|
221
|
+
} }, metadata: a }, G, K), d(r, null, U, { kind: "accessor", name: "index", static: !1, private: !1, access: { has: (t) => "index" in t, get: (t) => t.index, set: (t, e) => {
|
|
226
222
|
t.index = e;
|
|
227
|
-
} }, metadata: a },
|
|
223
|
+
} }, metadata: a }, q, F), d(r, null, M, { kind: "accessor", name: "travelClass", static: !1, private: !1, access: { has: (t) => "travelClass" in t, get: (t) => t.travelClass, set: (t, e) => {
|
|
228
224
|
t.travelClass = e;
|
|
229
|
-
} }, metadata: a },
|
|
225
|
+
} }, metadata: a }, Y, P), d(r, null, X, { kind: "accessor", name: "driverArea", static: !1, private: !1, access: { has: (t) => "driverArea" in t, get: (t) => t.driverArea, set: (t, e) => {
|
|
230
226
|
t.driverArea = e;
|
|
231
|
-
} }, metadata: a },
|
|
227
|
+
} }, metadata: a }, J, Q), d(r, null, W, { kind: "accessor", name: "first", static: !1, private: !1, access: { has: (t) => "first" in t, get: (t) => t.first, set: (t, e) => {
|
|
232
228
|
t.first = e;
|
|
233
|
-
} }, metadata: a },
|
|
229
|
+
} }, metadata: a }, Z, tt), d(r, null, at, { kind: "accessor", name: "last", static: !1, private: !1, access: { has: (t) => "last" in t, get: (t) => t.last, set: (t, e) => {
|
|
234
230
|
t.last = e;
|
|
235
|
-
} }, metadata: a },
|
|
231
|
+
} }, metadata: a }, et, st), d(r, null, it, { kind: "accessor", name: "disable", static: !1, private: !1, access: { has: (t) => "disable" in t, get: (t) => t.disable, set: (t, e) => {
|
|
236
232
|
t.disable = e;
|
|
237
|
-
} }, metadata: a },
|
|
233
|
+
} }, metadata: a }, rt, ot), d(r, null, nt, { kind: "accessor", name: "vertical", static: !1, private: !1, access: { has: (t) => "vertical" in t, get: (t) => t.vertical, set: (t, e) => {
|
|
238
234
|
t.vertical = e;
|
|
239
|
-
} }, metadata: a },
|
|
235
|
+
} }, metadata: a }, ct, lt), d(null, n = { value: h }, o, { kind: "class", name: h.name, metadata: a }, null, c), z = h = n.value, a && Object.defineProperty(h, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
240
236
|
})(), r.styles = xt, r.events = {
|
|
241
237
|
selectCoach: "selectCoach",
|
|
242
238
|
focusCoach: "focusCoach"
|
|
243
239
|
}, i(h, c), r);
|
|
244
|
-
return
|
|
240
|
+
return z = h;
|
|
245
241
|
})();
|
|
246
242
|
export {
|
|
247
243
|
Rt as SbbSeatReservationNavigationCoachElement
|
package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-reservation-navigation-coach.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.ts"],"names":[],"mappings":"AAAA,cAAc,oFAAoF,CAAC"}
|
|
1
|
+
{"version":3,"file":"seat-reservation-navigation-coach.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oFAAoF,CAAC"}
|