@sbb-esta/lyne-elements-experimental 3.3.2 → 3.5.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 +33 -173
- package/development/seat-reservation/common/translations/i18n.js +4 -4
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +5 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +15 -3
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +0 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +41 -49
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +5 -5
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +1 -10
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +4 -83
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +16 -17
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +11 -14
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +0 -8
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +20 -87
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -4
- package/package.json +2 -2
- package/seat-reservation/common/translations/i18n.js +3 -3
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +5 -0
- package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +24 -14
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts +0 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation/seat-reservation.component.js +129 -134
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +6 -6
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +1 -10
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +47 -90
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +75 -76
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +32 -35
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +0 -8
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +92 -129
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -2
|
@@ -2,58 +2,55 @@ var x = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var L = (e, s, a) => s.has(e) || x("Cannot " + a);
|
|
5
|
-
var
|
|
6
|
-
import { __runInitializers as b, __esDecorate as
|
|
5
|
+
var u = (e, s, a) => (L(e, s, "read from private field"), a ? a.call(e) : s.get(e)), d = (e, s, a) => s.has(e) ? x("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, a), p = (e, s, a, i) => (L(e, s, "write to private field"), i ? i.call(e, a) : s.set(e, a), a);
|
|
6
|
+
import { __runInitializers as b, __esDecorate as m } from "tslib";
|
|
7
7
|
import { SbbLanguageController as $ } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
|
-
import { forceType as
|
|
9
|
-
import { css as
|
|
10
|
-
import { customElement as C, property as
|
|
11
|
-
import {
|
|
12
|
-
import { getI18nSeatReservation as
|
|
8
|
+
import { forceType as A } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
+
import { css as j, LitElement as w, nothing as z, html as D } from "lit";
|
|
10
|
+
import { customElement as C, property as E } from "lit/decorators.js";
|
|
11
|
+
import { styleMap as k } from "lit/directives/style-map.js";
|
|
12
|
+
import { getI18nSeatReservation as g } from "../common.js";
|
|
13
13
|
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
14
14
|
import "../seat-reservation-graphic.js";
|
|
15
|
-
const O =
|
|
15
|
+
const O = j`*,:before,:after{box-sizing:border-box}.sbb-sr-navigation__signs{display:flex;flex-direction:row;justify-content:center;gap:var(--sbb-spacing-fixed-2x);color:var(--sbb-color-granite)}:host([vertical]) .sbb-sr-navigation__signs{flex-direction:column;height:100%}`;
|
|
16
16
|
let J = (() => {
|
|
17
|
-
var
|
|
18
|
-
let e = [C("sbb-seat-reservation-navigation-services")], s, a = [], i,
|
|
19
|
-
return l = class extends
|
|
17
|
+
var n, c, l;
|
|
18
|
+
let e = [C("sbb-seat-reservation-navigation-services")], s, a = [], i, h = w, _, v = [], y = [], f, I = [], S = [];
|
|
19
|
+
return l = class extends h {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
|
-
d(this,
|
|
22
|
+
d(this, n);
|
|
23
23
|
d(this, c);
|
|
24
|
-
p(this,
|
|
24
|
+
p(this, n, b(this, v, [])), p(this, c, (b(this, y), b(this, I, !1))), this._language = (b(this, S), new $(this));
|
|
25
25
|
}
|
|
26
26
|
/** Coach service property ids, which are used to display the services in the navigation */
|
|
27
27
|
get propertyIds() {
|
|
28
|
-
return
|
|
28
|
+
return u(this, n);
|
|
29
29
|
}
|
|
30
30
|
set propertyIds(r) {
|
|
31
|
-
p(this,
|
|
31
|
+
p(this, n, r);
|
|
32
32
|
}
|
|
33
33
|
/** If true, the service icons are displayed vertically */
|
|
34
34
|
get vertical() {
|
|
35
|
-
return
|
|
35
|
+
return u(this, c);
|
|
36
36
|
}
|
|
37
37
|
set vertical(r) {
|
|
38
38
|
p(this, c, r);
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
41
|
const r = this.propertyIds.length ? this._getServiceLabelDescription() : null;
|
|
42
|
-
return
|
|
43
|
-
class="${k({
|
|
44
|
-
"sbb-sr-navigation__signs": !0,
|
|
45
|
-
"sbb-sr-navigation__signs--vertical": this.vertical
|
|
46
|
-
})}"
|
|
47
|
-
>
|
|
42
|
+
return D` <div class="sbb-sr-navigation__signs">
|
|
48
43
|
<sbb-screen-reader-only ${r || z}
|
|
49
44
|
>${r}</sbb-screen-reader-only
|
|
50
45
|
>
|
|
51
|
-
${this.propertyIds?.map((t) =>
|
|
46
|
+
${this.propertyIds?.map((t) => D`
|
|
52
47
|
<sbb-seat-reservation-graphic
|
|
48
|
+
style=${k({
|
|
49
|
+
"--sbb-seat-reservation-graphic-width": 20,
|
|
50
|
+
"--sbb-seat-reservation-graphic-height": 20
|
|
51
|
+
})}
|
|
53
52
|
name=${t ?? z}
|
|
54
|
-
|
|
55
|
-
height="20"
|
|
56
|
-
title=${m(t, this._language.current)}
|
|
53
|
+
title=${g(t, this._language.current)}
|
|
57
54
|
aria-hidden="true"
|
|
58
55
|
></sbb-seat-reservation-graphic>
|
|
59
56
|
`)}
|
|
@@ -62,16 +59,16 @@ let J = (() => {
|
|
|
62
59
|
//Generate the translated service label from the available properties
|
|
63
60
|
_getServiceLabelDescription() {
|
|
64
61
|
let r = null;
|
|
65
|
-
const t = this.propertyIds.map((
|
|
66
|
-
return t && (r =
|
|
62
|
+
const t = this.propertyIds.map((o) => g(o, this._language.current)).filter((o) => !!o).join(", ");
|
|
63
|
+
return t && (r = g("COACH_AVAILABLE_SERVICES", this._language.current).concat(":").concat(t)), r;
|
|
67
64
|
}
|
|
68
|
-
},
|
|
69
|
-
const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
70
|
-
|
|
71
|
-
t.propertyIds =
|
|
72
|
-
} }, metadata: r },
|
|
73
|
-
t.vertical =
|
|
74
|
-
} }, metadata: r }, I, S),
|
|
65
|
+
}, n = new WeakMap(), c = new WeakMap(), i = l, (() => {
|
|
66
|
+
const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(h[Symbol.metadata] ?? null) : void 0;
|
|
67
|
+
_ = [E({ attribute: "property-ids", type: Array })], f = [A(), E({ type: Boolean, reflect: !0, useDefault: !0 })], m(l, null, _, { kind: "accessor", name: "propertyIds", static: !1, private: !1, access: { has: (t) => "propertyIds" in t, get: (t) => t.propertyIds, set: (t, o) => {
|
|
68
|
+
t.propertyIds = o;
|
|
69
|
+
} }, metadata: r }, v, y), m(l, null, f, { kind: "accessor", name: "vertical", static: !1, private: !1, access: { has: (t) => "vertical" in t, get: (t) => t.vertical, set: (t, o) => {
|
|
70
|
+
t.vertical = o;
|
|
71
|
+
} }, metadata: r }, I, S), m(null, s = { value: i }, e, { kind: "class", name: i.name, metadata: r }, null, a), i = s.value, r && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r });
|
|
75
72
|
})(), l.styles = O, b(i, a), i;
|
|
76
73
|
})();
|
|
77
74
|
export {
|
|
@@ -15,16 +15,8 @@ export declare class SbbSeatReservationPlaceControlElement extends SbbButtonBase
|
|
|
15
15
|
accessor state: PlaceState;
|
|
16
16
|
/** property ids of the place, to display more info about the place */
|
|
17
17
|
accessor propertyIds: string[];
|
|
18
|
-
/** rotation in degrees (without unit) */
|
|
19
|
-
accessor rotation: number;
|
|
20
|
-
/** width of the place in pixels (without unit) */
|
|
21
|
-
accessor width: number;
|
|
22
|
-
/** height of the place in pixels (without unit) */
|
|
23
|
-
accessor height: number;
|
|
24
18
|
/** label of the place, e.g. '1A', '2B' */
|
|
25
19
|
accessor text: string;
|
|
26
|
-
/** Rotation of the text in degrees (without unit) */
|
|
27
|
-
accessor textRotation: number;
|
|
28
20
|
/** Deck Index Prop to identifier the right place to deck */
|
|
29
21
|
accessor deckIndex: number;
|
|
30
22
|
/** Coach Index Prop to identifier the right place to coach */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-reservation-place-control.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAGrF,OAAO,EAAE,KAAK,cAAc,EAAiB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"seat-reservation-place-control.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAGrF,OAAO,EAAE,KAAK,cAAc,EAAiB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAKnG,OAAO,KAAK,EAAkB,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,gCAAgC,CAAC;AAIxC;;GAEG;AACH,qBAEM,qCAAsC,SAAQ,oBAAoB;IACtE,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;MAElB;IAEX,qDAAqD;IACrD,SAEgB,SAAS,EAAE,SAAS,CAAU;IAE9C,6DAA6D;IAC7D,SAEgB,KAAK,EAAE,UAAU,CAAU;IAE3C,sEAAsE;IACtE,SACgB,WAAW,EAAE,MAAM,EAAE,CAAM;IAE3C,0CAA0C;IAC1C,SAEgB,IAAI,EAAE,MAAM,CAAM;IAElC,4DAA4D;IAC5D,SAEgB,SAAS,EAAE,MAAM,CAAS;IAE1C,8DAA8D;IAC9D,SAEgB,UAAU,EAAE,MAAM,CAAS;IAE3C,kDAAkD;IAClD,SAEgB,YAAY,EAAE,OAAO,CAAS;IAE9C,wCAAwC;IACxC,SAEgB,QAAQ,EAAE,MAAM,CAAa;IAE7C,OAAO,CAAC,SAAS,CAAmC;;cAOjC,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAUzD,MAAM,IAAI,cAAc;IAuC3C,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,yBAAyB;IAejC,yGAAyG;IACzG,OAAO,CAAC,YAAY;CA4BrB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,oCAAoC,EAAE,qCAAqC,CAAC;KAC7E;CACF"}
|
package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js
CHANGED
|
@@ -1,158 +1,129 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var W = (r) => {
|
|
2
|
+
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __esDecorate as
|
|
7
|
-
import { SbbButtonBaseElement as
|
|
8
|
-
import { SbbLanguageController as
|
|
4
|
+
var X = (r, o, i) => o.has(r) || W("Cannot " + i);
|
|
5
|
+
var b = (r, o, i) => (X(r, o, "read from private field"), i ? i.call(r) : o.get(r)), p = (r, o, i) => o.has(r) ? W("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(r) : o.set(r, i), a = (r, o, i, n) => (X(r, o, "write to private field"), n ? n.call(r, i) : o.set(r, i), i);
|
|
6
|
+
import { __esDecorate as d, __runInitializers as c } from "tslib";
|
|
7
|
+
import { SbbButtonBaseElement as ae } from "@sbb-esta/lyne-elements/core/base-elements.js";
|
|
8
|
+
import { SbbLanguageController as ce } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
9
9
|
import { forceType as h } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
10
|
-
import { css as
|
|
11
|
-
import { customElement as
|
|
12
|
-
import {
|
|
10
|
+
import { css as le, nothing as oe, html as ie } from "lit";
|
|
11
|
+
import { customElement as ne, property as v } from "lit/decorators.js";
|
|
12
|
+
import { styleMap as be } from "lit/directives/style-map.js";
|
|
13
|
+
import { getI18nSeatReservation as E } from "../common.js";
|
|
13
14
|
import "../seat-reservation-graphic.js";
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
var u,
|
|
17
|
-
let
|
|
18
|
-
return
|
|
15
|
+
const pe = le`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-place-control-text-scale-value: 1;--sbb-seat-reservation-place-control-width: 16;--sbb-seat-reservation-place-control-height: 16;--sbb-seat-reservation-place-control-top: 0;--sbb-seat-reservation-place-control-left: 0;--sbb-seat-reservation-place-control-rotation: 0;--sbb-seat-reservation-place-control-text-rotation: 0;--sbb-seat-reservation-place-control-text-size: calc( var(--sbb-seat-reservation-place-control-text-scale-value, 1) * .5 );--sbb-seat-reservation-place-control-default-text: var(--sbb-color-black);--sbb-seat-reservation-place-control-hover-text: var(--sbb-color-iron);--sbb-seat-reservation-place-control-focus-text: var(--sbb-color-anthracite);--sbb-seat-reservation-place-control-allocated-text: var(--sbb-color-smoke);--sbb-seat-reservation-place-control-free-background-default: var(--sbb-color-white);--sbb-seat-reservation-place-control-free-background-hover: var(--sbb-color-cloud);--sbb-seat-reservation-place-control-free-background-focus: var(--sbb-color-silver);--sbb-seat-reservation-place-control-free-backrest-background-default: var(--sbb-color-black);--sbb-seat-reservation-place-control-free-backrest-background-hover: var(--sbb-color-black);--sbb-seat-reservation-place-control-free-backrest-background-focus: var(--sbb-color-black);--sbb-seat-reservation-place-control-selected-background-default: var(--sbb-color-red);--sbb-seat-reservation-place-control-selected-background-hover: var(--sbb-color-red125);--sbb-seat-reservation-place-control-selected-background-focus: var(--sbb-color-red150);--sbb-seat-reservation-place-control-selected-backrest-background-default: var( --sbb-color-red150 );--sbb-seat-reservation-place-control-selected-backrest-background-hover: #7d000f;--sbb-seat-reservation-place-control-selected-backrest-background-focus: #5a000b;--sbb-seat-reservation-place-control-allocated-background-default: var(--sbb-color-milk);width:calc(var(--sbb-seat-reservation-place-control-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:calc(var(--sbb-seat-reservation-place-control-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));position:absolute;inset-block-start:calc(var(--sbb-seat-reservation-place-control-top) * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(var(--sbb-seat-reservation-place-control-left) * var(--sbb-seat-reservation-one-px-rem, .0625rem));cursor:pointer}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-hover)}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-background-hover)}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-free-background-hover);color:var(--sbb-seat-reservation-place-control-free-text)}:host(:hover) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-selected-background-hover)}:host(:hover) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-selected-backrest-background-hover)}:host(:hover) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-selected-background-hover);color:var(--sbb-seat-reservation-place-control-selected-text)}:host(:focus){border-radius:var(--sbb-border-width-1x);outline:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) solid var(--sbb-color-black)}:host(:focus) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-focus)}:host(:focus) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-background-focus)}:host(:focus) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-free-background-focus);color:var(--sbb-seat-reservation-place-control-free-text)}:host(:focus) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-selected-background-focus)}:host(:focus) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-selected-backrest-background-focus)}:host(:focus) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-selected-background-focus);color:var(--sbb-seat-reservation-place-control-selected-text)}: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(svg-place){rotate:180deg}.sbb-sr-place-ctrl{width:max-content;position:relative;font-size:calc(var(--sbb-seat-reservation-place-control-text-size) * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-place-ctrl--state-free ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-default)}.sbb-sr-place-ctrl--state-free ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-background-default)}.sbb-sr-place-ctrl--state-free .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-free-background-default);color:var(--sbb-seat-reservation-place-control-free-text)}.sbb-sr-place-ctrl--state-selected ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-selected-background-default)}.sbb-sr-place-ctrl--state-selected ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-selected-backrest-background-default)}.sbb-sr-place-ctrl--state-selected .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-selected-background-default);color:var(--sbb-seat-reservation-place-control-selected-text)}.sbb-sr-place-ctrl--state-allocated,.sbb-sr-place-ctrl--state-restricted{cursor:not-allowed}.sbb-sr-place-ctrl--state-allocated ::part(svg-place),.sbb-sr-place-ctrl--state-restricted ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-allocated-background-default)}.sbb-sr-place-ctrl--state-allocated ::part(svg-backrest),.sbb-sr-place-ctrl--state-restricted ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-allocated-backrest-background-default)}.sbb-sr-place-ctrl--state-allocated .sbb-sr-place-ctrl__text,.sbb-sr-place-ctrl--state-restricted .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-allocated-background-default);color:var(--sbb-seat-reservation-place-control-allocated-text)}.sbb-sr-place-ctrl__text{overflow:hidden;display:none;position:absolute;inset-block-start:50%;translate:-50% -50%;rotate:calc(var(--sbb-seat-reservation-place-control-text-rotation) * 1deg);font-family:var(--sbb-typo-font-family);font-size:.75em;line-height:initial}.sbb-sr-place-ctrl--state-free .sbb-sr-place-ctrl__text,.sbb-sr-place-ctrl--state-allocated .sbb-sr-place-ctrl__text,.sbb-sr-place-ctrl--state-restricted.sbb-sr-place-ctrl--type-bicycle .sbb-sr-place-ctrl__text{display:block}.sbb-sr-place-ctrl--type-bicycle .sbb-sr-place-ctrl__text{inset-block-start:65%;inset-inline-start:50%;transform-origin:center 16%;font-size:.6875em}.sbb-sr-place-ctrl--orientation-0.sbb-sr-place-ctrl--type-seat .sbb-sr-place-ctrl__text{inset-inline-start:45%}.sbb-sr-place-ctrl--orientation-90.sbb-sr-place-ctrl--type-seat .sbb-sr-place-ctrl__text{inset-block-start:46%;inset-inline-start:50%}.sbb-sr-place-ctrl--orientation-180.sbb-sr-place-ctrl--type-seat .sbb-sr-place-ctrl__text{inset-inline-start:55%}.sbb-sr-place-ctrl--orientation-270.sbb-sr-place-ctrl--type-seat .sbb-sr-place-ctrl__text{inset-block-start:52%;inset-inline-start:52%}:host(:dir(rtl)) .sbb-sr-place-ctrl--orientation-0 .sbb-sr-place-ctrl__text{inset-inline-start:3%}:host(:dir(rtl)) .sbb-sr-place-ctrl--orientation-90 .sbb-sr-place-ctrl__text,:host(:dir(rtl)) .sbb-sr-place-ctrl--orientation-180 .sbb-sr-place-ctrl__text{inset-inline-start:10%}:host(:dir(rtl)) .sbb-sr-place-ctrl--orientation-270 .sbb-sr-place-ctrl__text{inset-inline-start:5%}:host(:dir(rtl)) .sbb-sr-place-ctrl--type-bicycle .sbb-sr-place-ctrl__text{inset-inline-start:-10%}`;
|
|
16
|
+
let Ie = (() => {
|
|
17
|
+
var u, f, _, g, k, x, y, m, l;
|
|
18
|
+
let r = [ne("sbb-seat-reservation-place-control")], o, i = [], n, C = ae, z, T = [], S = [], w, P = [], R = [], L, $ = [], D = [], A, N = [], O = [], F, V = [], j = [], B, U = [], K = [], M, Y = [], q = [], G, H = [], J = [];
|
|
19
|
+
return l = class extends C {
|
|
19
20
|
constructor() {
|
|
20
21
|
super();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
b(this, z);
|
|
31
|
-
b(this, w);
|
|
32
|
-
b(this, E);
|
|
33
|
-
a(this, u, r(this, S, "SEAT")), a(this, _, (r(this, $), r(this, L, "FREE"))), a(this, f, (r(this, D), r(this, A, []))), a(this, g, (r(this, O), r(this, j, 0))), a(this, k, (r(this, B), r(this, K, 32))), a(this, x, (r(this, M), r(this, q, 32))), a(this, m, (r(this, G), r(this, J, ""))), a(this, y, (r(this, Q), r(this, W, 0))), a(this, I, (r(this, X), r(this, tt, null))), a(this, z, (r(this, et), r(this, at, null))), a(this, w, (r(this, rt), r(this, lt, !1))), a(this, E, (r(this, ot), r(this, nt, "unfocus"))), this._language = (r(this, bt), new kt(this)), this.addEventListener("click", () => this._selectPlace());
|
|
22
|
+
p(this, u);
|
|
23
|
+
p(this, f);
|
|
24
|
+
p(this, _);
|
|
25
|
+
p(this, g);
|
|
26
|
+
p(this, k);
|
|
27
|
+
p(this, x);
|
|
28
|
+
p(this, y);
|
|
29
|
+
p(this, m);
|
|
30
|
+
a(this, u, c(this, T, "SEAT")), a(this, f, (c(this, S), c(this, P, "FREE"))), a(this, _, (c(this, R), c(this, $, []))), a(this, g, (c(this, D), c(this, N, ""))), a(this, k, (c(this, O), c(this, V, null))), a(this, x, (c(this, j), c(this, U, null))), a(this, y, (c(this, K), c(this, Y, !1))), a(this, m, (c(this, q), c(this, H, "unfocus"))), this._language = (c(this, J), new ce(this)), this.addEventListener("click", () => this._selectPlace());
|
|
34
31
|
}
|
|
35
32
|
/** placeType of the place, e.g. 'SEAT', 'BICYCLE' */
|
|
36
33
|
get placeType() {
|
|
37
|
-
return
|
|
34
|
+
return b(this, u);
|
|
38
35
|
}
|
|
39
|
-
set placeType(
|
|
40
|
-
a(this, u,
|
|
36
|
+
set placeType(t) {
|
|
37
|
+
a(this, u, t);
|
|
41
38
|
}
|
|
42
39
|
/** state of the place, e.g. 'FREE', 'SELECTED', 'BLOCKED' */
|
|
43
40
|
get state() {
|
|
44
|
-
return
|
|
41
|
+
return b(this, f);
|
|
45
42
|
}
|
|
46
|
-
set state(
|
|
47
|
-
a(this,
|
|
43
|
+
set state(t) {
|
|
44
|
+
a(this, f, t);
|
|
48
45
|
}
|
|
49
46
|
/** property ids of the place, to display more info about the place */
|
|
50
47
|
get propertyIds() {
|
|
51
|
-
return
|
|
48
|
+
return b(this, _);
|
|
52
49
|
}
|
|
53
|
-
set propertyIds(
|
|
54
|
-
a(this,
|
|
55
|
-
}
|
|
56
|
-
/** rotation in degrees (without unit) */
|
|
57
|
-
get rotation() {
|
|
58
|
-
return n(this, g);
|
|
59
|
-
}
|
|
60
|
-
set rotation(e) {
|
|
61
|
-
a(this, g, e);
|
|
62
|
-
}
|
|
63
|
-
/** width of the place in pixels (without unit) */
|
|
64
|
-
get width() {
|
|
65
|
-
return n(this, k);
|
|
66
|
-
}
|
|
67
|
-
set width(e) {
|
|
68
|
-
a(this, k, e);
|
|
69
|
-
}
|
|
70
|
-
/** height of the place in pixels (without unit) */
|
|
71
|
-
get height() {
|
|
72
|
-
return n(this, x);
|
|
73
|
-
}
|
|
74
|
-
set height(e) {
|
|
75
|
-
a(this, x, e);
|
|
50
|
+
set propertyIds(t) {
|
|
51
|
+
a(this, _, t);
|
|
76
52
|
}
|
|
77
53
|
/** label of the place, e.g. '1A', '2B' */
|
|
78
54
|
get text() {
|
|
79
|
-
return
|
|
80
|
-
}
|
|
81
|
-
set text(e) {
|
|
82
|
-
a(this, m, e);
|
|
83
|
-
}
|
|
84
|
-
/** Rotation of the text in degrees (without unit) */
|
|
85
|
-
get textRotation() {
|
|
86
|
-
return n(this, y);
|
|
55
|
+
return b(this, g);
|
|
87
56
|
}
|
|
88
|
-
set
|
|
89
|
-
a(this,
|
|
57
|
+
set text(t) {
|
|
58
|
+
a(this, g, t);
|
|
90
59
|
}
|
|
91
60
|
/** Deck Index Prop to identifier the right place to deck */
|
|
92
61
|
get deckIndex() {
|
|
93
|
-
return
|
|
62
|
+
return b(this, k);
|
|
94
63
|
}
|
|
95
|
-
set deckIndex(
|
|
96
|
-
a(this,
|
|
64
|
+
set deckIndex(t) {
|
|
65
|
+
a(this, k, t);
|
|
97
66
|
}
|
|
98
67
|
/** Coach Index Prop to identifier the right place to coach */
|
|
99
68
|
get coachIndex() {
|
|
100
|
-
return
|
|
69
|
+
return b(this, x);
|
|
101
70
|
}
|
|
102
|
-
set coachIndex(
|
|
103
|
-
a(this,
|
|
71
|
+
set coachIndex(t) {
|
|
72
|
+
a(this, x, t);
|
|
104
73
|
}
|
|
105
74
|
/** Prevent click prop prevent any place action */
|
|
106
75
|
get preventClick() {
|
|
107
|
-
return
|
|
76
|
+
return b(this, y);
|
|
108
77
|
}
|
|
109
|
-
set preventClick(
|
|
110
|
-
a(this,
|
|
78
|
+
set preventClick(t) {
|
|
79
|
+
a(this, y, t);
|
|
111
80
|
}
|
|
112
81
|
/** Set the place focus outline style */
|
|
113
82
|
get keyfocus() {
|
|
114
|
-
return
|
|
83
|
+
return b(this, m);
|
|
115
84
|
}
|
|
116
|
-
set keyfocus(
|
|
117
|
-
a(this,
|
|
85
|
+
set keyfocus(t) {
|
|
86
|
+
a(this, m, t);
|
|
118
87
|
}
|
|
119
|
-
willUpdate(
|
|
120
|
-
super.willUpdate(
|
|
88
|
+
willUpdate(t) {
|
|
89
|
+
super.willUpdate(t), t.has("keyfocus") && this.keyfocus === "focus" && this.focus();
|
|
121
90
|
}
|
|
122
91
|
render() {
|
|
123
|
-
const
|
|
124
|
-
return this.title = this._getTitleDescriptionPlace(), this.tabIndex = -1,
|
|
92
|
+
const t = this._getPlaceSvg(this.placeType, this.state), e = this.type.toLowerCase(), s = this.state.toLowerCase(), Q = this.text, Z = this.style?.getPropertyValue("--sbb-seat-reservation-place-control-width"), ee = this.style?.getPropertyValue("--sbb-seat-reservation-place-control-height"), I = this.style?.getPropertyValue("--sbb-seat-reservation-place-control-rotation"), te = this.style?.getPropertyValue("--sbb-seat-reservation-place-control-text-rotation"), se = Number(te) - Number(I), re = this.preventClick ? "sbb-reservation-place-control--disabled" : null;
|
|
93
|
+
return this.title = this._getTitleDescriptionPlace(), this.tabIndex = -1, ie`
|
|
125
94
|
<div
|
|
126
95
|
part="sbb-sr-place-part"
|
|
127
|
-
class="sbb-sr-place-ctrl sbb-sr-place-ctrl--orientation-${
|
|
96
|
+
class="sbb-sr-place-ctrl sbb-sr-place-ctrl--orientation-${I} sbb-sr-place-ctrl--state-${s} sbb-sr-place-ctrl--type-${e} ${re}"
|
|
128
97
|
>
|
|
129
98
|
<sbb-seat-reservation-graphic
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
99
|
+
style=${be({
|
|
100
|
+
"--sbb-seat-reservation-graphic-width": Z,
|
|
101
|
+
"--sbb-seat-reservation-graphic-height": ee,
|
|
102
|
+
"--sbb-seat-reservation-graphic-rotation": I,
|
|
103
|
+
"--sbb-seat-reservation-graphic-inverse-rotation": se
|
|
104
|
+
})}
|
|
105
|
+
.name=${t}
|
|
135
106
|
aria-hidden="true"
|
|
136
107
|
></sbb-seat-reservation-graphic>
|
|
137
|
-
<span ${this.text ??
|
|
138
|
-
>${
|
|
108
|
+
<span ${this.text ?? oe} class="sbb-sr-place-ctrl__text" aria-hidden="true"
|
|
109
|
+
>${Q}</span
|
|
139
110
|
>
|
|
140
111
|
</div>
|
|
141
112
|
`;
|
|
142
113
|
}
|
|
143
|
-
_getPlaceSvg(
|
|
144
|
-
return `PLACE_${
|
|
114
|
+
_getPlaceSvg(t, e) {
|
|
115
|
+
return `PLACE_${t}_${e}`;
|
|
145
116
|
}
|
|
146
117
|
_getTitleDescriptionPlace() {
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
return this.propertyIds.length && (
|
|
118
|
+
const t = "PLACE_CONTROL_" + this.type + "_" + this.state;
|
|
119
|
+
let e = E(t, this._language.current, [this.text]);
|
|
120
|
+
return this.propertyIds.length && (e += ". " + E("PLACE_PROPERTY", this._language.current).concat(": "), e += this.propertyIds.map((s) => E(s, this._language.current)).join(", ")), e;
|
|
150
121
|
}
|
|
151
122
|
/** If the place selectable, we emit the placeSelection object which contains infos to the place state */
|
|
152
123
|
_selectPlace() {
|
|
153
124
|
if ((this.state === "FREE" || this.state === "SELECTED") && !this.preventClick) {
|
|
154
125
|
this.state = this.state === "FREE" ? "SELECTED" : "FREE";
|
|
155
|
-
const
|
|
126
|
+
const e = {
|
|
156
127
|
id: this.id,
|
|
157
128
|
deckIndex: this.deckIndex,
|
|
158
129
|
coachIndex: this.coachIndex,
|
|
@@ -161,43 +132,35 @@ let Nt = (() => {
|
|
|
161
132
|
placeType: this.placeType
|
|
162
133
|
};
|
|
163
134
|
this.dispatchEvent(new CustomEvent("selectplace", {
|
|
164
|
-
detail:
|
|
135
|
+
detail: e,
|
|
165
136
|
bubbles: !0,
|
|
166
137
|
composed: !0
|
|
167
138
|
}));
|
|
168
139
|
}
|
|
169
140
|
}
|
|
170
|
-
}, u = new WeakMap(),
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
} }, metadata:
|
|
175
|
-
|
|
176
|
-
} }, metadata:
|
|
177
|
-
|
|
178
|
-
} }, metadata:
|
|
179
|
-
|
|
180
|
-
} }, metadata:
|
|
181
|
-
|
|
182
|
-
} }, metadata:
|
|
183
|
-
|
|
184
|
-
} }, metadata:
|
|
185
|
-
|
|
186
|
-
} }, metadata:
|
|
187
|
-
|
|
188
|
-
} }, metadata:
|
|
189
|
-
|
|
190
|
-
} }, metadata: e }, tt, et), p(c, null, st, { kind: "accessor", name: "coachIndex", static: !1, private: !1, access: { has: (t) => "coachIndex" in t, get: (t) => t.coachIndex, set: (t, s) => {
|
|
191
|
-
t.coachIndex = s;
|
|
192
|
-
} }, metadata: e }, at, rt), p(c, null, ct, { kind: "accessor", name: "preventClick", static: !1, private: !1, access: { has: (t) => "preventClick" in t, get: (t) => t.preventClick, set: (t, s) => {
|
|
193
|
-
t.preventClick = s;
|
|
194
|
-
} }, metadata: e }, lt, ot), p(c, null, it, { kind: "accessor", name: "keyfocus", static: !1, private: !1, access: { has: (t) => "keyfocus" in t, get: (t) => t.keyfocus, set: (t, s) => {
|
|
195
|
-
t.keyfocus = s;
|
|
196
|
-
} }, metadata: e }, nt, bt), p(null, o = { value: v }, l, { kind: "class", name: v.name, metadata: e }, null, i), v = o.value, e && Object.defineProperty(v, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
197
|
-
})(), c.styles = zt, c.events = {
|
|
141
|
+
}, u = new WeakMap(), f = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), k = new WeakMap(), x = new WeakMap(), y = new WeakMap(), m = new WeakMap(), n = l, (() => {
|
|
142
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(C[Symbol.metadata] ?? null) : void 0;
|
|
143
|
+
z = [h(), v({ attribute: "type" })], w = [h(), v({ attribute: "state" })], L = [v({ attribute: "propertyIds", type: Array })], A = [h(), v({ attribute: "text" })], F = [h(), v({ attribute: "deck-index", type: Number })], B = [h(), v({ attribute: "coach-index", type: Number })], M = [h(), v({ attribute: "prevent-click", type: Boolean })], G = [h(), v({ attribute: "keyfocus" })], d(l, null, z, { kind: "accessor", name: "placeType", static: !1, private: !1, access: { has: (e) => "placeType" in e, get: (e) => e.placeType, set: (e, s) => {
|
|
144
|
+
e.placeType = s;
|
|
145
|
+
} }, metadata: t }, T, S), d(l, null, w, { kind: "accessor", name: "state", static: !1, private: !1, access: { has: (e) => "state" in e, get: (e) => e.state, set: (e, s) => {
|
|
146
|
+
e.state = s;
|
|
147
|
+
} }, metadata: t }, P, R), d(l, null, L, { kind: "accessor", name: "propertyIds", static: !1, private: !1, access: { has: (e) => "propertyIds" in e, get: (e) => e.propertyIds, set: (e, s) => {
|
|
148
|
+
e.propertyIds = s;
|
|
149
|
+
} }, metadata: t }, $, D), d(l, null, A, { kind: "accessor", name: "text", static: !1, private: !1, access: { has: (e) => "text" in e, get: (e) => e.text, set: (e, s) => {
|
|
150
|
+
e.text = s;
|
|
151
|
+
} }, metadata: t }, N, O), d(l, null, F, { kind: "accessor", name: "deckIndex", static: !1, private: !1, access: { has: (e) => "deckIndex" in e, get: (e) => e.deckIndex, set: (e, s) => {
|
|
152
|
+
e.deckIndex = s;
|
|
153
|
+
} }, metadata: t }, V, j), d(l, null, B, { kind: "accessor", name: "coachIndex", static: !1, private: !1, access: { has: (e) => "coachIndex" in e, get: (e) => e.coachIndex, set: (e, s) => {
|
|
154
|
+
e.coachIndex = s;
|
|
155
|
+
} }, metadata: t }, U, K), d(l, null, M, { kind: "accessor", name: "preventClick", static: !1, private: !1, access: { has: (e) => "preventClick" in e, get: (e) => e.preventClick, set: (e, s) => {
|
|
156
|
+
e.preventClick = s;
|
|
157
|
+
} }, metadata: t }, Y, q), d(l, null, G, { kind: "accessor", name: "keyfocus", static: !1, private: !1, access: { has: (e) => "keyfocus" in e, get: (e) => e.keyfocus, set: (e, s) => {
|
|
158
|
+
e.keyfocus = s;
|
|
159
|
+
} }, metadata: t }, H, J), d(null, o = { value: n }, r, { kind: "class", name: n.name, metadata: t }, null, i), n = o.value, t && Object.defineProperty(n, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
160
|
+
})(), l.styles = pe, l.events = {
|
|
198
161
|
selectplace: "selectplace"
|
|
199
|
-
},
|
|
162
|
+
}, c(n, i), n;
|
|
200
163
|
})();
|
|
201
164
|
export {
|
|
202
|
-
|
|
165
|
+
Ie as SbbSeatReservationPlaceControlElement
|
|
203
166
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __esDecorate as i, __runInitializers as c } from "tslib";
|
|
2
2
|
import { css as n, LitElement as b, html as m } from "lit";
|
|
3
3
|
import { customElement as d } from "lit/decorators.js";
|
|
4
|
-
const p = n`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-scoped-width: 0;--sbb-seat-reservation-scoped-height: 0;display:block
|
|
4
|
+
const p = n`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-scoped-width: 0;--sbb-seat-reservation-scoped-height: 0;display:block;width:calc(var(--sbb-seat-reservation-scoped-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:calc(var(--sbb-seat-reservation-scoped-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem))}`;
|
|
5
5
|
let f = (() => {
|
|
6
6
|
var t;
|
|
7
7
|
let l = [d("sbb-seat-reservation-scoped")], a, r = [], e, o = b;
|
|
8
8
|
return t = class extends o {
|
|
9
9
|
render() {
|
|
10
|
-
return m`<
|
|
10
|
+
return m`<slot></slot>`;
|
|
11
11
|
}
|
|
12
12
|
}, e = t, (() => {
|
|
13
13
|
const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|