@sbb-esta/lyne-elements-experimental 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1147 -590
- package/development/seat-reservation/common/mapper/icon-mapper.d.ts.map +1 -1
- package/development/seat-reservation/common/mapper/icon-mapper.js +4 -5
- package/development/seat-reservation/common/mapper/mapper.d.ts +6 -5
- package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
- package/development/seat-reservation/common/mapper/mapper.js +14 -11
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +113 -0
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +25999 -649
- package/development/seat-reservation/common/svgs.d.ts +0 -1
- package/development/seat-reservation/common/svgs.d.ts.map +1 -1
- package/development/seat-reservation/common/svgs.js +1 -3
- package/development/seat-reservation/common/translations/i18n.d.ts.map +1 -1
- package/development/seat-reservation/common/translations/i18n.js +225 -194
- package/development/seat-reservation/common/types.d.ts +20 -3
- package/development/seat-reservation/common/types.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +50 -18
- 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 +352 -172
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +29 -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 +603 -308
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +17 -10
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +1 -6
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +36 -18
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +3 -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 +54 -32
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +107 -58
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts +1 -16
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +10 -164
- package/package.json +2 -2
- package/seat-reservation/common/mapper/icon-mapper.d.ts.map +1 -1
- package/seat-reservation/common/mapper/icon-mapper.js +3 -4
- package/seat-reservation/common/mapper/mapper.d.ts +6 -5
- package/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
- package/seat-reservation/common/mapper/mapper.js +35 -32
- package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +113 -0
- package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
- package/seat-reservation/common/mapper/seat-reservation-sample-data.js +25997 -648
- package/seat-reservation/common/svgs.d.ts +0 -1
- package/seat-reservation/common/svgs.d.ts.map +1 -1
- package/seat-reservation/common/svgs.js +4 -11
- package/seat-reservation/common/translations/i18n.d.ts.map +1 -1
- package/seat-reservation/common/translations/i18n.js +228 -197
- package/seat-reservation/common/types.d.ts +20 -3
- package/seat-reservation/common/types.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +50 -18
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +294 -175
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts +29 -13
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.js +318 -303
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +22 -22
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +0 -5
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +37 -37
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +3 -1
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +95 -84
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -0
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +75 -63
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts +1 -16
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +14 -101
|
@@ -1,37 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { customElement as J, property as y } from "lit/decorators.js";
|
|
11
|
-
import { classMap as Y } from "lit/directives/class-map.js";
|
|
12
|
-
import { styleMap as Q } from "lit/directives/style-map.js";
|
|
13
|
-
import { getI18nSeatReservation as _ } from "../common.js";
|
|
14
|
-
import { SeatReservationBaseElement as Z } from "./seat-reservation-base-element.js";
|
|
1
|
+
import { __esDecorate as C, __runInitializers as S } from "tslib";
|
|
2
|
+
import { SbbLanguageController as y } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
3
|
+
import { css as A, isServer as R, html as b, nothing as v } from "lit";
|
|
4
|
+
import { customElement as E } from "lit/decorators.js";
|
|
5
|
+
import { classMap as m } from "lit/directives/class-map.js";
|
|
6
|
+
import { styleMap as g } from "lit/directives/style-map.js";
|
|
7
|
+
import { getI18nSeatReservation as n } from "../common.js";
|
|
8
|
+
import { SeatReservationBaseElement as P } from "./seat-reservation-base-element.js";
|
|
9
|
+
import "@sbb-esta/lyne-elements/button.js";
|
|
15
10
|
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
16
11
|
import "../seat-reservation-area.js";
|
|
17
12
|
import "../seat-reservation-graphic.js";
|
|
18
13
|
import "../seat-reservation-place-control.js";
|
|
19
14
|
import "../seat-reservation-navigation-coach.js";
|
|
20
15
|
import "../seat-reservation-scoped.js";
|
|
21
|
-
|
|
22
|
-
let me = (() => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
import "@sbb-esta/lyne-elements/popover/popover.js";
|
|
17
|
+
const T = A`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-height: 0;--sbb-seat-reservation-decks: 1;display:block;height:inherit}:host ::part(coach-floor){fill:var(--sbb-color-white)}@media (forced-colors: active){:host ::part(coach-floor){fill:transparent}}:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,.sbb-sr-place-ctrl--orientation-90,.sbb-sr-place-ctrl--orientation-270,.sbb-sr-place-ctrl--state-selected) ::part(coach-floor){rotate:180deg}[popover]:where(sbb-popover){margin:0;padding:0;border:none;width:auto;height:auto;background-color:transparent;color:inherit;pointer-events:none}.sbb-sr__container{display:flex;height:inherit}.sbb-sr__grid{display:grid;grid-template-columns:20% 1fr 20%;grid-template-rows:auto auto}.sbb-sr__grid .sbb-sr-navigation-first-grid,.sbb-sr__grid .sbb-sr-navigation-last-grid{grid-row-start:1;position:relative}.sbb-sr__grid .sbb-sr-navigation-first-grid{grid-column:1/2}.sbb-sr__grid .sbb-sr-navigation-last-grid{grid-column:3/4}.sbb-sr__grid .sbb-sr__component{display:flex;grid-column:1/4;grid-row:1/3}.sbb-sr__grid .sbb-sr-grid-inner{display:grid;grid-template-columns:20% 60% 20%;grid-template-rows:auto 1fr;grid-gap:0}.sbb-sr__grid .sbb-sr-grid-inner .nav-grid{grid-column:2/3;grid-row:1/2;display:inherit}.sbb-sr__grid .sbb-sr-grid-inner .coaches-grid{grid-column:1/4;grid-row:2/3;display:inherit}.sbb-sr__navigation-control-button{position:absolute;z-index:10}.sbb-sr__navigation-control-button#first-tab-element{inset-inline-end:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__navigation-control-button#last-tab-element{inset-inline-start:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-navigation-wrapper{overflow:hidden;padding-block:0 calc(32 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-navigation{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr-navigation::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr-navigation::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr-navigation::-webkit-scrollbar-button,.sbb-sr-navigation::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr-navigation{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr-navigation{--sbb-scrollbar-color: var(--sbb-color-white-alpha-0);display:flex;overflow:scroll hidden;position:relative}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-wrap:nowrap;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem));padding:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper-coach-decks{display:flex;overflow:hidden;height:inherit}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{display:flex;justify-content:space-between;height:calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));writing-mode:vertical-lr}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{height:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-block-end:16px;rotate:180deg;text-align:center;line-height:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr__wrapper::-webkit-scrollbar-button,.sbb-sr__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr__wrapper{overflow-x:scroll;padding-block:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper .sbb-sr__parent{display:flex;flex-direction:column;position:relative}.sbb-sr__list-decks{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-direction:column}.sbb-sr__list-decks--gap{gap:calc(48 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__list-item-deck{position:relative}.sbb-sr__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__item-coach{position:relative}.sbb-sr-popover{margin:0}.sbb-sr-coach-wrapper__table{outline:0}.sbb-sr.sbb-sr__grid--vertical{grid-template-columns:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) 1fr;grid-template-rows:20% 60% 20%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-first-grid{grid-column:2/3;grid-row-start:1}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-first-grid #first-tab-element{position:absolute;inset-block-end:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-end:initial;rotate:90deg}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-last-grid{grid-column:2/3;grid-row:3/4}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-last-grid #last-tab-element{inset-block-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));rotate:90deg}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-wrapper{padding-block-end:initial;padding-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr.sbb-sr__grid--vertical .sbb-sr__component{grid-column:1/3;grid-row:1/4}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner{grid-template-columns:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) 1fr;grid-template-rows:20% 60% 20%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid{grid-column:2/3;grid-row:2/3;height:100%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid .sbb-sr-navigation{display:block;overflow:hidden scroll;height:100%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid .sbb-sr-navigation .sbb-sr-navigation__list-coaches{flex-direction:column;padding:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid{grid-column:1/2;grid-row:1/4;overflow:hidden;position:relative}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks{flex-direction:column}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{flex-direction:column-reverse;width:calc(100% - 24 * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:initial}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{width:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-bottom:16px;rotate:initial;writing-mode:initial}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-button,.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{overflow:hidden scroll;height:100%;padding:0}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__parent{rotate:90deg;transform-origin:calc((var(--sbb-seat-reservation-height) + 24 - 24 - 6 * (var(--sbb-seat-reservation-decks) - 1)) / 2 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc((var(--sbb-seat-reservation-height) + 24 - 24 - 6 * (var(--sbb-seat-reservation-decks) - 1)) / 2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}`;
|
|
18
|
+
let K = (() => {
|
|
19
|
+
var d;
|
|
20
|
+
let $ = [E("sbb-seat-reservation")], w, f = [], c, k = P;
|
|
21
|
+
return d = class extends k {
|
|
26
22
|
constructor() {
|
|
27
|
-
super(...arguments)
|
|
28
|
-
|
|
29
|
-
x(this, m);
|
|
30
|
-
x(this, f);
|
|
31
|
-
x(this, $);
|
|
32
|
-
x(this, C);
|
|
33
|
-
b(this, g, p(this, z, null)), b(this, m, (p(this, O), p(this, k, !0))), b(this, f, (p(this, D), p(this, I, !1))), b(this, $, (p(this, V), p(this, L, null))), b(this, C, (p(this, F), p(this, H, !1))), this._language = (p(this, W), new K(this)), this._notAreaElements = [
|
|
34
|
-
"DRIVER_AREA_FULL",
|
|
23
|
+
super(...arguments), this._language = new y(this), this._notAreaElements = [
|
|
24
|
+
"DRIVER_AREA",
|
|
35
25
|
"COACH_PASSAGE",
|
|
36
26
|
"COACH_WALL_NO_PASSAGE",
|
|
37
27
|
"COMPARTMENT_PASSAGE",
|
|
@@ -40,301 +30,312 @@ let me = (() => {
|
|
|
40
30
|
"COMPARTMENT_PASSAGE_LOW"
|
|
41
31
|
], this._notFixedRotatableAreaIcons = ["ENTRY_EXIT"];
|
|
42
32
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return R(this, g);
|
|
46
|
-
}
|
|
47
|
-
set seatReservation(e) {
|
|
48
|
-
b(this, g, e);
|
|
49
|
-
}
|
|
50
|
-
/** The seat reservation navigation can be toggled by this property */
|
|
51
|
-
get hasNavigation() {
|
|
52
|
-
return R(this, m);
|
|
53
|
-
}
|
|
54
|
-
set hasNavigation(e) {
|
|
55
|
-
b(this, m, e);
|
|
56
|
-
}
|
|
57
|
-
/** Controls the visual representation of seat reservation in a horizonal or vertical alignment */
|
|
58
|
-
get alignVertical() {
|
|
59
|
-
return R(this, f);
|
|
60
|
-
}
|
|
61
|
-
set alignVertical(e) {
|
|
62
|
-
b(this, f, e);
|
|
33
|
+
willUpdate(r) {
|
|
34
|
+
super.willUpdate(r), r.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((e) => e.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((e) => e.setAttribute("tabindex", "0")));
|
|
63
35
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
set maxReservations(e) {
|
|
69
|
-
b(this, $, e);
|
|
70
|
-
}
|
|
71
|
-
/** Any click functionality is prevented */
|
|
72
|
-
get preventPlaceClick() {
|
|
73
|
-
return R(this, C);
|
|
74
|
-
}
|
|
75
|
-
set preventPlaceClick(e) {
|
|
76
|
-
b(this, C, e);
|
|
77
|
-
}
|
|
78
|
-
willUpdate(e) {
|
|
79
|
-
super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((t) => t.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((t) => t.setAttribute("tabindex", "0")));
|
|
80
|
-
}
|
|
81
|
-
firstUpdated(e) {
|
|
82
|
-
super.firstUpdated(e), this._componentSetup();
|
|
36
|
+
firstUpdated(r) {
|
|
37
|
+
super.firstUpdated(r), this.updateComplete.then(() => {
|
|
38
|
+
this.initPrepairSeatReservationData(), this.initNavigationSelectionByScrollEvent(), this.requestUpdate();
|
|
39
|
+
});
|
|
83
40
|
}
|
|
84
41
|
render() {
|
|
85
|
-
return this._initVehicleSeatReservationConstruction(), this._coachesHtmlTemplate || null;
|
|
42
|
+
return R || this._determineBaseFontSize(), this._initVehicleSeatReservationConstruction(), this._coachesHtmlTemplate || null;
|
|
86
43
|
}
|
|
87
|
-
|
|
88
|
-
|
|
44
|
+
_determineBaseFontSize() {
|
|
45
|
+
const e = 1 / parseInt(window.getComputedStyle(document.body).fontSize, 10);
|
|
46
|
+
this.style?.setProperty("--sbb-seat-reservation-one-px-rem", `${e + "rem"}`);
|
|
89
47
|
}
|
|
90
48
|
_initVehicleSeatReservationConstruction() {
|
|
91
|
-
const
|
|
92
|
-
this._coachesHtmlTemplate =
|
|
93
|
-
<div>
|
|
94
|
-
<sbb-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
49
|
+
const r = this.alignVertical ? "sbb-sr__grid--vertical" : "";
|
|
50
|
+
this._coachesHtmlTemplate = b`
|
|
51
|
+
<div class="sbb-sr__container">
|
|
52
|
+
<div class="sbb-sr sbb-sr__grid ${r}">
|
|
53
|
+
<div class="sbb-sr-navigation-first-grid">
|
|
54
|
+
${this._renderNavigationControlButton("DIRECTION_LEFT")}
|
|
55
|
+
</div>
|
|
56
|
+
<div
|
|
57
|
+
class="sbb-sr__component"
|
|
58
|
+
@keydown=${(e) => this.handleKeyboardEvent(e)}
|
|
59
|
+
>
|
|
60
|
+
<div class="sbb-sr-grid-inner">
|
|
61
|
+
<div class="nav-grid">${this._renderNavigation()}</div>
|
|
62
|
+
<div class="coaches-grid">
|
|
63
|
+
<div class="sbb-sr__wrapper-coach-decks">
|
|
64
|
+
<div class="sbb-sr__wrapper-deck-labels">${this._renderDeckLabels()}</div>
|
|
65
|
+
<div id="sbb-sr__wrapper-scrollarea" class="sbb-sr__wrapper">
|
|
66
|
+
<div id="sbb-sr__parent-area" class="sbb-sr__parent" tabindex="-1">
|
|
67
|
+
<ul
|
|
68
|
+
class="${m({
|
|
69
|
+
"sbb-sr__list-decks": !0,
|
|
70
|
+
"sbb-sr__list-decks--gap": this.hasMultipleDecks
|
|
71
|
+
})}"
|
|
72
|
+
>
|
|
73
|
+
${this.seatReservations?.map((e, t) => b`<li class="sbb-sr__list-item-deck">
|
|
74
|
+
<ul class="sbb-sr__list-coaches" role="presentation">
|
|
75
|
+
${this._renderCoaches(e, t)}
|
|
76
|
+
</ul>
|
|
77
|
+
</li>`)}
|
|
78
|
+
</ul>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
111
83
|
</div>
|
|
112
84
|
</div>
|
|
85
|
+
<div class="sbb-sr-navigation-last-grid">
|
|
86
|
+
${this._renderNavigationControlButton("DIRECTION_RIGHT")}
|
|
87
|
+
</div>
|
|
113
88
|
</div>
|
|
114
|
-
|
|
115
|
-
<sbb-screen-reader-only>
|
|
116
|
-
<input
|
|
117
|
-
id="last-tab-element"
|
|
118
|
-
role="contentinfo"
|
|
119
|
-
type="text"
|
|
120
|
-
aria-label="${_("SEAT_RESERVATION_END", this._language.current)}"
|
|
121
|
-
readonly
|
|
122
|
-
/>
|
|
123
|
-
</sbb-screen-reader-only>
|
|
124
89
|
</div>
|
|
125
90
|
`;
|
|
126
91
|
}
|
|
92
|
+
_renderDeckLabels() {
|
|
93
|
+
return this.hasMultipleDecks ? this.seatReservations.map((r) => {
|
|
94
|
+
const e = n(r.deckCoachLevel, this._language.current);
|
|
95
|
+
return b`<b aria-hidden="true">${e}</b>`;
|
|
96
|
+
}) : null;
|
|
97
|
+
}
|
|
98
|
+
_renderNavigationControlButton(r) {
|
|
99
|
+
if (!this.hasNavigation || !this.seatReservations)
|
|
100
|
+
return null;
|
|
101
|
+
const e = r == "DIRECTION_RIGHT" ? "last-tab-element" : "first-tab-element", t = r == "DIRECTION_RIGHT" ? "arrow-right-small" : "arrow-left-small", s = r == "DIRECTION_RIGHT" ? n("SEAT_RESERVATION_END", this._language.current) : n("SEAT_RESERVATION_BEGIN", this._language.current);
|
|
102
|
+
let a = !0;
|
|
103
|
+
return (r == "DIRECTION_LEFT" && this.selectedCoachIndex > 0 || r == "DIRECTION_RIGHT" && this.selectedCoachIndex < this.seatReservations[this.currSelectedDeckIndex].coachItems.length - 1) && (a = !1), b`<sbb-secondary-button
|
|
104
|
+
@click="${() => this.navigateByDirectionBtn(r)}"
|
|
105
|
+
id="${e}"
|
|
106
|
+
class="sbb-sr__navigation-control-button"
|
|
107
|
+
size="s"
|
|
108
|
+
icon-name="${t}"
|
|
109
|
+
type="button"
|
|
110
|
+
aria-label="${s}"
|
|
111
|
+
role="contentinfo"
|
|
112
|
+
.disabledInteractive="${a || v}"
|
|
113
|
+
></sbb-secondary-button>`;
|
|
114
|
+
}
|
|
127
115
|
_renderNavigation() {
|
|
128
|
-
return this.hasNavigation ?
|
|
129
|
-
<nav
|
|
116
|
+
return !this.hasNavigation || !this.seatReservations ? null : b`<div class="sbb-sr-navigation-wrapper">
|
|
117
|
+
<nav id="sbb-sr-navigation" class="sbb-sr-navigation">
|
|
130
118
|
<ul
|
|
119
|
+
id="sbb-sr__navigation-list-coaches"
|
|
131
120
|
class="sbb-sr-navigation__list-coaches"
|
|
132
|
-
aria-label="${
|
|
121
|
+
aria-label="${n("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
|
|
133
122
|
>
|
|
134
|
-
${this.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
123
|
+
${this.seatReservations[this.currSelectedDeckIndex]?.coachItems.map((r, e) => {
|
|
124
|
+
const t = this.getAvailableFreePlacesNumFromCoach(e);
|
|
125
|
+
return b`<li>
|
|
126
|
+
<sbb-seat-reservation-navigation-coach
|
|
127
|
+
@selectcoach=${(s) => this._onSelectNavCoach(s)}
|
|
128
|
+
@focuscoach=${() => this._onFocusNavCoach()}
|
|
129
|
+
class="${m({
|
|
130
|
+
"sbb-sr__navigation-coach--hover-scroll": this.hoveredScrollCoachIndex === e
|
|
131
|
+
})}"
|
|
132
|
+
index="${e}"
|
|
133
|
+
coach-id="${r.id}"
|
|
134
|
+
.freePlacesByType="${t}"
|
|
135
|
+
.selected=${this.selectedCoachIndex === e}
|
|
136
|
+
.focused=${this.focusedCoachIndex === e}
|
|
137
|
+
.propertyIds="${r.propertyIds}"
|
|
138
|
+
.travelClass="${r.travelClass}"
|
|
139
|
+
?driver-area="${!r.places?.length}"
|
|
140
|
+
?first="${r?.driverAreaSide?.left}"
|
|
141
|
+
?last="${r?.driverAreaSide?.right}"
|
|
142
|
+
?vertical="${this.alignVertical}"
|
|
143
|
+
>
|
|
144
|
+
</sbb-seat-reservation-navigation-coach>
|
|
145
|
+
</li>`;
|
|
146
|
+
})}
|
|
151
147
|
</ul>
|
|
152
148
|
</nav>
|
|
153
|
-
|
|
149
|
+
</div>`;
|
|
154
150
|
}
|
|
155
151
|
/**
|
|
156
152
|
*
|
|
157
153
|
* @param coaches
|
|
158
154
|
* @returns
|
|
159
155
|
*/
|
|
160
|
-
_renderCoaches(e) {
|
|
161
|
-
|
|
162
|
-
|
|
156
|
+
_renderCoaches(r, e) {
|
|
157
|
+
const t = JSON.parse(JSON.stringify(r?.coachItems));
|
|
158
|
+
return t ? t.map((s, a) => b`
|
|
159
|
+
<li class="sbb-sr__item-coach">
|
|
160
|
+
${this._renderCoachElement(s, a, e)}
|
|
161
|
+
</li>
|
|
163
162
|
`) : null;
|
|
164
163
|
}
|
|
165
|
-
_renderCoachElement(e, t) {
|
|
166
|
-
const
|
|
167
|
-
return
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
_renderCoachElement(r, e, t) {
|
|
165
|
+
const s = this.getCalculatedDimension(r.dimension), a = this._getDescriptionTableCoach(r, e);
|
|
166
|
+
return b`<sbb-seat-reservation-scoped
|
|
167
|
+
style=${g({
|
|
168
|
+
"--sbb-seat-reservation-scoped-width": s.w,
|
|
169
|
+
"--sbb-seat-reservation-scoped-height": s.h
|
|
170
|
+
})}
|
|
171
171
|
>
|
|
172
|
-
${this._getRenderedCoachBorders(
|
|
173
|
-
${this._getRenderedGraphicalElements(
|
|
174
|
-
${this._getRenderedServiceElements(e.serviceElements)}
|
|
172
|
+
${this._getRenderedCoachBorders(r)}
|
|
173
|
+
${this._getRenderedGraphicalElements(r.graphicElements || [], r.dimension, e, t)}
|
|
174
|
+
${this._getRenderedServiceElements(e, t, r.serviceElements)}
|
|
175
|
+
|
|
175
176
|
<table
|
|
176
|
-
@focus=${() => this.onFocusTableCoachAndPreselectPlace(
|
|
177
|
-
id="sbb-sr-coach-${
|
|
177
|
+
@focus=${() => this.onFocusTableCoachAndPreselectPlace(e)}
|
|
178
|
+
id="sbb-sr-coach-${e}"
|
|
178
179
|
class="sbb-sr-coach-wrapper__table"
|
|
179
|
-
aria-describedby="sbb-sr-coach-caption-${
|
|
180
|
+
aria-describedby="sbb-sr-coach-caption-${e}"
|
|
180
181
|
>
|
|
181
|
-
<caption id="sbb-sr-coach-caption-${
|
|
182
|
-
<sbb-screen-reader-only>${
|
|
182
|
+
<caption id="sbb-sr-coach-caption-${e}" tabindex="-1">
|
|
183
|
+
<sbb-screen-reader-only>${a}</sbb-screen-reader-only>
|
|
183
184
|
</caption>
|
|
184
|
-
${this._getRenderedRowPlaces(e, t)}
|
|
185
|
+
${this._getRenderedRowPlaces(r, e, t)}
|
|
185
186
|
</table>
|
|
186
187
|
</sbb-seat-reservation-scoped>`;
|
|
187
188
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
189
|
+
/**
|
|
190
|
+
* @returns Returns the border graphic (COACH_BORDER_MIDDLE) of a coach with calculated border gap and coach width,
|
|
191
|
+
* depending on whether the coach is with a driver area or without.
|
|
192
|
+
*/
|
|
193
|
+
_getRenderedCoachBorders(r) {
|
|
194
|
+
const s = r.graphicElements?.find((l) => l.icon === "DRIVER_AREA"), a = s ? r.dimension.w - s.dimension.w - 1 : r.dimension.w - 2, o = (r.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize, i = s && s.position.x === 0 ? s?.dimension.w * this.baseGridSize : this.baseGridSize;
|
|
195
|
+
return b`
|
|
196
|
+
<sbb-seat-reservation-graphic
|
|
197
|
+
style=${g({
|
|
198
|
+
"--sbb-seat-reservation-graphic-width": a * this.baseGridSize,
|
|
199
|
+
"--sbb-seat-reservation-graphic-height": o,
|
|
200
|
+
"--sbb-seat-reservation-graphic-top": this.coachBorderPadding * -1,
|
|
201
|
+
"--sbb-seat-reservation-graphic-left": i,
|
|
202
|
+
"--sbb-seat-reservation-graphic-position": "absolute"
|
|
203
|
+
})}
|
|
204
|
+
name="COACH_BORDER_MIDDLE"
|
|
205
|
+
?stretch=${!0}
|
|
206
|
+
role="presentation"
|
|
207
|
+
></sbb-seat-reservation-graphic>
|
|
204
208
|
`;
|
|
205
209
|
}
|
|
206
|
-
_getRenderedRowPlaces(e, t) {
|
|
207
|
-
if (!
|
|
210
|
+
_getRenderedRowPlaces(r, e, t) {
|
|
211
|
+
if (!r.places)
|
|
208
212
|
return null;
|
|
209
|
-
const
|
|
210
|
-
for (const
|
|
211
|
-
|
|
212
|
-
return Object.values(
|
|
213
|
-
<tr id="row-${
|
|
214
|
-
${this._getRenderedColumnPlaces(
|
|
213
|
+
const s = {};
|
|
214
|
+
for (const a of r.places)
|
|
215
|
+
s[a.position.y] ? s[a.position.y].push(a) : s[a.position.y] = [a];
|
|
216
|
+
return Object.values(s).map((a, o) => b`
|
|
217
|
+
<tr id="row-${e}-${a[0].position.y}" data-row-index=${o}>
|
|
218
|
+
${this._getRenderedColumnPlaces(a, e, t)}
|
|
215
219
|
</tr>
|
|
216
|
-
`).flatMap((
|
|
220
|
+
`).flatMap((a) => a);
|
|
217
221
|
}
|
|
218
|
-
_getRenderedColumnPlaces(e, t) {
|
|
219
|
-
return
|
|
220
|
-
const
|
|
221
|
-
return
|
|
222
|
-
<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
inset-inline-start="${n.x}px"
|
|
226
|
-
width="${a.w}px"
|
|
227
|
-
height="${a.h}px"
|
|
228
|
-
z-index="${i.position.z}"
|
|
229
|
-
cell-id="cell-${t}-${i.position.y}-${s}"
|
|
222
|
+
_getRenderedColumnPlaces(r, e, t) {
|
|
223
|
+
return r.sort((s, a) => Number(s.position.x) - Number(a.position.x)), r?.map((s, a) => {
|
|
224
|
+
const o = this.getCalculatedDimension(s.dimension), i = this.getCalculatedPosition(s.position), l = this.alignVertical ? -90 : 0;
|
|
225
|
+
return b`
|
|
226
|
+
<td
|
|
227
|
+
id="cell-${t}-${e}-${s.position.y}-${a}"
|
|
228
|
+
class="graphical-element"
|
|
230
229
|
>
|
|
231
230
|
<sbb-seat-reservation-place-control
|
|
232
|
-
|
|
231
|
+
style=${g({
|
|
232
|
+
"--sbb-seat-reservation-place-control-width": o.w,
|
|
233
|
+
"--sbb-seat-reservation-place-control-height": o.h,
|
|
234
|
+
"--sbb-seat-reservation-place-control-top": i.y,
|
|
235
|
+
"--sbb-seat-reservation-place-control-left": i.x
|
|
236
|
+
})}
|
|
237
|
+
@selectplace=${(h) => this._onSelectPlace(h)}
|
|
233
238
|
exportparts="sbb-sr-place-part"
|
|
234
|
-
id="seat-reservation__place-button-${t}-${
|
|
239
|
+
id="seat-reservation__place-button-${t}-${e}-${s.number}"
|
|
235
240
|
class="seat-reservation-place-control"
|
|
236
|
-
data-cell-id="${
|
|
237
|
-
text=${
|
|
238
|
-
type=${
|
|
239
|
-
state=${
|
|
240
|
-
width=${
|
|
241
|
-
height=${
|
|
242
|
-
rotation=${
|
|
243
|
-
text-rotation=${
|
|
244
|
-
coach-index=${
|
|
245
|
-
|
|
241
|
+
data-cell-id="${e}-${s.position.y}-${a}"
|
|
242
|
+
text=${s.number}
|
|
243
|
+
type=${s.type}
|
|
244
|
+
state=${s.state}
|
|
245
|
+
width=${s.dimension.w * this.baseGridSize}
|
|
246
|
+
height=${s.dimension.h * this.baseGridSize}
|
|
247
|
+
rotation=${s.rotation ?? v}
|
|
248
|
+
text-rotation=${l}
|
|
249
|
+
coach-index=${e}
|
|
250
|
+
deck-index=${t}
|
|
251
|
+
.propertyIds=${s.propertyIds}
|
|
246
252
|
.preventClick=${this.preventPlaceClick}
|
|
247
253
|
></sbb-seat-reservation-place-control>
|
|
248
|
-
</
|
|
254
|
+
</td>
|
|
249
255
|
`;
|
|
250
256
|
});
|
|
251
257
|
}
|
|
252
|
-
_getRenderedGraphicalElements(e, t) {
|
|
253
|
-
return
|
|
254
|
-
const
|
|
255
|
-
return this._notAreaElements.findIndex((
|
|
258
|
+
_getRenderedGraphicalElements(r, e, t, s) {
|
|
259
|
+
return r ? r?.map((a) => {
|
|
260
|
+
const o = a.icon ?? "", i = a.rotation || 0, l = this._notFixedRotatableAreaIcons.indexOf(a.icon) === -1, h = this.alignVertical && l ? i - 90 : i;
|
|
261
|
+
return this._notAreaElements.findIndex((p) => p === o) > -1 ? this._getRenderElementWithoutArea(a, i, e) : this._getRenderElementWithArea(a, h, e, t, s);
|
|
256
262
|
}) : null;
|
|
257
263
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
"
|
|
273
|
-
|
|
264
|
+
/**
|
|
265
|
+
* creates a rendered element with an area component
|
|
266
|
+
* @param graphicalElement
|
|
267
|
+
* @param rotation
|
|
268
|
+
* @param coachDimension
|
|
269
|
+
* @param coachIndex used to generate a unique id for the popover trigger
|
|
270
|
+
* @private
|
|
271
|
+
*/
|
|
272
|
+
_getRenderElementWithArea(r, e, t, s, a) {
|
|
273
|
+
const o = r.icon?.indexOf("TABLE") === -1, i = r.icon && o ? r.icon : null, l = i !== "ENTRY_EXIT", h = r.icon ? n(r.icon, this._language.current) : v, p = this.getCalculatedDimension(r.dimension, t, !0, l), _ = this.getCalculatedPosition(r.position, r.dimension, t, !0), x = `popover-trigger-${a}-${s}-${_.x}-${_.y}`;
|
|
274
|
+
let u = "free";
|
|
275
|
+
return r.position.y === this.coachBorderOffset * -1 ? u = "upper-border" : r.position.y + r.dimension.h === t.h + this.coachBorderOffset && (u = "lower-border"), b`
|
|
276
|
+
<sbb-seat-reservation-area
|
|
277
|
+
id="${x}"
|
|
278
|
+
class="${m({ "sbb-seat-reservation-area--cursor-pointer": i !== null })}"
|
|
279
|
+
style=${g({
|
|
280
|
+
"--sbb-seat-reservation-area-width": p.w,
|
|
281
|
+
"--sbb-seat-reservation-area-height": p.h,
|
|
282
|
+
"--sbb-seat-reservation-area-top": _.y,
|
|
283
|
+
"--sbb-seat-reservation-area-left": _.x
|
|
274
284
|
})}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
</sbb-seat-reservation-scoped>
|
|
285
|
+
mounting=${u}
|
|
286
|
+
background="dark"
|
|
287
|
+
aria-hidden="true"
|
|
288
|
+
>
|
|
289
|
+
${i ? b`
|
|
290
|
+
<sbb-seat-reservation-graphic
|
|
291
|
+
name=${i}
|
|
292
|
+
width=${this.baseGridSize}
|
|
293
|
+
height=${this.baseGridSize}
|
|
294
|
+
rotation=${e}
|
|
295
|
+
role="img"
|
|
296
|
+
aria-hidden="true"
|
|
297
|
+
></sbb-seat-reservation-graphic>
|
|
298
|
+
` : v}
|
|
299
|
+
</sbb-seat-reservation-area>
|
|
300
|
+
${i ? this._popover(x, h) : v}
|
|
292
301
|
`;
|
|
293
302
|
}
|
|
294
|
-
_getRenderElementWithoutArea(e, t
|
|
295
|
-
const s = this.getCalculatedDimension(
|
|
296
|
-
return
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
_getRenderElementWithoutArea(r, e, t) {
|
|
304
|
+
const s = this.getCalculatedDimension(r.dimension, t), a = this.getCalculatedPosition(r.position, r.dimension, t), o = r.icon && r.icon.indexOf("DRIVER_AREA") === -1 ? r.icon : r.icon?.concat("_", this.seatReservations[this.currSelectedDeckIndex].vehicleType);
|
|
305
|
+
return b` <sbb-seat-reservation-graphic
|
|
306
|
+
style=${g({
|
|
307
|
+
"--sbb-seat-reservation-graphic-width": s.w,
|
|
308
|
+
"--sbb-seat-reservation-graphic-height": s.h,
|
|
309
|
+
"--sbb-seat-reservation-graphic-top": a.y,
|
|
310
|
+
"--sbb-seat-reservation-graphic-left": a.x,
|
|
311
|
+
"--sbb-seat-reservation-graphic-position": "absolute"
|
|
312
|
+
})}
|
|
313
|
+
name=${o ?? v}
|
|
314
|
+
rotation=${e}
|
|
315
|
+
aria-hidden="true"
|
|
316
|
+
?stretch=${!0}
|
|
317
|
+
></sbb-seat-reservation-graphic>`;
|
|
318
|
+
}
|
|
319
|
+
_getRenderedServiceElements(r, e, t) {
|
|
320
|
+
return t ? t?.map((s) => {
|
|
321
|
+
const a = s.icon ? n(s.icon, this._language.current) : null, o = this.getCalculatedDimension(s.dimension), i = this.getCalculatedPosition(s.position), l = s.rotation || 0, h = this.alignVertical ? l - 90 : l, p = `popover-trigger-${e}-${r}-${i.x}-${i.y}`;
|
|
322
|
+
return b`
|
|
305
323
|
<sbb-seat-reservation-graphic
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
324
|
+
id="${p}"
|
|
325
|
+
style=${g({
|
|
326
|
+
"--sbb-seat-reservation-graphic-width": o.w,
|
|
327
|
+
"--sbb-seat-reservation-graphic-height": o.h,
|
|
328
|
+
"--sbb-seat-reservation-graphic-top": i.y,
|
|
329
|
+
"--sbb-seat-reservation-graphic-left": i.x,
|
|
330
|
+
"--sbb-seat-reservation-graphic-position": "absolute"
|
|
331
|
+
})}
|
|
332
|
+
class="sbb-seat-reservation-graphic--cursor-pointer"
|
|
333
|
+
name=${s.icon ?? v}
|
|
334
|
+
.rotation=${h}
|
|
335
|
+
role="img"
|
|
310
336
|
aria-hidden="true"
|
|
311
|
-
?stretch=${!0}
|
|
312
337
|
></sbb-seat-reservation-graphic>
|
|
313
|
-
|
|
314
|
-
`;
|
|
315
|
-
}
|
|
316
|
-
_getRenderedServiceElements(e) {
|
|
317
|
-
return e ? e?.map((t) => {
|
|
318
|
-
const i = t.icon ? _(t.icon, this._language.current) : null, s = this.getCalculatedDimension(t.dimension), a = this.getCalculatedPosition(t.position), n = t.rotation || 0, h = this.alignVertical ? n - 90 : n;
|
|
319
|
-
return d`
|
|
320
|
-
<sbb-seat-reservation-scoped
|
|
321
|
-
scoped-classes="graphical-element"
|
|
322
|
-
inset-block-start="${a.y}px"
|
|
323
|
-
inset-inline-start="${a.x}px"
|
|
324
|
-
width="${s.w}px"
|
|
325
|
-
height="${s.h}px"
|
|
326
|
-
z-index="${t.position.z}"
|
|
327
|
-
>
|
|
328
|
-
<sbb-seat-reservation-graphic
|
|
329
|
-
name=${t.icon ?? A}
|
|
330
|
-
width=${t.dimension.w * this.baseGridSize}
|
|
331
|
-
height=${t.dimension.h * this.baseGridSize}
|
|
332
|
-
.rotation=${h}
|
|
333
|
-
role="img"
|
|
334
|
-
aria-hidden="true"
|
|
335
|
-
title=${i ?? A}
|
|
336
|
-
></sbb-seat-reservation-graphic>
|
|
337
|
-
</sbb-seat-reservation-scoped>
|
|
338
|
+
${this._popover(p, a)}
|
|
338
339
|
`;
|
|
339
340
|
}) : null;
|
|
340
341
|
}
|
|
@@ -343,53 +344,67 @@ let me = (() => {
|
|
|
343
344
|
* Each selection emits an array of all selected places
|
|
344
345
|
* @param selectPlaceEvent
|
|
345
346
|
*/
|
|
346
|
-
_onSelectPlace(
|
|
347
|
-
const
|
|
348
|
-
this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(
|
|
347
|
+
_onSelectPlace(r) {
|
|
348
|
+
const e = r.detail;
|
|
349
|
+
this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.preventPlaceClick || (this.currSelectedDeckIndex = e.deckIndex, this.updateSelectedSeatReservationPlaces(e), this.updateCurrentSelectedPlaceInCoach(e));
|
|
349
350
|
}
|
|
350
|
-
_onSelectNavCoach(
|
|
351
|
-
const
|
|
352
|
-
this.isKeyboardNavigation = !1,
|
|
351
|
+
_onSelectNavCoach(r) {
|
|
352
|
+
const e = r.detail;
|
|
353
|
+
this.isKeyboardNavigation = !1, e !== null && e !== this.currSelectedCoachIndex ? (this.unfocusPlaceElement(), this.scrollToSelectedNavCoach(e)) : e === this.currSelectedCoachIndex && (this.updateCurrentSelectedCoach(), this.preselectPlaceInCoach()), this._closePopover();
|
|
353
354
|
}
|
|
354
355
|
_onFocusNavCoach() {
|
|
355
356
|
this.preventCoachScrollByPlaceClick ? this.focusPlaceElement(this.currSelectedPlace) : this.preselectPlaceInCoach(), this.isAutoScrolling = !1;
|
|
356
357
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
358
|
+
/**
|
|
359
|
+
* Creates a popover for extra service information
|
|
360
|
+
* @param triggerId
|
|
361
|
+
* @param popoverContent
|
|
362
|
+
* @private
|
|
363
|
+
*/
|
|
364
|
+
_popover(r, e) {
|
|
365
|
+
return b`
|
|
366
|
+
<sbb-popover trigger="${r}">
|
|
367
|
+
<p class="sbb-text-s sbb-sr-popover">${e}</p>
|
|
368
|
+
</sbb-popover>
|
|
369
|
+
`;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* trigger to close all opened popovers (normally only one is opened at a time)
|
|
373
|
+
* @private
|
|
374
|
+
*/
|
|
375
|
+
_closePopover() {
|
|
376
|
+
this.shadowRoot?.querySelectorAll('sbb-popover[data-state="opened"]').forEach((r) => r.setAttribute("data-state", "closed"));
|
|
377
|
+
}
|
|
378
|
+
_getDescriptionTableCoach(r, e) {
|
|
379
|
+
if (!r.places?.length)
|
|
380
|
+
return n("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [
|
|
381
|
+
r.id
|
|
361
382
|
]);
|
|
362
|
-
let t
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
]),
|
|
383
|
+
let t;
|
|
384
|
+
const s = this._getTitleDescriptionListString(r.graphicElements), a = this._getTitleDescriptionListString(r.serviceElements);
|
|
385
|
+
if (t = n("COACH_TABLE_CAPTION", this._language.current, [
|
|
386
|
+
r.id
|
|
387
|
+
]), !this.hasNavigation) {
|
|
388
|
+
const o = this.getAvailableFreePlacesNumFromCoach(e), i = n("COACH_AVAILABLE_NUMBER_OF_PLACES", this._language.current, [o.seats, o.bicycles]);
|
|
389
|
+
t = t.concat(". ").concat(i).concat(". ");
|
|
390
|
+
}
|
|
391
|
+
return (s || a) && (t += ". " + n("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", t += a + ", " + s + "."), t;
|
|
367
392
|
}
|
|
368
|
-
_getTitleDescriptionListString(
|
|
369
|
-
const
|
|
370
|
-
return
|
|
371
|
-
const s =
|
|
393
|
+
_getTitleDescriptionListString(r) {
|
|
394
|
+
const e = [];
|
|
395
|
+
return r?.map((t) => {
|
|
396
|
+
const s = t.icon;
|
|
372
397
|
if (!s)
|
|
373
398
|
return null;
|
|
374
|
-
const a =
|
|
375
|
-
return a ||
|
|
376
|
-
}).filter((
|
|
399
|
+
const a = e.indexOf(s) > -1, o = n(t.icon, this._language.current), i = this._notFixedRotatableAreaIcons.indexOf(s) === -1 && this._notAreaElements.indexOf(s) === -1;
|
|
400
|
+
return a || e.push(t.icon), o && !a && i ? o : null;
|
|
401
|
+
}).filter((t) => !!t).join(", ");
|
|
377
402
|
}
|
|
378
|
-
},
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
} }, metadata: e }, z, O), S(c, null, E, { kind: "accessor", name: "hasNavigation", static: !1, private: !1, access: { has: (t) => "hasNavigation" in t, get: (t) => t.hasNavigation, set: (t, i) => {
|
|
383
|
-
t.hasNavigation = i;
|
|
384
|
-
} }, metadata: e }, k, D), S(c, null, G, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, i) => {
|
|
385
|
-
t.alignVertical = i;
|
|
386
|
-
} }, metadata: e }, I, V), S(c, null, B, { kind: "accessor", name: "maxReservations", static: !1, private: !1, access: { has: (t) => "maxReservations" in t, get: (t) => t.maxReservations, set: (t, i) => {
|
|
387
|
-
t.maxReservations = i;
|
|
388
|
-
} }, metadata: e }, L, F), S(c, null, M, { kind: "accessor", name: "preventPlaceClick", static: !1, private: !1, access: { has: (t) => "preventPlaceClick" in t, get: (t) => t.preventPlaceClick, set: (t, i) => {
|
|
389
|
-
t.preventPlaceClick = i;
|
|
390
|
-
} }, metadata: e }, H, W), S(null, o = { value: u }, r, { kind: "class", name: u.name, metadata: e }, null, l), u = o.value, e && Object.defineProperty(u, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
391
|
-
})(), c.styles = ee, p(u, l), u;
|
|
403
|
+
}, c = d, (() => {
|
|
404
|
+
const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(k[Symbol.metadata] ?? null) : void 0;
|
|
405
|
+
C(null, w = { value: c }, $, { kind: "class", name: c.name, metadata: r }, null, f), c = w.value, r && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r });
|
|
406
|
+
})(), d.styles = T, S(c, f), c;
|
|
392
407
|
})();
|
|
393
408
|
export {
|
|
394
|
-
|
|
409
|
+
K as SbbSeatReservationElement
|
|
395
410
|
};
|