@sbb-esta/lyne-elements-experimental 2.11.1 → 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/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.js +14 -16
- 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/seat-reservation/seat-reservation-base-element.js +22 -33
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +6 -7
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +16 -23
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +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-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +7 -11
- 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-place-control/seat-reservation-place-control.component.js +4 -5
- 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/isValid-Ceq2O0NQ.js +45 -0
- package/journey-summary/journey-summary.component.js +3 -4
- package/package.json +2 -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.js +50 -54
- package/seat-reservation/common/translations/i18n.js +5 -6
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +104 -115
- package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +40 -41
- package/seat-reservation/seat-reservation/seat-reservation.component.js +78 -87
- 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-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +71 -75
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +12 -13
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +23 -24
- package/timetable-row/timetable-row.component.js +207 -247
- package/differenceInMinutes-BMqUZdhj.js +0 -23
- package/isValid-DJ69OMZJ.js +0 -45
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
1
|
+
var J = (s) => {
|
|
2
2
|
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var o = (s,
|
|
6
|
-
import { __esDecorate as _, __runInitializers as
|
|
4
|
+
var K = (s, i, l) => i.has(s) || J("Cannot " + l);
|
|
5
|
+
var o = (s, i, l) => (K(s, i, "read from private field"), l ? l.call(s) : i.get(s)), h = (s, i, l) => i.has(s) ? J("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, l), d = (s, i, l, c) => (K(s, i, "write to private field"), c ? c.call(s, l) : i.set(s, l), l);
|
|
6
|
+
import { __esDecorate as _, __runInitializers as a } from "tslib";
|
|
7
7
|
import { forceType as p } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
8
|
-
import { css as
|
|
9
|
-
import { customElement as
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
var I, u, m, g, z, f, S,
|
|
13
|
-
let s = [
|
|
14
|
-
return
|
|
8
|
+
import { css as N, LitElement as Q, html as M } from "lit";
|
|
9
|
+
import { customElement as V, property as b } from "lit/decorators.js";
|
|
10
|
+
const W = N`*,:before,:after{box-sizing:border-box}:host{display:block}:host .coach-border,:host .coach-wrapper,:host .graphical-element{width:var(--sbb-seat-reservation-scoped-width);height:var(--sbb-seat-reservation-scoped-height);inset-block-start:var(--sbb-seat-reservation-scoped-inset-block-start);inset-inline-start:var(--sbb-seat-reservation-scoped-inset-inline-start);z-index:var(--sbb-seat-reservation-scoped-z-index)}:host .coach-border,:host .graphical-element ::slotted(*),:host .graphical-element{position:absolute}:host .coach-border{z-index:0}`;
|
|
11
|
+
let it = (() => {
|
|
12
|
+
var I, u, m, g, z, f, S, r;
|
|
13
|
+
let s = [V("sbb-seat-reservation-scoped")], i, l = [], c, v = Q, x, k = [], y = [], w, B = [], C = [], $, E = [], D = [], j, O = [], T = [], U, L = [], P = [], R, q = [], A = [], F, G = [], H = [];
|
|
14
|
+
return r = class extends v {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
|
-
h(this, I,
|
|
18
|
-
h(this, u, (
|
|
19
|
-
h(this, m, (
|
|
20
|
-
h(this, g, (
|
|
21
|
-
h(this, z, (
|
|
22
|
-
h(this, f, (
|
|
23
|
-
h(this, S, (
|
|
24
|
-
|
|
17
|
+
h(this, I, a(this, k, ""));
|
|
18
|
+
h(this, u, (a(this, y), a(this, B, "")));
|
|
19
|
+
h(this, m, (a(this, C), a(this, E, "")));
|
|
20
|
+
h(this, g, (a(this, D), a(this, O, "")));
|
|
21
|
+
h(this, z, (a(this, T), a(this, L, "")));
|
|
22
|
+
h(this, f, (a(this, P), a(this, q, "")));
|
|
23
|
+
h(this, S, (a(this, A), a(this, G, "")));
|
|
24
|
+
a(this, H);
|
|
25
25
|
}
|
|
26
26
|
/** Inset block start in pixels (without unit) */
|
|
27
27
|
get insetBlockStart() {
|
|
@@ -73,35 +73,34 @@ let lt = (() => {
|
|
|
73
73
|
d(this, S, e);
|
|
74
74
|
}
|
|
75
75
|
willUpdate(e) {
|
|
76
|
-
|
|
77
|
-
super.willUpdate(e), e.has("width") && ((t = this.style) == null || t.setProperty("--sbb-seat-reservation-scoped-width", `${this.width}`)), e.has("height") && ((i = this.style) == null || i.setProperty("--sbb-seat-reservation-scoped-height", `${this.height}`)), e.has("insetBlockStart") && ((J = this.style) == null || J.setProperty("--sbb-seat-reservation-scoped-inset-block-start", `${this.insetBlockStart}`)), e.has("insetInlineStart") && ((K = this.style) == null || K.setProperty("--sbb-seat-reservation-scoped-inset-inline-start", `${this.insetInlineStart}`)), e.has("zIndex") && ((M = this.style) == null || M.setProperty("--sbb-seat-reservation-scoped-z-index", `${this.zIndex}`));
|
|
76
|
+
super.willUpdate(e), e.has("width") && this.style?.setProperty("--sbb-seat-reservation-scoped-width", `${this.width}`), e.has("height") && this.style?.setProperty("--sbb-seat-reservation-scoped-height", `${this.height}`), e.has("insetBlockStart") && this.style?.setProperty("--sbb-seat-reservation-scoped-inset-block-start", `${this.insetBlockStart}`), e.has("insetInlineStart") && this.style?.setProperty("--sbb-seat-reservation-scoped-inset-inline-start", `${this.insetInlineStart}`), e.has("zIndex") && this.style?.setProperty("--sbb-seat-reservation-scoped-z-index", `${this.zIndex}`);
|
|
78
77
|
}
|
|
79
78
|
render() {
|
|
80
|
-
return this.cellId ?
|
|
79
|
+
return this.cellId ? M`<td id="${this.cellId}" class="${this.scopedClasses}">
|
|
81
80
|
<slot></slot>
|
|
82
|
-
</td>` :
|
|
81
|
+
</td>` : M`<div class="${this.scopedClasses}">
|
|
83
82
|
<slot></slot>
|
|
84
83
|
</div>`;
|
|
85
84
|
}
|
|
86
|
-
}, I = new WeakMap(), u = new WeakMap(), m = new WeakMap(), g = new WeakMap(), z = new WeakMap(), f = new WeakMap(), S = new WeakMap(), c =
|
|
85
|
+
}, I = new WeakMap(), u = new WeakMap(), m = new WeakMap(), g = new WeakMap(), z = new WeakMap(), f = new WeakMap(), S = new WeakMap(), c = r, (() => {
|
|
87
86
|
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(v[Symbol.metadata] ?? null) : void 0;
|
|
88
|
-
x = [p(), b({ attribute: "inset-block-start" })], w = [p(), b({ attribute: "inset-inline-start" })], $ = [p(), b({ attribute: "width" })], j = [p(), b({ attribute: "height" })], U = [p(), b({ attribute: "z-index" })], R = [p(), b({ attribute: "cell-id" })], F = [p(), b({ attribute: "scoped-classes" })], _(
|
|
89
|
-
t.insetBlockStart =
|
|
90
|
-
} }, metadata: e }, k, y), _(
|
|
91
|
-
t.insetInlineStart =
|
|
92
|
-
} }, metadata: e }, B, C), _(
|
|
93
|
-
t.width =
|
|
94
|
-
} }, metadata: e }, E, D), _(
|
|
95
|
-
t.height =
|
|
96
|
-
} }, metadata: e }, O, T), _(
|
|
97
|
-
t.zIndex =
|
|
98
|
-
} }, metadata: e }, L, P), _(
|
|
99
|
-
t.cellId =
|
|
100
|
-
} }, metadata: e }, q, A), _(
|
|
101
|
-
t.scopedClasses =
|
|
102
|
-
} }, metadata: e }, G, H), _(null,
|
|
103
|
-
})(),
|
|
87
|
+
x = [p(), b({ attribute: "inset-block-start" })], w = [p(), b({ attribute: "inset-inline-start" })], $ = [p(), b({ attribute: "width" })], j = [p(), b({ attribute: "height" })], U = [p(), b({ attribute: "z-index" })], R = [p(), b({ attribute: "cell-id" })], F = [p(), b({ attribute: "scoped-classes" })], _(r, null, x, { kind: "accessor", name: "insetBlockStart", static: !1, private: !1, access: { has: (t) => "insetBlockStart" in t, get: (t) => t.insetBlockStart, set: (t, n) => {
|
|
88
|
+
t.insetBlockStart = n;
|
|
89
|
+
} }, metadata: e }, k, y), _(r, null, w, { kind: "accessor", name: "insetInlineStart", static: !1, private: !1, access: { has: (t) => "insetInlineStart" in t, get: (t) => t.insetInlineStart, set: (t, n) => {
|
|
90
|
+
t.insetInlineStart = n;
|
|
91
|
+
} }, metadata: e }, B, C), _(r, null, $, { kind: "accessor", name: "width", static: !1, private: !1, access: { has: (t) => "width" in t, get: (t) => t.width, set: (t, n) => {
|
|
92
|
+
t.width = n;
|
|
93
|
+
} }, metadata: e }, E, D), _(r, null, j, { kind: "accessor", name: "height", static: !1, private: !1, access: { has: (t) => "height" in t, get: (t) => t.height, set: (t, n) => {
|
|
94
|
+
t.height = n;
|
|
95
|
+
} }, metadata: e }, O, T), _(r, null, U, { kind: "accessor", name: "zIndex", static: !1, private: !1, access: { has: (t) => "zIndex" in t, get: (t) => t.zIndex, set: (t, n) => {
|
|
96
|
+
t.zIndex = n;
|
|
97
|
+
} }, metadata: e }, L, P), _(r, null, R, { kind: "accessor", name: "cellId", static: !1, private: !1, access: { has: (t) => "cellId" in t, get: (t) => t.cellId, set: (t, n) => {
|
|
98
|
+
t.cellId = n;
|
|
99
|
+
} }, metadata: e }, q, A), _(r, null, F, { kind: "accessor", name: "scopedClasses", static: !1, private: !1, access: { has: (t) => "scopedClasses" in t, get: (t) => t.scopedClasses, set: (t, n) => {
|
|
100
|
+
t.scopedClasses = n;
|
|
101
|
+
} }, metadata: e }, G, H), _(null, i = { value: c }, s, { kind: "class", name: c.name, metadata: e }, null, l), c = i.value, e && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
102
|
+
})(), r.styles = W, a(c, l), c;
|
|
104
103
|
})();
|
|
105
104
|
export {
|
|
106
|
-
|
|
105
|
+
it as SbbSeatReservationScopedElement
|
|
107
106
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var U = (r) => {
|
|
2
|
+
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var R = (
|
|
4
|
+
var q = (r, o, l) => o.has(r) || U("Cannot " + l);
|
|
5
|
+
var R = (r, o, l) => (q(r, o, "read from private field"), l ? l.call(r) : o.get(r)), x = (r, o, l) => o.has(r) ? U("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(r) : o.set(r, l), b = (r, o, l, u) => (q(r, o, "write to private field"), u ? u.call(r, l) : o.set(r, l), l);
|
|
6
6
|
import { __runInitializers as p, __esDecorate as S } from "tslib";
|
|
7
|
-
import { SbbLanguageController as
|
|
7
|
+
import { SbbLanguageController as K } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
8
|
import { forceType as P } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
-
import { css as
|
|
10
|
-
import { customElement as
|
|
11
|
-
import { classMap as
|
|
12
|
-
import { styleMap as
|
|
9
|
+
import { css as X, html as d, nothing as A } from "lit";
|
|
10
|
+
import { customElement as J, property as y } from "lit/decorators.js";
|
|
11
|
+
import { classMap as Y } from "lit/directives/class-map.js";
|
|
12
|
+
import { styleMap as Q } from "lit/directives/style-map.js";
|
|
13
13
|
import { getI18nSeatReservation as _ } from "../common.js";
|
|
14
|
-
import { SeatReservationBaseElement as
|
|
14
|
+
import { SeatReservationBaseElement as Z } from "./seat-reservation-base-element.js";
|
|
15
15
|
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
16
16
|
import "../seat-reservation-area.js";
|
|
17
17
|
import "../seat-reservation-graphic.js";
|
|
18
18
|
import "../seat-reservation-place-control.js";
|
|
19
19
|
import "../seat-reservation-navigation/seat-reservation-navigation-coach.js";
|
|
20
20
|
import "./seat-reservation-scoped/seat-reservation-scoped.component.js";
|
|
21
|
-
const
|
|
21
|
+
const ee = X`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-vertical-offset: 0;display:block}:host ::part(coach-floor){fill:var(--sbb-color-white)}@media (forced-colors: active){:host ::part(coach-floor){fill:transparent}}.sbb-sr__wrapper--vertical{width:fit-content;position:relative;inset-inline-start:var(--sbb-seat-reservation-vertical-offset);rotate:90deg;transform-origin:top left}.sbb-sr__wrapper--vertical .sbb-sr__parent{overflow-y:hidden}.sbb-sr__wrapper--vertical .sbb-sr__list-coaches{width:100vw}.sbb-sr-navigation--vertical{inset-inline-start:var(--sbb-seat-reservation-vertical-offset);margin-inline-start:1.25rem;position:absolute}.sbb-sr-navigation--vertical .sbb-sr-navigation__list-coaches{flex-direction:column}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;justify-content:center;flex-wrap:nowrap;gap:var(--sbb-spacing-fixed-1x);min-height:3.75rem}.sbb-sr__parent{overflow-x:scroll;padding:3rem 0}.sbb-sr__list-coaches{display:flex;gap:.25rem;padding:0;margin:0;list-style:none}.sbb-sr__item-coach{padding:0;margin:0;position:relative}.sbb-sr-coach-wrapper__table{outline:0}`;
|
|
22
22
|
let me = (() => {
|
|
23
|
-
var g,
|
|
24
|
-
let
|
|
25
|
-
return
|
|
23
|
+
var g, m, f, $, C, c;
|
|
24
|
+
let r = [J("sbb-seat-reservation")], o, l = [], u, N = Z, T, z = [], O = [], E, k = [], D = [], G, I = [], V = [], B, L = [], F = [], M, H = [], W = [];
|
|
25
|
+
return c = class extends N {
|
|
26
26
|
constructor() {
|
|
27
27
|
super(...arguments);
|
|
28
28
|
x(this, g);
|
|
29
|
-
x(this, f);
|
|
30
29
|
x(this, m);
|
|
30
|
+
x(this, f);
|
|
31
31
|
x(this, $);
|
|
32
32
|
x(this, C);
|
|
33
|
-
b(this, g, p(this, z, null)), b(this,
|
|
33
|
+
b(this, g, p(this, z, null)), b(this, m, (p(this, O), p(this, k, !0))), b(this, f, (p(this, D), p(this, I, !1))), b(this, $, (p(this, V), p(this, L, null))), b(this, C, (p(this, F), p(this, H, !1))), this._language = (p(this, W), new K(this)), this._notAreaElements = [
|
|
34
34
|
"DRIVER_AREA_FULL",
|
|
35
35
|
"COACH_PASSAGE",
|
|
36
36
|
"COACH_WALL_NO_PASSAGE",
|
|
@@ -49,17 +49,17 @@ let me = (() => {
|
|
|
49
49
|
}
|
|
50
50
|
/** The seat reservation navigation can be toggled by this property */
|
|
51
51
|
get hasNavigation() {
|
|
52
|
-
return R(this,
|
|
52
|
+
return R(this, m);
|
|
53
53
|
}
|
|
54
54
|
set hasNavigation(e) {
|
|
55
|
-
b(this,
|
|
55
|
+
b(this, m, e);
|
|
56
56
|
}
|
|
57
57
|
/** Controls the visual representation of seat reservation in a horizonal or vertical alignment */
|
|
58
58
|
get alignVertical() {
|
|
59
|
-
return R(this,
|
|
59
|
+
return R(this, f);
|
|
60
60
|
}
|
|
61
61
|
set alignVertical(e) {
|
|
62
|
-
b(this,
|
|
62
|
+
b(this, f, e);
|
|
63
63
|
}
|
|
64
64
|
/** Maximal number of possible clickable seats */
|
|
65
65
|
get maxReservations() {
|
|
@@ -76,8 +76,7 @@ let me = (() => {
|
|
|
76
76
|
b(this, C, e);
|
|
77
77
|
}
|
|
78
78
|
willUpdate(e) {
|
|
79
|
-
|
|
80
|
-
super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? (t = this.shadowRoot) == null || t.querySelectorAll("table").forEach((s) => s.removeAttribute("tabindex")) : (i = this.shadowRoot) == null || i.querySelectorAll("table").forEach((s) => s.setAttribute("tabindex", "0")));
|
|
79
|
+
super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((t) => t.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((t) => t.setAttribute("tabindex", "0")));
|
|
81
80
|
}
|
|
82
81
|
firstUpdated(e) {
|
|
83
82
|
super.firstUpdated(e), this._componentSetup();
|
|
@@ -89,9 +88,8 @@ let me = (() => {
|
|
|
89
88
|
this.initNavigationSelectionByScrollEvent();
|
|
90
89
|
}
|
|
91
90
|
_initVehicleSeatReservationConstruction() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this._coachesHtmlTemplate = h`
|
|
91
|
+
const e = JSON.parse(JSON.stringify(this.seatReservation?.coachItems)), t = this.alignVertical ? "sbb-sr__wrapper--vertical" : "";
|
|
92
|
+
this._coachesHtmlTemplate = d`
|
|
95
93
|
<div>
|
|
96
94
|
<sbb-screen-reader-only>
|
|
97
95
|
<input
|
|
@@ -103,7 +101,7 @@ let me = (() => {
|
|
|
103
101
|
/>
|
|
104
102
|
</sbb-screen-reader-only>
|
|
105
103
|
|
|
106
|
-
<div @keydown=${(
|
|
104
|
+
<div @keydown=${(i) => this.handleKeyboardEvent(i)}>
|
|
107
105
|
${this._renderNavigation()}
|
|
108
106
|
<div class="sbb-sr__wrapper ${t}">
|
|
109
107
|
<div id="sbb-sr__parent-area" class="sbb-sr__parent" tabindex="-1">
|
|
@@ -127,33 +125,29 @@ let me = (() => {
|
|
|
127
125
|
`;
|
|
128
126
|
}
|
|
129
127
|
_renderNavigation() {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<nav class="${Q({ "sbb-sr-navigation--vertical": this.alignVertical })}">
|
|
128
|
+
return this.hasNavigation ? d`
|
|
129
|
+
<nav class="${Y({ "sbb-sr-navigation--vertical": this.alignVertical })}">
|
|
133
130
|
<ul
|
|
134
131
|
class="sbb-sr-navigation__list-coaches"
|
|
135
132
|
aria-label="${_("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
|
|
136
133
|
>
|
|
137
|
-
${
|
|
138
|
-
var s, a;
|
|
139
|
-
return h`<li>
|
|
134
|
+
${this.seatReservation?.coachItems.map((e, t) => d`<li>
|
|
140
135
|
<sbb-seat-reservation-navigation-coach
|
|
141
|
-
@selectCoach=${(
|
|
136
|
+
@selectCoach=${(i) => this._onSelectNavCoach(i)}
|
|
142
137
|
@focusCoach=${() => this._onFocusNavCoach()}
|
|
143
|
-
index="${
|
|
144
|
-
coach-id="${
|
|
145
|
-
.selected=${this.selectedCoachIndex ===
|
|
146
|
-
.focused=${this.focusedCoachIndex ===
|
|
147
|
-
.propertyIds="${
|
|
148
|
-
.travelClass="${
|
|
149
|
-
?driver-area="${!
|
|
150
|
-
?first="${
|
|
151
|
-
?last="${
|
|
138
|
+
index="${t}"
|
|
139
|
+
coach-id="${e.id}"
|
|
140
|
+
.selected=${this.selectedCoachIndex === t}
|
|
141
|
+
.focused=${this.focusedCoachIndex === t}
|
|
142
|
+
.propertyIds="${e.propertyIds}"
|
|
143
|
+
.travelClass="${e.travelClass}"
|
|
144
|
+
?driver-area="${!e.places?.length}"
|
|
145
|
+
?first="${t === 0}"
|
|
146
|
+
?last="${t === this.seatReservation?.coachItems.length - 1}"
|
|
152
147
|
?vertical="${this.alignVertical}"
|
|
153
148
|
>
|
|
154
149
|
</sbb-seat-reservation-navigation-coach>
|
|
155
|
-
</li
|
|
156
|
-
})}
|
|
150
|
+
</li>`)}
|
|
157
151
|
</ul>
|
|
158
152
|
</nav>
|
|
159
153
|
` : null;
|
|
@@ -164,13 +158,13 @@ let me = (() => {
|
|
|
164
158
|
* @returns
|
|
165
159
|
*/
|
|
166
160
|
_renderCoaches(e) {
|
|
167
|
-
return e ? e.map((t, i) =>
|
|
161
|
+
return e ? e.map((t, i) => d`
|
|
168
162
|
<li class="sbb-sr__item-coach">${this._renderCoachElement(t, i)}</li>
|
|
169
163
|
`) : null;
|
|
170
164
|
}
|
|
171
165
|
_renderCoachElement(e, t) {
|
|
172
166
|
const i = this.getCalculatedDimension(e.dimension), s = this._getDescriptionTableCoach(e);
|
|
173
|
-
return
|
|
167
|
+
return d` <sbb-seat-reservation-scoped
|
|
174
168
|
scoped-classes="coach-wrapper"
|
|
175
169
|
height="${i.h}px"
|
|
176
170
|
width="${i.w}px"
|
|
@@ -192,16 +186,16 @@ let me = (() => {
|
|
|
192
186
|
</sbb-seat-reservation-scoped>`;
|
|
193
187
|
}
|
|
194
188
|
_getRenderedCoachBorders(e, t) {
|
|
195
|
-
const i = e.graphicElements, s = 1, a = i
|
|
196
|
-
return
|
|
189
|
+
const i = e.graphicElements, s = 1, a = i?.find((v) => v.icon === "DRIVER_AREA_FULL"), n = a ? e.dimension.w - a.dimension.w - s : e.dimension.w - s * 2, h = t === 0 && a ? a?.dimension.w * this.baseGridSize : this.baseGridSize;
|
|
190
|
+
return d`
|
|
197
191
|
<sbb-seat-reservation-scoped
|
|
198
192
|
scoped-classes="coach-border"
|
|
199
193
|
inset-block-start="${this.coachBorderPadding * -1}px"
|
|
200
|
-
inset-inline-start="${
|
|
194
|
+
inset-inline-start="${h}px"
|
|
201
195
|
>
|
|
202
196
|
<sbb-seat-reservation-graphic
|
|
203
197
|
name="COACH_BORDER_MIDDLE"
|
|
204
|
-
width=${
|
|
198
|
+
width=${n * this.baseGridSize}
|
|
205
199
|
height=${(e.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize}
|
|
206
200
|
?stretch=${!0}
|
|
207
201
|
role="presentation"
|
|
@@ -215,20 +209,20 @@ let me = (() => {
|
|
|
215
209
|
const i = {};
|
|
216
210
|
for (const s of e.places)
|
|
217
211
|
i[s.position.y] ? i[s.position.y].push(s) : i[s.position.y] = [s];
|
|
218
|
-
return Object.values(i).map((s, a) =>
|
|
212
|
+
return Object.values(i).map((s, a) => d`
|
|
219
213
|
<tr id="row-${t}-${s[0].position.y}" data-row-index=${a}>
|
|
220
214
|
${this._getRenderedColumnPlaces(s, t)}
|
|
221
215
|
</tr>
|
|
222
216
|
`).flatMap((s) => s);
|
|
223
217
|
}
|
|
224
218
|
_getRenderedColumnPlaces(e, t) {
|
|
225
|
-
return e.sort((i, s) => Number(i.position.x) - Number(s.position.x)), e
|
|
226
|
-
const a = this.getCalculatedDimension(i.dimension),
|
|
227
|
-
return
|
|
219
|
+
return e.sort((i, s) => Number(i.position.x) - Number(s.position.x)), e?.map((i, s) => {
|
|
220
|
+
const a = this.getCalculatedDimension(i.dimension), n = this.getCalculatedPosition(i.position), h = this.alignVertical ? -90 : 0;
|
|
221
|
+
return d`
|
|
228
222
|
<sbb-seat-reservation-scoped
|
|
229
223
|
scoped-classes="graphical-element"
|
|
230
|
-
inset-block-start="${
|
|
231
|
-
inset-inline-start="${
|
|
224
|
+
inset-block-start="${n.y}px"
|
|
225
|
+
inset-inline-start="${n.x}px"
|
|
232
226
|
width="${a.w}px"
|
|
233
227
|
height="${a.h}px"
|
|
234
228
|
z-index="${i.position.z}"
|
|
@@ -246,7 +240,7 @@ let me = (() => {
|
|
|
246
240
|
width=${i.dimension.w * this.baseGridSize}
|
|
247
241
|
height=${i.dimension.h * this.baseGridSize}
|
|
248
242
|
rotation=${i.rotation ?? A}
|
|
249
|
-
text-rotation=${
|
|
243
|
+
text-rotation=${h}
|
|
250
244
|
coach-index=${t}
|
|
251
245
|
.propertyIds=${i.propertyIds}
|
|
252
246
|
.preventClick=${this.preventPlaceClick}
|
|
@@ -256,16 +250,15 @@ let me = (() => {
|
|
|
256
250
|
});
|
|
257
251
|
}
|
|
258
252
|
_getRenderedGraphicalElements(e, t) {
|
|
259
|
-
return e ? e
|
|
260
|
-
const s = i.icon ?? "", a = i.rotation || 0,
|
|
261
|
-
return this._notAreaElements.findIndex((v) => v === s) > -1 ? this._getRenderElementWithoutArea(i, a, t) : this._getRenderElementWithArea(i,
|
|
253
|
+
return e ? e?.map((i) => {
|
|
254
|
+
const s = i.icon ?? "", a = i.rotation || 0, n = this._notFixedRotatableAreaIcons.indexOf(i.icon) === -1, h = this.alignVertical && n ? a - 90 : a;
|
|
255
|
+
return this._notAreaElements.findIndex((v) => v === s) > -1 ? this._getRenderElementWithoutArea(i, a, t) : this._getRenderElementWithArea(i, h, t);
|
|
262
256
|
}) : null;
|
|
263
257
|
}
|
|
264
258
|
_getRenderElementWithArea(e, t, i) {
|
|
265
|
-
|
|
266
|
-
const s = ((U = e.icon) == null ? void 0 : U.indexOf("TABLE")) === -1, a = e.icon && s ? e.icon : null, r = a !== "ENTRY_EXIT", l = e.icon ? _(e.icon, this._language.current) : A, v = this.getCalculatedDimension(e.dimension, i, !0, r), j = this.getCalculatedPosition(e.position, e.dimension, i, !0);
|
|
259
|
+
const s = e.icon?.indexOf("TABLE") === -1, a = e.icon && s ? e.icon : null, n = a !== "ENTRY_EXIT", h = e.icon ? _(e.icon, this._language.current) : A, v = this.getCalculatedDimension(e.dimension, i, !0, n), j = this.getCalculatedPosition(e.position, e.dimension, i, !0);
|
|
267
260
|
let w = "free";
|
|
268
|
-
return e.position.y === this.coachBorderOffset * -1 ? w = "upper-border" : e.position.y + e.dimension.h === i.h + this.coachBorderOffset && (w = "lower-border"),
|
|
261
|
+
return e.position.y === this.coachBorderOffset * -1 ? w = "upper-border" : e.position.y + e.dimension.h === i.h + this.coachBorderOffset && (w = "lower-border"), d`
|
|
269
262
|
<sbb-seat-reservation-scoped
|
|
270
263
|
scoped-classes="graphical-element"
|
|
271
264
|
inset-block-start="${j.y}px"
|
|
@@ -275,16 +268,16 @@ let me = (() => {
|
|
|
275
268
|
z-index="${e.position.z}"
|
|
276
269
|
>
|
|
277
270
|
<sbb-seat-reservation-area
|
|
278
|
-
style=${
|
|
271
|
+
style=${Q({
|
|
279
272
|
"--sbb-reservation-area-width": e.dimension.w * this.baseGridSize,
|
|
280
273
|
"--sbb-reservation-area-height": e.dimension.h * this.baseGridSize
|
|
281
274
|
})}
|
|
282
275
|
mounting=${w}
|
|
283
276
|
background="dark"
|
|
284
277
|
aria-hidden="true"
|
|
285
|
-
title=${
|
|
278
|
+
title=${h}
|
|
286
279
|
>
|
|
287
|
-
${a ?
|
|
280
|
+
${a ? d`
|
|
288
281
|
<sbb-seat-reservation-graphic
|
|
289
282
|
name=${a}
|
|
290
283
|
rotation=${t}
|
|
@@ -299,9 +292,8 @@ let me = (() => {
|
|
|
299
292
|
`;
|
|
300
293
|
}
|
|
301
294
|
_getRenderElementWithoutArea(e, t, i) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
return h`
|
|
295
|
+
const s = this.getCalculatedDimension(e.dimension, i), a = this.getCalculatedPosition(e.position, e.dimension, i), n = e.icon && e.icon.indexOf("DRIVER_AREA") === -1 ? e.icon : e.icon?.concat("_", this.seatReservation.vehicleType);
|
|
296
|
+
return d`
|
|
305
297
|
<sbb-seat-reservation-scoped
|
|
306
298
|
scoped-classes="graphical-element"
|
|
307
299
|
inset-block-start="${a.y}px"
|
|
@@ -311,7 +303,7 @@ let me = (() => {
|
|
|
311
303
|
z-index="${e.position.z}"
|
|
312
304
|
>
|
|
313
305
|
<sbb-seat-reservation-graphic
|
|
314
|
-
name=${
|
|
306
|
+
name=${n ?? A}
|
|
315
307
|
width=${e.dimension.w * this.baseGridSize}
|
|
316
308
|
height=${e.dimension.h * this.baseGridSize}
|
|
317
309
|
rotation=${t}
|
|
@@ -322,9 +314,9 @@ let me = (() => {
|
|
|
322
314
|
`;
|
|
323
315
|
}
|
|
324
316
|
_getRenderedServiceElements(e) {
|
|
325
|
-
return e ? e
|
|
326
|
-
const i = t.icon ? _(t.icon, this._language.current) : null, s = this.getCalculatedDimension(t.dimension), a = this.getCalculatedPosition(t.position),
|
|
327
|
-
return
|
|
317
|
+
return e ? e?.map((t) => {
|
|
318
|
+
const i = t.icon ? _(t.icon, this._language.current) : null, s = this.getCalculatedDimension(t.dimension), a = this.getCalculatedPosition(t.position), n = t.rotation || 0, h = this.alignVertical ? n - 90 : n;
|
|
319
|
+
return d`
|
|
328
320
|
<sbb-seat-reservation-scoped
|
|
329
321
|
scoped-classes="graphical-element"
|
|
330
322
|
inset-block-start="${a.y}px"
|
|
@@ -337,7 +329,7 @@ let me = (() => {
|
|
|
337
329
|
name=${t.icon ?? A}
|
|
338
330
|
width=${t.dimension.w * this.baseGridSize}
|
|
339
331
|
height=${t.dimension.h * this.baseGridSize}
|
|
340
|
-
.rotation=${
|
|
332
|
+
.rotation=${h}
|
|
341
333
|
role="img"
|
|
342
334
|
aria-hidden="true"
|
|
343
335
|
title=${i ?? A}
|
|
@@ -363,8 +355,7 @@ let me = (() => {
|
|
|
363
355
|
this.preventCoachScrollByPlaceClick ? this.focusPlaceElement(this.currSelectedPlace) : this.preselectPlaceInCoach(), this.isAutoScrolling = !1;
|
|
364
356
|
}
|
|
365
357
|
_getDescriptionTableCoach(e) {
|
|
366
|
-
|
|
367
|
-
if (!((a = e.places) != null && a.length))
|
|
358
|
+
if (!e.places?.length)
|
|
368
359
|
return _("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [
|
|
369
360
|
e.id
|
|
370
361
|
]);
|
|
@@ -376,28 +367,28 @@ let me = (() => {
|
|
|
376
367
|
}
|
|
377
368
|
_getTitleDescriptionListString(e) {
|
|
378
369
|
const t = [];
|
|
379
|
-
return e
|
|
370
|
+
return e?.map((i) => {
|
|
380
371
|
const s = i.icon;
|
|
381
372
|
if (!s)
|
|
382
373
|
return null;
|
|
383
|
-
const a = t.indexOf(s) > -1,
|
|
384
|
-
return a || t.push(i.icon),
|
|
374
|
+
const a = t.indexOf(s) > -1, n = _(i.icon, this._language.current), h = this._notFixedRotatableAreaIcons.indexOf(s) === -1 && this._notAreaElements.indexOf(s) === -1;
|
|
375
|
+
return a || t.push(i.icon), n && !a && h ? n : null;
|
|
385
376
|
}).filter((i) => !!i).join(", ");
|
|
386
377
|
}
|
|
387
|
-
}, g = new WeakMap(),
|
|
378
|
+
}, g = new WeakMap(), m = new WeakMap(), f = new WeakMap(), $ = new WeakMap(), C = new WeakMap(), u = c, (() => {
|
|
388
379
|
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(N[Symbol.metadata] ?? null) : void 0;
|
|
389
|
-
T = [y({ attribute: "seat-reservation", type: Object })],
|
|
380
|
+
T = [y({ attribute: "seat-reservation", type: Object })], E = [P(), y({ attribute: "has-navigation", type: Boolean })], G = [P(), y({ attribute: "align-vertical", type: Boolean })], B = [P(), y({ attribute: "max-reservations", type: Number })], M = [P(), y({ attribute: "prevent-place-click", type: Boolean })], S(c, null, T, { kind: "accessor", name: "seatReservation", static: !1, private: !1, access: { has: (t) => "seatReservation" in t, get: (t) => t.seatReservation, set: (t, i) => {
|
|
390
381
|
t.seatReservation = i;
|
|
391
|
-
} }, metadata: e }, z, O), S(
|
|
382
|
+
} }, metadata: e }, z, O), S(c, null, E, { kind: "accessor", name: "hasNavigation", static: !1, private: !1, access: { has: (t) => "hasNavigation" in t, get: (t) => t.hasNavigation, set: (t, i) => {
|
|
392
383
|
t.hasNavigation = i;
|
|
393
|
-
} }, metadata: e },
|
|
384
|
+
} }, metadata: e }, k, D), S(c, null, G, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, i) => {
|
|
394
385
|
t.alignVertical = i;
|
|
395
|
-
} }, metadata: e },
|
|
386
|
+
} }, metadata: e }, I, V), S(c, null, B, { kind: "accessor", name: "maxReservations", static: !1, private: !1, access: { has: (t) => "maxReservations" in t, get: (t) => t.maxReservations, set: (t, i) => {
|
|
396
387
|
t.maxReservations = i;
|
|
397
|
-
} }, metadata: e }, L, F), S(
|
|
388
|
+
} }, metadata: e }, L, F), S(c, null, M, { kind: "accessor", name: "preventPlaceClick", static: !1, private: !1, access: { has: (t) => "preventPlaceClick" in t, get: (t) => t.preventPlaceClick, set: (t, i) => {
|
|
398
389
|
t.preventPlaceClick = i;
|
|
399
|
-
} }, metadata: e }, H, W), S(null, o = { value: u },
|
|
400
|
-
})(),
|
|
390
|
+
} }, metadata: e }, H, W), S(null, o = { value: u }, r, { kind: "class", name: u.name, metadata: e }, null, l), u = o.value, e && Object.defineProperty(u, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
391
|
+
})(), c.styles = ee, p(u, l), u;
|
|
401
392
|
})();
|
|
402
393
|
export {
|
|
403
394
|
me as SbbSeatReservationElement
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { html as d } from "lit";
|
|
2
|
-
import { unsafeHTML as
|
|
3
|
-
import { svgs as
|
|
2
|
+
import { unsafeHTML as a } from "lit/directives/unsafe-html.js";
|
|
3
|
+
import { svgs as e, mapIconToSvg as r } from "../common.js";
|
|
4
4
|
import "@sbb-esta/lyne-elements/table.js";
|
|
5
5
|
import "../seat-reservation-graphic.js";
|
|
6
6
|
const E = (A) => d`
|
|
7
7
|
<div class="story-asset">
|
|
8
|
-
<span class="story-asset__preview">${
|
|
8
|
+
<span class="story-asset__preview">${a(A)}</span>
|
|
9
9
|
</div>
|
|
10
|
-
`, t = (A) => {
|
|
11
|
-
var e, a;
|
|
12
|
-
return (e = r[A]) != null && e.svg ? E(r[A].svg) : (a = r[A]) != null && a.svgName ? d`<sbb-icon name="${r[A].svgName}"></sbb-icon>` : null;
|
|
13
|
-
}, R = d`
|
|
10
|
+
`, t = (A) => r[A]?.svg ? E(r[A].svg) : r[A]?.svgName ? d`<sbb-icon name="${r[A].svgName}"></sbb-icon>` : null, _ = d`
|
|
14
11
|
<sbb-table-wrapper>
|
|
15
12
|
<table class="sbb-table">
|
|
16
13
|
<thead>
|
|
@@ -64,7 +61,7 @@ const E = (A) => d`
|
|
|
64
61
|
</tbody>
|
|
65
62
|
</table>
|
|
66
63
|
</sbb-table-wrapper>
|
|
67
|
-
`,
|
|
64
|
+
`, s = d`
|
|
68
65
|
<sbb-table-wrapper>
|
|
69
66
|
<table class="sbb-table">
|
|
70
67
|
<thead>
|
|
@@ -133,7 +130,7 @@ const E = (A) => d`
|
|
|
133
130
|
</tbody>
|
|
134
131
|
</table>
|
|
135
132
|
</sbb-table-wrapper>
|
|
136
|
-
`,
|
|
133
|
+
`, R = d`
|
|
137
134
|
<sbb-table-wrapper>
|
|
138
135
|
<table aria-label="Available Service Icons" class="sbb-table">
|
|
139
136
|
<thead>
|
|
@@ -212,7 +209,7 @@ const E = (A) => d`
|
|
|
212
209
|
</tbody>
|
|
213
210
|
</table>
|
|
214
211
|
</sbb-table-wrapper>
|
|
215
|
-
`,
|
|
212
|
+
`, o = d`
|
|
216
213
|
<sbb-table-wrapper>
|
|
217
214
|
<table class="sbb-table">
|
|
218
215
|
<thead>
|
|
@@ -259,7 +256,7 @@ const E = (A) => d`
|
|
|
259
256
|
<td>COACH_PASSAGE</td>
|
|
260
257
|
</tr>
|
|
261
258
|
<tr>
|
|
262
|
-
<td>${E(
|
|
259
|
+
<td>${E(e.chassisPassageWaggonBottomRight)}</td>
|
|
263
260
|
<td>Passage-Waggon Type: Right</td>
|
|
264
261
|
<td
|
|
265
262
|
style="background: linear-gradient(90deg, var(--sbb-color-white) 5%, var(--sbb-color-red));"
|
|
@@ -278,7 +275,7 @@ const E = (A) => d`
|
|
|
278
275
|
<td>COACH_BORDER_MIDDLE</td>
|
|
279
276
|
</tr>
|
|
280
277
|
<tr>
|
|
281
|
-
<td>${E(
|
|
278
|
+
<td>${E(e.chassisSeparator)}</td>
|
|
282
279
|
<td>Separator</td>
|
|
283
280
|
<td
|
|
284
281
|
style="background: linear-gradient(90deg, var(--sbb-color-white) 5%, var(--sbb-color-red))"
|
|
@@ -294,7 +291,7 @@ const E = (A) => d`
|
|
|
294
291
|
</tbody>
|
|
295
292
|
</table>
|
|
296
293
|
</sbb-table-wrapper>
|
|
297
|
-
`,
|
|
294
|
+
`, L = d`
|
|
298
295
|
<style>
|
|
299
296
|
.story-asset {
|
|
300
297
|
width: max-content;
|
|
@@ -303,15 +300,15 @@ const E = (A) => d`
|
|
|
303
300
|
</style>
|
|
304
301
|
<h1>List of all currently available assets.</h1>
|
|
305
302
|
<h2>Interior</h2>
|
|
306
|
-
${
|
|
303
|
+
${_}
|
|
307
304
|
<h2>Layout</h2>
|
|
308
|
-
${
|
|
305
|
+
${s}
|
|
309
306
|
<h2>Service Icons</h2>
|
|
310
|
-
${
|
|
307
|
+
${R}
|
|
311
308
|
<h2>Chassis</h2>
|
|
312
|
-
${
|
|
309
|
+
${o}
|
|
313
310
|
`;
|
|
314
311
|
export {
|
|
315
|
-
|
|
312
|
+
L as assetsTemplate,
|
|
316
313
|
t as svgImageByOSDMCode
|
|
317
314
|
};
|