@sbb-esta/lyne-elements-experimental 0.0.0 → 0.52.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/README.md +55 -0
- package/constants-ClrwyPF-.js +12 -0
- package/core/datetime/date-helper.d.ts +27 -0
- package/core/datetime/date-helper.d.ts.map +1 -0
- package/core/datetime.d.ts +2 -0
- package/core/datetime.d.ts.map +1 -0
- package/core/datetime.js +193 -0
- package/core/timetable/access-leg-helper.d.ts +26 -0
- package/core/timetable/access-leg-helper.d.ts.map +1 -0
- package/core/timetable/timetable-helper.d.ts +9 -0
- package/core/timetable/timetable-helper.d.ts.map +1 -0
- package/core/timetable/timetable-properties.d.ts +308 -0
- package/core/timetable/timetable-properties.d.ts.map +1 -0
- package/core/timetable.d.ts +4 -0
- package/core/timetable.d.ts.map +1 -0
- package/core/timetable.js +123 -0
- package/custom-elements.json +1606 -0
- package/development/constants-D72r1E-c.js +22 -0
- package/development/core/datetime/date-helper.d.ts +27 -0
- package/development/core/datetime/date-helper.d.ts.map +1 -0
- package/development/core/datetime.d.ts +2 -0
- package/development/core/datetime.d.ts.map +1 -0
- package/development/core/datetime.js +290 -0
- package/development/core/timetable/access-leg-helper.d.ts +26 -0
- package/development/core/timetable/access-leg-helper.d.ts.map +1 -0
- package/development/core/timetable/timetable-helper.d.ts +9 -0
- package/development/core/timetable/timetable-helper.d.ts.map +1 -0
- package/development/core/timetable/timetable-properties.d.ts +308 -0
- package/development/core/timetable/timetable-properties.d.ts.map +1 -0
- package/development/core/timetable.d.ts +4 -0
- package/development/core/timetable.d.ts.map +1 -0
- package/development/core/timetable.js +164 -0
- package/development/differenceInMinutes-D47vcSvy.js +21 -0
- package/development/format-BOXfsJCN.js +1373 -0
- package/development/isValid-YTpbhEHG.js +52 -0
- package/development/journey-summary/journey-summary.d.ts +57 -0
- package/development/journey-summary/journey-summary.d.ts.map +1 -0
- package/development/journey-summary.d.ts +2 -0
- package/development/journey-summary.d.ts.map +1 -0
- package/development/journey-summary.js +209 -0
- package/development/pearl-chain/pearl-chain.d.ts +41 -0
- package/development/pearl-chain/pearl-chain.d.ts.map +1 -0
- package/development/pearl-chain/pearl-chain.sample-data.d.ts +121 -0
- package/development/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -0
- package/development/pearl-chain-time/pearl-chain-time.d.ts +44 -0
- package/development/pearl-chain-time/pearl-chain-time.d.ts.map +1 -0
- package/development/pearl-chain-time.d.ts +2 -0
- package/development/pearl-chain-time.d.ts.map +1 -0
- package/development/pearl-chain-time.js +208 -0
- package/development/pearl-chain-vertical/pearl-chain-vertical.d.ts +17 -0
- package/development/pearl-chain-vertical/pearl-chain-vertical.d.ts.map +1 -0
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts +35 -0
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts.map +1 -0
- package/development/pearl-chain-vertical-item.d.ts +2 -0
- package/development/pearl-chain-vertical-item.d.ts.map +1 -0
- package/development/pearl-chain-vertical-item.js +368 -0
- package/development/pearl-chain-vertical.d.ts +2 -0
- package/development/pearl-chain-vertical.d.ts.map +1 -0
- package/development/pearl-chain-vertical.js +58 -0
- package/development/pearl-chain.d.ts +2 -0
- package/development/pearl-chain.d.ts.map +1 -0
- package/development/pearl-chain.js +597 -0
- package/development/timetable-duration/timetable-duration.d.ts +23 -0
- package/development/timetable-duration/timetable-duration.d.ts.map +1 -0
- package/development/timetable-duration/timetable-duration.sample-data.d.ts +6 -0
- package/development/timetable-duration/timetable-duration.sample-data.d.ts.map +1 -0
- package/development/timetable-duration.d.ts +2 -0
- package/development/timetable-duration.d.ts.map +1 -0
- package/development/timetable-duration.js +106 -0
- package/development/timetable-row/timetable-row.d.ts +79 -0
- package/development/timetable-row/timetable-row.d.ts.map +1 -0
- package/development/timetable-row/timetable-row.sample-data.d.ts +24 -0
- package/development/timetable-row/timetable-row.sample-data.d.ts.map +1 -0
- package/development/timetable-row.d.ts +2 -0
- package/development/timetable-row.d.ts.map +1 -0
- package/development/timetable-row.js +687 -0
- package/differenceInMinutes-CDpgJIgL.js +19 -0
- package/format-qHhIvnY8.js +1164 -0
- package/index.d.ts +19 -0
- package/index.js +17 -0
- package/isValid-Df_caLp4.js +40 -0
- package/journey-summary/journey-summary.d.ts +57 -0
- package/journey-summary/journey-summary.d.ts.map +1 -0
- package/journey-summary.d.ts +2 -0
- package/journey-summary.d.ts.map +1 -0
- package/journey-summary.js +130 -0
- package/package.json +79 -2
- package/pearl-chain/pearl-chain.d.ts +41 -0
- package/pearl-chain/pearl-chain.d.ts.map +1 -0
- package/pearl-chain/pearl-chain.sample-data.d.ts +121 -0
- package/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -0
- package/pearl-chain-time/pearl-chain-time.d.ts +44 -0
- package/pearl-chain-time/pearl-chain-time.d.ts.map +1 -0
- package/pearl-chain-time.d.ts +2 -0
- package/pearl-chain-time.d.ts.map +1 -0
- package/pearl-chain-time.js +90 -0
- package/pearl-chain-vertical/pearl-chain-vertical.d.ts +17 -0
- package/pearl-chain-vertical/pearl-chain-vertical.d.ts.map +1 -0
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts +35 -0
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts.map +1 -0
- package/pearl-chain-vertical-item.d.ts +2 -0
- package/pearl-chain-vertical-item.d.ts.map +1 -0
- package/pearl-chain-vertical-item.js +48 -0
- package/pearl-chain-vertical.d.ts +2 -0
- package/pearl-chain-vertical.d.ts.map +1 -0
- package/pearl-chain-vertical.js +24 -0
- package/pearl-chain.d.ts +2 -0
- package/pearl-chain.d.ts.map +1 -0
- package/pearl-chain.js +147 -0
- package/timetable-duration/timetable-duration.d.ts +23 -0
- package/timetable-duration/timetable-duration.d.ts.map +1 -0
- package/timetable-duration/timetable-duration.sample-data.d.ts +6 -0
- package/timetable-duration/timetable-duration.sample-data.d.ts.map +1 -0
- package/timetable-duration.d.ts +2 -0
- package/timetable-duration.d.ts.map +1 -0
- package/timetable-duration.js +37 -0
- package/timetable-row/timetable-row.d.ts +79 -0
- package/timetable-row/timetable-row.d.ts.map +1 -0
- package/timetable-row/timetable-row.sample-data.d.ts +24 -0
- package/timetable-row/timetable-row.sample-data.d.ts.map +1 -0
- package/timetable-row.d.ts +2 -0
- package/timetable-row.d.ts.map +1 -0
- package/timetable-row.js +386 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/core/timetable.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { i18nWalkingDistanceDeparture as k, i18nWalkingDistanceArrival as A } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
2
|
+
import { html as b, nothing as m } from "lit";
|
|
3
|
+
import "@sbb-esta/lyne-elements/icon.js";
|
|
4
|
+
const x = (t) => (t == null ? void 0 : t.a) === "PTRideLeg", h = (t) => (t == null ? void 0 : t.a) === "PTConnectionLeg", C = (t) => {
|
|
5
|
+
var n, r, u, s, a, o;
|
|
6
|
+
const i = ((n = t == null ? void 0 : t.text) == null ? void 0 : n.template) && t.text.template.indexOf("(") + 1, e = (s = (r = t == null ? void 0 : t.text) == null ? void 0 : r.template) == null ? void 0 : s.substring(
|
|
7
|
+
i || 0,
|
|
8
|
+
(u = t == null ? void 0 : t.text) == null ? void 0 : u.template.indexOf(")")
|
|
9
|
+
);
|
|
10
|
+
return {
|
|
11
|
+
duration: e && +e.substring(0, e.length - 1) || 0,
|
|
12
|
+
text: ((o = (a = t == null ? void 0 : t.text) == null ? void 0 : a.template) == null ? void 0 : o.split("(")[0]) || ""
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
function w(t, i) {
|
|
16
|
+
var r, u;
|
|
17
|
+
const e = h(t) ? t : null, n = e ? (r = e == null ? void 0 : e.notices) == null ? void 0 : r.filter((s) => i.includes(s.name))[0] : null;
|
|
18
|
+
return n ? {
|
|
19
|
+
duration: (e == null ? void 0 : e.duration) || 0,
|
|
20
|
+
text: ((u = n == null ? void 0 : n.text) == null ? void 0 : u.template) || "",
|
|
21
|
+
icon: "walk-small"
|
|
22
|
+
} : null;
|
|
23
|
+
}
|
|
24
|
+
function R(t, i) {
|
|
25
|
+
var r, u, s;
|
|
26
|
+
const e = x(t) ? (u = (r = t == null ? void 0 : t.serviceJourney) == null ? void 0 : r.notices) == null ? void 0 : u.filter(
|
|
27
|
+
(a) => ["CI"].includes(a.name)
|
|
28
|
+
)[0] : null, n = e && C(e);
|
|
29
|
+
return e ? {
|
|
30
|
+
duration: ((n == null ? void 0 : n.duration) || 0) + (i || 0),
|
|
31
|
+
text: (n == null ? void 0 : n.text) || "",
|
|
32
|
+
icon: `sa-${(s = e == null ? void 0 : e.name) == null ? void 0 : s.toLowerCase()}`
|
|
33
|
+
} : null;
|
|
34
|
+
}
|
|
35
|
+
function Y(t, i) {
|
|
36
|
+
var r, u, s;
|
|
37
|
+
const e = x(t) ? (u = (r = t == null ? void 0 : t.serviceJourney) == null ? void 0 : r.notices) == null ? void 0 : u.filter(
|
|
38
|
+
(a) => ["CO"].includes(a.name)
|
|
39
|
+
)[0] : null, n = e && C(e);
|
|
40
|
+
return e ? {
|
|
41
|
+
duration: ((n == null ? void 0 : n.duration) || 0) + (i || 0),
|
|
42
|
+
text: (n == null ? void 0 : n.text) || "",
|
|
43
|
+
icon: `sa-${(s = e == null ? void 0 : e.name) == null ? void 0 : s.toLowerCase()}`
|
|
44
|
+
} : null;
|
|
45
|
+
}
|
|
46
|
+
function T(t, i, e, n, r) {
|
|
47
|
+
return b`
|
|
48
|
+
<span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${r}">
|
|
49
|
+
<sbb-icon name=${i}></sbb-icon>
|
|
50
|
+
<time datetime=${t + "M"}>
|
|
51
|
+
<span class="sbb-screen-reader-only">
|
|
52
|
+
${!n && r ? r === "departure" ? k[e] : A[e] : m}
|
|
53
|
+
${n ? b`<span>${n}</span>` : m}
|
|
54
|
+
</span>
|
|
55
|
+
${t}
|
|
56
|
+
<span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
|
|
57
|
+
<span class="sbb-screen-reader-only">min</span>
|
|
58
|
+
</time>
|
|
59
|
+
</span>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
function f(t, i, e) {
|
|
63
|
+
return b`
|
|
64
|
+
<span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${e}">
|
|
65
|
+
<sbb-icon name="walk-small"></sbb-icon>
|
|
66
|
+
<time datetime=${t + "M"}>
|
|
67
|
+
<span class="sbb-screen-reader-only">${i}</span>
|
|
68
|
+
${t}
|
|
69
|
+
<span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
|
|
70
|
+
</time>
|
|
71
|
+
</span>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
function E(t, i, e, n) {
|
|
75
|
+
const r = t && t.filter((_) => x(_) || h(_))[0], u = ["YM", "YB", "Y", "YT"], s = w(r, u), a = R(r, i), o = i ? {
|
|
76
|
+
text: k[n],
|
|
77
|
+
duration: i,
|
|
78
|
+
icon: "walk-small"
|
|
79
|
+
} : null, L = () => s || (o && !a && !s ? o : a || null);
|
|
80
|
+
function v() {
|
|
81
|
+
return b`
|
|
82
|
+
${s ? f(s.duration, s.text, "left") : m}
|
|
83
|
+
${o && !a && !s ? f(o.duration, o.text, "left") : m}
|
|
84
|
+
${a ? T(
|
|
85
|
+
a.duration,
|
|
86
|
+
a.icon,
|
|
87
|
+
n,
|
|
88
|
+
a.text,
|
|
89
|
+
"departure"
|
|
90
|
+
) : m}
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
const $ = t && t[t.length - 1], d = (h($) || x($)) && $, c = d && w(d, u), l = d && Y(d, e), p = e ? {
|
|
94
|
+
text: A[n],
|
|
95
|
+
duration: e,
|
|
96
|
+
icon: "walk-small"
|
|
97
|
+
} : null, y = () => c || (p && !l && !c ? p : l || null);
|
|
98
|
+
function D() {
|
|
99
|
+
return b`
|
|
100
|
+
${c ? f(c.duration, c.text, "right") : m}
|
|
101
|
+
${p && !l && !c ? f(p.duration, p.text, "right") : m}
|
|
102
|
+
${l ? T(
|
|
103
|
+
l.duration,
|
|
104
|
+
l.icon,
|
|
105
|
+
n,
|
|
106
|
+
l.text,
|
|
107
|
+
"arrival"
|
|
108
|
+
) : m}
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
renderDepartureTimeAttribute: v,
|
|
113
|
+
renderArrivalTimeAttribute: D,
|
|
114
|
+
departureTimeAttribute: L(),
|
|
115
|
+
arrivalTimeAttribute: y()
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export {
|
|
119
|
+
C as extractTimeAndStringFromNoticeText,
|
|
120
|
+
E as getDepartureArrivalTimeAttribute,
|
|
121
|
+
h as isConnectionLeg,
|
|
122
|
+
x as isRideLeg
|
|
123
|
+
};
|