@sbb-esta/lyne-elements-experimental 3.0.0-next.3 → 3.0.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/custom-elements.json +839 -907
- package/development/core/datetime/date-helper.js +1 -1
- package/development/core/timetable/access-leg-helper.js +1 -1
- package/development/differenceInMinutes-D5Nj8Stc.js +1 -1
- package/development/format-BQfaa1ZT.js +1 -1
- package/development/journey-summary/journey-summary.component.js +1 -1
- package/development/pearl-chain/pearl-chain.component.js +1 -1
- package/development/pearl-chain-time/pearl-chain-time.component.js +1 -1
- 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/mapper.js +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +4 -9
- 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 +15 -10
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +0 -3
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +6 -6
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +1 -1
- package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach → seat-reservation-navigation-coach}/seat-reservation-navigation-coach.component.d.ts +3 -10
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -0
- package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach → seat-reservation-navigation-coach}/seat-reservation-navigation-coach.component.js +14 -13
- package/development/seat-reservation/seat-reservation-navigation-coach.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +123 -0
- package/development/seat-reservation/seat-reservation-navigation-services.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -7
- 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 +12 -10
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
- package/development/seat-reservation/{seat-reservation/seat-reservation-scoped → seat-reservation-scoped}/seat-reservation-scoped.component.js +1 -1
- package/{seat-reservation → development}/seat-reservation/seat-reservation-scoped.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation.d.ts +0 -1
- package/development/seat-reservation/seat-reservation.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation.js +1 -3
- package/development/seat-reservation.d.ts +3 -1
- package/development/seat-reservation.d.ts.map +1 -1
- package/development/seat-reservation.js +3 -3
- package/development/timetable-duration/timetable-duration.component.js +1 -1
- package/development/timetable-row/timetable-row.component.js +1 -1
- package/index.d.ts +3 -3
- package/index.js +3 -3
- package/package.json +14 -19
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +4 -9
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +56 -49
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts +0 -3
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.js +5 -5
- package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach → seat-reservation-navigation-coach}/seat-reservation-navigation-coach.component.d.ts +3 -10
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -0
- package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach → seat-reservation-navigation-coach}/seat-reservation-navigation-coach.component.js +54 -52
- package/seat-reservation/seat-reservation-navigation-coach.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -0
- package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services → seat-reservation-navigation-services}/seat-reservation-navigation-services.component.js +2 -2
- package/seat-reservation/seat-reservation-navigation-services.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -7
- 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 +45 -43
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-scoped.d.ts.map +1 -0
- package/seat-reservation/seat-reservation.d.ts +0 -1
- package/seat-reservation/seat-reservation.d.ts.map +1 -1
- package/seat-reservation/seat-reservation.js +0 -2
- package/seat-reservation.d.ts +3 -1
- package/seat-reservation.d.ts.map +1 -1
- package/seat-reservation.js +12 -12
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +0 -122
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation.d.ts +0 -6
- package/development/seat-reservation/seat-reservation-navigation.d.ts.map +0 -1
- package/development/seat-reservation/seat-reservation-navigation.js +0 -7
- package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation.d.ts +0 -6
- package/seat-reservation/seat-reservation-navigation.d.ts.map +0 -1
- package/seat-reservation/seat-reservation-navigation.js +0 -6
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach.d.ts → seat-reservation-navigation-coach.d.ts} +0 -0
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach.js → seat-reservation-navigation-coach.js} +0 -0
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services → seat-reservation-navigation-services}/seat-reservation-navigation-services.component.d.ts +0 -0
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services.d.ts → seat-reservation-navigation-services.d.ts} +0 -0
- /package/development/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services.js → seat-reservation-navigation-services.js} +0 -0
- /package/development/seat-reservation/{seat-reservation/seat-reservation-scoped → seat-reservation-scoped}/seat-reservation-scoped.component.d.ts +0 -0
- /package/development/seat-reservation/{seat-reservation/seat-reservation-scoped.d.ts → seat-reservation-scoped.d.ts} +0 -0
- /package/development/seat-reservation/{seat-reservation/seat-reservation-scoped.js → seat-reservation-scoped.js} +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach.d.ts → seat-reservation-navigation-coach.d.ts} +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-coach.js → seat-reservation-navigation-coach.js} +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services → seat-reservation-navigation-services}/seat-reservation-navigation-services.component.d.ts +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services.d.ts → seat-reservation-navigation-services.d.ts} +0 -0
- /package/seat-reservation/{seat-reservation-navigation/seat-reservation-navigation-services.js → seat-reservation-navigation-services.js} +0 -0
- /package/seat-reservation/{seat-reservation/seat-reservation-scoped → seat-reservation-scoped}/seat-reservation-scoped.component.d.ts +0 -0
- /package/seat-reservation/{seat-reservation/seat-reservation-scoped → seat-reservation-scoped}/seat-reservation-scoped.component.js +0 -0
- /package/seat-reservation/{seat-reservation/seat-reservation-scoped.d.ts → seat-reservation-scoped.d.ts} +0 -0
- /package/seat-reservation/{seat-reservation/seat-reservation-scoped.js → seat-reservation-scoped.js} +0 -0
|
@@ -3,33 +3,32 @@ var Q = (a) => {
|
|
|
3
3
|
};
|
|
4
4
|
var Y = (a, l, h) => l.has(a) || Q("Cannot " + h);
|
|
5
5
|
var d = (a, l, h) => (Y(a, l, "read from private field"), h ? h.call(a) : l.get(a)), u = (a, l, h) => l.has(a) ? Q("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(a) : l.set(a, h), c = (a, l, h, R) => (Y(a, l, "write to private field"), R ? R.call(a, h) : l.set(a, h), h);
|
|
6
|
-
import { __runInitializers as
|
|
7
|
-
import { isArrowKeyOrPageKeysPressed as
|
|
6
|
+
import { __runInitializers as o, __esDecorate as f } from "tslib";
|
|
7
|
+
import { isArrowKeyOrPageKeysPressed as ee } from "@sbb-esta/lyne-elements/core/a11y.js";
|
|
8
8
|
import { forceType as y } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { mapPlaceInfosToPlaceSelection as se, mapPlaceAndCoachToSeatReservationPlaceSelection as ae, mapCoachInfosToCoachSelection as ce } from "../common/mapper.js";
|
|
9
|
+
import { LitElement as te } from "lit";
|
|
10
|
+
import { property as C, state as Z } from "lit/decorators.js";
|
|
11
|
+
import { mapPlaceInfosToPlaceSelection as ie, mapPlaceAndCoachToSeatReservationPlaceSelection as se, mapCoachInfosToCoachSelection as ae } from "../common/mapper.js";
|
|
13
12
|
var g;
|
|
14
13
|
(function(a) {
|
|
15
14
|
a.right = "right", a.left = "left";
|
|
16
15
|
})(g || (g = {}));
|
|
17
|
-
let
|
|
18
|
-
var v, S,
|
|
19
|
-
let a =
|
|
20
|
-
return
|
|
16
|
+
let fe = (() => {
|
|
17
|
+
var v, S, p, x, b, I, P, _, m, r;
|
|
18
|
+
let a = te, l, h = [], R = [], E, A = [], w = [], N, k = [], T = [], z, B = [], G = [], V, F = [], O = [], D, W = [], K = [], L, H = [], U = [], X, q = [], M = [], j, $ = [], J = [];
|
|
19
|
+
return r = class extends a {
|
|
21
20
|
constructor() {
|
|
22
21
|
super(...arguments);
|
|
23
22
|
u(this, v);
|
|
24
23
|
u(this, S);
|
|
25
|
-
u(this, x);
|
|
26
24
|
u(this, p);
|
|
25
|
+
u(this, x);
|
|
27
26
|
u(this, b);
|
|
28
|
-
u(this, P);
|
|
29
27
|
u(this, I);
|
|
30
|
-
u(this,
|
|
28
|
+
u(this, P);
|
|
31
29
|
u(this, _);
|
|
32
|
-
|
|
30
|
+
u(this, m);
|
|
31
|
+
c(this, v, o(this, h, null)), c(this, S, (o(this, R), o(this, A, !0))), c(this, p, (o(this, w), o(this, k, !1))), c(this, x, (o(this, T), o(this, B, 16))), c(this, b, (o(this, G), o(this, F, null))), c(this, I, (o(this, O), o(this, W, null))), c(this, P, (o(this, K), o(this, H, !1))), c(this, _, (o(this, U), o(this, q, -1))), c(this, m, (o(this, M), o(this, $, -1))), this.coachBorderPadding = (o(this, J), 6), this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.currScrollDirection = g.right, this.maxCalcCoachsWidth = 0, this.scrollCoachsAreaWidth = 0, this.triggerCoachPositionsCollection = [], this.firstTabElement = null, this.lastTabElement = null, this.coachScrollArea = null, this.currSelectedPlace = null, this.currSelectedPlaceElementId = null, this.currSelectedCoachIndex = -1, this.preventCoachScrollByPlaceClick = !1, this.selectedSeatReservationPlaces = [], this.seatReservationWithoutNavigationHasFocus = !1, this.isCoachGridFocusable = !1, this.isAutoScrolling = !1, this.isKeyboardNavigation = !1, this.keyboardNavigationEvents = {
|
|
33
32
|
ArrowLeft: "ArrowLeft",
|
|
34
33
|
ArrowRight: "ArrowRight",
|
|
35
34
|
ArrowUp: "ArrowUp",
|
|
@@ -45,7 +44,7 @@ let Ce = (() => {
|
|
|
45
44
|
set seatReservation(e) {
|
|
46
45
|
c(this, v, e);
|
|
47
46
|
}
|
|
48
|
-
/** The seat
|
|
47
|
+
/** The seat reservation navigation can be toggled by this property */
|
|
49
48
|
get hasNavigation() {
|
|
50
49
|
return d(this, S);
|
|
51
50
|
}
|
|
@@ -54,17 +53,17 @@ let Ce = (() => {
|
|
|
54
53
|
}
|
|
55
54
|
/** The seat reservation area is aligned vertically */
|
|
56
55
|
get alignVertical() {
|
|
57
|
-
return d(this,
|
|
56
|
+
return d(this, p);
|
|
58
57
|
}
|
|
59
58
|
set alignVertical(e) {
|
|
60
|
-
c(this,
|
|
59
|
+
c(this, p, e);
|
|
61
60
|
}
|
|
62
61
|
/** The seat reservation area's base grid size */
|
|
63
62
|
get baseGridSize() {
|
|
64
|
-
return d(this,
|
|
63
|
+
return d(this, x);
|
|
65
64
|
}
|
|
66
65
|
set baseGridSize(e) {
|
|
67
|
-
c(this,
|
|
66
|
+
c(this, x, e);
|
|
68
67
|
}
|
|
69
68
|
/** The seat reservation area's width */
|
|
70
69
|
get height() {
|
|
@@ -75,29 +74,29 @@ let Ce = (() => {
|
|
|
75
74
|
}
|
|
76
75
|
/** Maximal number of possible clickable seats */
|
|
77
76
|
get maxReservations() {
|
|
78
|
-
return d(this,
|
|
77
|
+
return d(this, I);
|
|
79
78
|
}
|
|
80
79
|
set maxReservations(e) {
|
|
81
|
-
c(this,
|
|
80
|
+
c(this, I, e);
|
|
82
81
|
}
|
|
83
82
|
/** Any click functionality is prevented */
|
|
84
83
|
get preventPlaceClick() {
|
|
85
|
-
return d(this,
|
|
84
|
+
return d(this, P);
|
|
86
85
|
}
|
|
87
86
|
set preventPlaceClick(e) {
|
|
88
|
-
c(this,
|
|
87
|
+
c(this, P, e);
|
|
89
88
|
}
|
|
90
89
|
get selectedCoachIndex() {
|
|
91
|
-
return d(this,
|
|
90
|
+
return d(this, _);
|
|
92
91
|
}
|
|
93
92
|
set selectedCoachIndex(e) {
|
|
94
|
-
c(this,
|
|
93
|
+
c(this, _, e);
|
|
95
94
|
}
|
|
96
95
|
get focusedCoachIndex() {
|
|
97
|
-
return d(this,
|
|
96
|
+
return d(this, m);
|
|
98
97
|
}
|
|
99
98
|
set focusedCoachIndex(e) {
|
|
100
|
-
c(this,
|
|
99
|
+
c(this, m, e);
|
|
101
100
|
}
|
|
102
101
|
willUpdate(e) {
|
|
103
102
|
super.willUpdate(e), e.has("seatReservation") && this._initSeatReservationPlaceSelection(), e.has("baseGridSize") && (this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this.alignVertical && this._setVerticalAlignmentOffset()), e.has("height") && this.height && this.seatReservation.coachItems.length && (this.baseGridSize = this.height / this.seatReservation.coachItems[0].dimension.h, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this.alignVertical && this._setVerticalAlignmentOffset()), e.has("alignVertical") && this.alignVertical && this._setVerticalAlignmentOffset();
|
|
@@ -144,7 +143,7 @@ let Ce = (() => {
|
|
|
144
143
|
return;
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
|
-
if (this.currSelectedCoachIndex !== -1 &&
|
|
146
|
+
if (this.currSelectedCoachIndex !== -1 && ee(e))
|
|
148
147
|
switch (e.preventDefault(), t) {
|
|
149
148
|
case this.keyboardNavigationEvents.ArrowLeft:
|
|
150
149
|
{
|
|
@@ -327,7 +326,11 @@ let Ce = (() => {
|
|
|
327
326
|
t && this.selectedSeatReservationPlaces.push(t);
|
|
328
327
|
} else
|
|
329
328
|
this.selectedSeatReservationPlaces = this.selectedSeatReservationPlaces.filter((t) => t.id !== e.id);
|
|
330
|
-
this.maxReservations && this.selectedSeatReservationPlaces.length > this.maxReservations && this._resetAllPlaceSelections(e), this.
|
|
329
|
+
this.maxReservations && this.selectedSeatReservationPlaces.length > this.maxReservations && this._resetAllPlaceSelections(e), this.dispatchEvent(new CustomEvent("selectedplaces", {
|
|
330
|
+
bubbles: !0,
|
|
331
|
+
composed: !0,
|
|
332
|
+
detail: this.selectedSeatReservationPlaces
|
|
333
|
+
}));
|
|
331
334
|
}
|
|
332
335
|
updateCurrentSelectedPlaceInCoach(e) {
|
|
333
336
|
const t = e.coachIndex, i = this.seatReservation.coachItems[t].places?.find((s) => s.number == e.number);
|
|
@@ -336,7 +339,11 @@ let Ce = (() => {
|
|
|
336
339
|
updateCurrentSelectedCoach() {
|
|
337
340
|
this.selectedCoachIndex = this.currSelectedCoachIndex, this.focusedCoachIndex = -1;
|
|
338
341
|
const e = this._getSeatReservationCoachSelection(this.selectedCoachIndex);
|
|
339
|
-
e && this.
|
|
342
|
+
e && this.dispatchEvent(new CustomEvent("selectedcoach", {
|
|
343
|
+
bubbles: !0,
|
|
344
|
+
composed: !0,
|
|
345
|
+
detail: e
|
|
346
|
+
}));
|
|
340
347
|
}
|
|
341
348
|
/**
|
|
342
349
|
* Initialization of SeatReservationPlaceSelection Array based on the transferred places
|
|
@@ -345,7 +352,7 @@ let Ce = (() => {
|
|
|
345
352
|
_initSeatReservationPlaceSelection() {
|
|
346
353
|
this.seatReservation.coachItems.map((e, t) => {
|
|
347
354
|
e.places?.filter((i) => i.state === "SELECTED")?.forEach((i) => {
|
|
348
|
-
const s =
|
|
355
|
+
const s = ie(i, t), n = this._getSeatReservationPlaceSelection(s);
|
|
349
356
|
n && this.selectedSeatReservationPlaces.push(n);
|
|
350
357
|
});
|
|
351
358
|
});
|
|
@@ -361,13 +368,13 @@ let Ce = (() => {
|
|
|
361
368
|
}
|
|
362
369
|
_getSeatReservationPlaceSelection(e) {
|
|
363
370
|
const t = this.seatReservation.coachItems[e.coachIndex], i = t.places?.find((s) => s.number === e.number);
|
|
364
|
-
return i ?
|
|
371
|
+
return i ? se(i, t, e.coachIndex) : null;
|
|
365
372
|
}
|
|
366
373
|
_getSeatReservationCoachSelection(e) {
|
|
367
374
|
if (!this.seatReservation.coachItems[e])
|
|
368
375
|
return null;
|
|
369
376
|
const t = this.seatReservation.coachItems[e];
|
|
370
|
-
return
|
|
377
|
+
return ae(e, t);
|
|
371
378
|
}
|
|
372
379
|
_setCurrSelectedPlaceElementId(e) {
|
|
373
380
|
e ? this.currSelectedPlaceElementId = "seat-reservation__place-button-" + this.currSelectedCoachIndex + "-" + e.number : this.currSelectedPlaceElementId = null;
|
|
@@ -393,32 +400,32 @@ let Ce = (() => {
|
|
|
393
400
|
}
|
|
394
401
|
});
|
|
395
402
|
}
|
|
396
|
-
}, v = new WeakMap(), S = new WeakMap(),
|
|
403
|
+
}, v = new WeakMap(), S = new WeakMap(), p = new WeakMap(), x = new WeakMap(), b = new WeakMap(), I = new WeakMap(), P = new WeakMap(), _ = new WeakMap(), m = new WeakMap(), (() => {
|
|
397
404
|
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(a[Symbol.metadata] ?? null) : void 0;
|
|
398
|
-
l = [C({ attribute: "seat-reservation", type: Object })],
|
|
405
|
+
l = [C({ attribute: "seat-reservation", type: Object })], E = [y(), C({ attribute: "has-navigation", type: Boolean })], N = [y(), C({ attribute: "align-vertical", type: Boolean })], z = [y(), C({ attribute: "base-grid-size", type: Number })], V = [y(), C({ attribute: "height", type: Number })], D = [y(), C({ attribute: "max-reservations", type: Number })], L = [y(), C({ attribute: "prevent-place-click", type: Boolean })], X = [Z()], j = [Z()], f(r, null, l, { kind: "accessor", name: "seatReservation", static: !1, private: !1, access: { has: (t) => "seatReservation" in t, get: (t) => t.seatReservation, set: (t, i) => {
|
|
399
406
|
t.seatReservation = i;
|
|
400
|
-
} }, metadata: e }, h, R), f(
|
|
407
|
+
} }, metadata: e }, h, R), f(r, null, E, { kind: "accessor", name: "hasNavigation", static: !1, private: !1, access: { has: (t) => "hasNavigation" in t, get: (t) => t.hasNavigation, set: (t, i) => {
|
|
401
408
|
t.hasNavigation = i;
|
|
402
|
-
} }, metadata: e },
|
|
409
|
+
} }, metadata: e }, A, w), f(r, null, N, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, i) => {
|
|
403
410
|
t.alignVertical = i;
|
|
404
|
-
} }, metadata: e }, k, T), f(
|
|
411
|
+
} }, metadata: e }, k, T), f(r, null, z, { kind: "accessor", name: "baseGridSize", static: !1, private: !1, access: { has: (t) => "baseGridSize" in t, get: (t) => t.baseGridSize, set: (t, i) => {
|
|
405
412
|
t.baseGridSize = i;
|
|
406
|
-
} }, metadata: e }, B, G), f(
|
|
413
|
+
} }, metadata: e }, B, G), f(r, null, V, { kind: "accessor", name: "height", static: !1, private: !1, access: { has: (t) => "height" in t, get: (t) => t.height, set: (t, i) => {
|
|
407
414
|
t.height = i;
|
|
408
|
-
} }, metadata: e }, F, O), f(
|
|
415
|
+
} }, metadata: e }, F, O), f(r, null, D, { kind: "accessor", name: "maxReservations", static: !1, private: !1, access: { has: (t) => "maxReservations" in t, get: (t) => t.maxReservations, set: (t, i) => {
|
|
409
416
|
t.maxReservations = i;
|
|
410
|
-
} }, metadata: e }, W, K), f(
|
|
417
|
+
} }, metadata: e }, W, K), f(r, null, L, { kind: "accessor", name: "preventPlaceClick", static: !1, private: !1, access: { has: (t) => "preventPlaceClick" in t, get: (t) => t.preventPlaceClick, set: (t, i) => {
|
|
411
418
|
t.preventPlaceClick = i;
|
|
412
|
-
} }, metadata: e }, H, U), f(
|
|
419
|
+
} }, metadata: e }, H, U), f(r, null, X, { kind: "accessor", name: "selectedCoachIndex", static: !1, private: !1, access: { has: (t) => "selectedCoachIndex" in t, get: (t) => t.selectedCoachIndex, set: (t, i) => {
|
|
413
420
|
t.selectedCoachIndex = i;
|
|
414
|
-
} }, metadata: e }, q, M), f(
|
|
421
|
+
} }, metadata: e }, q, M), f(r, null, j, { kind: "accessor", name: "focusedCoachIndex", static: !1, private: !1, access: { has: (t) => "focusedCoachIndex" in t, get: (t) => t.focusedCoachIndex, set: (t, i) => {
|
|
415
422
|
t.focusedCoachIndex = i;
|
|
416
|
-
} }, metadata: e }, $, J), e && Object.defineProperty(
|
|
417
|
-
})(),
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
},
|
|
423
|
+
} }, metadata: e }, $, J), e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
424
|
+
})(), r.events = {
|
|
425
|
+
selectedplaces: "selectedplaces",
|
|
426
|
+
selectedcoach: "selectedcoach"
|
|
427
|
+
}, r;
|
|
421
428
|
})();
|
|
422
429
|
export {
|
|
423
|
-
|
|
430
|
+
fe as SeatReservationBaseElement
|
|
424
431
|
};
|
|
@@ -3,9 +3,6 @@ import { SeatReservation } from '../common.js';
|
|
|
3
3
|
import { SeatReservationBaseElement } from './seat-reservation-base-element.js';
|
|
4
4
|
/**
|
|
5
5
|
* Describe the purpose of the component with a single short sentence.
|
|
6
|
-
*
|
|
7
|
-
* @event {CustomEvent<SeatReservationSelectedPlacesEventDetails>} selectedPlaces - Emits when a place was selected and returns a Place array with all selected places
|
|
8
|
-
* @event {CustomEvent<SeatReservationCoachSelection>} selectedCoach - Emits when a coach was selected and returns a CoachSelection
|
|
9
6
|
*/
|
|
10
7
|
export declare class SbbSeatReservationElement extends SeatReservationBaseElement {
|
|
11
8
|
static styles: CSSResultGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-reservation.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.component.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAM1E,OAAO,KAAK,EAMV,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGhF,OAAO,+CAA+C,CAAC;AACvD,OAAO,6BAA6B,CAAC;AACrC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"seat-reservation.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.component.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAM1E,OAAO,KAAK,EAMV,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGhF,OAAO,+CAA+C,CAAC;AACvD,OAAO,6BAA6B,CAAC;AACrC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,+BAA+B,CAAC;AAEvC;;GAEG;AACH,qBAEM,yBAA0B,SAAQ,0BAA0B;IAChE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,wEAAwE;IACxE,SACyB,eAAe,EAAE,eAAe,CAAS;IAElE,sEAAsE;IACtE,SAEyB,aAAa,EAAE,OAAO,CAAQ;IAEvD,kGAAkG;IAClG,SAEyB,aAAa,EAAE,OAAO,CAAS;IAExD,iDAAiD;IACjD,SAEyB,eAAe,EAAE,MAAM,CAAS;IAEzD,2CAA2C;IAC3C,SAEyB,iBAAiB,EAAE,OAAO,CAAS;IAE5D,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAE9C,OAAO,CAAC,gBAAgB,CAQtB;IAEF,OAAO,CAAC,2BAA2B,CAAkB;cAElC,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAgBzD,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAK3D,MAAM,IAAI,cAAc,GAAG,IAAI;IAKlD,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,uCAAuC;IAwC/C,OAAO,CAAC,iBAAiB;IAqCzB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,wBAAwB;IA+BhC,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,wBAAwB;IA4ChC,OAAO,CAAC,6BAA6B;IA0BrC,OAAO,CAAC,yBAAyB;IA2EjC,OAAO,CAAC,4BAA4B;IA0CpC,OAAO,CAAC,2BAA2B;IAyCnC;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,yBAAyB;IAuBjC,OAAO,CAAC,8BAA8B;CAyBvC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,sBAAsB,EAAE,yBAAyB,CAAC;KACnD;CACF"}
|
|
@@ -16,8 +16,8 @@ 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
|
-
import "../seat-reservation-navigation
|
|
20
|
-
import "
|
|
19
|
+
import "../seat-reservation-navigation-coach.js";
|
|
20
|
+
import "../seat-reservation-scoped.js";
|
|
21
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
23
|
var g, m, f, $, C, c;
|
|
@@ -133,8 +133,8 @@ let me = (() => {
|
|
|
133
133
|
>
|
|
134
134
|
${this.seatReservation?.coachItems.map((e, t) => d`<li>
|
|
135
135
|
<sbb-seat-reservation-navigation-coach
|
|
136
|
-
@
|
|
137
|
-
@
|
|
136
|
+
@selectcoach=${(i) => this._onSelectNavCoach(i)}
|
|
137
|
+
@focuscoach=${() => this._onFocusNavCoach()}
|
|
138
138
|
index="${t}"
|
|
139
139
|
coach-id="${e.id}"
|
|
140
140
|
.selected=${this.selectedCoachIndex === t}
|
|
@@ -229,7 +229,7 @@ let me = (() => {
|
|
|
229
229
|
cell-id="cell-${t}-${i.position.y}-${s}"
|
|
230
230
|
>
|
|
231
231
|
<sbb-seat-reservation-place-control
|
|
232
|
-
@
|
|
232
|
+
@selectplace=${(v) => this._onSelectPlace(v)}
|
|
233
233
|
exportparts="sbb-sr-place-part"
|
|
234
234
|
id="seat-reservation__place-button-${t}-${i.number}"
|
|
235
235
|
class="seat-reservation-place-control"
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { EventEmitter } from '@sbb-esta/lyne-elements/core/eventing.js';
|
|
2
1
|
import { CSSResultGroup, PropertyValues, TemplateResult, LitElement } from 'lit';
|
|
3
|
-
import { PlaceTravelClass } from '
|
|
2
|
+
import { PlaceTravelClass } from '../common.js';
|
|
4
3
|
export type SelectCoachEventDetails = number;
|
|
5
4
|
/**
|
|
6
5
|
* This component will display the navigation coach item for Seat reservation.
|
|
7
|
-
*
|
|
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
|
|
10
6
|
*/
|
|
11
7
|
export declare class SbbSeatReservationNavigationCoachElement extends LitElement {
|
|
12
8
|
static styles: CSSResultGroup;
|
|
13
9
|
static readonly events: {
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
10
|
+
readonly selectcoach: "selectcoach";
|
|
11
|
+
readonly focuscoach: "focuscoach";
|
|
16
12
|
};
|
|
17
13
|
/** Coach ID, which is used to identify the coach in the navigation */
|
|
18
14
|
accessor coachId: string;
|
|
@@ -34,9 +30,6 @@ export declare class SbbSeatReservationNavigationCoachElement extends LitElement
|
|
|
34
30
|
/** If the coach navigation should be displayed vertically */
|
|
35
31
|
accessor vertical: boolean;
|
|
36
32
|
private _language;
|
|
37
|
-
/** Emits when a coach within the navigation was selected */
|
|
38
|
-
protected selectNavCoach: EventEmitter<SelectCoachEventDetails>;
|
|
39
|
-
protected focusNavCoach: EventEmitter<void>;
|
|
40
33
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
41
34
|
/**
|
|
42
35
|
* Render a maximum of 3 of the service sign icons (slice(0,3)) regardless of the input from Backend,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-reservation-navigation-coach.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.ts"],"names":[],"mappings":"AAEA,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,cAAc,CAAC;AAIrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,4CAA4C,CAAC;AAIpD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE7C;;GAEG;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;cAEjC,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAwB5E;;;;;;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;IAgBvB,OAAO,CAAC,2BAA2B;CASpC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,uCAAuC,EAAE,wCAAwC,CAAC;KACnF;CACF"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
var
|
|
1
|
+
var lt = (o) => {
|
|
2
2
|
throw TypeError(o);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var l = (o, n, c) => (
|
|
4
|
+
var bt = (o, n, c) => n.has(o) || lt("Cannot " + c);
|
|
5
|
+
var l = (o, n, c) => (bt(o, n, "read from private field"), c ? c.call(o) : n.get(o)), b = (o, n, c) => n.has(o) ? lt("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(o) : n.set(o, c), s = (o, n, c, h) => (bt(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
|
-
import { SbbLanguageController as
|
|
7
|
+
import { SbbLanguageController as _t } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
8
|
import { forceType as _ } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { getI18nSeatReservation as w } from "../../common/translations.js";
|
|
9
|
+
import { css as gt, LitElement as ut, nothing as E, html as g } from "lit";
|
|
10
|
+
import { customElement as mt, property as v } from "lit/decorators.js";
|
|
11
|
+
import { classMap as dt } from "lit/directives/class-map.js";
|
|
12
|
+
import { getI18nSeatReservation as w } from "../common/translations.js";
|
|
14
13
|
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
15
14
|
import "../seat-reservation-navigation-services.js";
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
var u, m, f, p, x, y,
|
|
19
|
-
let o = [
|
|
20
|
-
|
|
15
|
+
const ft = gt`*,: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}`, pt = 3;
|
|
16
|
+
let $t = (() => {
|
|
17
|
+
var u, m, f, p, x, y, I, C, k, A, S, r;
|
|
18
|
+
let o = [mt("sbb-seat-reservation-navigation-coach")], n, c = [], h, z = ut, B, $ = [], N = [], T, D = [], R = [], 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 = [];
|
|
19
|
+
return r = class extends z {
|
|
21
20
|
constructor() {
|
|
22
21
|
super(...arguments);
|
|
23
22
|
b(this, u);
|
|
@@ -26,12 +25,12 @@ let Rt = (() => {
|
|
|
26
25
|
b(this, p);
|
|
27
26
|
b(this, x);
|
|
28
27
|
b(this, y);
|
|
29
|
-
b(this, C);
|
|
30
28
|
b(this, I);
|
|
29
|
+
b(this, C);
|
|
31
30
|
b(this, k);
|
|
32
|
-
b(this, S);
|
|
33
31
|
b(this, A);
|
|
34
|
-
|
|
32
|
+
b(this, S);
|
|
33
|
+
s(this, u, i(this, $, "")), s(this, m, (i(this, N), i(this, D, []))), s(this, f, (i(this, R), i(this, L, !1))), s(this, p, (i(this, V), i(this, H, !1))), s(this, x, (i(this, G), i(this, U, 0))), s(this, y, (i(this, q), i(this, M, ["ANY_CLASS"]))), s(this, I, (i(this, Y), i(this, X, !1))), s(this, C, (i(this, J), i(this, W, !1))), s(this, k, (i(this, Z), i(this, at, !1))), s(this, A, (i(this, et), i(this, it, !1))), s(this, S, (i(this, rt), i(this, nt, !1))), this._language = (i(this, ct), new _t(this));
|
|
35
34
|
}
|
|
36
35
|
/** Coach ID, which is used to identify the coach in the navigation */
|
|
37
36
|
get coachId() {
|
|
@@ -76,17 +75,17 @@ let Rt = (() => {
|
|
|
76
75
|
}
|
|
77
76
|
/** If the coach is a driver/restricted area */
|
|
78
77
|
get driverArea() {
|
|
79
|
-
return l(this,
|
|
78
|
+
return l(this, I);
|
|
80
79
|
}
|
|
81
80
|
set driverArea(a) {
|
|
82
|
-
s(this,
|
|
81
|
+
s(this, I, a);
|
|
83
82
|
}
|
|
84
83
|
/** If the coach is the first in the navigation */
|
|
85
84
|
get first() {
|
|
86
|
-
return l(this,
|
|
85
|
+
return l(this, C);
|
|
87
86
|
}
|
|
88
87
|
set first(a) {
|
|
89
|
-
s(this,
|
|
88
|
+
s(this, C, a);
|
|
90
89
|
}
|
|
91
90
|
/** If the coach is the last in the navigation */
|
|
92
91
|
get last() {
|
|
@@ -97,22 +96,22 @@ let Rt = (() => {
|
|
|
97
96
|
}
|
|
98
97
|
/** Disable the coach navigation */
|
|
99
98
|
get disable() {
|
|
100
|
-
return l(this,
|
|
99
|
+
return l(this, A);
|
|
101
100
|
}
|
|
102
101
|
set disable(a) {
|
|
103
|
-
s(this,
|
|
102
|
+
s(this, A, a);
|
|
104
103
|
}
|
|
105
104
|
/** If the coach navigation should be displayed vertically */
|
|
106
105
|
get vertical() {
|
|
107
|
-
return l(this,
|
|
106
|
+
return l(this, S);
|
|
108
107
|
}
|
|
109
108
|
set vertical(a) {
|
|
110
|
-
s(this,
|
|
109
|
+
s(this, S, a);
|
|
111
110
|
}
|
|
112
111
|
willUpdate(a) {
|
|
113
112
|
if (super.willUpdate(a), a.has("selected")) {
|
|
114
113
|
const t = this.shadowRoot?.querySelector(".sbb-sr-navigation__ctrl-button");
|
|
115
|
-
this.selected && t && (t.focus(), this.
|
|
114
|
+
this.selected && t && (t.focus(), this.dispatchEvent(new Event("focuscoach", { bubbles: !0, composed: !0 })));
|
|
116
115
|
}
|
|
117
116
|
if (a.has("focused") && this.focused) {
|
|
118
117
|
const t = this.shadowRoot?.querySelector(".sbb-sr-navigation__ctrl-button");
|
|
@@ -127,9 +126,9 @@ let Rt = (() => {
|
|
|
127
126
|
* @protected
|
|
128
127
|
*/
|
|
129
128
|
render() {
|
|
130
|
-
return this.propertyIds = this.propertyIds.filter((a) => a !== "ANY_SEAT").slice(0,
|
|
129
|
+
return this.propertyIds = this.propertyIds.filter((a) => a !== "ANY_SEAT").slice(0, pt), g`
|
|
131
130
|
<div
|
|
132
|
-
class="${
|
|
131
|
+
class="${dt({
|
|
133
132
|
"sbb-sr-navigation__item-coach": !0,
|
|
134
133
|
"last-coach": this.last,
|
|
135
134
|
"first-coach": this.first,
|
|
@@ -150,7 +149,7 @@ let Rt = (() => {
|
|
|
150
149
|
return g` <button
|
|
151
150
|
type="button"
|
|
152
151
|
?disabled="${this.disable}"
|
|
153
|
-
class="${
|
|
152
|
+
class="${dt({
|
|
154
153
|
"sbb-sr-navigation__ctrl-button": !0,
|
|
155
154
|
"sbb-sr-navigation-driver-area": this.driverArea
|
|
156
155
|
})}"
|
|
@@ -188,8 +187,8 @@ let Rt = (() => {
|
|
|
188
187
|
]);
|
|
189
188
|
let t = w("NAVIGATE_TO_COACH", this._language.current, [this.coachId]);
|
|
190
189
|
if (a) {
|
|
191
|
-
const
|
|
192
|
-
t = t.concat(
|
|
190
|
+
const vt = w(a === 1 ? "SERVICE_CLASS_FIRST" : "SERVICE_CLASS_SECOND", this._language.current), ht = w("NAVIGATE_TO_COACH_SERVICE_CLASS_SUB", this._language.current, [vt]);
|
|
191
|
+
t = t.concat(ht);
|
|
193
192
|
}
|
|
194
193
|
return t;
|
|
195
194
|
}
|
|
@@ -203,42 +202,45 @@ let Rt = (() => {
|
|
|
203
202
|
* @private
|
|
204
203
|
*/
|
|
205
204
|
_selectNavCoach(a) {
|
|
206
|
-
this.driverArea || this.
|
|
205
|
+
this.driverArea || this.dispatchEvent(new CustomEvent("selectcoach", {
|
|
206
|
+
bubbles: !0,
|
|
207
|
+
composed: !0,
|
|
208
|
+
detail: a
|
|
209
|
+
}));
|
|
207
210
|
}
|
|
208
211
|
_getCoachServiceClassNumber() {
|
|
209
212
|
return this.travelClass?.includes("FIRST") ? 1 : this.travelClass?.includes("SECOND") ? 2 : null;
|
|
210
213
|
}
|
|
211
|
-
}, u = new WeakMap(), m = new WeakMap(), f = new WeakMap(), p = new WeakMap(), x = new WeakMap(), y = new WeakMap(),
|
|
212
|
-
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
213
|
-
B = [_(), v({ attribute: "coach-id" })],
|
|
214
|
+
}, u = new WeakMap(), m = new WeakMap(), f = new WeakMap(), p = new WeakMap(), x = new WeakMap(), y = new WeakMap(), I = new WeakMap(), C = new WeakMap(), k = new WeakMap(), A = new WeakMap(), S = new WeakMap(), h = r, (() => {
|
|
215
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(z[Symbol.metadata] ?? null) : void 0;
|
|
216
|
+
B = [_(), v({ attribute: "coach-id" })], T = [v({ attribute: "property-ids", type: Array })], O = [_(), v({ type: Boolean })], j = [_(), v({ type: Boolean })], K = [_(), v({ type: Number })], F = [v({ attribute: "travel-class", type: Array })], P = [_(), v({ attribute: "driver-area", type: Boolean })], Q = [_(), v({ type: Boolean })], tt = [_(), v({ type: Boolean })], st = [_(), v({ attribute: "disable", type: Boolean })], ot = [_(), 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) => {
|
|
214
217
|
t.coachId = e;
|
|
215
|
-
} }, metadata: a }, $,
|
|
218
|
+
} }, metadata: a }, $, N), d(r, null, T, { kind: "accessor", name: "propertyIds", static: !1, private: !1, access: { has: (t) => "propertyIds" in t, get: (t) => t.propertyIds, set: (t, e) => {
|
|
216
219
|
t.propertyIds = e;
|
|
217
|
-
} }, metadata: a }, D,
|
|
220
|
+
} }, metadata: a }, D, R), d(r, null, O, { kind: "accessor", name: "selected", static: !1, private: !1, access: { has: (t) => "selected" in t, get: (t) => t.selected, set: (t, e) => {
|
|
218
221
|
t.selected = e;
|
|
219
|
-
} }, metadata: a },
|
|
222
|
+
} }, metadata: a }, L, V), d(r, null, j, { kind: "accessor", name: "focused", static: !1, private: !1, access: { has: (t) => "focused" in t, get: (t) => t.focused, set: (t, e) => {
|
|
220
223
|
t.focused = e;
|
|
221
|
-
} }, metadata: a },
|
|
224
|
+
} }, metadata: a }, H, G), d(r, null, K, { kind: "accessor", name: "index", static: !1, private: !1, access: { has: (t) => "index" in t, get: (t) => t.index, set: (t, e) => {
|
|
222
225
|
t.index = e;
|
|
223
|
-
} }, metadata: a },
|
|
226
|
+
} }, metadata: a }, U, q), d(r, null, F, { kind: "accessor", name: "travelClass", static: !1, private: !1, access: { has: (t) => "travelClass" in t, get: (t) => t.travelClass, set: (t, e) => {
|
|
224
227
|
t.travelClass = e;
|
|
225
|
-
} }, metadata: a },
|
|
228
|
+
} }, metadata: a }, M, Y), d(r, null, P, { kind: "accessor", name: "driverArea", static: !1, private: !1, access: { has: (t) => "driverArea" in t, get: (t) => t.driverArea, set: (t, e) => {
|
|
226
229
|
t.driverArea = e;
|
|
227
|
-
} }, metadata: a },
|
|
230
|
+
} }, metadata: a }, X, J), d(r, null, Q, { kind: "accessor", name: "first", static: !1, private: !1, access: { has: (t) => "first" in t, get: (t) => t.first, set: (t, e) => {
|
|
228
231
|
t.first = e;
|
|
229
|
-
} }, metadata: a },
|
|
232
|
+
} }, metadata: a }, W, Z), d(r, null, tt, { kind: "accessor", name: "last", static: !1, private: !1, access: { has: (t) => "last" in t, get: (t) => t.last, set: (t, e) => {
|
|
230
233
|
t.last = e;
|
|
231
|
-
} }, metadata: a },
|
|
234
|
+
} }, metadata: a }, at, et), d(r, null, st, { kind: "accessor", name: "disable", static: !1, private: !1, access: { has: (t) => "disable" in t, get: (t) => t.disable, set: (t, e) => {
|
|
232
235
|
t.disable = e;
|
|
233
|
-
} }, metadata: a },
|
|
236
|
+
} }, metadata: a }, it, rt), d(r, null, ot, { kind: "accessor", name: "vertical", static: !1, private: !1, access: { has: (t) => "vertical" in t, get: (t) => t.vertical, set: (t, e) => {
|
|
234
237
|
t.vertical = e;
|
|
235
|
-
} }, metadata: a },
|
|
236
|
-
})(), r.styles =
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}, i(h, c),
|
|
240
|
-
return z = h;
|
|
238
|
+
} }, metadata: a }, nt, ct), d(null, n = { value: h }, o, { kind: "class", name: h.name, metadata: a }, null, c), h = n.value, a && Object.defineProperty(h, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
239
|
+
})(), r.styles = ft, r.events = {
|
|
240
|
+
selectcoach: "selectcoach",
|
|
241
|
+
focuscoach: "focuscoach"
|
|
242
|
+
}, i(h, c), h;
|
|
241
243
|
})();
|
|
242
244
|
export {
|
|
243
|
-
|
|
245
|
+
$t as SbbSeatReservationNavigationCoachElement
|
|
244
246
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-reservation-navigation-coach.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/seat-reservation/seat-reservation-navigation-coach.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,oFAAoF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-reservation-navigation-services.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAW,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AACxE,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAMvC,OAAO,+CAA+C,CAAC;AACvD,OAAO,gCAAgC,CAAC;AAIxC;;;GAGG;AACH,qBAEM,2CAA4C,SAAQ,UAAU;IAClE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,2FAA2F;IAC3F,SACgB,WAAW,EAAE,MAAM,EAAE,CAAM;IAE3C,0DAA0D;IAC1D,SAEgB,QAAQ,EAAE,OAAO,CAAS;IAE1C,OAAO,CAAC,SAAS,CAAmC;cAEjC,MAAM,IAAI,cAAc;IA4B3C,OAAO,CAAC,2BAA2B;CAcpC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,0CAA0C,EAAE,2CAA2C,CAAC;KACzF;CACF"}
|
|
@@ -9,9 +9,9 @@ import { forceType as w } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
|
9
9
|
import { css as A, LitElement as j, nothing as z, html as E } from "lit";
|
|
10
10
|
import { customElement as C, property as D } from "lit/decorators.js";
|
|
11
11
|
import { classMap as k } from "lit/directives/class-map.js";
|
|
12
|
-
import { getI18nSeatReservation as m } from "
|
|
12
|
+
import { getI18nSeatReservation as m } from "../common.js";
|
|
13
13
|
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
14
|
-
import "
|
|
14
|
+
import "../seat-reservation-graphic.js";
|
|
15
15
|
const O = A`*,:before,:after{box-sizing:border-box}.sbb-sr-navigation__signs{display:flex;justify-content:center;flex-wrap:wrap;gap:var(--sbb-spacing-fixed-2x);color:var(--sbb-color-granite)}.sbb-sr-navigation__signs--vertical{align-content:center;height:100%}`;
|
|
16
16
|
let J = (() => {
|
|
17
17
|
var o, c, l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-reservation-navigation-services.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/seat-reservation/seat-reservation-navigation-services.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,0FAA0F,CAAC"}
|