@sbb-esta/lyne-elements-experimental-dev 4.7.0-dev.1773333596 → 4.7.0-dev.1773388997
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/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +65 -76
- package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +72 -52
- package/autocomplete-grid/autocomplete-grid-button.js +3 -6
- package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +2 -17
- package/autocomplete-grid/autocomplete-grid-cell.js +4 -7
- package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +20 -21
- package/autocomplete-grid/autocomplete-grid-optgroup.js +3 -6
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +2 -33
- package/autocomplete-grid/autocomplete-grid-option.js +4 -9
- package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -22
- package/autocomplete-grid/autocomplete-grid-row.js +4 -7
- package/autocomplete-grid/autocomplete-grid.js +3 -6
- package/autocomplete-grid-cell.component-Dak9wlBr.js +24 -0
- package/autocomplete-grid-option.component-DNRFHOwc.js +37 -0
- package/autocomplete-grid-row.component-DBHZQ0GQ.js +27 -0
- package/autocomplete-grid.js +9 -21
- package/autocomplete-grid.pure.js +7 -15
- package/core/datetime/date-helper.js +2 -191
- package/core/datetime.js +2 -5
- package/core/timetable/access-leg-helper.js +76 -71
- package/core/timetable/timetable-helper.js +9 -11
- package/core/timetable/timetable-properties.js +0 -1
- package/core/timetable.js +3 -7
- package/date-helper-CGproP5d.js +185 -0
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +114 -122
- package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +92 -70
- package/development/autocomplete-grid/autocomplete-grid-button.js +6 -4
- package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +2 -29
- package/development/autocomplete-grid/autocomplete-grid-cell.js +7 -5
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +27 -22
- package/development/autocomplete-grid/autocomplete-grid-optgroup.js +6 -4
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +2 -109
- package/development/autocomplete-grid/autocomplete-grid-option.js +7 -7
- package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -91
- package/development/autocomplete-grid/autocomplete-grid-row.js +7 -5
- package/development/autocomplete-grid/autocomplete-grid.js +6 -4
- package/development/autocomplete-grid-cell.component-BBvM4o2H.js +42 -0
- package/development/autocomplete-grid-option.component-QzfM5eIE.js +123 -0
- package/development/autocomplete-grid-row.component-H8sCTCkT.js +104 -0
- package/development/autocomplete-grid.js +10 -14
- package/development/autocomplete-grid.pure.js +4 -13
- package/development/core/datetime/date-helper.js +2 -285
- package/development/core/datetime.js +2 -6
- package/development/core/timetable/access-leg-helper.js +104 -82
- package/development/core/timetable/timetable-helper.js +16 -17
- package/development/core/timetable/timetable-properties.js +0 -2
- package/development/core/timetable.js +3 -8
- package/development/date-helper-8_Y-PuHh.js +520 -0
- package/development/differenceInMinutes-DN_1Rk3O.js +110 -0
- package/development/format-Bbrn2bgo.js +1848 -0
- package/development/isValid-C-HzKv4v.js +178 -0
- package/development/journey-summary/journey-summary.component.js +2 -288
- package/development/journey-summary.component-uGhZvA4p.js +385 -0
- package/development/journey-summary.js +8 -5
- package/development/journey-summary.pure.js +2 -5
- package/development/pearl-chain/pearl-chain.component.js +2 -634
- package/development/pearl-chain-time/pearl-chain-time.component.js +2 -306
- package/development/pearl-chain-time.component-B8mayTWD.js +415 -0
- package/development/pearl-chain-time.js +8 -5
- package/development/pearl-chain-time.pure.js +2 -5
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +2 -28
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +2 -393
- package/development/pearl-chain-vertical-item.component-BDzbcIaf.js +435 -0
- package/development/pearl-chain-vertical-item.js +8 -5
- package/development/pearl-chain-vertical-item.pure.js +2 -5
- package/development/pearl-chain-vertical.component-CswE7b3M.js +39 -0
- package/development/pearl-chain-vertical.js +8 -5
- package/development/pearl-chain-vertical.pure.js +2 -5
- package/development/pearl-chain.component-wpsTvoSe.js +704 -0
- package/development/pearl-chain.js +8 -5
- package/development/pearl-chain.pure.js +2 -5
- package/development/seat-reservation/common/mapper/icon-mapper.js +168 -71
- package/development/seat-reservation/common/mapper/mapper.js +153 -122
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +570 -559
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +992 -972
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20334 -20367
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1731 -1738
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9741 -9782
- package/development/seat-reservation/common/mapper.js +1 -8
- package/development/seat-reservation/common/svgs.js +2 -46
- package/development/seat-reservation/common/translations/i18n.js +1118 -900
- package/development/seat-reservation/common/translations.js +1 -4
- package/development/seat-reservation/common/types.js +0 -2
- package/development/seat-reservation/common.js +7 -11
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +1305 -1230
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +2 -859
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +2 -106
- package/development/seat-reservation/seat-reservation-area.js +7 -5
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +35 -34
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +2 -162
- package/development/seat-reservation/seat-reservation-graphic.js +7 -5
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +2 -713
- package/development/seat-reservation/seat-reservation-navigation-coach.js +7 -5
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -131
- package/development/seat-reservation/seat-reservation-navigation-services.js +7 -5
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -601
- package/development/seat-reservation/seat-reservation-place-control.js +7 -5
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -22
- package/development/seat-reservation/seat-reservation-scoped.js +7 -5
- package/development/seat-reservation/seat-reservation.js +7 -6
- package/development/seat-reservation-area.component-BK92ZtFo.js +138 -0
- package/development/seat-reservation-graphic.component-cUnsHh5x.js +193 -0
- package/development/seat-reservation-navigation-coach.component-D6Bglus8.js +828 -0
- package/development/seat-reservation-navigation-services.component-DYJ6Ddkg.js +179 -0
- package/development/seat-reservation-place-control.component-Bg9evKBW.js +726 -0
- package/development/seat-reservation-scoped.component-DRQ_I702.js +31 -0
- package/development/seat-reservation.component-Cq_aJKR0.js +818 -0
- package/development/seat-reservation.js +15 -28
- package/development/seat-reservation.pure.js +10 -28
- package/development/svgs-C3JMWR26.js +28 -0
- package/development/timetable-duration/timetable-duration.component.js +2 -108
- package/development/timetable-duration.component-DI0lET17.js +125 -0
- package/development/timetable-duration.js +8 -5
- package/development/timetable-duration.pure.js +2 -5
- package/development/timetable-row/timetable-row.component.js +2 -781
- package/development/timetable-row.component-CAED6Zwc.js +932 -0
- package/development/timetable-row.js +8 -13
- package/development/timetable-row.pure.js +2 -12
- package/development/toDate-Biiv3kyf.js +150 -0
- package/differenceInMinutes-Dr9gRqtu.js +27 -0
- package/format-CM5exOsN.js +1103 -0
- package/isValid-B9oVW3lA.js +36 -0
- package/journey-summary/journey-summary.component.js +2 -194
- package/journey-summary.component-Cq_4kaOp.js +264 -0
- package/journey-summary.js +5 -4
- package/journey-summary.pure.js +2 -4
- package/package.json +2 -2
- package/pearl-chain/pearl-chain.component.js +2 -165
- package/pearl-chain-time/pearl-chain-time.component.js +2 -157
- package/pearl-chain-time.component-DGDW5S1c.js +239 -0
- package/pearl-chain-time.js +5 -4
- package/pearl-chain-time.pure.js +2 -4
- package/pearl-chain-vertical/pearl-chain-vertical.component.js +2 -17
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +2 -77
- package/pearl-chain-vertical-item.component-G22bWhLU.js +108 -0
- package/pearl-chain-vertical-item.js +5 -4
- package/pearl-chain-vertical-item.pure.js +2 -4
- package/pearl-chain-vertical.component-CXIDT5RD.js +21 -0
- package/pearl-chain-vertical.js +5 -4
- package/pearl-chain-vertical.pure.js +2 -4
- package/pearl-chain.component-DmjkVIva.js +194 -0
- package/pearl-chain.js +5 -4
- package/pearl-chain.pure.js +2 -4
- package/seat-reservation/common/mapper/icon-mapper.js +71 -71
- package/seat-reservation/common/mapper/mapper.js +95 -89
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +568 -558
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +989 -970
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20332 -20366
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1729 -1737
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9739 -9781
- package/seat-reservation/common/mapper.js +3 -9
- package/seat-reservation/common/svgs.js +2 -243
- package/seat-reservation/common/translations/i18n.js +1084 -891
- package/seat-reservation/common/translations.js +2 -4
- package/seat-reservation/common/types.js +0 -1
- package/seat-reservation/common.js +9 -15
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +832 -810
- package/seat-reservation/seat-reservation/seat-reservation.component.js +2 -420
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +2 -51
- package/seat-reservation/seat-reservation-area.js +4 -7
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +68 -71
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +2 -75
- package/seat-reservation/seat-reservation-graphic.js +4 -7
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +2 -234
- package/seat-reservation/seat-reservation-navigation-coach.js +4 -7
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -85
- package/seat-reservation/seat-reservation-navigation-services.js +4 -7
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -203
- package/seat-reservation/seat-reservation-place-control.js +4 -7
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -13
- package/seat-reservation/seat-reservation-scoped.js +4 -7
- package/seat-reservation/seat-reservation.js +5 -9
- package/seat-reservation-area.component-n-9rGn_y.js +75 -0
- package/seat-reservation-graphic.component-YTXRmKt0.js +102 -0
- package/seat-reservation-navigation-coach.component-YJ0vaYmO.js +333 -0
- package/seat-reservation-navigation-services.component-C3xnLJg2.js +127 -0
- package/seat-reservation-place-control.component-DmBAfM6K.js +322 -0
- package/seat-reservation-scoped.component-DPkz6u17.js +17 -0
- package/seat-reservation.component-C_anMkgw.js +364 -0
- package/seat-reservation.js +17 -39
- package/seat-reservation.pure.js +15 -32
- package/svgs-D9arBcqr.js +26 -0
- package/timetable-duration/timetable-duration.component.js +2 -57
- package/timetable-duration.component-DCu8Phts.js +65 -0
- package/timetable-duration.js +5 -4
- package/timetable-duration.pure.js +2 -4
- package/timetable-row/timetable-row.component.js +2 -427
- package/timetable-row.component-BVRCB3xK.js +559 -0
- package/timetable-row.js +6 -13
- package/timetable-row.pure.js +2 -11
- package/toDate-p-Tpkb7t.js +16 -0
- package/development/differenceInMinutes-B0dawX-5.js +0 -26
- package/development/format-BMkeaqaF.js +0 -1433
- package/development/isValid-BYRch7pV.js +0 -53
- package/development/toDate-BWb6Z1JD.js +0 -24
- package/differenceInMinutes-COvvdYsJ.js +0 -23
- package/format-CmKROkbc.js +0 -1186
- package/isValid-m3_OsPaB.js +0 -45
- package/toDate-Bw2KTWeq.js +0 -15
|
@@ -1,811 +1,833 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
1
|
+
import { __esDecorate as e, __runInitializers as t } from "tslib";
|
|
2
|
+
import { SbbElement as n } from "@sbb-esta/lyne-elements/core/base-elements.js";
|
|
3
|
+
import { forceType as r } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
4
|
+
import { isServer as i } from "lit";
|
|
5
|
+
import { isArrowKeyOrPageKeysPressed as a } from "@sbb-esta/lyne-elements/core/a11y.js";
|
|
6
|
+
import { eventOptions as ee, property as o, state as s } from "lit/decorators.js";
|
|
7
|
+
import { mapCoachInfosToCoachSelection as te, mapIconToSvg as c, mapPlaceAndCoachToSeatReservationPlaceSelection as ne, mapPlaceInfosToPlaceSelection as re } from "../common/mapper.js";
|
|
8
|
+
//#region src/elements-experimental/seat-reservation/seat-reservation/seat-reservation-base-element.ts
|
|
9
|
+
var l;
|
|
10
|
+
(function(e) {
|
|
11
|
+
e.right = "right", e.left = "left";
|
|
12
|
+
})(l ||= {});
|
|
13
|
+
var ie = 3, ae = [
|
|
14
|
+
"sa-vo",
|
|
15
|
+
"sa-rs",
|
|
16
|
+
"sa-abteilkinderwagen",
|
|
17
|
+
"sa-wr",
|
|
18
|
+
"sa-fa",
|
|
19
|
+
"sa-bz",
|
|
20
|
+
"sa-rz"
|
|
21
|
+
], u = (() => {
|
|
22
|
+
let u = n, d = [], f, p = [], m = [], h, g = [], _ = [], v, y = [], b = [], x, S = [], C = [], w, T = [], E = [], D, O = [], oe = [], k, A = [], j = [], M, N = [], P = [], F, I = [], L = [], R, z = [], B = [], V, H = [], U = [], W, G = [], K = [], q, J = [], Y = [], X, Z = [], Q = [], $;
|
|
23
|
+
return class extends u {
|
|
24
|
+
static {
|
|
25
|
+
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
|
|
26
|
+
f = [o({
|
|
27
|
+
attribute: "seat-reservations",
|
|
28
|
+
type: Array
|
|
29
|
+
})], h = [o({
|
|
30
|
+
attribute: "travel-direction",
|
|
31
|
+
type: String
|
|
32
|
+
})], v = [r(), o({
|
|
33
|
+
attribute: "has-navigation",
|
|
34
|
+
type: Boolean
|
|
35
|
+
})], x = [r(), o({
|
|
36
|
+
attribute: "align-vertical",
|
|
37
|
+
type: Boolean,
|
|
38
|
+
reflect: !0,
|
|
39
|
+
useDefault: !0
|
|
40
|
+
})], w = [r(), o({
|
|
41
|
+
attribute: "base-grid-size",
|
|
42
|
+
type: Number
|
|
43
|
+
})], D = [r(), o({
|
|
44
|
+
attribute: "height",
|
|
45
|
+
type: Number
|
|
46
|
+
})], k = [r(), o({
|
|
47
|
+
attribute: "max-seat-reservations",
|
|
48
|
+
type: Number
|
|
49
|
+
})], M = [r(), o({
|
|
50
|
+
attribute: "max-bicycle-reservations",
|
|
51
|
+
type: Number
|
|
52
|
+
})], F = [r(), o({
|
|
53
|
+
attribute: "prevent-place-click",
|
|
54
|
+
type: Boolean
|
|
55
|
+
})], R = [r(), o({
|
|
56
|
+
attribute: "preselect-coach-index",
|
|
57
|
+
type: Number
|
|
58
|
+
})], V = [r(), o({
|
|
59
|
+
attribute: "show-title-info",
|
|
60
|
+
type: Boolean
|
|
61
|
+
})], W = [s()], q = [s()], X = [s()], $ = [ee({ passive: !0 })], e(this, null, f, {
|
|
62
|
+
kind: "accessor",
|
|
63
|
+
name: "seatReservations",
|
|
64
|
+
static: !1,
|
|
65
|
+
private: !1,
|
|
66
|
+
access: {
|
|
67
|
+
has: (e) => "seatReservations" in e,
|
|
68
|
+
get: (e) => e.seatReservations,
|
|
69
|
+
set: (e, t) => {
|
|
70
|
+
e.seatReservations = t;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
metadata: t
|
|
74
|
+
}, p, m), e(this, null, h, {
|
|
75
|
+
kind: "accessor",
|
|
76
|
+
name: "travelDirection",
|
|
77
|
+
static: !1,
|
|
78
|
+
private: !1,
|
|
79
|
+
access: {
|
|
80
|
+
has: (e) => "travelDirection" in e,
|
|
81
|
+
get: (e) => e.travelDirection,
|
|
82
|
+
set: (e, t) => {
|
|
83
|
+
e.travelDirection = t;
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
metadata: t
|
|
87
|
+
}, g, _), e(this, null, v, {
|
|
88
|
+
kind: "accessor",
|
|
89
|
+
name: "hasNavigation",
|
|
90
|
+
static: !1,
|
|
91
|
+
private: !1,
|
|
92
|
+
access: {
|
|
93
|
+
has: (e) => "hasNavigation" in e,
|
|
94
|
+
get: (e) => e.hasNavigation,
|
|
95
|
+
set: (e, t) => {
|
|
96
|
+
e.hasNavigation = t;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
metadata: t
|
|
100
|
+
}, y, b), e(this, null, x, {
|
|
101
|
+
kind: "accessor",
|
|
102
|
+
name: "alignVertical",
|
|
103
|
+
static: !1,
|
|
104
|
+
private: !1,
|
|
105
|
+
access: {
|
|
106
|
+
has: (e) => "alignVertical" in e,
|
|
107
|
+
get: (e) => e.alignVertical,
|
|
108
|
+
set: (e, t) => {
|
|
109
|
+
e.alignVertical = t;
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
metadata: t
|
|
113
|
+
}, S, C), e(this, null, w, {
|
|
114
|
+
kind: "accessor",
|
|
115
|
+
name: "baseGridSize",
|
|
116
|
+
static: !1,
|
|
117
|
+
private: !1,
|
|
118
|
+
access: {
|
|
119
|
+
has: (e) => "baseGridSize" in e,
|
|
120
|
+
get: (e) => e.baseGridSize,
|
|
121
|
+
set: (e, t) => {
|
|
122
|
+
e.baseGridSize = t;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
metadata: t
|
|
126
|
+
}, T, E), e(this, null, D, {
|
|
127
|
+
kind: "accessor",
|
|
128
|
+
name: "height",
|
|
129
|
+
static: !1,
|
|
130
|
+
private: !1,
|
|
131
|
+
access: {
|
|
132
|
+
has: (e) => "height" in e,
|
|
133
|
+
get: (e) => e.height,
|
|
134
|
+
set: (e, t) => {
|
|
135
|
+
e.height = t;
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
metadata: t
|
|
139
|
+
}, O, oe), e(this, null, k, {
|
|
140
|
+
kind: "accessor",
|
|
141
|
+
name: "maxSeatReservations",
|
|
142
|
+
static: !1,
|
|
143
|
+
private: !1,
|
|
144
|
+
access: {
|
|
145
|
+
has: (e) => "maxSeatReservations" in e,
|
|
146
|
+
get: (e) => e.maxSeatReservations,
|
|
147
|
+
set: (e, t) => {
|
|
148
|
+
e.maxSeatReservations = t;
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
metadata: t
|
|
152
|
+
}, A, j), e(this, null, M, {
|
|
153
|
+
kind: "accessor",
|
|
154
|
+
name: "maxBicycleReservations",
|
|
155
|
+
static: !1,
|
|
156
|
+
private: !1,
|
|
157
|
+
access: {
|
|
158
|
+
has: (e) => "maxBicycleReservations" in e,
|
|
159
|
+
get: (e) => e.maxBicycleReservations,
|
|
160
|
+
set: (e, t) => {
|
|
161
|
+
e.maxBicycleReservations = t;
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
metadata: t
|
|
165
|
+
}, N, P), e(this, null, F, {
|
|
166
|
+
kind: "accessor",
|
|
167
|
+
name: "preventPlaceClick",
|
|
168
|
+
static: !1,
|
|
169
|
+
private: !1,
|
|
170
|
+
access: {
|
|
171
|
+
has: (e) => "preventPlaceClick" in e,
|
|
172
|
+
get: (e) => e.preventPlaceClick,
|
|
173
|
+
set: (e, t) => {
|
|
174
|
+
e.preventPlaceClick = t;
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
metadata: t
|
|
178
|
+
}, I, L), e(this, null, R, {
|
|
179
|
+
kind: "accessor",
|
|
180
|
+
name: "preselectCoachIndex",
|
|
181
|
+
static: !1,
|
|
182
|
+
private: !1,
|
|
183
|
+
access: {
|
|
184
|
+
has: (e) => "preselectCoachIndex" in e,
|
|
185
|
+
get: (e) => e.preselectCoachIndex,
|
|
186
|
+
set: (e, t) => {
|
|
187
|
+
e.preselectCoachIndex = t;
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
metadata: t
|
|
191
|
+
}, z, B), e(this, null, V, {
|
|
192
|
+
kind: "accessor",
|
|
193
|
+
name: "showTitleInfo",
|
|
194
|
+
static: !1,
|
|
195
|
+
private: !1,
|
|
196
|
+
access: {
|
|
197
|
+
has: (e) => "showTitleInfo" in e,
|
|
198
|
+
get: (e) => e.showTitleInfo,
|
|
199
|
+
set: (e, t) => {
|
|
200
|
+
e.showTitleInfo = t;
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
metadata: t
|
|
204
|
+
}, H, U), e(this, null, W, {
|
|
205
|
+
kind: "accessor",
|
|
206
|
+
name: "selectedCoachIndex",
|
|
207
|
+
static: !1,
|
|
208
|
+
private: !1,
|
|
209
|
+
access: {
|
|
210
|
+
has: (e) => "selectedCoachIndex" in e,
|
|
211
|
+
get: (e) => e.selectedCoachIndex,
|
|
212
|
+
set: (e, t) => {
|
|
213
|
+
e.selectedCoachIndex = t;
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
metadata: t
|
|
217
|
+
}, G, K), e(this, null, q, {
|
|
218
|
+
kind: "accessor",
|
|
219
|
+
name: "focusedCoachIndex",
|
|
220
|
+
static: !1,
|
|
221
|
+
private: !1,
|
|
222
|
+
access: {
|
|
223
|
+
has: (e) => "focusedCoachIndex" in e,
|
|
224
|
+
get: (e) => e.focusedCoachIndex,
|
|
225
|
+
set: (e, t) => {
|
|
226
|
+
e.focusedCoachIndex = t;
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
metadata: t
|
|
230
|
+
}, J, Y), e(this, null, X, {
|
|
231
|
+
kind: "accessor",
|
|
232
|
+
name: "hoveredCoachIndex",
|
|
233
|
+
static: !1,
|
|
234
|
+
private: !1,
|
|
235
|
+
access: {
|
|
236
|
+
has: (e) => "hoveredCoachIndex" in e,
|
|
237
|
+
get: (e) => e.hoveredCoachIndex,
|
|
238
|
+
set: (e, t) => {
|
|
239
|
+
e.hoveredCoachIndex = t;
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
metadata: t
|
|
243
|
+
}, Z, Q), e(this, null, $, {
|
|
244
|
+
kind: "method",
|
|
245
|
+
name: "coachAreaScrollend",
|
|
246
|
+
static: !1,
|
|
247
|
+
private: !1,
|
|
248
|
+
access: {
|
|
249
|
+
has: (e) => "coachAreaScrollend" in e,
|
|
250
|
+
get: (e) => e.coachAreaScrollend
|
|
251
|
+
},
|
|
252
|
+
metadata: t
|
|
253
|
+
}, null, d), t && Object.defineProperty(this, Symbol.metadata, {
|
|
254
|
+
enumerable: !0,
|
|
255
|
+
configurable: !0,
|
|
256
|
+
writable: !0,
|
|
257
|
+
value: t
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
static {
|
|
261
|
+
this.events = {
|
|
262
|
+
selectedplaces: "selectedplaces",
|
|
263
|
+
selectedcoach: "selectedcoach"
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
#e;
|
|
267
|
+
get seatReservations() {
|
|
268
|
+
return this.#e;
|
|
269
|
+
}
|
|
270
|
+
set seatReservations(e) {
|
|
271
|
+
this.#e = e;
|
|
272
|
+
}
|
|
273
|
+
#t;
|
|
274
|
+
get travelDirection() {
|
|
275
|
+
return this.#t;
|
|
276
|
+
}
|
|
277
|
+
set travelDirection(e) {
|
|
278
|
+
this.#t = e;
|
|
279
|
+
}
|
|
280
|
+
#n;
|
|
281
|
+
get hasNavigation() {
|
|
282
|
+
return this.#n;
|
|
283
|
+
}
|
|
284
|
+
set hasNavigation(e) {
|
|
285
|
+
this.#n = e;
|
|
286
|
+
}
|
|
287
|
+
#r;
|
|
288
|
+
get alignVertical() {
|
|
289
|
+
return this.#r;
|
|
290
|
+
}
|
|
291
|
+
set alignVertical(e) {
|
|
292
|
+
this.#r = e;
|
|
293
|
+
}
|
|
294
|
+
#i;
|
|
295
|
+
get baseGridSize() {
|
|
296
|
+
return this.#i;
|
|
297
|
+
}
|
|
298
|
+
set baseGridSize(e) {
|
|
299
|
+
this.#i = e;
|
|
300
|
+
}
|
|
301
|
+
#a;
|
|
302
|
+
get height() {
|
|
303
|
+
return this.#a;
|
|
304
|
+
}
|
|
305
|
+
set height(e) {
|
|
306
|
+
this.#a = e;
|
|
307
|
+
}
|
|
308
|
+
#o;
|
|
309
|
+
get maxSeatReservations() {
|
|
310
|
+
return this.#o;
|
|
311
|
+
}
|
|
312
|
+
set maxSeatReservations(e) {
|
|
313
|
+
this.#o = e;
|
|
314
|
+
}
|
|
315
|
+
#s;
|
|
316
|
+
get maxBicycleReservations() {
|
|
317
|
+
return this.#s;
|
|
318
|
+
}
|
|
319
|
+
set maxBicycleReservations(e) {
|
|
320
|
+
this.#s = e;
|
|
321
|
+
}
|
|
322
|
+
#c;
|
|
323
|
+
get preventPlaceClick() {
|
|
324
|
+
return this.#c;
|
|
325
|
+
}
|
|
326
|
+
set preventPlaceClick(e) {
|
|
327
|
+
this.#c = e;
|
|
328
|
+
}
|
|
329
|
+
#l;
|
|
330
|
+
get preselectCoachIndex() {
|
|
331
|
+
return this.#l;
|
|
332
|
+
}
|
|
333
|
+
set preselectCoachIndex(e) {
|
|
334
|
+
this.#l = e;
|
|
335
|
+
}
|
|
336
|
+
#u;
|
|
337
|
+
get showTitleInfo() {
|
|
338
|
+
return this.#u;
|
|
339
|
+
}
|
|
340
|
+
set showTitleInfo(e) {
|
|
341
|
+
this.#u = e;
|
|
342
|
+
}
|
|
343
|
+
#d;
|
|
344
|
+
get selectedCoachIndex() {
|
|
345
|
+
return this.#d;
|
|
346
|
+
}
|
|
347
|
+
set selectedCoachIndex(e) {
|
|
348
|
+
this.#d = e;
|
|
349
|
+
}
|
|
350
|
+
#f;
|
|
351
|
+
get focusedCoachIndex() {
|
|
352
|
+
return this.#f;
|
|
353
|
+
}
|
|
354
|
+
set focusedCoachIndex(e) {
|
|
355
|
+
this.#f = e;
|
|
356
|
+
}
|
|
357
|
+
#p;
|
|
358
|
+
get hoveredCoachIndex() {
|
|
359
|
+
return this.#p;
|
|
360
|
+
}
|
|
361
|
+
set hoveredCoachIndex(e) {
|
|
362
|
+
this.#p = e;
|
|
363
|
+
}
|
|
364
|
+
constructor() {
|
|
365
|
+
super(), this.#e = (t(this, d), t(this, p, null)), this.#t = (t(this, m), t(this, g, "NONE")), this.#n = (t(this, _), t(this, y, !0)), this.#r = (t(this, b), t(this, S, !1)), this.#i = (t(this, C), t(this, T, 16)), this.#a = (t(this, E), t(this, O, null)), this.#o = (t(this, oe), t(this, A, -1)), this.#s = (t(this, j), t(this, N, -1)), this.#c = (t(this, P), t(this, I, !1)), this.#l = (t(this, L), t(this, z, -1)), this.#u = (t(this, B), t(this, H, !1)), this.#d = (t(this, U), t(this, G, -1)), this.#f = (t(this, K), t(this, J, -1)), this.#p = (t(this, Y), t(this, Z, -1)), this.coachBorderPadding = (t(this, Q), 6), this.gapBetweenCoaches = 4, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.gapBetweenCoachDecks = 48, this.coachNavButtonDim = 0, this.coachItemDetailsElements = [], this.currScrollDirection = l.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 = {
|
|
366
|
+
seats: [],
|
|
367
|
+
bicycles: []
|
|
368
|
+
}, this.seatReservationWithoutNavigationHasFocus = !1, this.isCoachGridFocusable = !1, this.isAutoScrolling = !1, this.isKeyboardNavigation = !1, this.hasMultipleDecks = !1, this.hasSeatReservationNativeFocus = !1, this.keyboardNavigationEvents = {
|
|
369
|
+
ArrowLeft: "ArrowLeft",
|
|
370
|
+
ArrowRight: "ArrowRight",
|
|
371
|
+
ArrowUp: "ArrowUp",
|
|
372
|
+
ArrowDown: "ArrowDown",
|
|
373
|
+
Tab: "Tab",
|
|
374
|
+
Enter: "Enter"
|
|
375
|
+
}, this.notAreaElements = [
|
|
376
|
+
"DRIVER_AREA",
|
|
377
|
+
"DRIVER_AREA_NO_VERTICAL_WALL",
|
|
378
|
+
"COACH_PASSAGE",
|
|
379
|
+
"COACH_WALL_NO_PASSAGE",
|
|
380
|
+
"COMPARTMENT_PASSAGE",
|
|
381
|
+
"COMPARTMENT_PASSAGE_HIGH",
|
|
382
|
+
"COMPARTMENT_PASSAGE_MIDDLE",
|
|
383
|
+
"COMPARTMENT_PASSAGE_LOW"
|
|
384
|
+
], this.overHangingElementInformation = [], this._isRunningInitPreselectCoachIndex = !1, this._lastStartScrollPos = -1, this._prepareServiceIconsNavigation = (e) => e && e?.map(function(e) {
|
|
385
|
+
return {
|
|
386
|
+
pId: e,
|
|
387
|
+
svgName: c[e]?.svgName ? c[e]?.svgName : ""
|
|
388
|
+
};
|
|
389
|
+
}).filter((e) => ae.indexOf(e.svgName) !== -1).filter((e, t, n) => n.map((e) => e.svgName).indexOf(e.svgName) === t).map((e) => e.pId).slice(0, ie) || [], this.addEventListener("blur", () => this._onLeaveSeatReservationComponent());
|
|
390
|
+
}
|
|
391
|
+
willUpdate(e) {
|
|
392
|
+
if (super.willUpdate(e), e.has("seatReservations") && (this.hasMultipleDecks = this.seatReservations?.length > 1, this._initPrepareSeatReservationData(), this._prepareCoachWidthAndGapCalculations(), 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.initNavigationSelectionByScrollEvent()), e.has("height") && this.height) {
|
|
393
|
+
let e = this.seatReservations[this.currSelectedDeckIndex] || null;
|
|
394
|
+
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.initNavigationSelectionByScrollEvent());
|
|
395
|
+
}
|
|
396
|
+
e.has("alignVertical") && this.alignVertical && this.initNavigationSelectionByScrollEvent(), e.has("preselectCoachIndex") && (this._isRunningInitPreselectCoachIndex = !0, setTimeout(() => this.scrollToSelectedNavCoach(this.preselectCoachIndex), 1));
|
|
397
|
+
}
|
|
398
|
+
navigateByDirectionBtn(e) {
|
|
399
|
+
this.unfocusPlaceElement();
|
|
400
|
+
let t = this.currSelectedCoachIndex;
|
|
401
|
+
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);
|
|
402
|
+
}
|
|
403
|
+
_initPrepareSeatReservationData() {
|
|
404
|
+
this._determineBaseFontSize(), this.hasMultipleDecks && this._initEmptyCoachDeckOffsets(), this._prepareCoachItemDetailsData();
|
|
405
|
+
}
|
|
406
|
+
initNavigationSelectionByScrollEvent() {
|
|
407
|
+
this.coachScrollArea = this.shadowRoot?.querySelector("#sbb-sr__wrapper-scrollarea"), this.navigationScrollArea = this.shadowRoot?.querySelector("#sbb-sr__navigation-list-coaches");
|
|
408
|
+
let e = this.seatReservations ? this.seatReservations[this.currSelectedDeckIndex] : null;
|
|
409
|
+
if (e && e.coachItems.length > 0) {
|
|
410
|
+
let t = e.coachItems[0].dimension.h * this.baseGridSize + this.coachBorderPadding, n = (this.seatReservations.length - 1) * this.gapBetweenCoachDecks;
|
|
411
|
+
this.style?.setProperty("--sbb-seat-reservation-height", `${t * this.seatReservations.length + n}`), this.style?.setProperty("--sbb-seat-reservation-decks", `${this.seatReservations.length}`);
|
|
412
|
+
}
|
|
413
|
+
if (this.navigationScrollArea) {
|
|
414
|
+
this.scrollNavigationAreaDim = this.alignVertical ? this.navigationScrollArea.getBoundingClientRect().height : this.navigationScrollArea.getBoundingClientRect().width;
|
|
415
|
+
let e = this.navigationScrollArea.querySelector("ul > li");
|
|
416
|
+
if (e) {
|
|
417
|
+
let t = e?.getBoundingClientRect();
|
|
418
|
+
this.coachNavButtonDim = this.alignVertical ? t.height : t.width;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if (this.coachScrollArea && e) {
|
|
422
|
+
let t = 0;
|
|
423
|
+
this.scrollCoachesAreaWidth = this.alignVertical ? this.coachScrollArea.getBoundingClientRect().height : this.coachScrollArea.getBoundingClientRect().width, this.triggerCoachPositionsCollection = e.coachItems.map((e) => {
|
|
424
|
+
let n = t, r = this.getCalculatedDimension(e.dimension).w, i = this.overHangingElementInformation.find((t) => t.coachId === e.id), a = i?.overhangingPlaces || i?.overhangingGraphicAreas;
|
|
425
|
+
return t += r + (a ? 2 * this.gapBetweenCoaches : this.gapBetweenCoaches), {
|
|
426
|
+
start: n,
|
|
427
|
+
end: t,
|
|
428
|
+
width: r
|
|
429
|
+
};
|
|
430
|
+
}), this.maxCalcCoachesWidth = t - this.gapBetweenCoaches;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
coachAreaScrollend() {
|
|
434
|
+
this._scrollTimeout && clearTimeout(this._scrollTimeout), this._scrollTimeout = setTimeout(() => this._handleCoachAreaScrollendEvent(), 150);
|
|
435
|
+
}
|
|
436
|
+
onFocusTableCoachAndPreselectPlace(e) {
|
|
437
|
+
!this.seatReservationWithoutNavigationHasFocus && !this.hasNavigation && (this.seatReservationWithoutNavigationHasFocus = !0, this.currSelectedCoachIndex = e === 0 ? this.getNextAvailableCoachIndex(-1) : this.getPrevAvailableCoachIndex(e), this.preselectPlaceInCoach());
|
|
438
|
+
}
|
|
439
|
+
onFocusNavDirectionButton() {
|
|
440
|
+
this.focusedCoachIndex = -1;
|
|
441
|
+
}
|
|
442
|
+
onKeyNavigationNavCoachButton(e, t) {
|
|
443
|
+
if (e.key === this.keyboardNavigationEvents.Tab) {
|
|
444
|
+
this._handleTabKeyNavigation(e, "navigation", t);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
a(e) && this.keyboardSeatmapEventHandling(e);
|
|
448
|
+
}
|
|
449
|
+
_handleTabKeyNavigation(e, t, n) {
|
|
450
|
+
let r = e.key, i = e.shiftKey;
|
|
451
|
+
r === this.keyboardNavigationEvents.Tab && (t == "navigation" ? (n == this.currSelectedCoachIndex ? !this.currSelectedPlace || !i || this.coachItemDetailsElements[n].isDriverArea || this.focusedCoachIndex == -1 ? this.focusedCoachIndex = n : i && this.currSelectedPlace && (this.focusedCoachIndex = -1, this.focusPlaceElement(this.currSelectedPlace)) : this.focusedCoachIndex = n, this._scrollToSelectedNavigationButton(n)) : t == "seatmap" && (e.preventDefault(), i ? this._navigateCoachNavigationByKeyboard("PREV_TAB") : this._navigateCoachNavigationByKeyboard("NEXT_TAB")));
|
|
452
|
+
}
|
|
453
|
+
keyboardSeatmapEventHandling(e) {
|
|
454
|
+
let t = e.key === this.keyboardNavigationEvents.Tab, n = e.shiftKey && t;
|
|
455
|
+
if (!this.hasNavigation && this.currSelectedCoachIndex === 0 && n || this.currSelectedCoachIndex === this.coachItemDetailsElements.length - 1 && t) return;
|
|
456
|
+
let r = e.key;
|
|
457
|
+
if (this.preventCoachScrollByPlaceClick = !1, !this.hasSeatReservationNativeFocus && (t || n) && (this.hasSeatReservationNativeFocus = !0), t) {
|
|
458
|
+
this._handleTabKeyNavigation(e, "seatmap");
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
if (this.currSelectedCoachIndex !== -1 && a(e)) switch (e.preventDefault(), r) {
|
|
462
|
+
case this.keyboardNavigationEvents.ArrowLeft:
|
|
463
|
+
{
|
|
464
|
+
let e = this.alignVertical ? this.keyboardNavigationEvents.ArrowDown : r;
|
|
465
|
+
this._navigateToPlaceByKeyboard(e);
|
|
466
|
+
}
|
|
467
|
+
break;
|
|
468
|
+
case this.keyboardNavigationEvents.ArrowRight:
|
|
469
|
+
{
|
|
470
|
+
let e = this.alignVertical ? this.keyboardNavigationEvents.ArrowUp : r;
|
|
471
|
+
this._navigateToPlaceByKeyboard(e);
|
|
472
|
+
}
|
|
473
|
+
break;
|
|
474
|
+
case this.keyboardNavigationEvents.ArrowUp:
|
|
475
|
+
{
|
|
476
|
+
let e = this.alignVertical ? this.keyboardNavigationEvents.ArrowLeft : r;
|
|
477
|
+
this._navigateToPlaceByKeyboard(e);
|
|
478
|
+
}
|
|
479
|
+
break;
|
|
480
|
+
case this.keyboardNavigationEvents.ArrowDown:
|
|
481
|
+
{
|
|
482
|
+
let e = this.alignVertical ? this.keyboardNavigationEvents.ArrowRight : r;
|
|
483
|
+
this._navigateToPlaceByKeyboard(e);
|
|
484
|
+
}
|
|
485
|
+
break;
|
|
486
|
+
default: break;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
preselectPlaceInCoach() {
|
|
490
|
+
if (this.isAutoScrolling) {
|
|
491
|
+
if (this._isRunningInitPreselectCoachIndex) {
|
|
492
|
+
this._isRunningInitPreselectCoachIndex = !1;
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
if (this.coachItemDetailsElements[this.currSelectedCoachIndex] && this.coachItemDetailsElements[this.currSelectedCoachIndex].isDriverArea) {
|
|
496
|
+
this._setFocusToSelectedCoachGrid();
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if (this.isKeyboardNavigation && this.isAutoScrolling) {
|
|
500
|
+
let e = this._getClosestPlaceByKeyDirection();
|
|
501
|
+
e ? (this.unfocusPlaceElement(), this.focusPlaceElement(e), this.focusedCoachIndex = -1) : this._setFocusToSelectedCoachGrid();
|
|
502
|
+
} else this.unfocusPlaceElement(), this.isCoachGridFocusable = !0, this._setFocusToSelectedCoachGrid();
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
scrollToSelectedNavCoach(e) {
|
|
506
|
+
if (this._isValidCoachIndex(e) && e !== this.currSelectedCoachIndex) {
|
|
507
|
+
this.hoveredCoachIndex = e, this.isAutoScrolling = !0, this.isCoachGridFocusable = !0, this.currSelectedCoachIndex = e, this.currSelectedDeckIndex = this._getExistingCoachDeckIndex(), this._setScrollDirectionByCoachIndex();
|
|
508
|
+
let t = this._getCoachScrollPositionX();
|
|
509
|
+
(this.selectedCoachIndex !== -1 || this.currSelectedCoachIndex > 0) && this._isScrollableToSelectedCoach() ? (this._lastStartScrollPos = this.coachScrollArea.scrollLeft, this.coachScrollArea.scrollTo({
|
|
510
|
+
top: this.alignVertical ? t : 0,
|
|
511
|
+
left: this.alignVertical ? 0 : t,
|
|
512
|
+
behavior: "smooth"
|
|
513
|
+
})) : this.updateCurrentSelectedCoach(), this._scrollToSelectedNavigationButton(e);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
focusPlaceElement(e) {
|
|
517
|
+
if (this.unfocusPlaceElement(), e) {
|
|
518
|
+
this.currSelectedPlace = e, this._setCurrSelectedPlaceElementId(e);
|
|
519
|
+
let t = this._getPlaceHtmlElement();
|
|
520
|
+
if (t) {
|
|
521
|
+
t.setAttribute("keyfocus", "focus");
|
|
522
|
+
let n = setTimeout(() => {
|
|
523
|
+
let t = this.getPlaceElementId(this.currSelectedDeckIndex, this.currSelectedCoachIndex, e.number);
|
|
524
|
+
this._scrollPlaceIntoNearestViewport(t), clearTimeout(n);
|
|
525
|
+
}, 0);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
unfocusPlaceElement() {
|
|
530
|
+
let e = this._getPlaceHtmlElement();
|
|
531
|
+
e && (e.setAttribute("keyfocus", "unfocus"), this._setCurrSelectedPlaceElementId(null), this.currSelectedPlace = null);
|
|
532
|
+
}
|
|
533
|
+
getCalculatedDimension(e, t, n, r) {
|
|
534
|
+
return t && !n && (e.h += this.coachBorderOffset * 2), r && (e.h += this.coachBorderOffset), {
|
|
535
|
+
w: this.baseGridSize * e.w,
|
|
536
|
+
h: this.baseGridSize * e.h
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
getCalculatedPosition(e, t, n, r) {
|
|
540
|
+
if (n && t) {
|
|
541
|
+
let i = r ? n.h : n.h + this.coachBorderOffset;
|
|
542
|
+
e.y === 0 ? e.y -= this.coachBorderOffset : e.y + t.h === i && (e.y += this.coachBorderOffset);
|
|
543
|
+
}
|
|
544
|
+
return {
|
|
545
|
+
x: this.baseGridSize * e.x,
|
|
546
|
+
y: this.baseGridSize * e.y,
|
|
547
|
+
z: e.z
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
isElementDirectlyOnBorder(e, t) {
|
|
551
|
+
return e.position.y === 0 || e.position.y + e.dimension.h === t.h;
|
|
552
|
+
}
|
|
553
|
+
getAvailableFreePlacesNumFromCoach(e) {
|
|
554
|
+
let t = {
|
|
555
|
+
seats: 0,
|
|
556
|
+
bicycles: 0
|
|
557
|
+
};
|
|
558
|
+
return e?.reduce((e, t) => (t.state === "FREE" && (t.type === "SEAT" ? e.seats++ : e.bicycles++), e), t) || t;
|
|
559
|
+
}
|
|
560
|
+
_handleCoachAreaScrollendEvent() {
|
|
561
|
+
let e = this.isAutoScrolling ? this.currSelectedCoachIndex : this._getCoachIndexByScrollTriggerPosition();
|
|
562
|
+
if (this.preventCoachScrollByPlaceClick) {
|
|
563
|
+
Math.abs(this._lastStartScrollPos - this.coachScrollArea.scrollLeft) > this.baseGridSize * 2 && (this.selectedCoachIndex = e), this.preventCoachScrollByPlaceClick = !1;
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
this._lastStartScrollPos = this.coachScrollArea.scrollLeft, this.hoveredCoachIndex = -1, 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);
|
|
567
|
+
}
|
|
568
|
+
_scrollToSelectedNavigationButton(e) {
|
|
569
|
+
setTimeout(() => {
|
|
570
|
+
if (this.hasNavigation && this.navigationScrollArea) {
|
|
571
|
+
let t = this.scrollNavigationAreaDim / 2, n = e * this.coachNavButtonDim - t + this.coachNavButtonDim;
|
|
572
|
+
this.navigationScrollArea.scrollTo({
|
|
573
|
+
top: this.alignVertical ? n : 0,
|
|
574
|
+
left: this.alignVertical ? 0 : n,
|
|
575
|
+
behavior: "smooth"
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
}, 10);
|
|
579
|
+
}
|
|
580
|
+
_setScrollDirectionByCoachIndex() {
|
|
581
|
+
this.currScrollDirection = this.currSelectedCoachIndex > this.selectedCoachIndex ? l.right : l.left;
|
|
582
|
+
}
|
|
583
|
+
_getCoachScrollPositionX() {
|
|
584
|
+
let e = this.triggerCoachPositionsCollection[this.currSelectedCoachIndex];
|
|
585
|
+
return this.isKeyboardNavigation && this.currScrollDirection === l.left && e.width > this.scrollCoachesAreaWidth ? e.end - this.scrollCoachesAreaWidth : e.start;
|
|
586
|
+
}
|
|
587
|
+
_setFocusToSelectedCoachGrid() {
|
|
588
|
+
if (this.isCoachGridFocusable && this.hasSeatReservationNativeFocus) {
|
|
589
|
+
this.isCoachGridFocusable = !1;
|
|
590
|
+
let e = this.shadowRoot?.querySelector("#sbb-sr-coach-caption-" + this.currSelectedCoachIndex);
|
|
591
|
+
e && e.focus();
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
_isScrollableToSelectedCoach() {
|
|
595
|
+
let e = this.alignVertical ? this.coachScrollArea.scrollTop : this.coachScrollArea.scrollLeft, t = this.alignVertical ? this.coachScrollArea.getBoundingClientRect().height : this.coachScrollArea.getBoundingClientRect().width, n = this.maxCalcCoachesWidth - t, r = this.triggerCoachPositionsCollection[this.currSelectedCoachIndex], i = e === this.triggerCoachPositionsCollection[this.currSelectedCoachIndex].start;
|
|
596
|
+
return (e < n || e > r.start) && !i;
|
|
597
|
+
}
|
|
598
|
+
_getCoachIndexByScrollTriggerPosition() {
|
|
599
|
+
let e = (this.alignVertical ? this.coachScrollArea.scrollTop : this.coachScrollArea.scrollLeft) + this.scrollCoachesAreaWidth / 2;
|
|
600
|
+
return this.triggerCoachPositionsCollection.findIndex((t) => e >= t.start && e <= t.end);
|
|
601
|
+
}
|
|
602
|
+
_getFirstPlaceInSelectedCoach() {
|
|
603
|
+
let e = null, t = this.seatReservations[this.currSelectedDeckIndex].coachItems[this.currSelectedCoachIndex], n = "cell-" + this.currSelectedDeckIndex + "-" + this.currSelectedCoachIndex + "-0-0", r = this.shadowRoot?.querySelector("#" + n)?.querySelector("sbb-seat-reservation-place-control")?.getAttribute("text") || null;
|
|
604
|
+
return t && r && (e = t.places?.find((e) => e.number === r) || null), e;
|
|
605
|
+
}
|
|
606
|
+
_getSwitchedCoachDeckIndexByKeyNavigation(e, t) {
|
|
607
|
+
return !this.currSelectedPlace || e === this.keyboardNavigationEvents.ArrowRight || e === this.keyboardNavigationEvents.ArrowLeft ? null : e === this.keyboardNavigationEvents.ArrowDown && this.currSelectedPlace.position.y + 2 === t.dimension.h && this.seatReservations[this.currSelectedDeckIndex + 1] ? this.currSelectedDeckIndex + 1 : e === this.keyboardNavigationEvents.ArrowUp && this.currSelectedPlace.position.y === 0 && this.seatReservations[this.currSelectedDeckIndex - 1] ? this.currSelectedDeckIndex - 1 : null;
|
|
608
|
+
}
|
|
609
|
+
_getClosestPlaceByKeyDirection(e) {
|
|
610
|
+
let t = this.seatReservations[this.currSelectedDeckIndex].coachItems[this.currSelectedCoachIndex], n = null, r = t.places, i = null;
|
|
611
|
+
if (r) {
|
|
612
|
+
if (!this.currSelectedPlaceElementId) return this._getFirstPlaceInSelectedCoach();
|
|
613
|
+
if (this.currSelectedPlace) {
|
|
614
|
+
let a = { ...this.currSelectedPlace.position };
|
|
615
|
+
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));
|
|
616
|
+
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 === l.right && t.position.y === a.y && (!n || t.position.x < n.position.x) || this.currScrollDirection === l.left && t.position.y === a.y && (!n || t.position.x > n.position.x)) && (n = t);
|
|
617
|
+
i !== null && n && (this.currSelectedDeckIndex = i);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return n;
|
|
621
|
+
}
|
|
622
|
+
_navigateCoachNavigationByKeyboard(e) {
|
|
623
|
+
let t = this.focusedCoachIndex === -1 ? this.currSelectedCoachIndex === -1 ? 0 : this.currSelectedCoachIndex : this.focusedCoachIndex, n = e === "NEXT_TAB" ? this.getNextAvailableCoachIndex(t) : this.getPrevAvailableCoachIndex(t);
|
|
624
|
+
if (this.hasNavigation) {
|
|
625
|
+
let r = this._getPlaceHtmlElement(), i = r ? r.getAttribute("keyfocus") === "focus" : !1;
|
|
626
|
+
if (e === "PREV_TAB" && this.selectedCoachIndex === t) if (i || this.currSelectedPlace !== null) {
|
|
627
|
+
this.focusedCoachIndex = t, this.unfocusPlaceElement();
|
|
628
|
+
return;
|
|
629
|
+
} else t === 0 ? this._refocusCurrentFocusedNavCoach(t) : this.focusedCoachIndex = n;
|
|
630
|
+
else n === this.currSelectedCoachIndex ? e === "NEXT_TAB" && n === this.coachItemDetailsElements.length - 1 ? this._refocusCurrentFocusedNavCoach(t) : (this.focusedCoachIndex = -1, this.selectedCoachIndex = n, i ? this.focusPlaceElement(this.currSelectedPlace) : (this.isCoachGridFocusable = !0, this._setFocusToSelectedCoachGrid())) : this.focusedCoachIndex = n;
|
|
631
|
+
this._scrollToSelectedNavigationButton(n);
|
|
632
|
+
} else this.scrollToSelectedNavCoach(n);
|
|
633
|
+
}
|
|
634
|
+
_refocusCurrentFocusedNavCoach(e) {
|
|
635
|
+
this.focusedCoachIndex = -1, setTimeout(() => this.focusedCoachIndex = e, 0);
|
|
636
|
+
}
|
|
637
|
+
_navigateToPlaceByKeyboard(e) {
|
|
638
|
+
if (this.isKeyboardNavigation = !0, this.focusedCoachIndex !== -1 && (this.focusedCoachIndex = -1), !this.preventPlaceClick) {
|
|
639
|
+
let t = this._getClosestPlaceByKeyDirection(e);
|
|
640
|
+
if (t) this.focusPlaceElement(t);
|
|
641
|
+
else if (e === this.keyboardNavigationEvents.ArrowRight || e === this.keyboardNavigationEvents.ArrowLeft || this.alignVertical && (e === this.keyboardNavigationEvents.ArrowUp || e === this.keyboardNavigationEvents.ArrowDown)) {
|
|
642
|
+
let t = e === this.keyboardNavigationEvents.ArrowRight ? this.getNextAvailableCoachIndex() : this.getPrevAvailableCoachIndex();
|
|
643
|
+
this.scrollToSelectedNavCoach(t);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
getNextAvailableCoachIndex(e) {
|
|
648
|
+
let t = e ?? this.currSelectedCoachIndex;
|
|
649
|
+
return t < this.seatReservations[this.currSelectedDeckIndex].coachItems.length - 1 ? t + 1 : t;
|
|
650
|
+
}
|
|
651
|
+
getPrevAvailableCoachIndex(e) {
|
|
652
|
+
let t = e ?? this.currSelectedCoachIndex;
|
|
653
|
+
return t > 0 ? t - 1 : t;
|
|
654
|
+
}
|
|
655
|
+
updateSelectedSeatReservationPlaces(e) {
|
|
656
|
+
let t = e.placeType === "SEAT" ? "seats" : "bicycles", n = e.placeType === "SEAT" ? this.maxSeatReservations : this.maxBicycleReservations, r = this.selectedSeatReservationPlaces[t];
|
|
657
|
+
this.selectedSeatReservationPlaces[t] = this._updateSelectedSeatReservationPlaces(r, n, e), this.dispatchEvent(new CustomEvent("selectedplaces", {
|
|
658
|
+
bubbles: !0,
|
|
659
|
+
composed: !0,
|
|
660
|
+
detail: this.selectedSeatReservationPlaces
|
|
661
|
+
}));
|
|
662
|
+
}
|
|
663
|
+
_updateSelectedSeatReservationPlaces(e, t, n) {
|
|
664
|
+
if (n.state === "SELECTED") {
|
|
665
|
+
let t = this._getDeckIndexByPlaceId(n.id), r = this._getSeatReservationPlaceSelection(n, t);
|
|
666
|
+
r && e.push(r);
|
|
667
|
+
} else e = e.filter((e) => e.id !== n.id);
|
|
668
|
+
if (t > -1 && e.length > t) {
|
|
669
|
+
let r = t > 0 ? n : void 0;
|
|
670
|
+
e = this._resetAllPlaceSelections(e, r);
|
|
671
|
+
}
|
|
672
|
+
return e;
|
|
673
|
+
}
|
|
674
|
+
updateCurrentSelectedPlaceInCoach(e) {
|
|
675
|
+
let t = this._getDeckIndexByPlaceId(e.id), n = e.coachIndex;
|
|
676
|
+
if (t === null) return;
|
|
677
|
+
let r = this.seatReservations[t].coachItems[n].places?.find((t) => t.number == e.number);
|
|
678
|
+
if (!r) return;
|
|
679
|
+
this.currSelectedDeckIndex = t, this.currSelectedCoachIndex = n, this.currSelectedPlace = r, this.currSelectedCoachIndex !== this.selectedCoachIndex && this.updateCurrentSelectedCoach(), this._setCurrSelectedPlaceElementId(r);
|
|
680
|
+
let i = setTimeout(() => {
|
|
681
|
+
this._scrollPlaceIntoNearestViewport(e.id), clearTimeout(i);
|
|
682
|
+
}, 0);
|
|
683
|
+
}
|
|
684
|
+
updateCurrentSelectedCoach() {
|
|
685
|
+
if (this.currSelectedCoachIndex == this.selectedCoachIndex) return;
|
|
686
|
+
this.focusedCoachIndex != -1 && (this.focusedCoachIndex = this.currSelectedCoachIndex), this.selectedCoachIndex = this.currSelectedCoachIndex;
|
|
687
|
+
let e = this._getSeatReservationSelectedCoach(this.selectedCoachIndex);
|
|
688
|
+
e && this.dispatchEvent(new CustomEvent("selectedcoach", {
|
|
689
|
+
bubbles: !0,
|
|
690
|
+
composed: !0,
|
|
691
|
+
detail: e
|
|
692
|
+
}));
|
|
693
|
+
}
|
|
694
|
+
getPlaceElementId(e, t, n) {
|
|
695
|
+
return "seat-reservation__place-button-" + e + "-" + t + "-" + n;
|
|
696
|
+
}
|
|
697
|
+
_initEmptyCoachDeckOffsets() {
|
|
698
|
+
let e = Array(this.seatReservations.length - 1).fill(0);
|
|
699
|
+
this.seatReservations[this.seatReservations.length - 1].coachItems.forEach((t) => {
|
|
700
|
+
for (let n = 0; n < this.seatReservations.length - 1; n++) {
|
|
701
|
+
let r = this.seatReservations[n].coachItems[e[n]];
|
|
702
|
+
if (t.id != r?.id) {
|
|
703
|
+
let r = {
|
|
704
|
+
...t,
|
|
705
|
+
places: void 0,
|
|
706
|
+
propertyIds: void 0,
|
|
707
|
+
graphicElements: void 0,
|
|
708
|
+
serviceElements: void 0,
|
|
709
|
+
travelClass: []
|
|
710
|
+
};
|
|
711
|
+
this.seatReservations[n].coachItems.splice(e[n], 0, r);
|
|
712
|
+
}
|
|
713
|
+
e[n]++;
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
_initSeatReservationPlaceSelection() {
|
|
718
|
+
this.selectedSeatReservationPlaces.seats = [], this.selectedSeatReservationPlaces.bicycles = [], this.seatReservations?.forEach((e, t) => e.coachItems.map((n, r) => {
|
|
719
|
+
n.places?.filter((e) => e.state === "SELECTED")?.forEach((n) => {
|
|
720
|
+
let i = re(n, this.getPlaceElementId(t, r, n.number), e.deckCoachIndex, r), a = this._getSeatReservationPlaceSelection(i, t);
|
|
721
|
+
a && (a.placeType === "SEAT" ? this.selectedSeatReservationPlaces.seats.push(a) : this.selectedSeatReservationPlaces.bicycles.push(a));
|
|
722
|
+
});
|
|
723
|
+
}));
|
|
724
|
+
}
|
|
725
|
+
_resetAllPlaceSelections(e, t) {
|
|
726
|
+
for (let n of e) if (!t || t.id !== n.id) {
|
|
727
|
+
let e = this.shadowRoot?.getElementById(n.id);
|
|
728
|
+
e && e.setAttribute("state", "FREE");
|
|
729
|
+
}
|
|
730
|
+
return e = t ? e.filter((e) => e.id === t.id) : [], e;
|
|
731
|
+
}
|
|
732
|
+
_getSeatReservationPlaceSelection(e, t) {
|
|
733
|
+
if (t === null) return null;
|
|
734
|
+
let n = this.seatReservations[t].coachItems[e.coachIndex], r = n.places?.find((t) => t.number === e.number);
|
|
735
|
+
return r ? ne(r, n, e.id, e.deckIndex, e.coachIndex) : null;
|
|
736
|
+
}
|
|
737
|
+
_getSeatReservationSelectedCoach(e) {
|
|
738
|
+
if (!this.seatReservations[this.currSelectedDeckIndex].coachItems[e]) return null;
|
|
739
|
+
let t = this.seatReservations[this.currSelectedDeckIndex].coachItems[e];
|
|
740
|
+
return te(e, t, this.getAvailableFreePlacesNumFromCoach(t.places));
|
|
741
|
+
}
|
|
742
|
+
_setCurrSelectedPlaceElementId(e) {
|
|
743
|
+
this.currSelectedPlaceElementId = e ? this.getPlaceElementId(this.currSelectedDeckIndex, this.currSelectedCoachIndex, e.number) : null;
|
|
744
|
+
}
|
|
745
|
+
_determineBaseFontSize() {
|
|
746
|
+
if (!i) {
|
|
747
|
+
let e = 1 / parseInt(window.getComputedStyle(document.body).fontSize, 10);
|
|
748
|
+
this.style?.setProperty("--sbb-seat-reservation-one-px-rem", `${e + "rem"}`);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
_prepareCoachItemDetailsData() {
|
|
752
|
+
if (this.seatReservations) {
|
|
753
|
+
let e = this.seatReservations[this.seatReservations.length - 1].coachItems;
|
|
754
|
+
this.coachItemDetailsElements = [], e.forEach((e, t) => {
|
|
755
|
+
let n = [], r = [], i = [];
|
|
756
|
+
this.seatReservations.map((e) => e.coachItems[t]).forEach((e) => {
|
|
757
|
+
n.push(...e.travelClass), r.push(...e.propertyIds ? e.propertyIds : []), i.push(...e.places ? e.places : []);
|
|
758
|
+
}), this.coachItemDetailsElements.push({
|
|
759
|
+
id: e.id,
|
|
760
|
+
travelClass: this._prepareTravelClassNavigation(n),
|
|
761
|
+
propertyIds: this._prepareServiceIconsNavigation(r),
|
|
762
|
+
isDriverArea: e.places ? e.places.length === 0 : !0,
|
|
763
|
+
driverAreaSide: this._prepareDriverAreaSideNavigation(e),
|
|
764
|
+
freePlaces: this.getAvailableFreePlacesNumFromCoach(i),
|
|
765
|
+
driverAreaElements: this._setDriverAreasElements(e)
|
|
766
|
+
});
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
_prepareTravelClassNavigation(e) {
|
|
771
|
+
return e.indexOf("FIRST") === -1 ? e.indexOf("SECOND") === -1 ? "ANY_CLASS" : "SECOND" : "FIRST";
|
|
772
|
+
}
|
|
773
|
+
_prepareDriverAreaSideNavigation(e) {
|
|
774
|
+
let t = e.graphicElements?.filter((e) => e.icon === "DRIVER_AREA");
|
|
775
|
+
if (t && t.length > 0) {
|
|
776
|
+
let e = t.find((e) => e.position.x === 0) || !1, n = t.find((e) => e.position.x > 0) || !1;
|
|
777
|
+
return {
|
|
778
|
+
left: !!e,
|
|
779
|
+
right: !!n
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
_prepareCoachWidthAndGapCalculations() {
|
|
784
|
+
this.seatReservations && (this.seatReservations[this.seatReservations.length - 1]?.coachItems)?.forEach((e) => {
|
|
785
|
+
let t = this._isOverhangingElementsPresent(e.dimension.w, e.places), n = e.graphicElements?.filter((e) => e.icon && !this.notAreaElements.includes(e.icon)), r = this._isOverhangingElementsPresent(e.dimension.w, n);
|
|
786
|
+
this.overHangingElementInformation.push({
|
|
787
|
+
coachId: e.id,
|
|
788
|
+
overhangingPlaces: t,
|
|
789
|
+
overhangingGraphicAreas: r
|
|
790
|
+
});
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
_getPlaceHtmlElement() {
|
|
794
|
+
return this.currSelectedPlaceElementId && this.shadowRoot?.getElementById(this.currSelectedPlaceElementId) || null;
|
|
795
|
+
}
|
|
796
|
+
_getDeckIndexByPlaceId(e) {
|
|
797
|
+
let t = this.shadowRoot?.querySelector("#" + e)?.getAttribute("data-deck-index");
|
|
798
|
+
return t && !isNaN(+t) ? +t : null;
|
|
799
|
+
}
|
|
800
|
+
_isValidCoachIndex(e) {
|
|
801
|
+
return e >= 0 && e <= this.seatReservations[this.seatReservations.length - 1].coachItems.length;
|
|
802
|
+
}
|
|
803
|
+
_getExistingCoachDeckIndex() {
|
|
804
|
+
if (this.seatReservations[this.currSelectedDeckIndex].coachItems[this.currSelectedCoachIndex].places !== void 0) return this.currSelectedDeckIndex;
|
|
805
|
+
let e = this.seatReservations.findIndex((e) => e.coachItems[this.currSelectedCoachIndex].places !== void 0);
|
|
806
|
+
return this.currSelectedDeckIndex >= e ? this.currSelectedDeckIndex : e;
|
|
807
|
+
}
|
|
808
|
+
_scrollPlaceIntoNearestViewport(e) {
|
|
809
|
+
this.shadowRoot?.getElementById(e)?.scrollIntoView({
|
|
810
|
+
behavior: "smooth",
|
|
811
|
+
block: "nearest",
|
|
812
|
+
inline: "nearest"
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
_isOverhangingElementsPresent(e, t) {
|
|
816
|
+
return t?.some((t) => t.position.x === 0 || t.position.x + t.dimension.w >= e) ?? !1;
|
|
817
|
+
}
|
|
818
|
+
_setDriverAreasElements(e) {
|
|
819
|
+
return e ? {
|
|
820
|
+
driverArea: e.graphicElements?.find((e) => e.icon === "DRIVER_AREA"),
|
|
821
|
+
driverAreaNoVerticalWall: e.type === "LOCOMOTIVE_COACH" ? e.graphicElements?.find((e) => e.icon === "DRIVER_AREA_NO_VERTICAL_WALL") : void 0
|
|
822
|
+
} : {
|
|
823
|
+
driverArea: void 0,
|
|
824
|
+
driverAreaNoVerticalWall: void 0
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
_onLeaveSeatReservationComponent() {
|
|
828
|
+
this.hasNavigation && (this.focusedCoachIndex = -1), this.unfocusPlaceElement();
|
|
829
|
+
}
|
|
830
|
+
};
|
|
808
831
|
})();
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
};
|
|
832
|
+
//#endregion
|
|
833
|
+
export { u as SeatReservationBaseElement };
|