@sbb-esta/lyne-elements-experimental 2.10.1 → 2.11.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 +4286 -0
- package/development/seat-reservation/common/mapper/icon-mapper.d.ts +112 -0
- package/development/seat-reservation/common/mapper/icon-mapper.d.ts.map +1 -0
- package/development/seat-reservation/common/mapper/icon-mapper.js +72 -0
- package/development/seat-reservation/common/mapper/mapper.d.ts +29 -0
- package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -0
- package/development/seat-reservation/common/mapper/mapper.js +117 -0
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +225 -0
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -0
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +6152 -0
- package/development/seat-reservation/common/mapper.d.ts +3 -0
- package/development/seat-reservation/common/mapper.d.ts.map +1 -0
- package/development/seat-reservation/common/mapper.js +10 -0
- package/development/seat-reservation/common/svgs.d.ts +25 -0
- package/development/seat-reservation/common/svgs.d.ts.map +1 -0
- package/development/seat-reservation/common/svgs.js +48 -0
- package/development/seat-reservation/common/translations/i18n.d.ts +19 -0
- package/development/seat-reservation/common/translations/i18n.d.ts.map +1 -0
- package/development/seat-reservation/common/translations/i18n.js +462 -0
- package/development/seat-reservation/common/translations.d.ts +2 -0
- package/development/seat-reservation/common/translations.d.ts.map +1 -0
- package/development/seat-reservation/common/translations.js +5 -0
- package/development/seat-reservation/common.d.ts +5 -0
- package/development/seat-reservation/common.d.ts.map +1 -0
- package/development/seat-reservation/common.js +18 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +156 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +706 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.d.ts +29 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.js +196 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts +2 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.js +5 -0
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +62 -0
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +615 -0
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts +18 -0
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +108 -0
- package/development/seat-reservation/seat-reservation-area.d.ts +2 -0
- package/development/seat-reservation/seat-reservation-area.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-area.js +5 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts +9 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +326 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +29 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +224 -0
- package/development/seat-reservation/seat-reservation-graphic.d.ts +2 -0
- package/development/seat-reservation/seat-reservation-graphic.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-graphic.js +5 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +65 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +576 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts +2 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.js +5 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts +21 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +123 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts +2 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.js +5 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +53 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +446 -0
- package/development/seat-reservation/seat-reservation-place-control.d.ts +2 -0
- package/development/seat-reservation/seat-reservation-place-control.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-place-control.js +5 -0
- package/development/seat-reservation/seat-reservation.d.ts +73 -0
- package/development/seat-reservation/seat-reservation.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation.js +7 -0
- package/development/seat-reservation.d.ts +5 -0
- package/development/seat-reservation.d.ts.map +1 -0
- package/development/seat-reservation.js +7 -0
- package/index.d.ts +14 -0
- package/index.js +14 -0
- package/package.json +7 -2
- package/seat-reservation/common/mapper/icon-mapper.d.ts +112 -0
- package/seat-reservation/common/mapper/icon-mapper.d.ts.map +1 -0
- package/seat-reservation/common/mapper/icon-mapper.js +71 -0
- package/seat-reservation/common/mapper/mapper.d.ts +29 -0
- package/seat-reservation/common/mapper/mapper.d.ts.map +1 -0
- package/seat-reservation/common/mapper/mapper.js +87 -0
- package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +225 -0
- package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -0
- package/seat-reservation/common/mapper/seat-reservation-sample-data.js +6149 -0
- package/seat-reservation/common/mapper.d.ts +3 -0
- package/seat-reservation/common/mapper.d.ts.map +1 -0
- package/seat-reservation/common/mapper.js +9 -0
- package/seat-reservation/common/svgs.d.ts +25 -0
- package/seat-reservation/common/svgs.d.ts.map +1 -0
- package/seat-reservation/common/svgs.js +250 -0
- package/seat-reservation/common/translations/i18n.d.ts +19 -0
- package/seat-reservation/common/translations/i18n.d.ts.map +1 -0
- package/seat-reservation/common/translations/i18n.js +460 -0
- package/seat-reservation/common/translations.d.ts +2 -0
- package/seat-reservation/common/translations.d.ts.map +1 -0
- package/seat-reservation/common/translations.js +4 -0
- package/seat-reservation/common.d.ts +5 -0
- package/seat-reservation/common.d.ts.map +1 -0
- package/seat-reservation/common.js +17 -0
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +156 -0
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -0
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +435 -0
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.d.ts +29 -0
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.js +107 -0
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts +2 -0
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation/seat-reservation-scoped-component.js +4 -0
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts +62 -0
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation/seat-reservation.component.js +404 -0
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts +18 -0
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +49 -0
- package/seat-reservation/seat-reservation-area.d.ts +2 -0
- package/seat-reservation/seat-reservation-area.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-area.js +4 -0
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts +9 -0
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +317 -0
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +29 -0
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +113 -0
- package/seat-reservation/seat-reservation-graphic.d.ts +2 -0
- package/seat-reservation/seat-reservation-graphic.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-graphic.js +4 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +65 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +248 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts +2 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.js +4 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts +21 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +80 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts +2 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.js +4 -0
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +53 -0
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +190 -0
- package/seat-reservation/seat-reservation-place-control.d.ts +2 -0
- package/seat-reservation/seat-reservation-place-control.d.ts.map +1 -0
- package/seat-reservation/seat-reservation-place-control.js +4 -0
- package/seat-reservation/seat-reservation.d.ts +73 -0
- package/seat-reservation/seat-reservation.d.ts.map +1 -0
- package/seat-reservation/seat-reservation.js +6 -0
- package/seat-reservation.d.ts +5 -0
- package/seat-reservation.d.ts.map +1 -0
- package/seat-reservation.js +6 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-reservation.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.component.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAM1E,OAAO,KAAK,EAMV,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGhF,OAAO,+CAA+C,CAAC;AACvD,OAAO,6BAA6B,CAAC;AACrC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,qEAAqE,CAAC;AAC7E,OAAO,wCAAwC,CAAC;AAEhD;;;;;GAKG;AACH,qBAEM,yBAA0B,SAAQ,0BAA0B;IAChE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,wEAAwE;IACxE,SACyB,eAAe,EAAE,eAAe,CAAS;IAElE,uEAAuE;IACvE,SAEyB,aAAa,EAAE,OAAO,CAAQ;IAEvD,gGAAgG;IAChG,SAEyB,aAAa,EAAE,OAAO,CAAS;IAExD,iDAAiD;IACjD,SAEyB,eAAe,EAAE,MAAM,CAAS;IAEzD,2CAA2C;IAC3C,SAEyB,iBAAiB,EAAE,OAAO,CAAS;IAE5D,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAE9C,OAAO,CAAC,gBAAgB,CAQtB;IAEF,OAAO,CAAC,2BAA2B,CAAkB;cAElC,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAgBzD,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAK3D,MAAM,IAAI,cAAc,GAAG,IAAI;IAKlD,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,uCAAuC;IAwC/C,OAAO,CAAC,iBAAiB;IAqCzB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,wBAAwB;IA+BhC,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,wBAAwB;IA2ChC,OAAO,CAAC,6BAA6B;IA0BrC,OAAO,CAAC,yBAAyB;IA2EjC,OAAO,CAAC,4BAA4B;IA0CpC,OAAO,CAAC,2BAA2B;IAyCnC;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,yBAAyB;IAuBjC,OAAO,CAAC,8BAA8B;CAyBvC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,sBAAsB,EAAE,yBAAyB,CAAC;KACnD;CACF"}
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
var q = (n) => {
|
|
2
|
+
throw TypeError(n);
|
|
3
|
+
};
|
|
4
|
+
var K = (n, o, c) => o.has(n) || q("Cannot " + c);
|
|
5
|
+
var R = (n, o, c) => (K(n, o, "read from private field"), c ? c.call(n) : o.get(n)), x = (n, o, c) => o.has(n) ? q("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(n) : o.set(n, c), b = (n, o, c, u) => (K(n, o, "write to private field"), u ? u.call(n, c) : o.set(n, c), c);
|
|
6
|
+
import { __runInitializers as p, __esDecorate as S } from "tslib";
|
|
7
|
+
import { SbbLanguageController as X } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
|
+
import { forceType as P } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
+
import { css as J, html as h, nothing as A } from "lit";
|
|
10
|
+
import { customElement as Y, property as y } from "lit/decorators.js";
|
|
11
|
+
import { classMap as Q } from "lit/directives/class-map.js";
|
|
12
|
+
import { styleMap as Z } from "lit/directives/style-map.js";
|
|
13
|
+
import { getI18nSeatReservation as _ } from "../common.js";
|
|
14
|
+
import { SeatReservationBaseElement as ee } from "./seat-reservation-base-element.js";
|
|
15
|
+
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
16
|
+
import "../seat-reservation-area.js";
|
|
17
|
+
import "../seat-reservation-graphic.js";
|
|
18
|
+
import "../seat-reservation-place-control.js";
|
|
19
|
+
import "../seat-reservation-navigation/seat-reservation-navigation-coach.js";
|
|
20
|
+
import "./seat-reservation-scoped-component/seat-reservation-scoped.component.js";
|
|
21
|
+
const te = J`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-vertical-offset: 0;display:block}:host ::part(coach-floor){fill:var(--sbb-color-white)}@media (forced-colors: active){:host ::part(coach-floor){fill:transparent}}.sbb-sr__wrapper--vertical{width:fit-content;position:relative;inset-inline-start:var(--sbb-seat-reservation-vertical-offset);rotate:90deg;transform-origin:top left}.sbb-sr__wrapper--vertical .sbb-sr__parent{overflow-y:hidden}.sbb-sr__wrapper--vertical .sbb-sr__list-coaches{width:100vw}.sbb-sr-navigation--vertical{inset-inline-start:var(--sbb-seat-reservation-vertical-offset);margin-inline-start:1.25rem;position:absolute}.sbb-sr-navigation--vertical .sbb-sr-navigation__list-coaches{flex-direction:column}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;justify-content:center;flex-wrap:nowrap;gap:var(--sbb-spacing-fixed-1x);min-height:3.75rem}.sbb-sr__parent{overflow-x:scroll;padding:3rem 0}.sbb-sr__list-coaches{display:flex;gap:.25rem;padding:0;margin:0;list-style:none}.sbb-sr__item-coach{padding:0;margin:0;position:relative}.sbb-sr-coach-wrapper__table{outline:0}`;
|
|
22
|
+
let me = (() => {
|
|
23
|
+
var g, f, m, $, C, d;
|
|
24
|
+
let n = [Y("sbb-seat-reservation")], o, c = [], u, N = ee, T, z = [], O = [], k, D = [], G = [], I, V = [], E = [], B, L = [], F = [], M, H = [], W = [];
|
|
25
|
+
return d = class extends N {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
x(this, g);
|
|
29
|
+
x(this, f);
|
|
30
|
+
x(this, m);
|
|
31
|
+
x(this, $);
|
|
32
|
+
x(this, C);
|
|
33
|
+
b(this, g, p(this, z, null)), b(this, f, (p(this, O), p(this, D, !0))), b(this, m, (p(this, G), p(this, V, !1))), b(this, $, (p(this, E), p(this, L, null))), b(this, C, (p(this, F), p(this, H, !1))), this._language = (p(this, W), new X(this)), this._notAreaElements = [
|
|
34
|
+
"DRIVER_AREA_FULL",
|
|
35
|
+
"COACH_PASSAGE",
|
|
36
|
+
"COACH_WALL_NO_PASSAGE",
|
|
37
|
+
"COMPARTMENT_PASSAGE",
|
|
38
|
+
"COMPARTMENT_PASSAGE_HIGH",
|
|
39
|
+
"COMPARTMENT_PASSAGE_MIDDLE",
|
|
40
|
+
"COMPARTMENT_PASSAGE_LOW"
|
|
41
|
+
], this._notFixedRotatableAreaIcons = ["ENTRY_EXIT"];
|
|
42
|
+
}
|
|
43
|
+
/** The seat reservation object which contains all coaches and places */
|
|
44
|
+
get seatReservation() {
|
|
45
|
+
return R(this, g);
|
|
46
|
+
}
|
|
47
|
+
set seatReservation(e) {
|
|
48
|
+
b(this, g, e);
|
|
49
|
+
}
|
|
50
|
+
/** The seat resvervation navigation can be toggled by this property */
|
|
51
|
+
get hasNavigation() {
|
|
52
|
+
return R(this, f);
|
|
53
|
+
}
|
|
54
|
+
set hasNavigation(e) {
|
|
55
|
+
b(this, f, e);
|
|
56
|
+
}
|
|
57
|
+
/** controls the visual represention of seat reservation in a horizonal or vertical alignment */
|
|
58
|
+
get alignVertical() {
|
|
59
|
+
return R(this, m);
|
|
60
|
+
}
|
|
61
|
+
set alignVertical(e) {
|
|
62
|
+
b(this, m, e);
|
|
63
|
+
}
|
|
64
|
+
/** Maximal number of possible clickable seats */
|
|
65
|
+
get maxReservations() {
|
|
66
|
+
return R(this, $);
|
|
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
|
+
var t, i;
|
|
80
|
+
super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? (t = this.shadowRoot) == null || t.querySelectorAll("table").forEach((s) => s.removeAttribute("tabindex")) : (i = this.shadowRoot) == null || i.querySelectorAll("table").forEach((s) => s.setAttribute("tabindex", "0")));
|
|
81
|
+
}
|
|
82
|
+
firstUpdated(e) {
|
|
83
|
+
super.firstUpdated(e), this._componentSetup();
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
return this._initVehicleSeatReservationConstruction(), this._coachesHtmlTemplate || null;
|
|
87
|
+
}
|
|
88
|
+
_componentSetup() {
|
|
89
|
+
this.initNavigationSelectionByScrollEvent();
|
|
90
|
+
}
|
|
91
|
+
_initVehicleSeatReservationConstruction() {
|
|
92
|
+
var i;
|
|
93
|
+
const e = JSON.parse(JSON.stringify((i = this.seatReservation) == null ? void 0 : i.coachItems)), t = this.alignVertical ? "sbb-sr__wrapper--vertical" : "";
|
|
94
|
+
this._coachesHtmlTemplate = h`
|
|
95
|
+
<div>
|
|
96
|
+
<sbb-screen-reader-only>
|
|
97
|
+
<input
|
|
98
|
+
id="first-tab-element"
|
|
99
|
+
role="contentinfo"
|
|
100
|
+
type="text"
|
|
101
|
+
aria-label="${_("SEAT_RESERVATION_BEGIN", this._language.current)}"
|
|
102
|
+
readonly
|
|
103
|
+
/>
|
|
104
|
+
</sbb-screen-reader-only>
|
|
105
|
+
|
|
106
|
+
<div @keydown=${(s) => this.handleKeyboardEvent(s)}>
|
|
107
|
+
${this._renderNavigation()}
|
|
108
|
+
<div class="sbb-sr__wrapper ${t}">
|
|
109
|
+
<div id="sbb-sr__parent-area" class="sbb-sr__parent" tabindex="-1">
|
|
110
|
+
<ul class="sbb-sr__list-coaches" role="presentation">
|
|
111
|
+
${this._renderCoaches(e)}
|
|
112
|
+
</ul>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<sbb-screen-reader-only>
|
|
118
|
+
<input
|
|
119
|
+
id="last-tab-element"
|
|
120
|
+
role="contentinfo"
|
|
121
|
+
type="text"
|
|
122
|
+
aria-label="${_("SEAT_RESERVATION_END", this._language.current)}"
|
|
123
|
+
readonly
|
|
124
|
+
/>
|
|
125
|
+
</sbb-screen-reader-only>
|
|
126
|
+
</div>
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
_renderNavigation() {
|
|
130
|
+
var e;
|
|
131
|
+
return this.hasNavigation ? h`
|
|
132
|
+
<nav class="${Q({ "sbb-sr-navigation--vertical": this.alignVertical })}">
|
|
133
|
+
<ul
|
|
134
|
+
class="sbb-sr-navigation__list-coaches"
|
|
135
|
+
aria-label="${_("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
|
|
136
|
+
>
|
|
137
|
+
${(e = this.seatReservation) == null ? void 0 : e.coachItems.map((t, i) => {
|
|
138
|
+
var s, a;
|
|
139
|
+
return h`<li>
|
|
140
|
+
<sbb-seat-reservation-navigation-coach
|
|
141
|
+
@selectCoach=${(r) => this._onSelectNavCoach(r)}
|
|
142
|
+
@focusCoach=${() => this._onFocusNavCoach()}
|
|
143
|
+
index="${i}"
|
|
144
|
+
coach-id="${t.id}"
|
|
145
|
+
.selected=${this.selectedCoachIndex === i}
|
|
146
|
+
.focused=${this.focusedCoachIndex === i}
|
|
147
|
+
.propertyIds="${t.propertyIds}"
|
|
148
|
+
.travelClass="${t.travelClass}"
|
|
149
|
+
?driver-area="${!((s = t.places) != null && s.length)}"
|
|
150
|
+
?first="${i === 0}"
|
|
151
|
+
?last="${i === ((a = this.seatReservation) == null ? void 0 : a.coachItems.length) - 1}"
|
|
152
|
+
?vertical="${this.alignVertical}"
|
|
153
|
+
>
|
|
154
|
+
</sbb-seat-reservation-navigation-coach>
|
|
155
|
+
</li>`;
|
|
156
|
+
})}
|
|
157
|
+
</ul>
|
|
158
|
+
</nav>
|
|
159
|
+
` : null;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* @param coaches
|
|
164
|
+
* @returns
|
|
165
|
+
*/
|
|
166
|
+
_renderCoaches(e) {
|
|
167
|
+
return e ? e.map((t, i) => h`
|
|
168
|
+
<li class="sbb-sr__item-coach">${this._renderCoachElement(t, i)}</li>
|
|
169
|
+
`) : null;
|
|
170
|
+
}
|
|
171
|
+
_renderCoachElement(e, t) {
|
|
172
|
+
const i = this.getCalculatedDimension(e.dimension), s = this._getDescriptionTableCoach(e);
|
|
173
|
+
return h` <sbb-seat-reservation-scoped
|
|
174
|
+
scoped-classes="coach-wrapper"
|
|
175
|
+
height="${i.h}px"
|
|
176
|
+
width="${i.w}px"
|
|
177
|
+
>
|
|
178
|
+
${this._getRenderedCoachBorders(e, t)}
|
|
179
|
+
${this._getRenderedGraphicalElements(e.graphicElements || [], e.dimension)}
|
|
180
|
+
${this._getRenderedServiceElements(e.serviceElements)}
|
|
181
|
+
<table
|
|
182
|
+
@focus=${() => this.onFocusTableCoachAndPreselectPlace(t)}
|
|
183
|
+
id="sbb-sr-coach-${t}"
|
|
184
|
+
class="sbb-sr-coach-wrapper__table"
|
|
185
|
+
aria-describedby="sbb-sr-coach-caption-${t}"
|
|
186
|
+
>
|
|
187
|
+
<caption id="sbb-sr-coach-caption-${t}" tabindex="-1">
|
|
188
|
+
<sbb-screen-reader-only>${s}</sbb-screen-reader-only>
|
|
189
|
+
</caption>
|
|
190
|
+
${this._getRenderedRowPlaces(e, t)}
|
|
191
|
+
</table>
|
|
192
|
+
</sbb-seat-reservation-scoped>`;
|
|
193
|
+
}
|
|
194
|
+
_getRenderedCoachBorders(e, t) {
|
|
195
|
+
const i = e.graphicElements, s = 1, a = i == null ? void 0 : i.find((v) => v.icon === "DRIVER_AREA_FULL"), r = a ? e.dimension.w - a.dimension.w - s : e.dimension.w - s * 2, l = t === 0 && a ? (a == null ? void 0 : a.dimension.w) * this.baseGridSize : this.baseGridSize;
|
|
196
|
+
return h`
|
|
197
|
+
<sbb-seat-reservation-scoped
|
|
198
|
+
scoped-classes="coach-border"
|
|
199
|
+
inset-block-start="${this.coachBorderPadding * -1}px"
|
|
200
|
+
inset-inline-start="${l}px"
|
|
201
|
+
>
|
|
202
|
+
<sbb-seat-reservation-graphic
|
|
203
|
+
name="COACH_BORDER_MIDDLE"
|
|
204
|
+
width=${r * this.baseGridSize}
|
|
205
|
+
height=${(e.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize}
|
|
206
|
+
?stretch=${!0}
|
|
207
|
+
role="presentation"
|
|
208
|
+
></sbb-seat-reservation-graphic>
|
|
209
|
+
</sbb-seat-reservation-scoped>
|
|
210
|
+
`;
|
|
211
|
+
}
|
|
212
|
+
_getRenderedRowPlaces(e, t) {
|
|
213
|
+
if (!e.places)
|
|
214
|
+
return null;
|
|
215
|
+
const i = {};
|
|
216
|
+
for (const s of e.places)
|
|
217
|
+
i[s.position.y] ? i[s.position.y].push(s) : i[s.position.y] = [s];
|
|
218
|
+
return Object.values(i).map((s, a) => h`
|
|
219
|
+
<tr id="row-${t}-${s[0].position.y}" data-row-index=${a}>
|
|
220
|
+
${this._getRenderedColumnPlaces(s, t)}
|
|
221
|
+
</tr>
|
|
222
|
+
`).flatMap((s) => s);
|
|
223
|
+
}
|
|
224
|
+
_getRenderedColumnPlaces(e, t) {
|
|
225
|
+
return e.sort((i, s) => Number(i.position.x) - Number(s.position.x)), e == null ? void 0 : e.map((i, s) => {
|
|
226
|
+
const a = this.getCalculatedDimension(i.dimension), r = this.getCalculatedPosition(i.position), l = this.alignVertical ? -90 : 0;
|
|
227
|
+
return h`
|
|
228
|
+
<sbb-seat-reservation-scoped
|
|
229
|
+
scoped-classes="graphical-element"
|
|
230
|
+
inset-block-start="${r.y}px"
|
|
231
|
+
inset-inline-start="${r.x}px"
|
|
232
|
+
width="${a.w}px"
|
|
233
|
+
height="${a.h}px"
|
|
234
|
+
z-index="${i.position.z}"
|
|
235
|
+
cell-id="cell-${t}-${i.position.y}-${s}"
|
|
236
|
+
>
|
|
237
|
+
<sbb-seat-reservation-place-control
|
|
238
|
+
@selectPlace=${(v) => this._onSelectPlace(v)}
|
|
239
|
+
exportparts="sbb-sr-place-part"
|
|
240
|
+
id="seat-reservation__place-button-${t}-${i.number}"
|
|
241
|
+
class="seat-reservation-place-control"
|
|
242
|
+
data-cell-id="${t}-${i.position.y}-${s}"
|
|
243
|
+
text=${i.number}
|
|
244
|
+
type=${i.type}
|
|
245
|
+
state=${i.state}
|
|
246
|
+
width=${i.dimension.w * this.baseGridSize}
|
|
247
|
+
height=${i.dimension.h * this.baseGridSize}
|
|
248
|
+
rotation=${i.rotation ?? A}
|
|
249
|
+
text-rotation=${l}
|
|
250
|
+
coach-index=${t}
|
|
251
|
+
.propertyIds=${i.propertyIds}
|
|
252
|
+
.preventClick=${this.preventPlaceClick}
|
|
253
|
+
></sbb-seat-reservation-place-control>
|
|
254
|
+
</sbb-seat-reservation-scoped>
|
|
255
|
+
`;
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
_getRenderedGraphicalElements(e, t) {
|
|
259
|
+
return e ? e == null ? void 0 : e.map((i) => {
|
|
260
|
+
const s = i.icon ?? "", a = i.rotation || 0, r = this._notFixedRotatableAreaIcons.indexOf(i.icon) === -1, l = this.alignVertical && r ? a - 90 : a;
|
|
261
|
+
return this._notAreaElements.findIndex((v) => v === s) > -1 ? this._getRenderElementWithoutArea(i, a, t) : this._getRenderElementWithArea(i, l, t);
|
|
262
|
+
}) : null;
|
|
263
|
+
}
|
|
264
|
+
_getRenderElementWithArea(e, t, i) {
|
|
265
|
+
var U;
|
|
266
|
+
const s = ((U = e.icon) == null ? void 0 : U.indexOf("TABLE")) === -1, a = e.icon && s ? e.icon : null, r = a !== "ENTRY_EXIT", l = e.icon ? _(e.icon, this._language.current) : A, v = this.getCalculatedDimension(e.dimension, i, !0, r), j = this.getCalculatedPosition(e.position, e.dimension, i, !0);
|
|
267
|
+
let w = "free";
|
|
268
|
+
return e.position.y === this.coachBorderOffset * -1 ? w = "upper-border" : e.position.y + e.dimension.h === i.h + this.coachBorderOffset && (w = "lower-border"), h`
|
|
269
|
+
<sbb-seat-reservation-scoped
|
|
270
|
+
scoped-classes="graphical-element"
|
|
271
|
+
inset-block-start="${j.y}px"
|
|
272
|
+
inset-inline-start="${j.x}px"
|
|
273
|
+
width="${v.w}px"
|
|
274
|
+
height="${v.h}px"
|
|
275
|
+
z-index="${e.position.z}"
|
|
276
|
+
>
|
|
277
|
+
<sbb-seat-reservation-area
|
|
278
|
+
style=${Z({
|
|
279
|
+
"--sbb-reservation-area-width": e.dimension.w * this.baseGridSize,
|
|
280
|
+
"--sbb-reservation-area-height": e.dimension.h * this.baseGridSize
|
|
281
|
+
})}
|
|
282
|
+
mounting=${w}
|
|
283
|
+
background="dark"
|
|
284
|
+
aria-hidden="true"
|
|
285
|
+
title=${l}
|
|
286
|
+
>
|
|
287
|
+
${a ? h`
|
|
288
|
+
<sbb-seat-reservation-graphic
|
|
289
|
+
name=${a}
|
|
290
|
+
rotation=${t}
|
|
291
|
+
width=${this.baseGridSize}
|
|
292
|
+
height=${this.baseGridSize}
|
|
293
|
+
role="img"
|
|
294
|
+
aria-hidden="true"
|
|
295
|
+
></sbb-seat-reservation-graphic>
|
|
296
|
+
` : A}
|
|
297
|
+
</sbb-seat-reservation-area>
|
|
298
|
+
</sbb-seat-reservation-scoped>
|
|
299
|
+
`;
|
|
300
|
+
}
|
|
301
|
+
_getRenderElementWithoutArea(e, t, i) {
|
|
302
|
+
var l;
|
|
303
|
+
const s = this.getCalculatedDimension(e.dimension, i), a = this.getCalculatedPosition(e.position, e.dimension, i), r = e.icon && e.icon.indexOf("DRIVER_AREA") === -1 ? e.icon : (l = e.icon) == null ? void 0 : l.concat("_", this.seatReservation.vehicleType);
|
|
304
|
+
return h`
|
|
305
|
+
<sbb-seat-reservation-scoped
|
|
306
|
+
scoped-classes="graphical-element"
|
|
307
|
+
inset-block-start="${a.y}px"
|
|
308
|
+
inset-inline-start="${a.x}px"
|
|
309
|
+
width="${s.w}px"
|
|
310
|
+
height="${s.h}px"
|
|
311
|
+
z-index="${e.position.z}"
|
|
312
|
+
>
|
|
313
|
+
<sbb-seat-reservation-graphic
|
|
314
|
+
name=${r ?? A}
|
|
315
|
+
width=${e.dimension.w * this.baseGridSize}
|
|
316
|
+
height=${e.dimension.h * this.baseGridSize}
|
|
317
|
+
rotation=${t}
|
|
318
|
+
aria-hidden="true"
|
|
319
|
+
?stretch=${!0}
|
|
320
|
+
></sbb-seat-reservation-graphic>
|
|
321
|
+
</sbb-seat-reservation-scoped>
|
|
322
|
+
`;
|
|
323
|
+
}
|
|
324
|
+
_getRenderedServiceElements(e) {
|
|
325
|
+
return e ? e == null ? void 0 : e.map((t) => {
|
|
326
|
+
const i = t.icon ? _(t.icon, this._language.current) : null, s = this.getCalculatedDimension(t.dimension), a = this.getCalculatedPosition(t.position), r = t.rotation || 0, l = this.alignVertical ? r - 90 : r;
|
|
327
|
+
return h`
|
|
328
|
+
<sbb-seat-reservation-scoped
|
|
329
|
+
scoped-classes="graphical-element"
|
|
330
|
+
inset-block-start="${a.y}px"
|
|
331
|
+
inset-inline-start="${a.x}px"
|
|
332
|
+
width="${s.w}px"
|
|
333
|
+
height="${s.h}px"
|
|
334
|
+
z-index="${t.position.z}"
|
|
335
|
+
>
|
|
336
|
+
<sbb-seat-reservation-graphic
|
|
337
|
+
name=${t.icon ?? A}
|
|
338
|
+
width=${t.dimension.w * this.baseGridSize}
|
|
339
|
+
height=${t.dimension.h * this.baseGridSize}
|
|
340
|
+
.rotation=${l}
|
|
341
|
+
role="img"
|
|
342
|
+
aria-hidden="true"
|
|
343
|
+
title=${i ?? A}
|
|
344
|
+
></sbb-seat-reservation-graphic>
|
|
345
|
+
</sbb-seat-reservation-scoped>
|
|
346
|
+
`;
|
|
347
|
+
}) : null;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Manages the selected place event triggered from the place
|
|
351
|
+
* Each selection emits an array of all selected places
|
|
352
|
+
* @param selectPlaceEvent
|
|
353
|
+
*/
|
|
354
|
+
_onSelectPlace(e) {
|
|
355
|
+
const t = e.detail;
|
|
356
|
+
this.preventCoachScrollByPlaceClick = !0, this.isCochGridFocusable = !1, this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(t), this.updateCurrentSelectedPlaceInCoach(t));
|
|
357
|
+
}
|
|
358
|
+
_onSelectNavCoach(e) {
|
|
359
|
+
const t = e.detail;
|
|
360
|
+
this.isKeyboardNavigation = !1, t !== null && t !== this.currSelectedCoachIndex ? (this.unfocusPlaceElement(), this.scrollToSelectedNavCoach(t)) : t === this.currSelectedCoachIndex && (this.updateCurrentSelectedCoach(), this.preselectPlaceInCoach());
|
|
361
|
+
}
|
|
362
|
+
_onFocusNavCoach() {
|
|
363
|
+
this.preventCoachScrollByPlaceClick ? this.focusPlaceElement(this.currSelectedPlace) : this.preselectPlaceInCoach(), this.isAutoScrolling = !1;
|
|
364
|
+
}
|
|
365
|
+
_getDescriptionTableCoach(e) {
|
|
366
|
+
var a;
|
|
367
|
+
if (!((a = e.places) != null && a.length))
|
|
368
|
+
return _("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [
|
|
369
|
+
e.id
|
|
370
|
+
]);
|
|
371
|
+
let t = "";
|
|
372
|
+
const i = this._getTitleDescriptionListString(e.graphicElements), s = this._getTitleDescriptionListString(e.serviceElements);
|
|
373
|
+
return t = _("COACH_TABLE_CAPTION", this._language.current, [
|
|
374
|
+
e.id
|
|
375
|
+
]), (i || s) && (t += ". " + _("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", t += s + ", " + i + "."), t;
|
|
376
|
+
}
|
|
377
|
+
_getTitleDescriptionListString(e) {
|
|
378
|
+
const t = [];
|
|
379
|
+
return e == null ? void 0 : e.map((i) => {
|
|
380
|
+
const s = i.icon;
|
|
381
|
+
if (!s)
|
|
382
|
+
return null;
|
|
383
|
+
const a = t.indexOf(s) > -1, r = _(i.icon, this._language.current), l = this._notFixedRotatableAreaIcons.indexOf(s) === -1 && this._notAreaElements.indexOf(s) === -1;
|
|
384
|
+
return a || t.push(i.icon), r && !a && l ? r : null;
|
|
385
|
+
}).filter((i) => !!i).join(", ");
|
|
386
|
+
}
|
|
387
|
+
}, g = new WeakMap(), f = new WeakMap(), m = new WeakMap(), $ = new WeakMap(), C = new WeakMap(), u = d, (() => {
|
|
388
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(N[Symbol.metadata] ?? null) : void 0;
|
|
389
|
+
T = [y({ attribute: "seat-reservation", type: Object })], k = [P(), y({ attribute: "has-navigation", type: Boolean })], I = [P(), y({ attribute: "align-vertical", type: Boolean })], B = [P(), y({ attribute: "max-reservations", type: Number })], M = [P(), y({ attribute: "prevent-place-click", type: Boolean })], S(d, null, T, { kind: "accessor", name: "seatReservation", static: !1, private: !1, access: { has: (t) => "seatReservation" in t, get: (t) => t.seatReservation, set: (t, i) => {
|
|
390
|
+
t.seatReservation = i;
|
|
391
|
+
} }, metadata: e }, z, O), S(d, null, k, { kind: "accessor", name: "hasNavigation", static: !1, private: !1, access: { has: (t) => "hasNavigation" in t, get: (t) => t.hasNavigation, set: (t, i) => {
|
|
392
|
+
t.hasNavigation = i;
|
|
393
|
+
} }, metadata: e }, D, G), S(d, null, I, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, i) => {
|
|
394
|
+
t.alignVertical = i;
|
|
395
|
+
} }, metadata: e }, V, E), S(d, null, B, { kind: "accessor", name: "maxReservations", static: !1, private: !1, access: { has: (t) => "maxReservations" in t, get: (t) => t.maxReservations, set: (t, i) => {
|
|
396
|
+
t.maxReservations = i;
|
|
397
|
+
} }, metadata: e }, L, F), S(d, null, M, { kind: "accessor", name: "preventPlaceClick", static: !1, private: !1, access: { has: (t) => "preventPlaceClick" in t, get: (t) => t.preventPlaceClick, set: (t, i) => {
|
|
398
|
+
t.preventPlaceClick = i;
|
|
399
|
+
} }, metadata: e }, H, W), S(null, o = { value: u }, n, { kind: "class", name: u.name, metadata: e }, null, c), u = o.value, e && Object.defineProperty(u, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
400
|
+
})(), d.styles = te, p(u, c), u;
|
|
401
|
+
})();
|
|
402
|
+
export {
|
|
403
|
+
me as SbbSeatReservationElement
|
|
404
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CSSResultGroup, TemplateResult, LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Visualize an area with a special meaning within a wagon.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SbbSeatReservationAreaElement extends LitElement {
|
|
6
|
+
static styles: CSSResultGroup;
|
|
7
|
+
/** Mounting Prop */
|
|
8
|
+
accessor mounting: 'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border';
|
|
9
|
+
/** the background of the area */
|
|
10
|
+
accessor background: 'light' | 'dark';
|
|
11
|
+
protected render(): TemplateResult;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'sbb-seat-reservation-area': SbbSeatReservationAreaElement;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=seat-reservation-area.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-reservation-area.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-area/seat-reservation-area.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC;;GAEG;AACH,qBAEM,6BAA8B,SAAQ,UAAU;IACpD,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,oBAAoB;IACpB,SAEgB,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,GAAG,uBAAuB,CACnF;IAET,iCAAiC;IACjC,SAEgB,UAAU,EAAE,OAAO,GAAG,MAAM,CAAW;cAEpC,MAAM,IAAI,cAAc;CAG5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,2BAA2B,EAAE,6BAA6B,CAAC;KAC5D;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var x = (r) => {
|
|
2
|
+
throw TypeError(r);
|
|
3
|
+
};
|
|
4
|
+
var y = (r, e, t) => e.has(r) || x("Cannot " + t);
|
|
5
|
+
var c = (r, e, t) => (y(r, e, "read from private field"), t ? t.call(r) : e.get(r)), u = (r, e, t) => e.has(r) ? x("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), m = (r, e, t, o) => (y(r, e, "write to private field"), o ? o.call(r, t) : e.set(r, t), t);
|
|
6
|
+
import { __esDecorate as g, __runInitializers as l } from "tslib";
|
|
7
|
+
import { forceType as z } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
8
|
+
import { css as E, LitElement as I, html as j } from "lit";
|
|
9
|
+
import { customElement as D, property as S } from "lit/decorators.js";
|
|
10
|
+
const O = E`*,:before,:after{box-sizing:border-box}:host{--sbb-reservation-area-border-radius: var(--sbb-border-width-4x);--sbb-reservation-area-rotation: 0;display:flex;justify-content:center;align-items:center;height:calc(var(--sbb-reservation-area-height) * .0625rem);width:calc(var(--sbb-reservation-area-width) * .0625rem);border:var(--sbb-border-width-1x) solid var(--sbb-color-graphite);border-radius:var(--sbb-reservation-area-border-radius);position:inherit;rotate:calc(var(--sbb-reservation-area-rotation) * 1deg);background-color:var(--sbb-color-white)}:host([background=dark]){background-color:var(--sbb-color-milk)}:host([mounting=upper-border]){border-block-start-width:var(--sbb-border-width-2x);border-radius:0 0 var(--sbb-reservation-area-border-radius) var(--sbb-reservation-area-border-radius)}:host([mounting=lower-border]){border-block-end-width:var(--sbb-border-width-2x);border-radius:var(--sbb-reservation-area-border-radius) var(--sbb-reservation-area-border-radius) 0 0}:host([mounting=upper-to-lower-border]){border-block-start:none;border-block-end:none;border-radius:0}`;
|
|
11
|
+
let B = (() => {
|
|
12
|
+
var n, b, s;
|
|
13
|
+
let r = [D("sbb-seat-reservation-area")], e, t = [], o, h = I, v, _ = [], k = [], p, f = [], w = [];
|
|
14
|
+
return s = class extends h {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
u(this, n, l(this, _, "free"));
|
|
18
|
+
u(this, b, (l(this, k), l(this, f, "light")));
|
|
19
|
+
l(this, w);
|
|
20
|
+
}
|
|
21
|
+
/** Mounting Prop */
|
|
22
|
+
get mounting() {
|
|
23
|
+
return c(this, n);
|
|
24
|
+
}
|
|
25
|
+
set mounting(i) {
|
|
26
|
+
m(this, n, i);
|
|
27
|
+
}
|
|
28
|
+
/** the background of the area */
|
|
29
|
+
get background() {
|
|
30
|
+
return c(this, b);
|
|
31
|
+
}
|
|
32
|
+
set background(i) {
|
|
33
|
+
m(this, b, i);
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return j`<slot></slot>`;
|
|
37
|
+
}
|
|
38
|
+
}, n = new WeakMap(), b = new WeakMap(), o = s, (() => {
|
|
39
|
+
const i = typeof Symbol == "function" && Symbol.metadata ? Object.create(h[Symbol.metadata] ?? null) : void 0;
|
|
40
|
+
v = [z(), S({ reflect: !0 })], p = [z(), S({ reflect: !0 })], g(s, null, v, { kind: "accessor", name: "mounting", static: !1, private: !1, access: { has: (a) => "mounting" in a, get: (a) => a.mounting, set: (a, d) => {
|
|
41
|
+
a.mounting = d;
|
|
42
|
+
} }, metadata: i }, _, k), g(s, null, p, { kind: "accessor", name: "background", static: !1, private: !1, access: { has: (a) => "background" in a, get: (a) => a.background, set: (a, d) => {
|
|
43
|
+
a.background = d;
|
|
44
|
+
} }, metadata: i }, f, w), g(null, e = { value: o }, r, { kind: "class", name: o.name, metadata: i }, null, t), o = e.value, i && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: i });
|
|
45
|
+
})(), s.styles = O, l(o, t), o;
|
|
46
|
+
})();
|
|
47
|
+
export {
|
|
48
|
+
B as SbbSeatReservationAreaElement
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-reservation-area.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/seat-reservation/seat-reservation-area.ts"],"names":[],"mappings":"AAAA,cAAc,4DAA4D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* svgImageByOSDMCode Function returns the corresponding svg image by OSDM Code
|
|
4
|
+
* @param osdmCode
|
|
5
|
+
* @returns The SVG Image as TemplateResult if it matches the OSDM code, or null if it's not found.
|
|
6
|
+
*/
|
|
7
|
+
export declare const svgImageByOSDMCode: (osdmCode: string) => TemplateResult | null;
|
|
8
|
+
export declare const assetsTemplate: TemplateResult;
|
|
9
|
+
//# sourceMappingURL=seat-reservation-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-reservation-assets.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-graphic/seat-reservation-assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAKhD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AAUxC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,KAAG,cAAc,GAAG,IAMtE,CAAC;AAmSF,eAAO,MAAM,cAAc,EAAE,cAgB5B,CAAC"}
|