@sbb-esta/lyne-elements-experimental 3.4.0 → 3.6.0
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 +105 -173
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts.map +1 -1
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +8 -4
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +18 -0
- 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 +57 -25
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +0 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +46 -50
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +5 -5
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +1 -10
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +4 -83
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +16 -17
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +11 -14
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +0 -8
- 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 +30 -100
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -4
- package/package.json +2 -2
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts.map +1 -1
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +30 -26
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +18 -0
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +70 -46
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts +0 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.js +134 -135
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +6 -6
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +1 -10
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +47 -90
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +75 -76
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +32 -35
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +0 -8
- 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 +92 -129
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-reservation-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation-base-element.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"seat-reservation-base-element.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reserv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AC,yCAAyC;IA6BjD;;;;;OAKG;IACH,OAAO,CAAC,8BAA8B;IAgHtC,OAAO,CAAC,kCAAkC;IAoE1C,OAAO,CAAC,0BAA0B;IAmClC,SAAS,CAAC,0BAA0B,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM;IAOnE,SAAS,CAAC,0BAA0B,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM;IAKnE,SAAS,CAAC,mCAAmC,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI;IA0BnF,OAAO,CAAC,oCAAoC;IA+B5C,SAAS,CAAC,iCAAiC,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI;IAgBjF,SAAS,CAAC,0BAA0B,IAAI,IAAI;IAmB5C;;;OAGG;IACH,OAAO,CAAC,kCAAkC;IAwB1C;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,iCAAiC;IAiBzC,OAAO,CAAC,gCAAgC;IAUxC,OAAO,CAAC,8BAA8B;IActC;;;SAGK;IACL,OAAO,CAAC,sBAAsB;IAS9B;;SAEK;IACL,OAAO,CAAC,uBAAuB;IAyB/B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;CAK7B"}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ve = (h) => {
|
|
2
2
|
throw TypeError(h);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var g = (h, d, u) => (
|
|
4
|
+
var fe = (h, d, u) => d.has(h) || ve("Cannot " + u);
|
|
5
|
+
var g = (h, d, u) => (fe(h, d, "read from private field"), u ? u.call(h) : d.get(h)), v = (h, d, u) => d.has(h) ? ve("Cannot add the same private member more than once") : d instanceof WeakSet ? d.add(h) : d.set(h, u), o = (h, d, u, w) => (fe(h, d, "write to private field"), w ? w.call(h, u) : d.set(h, u), u);
|
|
6
6
|
import { __runInitializers as r, __esDecorate as f } from "tslib";
|
|
7
|
-
import { isArrowKeyOrPageKeysPressed as
|
|
8
|
-
import { forceType as
|
|
9
|
-
import { LitElement as
|
|
10
|
-
import { property as
|
|
11
|
-
import { mapPlaceInfosToPlaceSelection as
|
|
7
|
+
import { isArrowKeyOrPageKeysPressed as Se } from "@sbb-esta/lyne-elements/core/a11y.js";
|
|
8
|
+
import { forceType as C } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
+
import { LitElement as Ce, isServer as xe } from "lit";
|
|
10
|
+
import { property as S, state as T, eventOptions as Ie } from "lit/decorators.js";
|
|
11
|
+
import { mapPlaceInfosToPlaceSelection as pe, mapPlaceAndCoachToSeatReservationPlaceSelection as me, mapCoachInfosToCoachSelection as be } from "../common/mapper.js";
|
|
12
12
|
var x;
|
|
13
13
|
(function(h) {
|
|
14
14
|
h.right = "right", h.left = "left";
|
|
15
15
|
})(x || (x = {}));
|
|
16
|
-
let
|
|
17
|
-
var I, p, b,
|
|
18
|
-
let h =
|
|
16
|
+
let we = (() => {
|
|
17
|
+
var I, p, m, b, _, y, P, A, R, k, E, N, n;
|
|
18
|
+
let h = Ce, d = [], u, w = [], B = [], D, z = [], F = [], G, V = [], O = [], L, W = [], X = [], H, K = [], U = [], q, M = [], $ = [], j, J = [], Q = [], Y, Z = [], ee = [], te, ie = [], se = [], ae, ce = [], oe = [], re, le = [], he = [], ne, de = [], ue = [], ge;
|
|
19
19
|
return n = class extends h {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
22
|
v(this, I);
|
|
23
23
|
v(this, p);
|
|
24
|
-
v(this, b);
|
|
25
24
|
v(this, m);
|
|
26
|
-
v(this,
|
|
25
|
+
v(this, b);
|
|
27
26
|
v(this, _);
|
|
27
|
+
v(this, y);
|
|
28
28
|
v(this, P);
|
|
29
29
|
v(this, A);
|
|
30
30
|
v(this, R);
|
|
31
31
|
v(this, k);
|
|
32
32
|
v(this, E);
|
|
33
33
|
v(this, N);
|
|
34
|
-
o(this, I, r(this,
|
|
34
|
+
o(this, I, (r(this, d), r(this, w, null))), o(this, p, (r(this, B), r(this, z, !0))), o(this, m, (r(this, F), r(this, V, !1))), o(this, b, (r(this, O), r(this, W, 16))), o(this, _, (r(this, X), r(this, K, null))), o(this, y, (r(this, U), r(this, M, -1))), o(this, P, (r(this, $), r(this, J, -1))), o(this, A, (r(this, Q), r(this, Z, !1))), o(this, R, (r(this, ee), r(this, ie, -1))), o(this, k, (r(this, se), r(this, ce, -1))), o(this, E, (r(this, oe), r(this, le, -1))), o(this, N, (r(this, he), r(this, de, -1))), this.coachBorderPadding = (r(this, ue), 6), this.gapBetweenCoaches = 4, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.gapBetweenCoachDecks = 48, this.coachNavButtonDim = 0, this.currScrollDirection = x.right, this.maxCalcCoachsWidth = 0, this.scrollCoachsAreaWidth = 0, this.scrollNavigationAreaDim = 0, this.triggerCoachPositionsCollection = [], this.firstTabElement = null, this.lastTabElement = null, this.navigationScrollArea = null, this.coachScrollArea = null, this.currSelectedPlace = null, this.currSelectedPlaceElementId = null, this.currSelectedCoachIndex = -1, this.currSelectedDeckIndex = 0, this.preventCoachScrollByPlaceClick = !1, this.selectedSeatReservationPlaces = {
|
|
35
35
|
seats: [],
|
|
36
36
|
bicycles: []
|
|
37
37
|
}, this.seatReservationWithoutNavigationHasFocus = !1, this.isCoachGridFocusable = !1, this.isAutoScrolling = !1, this.isKeyboardNavigation = !1, this.hasMultipleDecks = !1, this.keyboardNavigationEvents = {
|
|
@@ -59,31 +59,31 @@ let Re = (() => {
|
|
|
59
59
|
}
|
|
60
60
|
/** The seat reservation area is aligned vertically */
|
|
61
61
|
get alignVertical() {
|
|
62
|
-
return g(this,
|
|
62
|
+
return g(this, m);
|
|
63
63
|
}
|
|
64
64
|
set alignVertical(e) {
|
|
65
|
-
o(this,
|
|
65
|
+
o(this, m, e);
|
|
66
66
|
}
|
|
67
67
|
/** The seat reservation area's base grid size */
|
|
68
68
|
get baseGridSize() {
|
|
69
|
-
return g(this,
|
|
69
|
+
return g(this, b);
|
|
70
70
|
}
|
|
71
71
|
set baseGridSize(e) {
|
|
72
|
-
o(this,
|
|
72
|
+
o(this, b, e);
|
|
73
73
|
}
|
|
74
74
|
/** The seat reservation area's width */
|
|
75
75
|
get height() {
|
|
76
|
-
return g(this,
|
|
76
|
+
return g(this, _);
|
|
77
77
|
}
|
|
78
78
|
set height(e) {
|
|
79
|
-
o(this,
|
|
79
|
+
o(this, _, e);
|
|
80
80
|
}
|
|
81
81
|
/** Maximal number of possible clickable seats */
|
|
82
82
|
get maxSeatReservations() {
|
|
83
|
-
return g(this,
|
|
83
|
+
return g(this, y);
|
|
84
84
|
}
|
|
85
85
|
set maxSeatReservations(e) {
|
|
86
|
-
o(this,
|
|
86
|
+
o(this, y, e);
|
|
87
87
|
}
|
|
88
88
|
/** Maximal number of possible clickable bicycle places */
|
|
89
89
|
get maxBicycleReservations() {
|
|
@@ -141,7 +141,7 @@ let Re = (() => {
|
|
|
141
141
|
* in order to avoid recurring iteration processes in rendering.
|
|
142
142
|
*/
|
|
143
143
|
initPrepairSeatReservationData() {
|
|
144
|
-
this._prepairCoachDriverArea();
|
|
144
|
+
this._determineBaseFontSize(), this._prepairCoachDriverArea();
|
|
145
145
|
}
|
|
146
146
|
/* Init scroll event handling for coach navigation */
|
|
147
147
|
initNavigationSelectionByScrollEvent() {
|
|
@@ -168,12 +168,18 @@ let Re = (() => {
|
|
|
168
168
|
end: t,
|
|
169
169
|
width: c
|
|
170
170
|
};
|
|
171
|
-
}), this.maxCalcCoachsWidth = t
|
|
172
|
-
const i = this.isAutoScrolling ? this.currSelectedCoachIndex : this._getCoachIndexByScrollTriggerPosition();
|
|
173
|
-
this.currSelectedCoachIndex === -1 && (this.currSelectedCoachIndex = i), this._isScrollableToSelectedCoach() ? this.currSelectedCoachIndex = i : this.currSelectedCoachIndex = i < this.currSelectedCoachIndex ? this.currSelectedCoachIndex : i, this.isAutoScrolling || this._scrollToSelectedNavigationButton(i), this.preventCoachScrollByPlaceClick = !1, this.updateCurrentSelectedCoach(), this.hasNavigation || (this.preselectPlaceInCoach(), this.isAutoScrolling = !1);
|
|
174
|
-
});
|
|
171
|
+
}), this.maxCalcCoachsWidth = t;
|
|
175
172
|
}
|
|
176
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Scroll event handler managed the end of scrolling inside the coach scroll area.
|
|
176
|
+
* Timeout event handling to check if the scrolling has been completed.
|
|
177
|
+
* It is required because the Safari browser does not handle scrollend event
|
|
178
|
+
* and we therefore imitate this event -> scrollend.
|
|
179
|
+
*/
|
|
180
|
+
coachAreaScrollend() {
|
|
181
|
+
this._scrollTimeout && clearTimeout(this._scrollTimeout), this._scrollTimeout = setTimeout(() => this._handleCoachAreaScrollEvent(), 150);
|
|
182
|
+
}
|
|
177
183
|
/**
|
|
178
184
|
* If no navigation exists (property setting -> hasNavigation) and a table coach gets the focus,
|
|
179
185
|
* the first place in the coach must be automatically preselected to control the place navigation via keyboard
|
|
@@ -199,7 +205,7 @@ let Re = (() => {
|
|
|
199
205
|
return;
|
|
200
206
|
}
|
|
201
207
|
}
|
|
202
|
-
if (this.currSelectedCoachIndex !== -1 &&
|
|
208
|
+
if (this.currSelectedCoachIndex !== -1 && Se(e))
|
|
203
209
|
switch (e.preventDefault(), t) {
|
|
204
210
|
case this.keyboardNavigationEvents.ArrowLeft:
|
|
205
211
|
{
|
|
@@ -284,6 +290,14 @@ let Re = (() => {
|
|
|
284
290
|
const t = { seats: 0, bicycles: 0 }, i = this.seatReservations[this.currSelectedDeckIndex].coachItems[e].places?.reduce((s, c) => (c.state !== "FREE" || (c.type === "SEAT" ? s.seats++ : s.bicycles++), s), t);
|
|
285
291
|
return i || t;
|
|
286
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* At the end of a scroll Event from the coach scrollable area,
|
|
295
|
+
* the reached coach is marked as selected
|
|
296
|
+
*/
|
|
297
|
+
_handleCoachAreaScrollEvent() {
|
|
298
|
+
const e = this.isAutoScrolling ? this.currSelectedCoachIndex : this._getCoachIndexByScrollTriggerPosition();
|
|
299
|
+
this.currSelectedCoachIndex === -1 && (this.currSelectedCoachIndex = e), this._isScrollableToSelectedCoach() ? this.currSelectedCoachIndex = e : this.currSelectedCoachIndex = e < this.currSelectedCoachIndex ? this.currSelectedCoachIndex : e, this.isAutoScrolling || this._scrollToSelectedNavigationButton(e), this.preventCoachScrollByPlaceClick = !1, this.updateCurrentSelectedCoach(), this.hasNavigation || (this.preselectPlaceInCoach(), this.isAutoScrolling = !1);
|
|
300
|
+
}
|
|
287
301
|
/**
|
|
288
302
|
* Performs an automatic main navigation scroll to the specified selectedNavCoachIndex.
|
|
289
303
|
* Calculates the central scroll offset of the nav coach to be selected.
|
|
@@ -457,7 +471,7 @@ let Re = (() => {
|
|
|
457
471
|
_initSeatReservationPlaceSelection() {
|
|
458
472
|
this.seatReservations?.forEach((e) => e.coachItems.map((t, i) => {
|
|
459
473
|
t.places?.filter((s) => s.state === "SELECTED")?.forEach((s) => {
|
|
460
|
-
const c =
|
|
474
|
+
const c = pe(s, e.deckCoachIndex, i), l = this._getSeatReservationPlaceSelection(c);
|
|
461
475
|
l && (l.placeType === "SEAT" ? this.selectedSeatReservationPlaces.seats.push(l) : this.selectedSeatReservationPlaces.bicycles.push(l));
|
|
462
476
|
});
|
|
463
477
|
}));
|
|
@@ -477,17 +491,27 @@ let Re = (() => {
|
|
|
477
491
|
}
|
|
478
492
|
_getSeatReservationPlaceSelection(e) {
|
|
479
493
|
const t = this.seatReservations[this.currSelectedDeckIndex].coachItems[e.coachIndex], i = t.places?.find((s) => s.number === e.number);
|
|
480
|
-
return i ?
|
|
494
|
+
return i ? me(i, t, e.deckIndex, e.coachIndex) : null;
|
|
481
495
|
}
|
|
482
496
|
_getSeatReservationSelectedCoach(e) {
|
|
483
497
|
if (!this.seatReservations[this.currSelectedDeckIndex].coachItems[e])
|
|
484
498
|
return null;
|
|
485
499
|
const t = this.seatReservations[this.currSelectedDeckIndex].coachItems[e], i = this.getAvailableFreePlacesNumFromCoach(e);
|
|
486
|
-
return
|
|
500
|
+
return be(e, t, i);
|
|
487
501
|
}
|
|
488
502
|
_setCurrSelectedPlaceElementId(e) {
|
|
489
503
|
e ? this.currSelectedPlaceElementId = "seat-reservation__place-button-" + this.currSelectedDeckIndex + "-" + this.currSelectedCoachIndex + "-" + e.number : this.currSelectedPlaceElementId = null;
|
|
490
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* Preparation of the used documents font-size which needs
|
|
507
|
+
* to be determined in order to correctly calculate css values with rem
|
|
508
|
+
* */
|
|
509
|
+
_determineBaseFontSize() {
|
|
510
|
+
if (!xe) {
|
|
511
|
+
const t = 1 / parseInt(window.getComputedStyle(document.body).fontSize, 10);
|
|
512
|
+
this.style?.setProperty("--sbb-seat-reservation-one-px-rem", `${t + "rem"}`);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
491
515
|
/**
|
|
492
516
|
* Prepares all coaches with the values for whether there is a driver area left or right
|
|
493
517
|
* */
|
|
@@ -513,38 +537,38 @@ let Re = (() => {
|
|
|
513
537
|
_getPlaceHtmlElement() {
|
|
514
538
|
return this.currSelectedPlaceElementId && this.shadowRoot?.getElementById(this.currSelectedPlaceElementId) || null;
|
|
515
539
|
}
|
|
516
|
-
}, I = new WeakMap(), p = new WeakMap(),
|
|
540
|
+
}, I = new WeakMap(), p = new WeakMap(), m = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), y = new WeakMap(), P = new WeakMap(), A = new WeakMap(), R = new WeakMap(), k = new WeakMap(), E = new WeakMap(), N = new WeakMap(), (() => {
|
|
517
541
|
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(h[Symbol.metadata] ?? null) : void 0;
|
|
518
|
-
|
|
542
|
+
u = [S({ attribute: "seat-reservations", type: Array })], D = [C(), S({ attribute: "has-navigation", type: Boolean })], G = [C(), S({ attribute: "align-vertical", type: Boolean, reflect: !0, useDefault: !0 })], L = [C(), S({ attribute: "base-grid-size", type: Number })], H = [C(), S({ attribute: "height", type: Number })], q = [C(), S({ attribute: "max-seat-reservations", type: Number })], j = [C(), S({ attribute: "max-bicycle-reservations", type: Number })], Y = [C(), S({ attribute: "prevent-place-click", type: Boolean })], te = [C(), S({ attribute: "preselect-coach-index", type: Number })], ae = [T()], re = [T()], ne = [T()], ge = [Ie({ passive: !0 })], f(n, null, u, { kind: "accessor", name: "seatReservations", static: !1, private: !1, access: { has: (t) => "seatReservations" in t, get: (t) => t.seatReservations, set: (t, i) => {
|
|
519
543
|
t.seatReservations = i;
|
|
520
|
-
} }, metadata: e },
|
|
544
|
+
} }, metadata: e }, w, B), f(n, null, D, { kind: "accessor", name: "hasNavigation", static: !1, private: !1, access: { has: (t) => "hasNavigation" in t, get: (t) => t.hasNavigation, set: (t, i) => {
|
|
521
545
|
t.hasNavigation = i;
|
|
522
|
-
} }, metadata: e },
|
|
546
|
+
} }, metadata: e }, z, F), f(n, null, G, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, i) => {
|
|
523
547
|
t.alignVertical = i;
|
|
524
|
-
} }, metadata: e },
|
|
548
|
+
} }, metadata: e }, V, O), f(n, null, L, { kind: "accessor", name: "baseGridSize", static: !1, private: !1, access: { has: (t) => "baseGridSize" in t, get: (t) => t.baseGridSize, set: (t, i) => {
|
|
525
549
|
t.baseGridSize = i;
|
|
526
|
-
} }, metadata: e },
|
|
550
|
+
} }, metadata: e }, W, X), f(n, null, H, { kind: "accessor", name: "height", static: !1, private: !1, access: { has: (t) => "height" in t, get: (t) => t.height, set: (t, i) => {
|
|
527
551
|
t.height = i;
|
|
528
|
-
} }, metadata: e },
|
|
552
|
+
} }, metadata: e }, K, U), f(n, null, q, { kind: "accessor", name: "maxSeatReservations", static: !1, private: !1, access: { has: (t) => "maxSeatReservations" in t, get: (t) => t.maxSeatReservations, set: (t, i) => {
|
|
529
553
|
t.maxSeatReservations = i;
|
|
530
|
-
} }, metadata: e },
|
|
554
|
+
} }, metadata: e }, M, $), f(n, null, j, { kind: "accessor", name: "maxBicycleReservations", static: !1, private: !1, access: { has: (t) => "maxBicycleReservations" in t, get: (t) => t.maxBicycleReservations, set: (t, i) => {
|
|
531
555
|
t.maxBicycleReservations = i;
|
|
532
|
-
} }, metadata: e },
|
|
556
|
+
} }, metadata: e }, J, Q), f(n, null, Y, { kind: "accessor", name: "preventPlaceClick", static: !1, private: !1, access: { has: (t) => "preventPlaceClick" in t, get: (t) => t.preventPlaceClick, set: (t, i) => {
|
|
533
557
|
t.preventPlaceClick = i;
|
|
534
|
-
} }, metadata: e },
|
|
558
|
+
} }, metadata: e }, Z, ee), f(n, null, te, { kind: "accessor", name: "preselectCoachIndex", static: !1, private: !1, access: { has: (t) => "preselectCoachIndex" in t, get: (t) => t.preselectCoachIndex, set: (t, i) => {
|
|
535
559
|
t.preselectCoachIndex = i;
|
|
536
|
-
} }, metadata: e },
|
|
560
|
+
} }, metadata: e }, ie, se), f(n, null, ae, { kind: "accessor", name: "selectedCoachIndex", static: !1, private: !1, access: { has: (t) => "selectedCoachIndex" in t, get: (t) => t.selectedCoachIndex, set: (t, i) => {
|
|
537
561
|
t.selectedCoachIndex = i;
|
|
538
|
-
} }, metadata: e },
|
|
562
|
+
} }, metadata: e }, ce, oe), f(n, null, re, { kind: "accessor", name: "focusedCoachIndex", static: !1, private: !1, access: { has: (t) => "focusedCoachIndex" in t, get: (t) => t.focusedCoachIndex, set: (t, i) => {
|
|
539
563
|
t.focusedCoachIndex = i;
|
|
540
|
-
} }, metadata: e },
|
|
564
|
+
} }, metadata: e }, le, he), f(n, null, ne, { kind: "accessor", name: "hoveredScrollCoachIndex", static: !1, private: !1, access: { has: (t) => "hoveredScrollCoachIndex" in t, get: (t) => t.hoveredScrollCoachIndex, set: (t, i) => {
|
|
541
565
|
t.hoveredScrollCoachIndex = i;
|
|
542
|
-
} }, metadata: e },
|
|
566
|
+
} }, metadata: e }, de, ue), f(n, null, ge, { kind: "method", name: "coachAreaScrollend", static: !1, private: !1, access: { has: (t) => "coachAreaScrollend" in t, get: (t) => t.coachAreaScrollend }, metadata: e }, null, d), e && Object.defineProperty(n, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
543
567
|
})(), n.events = {
|
|
544
568
|
selectedplaces: "selectedplaces",
|
|
545
569
|
selectedcoach: "selectedcoach"
|
|
546
570
|
}, n;
|
|
547
571
|
})();
|
|
548
572
|
export {
|
|
549
|
-
|
|
573
|
+
we as SeatReservationBaseElement
|
|
550
574
|
};
|
|
@@ -13,7 +13,6 @@ export declare class SbbSeatReservationElement extends SeatReservationBaseElemen
|
|
|
13
13
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
14
14
|
protected firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
15
15
|
protected render(): TemplateResult | null;
|
|
16
|
-
private _determineBaseFontSize;
|
|
17
16
|
private _initVehicleSeatReservationConstruction;
|
|
18
17
|
private _renderDeckLabels;
|
|
19
18
|
private _renderNavigationControlButton;
|
|
@@ -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":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAe1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGhF,OAAO,mCAAmC,CAAC;AAC3C,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;AACvC,OAAO,4CAA4C,CAAC;AAEpD;;;GAGG;AACH,qBAEM,yBAA0B,SAAQ,0BAA0B;IAChE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAE9C,OAAO,CAAC,gBAAgB,CAQtB;IAGF,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;cAc3D,MAAM,IAAI,cAAc,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"seat-reservation.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.component.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAe1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGhF,OAAO,mCAAmC,CAAC;AAC3C,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;AACvC,OAAO,4CAA4C,CAAC;AAEpD;;;GAGG;AACH,qBAEM,yBAA0B,SAAQ,0BAA0B;IAChE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAE9C,OAAO,CAAC,gBAAgB,CAQtB;IAGF,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;cAc3D,MAAM,IAAI,cAAc,GAAG,IAAI;IAKlD,OAAO,CAAC,uCAAuC;IAoD/C,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,8BAA8B;IAkCtC,O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