@sbb-esta/lyne-elements-experimental 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/datetime.js +116 -105
- package/core/timetable/access-leg-helper.d.ts +2 -1
- package/core/timetable/access-leg-helper.d.ts.map +1 -1
- package/core/timetable.js +111 -76
- package/custom-elements.json +44 -0
- package/development/core/datetime.js +53 -51
- package/development/core/timetable/access-leg-helper.d.ts +2 -1
- package/development/core/timetable/access-leg-helper.d.ts.map +1 -1
- package/development/core/timetable.js +57 -22
- package/development/differenceInMinutes-Cmyza6nm.js +26 -0
- package/development/format-DTy5_IOt.js +1371 -0
- package/development/isValid-DO_pHwcW.js +53 -0
- package/development/journey-summary.js +4 -17
- package/development/pearl-chain/pearl-chain.sample-data.d.ts +1 -0
- package/development/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -1
- package/development/pearl-chain-time/pearl-chain-time.d.ts +2 -0
- package/development/pearl-chain-time/pearl-chain-time.d.ts.map +1 -1
- package/development/pearl-chain-time.js +21 -21
- package/development/pearl-chain-vertical-item.js +2 -15
- package/development/pearl-chain-vertical.js +2 -15
- package/development/pearl-chain.js +8 -25
- package/development/timetable-duration.js +2 -15
- package/development/timetable-row/timetable-row.d.ts +7 -0
- package/development/timetable-row/timetable-row.d.ts.map +1 -1
- package/development/timetable-row/timetable-row.sample-data.d.ts +2 -0
- package/development/timetable-row/timetable-row.sample-data.d.ts.map +1 -1
- package/development/timetable-row.js +9 -17
- package/development/toDate-B6IBgPYH.js +24 -0
- package/differenceInMinutes-BI2zjbtS.js +23 -0
- package/{format-fWxoS2xH.js → format-oBQcGL50.js} +343 -344
- package/isValid-mroh13Xp.js +45 -0
- package/journey-summary.js +2 -2
- package/package.json +2 -2
- package/pearl-chain/pearl-chain.sample-data.d.ts +1 -0
- package/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -1
- package/pearl-chain-time/pearl-chain-time.d.ts +2 -0
- package/pearl-chain-time/pearl-chain-time.d.ts.map +1 -1
- package/pearl-chain-time.js +38 -34
- package/pearl-chain.js +57 -59
- package/timetable-row/timetable-row.d.ts +7 -0
- package/timetable-row/timetable-row.d.ts.map +1 -1
- package/timetable-row/timetable-row.sample-data.d.ts +2 -0
- package/timetable-row/timetable-row.sample-data.d.ts.map +1 -1
- package/timetable-row.js +41 -36
- package/toDate-DQg4ZFnf.js +15 -0
- package/constants-DSR8hPvP.js +0 -16
- package/development/constants-BMGwMkN3.js +0 -30
- package/development/differenceInMinutes-DHtPDiUE.js +0 -30
- package/development/format-DkbylFCM.js +0 -1373
- package/development/isValid-BVccOlli.js +0 -44
- package/differenceInMinutes-BhHyuJc4.js +0 -28
- package/isValid-DSjxf8eh.js +0 -36
package/core/datetime.js
CHANGED
|
@@ -1,156 +1,167 @@
|
|
|
1
|
-
import { i18nDurationDay as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
function x(t, e) {
|
|
6
|
-
const
|
|
7
|
-
return isNaN(e) ?
|
|
8
|
-
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { i18nDurationDay as h, i18nDurationHour as T, i18nDurationMinute as p } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
2
|
+
import { t as d, c as N, a as m, b as w } from "../toDate-DQg4ZFnf.js";
|
|
3
|
+
import { n as I, d as y, i as U } from "../isValid-mroh13Xp.js";
|
|
4
|
+
import { g as C, a as Y, d as F } from "../differenceInMinutes-BI2zjbtS.js";
|
|
5
|
+
function x(t, e, n) {
|
|
6
|
+
const r = d(t, n == null ? void 0 : n.in);
|
|
7
|
+
return isNaN(e) ? N(t, NaN) : (e && r.setDate(r.getDate() + e), r);
|
|
8
|
+
}
|
|
9
|
+
function z(t, e, n) {
|
|
10
|
+
return N(t, +d(t) + e);
|
|
11
|
+
}
|
|
12
|
+
function H(t, e, n) {
|
|
13
|
+
return z(t, e * m);
|
|
14
|
+
}
|
|
15
|
+
function S(t, e, n) {
|
|
16
|
+
const [r, i] = I(
|
|
17
|
+
n == null ? void 0 : n.in,
|
|
18
|
+
t,
|
|
19
|
+
e
|
|
20
|
+
), s = M(r, i), u = Math.abs(
|
|
21
|
+
y(r, i)
|
|
22
|
+
);
|
|
23
|
+
r.setDate(r.getDate() - s * u);
|
|
24
|
+
const a = +(M(r, i) === -s), c = s * (u - a);
|
|
25
|
+
return c === 0 ? 0 : c;
|
|
26
|
+
}
|
|
27
|
+
function M(t, e) {
|
|
19
28
|
const n = t.getFullYear() - e.getFullYear() || t.getMonth() - e.getMonth() || t.getDate() - e.getDate() || t.getHours() - e.getHours() || t.getMinutes() - e.getMinutes() || t.getSeconds() - e.getSeconds() || t.getMilliseconds() - e.getMilliseconds();
|
|
20
29
|
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
21
30
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
31
|
+
function Z(t, e, n) {
|
|
32
|
+
const [r, i] = I(
|
|
33
|
+
n == null ? void 0 : n.in,
|
|
34
|
+
t,
|
|
35
|
+
e
|
|
36
|
+
), s = (+r - +i) / m;
|
|
24
37
|
return C(n == null ? void 0 : n.roundingMethod)(s);
|
|
25
38
|
}
|
|
26
|
-
function
|
|
27
|
-
return x(t, -e);
|
|
39
|
+
function v(t, e, n) {
|
|
40
|
+
return x(t, -e, n);
|
|
28
41
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
if (
|
|
33
|
-
const o =
|
|
34
|
-
|
|
42
|
+
function O(t, e) {
|
|
43
|
+
const n = () => N(e == null ? void 0 : e.in, NaN), i = k(t);
|
|
44
|
+
let s;
|
|
45
|
+
if (i.date) {
|
|
46
|
+
const o = W(i.date, 2);
|
|
47
|
+
s = j(o.restDateString, o.year);
|
|
35
48
|
}
|
|
36
|
-
if (!
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (u = E(s.timezone), isNaN(u))
|
|
44
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
49
|
+
if (!s || isNaN(+s)) return n();
|
|
50
|
+
const u = +s;
|
|
51
|
+
let a = 0, c;
|
|
52
|
+
if (i.time && (a = A(i.time), isNaN(a)))
|
|
53
|
+
return n();
|
|
54
|
+
if (i.timezone) {
|
|
55
|
+
if (c = E(i.timezone), isNaN(c)) return n();
|
|
45
56
|
} else {
|
|
46
|
-
const o = new Date(
|
|
47
|
-
return
|
|
57
|
+
const o = new Date(u + a), D = d(0, e == null ? void 0 : e.in);
|
|
58
|
+
return D.setFullYear(
|
|
48
59
|
o.getUTCFullYear(),
|
|
49
60
|
o.getUTCMonth(),
|
|
50
61
|
o.getUTCDate()
|
|
51
|
-
),
|
|
62
|
+
), D.setHours(
|
|
52
63
|
o.getUTCHours(),
|
|
53
64
|
o.getUTCMinutes(),
|
|
54
65
|
o.getUTCSeconds(),
|
|
55
66
|
o.getUTCMilliseconds()
|
|
56
|
-
),
|
|
67
|
+
), D;
|
|
57
68
|
}
|
|
58
|
-
return
|
|
69
|
+
return d(u + a + c, e == null ? void 0 : e.in);
|
|
59
70
|
}
|
|
60
|
-
const
|
|
71
|
+
const l = {
|
|
61
72
|
dateTimeDelimiter: /[T ]/,
|
|
62
73
|
timeZoneDelimiter: /[Z ]/i,
|
|
63
74
|
timezone: /([Z+-].*)$/
|
|
64
|
-
},
|
|
65
|
-
function
|
|
66
|
-
const e = {}, n = t.split(
|
|
67
|
-
let
|
|
75
|
+
}, _ = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, b = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, R = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
76
|
+
function k(t) {
|
|
77
|
+
const e = {}, n = t.split(l.dateTimeDelimiter);
|
|
78
|
+
let r;
|
|
68
79
|
if (n.length > 2)
|
|
69
80
|
return e;
|
|
70
|
-
if (/:/.test(n[0]) ?
|
|
81
|
+
if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], l.timeZoneDelimiter.test(e.date) && (e.date = t.split(l.timeZoneDelimiter)[0], r = t.substr(
|
|
71
82
|
e.date.length,
|
|
72
83
|
t.length
|
|
73
|
-
))),
|
|
74
|
-
const
|
|
75
|
-
|
|
84
|
+
))), r) {
|
|
85
|
+
const i = l.timezone.exec(r);
|
|
86
|
+
i ? (e.time = r.replace(i[1], ""), e.timezone = i[1]) : e.time = r;
|
|
76
87
|
}
|
|
77
88
|
return e;
|
|
78
89
|
}
|
|
79
|
-
function
|
|
90
|
+
function W(t, e) {
|
|
80
91
|
const n = new RegExp(
|
|
81
92
|
"^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
|
|
82
|
-
),
|
|
83
|
-
if (!
|
|
84
|
-
const
|
|
93
|
+
), r = t.match(n);
|
|
94
|
+
if (!r) return { year: NaN, restDateString: "" };
|
|
95
|
+
const i = r[1] ? parseInt(r[1]) : null, s = r[2] ? parseInt(r[2]) : null;
|
|
85
96
|
return {
|
|
86
|
-
year:
|
|
87
|
-
restDateString: t.slice((
|
|
97
|
+
year: s === null ? i : s * 100,
|
|
98
|
+
restDateString: t.slice((r[1] || r[2]).length)
|
|
88
99
|
};
|
|
89
100
|
}
|
|
90
101
|
function j(t, e) {
|
|
91
102
|
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
92
|
-
const n = t.match(
|
|
103
|
+
const n = t.match(_);
|
|
93
104
|
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
return
|
|
105
|
+
const r = !!n[4], i = f(n[1]), s = f(n[2]) - 1, u = f(n[3]), a = f(n[4]), c = f(n[5]) - 1;
|
|
106
|
+
if (r)
|
|
107
|
+
return G(e, a, c) ? J(e, a, c) : /* @__PURE__ */ new Date(NaN);
|
|
97
108
|
{
|
|
98
|
-
const
|
|
99
|
-
return !
|
|
109
|
+
const o = /* @__PURE__ */ new Date(0);
|
|
110
|
+
return !q(e, s, u) || !B(e, i) ? /* @__PURE__ */ new Date(NaN) : (o.setUTCFullYear(e, s, Math.max(i, u)), o);
|
|
100
111
|
}
|
|
101
112
|
}
|
|
102
|
-
function
|
|
113
|
+
function f(t) {
|
|
103
114
|
return t ? parseInt(t) : 1;
|
|
104
115
|
}
|
|
105
116
|
function A(t) {
|
|
106
|
-
const e = t.match(
|
|
117
|
+
const e = t.match(b);
|
|
107
118
|
if (!e) return NaN;
|
|
108
|
-
const n =
|
|
109
|
-
return
|
|
119
|
+
const n = g(e[1]), r = g(e[2]), i = g(e[3]);
|
|
120
|
+
return K(n, r, i) ? n * m + r * w + i * 1e3 : NaN;
|
|
110
121
|
}
|
|
111
|
-
function
|
|
122
|
+
function g(t) {
|
|
112
123
|
return t && parseFloat(t.replace(",", ".")) || 0;
|
|
113
124
|
}
|
|
114
125
|
function E(t) {
|
|
115
126
|
if (t === "Z") return 0;
|
|
116
|
-
const e = t.match(
|
|
127
|
+
const e = t.match(R);
|
|
117
128
|
if (!e) return 0;
|
|
118
|
-
const n = e[1] === "+" ? -1 : 1,
|
|
119
|
-
return
|
|
129
|
+
const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), i = e[3] && parseInt(e[3]) || 0;
|
|
130
|
+
return P(r, i) ? n * (r * m + i * w) : NaN;
|
|
120
131
|
}
|
|
121
132
|
function J(t, e, n) {
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
return
|
|
133
|
+
const r = /* @__PURE__ */ new Date(0);
|
|
134
|
+
r.setUTCFullYear(t, 0, 4);
|
|
135
|
+
const i = r.getUTCDay() || 7, s = (e - 1) * 7 + n + 1 - i;
|
|
136
|
+
return r.setUTCDate(r.getUTCDate() + s), r;
|
|
126
137
|
}
|
|
127
|
-
const
|
|
128
|
-
function
|
|
138
|
+
const V = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
139
|
+
function $(t) {
|
|
129
140
|
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
130
141
|
}
|
|
131
|
-
function
|
|
132
|
-
return e >= 0 && e <= 11 && n >= 1 && n <= (
|
|
142
|
+
function q(t, e, n) {
|
|
143
|
+
return e >= 0 && e <= 11 && n >= 1 && n <= (V[e] || ($(t) ? 29 : 28));
|
|
133
144
|
}
|
|
134
|
-
function
|
|
135
|
-
return e >= 1 && e <= (
|
|
145
|
+
function B(t, e) {
|
|
146
|
+
return e >= 1 && e <= ($(t) ? 366 : 365);
|
|
136
147
|
}
|
|
137
|
-
function
|
|
148
|
+
function G(t, e, n) {
|
|
138
149
|
return e >= 1 && e <= 53 && n >= 0 && n <= 6;
|
|
139
150
|
}
|
|
140
|
-
function
|
|
151
|
+
function K(t, e, n) {
|
|
141
152
|
return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
|
|
142
153
|
}
|
|
143
|
-
function
|
|
154
|
+
function P(t, e) {
|
|
144
155
|
return e >= 0 && e <= 59;
|
|
145
156
|
}
|
|
146
|
-
function
|
|
157
|
+
function Q(t, e, n) {
|
|
147
158
|
return H(t, -e);
|
|
148
159
|
}
|
|
149
|
-
function
|
|
160
|
+
function ne(t) {
|
|
150
161
|
if (!t)
|
|
151
162
|
return;
|
|
152
|
-
const e =
|
|
153
|
-
if (
|
|
163
|
+
const e = O(t);
|
|
164
|
+
if (U(e)) {
|
|
154
165
|
if (t.includes("Z"))
|
|
155
166
|
return new Date(t.replace("Z", ""));
|
|
156
167
|
if (t.includes("T")) {
|
|
@@ -161,26 +172,26 @@ function te(t) {
|
|
|
161
172
|
return new Date(t);
|
|
162
173
|
}
|
|
163
174
|
}
|
|
164
|
-
const
|
|
165
|
-
const n = [],
|
|
166
|
-
let
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
`${
|
|
170
|
-
),
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
`${
|
|
174
|
-
),
|
|
175
|
-
const
|
|
176
|
-
return
|
|
177
|
-
`${
|
|
175
|
+
const re = (t, e) => {
|
|
176
|
+
const n = [], r = [];
|
|
177
|
+
let s = Y(0, t);
|
|
178
|
+
const u = S(s, 0);
|
|
179
|
+
u > 0 && (n.push(`${u} d`), e && r.push(
|
|
180
|
+
`${u} ${u > 1 ? h.multiple.long[e] : h.single.long[e]}`
|
|
181
|
+
), s = v(s, u));
|
|
182
|
+
const a = Z(s, 0);
|
|
183
|
+
a > 0 && (n.push(`${a} h`), e && r.push(
|
|
184
|
+
`${a} ${a > 1 ? T.multiple.long[e] : T.single.long[e]}`
|
|
185
|
+
), s = Q(s, a));
|
|
186
|
+
const c = F(s, 0);
|
|
187
|
+
return c > 0 && (n.push(`${c} min`), e && r.push(
|
|
188
|
+
`${c} ${c > 1 ? p.multiple.long[e] : p.single.long[e]}`
|
|
178
189
|
)), {
|
|
179
190
|
short: n.join(" "),
|
|
180
|
-
long:
|
|
191
|
+
long: r.join(" ")
|
|
181
192
|
};
|
|
182
193
|
};
|
|
183
194
|
export {
|
|
184
|
-
|
|
185
|
-
|
|
195
|
+
re as durationToTime,
|
|
196
|
+
ne as removeTimezoneFromISOTimeString
|
|
186
197
|
};
|
|
@@ -10,12 +10,13 @@ interface IAccessAttribute {
|
|
|
10
10
|
* @param departureWalk: The walking distance in minutes from the departure point to the first leg.
|
|
11
11
|
* @param arrivalWalk: The walking distance in minutes from the last leg to the arrival point.
|
|
12
12
|
* @param currentLanguage: The current language for localization.
|
|
13
|
+
* @param a11yFootpath: Whether the a11y-icon should be shown.
|
|
13
14
|
* @returns renderDepartureTimeAttribute: A function that renders the element for the departure time attribute.
|
|
14
15
|
* @returns renderArrivalTimeAttribute: A function that renders the element for the arrival time attribute.
|
|
15
16
|
* @returns arrivalTimeAttribute: The access attribute for the arrival time.
|
|
16
17
|
* @returns departureTimeAttribute: The access attribute for the departure time.
|
|
17
18
|
*/
|
|
18
|
-
export declare function getDepartureArrivalTimeAttribute(legs: Leg[], departureWalk: number, arrivalWalk: number, currentLanguage: string): {
|
|
19
|
+
export declare function getDepartureArrivalTimeAttribute(legs: Leg[], departureWalk: number, arrivalWalk: number, currentLanguage: string, a11yFootpath?: boolean): {
|
|
19
20
|
renderDepartureTimeAttribute: () => TemplateResult;
|
|
20
21
|
renderArrivalTimeAttribute: () => TemplateResult;
|
|
21
22
|
departureTimeAttribute: IAccessAttribute | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access-leg-helper.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/core/timetable/access-leg-helper.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAQ1C,OAAO,KAAK,EAAE,GAAG,EAA8B,MAAM,2BAA2B,CAAC;AAEjF,OAAO,iCAAiC,CAAC;AAEzC,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;
|
|
1
|
+
{"version":3,"file":"access-leg-helper.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/core/timetable/access-leg-helper.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAQ1C,OAAO,KAAK,EAAE,GAAG,EAA8B,MAAM,2BAA2B,CAAC;AAEjF,OAAO,iCAAiC,CAAC;AAEzC,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAuID;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,GAAG,EAAE,EACX,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,OAAO,GACrB;IACD,4BAA4B,EAAE,MAAM,cAAc,CAAC;IACnD,0BAA0B,EAAE,MAAM,cAAc,CAAC;IACjD,sBAAsB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChD,oBAAoB,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC/C,CAiJA"}
|
package/core/timetable.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { i18nWalkingDistanceDeparture as
|
|
2
|
-
import { html as
|
|
1
|
+
import { i18nWalkingDistanceDeparture as w, i18nWalkingDistanceArrival as T } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
2
|
+
import { html as f, nothing as b } from "lit";
|
|
3
3
|
import "@sbb-esta/lyne-elements/icon.js";
|
|
4
|
-
const
|
|
5
|
-
var
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
(
|
|
4
|
+
const $ = (t) => (t == null ? void 0 : t.__typename) === "PTRideLeg", _ = (t) => (t == null ? void 0 : t.__typename) === "PTConnectionLeg", v = (t) => {
|
|
5
|
+
var r, e, i, u, a, s;
|
|
6
|
+
const l = ((r = t == null ? void 0 : t.text) == null ? void 0 : r.template) && t.text.template.indexOf("(") + 1, n = (u = (e = t == null ? void 0 : t.text) == null ? void 0 : e.template) == null ? void 0 : u.substring(
|
|
7
|
+
l || 0,
|
|
8
|
+
(i = t == null ? void 0 : t.text) == null ? void 0 : i.template.indexOf(")")
|
|
9
9
|
);
|
|
10
10
|
return {
|
|
11
|
-
duration:
|
|
12
|
-
text: ((
|
|
11
|
+
duration: n && +n.substring(0, n.length - 1) || 0,
|
|
12
|
+
text: ((s = (a = t == null ? void 0 : t.text) == null ? void 0 : a.template) == null ? void 0 : s.split("(")[0]) || ""
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
function
|
|
16
|
-
var
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
duration: (
|
|
20
|
-
text: ((
|
|
15
|
+
function k(t, l) {
|
|
16
|
+
var e, i;
|
|
17
|
+
const n = _(t) ? t : null, r = n ? (e = n == null ? void 0 : n.notices) == null ? void 0 : e.filter((u) => l.includes(u.name))[0] : null;
|
|
18
|
+
return r ? {
|
|
19
|
+
duration: (n == null ? void 0 : n.duration) || 0,
|
|
20
|
+
text: ((i = r == null ? void 0 : r.text) == null ? void 0 : i.template) || "",
|
|
21
21
|
icon: "walk-small"
|
|
22
22
|
} : null;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
var
|
|
26
|
-
const e =
|
|
27
|
-
(
|
|
28
|
-
)[0] : null,
|
|
24
|
+
function M(t, l, n, r) {
|
|
25
|
+
var u, a, s;
|
|
26
|
+
const e = $(t) ? (a = (u = t == null ? void 0 : t.serviceJourney) == null ? void 0 : u.notices) == null ? void 0 : a.filter(
|
|
27
|
+
(m) => ["CI"].includes(m.name)
|
|
28
|
+
)[0] : null, i = e && v(e);
|
|
29
29
|
return e ? {
|
|
30
|
-
duration: ((
|
|
31
|
-
text:
|
|
32
|
-
icon: `sa-${(s = e == null ? void 0 : e.name) == null ? void 0 : s.toLowerCase()}`
|
|
30
|
+
duration: ((i == null ? void 0 : i.duration) || 0) + (l || 0),
|
|
31
|
+
text: n ? w[r] : (i == null ? void 0 : i.text) || "",
|
|
32
|
+
icon: n ? "wheelchair-small" : `sa-${(s = e == null ? void 0 : e.name) == null ? void 0 : s.toLowerCase()}`
|
|
33
33
|
} : null;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
var
|
|
37
|
-
const e =
|
|
38
|
-
(
|
|
39
|
-
)[0] : null,
|
|
35
|
+
function O(t, l, n, r) {
|
|
36
|
+
var u, a, s;
|
|
37
|
+
const e = $(t) ? (a = (u = t == null ? void 0 : t.serviceJourney) == null ? void 0 : u.notices) == null ? void 0 : a.filter(
|
|
38
|
+
(m) => ["CO"].includes(m.name)
|
|
39
|
+
)[0] : null, i = e && v(e);
|
|
40
40
|
return e ? {
|
|
41
|
-
duration: ((
|
|
42
|
-
text:
|
|
43
|
-
icon: `sa-${(s = e == null ? void 0 : e.name) == null ? void 0 : s.toLowerCase()}`
|
|
41
|
+
duration: ((i == null ? void 0 : i.duration) || 0) + (l || 0),
|
|
42
|
+
text: n ? T[r] : (i == null ? void 0 : i.text) || "",
|
|
43
|
+
icon: n ? "wheelchair-small" : `sa-${(s = e == null ? void 0 : e.name) == null ? void 0 : s.toLowerCase()}`
|
|
44
44
|
} : null;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
48
|
-
<span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${
|
|
49
|
-
<sbb-icon name=${
|
|
46
|
+
function C(t, l, n, r, e) {
|
|
47
|
+
return f`
|
|
48
|
+
<span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${l}-${e}">
|
|
49
|
+
<sbb-icon name=${l}></sbb-icon>
|
|
50
50
|
<time datetime=${t + "M"}>
|
|
51
51
|
<span class="sbb-screen-reader-only">
|
|
52
|
-
${!
|
|
53
|
-
${
|
|
52
|
+
${!r && e ? e === "departure" ? w[n] : T[n] : b}
|
|
53
|
+
${r ? f`<span>${r}</span>` : b}
|
|
54
54
|
</span>
|
|
55
55
|
${t}
|
|
56
56
|
<span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
|
|
@@ -59,65 +59,100 @@ function T(t, i, e, n, r) {
|
|
|
59
59
|
</span>
|
|
60
60
|
`;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
64
|
-
<span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${
|
|
65
|
-
<sbb-icon name
|
|
62
|
+
function p(t, l, n, r) {
|
|
63
|
+
return f`
|
|
64
|
+
<span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${r}-${n}">
|
|
65
|
+
<sbb-icon name=${r}></sbb-icon>
|
|
66
66
|
<time datetime=${t + "M"}>
|
|
67
|
-
<span class="sbb-screen-reader-only">${
|
|
67
|
+
<span class="sbb-screen-reader-only">${l}</span>
|
|
68
68
|
${t}
|
|
69
69
|
<span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
|
|
70
70
|
</time>
|
|
71
71
|
</span>
|
|
72
72
|
`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
function I(t, l, n, r, e) {
|
|
75
|
+
const i = t && t.filter((A) => $(A) || _(A))[0], u = ["YM", "YB", "Y", "YT"], a = k(i, u), s = M(
|
|
76
|
+
i,
|
|
77
|
+
l,
|
|
78
|
+
e,
|
|
79
|
+
r
|
|
80
|
+
), m = l ? {
|
|
81
|
+
text: w[r],
|
|
82
|
+
duration: l,
|
|
83
|
+
icon: e ? "wheelchair-small" : "walk-small"
|
|
84
|
+
} : null, D = () => a || (m && !s && !a ? m : s || null);
|
|
80
85
|
function L() {
|
|
81
|
-
return
|
|
82
|
-
${
|
|
83
|
-
${o && !a && !s ? f(o.duration, o.text, "left") : m}
|
|
84
|
-
${a ? T(
|
|
86
|
+
return f`
|
|
87
|
+
${a ? p(
|
|
85
88
|
a.duration,
|
|
86
|
-
a.icon,
|
|
87
|
-
n,
|
|
88
89
|
a.text,
|
|
90
|
+
"left",
|
|
91
|
+
a.icon
|
|
92
|
+
) : b}
|
|
93
|
+
${m && !s && !a ? p(
|
|
94
|
+
m.duration,
|
|
95
|
+
m.text,
|
|
96
|
+
"left",
|
|
97
|
+
m.icon
|
|
98
|
+
) : b}
|
|
99
|
+
${s ? e ? p(
|
|
100
|
+
s.duration,
|
|
101
|
+
s.text,
|
|
102
|
+
"left",
|
|
103
|
+
s.icon
|
|
104
|
+
) : C(
|
|
105
|
+
s.duration,
|
|
106
|
+
s.icon,
|
|
107
|
+
r,
|
|
108
|
+
s.text,
|
|
89
109
|
"departure"
|
|
90
|
-
) :
|
|
110
|
+
) : b}
|
|
91
111
|
`;
|
|
92
112
|
}
|
|
93
|
-
const
|
|
94
|
-
text:
|
|
95
|
-
duration:
|
|
96
|
-
icon: "walk-small"
|
|
97
|
-
} : null,
|
|
98
|
-
function
|
|
99
|
-
return
|
|
100
|
-
${c ?
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
const h = t && t[t.length - 1], x = (_(h) || $(h)) && h, c = x && k(x, u), o = x && O(x, n, e, r), d = n ? {
|
|
114
|
+
text: T[r],
|
|
115
|
+
duration: n,
|
|
116
|
+
icon: e ? "wheelchair-small" : "walk-small"
|
|
117
|
+
} : null, R = () => c || (d && !o && !c ? d : o || null);
|
|
118
|
+
function Y() {
|
|
119
|
+
return f`
|
|
120
|
+
${c ? p(
|
|
121
|
+
c.duration,
|
|
122
|
+
c.text,
|
|
123
|
+
"right",
|
|
124
|
+
c.icon
|
|
125
|
+
) : b}
|
|
126
|
+
${d && !o && !c ? p(
|
|
127
|
+
d.duration,
|
|
128
|
+
d.text,
|
|
129
|
+
"right",
|
|
130
|
+
d.icon
|
|
131
|
+
) : b}
|
|
132
|
+
${o ? e ? p(
|
|
133
|
+
o.duration,
|
|
134
|
+
o.text,
|
|
135
|
+
"right",
|
|
136
|
+
o.icon
|
|
137
|
+
) : C(
|
|
138
|
+
o.duration,
|
|
139
|
+
o.icon,
|
|
140
|
+
r,
|
|
141
|
+
o.text,
|
|
107
142
|
"arrival"
|
|
108
|
-
) :
|
|
143
|
+
) : b}
|
|
109
144
|
`;
|
|
110
145
|
}
|
|
111
146
|
return {
|
|
112
147
|
renderDepartureTimeAttribute: L,
|
|
113
|
-
renderArrivalTimeAttribute:
|
|
114
|
-
departureTimeAttribute:
|
|
115
|
-
arrivalTimeAttribute:
|
|
148
|
+
renderArrivalTimeAttribute: Y,
|
|
149
|
+
departureTimeAttribute: D(),
|
|
150
|
+
arrivalTimeAttribute: R()
|
|
116
151
|
};
|
|
117
152
|
}
|
|
118
153
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
154
|
+
v as extractTimeAndStringFromNoticeText,
|
|
155
|
+
I as getDepartureArrivalTimeAttribute,
|
|
121
156
|
_ as isConnectionLeg,
|
|
122
|
-
|
|
157
|
+
$ as isRideLeg
|
|
123
158
|
};
|
package/custom-elements.json
CHANGED
|
@@ -312,6 +312,16 @@
|
|
|
312
312
|
"description": "Per default, the current location has a pulsating animation. You can\ndisable the animation with this property.",
|
|
313
313
|
"attribute": "disable-animation"
|
|
314
314
|
},
|
|
315
|
+
{
|
|
316
|
+
"kind": "field",
|
|
317
|
+
"name": "a11yFootpath",
|
|
318
|
+
"type": {
|
|
319
|
+
"text": "boolean | undefined"
|
|
320
|
+
},
|
|
321
|
+
"privacy": "public",
|
|
322
|
+
"description": "Optional prop to render wheelchair-small instead of walk-small",
|
|
323
|
+
"attribute": "a11y-footpath"
|
|
324
|
+
},
|
|
315
325
|
{
|
|
316
326
|
"kind": "field",
|
|
317
327
|
"name": "now",
|
|
@@ -388,6 +398,14 @@
|
|
|
388
398
|
"description": "Per default, the current location has a pulsating animation. You can\ndisable the animation with this property.",
|
|
389
399
|
"fieldName": "disableAnimation"
|
|
390
400
|
},
|
|
401
|
+
{
|
|
402
|
+
"name": "a11y-footpath",
|
|
403
|
+
"type": {
|
|
404
|
+
"text": "boolean | undefined"
|
|
405
|
+
},
|
|
406
|
+
"description": "Optional prop to render wheelchair-small instead of walk-small",
|
|
407
|
+
"fieldName": "a11yFootpath"
|
|
408
|
+
},
|
|
391
409
|
{
|
|
392
410
|
"name": "now",
|
|
393
411
|
"description": "A configured date which acts as the current date instead of the real current date. Recommended for testing purposes.",
|
|
@@ -1073,6 +1091,16 @@
|
|
|
1073
1091
|
"description": "The loading state -\nwhen this is true it will be render skeleton with an idling animation",
|
|
1074
1092
|
"attribute": "loading-trip"
|
|
1075
1093
|
},
|
|
1094
|
+
{
|
|
1095
|
+
"kind": "field",
|
|
1096
|
+
"name": "a11yFootpath",
|
|
1097
|
+
"type": {
|
|
1098
|
+
"text": "boolean | undefined"
|
|
1099
|
+
},
|
|
1100
|
+
"privacy": "public",
|
|
1101
|
+
"description": "The Footpath attribute for rendering different icons\ntrue: render a11y-icon\nfalse: render walk-icon\ndefault: render walk-icon",
|
|
1102
|
+
"attribute": "a11y-footpath"
|
|
1103
|
+
},
|
|
1076
1104
|
{
|
|
1077
1105
|
"kind": "field",
|
|
1078
1106
|
"name": "loadingPrice",
|
|
@@ -1251,6 +1279,14 @@
|
|
|
1251
1279
|
"description": "The loading state -\nwhen this is true it will be render skeleton with an idling animation",
|
|
1252
1280
|
"fieldName": "loadingTrip"
|
|
1253
1281
|
},
|
|
1282
|
+
{
|
|
1283
|
+
"name": "a11y-footpath",
|
|
1284
|
+
"type": {
|
|
1285
|
+
"text": "boolean | undefined"
|
|
1286
|
+
},
|
|
1287
|
+
"description": "The Footpath attribute for rendering different icons\ntrue: render a11y-icon\nfalse: render walk-icon\ndefault: render walk-icon",
|
|
1288
|
+
"fieldName": "a11yFootpath"
|
|
1289
|
+
},
|
|
1254
1290
|
{
|
|
1255
1291
|
"name": "loading-price",
|
|
1256
1292
|
"type": {
|
|
@@ -1487,6 +1523,14 @@
|
|
|
1487
1523
|
"text": "string"
|
|
1488
1524
|
},
|
|
1489
1525
|
"description": ": The current language for localization."
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
"name": "a11yFootpath",
|
|
1529
|
+
"optional": true,
|
|
1530
|
+
"type": {
|
|
1531
|
+
"text": "boolean"
|
|
1532
|
+
},
|
|
1533
|
+
"description": ": Whether the a11y-icon should be shown."
|
|
1490
1534
|
}
|
|
1491
1535
|
]
|
|
1492
1536
|
},
|