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