@sbb-esta/lyne-elements-experimental-dev 5.0.0-next.1-dev.1777525840 → 5.0.0-next.1-dev.1777528735
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 +220 -99
- package/development/seat-reservation/common/types.d.ts +3 -4
- package/development/seat-reservation/common/types.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +38 -7
- 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 +143 -32
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +2 -13
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +1 -1
- 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-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 +1 -1
- package/development/seat-reservation-area.component-DlH14rY-.js +94 -0
- package/development/seat-reservation-graphic.component-B771YtOf.js +129 -0
- package/development/{seat-reservation-navigation-coach.component-cSX-OEsP.js → seat-reservation-navigation-coach.component-CnA9MEBr.js} +3 -3
- package/development/seat-reservation.component-CZm8Lsj1.js +472 -0
- package/development/seat-reservation.js +4 -4
- package/development/seat-reservation.pure.js +4 -4
- package/package.json +2 -2
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +130 -77
- package/seat-reservation/seat-reservation/seat-reservation.component.js +1 -1
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +1 -1
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +1 -1
- package/{seat-reservation-area.component-CVc6uuMG.js → seat-reservation-area.component-B_T7k-dq.js} +1 -1
- package/seat-reservation-graphic.component-BNtFgIVM.js +102 -0
- package/{seat-reservation-navigation-coach.component-cYSUjsBj.js → seat-reservation-navigation-coach.component-BF2dTeIb.js} +2 -2
- package/{seat-reservation.component-80NgYHsf.js → seat-reservation.component-CNtc2Xcr.js} +74 -81
- package/seat-reservation.js +4 -4
- package/seat-reservation.pure.js +4 -4
- package/development/seat-reservation-area.component-BQEtJhk0.js +0 -94
- package/development/seat-reservation-graphic.component-XpqxL5nq.js +0 -129
- package/development/seat-reservation.component-Dkn66vPo.js +0 -518
- package/seat-reservation-graphic.component-Dzkv9tyR.js +0 -102
|
@@ -3,12 +3,12 @@ import { mapIconToSvg } from "./seat-reservation/common/mapper/icon-mapper.js";
|
|
|
3
3
|
import "./seat-reservation/common/mapper.js";
|
|
4
4
|
import { t as svgs } from "./svgs-kDpBCto5.js";
|
|
5
5
|
import { getI18nSeatReservation } from "./seat-reservation/common/translations/i18n.js";
|
|
6
|
-
import { t as SbbSeatReservationAreaElement } from "./seat-reservation-area.component-
|
|
7
|
-
import { t as SbbSeatReservationGraphicElement } from "./seat-reservation-graphic.component-
|
|
8
|
-
import { t as SbbSeatReservationNavigationCoachElement } from "./seat-reservation-navigation-coach.component-
|
|
6
|
+
import { t as SbbSeatReservationAreaElement } from "./seat-reservation-area.component-DlH14rY-.js";
|
|
7
|
+
import { t as SbbSeatReservationGraphicElement } from "./seat-reservation-graphic.component-B771YtOf.js";
|
|
8
|
+
import { t as SbbSeatReservationNavigationCoachElement } from "./seat-reservation-navigation-coach.component-CnA9MEBr.js";
|
|
9
9
|
import { t as SbbSeatReservationNavigationServicesElement } from "./seat-reservation-navigation-services.component-CLho6RnU.js";
|
|
10
10
|
import { t as SbbSeatReservationPlaceControlElement } from "./seat-reservation-place-control.component-BEeaDOS6.js";
|
|
11
11
|
import { t as SbbSeatReservationScopedElement } from "./seat-reservation-scoped.component-X-Kq0-w5.js";
|
|
12
12
|
import { SeatReservationBaseElement } from "./seat-reservation/seat-reservation/seat-reservation-base-element.js";
|
|
13
|
-
import { t as SbbSeatReservationElement } from "./seat-reservation.component-
|
|
13
|
+
import { t as SbbSeatReservationElement } from "./seat-reservation.component-CZm8Lsj1.js";
|
|
14
14
|
export { SbbSeatReservationAreaElement, SbbSeatReservationElement, SbbSeatReservationGraphicElement, SbbSeatReservationNavigationCoachElement, SbbSeatReservationNavigationServicesElement, SbbSeatReservationPlaceControlElement, SbbSeatReservationScopedElement, SeatReservationBaseElement, getI18nSeatReservation, mapCoachInfosToCoachSelection, mapIconToSvg, mapPlaceAndCoachToSeatReservationPlaceSelection, mapPlaceInfosToPlaceSelection, mapRawDataToSeatReservation, svgs };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbb-esta/lyne-elements-experimental-dev",
|
|
3
|
-
"version": "5.0.0-next.1-dev.
|
|
3
|
+
"version": "5.0.0-next.1-dev.1777528735",
|
|
4
4
|
"description": "Lyne Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design system",
|
|
7
7
|
"web components",
|
|
8
8
|
"lit",
|
|
9
9
|
"storybook",
|
|
10
|
-
"https://github.com/sbb-design-systems/lyne-components/commit/
|
|
10
|
+
"https://github.com/sbb-design-systems/lyne-components/commit/530dffe8c8f42141eda83bd4e0abe0534f0e2017"
|
|
11
11
|
],
|
|
12
12
|
"type": "module",
|
|
13
13
|
"exports": {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { __esDecorate as e, __runInitializers as t } from "tslib";
|
|
2
2
|
import { SbbElement as n, forceType as r, isArrowKeyOrPageKeysPressed as i } from "@sbb-esta/lyne-elements/core.js";
|
|
3
3
|
import { isServer as a } from "lit";
|
|
4
|
-
import { eventOptions as
|
|
5
|
-
import { mapCoachInfosToCoachSelection as
|
|
4
|
+
import { eventOptions as o, property as s, state as c } from "lit/decorators.js";
|
|
5
|
+
import { mapCoachInfosToCoachSelection as l, mapIconToSvg as u, mapPlaceAndCoachToSeatReservationPlaceSelection as ee, mapPlaceInfosToPlaceSelection as te } from "../common/mapper.js";
|
|
6
6
|
//#region src/elements-experimental/seat-reservation/seat-reservation/seat-reservation-base-element.ts
|
|
7
|
-
var
|
|
7
|
+
var d;
|
|
8
8
|
(function(e) {
|
|
9
9
|
e.right = "right", e.left = "left";
|
|
10
|
-
})(
|
|
11
|
-
var
|
|
10
|
+
})(d ||= {});
|
|
11
|
+
var ne = 3, re = [
|
|
12
12
|
"sa-vo",
|
|
13
13
|
"sa-rs",
|
|
14
14
|
"sa-abteilkinderwagen",
|
|
@@ -16,47 +16,47 @@ var ie = 3, ae = [
|
|
|
16
16
|
"sa-fa",
|
|
17
17
|
"sa-bz",
|
|
18
18
|
"sa-rz"
|
|
19
|
-
],
|
|
20
|
-
let
|
|
21
|
-
return class extends
|
|
19
|
+
], f = (() => {
|
|
20
|
+
let f = n, p = [], m, h = [], g = [], _, v = [], y = [], b, x = [], S = [], C, w = [], T = [], E, D = [], O = [], k, A = [], j = [], ie, M = [], N = [], P, F = [], I = [], L, R = [], z = [], B, V = [], H = [], U, W = [], G = [], K, q = [], J = [], Y, X = [], Z = [], Q, $ = [], ae = [], oe;
|
|
21
|
+
return class extends f {
|
|
22
22
|
static {
|
|
23
|
-
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
24
|
-
|
|
23
|
+
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(f[Symbol.metadata] ?? null) : void 0;
|
|
24
|
+
m = [s({
|
|
25
25
|
attribute: "seat-reservations",
|
|
26
26
|
type: Array
|
|
27
|
-
})],
|
|
27
|
+
})], _ = [s({
|
|
28
28
|
attribute: "travel-direction",
|
|
29
29
|
type: String
|
|
30
|
-
})],
|
|
30
|
+
})], b = [r(), s({
|
|
31
31
|
attribute: "has-navigation",
|
|
32
32
|
type: Boolean
|
|
33
|
-
})],
|
|
33
|
+
})], C = [r(), s({
|
|
34
34
|
attribute: "align-vertical",
|
|
35
35
|
type: Boolean,
|
|
36
36
|
reflect: !0,
|
|
37
37
|
useDefault: !0
|
|
38
|
-
})],
|
|
38
|
+
})], E = [r(), s({
|
|
39
39
|
attribute: "base-grid-size",
|
|
40
40
|
type: Number
|
|
41
|
-
})],
|
|
41
|
+
})], k = [r(), s({
|
|
42
42
|
attribute: "height",
|
|
43
43
|
type: Number
|
|
44
|
-
})],
|
|
44
|
+
})], ie = [r(), s({
|
|
45
45
|
attribute: "max-seat-reservations",
|
|
46
46
|
type: Number
|
|
47
|
-
})],
|
|
47
|
+
})], P = [r(), s({
|
|
48
48
|
attribute: "max-bicycle-reservations",
|
|
49
49
|
type: Number
|
|
50
|
-
})],
|
|
50
|
+
})], L = [r(), s({
|
|
51
51
|
attribute: "prevent-place-click",
|
|
52
52
|
type: Boolean
|
|
53
|
-
})],
|
|
53
|
+
})], B = [r(), s({
|
|
54
54
|
attribute: "preselect-coach-index",
|
|
55
55
|
type: Number
|
|
56
|
-
})],
|
|
56
|
+
})], U = [r(), s({
|
|
57
57
|
attribute: "show-title-info",
|
|
58
58
|
type: Boolean
|
|
59
|
-
})],
|
|
59
|
+
})], K = [c()], Y = [c()], Q = [c()], oe = [o({ passive: !0 })], e(this, null, m, {
|
|
60
60
|
kind: "accessor",
|
|
61
61
|
name: "seatReservations",
|
|
62
62
|
static: !1,
|
|
@@ -69,7 +69,7 @@ var ie = 3, ae = [
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
metadata: t
|
|
72
|
-
},
|
|
72
|
+
}, h, g), e(this, null, _, {
|
|
73
73
|
kind: "accessor",
|
|
74
74
|
name: "travelDirection",
|
|
75
75
|
static: !1,
|
|
@@ -82,7 +82,7 @@ var ie = 3, ae = [
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
metadata: t
|
|
85
|
-
},
|
|
85
|
+
}, v, y), e(this, null, b, {
|
|
86
86
|
kind: "accessor",
|
|
87
87
|
name: "hasNavigation",
|
|
88
88
|
static: !1,
|
|
@@ -95,7 +95,7 @@ var ie = 3, ae = [
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
metadata: t
|
|
98
|
-
},
|
|
98
|
+
}, x, S), e(this, null, C, {
|
|
99
99
|
kind: "accessor",
|
|
100
100
|
name: "alignVertical",
|
|
101
101
|
static: !1,
|
|
@@ -108,7 +108,7 @@ var ie = 3, ae = [
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
metadata: t
|
|
111
|
-
},
|
|
111
|
+
}, w, T), e(this, null, E, {
|
|
112
112
|
kind: "accessor",
|
|
113
113
|
name: "baseGridSize",
|
|
114
114
|
static: !1,
|
|
@@ -121,7 +121,7 @@ var ie = 3, ae = [
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
metadata: t
|
|
124
|
-
},
|
|
124
|
+
}, D, O), e(this, null, k, {
|
|
125
125
|
kind: "accessor",
|
|
126
126
|
name: "height",
|
|
127
127
|
static: !1,
|
|
@@ -134,7 +134,7 @@ var ie = 3, ae = [
|
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
136
|
metadata: t
|
|
137
|
-
},
|
|
137
|
+
}, A, j), e(this, null, ie, {
|
|
138
138
|
kind: "accessor",
|
|
139
139
|
name: "maxSeatReservations",
|
|
140
140
|
static: !1,
|
|
@@ -147,7 +147,7 @@ var ie = 3, ae = [
|
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
metadata: t
|
|
150
|
-
},
|
|
150
|
+
}, M, N), e(this, null, P, {
|
|
151
151
|
kind: "accessor",
|
|
152
152
|
name: "maxBicycleReservations",
|
|
153
153
|
static: !1,
|
|
@@ -160,7 +160,7 @@ var ie = 3, ae = [
|
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
162
|
metadata: t
|
|
163
|
-
},
|
|
163
|
+
}, F, I), e(this, null, L, {
|
|
164
164
|
kind: "accessor",
|
|
165
165
|
name: "preventPlaceClick",
|
|
166
166
|
static: !1,
|
|
@@ -173,7 +173,7 @@ var ie = 3, ae = [
|
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
metadata: t
|
|
176
|
-
},
|
|
176
|
+
}, R, z), e(this, null, B, {
|
|
177
177
|
kind: "accessor",
|
|
178
178
|
name: "preselectCoachIndex",
|
|
179
179
|
static: !1,
|
|
@@ -186,7 +186,7 @@ var ie = 3, ae = [
|
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
188
|
metadata: t
|
|
189
|
-
},
|
|
189
|
+
}, V, H), e(this, null, U, {
|
|
190
190
|
kind: "accessor",
|
|
191
191
|
name: "showTitleInfo",
|
|
192
192
|
static: !1,
|
|
@@ -199,7 +199,7 @@ var ie = 3, ae = [
|
|
|
199
199
|
}
|
|
200
200
|
},
|
|
201
201
|
metadata: t
|
|
202
|
-
},
|
|
202
|
+
}, W, G), e(this, null, K, {
|
|
203
203
|
kind: "accessor",
|
|
204
204
|
name: "selectedCoachIndex",
|
|
205
205
|
static: !1,
|
|
@@ -212,7 +212,7 @@ var ie = 3, ae = [
|
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
214
|
metadata: t
|
|
215
|
-
},
|
|
215
|
+
}, q, J), e(this, null, Y, {
|
|
216
216
|
kind: "accessor",
|
|
217
217
|
name: "focusedCoachIndex",
|
|
218
218
|
static: !1,
|
|
@@ -225,7 +225,7 @@ var ie = 3, ae = [
|
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
227
|
metadata: t
|
|
228
|
-
},
|
|
228
|
+
}, X, Z), e(this, null, Q, {
|
|
229
229
|
kind: "accessor",
|
|
230
230
|
name: "hoveredCoachIndex",
|
|
231
231
|
static: !1,
|
|
@@ -238,7 +238,7 @@ var ie = 3, ae = [
|
|
|
238
238
|
}
|
|
239
239
|
},
|
|
240
240
|
metadata: t
|
|
241
|
-
},
|
|
241
|
+
}, $, ae), e(this, null, oe, {
|
|
242
242
|
kind: "method",
|
|
243
243
|
name: "coachAreaScrollend",
|
|
244
244
|
static: !1,
|
|
@@ -248,7 +248,7 @@ var ie = 3, ae = [
|
|
|
248
248
|
get: (e) => e.coachAreaScrollend
|
|
249
249
|
},
|
|
250
250
|
metadata: t
|
|
251
|
-
}, null,
|
|
251
|
+
}, null, p), t && Object.defineProperty(this, Symbol.metadata, {
|
|
252
252
|
enumerable: !0,
|
|
253
253
|
configurable: !0,
|
|
254
254
|
writable: !0,
|
|
@@ -360,10 +360,10 @@ var ie = 3, ae = [
|
|
|
360
360
|
this.#p = e;
|
|
361
361
|
}
|
|
362
362
|
constructor() {
|
|
363
|
-
super(), this.#e = (t(this,
|
|
363
|
+
super(), this.#e = (t(this, p), t(this, h, null)), this.#t = (t(this, g), t(this, v, "NONE")), this.#n = (t(this, y), t(this, x, !0)), this.#r = (t(this, S), t(this, w, !1)), this.#i = (t(this, T), t(this, D, 16)), this.#a = (t(this, O), t(this, A, null)), this.#o = (t(this, j), t(this, M, -1)), this.#s = (t(this, N), t(this, F, -1)), this.#c = (t(this, I), t(this, R, !1)), this.#l = (t(this, z), t(this, V, -1)), this.#u = (t(this, H), t(this, W, !1)), this.#d = (t(this, G), t(this, q, -1)), this.#f = (t(this, J), t(this, X, -1)), this.#p = (t(this, Z), t(this, $, -1)), this.coachBorderPadding = (t(this, ae), 6), this.gapBetweenCoaches = 4, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.gapBetweenCoachDecks = 48, this.coachNavButtonDim = 0, this.globalAreaIconDim = {
|
|
364
364
|
w: 2,
|
|
365
365
|
h: 2
|
|
366
|
-
}, this.globalAreaIconPadding = .8, this.coachItemDetailsElements = [], this.currScrollDirection =
|
|
366
|
+
}, this.globalAreaIconPadding = .8, this.coachItemDetailsElements = [], this.currScrollDirection = d.right, this.maxCalcCoachesWidth = 0, this.scrollCoachesAreaWidth = 0, this.scrollNavigationAreaDim = 0, this.triggerCoachPositionsCollection = [], this.navigationScrollArea = null, this.coachScrollArea = null, this.currSelectedPlace = null, this.currSelectedPlaceElementId = null, this.currSelectedCoachIndex = -1, this.currSelectedDeckIndex = 0, this.preventCoachScrollByPlaceClick = !1, this.selectedSeatReservationPlaces = {
|
|
367
367
|
seats: [],
|
|
368
368
|
bicycles: []
|
|
369
369
|
}, this.seatReservationWithoutNavigationHasFocus = !1, this.isCoachGridFocusable = !1, this.isAutoScrolling = !1, this.isKeyboardNavigation = !1, this.hasMultipleDecks = !1, this.hasSeatReservationNativeFocus = !1, this.keyboardNavigationEvents = {
|
|
@@ -373,7 +373,7 @@ var ie = 3, ae = [
|
|
|
373
373
|
ArrowDown: "ArrowDown",
|
|
374
374
|
Tab: "Tab",
|
|
375
375
|
Enter: "Enter"
|
|
376
|
-
}, this.notAreaElements = [
|
|
376
|
+
}, this.seatReservationStructure = { decks: [] }, this.notFixedRotatableAreaIcons = ["ENTRY_EXIT"], this.notAreaElements = [
|
|
377
377
|
"DRIVER_AREA",
|
|
378
378
|
"DRIVER_AREA_NO_VERTICAL_WALL",
|
|
379
379
|
"COACH_PASSAGE",
|
|
@@ -383,19 +383,24 @@ var ie = 3, ae = [
|
|
|
383
383
|
"COMPARTMENT_PASSAGE_MIDDLE",
|
|
384
384
|
"COMPARTMENT_PASSAGE_LOW",
|
|
385
385
|
"COMPARTMENT_WALL"
|
|
386
|
-
], this.
|
|
386
|
+
], this.middleBorderDockingElements = [
|
|
387
|
+
"DRIVER_AREA",
|
|
388
|
+
"DRIVER_AREA_NO_VERTICAL_WALL",
|
|
389
|
+
"COACH_PASSAGE",
|
|
390
|
+
"COACH_WALL_NO_PASSAGE"
|
|
391
|
+
], this._isRunningInitPreselectCoachIndex = !1, this._lastStartScrollPos = -1, this._prepareServiceIconsNavigation = (e) => e && e?.map(function(e) {
|
|
387
392
|
return {
|
|
388
393
|
pId: e,
|
|
389
|
-
svgName:
|
|
394
|
+
svgName: u[e]?.svgName ? u[e]?.svgName : ""
|
|
390
395
|
};
|
|
391
|
-
}).filter((e) =>
|
|
396
|
+
}).filter((e) => re.indexOf(e.svgName) !== -1).filter((e, t, n) => n.map((e) => e.svgName).indexOf(e.svgName) === t).map((e) => e.pId).slice(0, ne) || [], this.addEventListener("blur", () => this._onLeaveSeatReservationComponent());
|
|
392
397
|
}
|
|
393
398
|
willUpdate(e) {
|
|
394
|
-
if (super.willUpdate(e), e.has("seatReservations") && (this.hasMultipleDecks = this.seatReservations?.length > 1, this._initPrepareSeatReservationData(), this.
|
|
399
|
+
if (super.willUpdate(e), e.has("seatReservations") && (this.hasMultipleDecks = this.seatReservations?.length > 1, this._initPrepareSeatReservationData(), this._initSeatReservationPlaceSelection(), this.initNavigationSelectionByScrollEvent()), e.has("baseGridSize") && (this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this._initPrepareSeatReservationData(), this.initNavigationSelectionByScrollEvent()), e.has("height") && this.height) {
|
|
395
400
|
let e = this.seatReservations[this.currSelectedDeckIndex] || null;
|
|
396
|
-
e?.coachItems.length && (this.baseGridSize = this.height / e.coachItems[0].dimension.h, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this._initPrepareSeatReservationData(), this.initNavigationSelectionByScrollEvent());
|
|
401
|
+
e?.coachItems.length && (this.baseGridSize = Math.round(this.height / e.coachItems[0].dimension.h), this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this._initPrepareSeatReservationData(), this.initNavigationSelectionByScrollEvent());
|
|
397
402
|
}
|
|
398
|
-
e.has("alignVertical") && this.
|
|
403
|
+
e.has("alignVertical") && (this._initPrepareSeatReservationData(), this.initNavigationSelectionByScrollEvent()), e.has("preselectCoachIndex") && (this._isRunningInitPreselectCoachIndex = !0, setTimeout(() => this.scrollToSelectedNavCoach(this.preselectCoachIndex), 1));
|
|
399
404
|
}
|
|
400
405
|
navigateByDirectionBtn(e) {
|
|
401
406
|
this.unfocusPlaceElement();
|
|
@@ -403,7 +408,7 @@ var ie = 3, ae = [
|
|
|
403
408
|
e == "DIRECTION_LEFT" && t > 0 ? t = this.currSelectedCoachIndex == -1 ? 0 : this.currSelectedCoachIndex - 1 : e == "DIRECTION_RIGHT" && t < this.seatReservations[this.currSelectedDeckIndex]?.coachItems.length - 1 && (t = this.currSelectedCoachIndex == -1 ? 0 : this.currSelectedCoachIndex + 1), this.scrollToSelectedNavCoach(t);
|
|
404
409
|
}
|
|
405
410
|
_initPrepareSeatReservationData() {
|
|
406
|
-
this._determineBaseFontSize(), this.hasMultipleDecks && this._initEmptyCoachDeckOffsets(), this._prepareCoachItemDetailsData(), this._prepareOptimizeAreaIconDimensionByMedian();
|
|
411
|
+
this._determineBaseFontSize(), this.hasMultipleDecks && this._initEmptyCoachDeckOffsets(), this._prepareCoachItemDetailsData(), this._prepareSeatReservationStructureInformation(), this._prepareOptimizeAreaIconDimensionByMedian();
|
|
407
412
|
}
|
|
408
413
|
initNavigationSelectionByScrollEvent() {
|
|
409
414
|
this.coachScrollArea = this.shadowRoot?.querySelector("#sbb-sr__wrapper-scrollarea"), this.navigationScrollArea = this.shadowRoot?.querySelector("#sbb-sr__navigation-list-coaches");
|
|
@@ -422,12 +427,12 @@ var ie = 3, ae = [
|
|
|
422
427
|
}
|
|
423
428
|
if (this.coachScrollArea && e) {
|
|
424
429
|
let t = 0;
|
|
425
|
-
this.scrollCoachesAreaWidth = this.alignVertical ? this.coachScrollArea.getBoundingClientRect().height : this.coachScrollArea.getBoundingClientRect().width, this.triggerCoachPositionsCollection = e.coachItems.map((e) => {
|
|
426
|
-
let
|
|
427
|
-
return t += r + (
|
|
428
|
-
start:
|
|
430
|
+
this.scrollCoachesAreaWidth = this.alignVertical ? this.coachScrollArea.getBoundingClientRect().height : this.coachScrollArea.getBoundingClientRect().width, this.triggerCoachPositionsCollection = e.coachItems.map((e, n) => {
|
|
431
|
+
let r = this.seatReservationStructure.decks[this.currSelectedDeckIndex].deckCoaches[n], i = t;
|
|
432
|
+
return t += r.width + (r.hasOverhangingElements ? 2 * this.gapBetweenCoaches : this.gapBetweenCoaches), {
|
|
433
|
+
start: i,
|
|
429
434
|
end: t,
|
|
430
|
-
width: r
|
|
435
|
+
width: r.width
|
|
431
436
|
};
|
|
432
437
|
}), this.maxCalcCoachesWidth = t - this.gapBetweenCoaches;
|
|
433
438
|
}
|
|
@@ -580,11 +585,11 @@ var ie = 3, ae = [
|
|
|
580
585
|
}, 10);
|
|
581
586
|
}
|
|
582
587
|
_setScrollDirectionByCoachIndex() {
|
|
583
|
-
this.currScrollDirection = this.currSelectedCoachIndex > this.selectedCoachIndex ?
|
|
588
|
+
this.currScrollDirection = this.currSelectedCoachIndex > this.selectedCoachIndex ? d.right : d.left;
|
|
584
589
|
}
|
|
585
590
|
_getCoachScrollPositionX() {
|
|
586
591
|
let e = this.triggerCoachPositionsCollection[this.currSelectedCoachIndex];
|
|
587
|
-
return this.isKeyboardNavigation && this.currScrollDirection ===
|
|
592
|
+
return this.isKeyboardNavigation && this.currScrollDirection === d.left && e.width > this.scrollCoachesAreaWidth ? e.end - this.scrollCoachesAreaWidth : e.start;
|
|
588
593
|
}
|
|
589
594
|
_setFocusToSelectedCoachGrid() {
|
|
590
595
|
if (this.isCoachGridFocusable && this.hasSeatReservationNativeFocus) {
|
|
@@ -615,7 +620,7 @@ var ie = 3, ae = [
|
|
|
615
620
|
if (this.currSelectedPlace) {
|
|
616
621
|
let a = { ...this.currSelectedPlace.position };
|
|
617
622
|
e && (i = this._getSwitchedCoachDeckIndexByKeyNavigation(e, t), i !== null && (r = this.seatReservations[i].coachItems[this.currSelectedCoachIndex].places || [], a.y = i < this.currSelectedDeckIndex ? t.dimension.h : -1));
|
|
618
|
-
for (let t of r) e ? t.number !== this.currSelectedPlace?.number && (e === this.keyboardNavigationEvents.ArrowRight && (t.position.y === a.y || t.position.y === a.y - 1) && t.position.x > a.x && (!n || t.position.x < n.position.x) || e === this.keyboardNavigationEvents.ArrowDown && (t.position.x === a.x || t.position.x === a.x + 1) && t.position.y > a.y && (!n || t.position.y < n.position.y) || e === this.keyboardNavigationEvents.ArrowLeft && (t.position.y === a.y || t.position.y === a.y + 1) && t.position.x < a.x && (!n || t.position.x > n.position.x) || e === this.keyboardNavigationEvents.ArrowUp && (t.position.x === a.x || t.position.x === a.x - 1) && t.position.y < a.y && (!n || t.position.y > n.position.y)) && (n = t) : (this.currScrollDirection ===
|
|
623
|
+
for (let t of r) e ? t.number !== this.currSelectedPlace?.number && (e === this.keyboardNavigationEvents.ArrowRight && (t.position.y === a.y || t.position.y === a.y - 1) && t.position.x > a.x && (!n || t.position.x < n.position.x) || e === this.keyboardNavigationEvents.ArrowDown && (t.position.x === a.x || t.position.x === a.x + 1) && t.position.y > a.y && (!n || t.position.y < n.position.y) || e === this.keyboardNavigationEvents.ArrowLeft && (t.position.y === a.y || t.position.y === a.y + 1) && t.position.x < a.x && (!n || t.position.x > n.position.x) || e === this.keyboardNavigationEvents.ArrowUp && (t.position.x === a.x || t.position.x === a.x - 1) && t.position.y < a.y && (!n || t.position.y > n.position.y)) && (n = t) : (this.currScrollDirection === d.right && t.position.y === a.y && (!n || t.position.x < n.position.x) || this.currScrollDirection === d.left && t.position.y === a.y && (!n || t.position.x > n.position.x)) && (n = t);
|
|
619
624
|
i !== null && n && (this.currSelectedDeckIndex = i);
|
|
620
625
|
}
|
|
621
626
|
}
|
|
@@ -719,7 +724,7 @@ var ie = 3, ae = [
|
|
|
719
724
|
_initSeatReservationPlaceSelection() {
|
|
720
725
|
this.selectedSeatReservationPlaces.seats = [], this.selectedSeatReservationPlaces.bicycles = [], this.seatReservations?.forEach((e, t) => e.coachItems.map((n, r) => {
|
|
721
726
|
n.places?.filter((e) => e.state === "SELECTED")?.forEach((n) => {
|
|
722
|
-
let i =
|
|
727
|
+
let i = te(n, this.getPlaceElementId(t, r, n.number), e.deckCoachIndex, r), a = this._getSeatReservationPlaceSelection(i, t);
|
|
723
728
|
a && (a.placeType === "SEAT" ? this.selectedSeatReservationPlaces.seats.push(a) : this.selectedSeatReservationPlaces.bicycles.push(a));
|
|
724
729
|
});
|
|
725
730
|
}));
|
|
@@ -734,12 +739,12 @@ var ie = 3, ae = [
|
|
|
734
739
|
_getSeatReservationPlaceSelection(e, t) {
|
|
735
740
|
if (t === null) return null;
|
|
736
741
|
let n = this.seatReservations[t].coachItems[e.coachIndex], r = n.places?.find((t) => t.number === e.number);
|
|
737
|
-
return r ?
|
|
742
|
+
return r ? ee(r, n, e.id, e.deckIndex, e.coachIndex) : null;
|
|
738
743
|
}
|
|
739
744
|
_getSeatReservationSelectedCoach(e) {
|
|
740
745
|
if (!this.seatReservations[this.currSelectedDeckIndex].coachItems[e]) return null;
|
|
741
746
|
let t = this.seatReservations[this.currSelectedDeckIndex].coachItems[e];
|
|
742
|
-
return
|
|
747
|
+
return l(e, t, this.getAvailableFreePlacesNumFromCoach(t.places));
|
|
743
748
|
}
|
|
744
749
|
_setCurrSelectedPlaceElementId(e) {
|
|
745
750
|
this.currSelectedPlaceElementId = e ? this.getPlaceElementId(this.currSelectedDeckIndex, this.currSelectedCoachIndex, e.number) : null;
|
|
@@ -762,9 +767,9 @@ var ie = 3, ae = [
|
|
|
762
767
|
travelClass: this._prepareTravelClassNavigation(n),
|
|
763
768
|
propertyIds: this._prepareServiceIconsNavigation(r),
|
|
764
769
|
isDriverArea: e.places ? e.places.length === 0 : !0,
|
|
770
|
+
isLocomotive: this._isLocomotive(e),
|
|
765
771
|
driverAreaSide: this._prepareDriverAreaSideNavigation(e),
|
|
766
|
-
freePlaces: this.getAvailableFreePlacesNumFromCoach(i)
|
|
767
|
-
driverAreaElements: this._setDriverAreasElements(e)
|
|
772
|
+
freePlaces: this.getAvailableFreePlacesNumFromCoach(i)
|
|
768
773
|
});
|
|
769
774
|
});
|
|
770
775
|
}
|
|
@@ -804,17 +809,71 @@ var ie = 3, ae = [
|
|
|
804
809
|
};
|
|
805
810
|
}
|
|
806
811
|
}
|
|
807
|
-
|
|
808
|
-
this.seatReservations && this.seatReservations.forEach((e) => {
|
|
812
|
+
_prepareSeatReservationStructureInformation() {
|
|
813
|
+
this.seatReservations && (this.seatReservationStructure = { decks: [] }, this.seatReservations.forEach((e, t) => {
|
|
814
|
+
let n = {
|
|
815
|
+
deckIndex: t,
|
|
816
|
+
deckCoaches: []
|
|
817
|
+
};
|
|
809
818
|
e?.coachItems?.forEach((e) => {
|
|
810
|
-
let t = this._isOverhangingElementsPresent(e.dimension.w,
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
819
|
+
let t = (e.graphicElements?.filter((e) => e.icon && !this.notAreaElements.includes(e.icon)))?.concat(e.serviceElements || []).concat(e.places || []) || [], r = this._isOverhangingElementsPresent(e.dimension.w, t), i = e.graphicElements?.filter((e) => !this.notAreaElements.includes(e.icon)).map((t) => this._getCalculatedDimensionPositionElement(t, e.dimension, !0)), a = e.graphicElements?.filter((e) => this.notAreaElements.includes(e.icon)).map((t) => this._getCalculatedDimensionPositionElement(t, e.dimension, !1)), o = e.serviceElements?.map((t) => this._getCalculatedDimensionPositionElement(t, e.dimension, !1)), s = this._getCalculatedMiddleBorderElement(e), c = this.getCalculatedDimension({ ...e.dimension }), l = {
|
|
820
|
+
width: c.w,
|
|
821
|
+
height: c.h,
|
|
822
|
+
otherElements: a || [],
|
|
823
|
+
serviceElements: o || [],
|
|
824
|
+
areaElements: i || [],
|
|
825
|
+
borderMiddleElement: s,
|
|
826
|
+
hasOverhangingElements: r
|
|
827
|
+
};
|
|
828
|
+
n.deckCoaches.push(l);
|
|
829
|
+
}), this.seatReservationStructure.decks.push(n);
|
|
830
|
+
}));
|
|
831
|
+
}
|
|
832
|
+
_getCalculatedMiddleBorderElement(e) {
|
|
833
|
+
let t = (e.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize, n = 0, r = e.dimension.w;
|
|
834
|
+
if (e.graphicElements) {
|
|
835
|
+
let t = this._getFirstLastDockingElements(e.graphicElements);
|
|
836
|
+
if (t?.length == 2) {
|
|
837
|
+
let i = t[0], a = t[1], o = i.position.x == 0 ? a.dimension.w : i.dimension.w;
|
|
838
|
+
n = i.position.x == 0 ? i.dimension.w : a.dimension.w, r = e.dimension.w - o - n;
|
|
839
|
+
} else if (t?.length == 1) {
|
|
840
|
+
let i = t[0];
|
|
841
|
+
i.position.x === 0 ? (n = i.dimension.w, r = e.dimension.w - i.dimension.w) : i.position.x !== 0 && (r = e.dimension.w - i.dimension.w);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
let i = this.coachBorderPadding * -1;
|
|
845
|
+
return {
|
|
846
|
+
position: {
|
|
847
|
+
x: n * this.baseGridSize,
|
|
848
|
+
y: i,
|
|
849
|
+
z: 0
|
|
850
|
+
},
|
|
851
|
+
dimension: {
|
|
852
|
+
w: r * this.baseGridSize,
|
|
853
|
+
h: t
|
|
854
|
+
}
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
_getFirstLastDockingElements(e) {
|
|
858
|
+
let t = (e.filter((e) => this.middleBorderDockingElements.includes(e.icon)) || []).sort((e, t) => {
|
|
859
|
+
let n = e.position.x, r = t.position.x;
|
|
860
|
+
return n > r ? 1 : n < r ? -1 : 0;
|
|
817
861
|
});
|
|
862
|
+
return t.filter((e, n) => n == 0 || n == t.length - 1);
|
|
863
|
+
}
|
|
864
|
+
_getCalculatedDimensionPositionElement(e, t, n) {
|
|
865
|
+
let r = { ...e.dimension }, i = { ...e.position }, a = e.rotation || 0, o = this.notAreaElements.concat(this.notFixedRotatableAreaIcons).indexOf(e.icon) === -1, s = this.alignVertical && o ? a - 90 : a, c = null;
|
|
866
|
+
if (n) {
|
|
867
|
+
let n = e.icon?.indexOf("TABLE") === -1, a = e.icon && n ? e.icon : null, o = this.isElementDirectlyOnBorder(e, t) && a !== "ENTRY_EXIT";
|
|
868
|
+
e.position.y === 0 ? (c = "upper-border", i.y -= this.coachBorderOffset - this.coachBorderOffset / 3) : e.position.y + e.dimension.h === t.h && (c = "lower-border", o || (i.y += this.coachBorderOffset - this.coachBorderOffset / 3)), o && (r.h += this.coachBorderOffset - this.coachBorderOffset / 3);
|
|
869
|
+
} else e.position.y === 0 && (i.y -= this.coachBorderOffset), t.h === e.position.y + e.dimension.h && (r.h += this.coachBorderOffset * 2);
|
|
870
|
+
return r.w *= this.baseGridSize, r.h *= this.baseGridSize, i.x *= this.baseGridSize, i.y *= this.baseGridSize, {
|
|
871
|
+
icon: e.icon && e.icon.endsWith("DRIVER_AREA") ? e.icon?.concat("_", this.seatReservations[this.currSelectedDeckIndex].vehicleType) : e.icon,
|
|
872
|
+
rotation: s,
|
|
873
|
+
dimension: r,
|
|
874
|
+
position: i,
|
|
875
|
+
mounting: c
|
|
876
|
+
};
|
|
818
877
|
}
|
|
819
878
|
_getPlaceHtmlElement() {
|
|
820
879
|
return this.currSelectedPlaceElementId && this.shadowRoot?.getElementById(this.currSelectedPlaceElementId) || null;
|
|
@@ -841,14 +900,8 @@ var ie = 3, ae = [
|
|
|
841
900
|
_isOverhangingElementsPresent(e, t) {
|
|
842
901
|
return t?.some((t) => t.position.x === 0 || t.position.x + t.dimension.w >= e) ?? !1;
|
|
843
902
|
}
|
|
844
|
-
|
|
845
|
-
return e
|
|
846
|
-
driverArea: e.graphicElements?.find((e) => e.icon === "DRIVER_AREA"),
|
|
847
|
-
driverAreaNoVerticalWall: e.type === "LOCOMOTIVE_COACH" ? e.graphicElements?.find((e) => e.icon === "DRIVER_AREA_NO_VERTICAL_WALL") : void 0
|
|
848
|
-
} : {
|
|
849
|
-
driverArea: void 0,
|
|
850
|
-
driverAreaNoVerticalWall: void 0
|
|
851
|
-
};
|
|
903
|
+
_isLocomotive(e) {
|
|
904
|
+
return e?.graphicElements?.find((e) => e.icon === "DRIVER_AREA_NO_VERTICAL_WALL") !== void 0;
|
|
852
905
|
}
|
|
853
906
|
_onLeaveSeatReservationComponent() {
|
|
854
907
|
this.hasNavigation && (this.focusedCoachIndex = -1), this.unfocusPlaceElement();
|
|
@@ -856,4 +909,4 @@ var ie = 3, ae = [
|
|
|
856
909
|
};
|
|
857
910
|
})();
|
|
858
911
|
//#endregion
|
|
859
|
-
export {
|
|
912
|
+
export { f as SeatReservationBaseElement };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../seat-reservation.component-
|
|
1
|
+
import { t as e } from "../../seat-reservation.component-CNtc2Xcr.js";
|
|
2
2
|
export { e as SbbSeatReservationElement };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../seat-reservation-area.component-
|
|
1
|
+
import { t as e } from "../../seat-reservation-area.component-B_T7k-dq.js";
|
|
2
2
|
export { e as SbbSeatReservationAreaElement };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../seat-reservation-graphic.component-
|
|
1
|
+
import { t as e } from "../../seat-reservation-graphic.component-BNtFgIVM.js";
|
|
2
2
|
export { e as SbbSeatReservationGraphicElement };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../seat-reservation-navigation-coach.component-
|
|
1
|
+
import { t as e } from "../../seat-reservation-navigation-coach.component-BF2dTeIb.js";
|
|
2
2
|
export { e as SbbSeatReservationNavigationCoachElement };
|
package/{seat-reservation-area.component-CVc6uuMG.js → seat-reservation-area.component-B_T7k-dq.js}
RENAMED
|
@@ -3,7 +3,7 @@ import { SbbElement as n, boxSizingStyles as r, forceType as i } from "@sbb-esta
|
|
|
3
3
|
import { html as a, unsafeCSS as o } from "lit";
|
|
4
4
|
import { property as s } from "lit/decorators.js";
|
|
5
5
|
//#region src/elements-experimental/seat-reservation/seat-reservation-area/seat-reservation-area.scss?inline
|
|
6
|
-
var c = ":host{--sbb-seat-reservation-area-border-radius: var(--sbb-border-width-4x);--sbb-seat-reservation-area-rotation: 0;display:flex;justify-content:center;align-items:center;height:calc(var(--sbb-seat-reservation-area-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:calc(var(--sbb-seat-reservation-area-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));border:var(--sbb-border-width-1x) solid var(--sbb-color-graphite);border:var(--sbb-border-width-1x) solid light-dark(var(--sbb-color-graphite),var(--sbb-color-granite));border-radius:var(--sbb-seat-reservation-area-border-radius);position:absolute;inset-block-start:calc(var(--sbb-seat-reservation-area-top) * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(var(--sbb-seat-reservation-area-left) * var(--sbb-seat-reservation-one-px-rem, .0625rem));rotate:calc(var(--sbb-seat-reservation-area-rotation) * 1deg);line-height:normal;background-color:var(--sbb-background-color-2)}:host([background=dark]){background-color:var(--sbb-color-milk);background-color:light-dark(var(--sbb-color-milk),var(--sbb-color-iron))}:host([mounting=upper-border]){border-block-start-width:0;border-radius:0 0 var(--sbb-seat-reservation-area-border-radius) var(--sbb-seat-reservation-area-border-radius)}:host([mounting=lower-border]){border-block-end-width:0;border-radius:var(--sbb-seat-reservation-area-border-radius) var(--sbb-seat-reservation-area-border-radius) 0 0}:host([mounting=upper-to-lower-border]){border-block-start:none;border-block-end:none;border-radius:0}:host(.sbb-seat-reservation-area--cursor-pointer){cursor:var(--sbb-cursor-pointer)}", l = (() => {
|
|
6
|
+
var c = ":host{--sbb-seat-reservation-area-border-radius: var(--sbb-border-width-4x);--sbb-seat-reservation-area-rotation: 0;--sbb-seat-reservation-area-z-index: 0;display:flex;justify-content:center;align-items:center;height:calc(var(--sbb-seat-reservation-area-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:calc(var(--sbb-seat-reservation-area-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));border:var(--sbb-border-width-1x) solid var(--sbb-color-graphite);border:var(--sbb-border-width-1x) solid light-dark(var(--sbb-color-graphite),var(--sbb-color-granite));border-radius:var(--sbb-seat-reservation-area-border-radius);position:absolute;z-index:var(--sbb-seat-reservation-area-z-index);inset-block-start:calc(var(--sbb-seat-reservation-area-top) * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(var(--sbb-seat-reservation-area-left) * var(--sbb-seat-reservation-one-px-rem, .0625rem));rotate:calc(var(--sbb-seat-reservation-area-rotation) * 1deg);line-height:normal;background-color:var(--sbb-background-color-2)}:host([background=dark]){background-color:var(--sbb-color-milk);background-color:light-dark(var(--sbb-color-milk),var(--sbb-color-iron))}:host([mounting=upper-border]){border-block-start-width:0;border-radius:0 0 var(--sbb-seat-reservation-area-border-radius) var(--sbb-seat-reservation-area-border-radius)}:host([mounting=lower-border]){border-block-end-width:0;border-radius:var(--sbb-seat-reservation-area-border-radius) var(--sbb-seat-reservation-area-border-radius) 0 0}:host([mounting=upper-to-lower-border]){border-block-start:none;border-block-end:none;border-radius:0}:host(.sbb-seat-reservation-area--cursor-pointer){cursor:var(--sbb-cursor-pointer)}", l = (() => {
|
|
7
7
|
let l = n, u, d = [], f = [], p, m = [], h = [];
|
|
8
8
|
return class extends l {
|
|
9
9
|
static {
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { __esDecorate as e, __runInitializers as t } from "tslib";
|
|
2
|
+
import { SbbElement as n, SbbLanguageController as r, boxSizingStyles as i, forceType as a } from "@sbb-esta/lyne-elements/core.js";
|
|
3
|
+
import { SbbIconElement as o } from "@sbb-esta/lyne-elements/icon.pure.js";
|
|
4
|
+
import { html as s, isServer as c, unsafeCSS as l } from "lit";
|
|
5
|
+
import { property as u } from "lit/decorators.js";
|
|
6
|
+
import { classMap as d } from "lit/directives/class-map.js";
|
|
7
|
+
import { mapIconToSvg as f } from "./seat-reservation/common/mapper.js";
|
|
8
|
+
import { getI18nSeatReservation as p } from "./seat-reservation/common/translations.js";
|
|
9
|
+
//#region src/elements-experimental/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.scss?inline
|
|
10
|
+
var m = ":host{--sbb-seat-reservation-graphic-max-width: auto;--sbb-seat-reservation-graphic-max-height: auto;--sbb-seat-reservation-graphic-width: 16;--sbb-seat-reservation-graphic-height: 16;--sbb-seat-reservation-graphic-rotation: 0;--sbb-seat-reservation-graphic-inverse-rotation: 0;--sbb-seat-reservation-graphic-padding-percent: 1;--sbb-seat-reservation-graphic-position: initial;--sbb-seat-reservation-graphic-z-index: 0;--sbb-seat-reservation-graphic-left: 0;--sbb-seat-reservation-graphic-top: 0;--sbb-icon-svg-width: calc( var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem) );--sbb-icon-svg-height: calc( var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem) );display:flex;justify-content:center;align-items:center;width:calc(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:calc(var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));position:var(--sbb-seat-reservation-graphic-position);z-index:var(--sbb-seat-reservation-graphic-z-index);inset-inline-start:calc(var(--sbb-seat-reservation-graphic-left) * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-block-start:calc(var(--sbb-seat-reservation-graphic-top) * var(--sbb-seat-reservation-one-px-rem, .0625rem))}:host(.auto-width){--sbb-icon-svg-width: auto;max-width:calc(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:auto}:host(.sbb-sr-graphic__dimension--square-dim){--sbb-icon-svg-width: min(min(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem), var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) * var(--sbb-seat-reservation-graphic-padding-percent), min(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem), var(--sbb-seat-reservation-graphic-max-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)));--sbb-icon-svg-height: min(min(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem), var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) * var(--sbb-seat-reservation-graphic-padding-percent), min(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem), var(--sbb-seat-reservation-graphic-max-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)));width:min(min(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem),var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) * var(--sbb-seat-reservation-graphic-padding-percent),min(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem),var(--sbb-seat-reservation-graphic-max-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)));height:min(min(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem),var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) * var(--sbb-seat-reservation-graphic-padding-percent),min(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem),var(--sbb-seat-reservation-graphic-max-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)))}:host(.sbb-seat-reservation-graphic--cursor-pointer){cursor:var(--sbb-cursor-pointer)}.sbb-sr-icon,.sbb-sr-graphic{width:inherit;height:inherit;transform-origin:center;rotate:calc(var(--sbb-seat-reservation-graphic-rotation) * 1deg)}.sbb-sr-icon{color:var(--sbb-color-granite);color:light-dark(var(--sbb-color-granite),var(--sbb-color-graphite))}.sbb-sr-graphic svg{width:100%;height:100%}.sbb-sr-graphic svg .fix-rotation-inverse{transform-origin:center;rotate:calc(var(--sbb-seat-reservation-graphic-inverse-rotation) * 1deg)}@media(forced-colors:active){.sbb-sr-graphic svg:not(.color-immutable) [fill]:not([fill=none]){fill:currentcolor}.sbb-sr-graphic .no-bg{fill:transparent}}", h = (() => {
|
|
11
|
+
let h = n, g, _ = [], v = [], y, b = [], x = [];
|
|
12
|
+
return class extends h {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.#e = t(this, _, ""), this.#t = (t(this, v), t(this, b, !1)), this._language = (t(this, x), new r(this));
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(h[Symbol.metadata] ?? null) : void 0;
|
|
18
|
+
g = [a(), u({ attribute: "name" })], y = [a(), u({
|
|
19
|
+
attribute: "stretch",
|
|
20
|
+
type: Boolean
|
|
21
|
+
})], e(this, null, g, {
|
|
22
|
+
kind: "accessor",
|
|
23
|
+
name: "name",
|
|
24
|
+
static: !1,
|
|
25
|
+
private: !1,
|
|
26
|
+
access: {
|
|
27
|
+
has: (e) => "name" in e,
|
|
28
|
+
get: (e) => e.name,
|
|
29
|
+
set: (e, t) => {
|
|
30
|
+
e.name = t;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
metadata: t
|
|
34
|
+
}, _, v), e(this, null, y, {
|
|
35
|
+
kind: "accessor",
|
|
36
|
+
name: "stretch",
|
|
37
|
+
static: !1,
|
|
38
|
+
private: !1,
|
|
39
|
+
access: {
|
|
40
|
+
has: (e) => "stretch" in e,
|
|
41
|
+
get: (e) => e.stretch,
|
|
42
|
+
set: (e, t) => {
|
|
43
|
+
e.stretch = t;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
metadata: t
|
|
47
|
+
}, b, x), t && Object.defineProperty(this, Symbol.metadata, {
|
|
48
|
+
enumerable: !0,
|
|
49
|
+
configurable: !0,
|
|
50
|
+
writable: !0,
|
|
51
|
+
value: t
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
static {
|
|
55
|
+
this.elementName = "sbb-seat-reservation-graphic";
|
|
56
|
+
}
|
|
57
|
+
static {
|
|
58
|
+
this.elementDependencies = [o];
|
|
59
|
+
}
|
|
60
|
+
static {
|
|
61
|
+
this.styles = [i, l(m)];
|
|
62
|
+
}
|
|
63
|
+
#e;
|
|
64
|
+
get name() {
|
|
65
|
+
return this.#e;
|
|
66
|
+
}
|
|
67
|
+
set name(e) {
|
|
68
|
+
this.#e = e;
|
|
69
|
+
}
|
|
70
|
+
#t;
|
|
71
|
+
get stretch() {
|
|
72
|
+
return this.#t;
|
|
73
|
+
}
|
|
74
|
+
set stretch(e) {
|
|
75
|
+
this.#t = e;
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
let e = f[this.name];
|
|
79
|
+
return !e?.svg && !e?.svgName ? null : s`<span
|
|
80
|
+
class="${d({
|
|
81
|
+
"sbb-sr-icon": !!e.svgName,
|
|
82
|
+
"sbb-sr-graphic": !!e.svg
|
|
83
|
+
})}"
|
|
84
|
+
>
|
|
85
|
+
${e.svgName ? s` <sbb-icon
|
|
86
|
+
name="${e.svgName || ""}"
|
|
87
|
+
aria-hidden="false"
|
|
88
|
+
aria-label="${p(e.svgName, this._language.current)}"
|
|
89
|
+
></sbb-icon>` : s`${this._getSvgElement(e.svg)}`}
|
|
90
|
+
</span>`;
|
|
91
|
+
}
|
|
92
|
+
_getSvgElement(e) {
|
|
93
|
+
if (!c) {
|
|
94
|
+
let t = new DOMParser(), n = e || "<svg></svg>", r = t.parseFromString(n, "image/svg+xml").firstElementChild;
|
|
95
|
+
return this.stretch && r?.nodeName.toLowerCase() === "svg" && r.setAttribute("preserveAspectRatio", "none"), r;
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
})();
|
|
101
|
+
//#endregion
|
|
102
|
+
export { h as t };
|