@sbb-esta/lyne-elements-experimental 2.11.1 → 2.11.2
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/core/datetime/date-helper.js +142 -142
- package/core/timetable/access-leg-helper.js +49 -52
- package/core/timetable/timetable-helper.js +7 -8
- package/development/core/datetime/date-helper.js +10 -10
- package/development/core/timetable/access-leg-helper.js +12 -15
- package/development/core/timetable/timetable-helper.js +6 -7
- package/development/{differenceInMinutes-CHSyWiQs.js → differenceInMinutes-D5Nj8Stc.js} +3 -3
- package/development/{format-D0-yhzi4.js → format-BQfaa1ZT.js} +22 -26
- package/development/{isValid-Bo4R7iA7.js → isValid-DvieCZVi.js} +3 -3
- package/development/journey-summary/journey-summary.component.js +4 -5
- package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/development/pearl-chain/pearl-chain.component.js +28 -39
- package/development/pearl-chain-time/pearl-chain-time.component.js +5 -6
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
- package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
- package/development/seat-reservation/common/mapper/mapper.js +14 -16
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
- package/development/seat-reservation/common/svgs.js +1 -1
- package/development/seat-reservation/common/translations/i18n.js +2 -3
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +22 -33
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +6 -7
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +16 -23
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +2 -3
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +7 -8
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +7 -11
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -3
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +4 -5
- package/development/timetable-duration/timetable-duration.component.js +1 -1
- package/development/timetable-row/timetable-row.component.js +58 -89
- package/differenceInMinutes-CP_C5onR.js +23 -0
- package/{format-Dg8rkk7h.js → format-lqeCzmzS.js} +438 -442
- package/isValid-Ceq2O0NQ.js +45 -0
- package/journey-summary/journey-summary.component.js +3 -4
- package/package.json +2 -2
- package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/pearl-chain/pearl-chain.component.js +78 -95
- package/pearl-chain-time/pearl-chain-time.component.js +44 -45
- package/seat-reservation/common/mapper/mapper.js +50 -54
- package/seat-reservation/common/translations/i18n.js +5 -6
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +104 -115
- package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +40 -41
- package/seat-reservation/seat-reservation/seat-reservation.component.js +78 -87
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +15 -18
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +58 -59
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +71 -75
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +12 -13
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +23 -24
- package/timetable-row/timetable-row.component.js +207 -247
- package/differenceInMinutes-BMqUZdhj.js +0 -23
- package/isValid-DJ69OMZJ.js +0 -45
package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js
CHANGED
|
@@ -10,13 +10,13 @@ import { forceType as v } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
|
10
10
|
import { EventEmitter as ft } from "@sbb-esta/lyne-elements/core/eventing.js";
|
|
11
11
|
import { css as gt, nothing as kt, html as xt } from "lit";
|
|
12
12
|
import { customElement as yt, property as d } from "lit/decorators.js";
|
|
13
|
-
import { getI18nSeatReservation as
|
|
13
|
+
import { getI18nSeatReservation as C } from "../common.js";
|
|
14
14
|
import "../seat-reservation-graphic.js";
|
|
15
15
|
const mt = gt`*,:before,:after{box-sizing:border-box}:host{--sbb-reservation-place-control-rotation: 0;--sbb-reservation-place-control-text-rotation: 0;--sbb-reservation-place-control-text-size: calc( var(--sbb-place-control-text-scale-value, 1) * .5 );--sbb-reservation-place-control-default-text: var(--sbb-color-black);--sbb-reservation-place-control-hover-text: var(--sbb-color-iron);--sbb-reservation-place-control-focus-text: var(--sbb-color-anthracite);--sbb-reservation-place-control-allocated-text: var(--sbb-color-smoke);--sbb-reservation-place-control-free-background-default: var(--sbb-color-white);--sbb-reservation-place-control-free-background-hover: var(--sbb-color-cloud);--sbb-reservation-place-control-free-background-focus: var(--sbb-color-silver);--sbb-reservation-place-control-free-backrest-background-default: var(--sbb-color-black);--sbb-reservation-place-control-free-backrest-background-hover: var(--sbb-color-black);--sbb-reservation-place-control-free-backrest-background-focus: var(--sbb-color-black);--sbb-reservation-place-control-selected-background-default: var(--sbb-color-red);--sbb-reservation-place-control-selected-background-hover: var(--sbb-color-red125);--sbb-reservation-place-control-selected-background-focus: var(--sbb-color-red150);--sbb-reservation-place-control-selected-backrest-background-default: var(--sbb-color-red150);--sbb-reservation-place-control-selected-backrest-background-hover: #7d000f;--sbb-reservation-place-control-selected-backrest-background-focus: #5a000b;--sbb-reservation-place-control-allocated-background-default: var(--sbb-color-milk);cursor:pointer}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-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-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-reservation-place-control-free-background-hover);color:var(--sbb-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-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-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-reservation-place-control-selected-background-hover);color:var(--sbb-reservation-place-control-selected-text)}:host(:focus){border-radius:var(--sbb-border-width-1x);outline:var(--sbb-border-width-2x) 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-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-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-reservation-place-control-free-background-focus);color:var(--sbb-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-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-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-reservation-place-control-selected-background-focus);color:var(--sbb-reservation-place-control-selected-text)}.sbb-sr-place-ctrl{width:max-content;position:relative;font-size:calc(var(--sbb-reservation-place-control-text-size) * .0625rem)}.sbb-sr-place-ctrl--state-free ::part(svg-place){fill:var(--sbb-reservation-place-control-free-background-default)}.sbb-sr-place-ctrl--state-free ::part(svg-backrest){fill:var(--sbb-reservation-place-control-free-backrest-background-default)}.sbb-sr-place-ctrl--state-free .sbb-sr-place-ctrl__text{background-color:var(--sbb-reservation-place-control-free-background-default);color:var(--sbb-reservation-place-control-free-text)}.sbb-sr-place-ctrl--state-selected ::part(svg-place){fill:var(--sbb-reservation-place-control-selected-background-default)}.sbb-sr-place-ctrl--state-selected ::part(svg-backrest){fill:var(--sbb-reservation-place-control-selected-backrest-background-default)}.sbb-sr-place-ctrl--state-selected .sbb-sr-place-ctrl__text{background-color:var(--sbb-reservation-place-control-selected-background-default);color:var(--sbb-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-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-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-reservation-place-control-allocated-background-default);color:var(--sbb-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-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%}`;
|
|
16
16
|
let Dt = (() => {
|
|
17
17
|
var u, _, f, g, k, x, y, m, I, z, w, c;
|
|
18
|
-
let o = [yt("sbb-seat-reservation-place-control")], l, i = [], h,
|
|
19
|
-
var
|
|
18
|
+
let o = [yt("sbb-seat-reservation-place-control")], l, i = [], h, R = ut, S, T = [], P = [], $, L = [], D = [], A, N = [], O = [], F, j = [], B = [], U, K = [], M = [], Y, q = [], G = [], H, J = [], Q = [], V, W = [], X = [], Z, tt = [], et = [], st, rt = [], at = [], ct, ot = [], lt = [];
|
|
19
|
+
var E = (c = class extends R {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
22
|
b(this, u);
|
|
@@ -30,7 +30,7 @@ let Dt = (() => {
|
|
|
30
30
|
b(this, I);
|
|
31
31
|
b(this, z);
|
|
32
32
|
b(this, w);
|
|
33
|
-
r(this, u, a(this,
|
|
33
|
+
r(this, u, a(this, T, "SEAT")), r(this, _, (a(this, P), a(this, L, "FREE"))), r(this, f, (a(this, D), a(this, N, []))), r(this, g, (a(this, O), a(this, j, 0))), r(this, k, (a(this, B), a(this, K, 32))), r(this, x, (a(this, M), a(this, q, 32))), r(this, y, (a(this, G), a(this, J, ""))), r(this, m, (a(this, Q), a(this, W, 0))), r(this, I, (a(this, X), a(this, tt, null))), r(this, z, (a(this, et), a(this, rt, !1))), r(this, w, (a(this, at), a(this, ot, "unfocus"))), this.placeSelected = (a(this, lt), new ft(this, E.events.selectPlace)), this._language = new _t(this), this.addEventListener("click", () => this._selectPlace());
|
|
34
34
|
}
|
|
35
35
|
/** placeType of the place, e.g. 'SEAT', 'BICYCLE' */
|
|
36
36
|
get placeType() {
|
|
@@ -110,11 +110,10 @@ let Dt = (() => {
|
|
|
110
110
|
r(this, w, e);
|
|
111
111
|
}
|
|
112
112
|
willUpdate(e) {
|
|
113
|
-
|
|
114
|
-
super.willUpdate(e), (e.has("width") || e.has("height")) && ((t = this.style) == null || t.setProperty("--sbb-place-control-text-scale-value", `${Math.min(this.width, this.height)}`)), e.has("textRotation") && ((s = this.style) == null || s.setProperty("--sbb-reservation-place-control-text-rotation", `${this.textRotation}`)), e.has("rotation") && ((E = this.style) == null || E.setProperty("--sbb-reservation-place-control-rotation", `${this.rotation}`)), e.has("keyfocus") && this.keyfocus === "focus" && this.focus();
|
|
113
|
+
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();
|
|
115
114
|
}
|
|
116
115
|
render() {
|
|
117
|
-
const e = this._getPlaceSvg(this.placeType, this.state), t = this.type.toLowerCase(), s = this.state.toLowerCase(),
|
|
116
|
+
const e = this._getPlaceSvg(this.placeType, this.state), t = this.type.toLowerCase(), s = this.state.toLowerCase(), it = this.text, pt = this.width, dt = this.height, ht = this.textRotation - this.rotation, vt = this.preventClick ? "sbb-reservation-place-control--disabled" : null;
|
|
118
117
|
return this.title = this._getTitleDescriptionPlace(), this.tabIndex = -1, xt`
|
|
119
118
|
<div
|
|
120
119
|
part="sbb-sr-place-part"
|
|
@@ -129,7 +128,7 @@ let Dt = (() => {
|
|
|
129
128
|
aria-hidden="true"
|
|
130
129
|
></sbb-seat-reservation-graphic>
|
|
131
130
|
<span ${this.text ?? kt} class="sbb-sr-place-ctrl__text" aria-hidden="true"
|
|
132
|
-
>${
|
|
131
|
+
>${it}</span
|
|
133
132
|
>
|
|
134
133
|
</div>
|
|
135
134
|
`;
|
|
@@ -139,8 +138,8 @@ let Dt = (() => {
|
|
|
139
138
|
}
|
|
140
139
|
_getTitleDescriptionPlace() {
|
|
141
140
|
const e = "PLACE_CONTROL_" + this.type + "_" + this.state;
|
|
142
|
-
let t =
|
|
143
|
-
return this.propertyIds.length && (t += ". " +
|
|
141
|
+
let t = C(e, this._language.current, [this.text]);
|
|
142
|
+
return this.propertyIds.length && (t += ". " + C("PLACE_PROPERTY", this._language.current).concat(": "), t += this.propertyIds.map((s) => C(s, this._language.current)).join(", ")), t;
|
|
144
143
|
}
|
|
145
144
|
/** If the place selectable, we emit the placeSelection object which contains infos to the place state */
|
|
146
145
|
_selectPlace() {
|
|
@@ -156,34 +155,34 @@ let Dt = (() => {
|
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
157
|
}, u = new WeakMap(), _ = new WeakMap(), f = new WeakMap(), g = new WeakMap(), k = new WeakMap(), x = new WeakMap(), y = new WeakMap(), m = new WeakMap(), I = new WeakMap(), z = new WeakMap(), w = new WeakMap(), h = c, (() => {
|
|
159
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
160
|
-
|
|
158
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(R[Symbol.metadata] ?? null) : void 0;
|
|
159
|
+
S = [v(), d({ attribute: "type" })], $ = [v(), d({ attribute: "state" })], A = [d({ attribute: "propertyIds", type: Array })], F = [v(), d({ attribute: "rotation", type: Number })], U = [v(), d({ attribute: "width", type: Number })], Y = [v(), d({ attribute: "height", type: Number })], H = [v(), d({ attribute: "text" })], V = [v(), d({ attribute: "text-rotation" })], Z = [v(), d({ attribute: "coach-index", type: Number })], st = [v(), d({ attribute: "prevent-click", type: Boolean })], ct = [v(), d({ attribute: "keyfocus" })], p(c, null, S, { kind: "accessor", name: "placeType", static: !1, private: !1, access: { has: (t) => "placeType" in t, get: (t) => t.placeType, set: (t, s) => {
|
|
161
160
|
t.placeType = s;
|
|
162
|
-
} }, metadata: e },
|
|
161
|
+
} }, metadata: e }, T, P), p(c, null, $, { kind: "accessor", name: "state", static: !1, private: !1, access: { has: (t) => "state" in t, get: (t) => t.state, set: (t, s) => {
|
|
163
162
|
t.state = s;
|
|
164
|
-
} }, metadata: e },
|
|
163
|
+
} }, metadata: e }, L, D), p(c, null, A, { kind: "accessor", name: "propertyIds", static: !1, private: !1, access: { has: (t) => "propertyIds" in t, get: (t) => t.propertyIds, set: (t, s) => {
|
|
165
164
|
t.propertyIds = s;
|
|
166
|
-
} }, metadata: e },
|
|
165
|
+
} }, metadata: e }, N, 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) => {
|
|
167
166
|
t.rotation = s;
|
|
168
|
-
} }, metadata: e },
|
|
167
|
+
} }, 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) => {
|
|
169
168
|
t.width = s;
|
|
170
|
-
} }, metadata: e },
|
|
169
|
+
} }, 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) => {
|
|
171
170
|
t.height = s;
|
|
172
|
-
} }, metadata: e },
|
|
171
|
+
} }, 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) => {
|
|
173
172
|
t.text = s;
|
|
174
|
-
} }, metadata: e },
|
|
173
|
+
} }, 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) => {
|
|
175
174
|
t.textRotation = s;
|
|
176
|
-
} }, metadata: e },
|
|
175
|
+
} }, metadata: e }, W, X), p(c, null, Z, { kind: "accessor", name: "coachIndex", static: !1, private: !1, access: { has: (t) => "coachIndex" in t, get: (t) => t.coachIndex, set: (t, s) => {
|
|
177
176
|
t.coachIndex = s;
|
|
178
|
-
} }, metadata: e },
|
|
177
|
+
} }, metadata: e }, tt, et), p(c, null, st, { kind: "accessor", name: "preventClick", static: !1, private: !1, access: { has: (t) => "preventClick" in t, get: (t) => t.preventClick, set: (t, s) => {
|
|
179
178
|
t.preventClick = s;
|
|
180
|
-
} }, metadata: e },
|
|
179
|
+
} }, metadata: e }, rt, at), p(c, null, ct, { kind: "accessor", name: "keyfocus", static: !1, private: !1, access: { has: (t) => "keyfocus" in t, get: (t) => t.keyfocus, set: (t, s) => {
|
|
181
180
|
t.keyfocus = s;
|
|
182
|
-
} }, metadata: e },
|
|
181
|
+
} }, metadata: e }, ot, lt), p(null, l = { value: h }, o, { kind: "class", name: h.name, metadata: e }, null, i), E = h = l.value, e && Object.defineProperty(h, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
183
182
|
})(), c.styles = mt, c.events = {
|
|
184
183
|
selectPlace: "selectPlace"
|
|
185
184
|
}, a(h, i), c);
|
|
186
|
-
return
|
|
185
|
+
return E = h;
|
|
187
186
|
})();
|
|
188
187
|
export {
|
|
189
188
|
Dt as SbbSeatReservationPlaceControlElement
|