@sbb-esta/lyne-elements-experimental 2.6.0 → 2.7.1
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 +191 -0
- package/core/datetime.d.ts +3 -0
- package/core/datetime.d.ts.map +1 -1
- package/core/datetime.js +3 -189
- package/core/timetable/access-leg-helper.js +94 -0
- package/core/timetable/timetable-helper.js +13 -0
- package/core/timetable/timetable-properties.js +1 -0
- package/core/timetable.d.ts +3 -0
- package/core/timetable.d.ts.map +1 -1
- package/core/timetable.js +6 -102
- package/custom-elements.json +598 -439
- package/development/core/datetime/date-helper.js +285 -0
- package/development/core/datetime.d.ts +3 -0
- package/development/core/datetime.d.ts.map +1 -1
- package/development/core/datetime.js +2 -281
- package/development/core/timetable/access-leg-helper.js +128 -0
- package/development/core/timetable/timetable-helper.js +21 -0
- package/development/core/timetable/timetable-properties.js +2 -0
- package/development/core/timetable.d.ts +3 -0
- package/development/core/timetable.d.ts.map +1 -1
- package/development/core/timetable.js +3 -139
- package/development/{differenceInMinutes-Cmyza6nm.js → differenceInMinutes-CHSyWiQs.js} +2 -2
- package/development/{format-BU7bjY-L.js → format-D0-yhzi4.js} +3 -3
- package/development/{isValid-DO_pHwcW.js → isValid-Bo4R7iA7.js} +2 -2
- package/development/journey-summary/journey-summary.js +297 -0
- package/development/journey-summary.d.ts +3 -0
- package/development/journey-summary.d.ts.map +1 -1
- package/development/journey-summary.js +2 -294
- package/development/pearl-chain/pearl-chain.js +649 -0
- package/development/pearl-chain-time/pearl-chain-time.js +315 -0
- package/development/pearl-chain-time.d.ts +3 -0
- package/development/pearl-chain-time.d.ts.map +1 -1
- package/development/pearl-chain-time.js +2 -312
- package/development/pearl-chain-vertical/pearl-chain-vertical.js +45 -0
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.js +395 -0
- package/development/pearl-chain-vertical-item.d.ts +3 -0
- package/development/pearl-chain-vertical-item.d.ts.map +1 -1
- package/development/pearl-chain-vertical-item.js +2 -392
- package/development/pearl-chain-vertical.d.ts +3 -0
- package/development/pearl-chain-vertical.d.ts.map +1 -1
- package/development/pearl-chain-vertical.js +2 -42
- package/development/pearl-chain.d.ts +3 -0
- package/development/pearl-chain.d.ts.map +1 -1
- package/development/pearl-chain.js +2 -646
- package/development/timetable-duration/timetable-duration.js +119 -0
- package/development/timetable-duration.d.ts +3 -0
- package/development/timetable-duration.d.ts.map +1 -1
- package/development/timetable-duration.js +2 -116
- package/development/timetable-row/timetable-row.js +820 -0
- package/development/timetable-row.d.ts +3 -0
- package/development/timetable-row.d.ts.map +1 -1
- package/development/timetable-row.js +2 -810
- package/development/{toDate-B6IBgPYH.js → toDate-D_Vjps95.js} +5 -5
- package/{differenceInMinutes-BI2zjbtS.js → differenceInMinutes-BMqUZdhj.js} +1 -1
- package/{format-CUYwLzoN.js → format-Dg8rkk7h.js} +2 -2
- package/index.d.ts +7 -7
- package/index.js +7 -7
- package/{isValid-mroh13Xp.js → isValid-DJ69OMZJ.js} +6 -6
- package/journey-summary/journey-summary.js +190 -0
- package/journey-summary.d.ts +3 -0
- package/journey-summary.d.ts.map +1 -1
- package/journey-summary.js +2 -188
- package/package.json +3 -3
- package/pearl-chain/pearl-chain.js +177 -0
- package/pearl-chain-time/pearl-chain-time.js +153 -0
- package/pearl-chain-time.d.ts +3 -0
- package/pearl-chain-time.d.ts.map +1 -1
- package/pearl-chain-time.js +2 -151
- package/pearl-chain-vertical/pearl-chain-vertical.js +23 -0
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.js +71 -0
- package/pearl-chain-vertical-item.d.ts +3 -0
- package/pearl-chain-vertical-item.d.ts.map +1 -1
- package/pearl-chain-vertical-item.js +2 -69
- package/pearl-chain-vertical.d.ts +3 -0
- package/pearl-chain-vertical.d.ts.map +1 -1
- package/pearl-chain-vertical.js +2 -21
- package/pearl-chain.d.ts +3 -0
- package/pearl-chain.d.ts.map +1 -1
- package/pearl-chain.js +2 -175
- package/timetable-duration/timetable-duration.js +55 -0
- package/timetable-duration.d.ts +3 -0
- package/timetable-duration.d.ts.map +1 -1
- package/timetable-duration.js +2 -53
- package/timetable-row/timetable-row.js +462 -0
- package/timetable-row.d.ts +3 -0
- package/timetable-row.d.ts.map +1 -1
- package/timetable-row.js +9 -460
- package/{toDate-DQg4ZFnf.js → toDate-BCXKL_wM.js} +4 -4
- package/development/pearl-chain/pearl-chain.sample-data.d.ts +0 -141
- package/development/pearl-chain/pearl-chain.sample-data.d.ts.map +0 -1
- package/development/timetable-duration/timetable-duration.sample-data.d.ts +0 -6
- package/development/timetable-duration/timetable-duration.sample-data.d.ts.map +0 -1
- package/development/timetable-row/timetable-row.sample-data.d.ts +0 -25
- package/development/timetable-row/timetable-row.sample-data.d.ts.map +0 -1
- package/pearl-chain/pearl-chain.sample-data.d.ts +0 -141
- package/pearl-chain/pearl-chain.sample-data.d.ts.map +0 -1
- package/timetable-duration/timetable-duration.sample-data.d.ts +0 -6
- package/timetable-duration/timetable-duration.sample-data.d.ts.map +0 -1
- package/timetable-row/timetable-row.sample-data.d.ts +0 -25
- package/timetable-row/timetable-row.sample-data.d.ts.map +0 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
var oe = (l) => {
|
|
2
|
+
throw TypeError(l);
|
|
3
|
+
};
|
|
4
|
+
var be = (l, n, p) => n.has(l) || oe("Cannot " + p);
|
|
5
|
+
var I = (l, n, p) => (be(l, n, "read from private field"), p ? p.call(l) : n.get(l)), H = (l, n, p) => n.has(l) ? oe("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(l) : n.set(l, p), k = (l, n, p, d) => (be(l, n, "write to private field"), d ? d.call(l, p) : n.set(l, p), p);
|
|
6
|
+
import { __runInitializers as f, __esDecorate as S } from "tslib";
|
|
7
|
+
import { defaultDateAdapter as ce } from "@sbb-esta/lyne-elements/core/datetime.js";
|
|
8
|
+
import { forceType as xe } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
+
import { css as Se, LitElement as De, html as y, nothing as pe } from "lit";
|
|
10
|
+
import { customElement as Te, property as O } from "lit/decorators.js";
|
|
11
|
+
import { styleMap as he } from "lit/directives/style-map.js";
|
|
12
|
+
import { removeTimezoneFromISOTimeString as h } from "../core/datetime.js";
|
|
13
|
+
import { isRideLeg as Ae } from "../core/timetable.js";
|
|
14
|
+
import { d as D, a as T } from "../differenceInMinutes-BMqUZdhj.js";
|
|
15
|
+
import { t as A } from "../toDate-BCXKL_wM.js";
|
|
16
|
+
function Ce(l, n) {
|
|
17
|
+
return +A(l) > +A(n);
|
|
18
|
+
}
|
|
19
|
+
function de(l, n) {
|
|
20
|
+
return +A(l) < +A(n);
|
|
21
|
+
}
|
|
22
|
+
const $e = Se`*,:before,:after{box-sizing:border-box}:host{--sbb-pearl-chain-height: var(--sbb-border-width-2x);--sbb-pearl-chain-spacing-small: .125rem;--sbb-pearl-chain-color: var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-color-disruption: var(--sbb-pearl-chain-bullet-color-disruption);--sbb-pearl-chain-color-past: var(--sbb-pearl-chain-bullet-color-past);--sbb-pearl-chain-leg-width: 100%;display:block;--sbb-pearl-chain-bullet-size-start-end: .625rem;--sbb-pearl-chain-bullet-size-stop: .5rem;--sbb-pearl-chain-bullet-color: var(--sbb-color-charcoal);--sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-red);--sbb-pearl-chain-bullet-border-width: var(--sbb-border-width-2x);--sbb-pearl-chain-bullet-animation-duration: 1.92s;--sbb-pearl-chain-bullet-animation-easing: ease-out;--sbb-pearl-chain-bullet-crossed-width: .88375rem;--sbb-pearl-chain-bullet-crossed-height: .21875rem;--sbb-pearl-chain-bullet-crossed-border-width: .09375rem}.sbb-pearl-chain{position:relative;display:flex;justify-content:space-between;flex-wrap:nowrap;color:var(--sbb-pearl-chain-color);width:100%;padding-block:calc((var(--sbb-pearl-chain-bullet-size-start-end) - var(--sbb-pearl-chain-height)) / 2);padding-inline-end:var(--sbb-pearl-chain-bullet-size-start-end)}.sbb-pearl-chain__bullet{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain__bullet{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain__bullet{content:"";position:absolute;background-color:currentcolor;inset-block-start:0;z-index:3}.sbb-pearl-chain__bullet:first-of-type{inset-inline-start:0}.sbb-pearl-chain__bullet:last-of-type{inset-inline-end:0}.sbb-pearl-chain__leg{flex-shrink:0;flex-grow:0;position:relative;height:var(--sbb-pearl-chain-height);border-inline-end:var(--sbb-pearl-chain-spacing-small) solid Canvas;background-color:currentcolor;width:var(--sbb-pearl-chain-leg-width);display:flex;align-items:center}@media (forced-colors: active){.sbb-pearl-chain__leg{background-color:CanvasText}.sbb-pearl-chain--past .sbb-pearl-chain__leg{background-color:GrayText}}.sbb-pearl-chain__leg:last-of-type{border:none}.sbb-pearl-chain__stop{position:relative;z-index:2;background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain__stop{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain__bullet--future{background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain__bullet--future{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{color:var(--sbb-pearl-chain-color-past);--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors: active){.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{--sbb-pearl-chain-bullet-color: GrayText !important}}@media (forced-colors: active){.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{background-color:GrayText!important}}.sbb-pearl-chain__bullet--progress{background:var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors: active){.sbb-pearl-chain__bullet--progress{--sbb-pearl-chain-bullet-color: GrayText !important}}.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{color:var(--sbb-pearl-chain-color-disruption);--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{--sbb-pearl-chain-bullet-color: Highlight}}@media (forced-colors: active){.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{color:Highlight;background:Highlight}}.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: Highlight}}.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors: active){.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: GrayText !important}}.sbb-pearl-chain__leg--disruption:after{background-color:unset;background-image:linear-gradient(to right,currentcolor 0%,currentcolor 50%,Canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors: active){.sbb-pearl-chain__leg--disruption:after{background:unset;border-block-start:.0625rem dashed Highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__leg--skipped{color:var(--sbb-pearl-chain-color-disruption)}.sbb-pearl-chain__leg--skipped:after{background-color:unset;background-image:linear-gradient(to right,currentcolor 0%,currentcolor 50%,Canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors: active){.sbb-pearl-chain__leg--skipped:after{background:unset;border-block-start:.0625rem dashed Highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__stop--departure-skipped{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain__stop--departure-skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width)}@media (forced-colors: active){.sbb-pearl-chain__stop--departure-skipped:before{background:Highlight}}.sbb-pearl-chain--arrival-skipped,.sbb-pearl-chain--departure-skipped{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width)}@media (forced-colors: active){.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{background:Highlight}}.sbb-pearl-chain__leg:after{content:"";position:absolute;inset-block:0;inset-inline-start:0;background-color:currentcolor;border-radius:var(--sbb-pearl-chain-height);z-index:1}@media (forced-colors: active){.sbb-pearl-chain__leg:after{background-color:CanvasText}.sbb-pearl-chain--past .sbb-pearl-chain__leg:after{background-color:GrayText}}.sbb-pearl-chain__leg:last-of-type:after{inset-inline-end:calc(-1 * var(--sbb-pearl-chain-height))}.sbb-pearl-chain__leg--progress:after{background-color:var(--sbb-pearl-chain-color-past);width:var(--sbb-pearl-chain-leg-status)}.sbb-pearl-chain__position{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color: Highlight}}@keyframes pearl-chain-bullet-position-pulse{0%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}25%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}50%{box-shadow:0 0 0 .1875rem var(--sbb-color-red-alpha-20)}to{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}}.sbb-pearl-chain__position{animation:pearl-chain-bullet-position-pulse var(--sbb-pearl-chain-bullet-animation-duration) var(--sbb-pearl-chain-bullet-animation-easing) infinite}.sbb-pearl-chain__position{position:absolute;inset-block-start:-200%;z-index:4;inset-inline-start:var(--sbb-pearl-chain-status-position)}.sbb-pearl-chain__position--no-animation{animation:unset}.sbb-screen-reader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
23
|
+
let Me = (() => {
|
|
24
|
+
var v, g, u;
|
|
25
|
+
let l = [Te("sbb-pearl-chain")], n, p = [], d, J = De, R = [], W, G = [], V = [], B, j = [], M = [], Y;
|
|
26
|
+
return u = class extends J {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
H(this, v);
|
|
30
|
+
H(this, g);
|
|
31
|
+
k(this, v, (f(this, R), f(this, G, []))), k(this, g, (f(this, V), f(this, j, !1))), this._now = (f(this, M), null);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Define the legs of the pearl-chain.
|
|
35
|
+
* Format:
|
|
36
|
+
* `{"legs": [{"duration": 25}, ...]}`
|
|
37
|
+
* `duration` in minutes. Duration of the leg is relative
|
|
38
|
+
* to the total travel time. Example: departure 16:30, change at 16:40,
|
|
39
|
+
* arrival at 17:00. So the change should have a duration of 33.33%.
|
|
40
|
+
*/
|
|
41
|
+
get legs() {
|
|
42
|
+
return I(this, v);
|
|
43
|
+
}
|
|
44
|
+
set legs(a) {
|
|
45
|
+
k(this, v, a);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Per default, the current location has a pulsating animation. You can
|
|
49
|
+
* disable the animation with this property.
|
|
50
|
+
*/
|
|
51
|
+
get disableAnimation() {
|
|
52
|
+
return I(this, g);
|
|
53
|
+
}
|
|
54
|
+
set disableAnimation(a) {
|
|
55
|
+
k(this, g, a);
|
|
56
|
+
}
|
|
57
|
+
/** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */
|
|
58
|
+
set now(a) {
|
|
59
|
+
this._now = ce.getValidDateOrNull(ce.deserialize(a));
|
|
60
|
+
}
|
|
61
|
+
get now() {
|
|
62
|
+
return this._now;
|
|
63
|
+
}
|
|
64
|
+
_getAllDuration(a) {
|
|
65
|
+
return a == null ? void 0 : a.reduce((e, r) => {
|
|
66
|
+
var c, _;
|
|
67
|
+
const i = h((c = r.arrival) == null ? void 0 : c.time), b = h((_ = r.departure) == null ? void 0 : _.time);
|
|
68
|
+
return i && b ? e + D(h(r.arrival.time), h(r.departure.time)) : e;
|
|
69
|
+
}, 0);
|
|
70
|
+
}
|
|
71
|
+
_isAllCancelled(a) {
|
|
72
|
+
return a == null ? void 0 : a.every((e) => {
|
|
73
|
+
var r, i;
|
|
74
|
+
return (i = (r = e == null ? void 0 : e.serviceJourney) == null ? void 0 : r.serviceAlteration) == null ? void 0 : i.cancelled;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
_getRelativeDuration(a, e) {
|
|
78
|
+
var b, c;
|
|
79
|
+
const r = h((b = e.arrival) == null ? void 0 : b.time), i = h((c = e.departure) == null ? void 0 : c.time);
|
|
80
|
+
if (r && i) {
|
|
81
|
+
const _ = D(h(e.arrival.time), h(e.departure.time)), w = this._getAllDuration(a);
|
|
82
|
+
return w === 0 ? 100 : _ / w * 100;
|
|
83
|
+
}
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
_getProgress(a, e, r) {
|
|
87
|
+
if (!(e != null && e.time) || !(r != null && r.time))
|
|
88
|
+
return 0;
|
|
89
|
+
const i = T(e.time, e.delay ?? 0), b = T(r.time, r.delay ?? 0), c = D(b, i), _ = D(a, i);
|
|
90
|
+
return c && _ / c * 100;
|
|
91
|
+
}
|
|
92
|
+
_getStatus(a, e, r) {
|
|
93
|
+
const i = e && e.time && T(e.time, e.delay ?? 0), b = r && r.time && T(r.time, r.delay ?? 0);
|
|
94
|
+
return i && de(i, a) && b && Ce(b, a) ? "progress" : b && de(b, a) ? "past" : "future";
|
|
95
|
+
}
|
|
96
|
+
_renderPosition(a, e, r) {
|
|
97
|
+
const i = this._getProgress(a, e, r);
|
|
98
|
+
if (i < 0 && i > 100)
|
|
99
|
+
return;
|
|
100
|
+
const b = () => ({
|
|
101
|
+
"--sbb-pearl-chain-status-position": `${i}%`,
|
|
102
|
+
...i >= 50 ? { transform: "translateX(-100%)" } : {}
|
|
103
|
+
}), c = this.disableAnimation ? "sbb-pearl-chain__position--no-animation" : "";
|
|
104
|
+
return y`<span
|
|
105
|
+
style=${he(b())}
|
|
106
|
+
class="sbb-pearl-chain__position ${c}"
|
|
107
|
+
></span>`;
|
|
108
|
+
}
|
|
109
|
+
render() {
|
|
110
|
+
var X, q, K, Q, U;
|
|
111
|
+
const a = this.now ?? /* @__PURE__ */ new Date(), e = (X = this.legs) == null ? void 0 : X.filter((t) => Ae(t)), r = (e == null ? void 0 : e.length) && h((K = (q = e[0]) == null ? void 0 : q.departure) == null ? void 0 : K.time), i = r && {
|
|
112
|
+
time: r,
|
|
113
|
+
delay: e[0].departure.delay ?? 0
|
|
114
|
+
}, b = (e == null ? void 0 : e.length) && h((Q = e[e.length - 1].arrival) == null ? void 0 : Q.time), c = b && {
|
|
115
|
+
time: b,
|
|
116
|
+
delay: ((U = e[e.length - 1]) == null ? void 0 : U.arrival.delay) ?? 0
|
|
117
|
+
}, _ = (() => {
|
|
118
|
+
var t, o, s, m;
|
|
119
|
+
return e && ((o = (t = e[0]) == null ? void 0 : t.serviceJourney) != null && o.stopPoints) && ((m = (s = e[0]) == null ? void 0 : s.serviceJourney) == null ? void 0 : m.stopPoints[0].stopStatus) === "NOT_SERVICED" ? "sbb-pearl-chain--departure-skipped" : "";
|
|
120
|
+
})(), w = (() => {
|
|
121
|
+
var s;
|
|
122
|
+
const t = e && e[e.length - 1], o = t && ((s = t.serviceJourney) == null ? void 0 : s.stopPoints);
|
|
123
|
+
return o && o[o.length - 1].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--arrival-skipped" : "";
|
|
124
|
+
})(), F = (() => {
|
|
125
|
+
var t, o, s;
|
|
126
|
+
return e && ((s = (o = (t = e[0]) == null ? void 0 : t.serviceJourney) == null ? void 0 : o.serviceAlteration) != null && s.cancelled) ? "sbb-pearl-chain--departure-disruption" : "";
|
|
127
|
+
})(), L = (() => {
|
|
128
|
+
var t, o, s;
|
|
129
|
+
return e && ((s = (o = (t = e[e.length - 1]) == null ? void 0 : t.serviceJourney) == null ? void 0 : o.serviceAlteration) != null && s.cancelled) ? "sbb-pearl-chain--arrival-disruption" : "";
|
|
130
|
+
})(), C = i && c && this._getStatus(a, i, c), ue = e && C && !F ? "sbb-pearl-chain__bullet--" + C : "", _e = e && C && !L ? "sbb-pearl-chain__bullet--" + this._getStatus(a, void 0, c) : "";
|
|
131
|
+
return this._isAllCancelled(e) ? y`
|
|
132
|
+
<div class="sbb-pearl-chain">
|
|
133
|
+
<span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
|
|
134
|
+
<div class="sbb-pearl-chain__leg sbb-pearl-chain__leg--disruption"></div>
|
|
135
|
+
<span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
|
|
136
|
+
</div>
|
|
137
|
+
` : y`
|
|
138
|
+
<div class="sbb-pearl-chain">
|
|
139
|
+
<span
|
|
140
|
+
class="sbb-pearl-chain__bullet ${ue} ${_} ${F}"
|
|
141
|
+
></span>
|
|
142
|
+
${e == null ? void 0 : e.map((t, o) => {
|
|
143
|
+
var ee, ae, re, te, le, ie, se, ne;
|
|
144
|
+
const { stopPoints: s, serviceAlteration: m } = (t == null ? void 0 : t.serviceJourney) || {}, ve = this._getRelativeDuration(e, t), ge = h((ee = t.departure) == null ? void 0 : ee.time), me = h((ae = t.arrival) == null ? void 0 : ae.time), fe = s && ((re = s[s.length - 1]) == null ? void 0 : re.stopStatus) === "NOT_SERVICED", ke = s && ((te = s[s.length - 1]) == null ? void 0 : te.stopStatus) === "PLANNED", Z = s && ((le = s[0]) == null ? void 0 : le.stopStatus) === "NOT_SERVICED", $ = o > 0 && e[o - 1].serviceJourney.stopPoints, ye = $ && ((ie = $[$.length - 1]) == null ? void 0 : ie.stopStatus) === "NOT_SERVICED", z = fe || Z && ke ? "sbb-pearl-chain__leg--skipped" : "", we = Z || ye ? "sbb-pearl-chain__stop--departure-skipped" : "", x = m != null && m.cancelled ? "sbb-pearl-chain__leg--disruption" : "", N = { time: ge, delay: ((se = t.departure) == null ? void 0 : se.delay) ?? 0 }, E = { time: me, delay: ((ne = t.arrival) == null ? void 0 : ne.delay) ?? 0 }, P = this._getStatus(a, N, E), ze = !x && !z && "sbb-pearl-chain__leg--" + P;
|
|
145
|
+
return y` <div
|
|
146
|
+
class="sbb-pearl-chain__leg ${ze || ""} ${x} ${z}"
|
|
147
|
+
style=${he({
|
|
148
|
+
"--sbb-pearl-chain-leg-width": `${ve}%`,
|
|
149
|
+
...P === "progress" && !x && !z ? {
|
|
150
|
+
"--sbb-pearl-chain-leg-status": `${this._getProgress(a, N, E)}%`
|
|
151
|
+
} : {}
|
|
152
|
+
})}
|
|
153
|
+
>
|
|
154
|
+
${o > 0 && o < e.length ? y`<span class="sbb-pearl-chain__stop ${we}"></span>` : pe}
|
|
155
|
+
${P === "progress" && !x && !z ? this._renderPosition(a, N, E) : pe}
|
|
156
|
+
</div>`;
|
|
157
|
+
})}
|
|
158
|
+
<span
|
|
159
|
+
class="sbb-pearl-chain__bullet ${_e} ${w} ${L}"
|
|
160
|
+
></span>
|
|
161
|
+
</div>
|
|
162
|
+
`;
|
|
163
|
+
}
|
|
164
|
+
}, v = new WeakMap(), g = new WeakMap(), d = u, (() => {
|
|
165
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(J[Symbol.metadata] ?? null) : void 0;
|
|
166
|
+
W = [O({ type: Array })], B = [xe(), O({ attribute: "disable-animation", type: Boolean })], Y = [O()], S(u, null, W, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, r) => {
|
|
167
|
+
e.legs = r;
|
|
168
|
+
} }, metadata: a }, G, V), S(u, null, B, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, r) => {
|
|
169
|
+
e.disableAnimation = r;
|
|
170
|
+
} }, metadata: a }, j, M), S(u, null, Y, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, r) => {
|
|
171
|
+
e.now = r;
|
|
172
|
+
} }, metadata: a }, null, R), S(null, n = { value: d }, l, { kind: "class", name: d.name, metadata: a }, null, p), d = n.value, a && Object.defineProperty(d, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
173
|
+
})(), u.styles = $e, f(d, p), d;
|
|
174
|
+
})();
|
|
175
|
+
export {
|
|
176
|
+
Me as SbbPearlChainElement
|
|
177
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
var U = (a) => {
|
|
2
|
+
throw TypeError(a);
|
|
3
|
+
};
|
|
4
|
+
var X = (a, s, o) => s.has(a) || U("Cannot " + o);
|
|
5
|
+
var h = (a, s, o) => (X(a, s, "read from private field"), o ? o.call(a) : s.get(a)), b = (a, s, o) => s.has(a) ? U("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(a) : s.set(a, o), n = (a, s, o, m) => (X(a, s, "write to private field"), m ? m.call(a, o) : s.set(a, o), o);
|
|
6
|
+
import { __runInitializers as r, __esDecorate as c } from "tslib";
|
|
7
|
+
import { SbbLanguageController as ie } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
|
+
import { defaultDateAdapter as Y } from "@sbb-esta/lyne-elements/core/datetime.js";
|
|
9
|
+
import { forceType as k } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
10
|
+
import { i18nDeparture as re, i18nTransferProcedures as se, i18nArrival as le } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
11
|
+
import { css as ne, LitElement as oe, nothing as T, html as w } from "lit";
|
|
12
|
+
import { customElement as me, property as p } from "lit/decorators.js";
|
|
13
|
+
import { removeTimezoneFromISOTimeString as Z } from "../core/datetime.js";
|
|
14
|
+
import { getDepartureArrivalTimeAttribute as ce, isRideLeg as he } from "../core/timetable.js";
|
|
15
|
+
import "../pearl-chain.js";
|
|
16
|
+
import { f as ee } from "../format-Dg8rkk7h.js";
|
|
17
|
+
const be = ne`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-pearl-chain-time-height: auto}@media (min-width: 37.5rem){:host{--sbb-pearl-chain-time-height: 1.5625rem}}@media (min-width: 52.5rem){:host{--sbb-pearl-chain-time-height: 1.75rem}}.sbb-pearl-chain__time{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;height:var(--sbb-pearl-chain-time-height)}.sbb-pearl-chain__time-walktime,.sbb-pearl-chain__time-transfer{--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:inline-flex;align-items:center}.sbb-pearl-chain__time-walktime--walk-small-left{transform:translate(-.4375rem);margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem)}.sbb-pearl-chain__time-walktime--walk-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-left{transform:translate(-.375rem);margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime-prime-symbol{float:right}.sbb-pearl-chain__time-transfer{gap:var(--sbb-spacing-fixed-1x)}.sbb-pearl-chain__time-transfer--sa-ci-departure{margin-inline-end:var(--sbb-spacing-fixed-2x)}.sbb-pearl-chain__time-transfer--sa-ci-arrival{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-chain{flex:1 1 auto;align-self:center;margin-inline:var(--sbb-spacing-fixed-3x)}.sbb-pearl-chain__time-time{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);font-weight:700;color:var(--sbb-color-charcoal)}.sbb-screen-reader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
18
|
+
let We = (() => {
|
|
19
|
+
var d, _, g, u, f, v, y, l;
|
|
20
|
+
let a = [me("sbb-pearl-chain-time")], s, o = [], m, z = oe, W = [], A, $ = [], F = [], I, D = [], S = [], N, E = [], H = [], O, j = [], P = [], B, C = [], R = [], V, q = [], G = [], J, K = [], L = [], M;
|
|
21
|
+
return l = class extends z {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
b(this, d);
|
|
25
|
+
b(this, _);
|
|
26
|
+
b(this, g);
|
|
27
|
+
b(this, u);
|
|
28
|
+
b(this, f);
|
|
29
|
+
b(this, v);
|
|
30
|
+
b(this, y);
|
|
31
|
+
n(this, d, (r(this, W), r(this, $, []))), n(this, _, (r(this, F), r(this, D, ""))), n(this, g, (r(this, S), r(this, E, ""))), n(this, u, (r(this, H), r(this, j, NaN))), n(this, f, (r(this, P), r(this, C, NaN))), n(this, v, (r(this, R), r(this, q, !1))), n(this, y, (r(this, G), r(this, K, !1))), this._now = (r(this, L), null), this._language = new ie(this);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* define the legs of the pearl-chain.
|
|
35
|
+
* Format:
|
|
36
|
+
* `{"legs": [{"duration": 25}, ...]}`
|
|
37
|
+
* `duration` in minutes. Duration of the leg is relative
|
|
38
|
+
* to the total travel time. Example: departure 16:30, change at 16:40,
|
|
39
|
+
* arrival at 17:00. So the change should have a duration of 33.33%.
|
|
40
|
+
*/
|
|
41
|
+
get legs() {
|
|
42
|
+
return h(this, d);
|
|
43
|
+
}
|
|
44
|
+
set legs(t) {
|
|
45
|
+
n(this, d, t);
|
|
46
|
+
}
|
|
47
|
+
/** Prop to render the departure time - will be formatted as "H:mm" */
|
|
48
|
+
get departureTime() {
|
|
49
|
+
return h(this, _);
|
|
50
|
+
}
|
|
51
|
+
set departureTime(t) {
|
|
52
|
+
n(this, _, t);
|
|
53
|
+
}
|
|
54
|
+
/** Prop to render the arrival time - will be formatted as "H:mm" */
|
|
55
|
+
get arrivalTime() {
|
|
56
|
+
return h(this, g);
|
|
57
|
+
}
|
|
58
|
+
set arrivalTime(t) {
|
|
59
|
+
n(this, g, t);
|
|
60
|
+
}
|
|
61
|
+
/** Optional prop to render the walk time (in minutes) before departure */
|
|
62
|
+
get departureWalk() {
|
|
63
|
+
return h(this, u);
|
|
64
|
+
}
|
|
65
|
+
set departureWalk(t) {
|
|
66
|
+
n(this, u, t);
|
|
67
|
+
}
|
|
68
|
+
/** Optional prop to render the walk time (in minutes) after arrival */
|
|
69
|
+
get arrivalWalk() {
|
|
70
|
+
return h(this, f);
|
|
71
|
+
}
|
|
72
|
+
set arrivalWalk(t) {
|
|
73
|
+
n(this, f, t);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Per default, the current location has a pulsating animation. You can
|
|
77
|
+
* disable the animation with this property.
|
|
78
|
+
*/
|
|
79
|
+
get disableAnimation() {
|
|
80
|
+
return h(this, v);
|
|
81
|
+
}
|
|
82
|
+
set disableAnimation(t) {
|
|
83
|
+
n(this, v, t);
|
|
84
|
+
}
|
|
85
|
+
/** Optional prop to render wheelchair-small instead of walk-small */
|
|
86
|
+
get a11yFootpath() {
|
|
87
|
+
return h(this, y);
|
|
88
|
+
}
|
|
89
|
+
set a11yFootpath(t) {
|
|
90
|
+
n(this, y, t);
|
|
91
|
+
}
|
|
92
|
+
/** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */
|
|
93
|
+
set now(t) {
|
|
94
|
+
this._now = Y.getValidDateOrNull(Y.deserialize(t));
|
|
95
|
+
}
|
|
96
|
+
get now() {
|
|
97
|
+
return this._now ?? /* @__PURE__ */ new Date();
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
var Q;
|
|
101
|
+
const t = this.departureTime ? Z(this.departureTime) : void 0, e = this.arrivalTime ? Z(this.arrivalTime) : void 0, { renderDepartureTimeAttribute: i, renderArrivalTimeAttribute: te } = ce(this.legs, this.departureWalk || 0, this.arrivalWalk || 0, this._language.current, this.a11yFootpath), x = (Q = this.legs) == null ? void 0 : Q.filter((ae) => he(ae));
|
|
102
|
+
return w`
|
|
103
|
+
<div class="sbb-pearl-chain__time">
|
|
104
|
+
${i()}
|
|
105
|
+
${t ? w`<time class="sbb-pearl-chain__time-time" datetime=${this.departureTime}>
|
|
106
|
+
<span class="sbb-screen-reader-only"
|
|
107
|
+
>${re[this._language.current]}: </span
|
|
108
|
+
>
|
|
109
|
+
${ee(t, "HH:mm")}
|
|
110
|
+
</time>` : T}
|
|
111
|
+
${(x == null ? void 0 : x.length) > 1 ? w`<span class="sbb-screen-reader-only" role="paragraph">
|
|
112
|
+
${(x == null ? void 0 : x.length) - 1} ${se[this._language.current]}
|
|
113
|
+
</span>` : T}
|
|
114
|
+
<sbb-pearl-chain
|
|
115
|
+
class="sbb-pearl-chain__time-chain"
|
|
116
|
+
.legs=${this.legs}
|
|
117
|
+
.disableAnimation=${this.disableAnimation}
|
|
118
|
+
.now=${this.now}
|
|
119
|
+
></sbb-pearl-chain>
|
|
120
|
+
${e ? w`<time class="sbb-pearl-chain__time-time" datetime=${this.arrivalTime}>
|
|
121
|
+
<span class="sbb-screen-reader-only"
|
|
122
|
+
>${le[this._language.current]}: </span
|
|
123
|
+
>
|
|
124
|
+
${ee(e, "HH:mm")}
|
|
125
|
+
</time>` : T}
|
|
126
|
+
${te()}
|
|
127
|
+
</div>
|
|
128
|
+
`;
|
|
129
|
+
}
|
|
130
|
+
}, d = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), u = new WeakMap(), f = new WeakMap(), v = new WeakMap(), y = new WeakMap(), m = l, (() => {
|
|
131
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(z[Symbol.metadata] ?? null) : void 0;
|
|
132
|
+
A = [p({ type: Array })], I = [k(), p({ attribute: "departure-time" })], N = [k(), p({ attribute: "arrival-time" })], O = [k(), p({ attribute: "departure-walk", type: Number })], B = [k(), p({ attribute: "arrival-walk", type: Number })], V = [k(), p({ attribute: "disable-animation", type: Boolean })], J = [k(), p({ attribute: "a11y-footpath", type: Boolean })], M = [p()], c(l, null, A, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, i) => {
|
|
133
|
+
e.legs = i;
|
|
134
|
+
} }, metadata: t }, $, F), c(l, null, I, { kind: "accessor", name: "departureTime", static: !1, private: !1, access: { has: (e) => "departureTime" in e, get: (e) => e.departureTime, set: (e, i) => {
|
|
135
|
+
e.departureTime = i;
|
|
136
|
+
} }, metadata: t }, D, S), c(l, null, N, { kind: "accessor", name: "arrivalTime", static: !1, private: !1, access: { has: (e) => "arrivalTime" in e, get: (e) => e.arrivalTime, set: (e, i) => {
|
|
137
|
+
e.arrivalTime = i;
|
|
138
|
+
} }, metadata: t }, E, H), c(l, null, O, { kind: "accessor", name: "departureWalk", static: !1, private: !1, access: { has: (e) => "departureWalk" in e, get: (e) => e.departureWalk, set: (e, i) => {
|
|
139
|
+
e.departureWalk = i;
|
|
140
|
+
} }, metadata: t }, j, P), c(l, null, B, { kind: "accessor", name: "arrivalWalk", static: !1, private: !1, access: { has: (e) => "arrivalWalk" in e, get: (e) => e.arrivalWalk, set: (e, i) => {
|
|
141
|
+
e.arrivalWalk = i;
|
|
142
|
+
} }, metadata: t }, C, R), c(l, null, V, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, i) => {
|
|
143
|
+
e.disableAnimation = i;
|
|
144
|
+
} }, metadata: t }, q, G), c(l, null, J, { kind: "accessor", name: "a11yFootpath", static: !1, private: !1, access: { has: (e) => "a11yFootpath" in e, get: (e) => e.a11yFootpath, set: (e, i) => {
|
|
145
|
+
e.a11yFootpath = i;
|
|
146
|
+
} }, metadata: t }, K, L), c(l, null, M, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, i) => {
|
|
147
|
+
e.now = i;
|
|
148
|
+
} }, metadata: t }, null, W), c(null, s = { value: m }, a, { kind: "class", name: m.name, metadata: t }, null, o), m = s.value, t && Object.defineProperty(m, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
149
|
+
})(), l.styles = be, r(m, o), m;
|
|
150
|
+
})();
|
|
151
|
+
export {
|
|
152
|
+
We as SbbPearlChainTimeElement
|
|
153
|
+
};
|
package/pearl-chain-time.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pearl-chain-time.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/pearl-chain-time.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"pearl-chain-time.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/pearl-chain-time.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,wCAAwC,CAAC"}
|
package/pearl-chain-time.js
CHANGED
|
@@ -1,153 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
throw TypeError(a);
|
|
3
|
-
};
|
|
4
|
-
var X = (a, s, o) => s.has(a) || U("Cannot " + o);
|
|
5
|
-
var h = (a, s, o) => (X(a, s, "read from private field"), o ? o.call(a) : s.get(a)), b = (a, s, o) => s.has(a) ? U("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(a) : s.set(a, o), n = (a, s, o, m) => (X(a, s, "write to private field"), m ? m.call(a, o) : s.set(a, o), o);
|
|
6
|
-
import { __runInitializers as r, __esDecorate as c } from "tslib";
|
|
7
|
-
import { SbbLanguageController as ie } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
|
-
import { defaultDateAdapter as Y } from "@sbb-esta/lyne-elements/core/datetime.js";
|
|
9
|
-
import { forceType as k } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
10
|
-
import { i18nDeparture as re, i18nTransferProcedures as se, i18nArrival as le } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
11
|
-
import { css as ne, LitElement as oe, nothing as T, html as w } from "lit";
|
|
12
|
-
import { customElement as me, property as p } from "lit/decorators.js";
|
|
13
|
-
import { removeTimezoneFromISOTimeString as Z } from "./core/datetime.js";
|
|
14
|
-
import { getDepartureArrivalTimeAttribute as ce, isRideLeg as he } from "./core/timetable.js";
|
|
15
|
-
import "./pearl-chain.js";
|
|
16
|
-
import { f as ee } from "./format-CUYwLzoN.js";
|
|
17
|
-
const be = ne`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-pearl-chain-time-height: auto}@media (min-width: 37.5rem){:host{--sbb-pearl-chain-time-height: 1.5625rem}}@media (min-width: 52.5rem){:host{--sbb-pearl-chain-time-height: 1.75rem}}.sbb-pearl-chain__time{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;height:var(--sbb-pearl-chain-time-height)}.sbb-pearl-chain__time-walktime,.sbb-pearl-chain__time-transfer{--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:inline-flex;align-items:center}.sbb-pearl-chain__time-walktime--walk-small-left{transform:translate(-.4375rem);margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem)}.sbb-pearl-chain__time-walktime--walk-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-left{transform:translate(-.375rem);margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime-prime-symbol{float:right}.sbb-pearl-chain__time-transfer{gap:var(--sbb-spacing-fixed-1x)}.sbb-pearl-chain__time-transfer--sa-ci-departure{margin-inline-end:var(--sbb-spacing-fixed-2x)}.sbb-pearl-chain__time-transfer--sa-ci-arrival{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-chain{flex:1 1 auto;align-self:center;margin-inline:var(--sbb-spacing-fixed-3x)}.sbb-pearl-chain__time-time{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);font-weight:700;color:var(--sbb-color-charcoal)}.sbb-screen-reader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
18
|
-
let We = (() => {
|
|
19
|
-
var d, _, g, u, f, v, y, l;
|
|
20
|
-
let a = [me("sbb-pearl-chain-time")], s, o = [], m, z = oe, W = [], A, $ = [], F = [], I, D = [], S = [], N, E = [], H = [], O, j = [], P = [], B, C = [], R = [], V, q = [], G = [], J, K = [], L = [], M;
|
|
21
|
-
return l = class extends z {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
b(this, d);
|
|
25
|
-
b(this, _);
|
|
26
|
-
b(this, g);
|
|
27
|
-
b(this, u);
|
|
28
|
-
b(this, f);
|
|
29
|
-
b(this, v);
|
|
30
|
-
b(this, y);
|
|
31
|
-
n(this, d, (r(this, W), r(this, $, []))), n(this, _, (r(this, F), r(this, D, ""))), n(this, g, (r(this, S), r(this, E, ""))), n(this, u, (r(this, H), r(this, j, NaN))), n(this, f, (r(this, P), r(this, C, NaN))), n(this, v, (r(this, R), r(this, q, !1))), n(this, y, (r(this, G), r(this, K, !1))), this._now = (r(this, L), null), this._language = new ie(this);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* define the legs of the pearl-chain.
|
|
35
|
-
* Format:
|
|
36
|
-
* `{"legs": [{"duration": 25}, ...]}`
|
|
37
|
-
* `duration` in minutes. Duration of the leg is relative
|
|
38
|
-
* to the total travel time. Example: departure 16:30, change at 16:40,
|
|
39
|
-
* arrival at 17:00. So the change should have a duration of 33.33%.
|
|
40
|
-
*/
|
|
41
|
-
get legs() {
|
|
42
|
-
return h(this, d);
|
|
43
|
-
}
|
|
44
|
-
set legs(t) {
|
|
45
|
-
n(this, d, t);
|
|
46
|
-
}
|
|
47
|
-
/** Prop to render the departure time - will be formatted as "H:mm" */
|
|
48
|
-
get departureTime() {
|
|
49
|
-
return h(this, _);
|
|
50
|
-
}
|
|
51
|
-
set departureTime(t) {
|
|
52
|
-
n(this, _, t);
|
|
53
|
-
}
|
|
54
|
-
/** Prop to render the arrival time - will be formatted as "H:mm" */
|
|
55
|
-
get arrivalTime() {
|
|
56
|
-
return h(this, g);
|
|
57
|
-
}
|
|
58
|
-
set arrivalTime(t) {
|
|
59
|
-
n(this, g, t);
|
|
60
|
-
}
|
|
61
|
-
/** Optional prop to render the walk time (in minutes) before departure */
|
|
62
|
-
get departureWalk() {
|
|
63
|
-
return h(this, u);
|
|
64
|
-
}
|
|
65
|
-
set departureWalk(t) {
|
|
66
|
-
n(this, u, t);
|
|
67
|
-
}
|
|
68
|
-
/** Optional prop to render the walk time (in minutes) after arrival */
|
|
69
|
-
get arrivalWalk() {
|
|
70
|
-
return h(this, f);
|
|
71
|
-
}
|
|
72
|
-
set arrivalWalk(t) {
|
|
73
|
-
n(this, f, t);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Per default, the current location has a pulsating animation. You can
|
|
77
|
-
* disable the animation with this property.
|
|
78
|
-
*/
|
|
79
|
-
get disableAnimation() {
|
|
80
|
-
return h(this, v);
|
|
81
|
-
}
|
|
82
|
-
set disableAnimation(t) {
|
|
83
|
-
n(this, v, t);
|
|
84
|
-
}
|
|
85
|
-
/** Optional prop to render wheelchair-small instead of walk-small */
|
|
86
|
-
get a11yFootpath() {
|
|
87
|
-
return h(this, y);
|
|
88
|
-
}
|
|
89
|
-
set a11yFootpath(t) {
|
|
90
|
-
n(this, y, t);
|
|
91
|
-
}
|
|
92
|
-
/** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */
|
|
93
|
-
set now(t) {
|
|
94
|
-
this._now = Y.getValidDateOrNull(Y.deserialize(t));
|
|
95
|
-
}
|
|
96
|
-
get now() {
|
|
97
|
-
return this._now ?? /* @__PURE__ */ new Date();
|
|
98
|
-
}
|
|
99
|
-
render() {
|
|
100
|
-
var Q;
|
|
101
|
-
const t = this.departureTime ? Z(this.departureTime) : void 0, e = this.arrivalTime ? Z(this.arrivalTime) : void 0, { renderDepartureTimeAttribute: i, renderArrivalTimeAttribute: te } = ce(this.legs, this.departureWalk || 0, this.arrivalWalk || 0, this._language.current, this.a11yFootpath), x = (Q = this.legs) == null ? void 0 : Q.filter((ae) => he(ae));
|
|
102
|
-
return w`
|
|
103
|
-
<div class="sbb-pearl-chain__time">
|
|
104
|
-
${i()}
|
|
105
|
-
${t ? w`<time class="sbb-pearl-chain__time-time" datetime=${this.departureTime}>
|
|
106
|
-
<span class="sbb-screen-reader-only"
|
|
107
|
-
>${re[this._language.current]}: </span
|
|
108
|
-
>
|
|
109
|
-
${ee(t, "HH:mm")}
|
|
110
|
-
</time>` : T}
|
|
111
|
-
${(x == null ? void 0 : x.length) > 1 ? w`<span class="sbb-screen-reader-only" role="paragraph">
|
|
112
|
-
${(x == null ? void 0 : x.length) - 1} ${se[this._language.current]}
|
|
113
|
-
</span>` : T}
|
|
114
|
-
<sbb-pearl-chain
|
|
115
|
-
class="sbb-pearl-chain__time-chain"
|
|
116
|
-
.legs=${this.legs}
|
|
117
|
-
.disableAnimation=${this.disableAnimation}
|
|
118
|
-
.now=${this.now}
|
|
119
|
-
></sbb-pearl-chain>
|
|
120
|
-
${e ? w`<time class="sbb-pearl-chain__time-time" datetime=${this.arrivalTime}>
|
|
121
|
-
<span class="sbb-screen-reader-only"
|
|
122
|
-
>${le[this._language.current]}: </span
|
|
123
|
-
>
|
|
124
|
-
${ee(e, "HH:mm")}
|
|
125
|
-
</time>` : T}
|
|
126
|
-
${te()}
|
|
127
|
-
</div>
|
|
128
|
-
`;
|
|
129
|
-
}
|
|
130
|
-
}, d = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), u = new WeakMap(), f = new WeakMap(), v = new WeakMap(), y = new WeakMap(), m = l, (() => {
|
|
131
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(z[Symbol.metadata] ?? null) : void 0;
|
|
132
|
-
A = [p({ type: Array })], I = [k(), p({ attribute: "departure-time" })], N = [k(), p({ attribute: "arrival-time" })], O = [k(), p({ attribute: "departure-walk", type: Number })], B = [k(), p({ attribute: "arrival-walk", type: Number })], V = [k(), p({ attribute: "disable-animation", type: Boolean })], J = [k(), p({ attribute: "a11y-footpath", type: Boolean })], M = [p()], c(l, null, A, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, i) => {
|
|
133
|
-
e.legs = i;
|
|
134
|
-
} }, metadata: t }, $, F), c(l, null, I, { kind: "accessor", name: "departureTime", static: !1, private: !1, access: { has: (e) => "departureTime" in e, get: (e) => e.departureTime, set: (e, i) => {
|
|
135
|
-
e.departureTime = i;
|
|
136
|
-
} }, metadata: t }, D, S), c(l, null, N, { kind: "accessor", name: "arrivalTime", static: !1, private: !1, access: { has: (e) => "arrivalTime" in e, get: (e) => e.arrivalTime, set: (e, i) => {
|
|
137
|
-
e.arrivalTime = i;
|
|
138
|
-
} }, metadata: t }, E, H), c(l, null, O, { kind: "accessor", name: "departureWalk", static: !1, private: !1, access: { has: (e) => "departureWalk" in e, get: (e) => e.departureWalk, set: (e, i) => {
|
|
139
|
-
e.departureWalk = i;
|
|
140
|
-
} }, metadata: t }, j, P), c(l, null, B, { kind: "accessor", name: "arrivalWalk", static: !1, private: !1, access: { has: (e) => "arrivalWalk" in e, get: (e) => e.arrivalWalk, set: (e, i) => {
|
|
141
|
-
e.arrivalWalk = i;
|
|
142
|
-
} }, metadata: t }, C, R), c(l, null, V, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, i) => {
|
|
143
|
-
e.disableAnimation = i;
|
|
144
|
-
} }, metadata: t }, q, G), c(l, null, J, { kind: "accessor", name: "a11yFootpath", static: !1, private: !1, access: { has: (e) => "a11yFootpath" in e, get: (e) => e.a11yFootpath, set: (e, i) => {
|
|
145
|
-
e.a11yFootpath = i;
|
|
146
|
-
} }, metadata: t }, K, L), c(l, null, M, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, i) => {
|
|
147
|
-
e.now = i;
|
|
148
|
-
} }, metadata: t }, null, W), c(null, s = { value: m }, a, { kind: "class", name: m.name, metadata: t }, null, o), m = s.value, t && Object.defineProperty(m, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
149
|
-
})(), l.styles = be, r(m, o), m;
|
|
150
|
-
})();
|
|
1
|
+
import { SbbPearlChainTimeElement as r } from "./pearl-chain-time/pearl-chain-time.js";
|
|
151
2
|
export {
|
|
152
|
-
|
|
3
|
+
r as SbbPearlChainTimeElement
|
|
153
4
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __esDecorate as c, __runInitializers as o } 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 u = n`*,:before,:after{box-sizing:border-box}:host{--sbb-pearl-chain-vertical-width: 100%;display:block}.sbb-pearl-chain-vertical{display:table;width:var(--sbb-pearl-chain-vertical-width)}`;
|
|
5
|
+
let f = (() => {
|
|
6
|
+
var e;
|
|
7
|
+
let i = [d("sbb-pearl-chain-vertical")], l, r = [], t, s = b;
|
|
8
|
+
return e = class extends s {
|
|
9
|
+
render() {
|
|
10
|
+
return m`
|
|
11
|
+
<div class="sbb-pearl-chain-vertical">
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</div>
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
}, t = e, (() => {
|
|
17
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(s[Symbol.metadata] ?? null) : void 0;
|
|
18
|
+
c(null, l = { value: t }, i, { kind: "class", name: t.name, metadata: a }, null, r), t = l.value, a && Object.defineProperty(t, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
19
|
+
})(), e.styles = u, o(t, r), t;
|
|
20
|
+
})();
|
|
21
|
+
export {
|
|
22
|
+
f as SbbPearlChainVerticalElement
|
|
23
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var C = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
|
+
};
|
|
4
|
+
var A = (e, a, t) => a.has(e) || C("Cannot " + t);
|
|
5
|
+
var d = (e, a, t) => (A(e, a, "read from private field"), t ? t.call(e) : a.get(e)), v = (e, a, t) => a.has(e) ? C("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(e) : a.set(e, t), m = (e, a, t, r) => (A(e, a, "write to private field"), r ? r.call(e, t) : a.set(e, t), t);
|
|
6
|
+
import { __esDecorate as u, __runInitializers as h } from "tslib";
|
|
7
|
+
import { forceType as S } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
8
|
+
import { css as E, LitElement as j, nothing as _, html as p } from "lit";
|
|
9
|
+
import { customElement as D, property as I } from "lit/decorators.js";
|
|
10
|
+
const G = E`*,:before,:after{box-sizing:border-box}:host{--sbb-pearl-chain-bullet-size-start-end: .625rem;--sbb-pearl-chain-bullet-size-stop: .5rem;--sbb-pearl-chain-bullet-color: var(--sbb-color-charcoal);--sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-red);--sbb-pearl-chain-bullet-border-width: var(--sbb-border-width-2x);--sbb-pearl-chain-bullet-animation-duration: 1.92s;--sbb-pearl-chain-bullet-animation-easing: ease-out;--sbb-pearl-chain-bullet-crossed-width: .88375rem;--sbb-pearl-chain-bullet-crossed-height: .21875rem;--sbb-pearl-chain-bullet-crossed-border-width: .09375rem;display:table-row;position:relative;--sbb-pearl-chain-vertical-right-item-width: 100%;--sbb-pearl-chain-vertical-middle-item-min-width: var(--sbb-pearl-chain-bullet-size-start-end);--sbb-pearl-chain-vertical-item-border-width: var(--sbb-border-width-2x);--sbb-pearl-chain-vertical-item-border-width-thin: var(--sbb-border-width-1x);--sbb-pearl-chain-vertical-item-spacing-small: var(--sbb-spacing-fixed-1x);--sbb-pearl-chain-vertical-item-spacing-medium: var(--sbb-spacing-fixed-4x);--sbb-pearl-chain-vertical-item-color-default: var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-vertical-item-color-disruption: var(--sbb-pearl-chain-bullet-color-disruption);--sbb-pearl-chain-vertical-item-color-past: var(--sbb-pearl-chain-bullet-color-past);--sbb-pearl-chain-vertical-item-color-walk: var(--sbb-color-sky);--sbb-pearl-chain-vertical-item-inline-start: 50%;--sbb-pearl-chain-vertical-item-transform: translateX(-50%)}slot[name=right],.sbb-pearl-chain-vertical-item__column{display:table-cell;position:relative;vertical-align:top}slot[name=right]{width:var(--sbb-pearl-chain-vertical-right-item-width)}.sbb-pearl-chain-vertical-item__column--middle{min-width:var(--sbb-pearl-chain-vertical-middle-item-min-width, --sbb-pearl-chain-vertical-middle-min-width)}slot[name=left]::slotted(*){margin-block-start:var(--sbb-pearl-chain-vertical-left-item-block-start);padding-inline-end:var(--sbb-pearl-chain-vertical-left-item-inline-end)}slot[name=right]::slotted(*){margin-block-start:var(--sbb-pearl-chain-vertical-right-item-block-start);padding-inline-start:var(--sbb-pearl-chain-vertical-right-item-inline-start)}.sbb-pearl-chain-vertical-item__middle{vertical-align:top;border-spacing:0}.sbb-pearl-chain-vertical-item__line{position:absolute;bottom:0;inset-inline-start:var(--sbb-pearl-chain-vertical-item-inline-start);transform:var(--sbb-pearl-chain-vertical-item-transform);width:var(--sbb-border-width-2x);inset-block-start:calc(var(--sbb-pearl-chain-bullet-size-start-end) / 2)}.sbb-pearl-chain-vertical-item__line:after{content:"";position:absolute;inset-inline-start:0;inset-block-start:0;height:var(--sbb-pearl-chain-vertical-item-leg-status);width:var(--sbb-pearl-chain-vertical-item-border-width);background-color:var(--sbb-pearl-chain-vertical-item-color-past)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line:after{--sbb-pearl-chain-vertical-item-color-past: GrayText}}.sbb-pearl-chain-vertical-item__line--dotted{background-color:unset;border-color:unset;background-image:linear-gradient(to bottom,currentcolor 0%,currentcolor 50%,Canvas 50%);background-repeat:repeat-y;background-size:calc(2 * var(--sbb-pearl-chain-vertical-item-spacing-small)) var(--sbb-pearl-chain-vertical-item-spacing-small)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line--dotted{background-color:unset!important;border-inline-start:.0625rem dashed Highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain-vertical-item__line--thin{width:var(--sbb-pearl-chain-vertical-item-border-width-thin)}.sbb-pearl-chain-vertical-item__line--default{background-color:var(--sbb-pearl-chain-vertical-item-color-default);border-color:var(--sbb-pearl-chain-vertical-item-color-default);color:var(--sbb-pearl-chain-vertical-item-color-default)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line--default{--sbb-pearl-chain-vertical-item-color-default: CanvasText}}.sbb-pearl-chain-vertical-item__line--disruption{border-color:var(--sbb-pearl-chain-vertical-item-color-disruption);background-color:var(--sbb-pearl-chain-vertical-item-color-disruption);color:var(--sbb-pearl-chain-vertical-item-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line--disruption{--sbb-pearl-chain-vertical-item-color-disruption: Highlight}}.sbb-pearl-chain-vertical-item__line--past{border-color:var(--sbb-pearl-chain-vertical-item-color-past);background-color:var(--sbb-pearl-chain-vertical-item-color-past);color:var(--sbb-pearl-chain-vertical-item-color-past)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line--past{--sbb-pearl-chain-vertical-item-color-past: GrayText}}.sbb-pearl-chain-vertical-item__line--walk{border-color:var(--sbb-pearl-chain-vertical-item-color-walk);background-color:var(--sbb-pearl-chain-vertical-item-color-walk);color:var(--sbb-pearl-chain-vertical-item-color-walk)}.sbb-pearl-chain-vertical-item__bullet{position:relative;inset-inline-start:var(--sbb-pearl-chain-vertical-item-inline-start);transform:var(--sbb-pearl-chain-vertical-item-transform);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain-vertical-item__bullet--start-end{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end)}.sbb-pearl-chain-vertical-item__bullet--stop{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain-vertical-item__bullet--disruption{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--disruption{--sbb-pearl-chain-bullet-color: Highlight}}.sbb-pearl-chain-vertical-item__bullet--irrelevant,.sbb-pearl-chain-vertical-item__bullet--past{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--irrelevant,.sbb-pearl-chain-vertical-item__bullet--past{--sbb-pearl-chain-bullet-color: GrayText !important}}.sbb-pearl-chain-vertical-item__bullet--stop.sbb-pearl-chain-vertical-item__bullet--irrelevant{--sbb-pearl-chain-bullet-border-width: var(--sbb-border-width-1x);min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain-vertical-item__bullet--start-end.sbb-pearl-chain-vertical-item__bullet--skipped{border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain-vertical-item__bullet--start-end.sbb-pearl-chain-vertical-item__bullet--skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--start-end.sbb-pearl-chain-vertical-item__bullet--skipped:before{background:Highlight}}.sbb-pearl-chain-vertical-item__bullet--stop.sbb-pearl-chain-vertical-item__bullet--skipped{--sbb-pearl-chain-bullet-crossed-width: .706875rem;--sbb-pearl-chain-bullet-crossed-height: .1875rem;min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain-vertical-item__bullet--stop.sbb-pearl-chain-vertical-item__bullet--skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--stop.sbb-pearl-chain-vertical-item__bullet--skipped:before{background:Highlight}}.sbb-pearl-chain-vertical-item__bullet--position{inset-block-start:var(--sbb-pearl-chain-vertical-item-position);position:absolute;left:50%;transform:translate(-50%);min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--position{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain-vertical-item__bullet--position{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--position{--sbb-pearl-chain-bullet-color: Highlight}}@keyframes pearl-chain-bullet-position-pulse{0%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}25%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}50%{box-shadow:0 0 0 .1875rem var(--sbb-color-red-alpha-20)}to{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}}.sbb-pearl-chain-vertical-item__bullet--position{animation:pearl-chain-bullet-position-pulse var(--sbb-pearl-chain-bullet-animation-duration) var(--sbb-pearl-chain-bullet-animation-easing) infinite}:host([disable-animation]) .sbb-pearl-chain-vertical-item__bullet--position{animation:unset!important}`;
|
|
11
|
+
let q = (() => {
|
|
12
|
+
var c, n, b;
|
|
13
|
+
let e = [D("sbb-pearl-chain-vertical-item")], a, t = [], r, g = j, f, w = [], k = [], z, x = [], y = [];
|
|
14
|
+
return b = class extends g {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
v(this, c, h(this, w, null));
|
|
18
|
+
v(this, n, (h(this, k), h(this, x, !1)));
|
|
19
|
+
h(this, y);
|
|
20
|
+
}
|
|
21
|
+
/** The pearlChainVerticalItemAttributes Prop for styling the bullets and line.*/
|
|
22
|
+
get pearlChainVerticalItemAttributes() {
|
|
23
|
+
return d(this, c);
|
|
24
|
+
}
|
|
25
|
+
set pearlChainVerticalItemAttributes(l) {
|
|
26
|
+
m(this, c, l);
|
|
27
|
+
}
|
|
28
|
+
/** If true, the position won't be animated. */
|
|
29
|
+
get disableAnimation() {
|
|
30
|
+
return d(this, n);
|
|
31
|
+
}
|
|
32
|
+
set disableAnimation(l) {
|
|
33
|
+
m(this, n, l);
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
const { bulletType: l, lineType: i, lineColor: o, hideLine: V, minHeight: T, bulletSize: $, position: s } = this.pearlChainVerticalItemAttributes || {}, H = s && s > 0 && s <= 100 ? "sbb-pearl-chain-vertical-item__bullet--past" : `sbb-pearl-chain-vertical-item__bullet--${l}`;
|
|
37
|
+
return p`
|
|
38
|
+
<div class="sbb-pearl-chain-vertical-item__column" style="height: ${T}px;">
|
|
39
|
+
<slot name="left"></slot>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
aria-hidden="true"
|
|
43
|
+
class="sbb-pearl-chain-vertical-item__column sbb-pearl-chain-vertical-item__column--middle"
|
|
44
|
+
>
|
|
45
|
+
${V ? _ : p`<div
|
|
46
|
+
style="--sbb-pearl-chain-vertical-item-leg-status:${s}%;"
|
|
47
|
+
class="sbb-pearl-chain-vertical-item__line sbb-pearl-chain-vertical-item__line--${i} sbb-pearl-chain-vertical-item__line--${o}"
|
|
48
|
+
></div>`}
|
|
49
|
+
${l ? p`<div
|
|
50
|
+
class="sbb-pearl-chain-vertical-item__bullet sbb-pearl-chain-vertical-item__bullet--${$} ${H}"
|
|
51
|
+
></div>` : _}
|
|
52
|
+
${s && s > 0 ? p`<div
|
|
53
|
+
style="--sbb-pearl-chain-vertical-item-position:${s}%;"
|
|
54
|
+
class="sbb-pearl-chain-vertical-item__bullet--position"
|
|
55
|
+
></div>` : _}
|
|
56
|
+
</div>
|
|
57
|
+
<slot name="right"></slot>
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
}, c = new WeakMap(), n = new WeakMap(), r = b, (() => {
|
|
61
|
+
const l = typeof Symbol == "function" && Symbol.metadata ? Object.create(g[Symbol.metadata] ?? null) : void 0;
|
|
62
|
+
f = [I({ attribute: "pearl-chain-vertical-item-attributes", type: Object })], z = [S(), I({ attribute: "disable-animation", reflect: !0, type: Boolean })], u(b, null, f, { kind: "accessor", name: "pearlChainVerticalItemAttributes", static: !1, private: !1, access: { has: (i) => "pearlChainVerticalItemAttributes" in i, get: (i) => i.pearlChainVerticalItemAttributes, set: (i, o) => {
|
|
63
|
+
i.pearlChainVerticalItemAttributes = o;
|
|
64
|
+
} }, metadata: l }, w, k), u(b, null, z, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (i) => "disableAnimation" in i, get: (i) => i.disableAnimation, set: (i, o) => {
|
|
65
|
+
i.disableAnimation = o;
|
|
66
|
+
} }, metadata: l }, x, y), u(null, a = { value: r }, e, { kind: "class", name: r.name, metadata: l }, null, t), r = a.value, l && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: l });
|
|
67
|
+
})(), b.styles = G, h(r, t), r;
|
|
68
|
+
})();
|
|
69
|
+
export {
|
|
70
|
+
q as SbbPearlChainVerticalItemElement
|
|
71
|
+
};
|