@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
package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var dt = (l) => {
|
|
2
|
+
throw TypeError(l);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var n = (
|
|
6
|
-
import { __esDecorate as p, __runInitializers as
|
|
7
|
-
import { SbbButtonBaseElement as
|
|
8
|
-
import { SbbLanguageController as
|
|
9
|
-
import { forceType as
|
|
10
|
-
import { css as
|
|
11
|
-
import { customElement as
|
|
12
|
-
import { getI18nSeatReservation as
|
|
4
|
+
var ht = (l, o, i) => o.has(l) || dt("Cannot " + i);
|
|
5
|
+
var n = (l, o, i) => (ht(l, o, "read from private field"), i ? i.call(l) : o.get(l)), b = (l, o, i) => o.has(l) ? dt("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(l) : o.set(l, i), a = (l, o, i, v) => (ht(l, o, "write to private field"), v ? v.call(l, i) : o.set(l, i), i);
|
|
6
|
+
import { __esDecorate as p, __runInitializers as r } from "tslib";
|
|
7
|
+
import { SbbButtonBaseElement as gt } from "@sbb-esta/lyne-elements/core/base-elements.js";
|
|
8
|
+
import { SbbLanguageController as kt } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
9
|
+
import { forceType as h } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
10
|
+
import { css as xt, nothing as mt, html as yt } from "lit";
|
|
11
|
+
import { customElement as It, property as d } from "lit/decorators.js";
|
|
12
|
+
import { getI18nSeatReservation as C } from "../common.js";
|
|
13
13
|
import "../seat-reservation-graphic.js";
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
var u, _, f, g, k, x,
|
|
17
|
-
let
|
|
18
|
-
return c = class extends
|
|
14
|
+
const zt = xt`*,:before,:after{box-sizing:border-box}:host{--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-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%}`;
|
|
15
|
+
let Nt = (() => {
|
|
16
|
+
var u, _, f, g, k, x, m, y, I, z, w, E, c;
|
|
17
|
+
let l = [It("sbb-seat-reservation-place-control")], o, i = [], v, R = gt, T, S = [], $ = [], P, L = [], D = [], N, A = [], O = [], F, j = [], B = [], U, K = [], M = [], Y, q = [], G = [], H, J = [], Q = [], V, W = [], X = [], Z, tt = [], et = [], st, at = [], rt = [], ct, lt = [], ot = [], it, nt = [], bt = [];
|
|
18
|
+
return c = class extends R {
|
|
19
19
|
constructor() {
|
|
20
20
|
super();
|
|
21
21
|
b(this, u);
|
|
@@ -24,110 +24,118 @@ let $t = (() => {
|
|
|
24
24
|
b(this, g);
|
|
25
25
|
b(this, k);
|
|
26
26
|
b(this, x);
|
|
27
|
-
b(this, y);
|
|
28
27
|
b(this, m);
|
|
28
|
+
b(this, y);
|
|
29
29
|
b(this, I);
|
|
30
30
|
b(this, z);
|
|
31
31
|
b(this, w);
|
|
32
|
-
|
|
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());
|
|
33
34
|
}
|
|
34
35
|
/** placeType of the place, e.g. 'SEAT', 'BICYCLE' */
|
|
35
36
|
get placeType() {
|
|
36
37
|
return n(this, u);
|
|
37
38
|
}
|
|
38
39
|
set placeType(e) {
|
|
39
|
-
|
|
40
|
+
a(this, u, e);
|
|
40
41
|
}
|
|
41
42
|
/** state of the place, e.g. 'FREE', 'SELECTED', 'BLOCKED' */
|
|
42
43
|
get state() {
|
|
43
44
|
return n(this, _);
|
|
44
45
|
}
|
|
45
46
|
set state(e) {
|
|
46
|
-
|
|
47
|
+
a(this, _, e);
|
|
47
48
|
}
|
|
48
49
|
/** property ids of the place, to display more info about the place */
|
|
49
50
|
get propertyIds() {
|
|
50
51
|
return n(this, f);
|
|
51
52
|
}
|
|
52
53
|
set propertyIds(e) {
|
|
53
|
-
|
|
54
|
+
a(this, f, e);
|
|
54
55
|
}
|
|
55
56
|
/** rotation in degrees (without unit) */
|
|
56
57
|
get rotation() {
|
|
57
58
|
return n(this, g);
|
|
58
59
|
}
|
|
59
60
|
set rotation(e) {
|
|
60
|
-
|
|
61
|
+
a(this, g, e);
|
|
61
62
|
}
|
|
62
63
|
/** width of the place in pixels (without unit) */
|
|
63
64
|
get width() {
|
|
64
65
|
return n(this, k);
|
|
65
66
|
}
|
|
66
67
|
set width(e) {
|
|
67
|
-
|
|
68
|
+
a(this, k, e);
|
|
68
69
|
}
|
|
69
70
|
/** height of the place in pixels (without unit) */
|
|
70
71
|
get height() {
|
|
71
72
|
return n(this, x);
|
|
72
73
|
}
|
|
73
74
|
set height(e) {
|
|
74
|
-
|
|
75
|
+
a(this, x, e);
|
|
75
76
|
}
|
|
76
77
|
/** label of the place, e.g. '1A', '2B' */
|
|
77
78
|
get text() {
|
|
78
|
-
return n(this,
|
|
79
|
+
return n(this, m);
|
|
79
80
|
}
|
|
80
81
|
set text(e) {
|
|
81
|
-
|
|
82
|
+
a(this, m, e);
|
|
82
83
|
}
|
|
83
84
|
/** Rotation of the text in degrees (without unit) */
|
|
84
85
|
get textRotation() {
|
|
85
|
-
return n(this,
|
|
86
|
+
return n(this, y);
|
|
86
87
|
}
|
|
87
88
|
set textRotation(e) {
|
|
88
|
-
|
|
89
|
+
a(this, y, e);
|
|
90
|
+
}
|
|
91
|
+
/** Deck Index Prop to identifier the right place to deck */
|
|
92
|
+
get deckIndex() {
|
|
93
|
+
return n(this, I);
|
|
94
|
+
}
|
|
95
|
+
set deckIndex(e) {
|
|
96
|
+
a(this, I, e);
|
|
89
97
|
}
|
|
90
98
|
/** Coach Index Prop to identifier the right place to coach */
|
|
91
99
|
get coachIndex() {
|
|
92
|
-
return n(this,
|
|
100
|
+
return n(this, z);
|
|
93
101
|
}
|
|
94
102
|
set coachIndex(e) {
|
|
95
|
-
|
|
103
|
+
a(this, z, e);
|
|
96
104
|
}
|
|
97
105
|
/** Prevent click prop prevent any place action */
|
|
98
106
|
get preventClick() {
|
|
99
|
-
return n(this,
|
|
107
|
+
return n(this, w);
|
|
100
108
|
}
|
|
101
109
|
set preventClick(e) {
|
|
102
|
-
|
|
110
|
+
a(this, w, e);
|
|
103
111
|
}
|
|
104
112
|
/** Set the place focus outline style */
|
|
105
113
|
get keyfocus() {
|
|
106
|
-
return n(this,
|
|
114
|
+
return n(this, E);
|
|
107
115
|
}
|
|
108
116
|
set keyfocus(e) {
|
|
109
|
-
|
|
117
|
+
a(this, E, e);
|
|
110
118
|
}
|
|
111
119
|
willUpdate(e) {
|
|
112
|
-
super.willUpdate(e), (e.has("width") || e.has("height")) && this.style?.setProperty("--sbb-place-control-text-scale-value", `${Math.min(this.width, this.height)}`), e.has("textRotation") && this.style?.setProperty("--sbb-reservation-place-control-text-rotation", `${this.textRotation}`), e.has("rotation") && this.style?.setProperty("--sbb-reservation-place-control-rotation", `${this.rotation}`), e.has("keyfocus") && this.keyfocus === "focus" && this.focus();
|
|
120
|
+
super.willUpdate(e), (e.has("width") || e.has("height")) && this.style?.setProperty("--sbb-place-control-text-scale-value", `${Math.min(this.width, this.height)}`), e.has("textRotation") && this.style?.setProperty("--sbb-seat-reservation-place-control-text-rotation", `${this.textRotation}`), e.has("rotation") && this.style?.setProperty("--sbb-seat-reservation-place-control-rotation", `${this.rotation}`), e.has("keyfocus") && this.keyfocus === "focus" && this.focus();
|
|
113
121
|
}
|
|
114
122
|
render() {
|
|
115
|
-
const e = this._getPlaceSvg(this.placeType, this.state), t = this.type.toLowerCase(), s = this.state.toLowerCase(),
|
|
116
|
-
return this.title = this._getTitleDescriptionPlace(), this.tabIndex = -1,
|
|
123
|
+
const e = this._getPlaceSvg(this.placeType, this.state), t = this.type.toLowerCase(), s = this.state.toLowerCase(), pt = this.text, vt = this.width, ut = this.height, _t = this.textRotation - this.rotation, ft = this.preventClick ? "sbb-reservation-place-control--disabled" : null;
|
|
124
|
+
return this.title = this._getTitleDescriptionPlace(), this.tabIndex = -1, yt`
|
|
117
125
|
<div
|
|
118
126
|
part="sbb-sr-place-part"
|
|
119
|
-
class="sbb-sr-place-ctrl sbb-sr-place-ctrl--orientation-${this.rotation} sbb-sr-place-ctrl--state-${s} sbb-sr-place-ctrl--type-${t} ${
|
|
127
|
+
class="sbb-sr-place-ctrl sbb-sr-place-ctrl--orientation-${this.rotation} sbb-sr-place-ctrl--state-${s} sbb-sr-place-ctrl--type-${t} ${ft}"
|
|
120
128
|
>
|
|
121
129
|
<sbb-seat-reservation-graphic
|
|
122
130
|
.name=${e}
|
|
123
|
-
.width=${
|
|
124
|
-
.height=${
|
|
131
|
+
.width=${vt}
|
|
132
|
+
.height=${ut}
|
|
125
133
|
.rotation=${this.rotation}
|
|
126
|
-
.inverseRotation=${
|
|
134
|
+
.inverseRotation=${_t}
|
|
127
135
|
aria-hidden="true"
|
|
128
136
|
></sbb-seat-reservation-graphic>
|
|
129
|
-
<span ${this.text ??
|
|
130
|
-
>${
|
|
137
|
+
<span ${this.text ?? mt} class="sbb-sr-place-ctrl__text" aria-hidden="true"
|
|
138
|
+
>${pt}</span
|
|
131
139
|
>
|
|
132
140
|
</div>
|
|
133
141
|
`;
|
|
@@ -137,8 +145,8 @@ let $t = (() => {
|
|
|
137
145
|
}
|
|
138
146
|
_getTitleDescriptionPlace() {
|
|
139
147
|
const e = "PLACE_CONTROL_" + this.type + "_" + this.state;
|
|
140
|
-
let t =
|
|
141
|
-
return this.propertyIds.length && (t += ". " +
|
|
148
|
+
let t = C(e, this._language.current, [this.text]);
|
|
149
|
+
return this.propertyIds.length && (t += ". " + C("PLACE_PROPERTY", this._language.current).concat(": "), t += this.propertyIds.map((s) => C(s, this._language.current)).join(", ")), t;
|
|
142
150
|
}
|
|
143
151
|
/** If the place selectable, we emit the placeSelection object which contains infos to the place state */
|
|
144
152
|
_selectPlace() {
|
|
@@ -146,9 +154,11 @@ let $t = (() => {
|
|
|
146
154
|
this.state = this.state === "FREE" ? "SELECTED" : "FREE";
|
|
147
155
|
const t = {
|
|
148
156
|
id: this.id,
|
|
157
|
+
deckIndex: this.deckIndex,
|
|
149
158
|
coachIndex: this.coachIndex,
|
|
150
159
|
number: this.text,
|
|
151
|
-
state: this.state
|
|
160
|
+
state: this.state,
|
|
161
|
+
placeType: this.placeType
|
|
152
162
|
};
|
|
153
163
|
this.dispatchEvent(new CustomEvent("selectplace", {
|
|
154
164
|
detail: t,
|
|
@@ -157,35 +167,37 @@ let $t = (() => {
|
|
|
157
167
|
}));
|
|
158
168
|
}
|
|
159
169
|
}
|
|
160
|
-
}, u = new WeakMap(), _ = new WeakMap(), f = new WeakMap(), g = new WeakMap(), k = new WeakMap(), x = new WeakMap(),
|
|
161
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
162
|
-
|
|
170
|
+
}, u = new WeakMap(), _ = new WeakMap(), f = new WeakMap(), g = new WeakMap(), k = new WeakMap(), x = new WeakMap(), m = new WeakMap(), y = new WeakMap(), I = new WeakMap(), z = new WeakMap(), w = new WeakMap(), E = new WeakMap(), v = c, (() => {
|
|
171
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(R[Symbol.metadata] ?? null) : void 0;
|
|
172
|
+
T = [h(), d({ attribute: "type" })], P = [h(), d({ attribute: "state" })], N = [d({ attribute: "propertyIds", type: Array })], F = [h(), d({ attribute: "rotation", type: Number })], U = [h(), d({ attribute: "width", type: Number })], Y = [h(), d({ attribute: "height", type: Number })], H = [h(), d({ attribute: "text" })], V = [h(), d({ attribute: "text-rotation" })], Z = [h(), d({ attribute: "deck-index", type: Number })], st = [h(), d({ attribute: "coach-index", type: Number })], ct = [h(), d({ attribute: "prevent-click", type: Boolean })], it = [h(), d({ attribute: "keyfocus" })], p(c, null, T, { kind: "accessor", name: "placeType", static: !1, private: !1, access: { has: (t) => "placeType" in t, get: (t) => t.placeType, set: (t, s) => {
|
|
163
173
|
t.placeType = s;
|
|
164
|
-
} }, metadata: e }, S,
|
|
174
|
+
} }, metadata: e }, S, $), p(c, null, P, { kind: "accessor", name: "state", static: !1, private: !1, access: { has: (t) => "state" in t, get: (t) => t.state, set: (t, s) => {
|
|
165
175
|
t.state = s;
|
|
166
|
-
} }, metadata: e },
|
|
176
|
+
} }, metadata: e }, L, D), p(c, null, N, { kind: "accessor", name: "propertyIds", static: !1, private: !1, access: { has: (t) => "propertyIds" in t, get: (t) => t.propertyIds, set: (t, s) => {
|
|
167
177
|
t.propertyIds = s;
|
|
168
|
-
} }, metadata: e }, A,
|
|
178
|
+
} }, metadata: e }, A, O), p(c, null, F, { kind: "accessor", name: "rotation", static: !1, private: !1, access: { has: (t) => "rotation" in t, get: (t) => t.rotation, set: (t, s) => {
|
|
169
179
|
t.rotation = s;
|
|
170
|
-
} }, metadata: e },
|
|
180
|
+
} }, metadata: e }, j, B), p(c, null, U, { kind: "accessor", name: "width", static: !1, private: !1, access: { has: (t) => "width" in t, get: (t) => t.width, set: (t, s) => {
|
|
171
181
|
t.width = s;
|
|
172
|
-
} }, metadata: e },
|
|
182
|
+
} }, metadata: e }, K, M), p(c, null, Y, { kind: "accessor", name: "height", static: !1, private: !1, access: { has: (t) => "height" in t, get: (t) => t.height, set: (t, s) => {
|
|
173
183
|
t.height = s;
|
|
174
|
-
} }, metadata: e },
|
|
184
|
+
} }, metadata: e }, q, G), p(c, null, H, { kind: "accessor", name: "text", static: !1, private: !1, access: { has: (t) => "text" in t, get: (t) => t.text, set: (t, s) => {
|
|
175
185
|
t.text = s;
|
|
176
|
-
} }, metadata: e },
|
|
186
|
+
} }, metadata: e }, J, Q), p(c, null, V, { kind: "accessor", name: "textRotation", static: !1, private: !1, access: { has: (t) => "textRotation" in t, get: (t) => t.textRotation, set: (t, s) => {
|
|
177
187
|
t.textRotation = s;
|
|
178
|
-
} }, metadata: e },
|
|
188
|
+
} }, metadata: e }, W, X), p(c, null, Z, { kind: "accessor", name: "deckIndex", static: !1, private: !1, access: { has: (t) => "deckIndex" in t, get: (t) => t.deckIndex, set: (t, s) => {
|
|
189
|
+
t.deckIndex = s;
|
|
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) => {
|
|
179
191
|
t.coachIndex = s;
|
|
180
|
-
} }, metadata: e },
|
|
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) => {
|
|
181
193
|
t.preventClick = s;
|
|
182
|
-
} }, metadata: e },
|
|
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) => {
|
|
183
195
|
t.keyfocus = s;
|
|
184
|
-
} }, metadata: e },
|
|
185
|
-
})(), c.styles =
|
|
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 = {
|
|
186
198
|
selectplace: "selectplace"
|
|
187
|
-
},
|
|
199
|
+
}, r(v, i), v;
|
|
188
200
|
})();
|
|
189
201
|
export {
|
|
190
|
-
|
|
202
|
+
Nt as SbbSeatReservationPlaceControlElement
|
|
191
203
|
};
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import { CSSResultGroup,
|
|
1
|
+
import { CSSResultGroup, TemplateResult, LitElement } from 'lit';
|
|
2
2
|
/**
|
|
3
3
|
* Wrapper class for scoped elements with similar properties to set.
|
|
4
4
|
*/
|
|
5
5
|
export declare class SbbSeatReservationScopedElement extends LitElement {
|
|
6
6
|
static styles: CSSResultGroup;
|
|
7
|
-
/** Inset block start in pixels (without unit) */
|
|
8
|
-
accessor insetBlockStart: string;
|
|
9
|
-
/** Inset inline start in pixels (without unit) */
|
|
10
|
-
accessor insetInlineStart: string;
|
|
11
|
-
/** Width of the scoped element in pixels (without unit) */
|
|
12
|
-
accessor width: string;
|
|
13
|
-
/** Height of the scoped element in pixels (without unit) */
|
|
14
|
-
accessor height: string;
|
|
15
|
-
/** Z-index of the scoped element */
|
|
16
|
-
accessor zIndex: string;
|
|
17
|
-
/** Cell id of the scoped element, if it is used in a table */
|
|
18
|
-
accessor cellId: string;
|
|
19
|
-
/** Scoped classes for the scoped element */
|
|
20
|
-
accessor scopedClasses: string;
|
|
21
|
-
protected willUpdate(_changedProperties: PropertyValues): void;
|
|
22
7
|
protected render(): TemplateResult;
|
|
23
8
|
}
|
|
24
9
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-reservation-scoped.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seat-reservation-scoped.component.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAC/D,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC;;GAEG;AACH,qBAEM,+BAAgC,SAAQ,UAAU;IACtD,OAAuB,MAAM,EAAE,cAAc,CAAS;cAEnC,MAAM,IAAI,cAAc;CAG5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,6BAA6B,EAAE,+BAA+B,CAAC;KAChE;CACF"}
|
|
@@ -1,106 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { customElement as V, property as b } from "lit/decorators.js";
|
|
10
|
-
const W = N`*,:before,:after{box-sizing:border-box}:host{display:block}:host .coach-border,:host .coach-wrapper,:host .graphical-element{width:var(--sbb-seat-reservation-scoped-width);height:var(--sbb-seat-reservation-scoped-height);inset-block-start:var(--sbb-seat-reservation-scoped-inset-block-start);inset-inline-start:var(--sbb-seat-reservation-scoped-inset-inline-start);z-index:var(--sbb-seat-reservation-scoped-z-index)}:host .coach-border,:host .graphical-element ::slotted(*),:host .graphical-element{position:absolute}:host .coach-border{z-index:0}`;
|
|
11
|
-
let it = (() => {
|
|
12
|
-
var I, u, m, g, z, f, S, r;
|
|
13
|
-
let s = [V("sbb-seat-reservation-scoped")], i, l = [], c, v = Q, x, k = [], y = [], w, B = [], C = [], $, E = [], D = [], j, O = [], T = [], U, L = [], P = [], R, q = [], A = [], F, G = [], H = [];
|
|
14
|
-
return r = class extends v {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
h(this, I, a(this, k, ""));
|
|
18
|
-
h(this, u, (a(this, y), a(this, B, "")));
|
|
19
|
-
h(this, m, (a(this, C), a(this, E, "")));
|
|
20
|
-
h(this, g, (a(this, D), a(this, O, "")));
|
|
21
|
-
h(this, z, (a(this, T), a(this, L, "")));
|
|
22
|
-
h(this, f, (a(this, P), a(this, q, "")));
|
|
23
|
-
h(this, S, (a(this, A), a(this, G, "")));
|
|
24
|
-
a(this, H);
|
|
25
|
-
}
|
|
26
|
-
/** Inset block start in pixels (without unit) */
|
|
27
|
-
get insetBlockStart() {
|
|
28
|
-
return o(this, I);
|
|
29
|
-
}
|
|
30
|
-
set insetBlockStart(e) {
|
|
31
|
-
d(this, I, e);
|
|
32
|
-
}
|
|
33
|
-
/** Inset inline start in pixels (without unit) */
|
|
34
|
-
get insetInlineStart() {
|
|
35
|
-
return o(this, u);
|
|
36
|
-
}
|
|
37
|
-
set insetInlineStart(e) {
|
|
38
|
-
d(this, u, e);
|
|
39
|
-
}
|
|
40
|
-
/** Width of the scoped element in pixels (without unit) */
|
|
41
|
-
get width() {
|
|
42
|
-
return o(this, m);
|
|
43
|
-
}
|
|
44
|
-
set width(e) {
|
|
45
|
-
d(this, m, e);
|
|
46
|
-
}
|
|
47
|
-
/** Height of the scoped element in pixels (without unit) */
|
|
48
|
-
get height() {
|
|
49
|
-
return o(this, g);
|
|
50
|
-
}
|
|
51
|
-
set height(e) {
|
|
52
|
-
d(this, g, e);
|
|
53
|
-
}
|
|
54
|
-
/** Z-index of the scoped element */
|
|
55
|
-
get zIndex() {
|
|
56
|
-
return o(this, z);
|
|
57
|
-
}
|
|
58
|
-
set zIndex(e) {
|
|
59
|
-
d(this, z, e);
|
|
60
|
-
}
|
|
61
|
-
/** Cell id of the scoped element, if it is used in a table */
|
|
62
|
-
get cellId() {
|
|
63
|
-
return o(this, f);
|
|
64
|
-
}
|
|
65
|
-
set cellId(e) {
|
|
66
|
-
d(this, f, e);
|
|
67
|
-
}
|
|
68
|
-
/** Scoped classes for the scoped element */
|
|
69
|
-
get scopedClasses() {
|
|
70
|
-
return o(this, S);
|
|
71
|
-
}
|
|
72
|
-
set scopedClasses(e) {
|
|
73
|
-
d(this, S, e);
|
|
74
|
-
}
|
|
75
|
-
willUpdate(e) {
|
|
76
|
-
super.willUpdate(e), e.has("width") && this.style?.setProperty("--sbb-seat-reservation-scoped-width", `${this.width}`), e.has("height") && this.style?.setProperty("--sbb-seat-reservation-scoped-height", `${this.height}`), e.has("insetBlockStart") && this.style?.setProperty("--sbb-seat-reservation-scoped-inset-block-start", `${this.insetBlockStart}`), e.has("insetInlineStart") && this.style?.setProperty("--sbb-seat-reservation-scoped-inset-inline-start", `${this.insetInlineStart}`), e.has("zIndex") && this.style?.setProperty("--sbb-seat-reservation-scoped-z-index", `${this.zIndex}`);
|
|
77
|
-
}
|
|
1
|
+
import { __esDecorate as i, __runInitializers as c } from "tslib";
|
|
2
|
+
import { css as n, LitElement as b, html as m } from "lit";
|
|
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}:host .scoped-element{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
|
+
let f = (() => {
|
|
6
|
+
var t;
|
|
7
|
+
let l = [d("sbb-seat-reservation-scoped")], a, r = [], e, o = b;
|
|
8
|
+
return t = class extends o {
|
|
78
9
|
render() {
|
|
79
|
-
return
|
|
80
|
-
<slot></slot>
|
|
81
|
-
</td>` : M`<div class="${this.scopedClasses}">
|
|
82
|
-
<slot></slot>
|
|
83
|
-
</div>`;
|
|
10
|
+
return m`<div class="scoped-element"><slot></slot></div>`;
|
|
84
11
|
}
|
|
85
|
-
},
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} }, metadata: e }, k, y), _(r, null, w, { kind: "accessor", name: "insetInlineStart", static: !1, private: !1, access: { has: (t) => "insetInlineStart" in t, get: (t) => t.insetInlineStart, set: (t, n) => {
|
|
90
|
-
t.insetInlineStart = n;
|
|
91
|
-
} }, metadata: e }, B, C), _(r, null, $, { kind: "accessor", name: "width", static: !1, private: !1, access: { has: (t) => "width" in t, get: (t) => t.width, set: (t, n) => {
|
|
92
|
-
t.width = n;
|
|
93
|
-
} }, metadata: e }, E, D), _(r, null, j, { kind: "accessor", name: "height", static: !1, private: !1, access: { has: (t) => "height" in t, get: (t) => t.height, set: (t, n) => {
|
|
94
|
-
t.height = n;
|
|
95
|
-
} }, metadata: e }, O, T), _(r, null, U, { kind: "accessor", name: "zIndex", static: !1, private: !1, access: { has: (t) => "zIndex" in t, get: (t) => t.zIndex, set: (t, n) => {
|
|
96
|
-
t.zIndex = n;
|
|
97
|
-
} }, metadata: e }, L, P), _(r, null, R, { kind: "accessor", name: "cellId", static: !1, private: !1, access: { has: (t) => "cellId" in t, get: (t) => t.cellId, set: (t, n) => {
|
|
98
|
-
t.cellId = n;
|
|
99
|
-
} }, metadata: e }, q, A), _(r, null, F, { kind: "accessor", name: "scopedClasses", static: !1, private: !1, access: { has: (t) => "scopedClasses" in t, get: (t) => t.scopedClasses, set: (t, n) => {
|
|
100
|
-
t.scopedClasses = n;
|
|
101
|
-
} }, metadata: e }, G, H), _(null, i = { value: c }, s, { kind: "class", name: c.name, metadata: e }, null, l), c = i.value, e && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
102
|
-
})(), r.styles = W, a(c, l), c;
|
|
12
|
+
}, e = t, (() => {
|
|
13
|
+
const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|
|
14
|
+
i(null, a = { value: e }, l, { kind: "class", name: e.name, metadata: s }, null, r), e = a.value, s && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s });
|
|
15
|
+
})(), t.styles = p, c(e, r), e;
|
|
103
16
|
})();
|
|
104
17
|
export {
|
|
105
|
-
|
|
18
|
+
f as SbbSeatReservationScopedElement
|
|
106
19
|
};
|