@sbb-esta/lyne-elements-experimental-dev 4.7.0-dev.1773388997 → 4.7.0-dev.1773393170
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/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +76 -65
- package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +52 -72
- package/autocomplete-grid/autocomplete-grid-button.js +6 -3
- package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +17 -2
- package/autocomplete-grid/autocomplete-grid-cell.js +7 -4
- package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +21 -20
- package/autocomplete-grid/autocomplete-grid-optgroup.js +6 -3
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +33 -2
- package/autocomplete-grid/autocomplete-grid-option.js +9 -4
- package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +22 -2
- package/autocomplete-grid/autocomplete-grid-row.js +7 -4
- package/autocomplete-grid/autocomplete-grid.js +6 -3
- package/autocomplete-grid.js +21 -9
- package/autocomplete-grid.pure.js +15 -7
- package/core/datetime/date-helper.js +191 -2
- package/core/datetime.js +5 -2
- package/core/timetable/access-leg-helper.js +71 -76
- package/core/timetable/timetable-helper.js +11 -9
- package/core/timetable/timetable-properties.js +1 -0
- package/core/timetable.js +7 -3
- package/custom-elements.json +84 -84
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +122 -114
- package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +70 -92
- package/development/autocomplete-grid/autocomplete-grid-button.js +4 -6
- package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +29 -2
- package/development/autocomplete-grid/autocomplete-grid-cell.js +5 -7
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +22 -27
- package/development/autocomplete-grid/autocomplete-grid-optgroup.js +4 -6
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +109 -2
- package/development/autocomplete-grid/autocomplete-grid-option.js +7 -7
- package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +91 -2
- package/development/autocomplete-grid/autocomplete-grid-row.js +5 -7
- package/development/autocomplete-grid/autocomplete-grid.js +4 -6
- package/development/autocomplete-grid.js +14 -10
- package/development/autocomplete-grid.pure.js +13 -4
- package/development/core/datetime/date-helper.js +285 -2
- package/development/core/datetime.js +6 -2
- package/development/core/timetable/access-leg-helper.js +82 -104
- package/development/core/timetable/timetable-helper.js +17 -16
- package/development/core/timetable/timetable-properties.js +2 -0
- package/development/core/timetable.js +8 -3
- package/development/differenceInMinutes-B0dawX-5.js +26 -0
- package/development/format-BMkeaqaF.js +1433 -0
- package/development/isValid-BYRch7pV.js +53 -0
- package/development/journey-summary/journey-summary.component.js +288 -2
- package/development/journey-summary.js +5 -8
- package/development/journey-summary.pure.js +5 -2
- package/development/pearl-chain/pearl-chain.component.js +634 -2
- package/development/pearl-chain-time/pearl-chain-time.component.js +306 -2
- package/development/pearl-chain-time.js +5 -8
- package/development/pearl-chain-time.pure.js +5 -2
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +28 -2
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +393 -2
- package/development/pearl-chain-vertical-item.js +5 -8
- package/development/pearl-chain-vertical-item.pure.js +5 -2
- package/development/pearl-chain-vertical.js +5 -8
- package/development/pearl-chain-vertical.pure.js +5 -2
- package/development/pearl-chain.js +5 -8
- package/development/pearl-chain.pure.js +5 -2
- package/development/seat-reservation/common/mapper/icon-mapper.js +71 -168
- package/development/seat-reservation/common/mapper/mapper.js +122 -153
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +559 -570
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +972 -992
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20367 -20334
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1738 -1731
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9782 -9741
- package/development/seat-reservation/common/mapper.js +8 -1
- package/development/seat-reservation/common/svgs.js +46 -2
- package/development/seat-reservation/common/translations/i18n.js +900 -1118
- package/development/seat-reservation/common/translations.js +4 -1
- package/development/seat-reservation/common/types.js +2 -0
- package/development/seat-reservation/common.js +11 -7
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +1230 -1305
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +859 -2
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +106 -2
- package/development/seat-reservation/seat-reservation-area.js +5 -7
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +34 -35
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +162 -2
- package/development/seat-reservation/seat-reservation-graphic.js +5 -7
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +713 -2
- package/development/seat-reservation/seat-reservation-navigation-coach.js +5 -7
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +131 -2
- package/development/seat-reservation/seat-reservation-navigation-services.js +5 -7
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +601 -2
- package/development/seat-reservation/seat-reservation-place-control.js +5 -7
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +22 -2
- package/development/seat-reservation/seat-reservation-scoped.js +5 -7
- package/development/seat-reservation/seat-reservation.js +6 -7
- package/development/seat-reservation.js +28 -15
- package/development/seat-reservation.pure.js +28 -10
- package/development/timetable-duration/timetable-duration.component.js +108 -2
- package/development/timetable-duration.js +5 -8
- package/development/timetable-duration.pure.js +5 -2
- package/development/timetable-row/timetable-row.component.js +781 -2
- package/development/timetable-row.js +13 -8
- package/development/timetable-row.pure.js +12 -2
- package/development/toDate-BWb6Z1JD.js +24 -0
- package/differenceInMinutes-COvvdYsJ.js +23 -0
- package/format-CmKROkbc.js +1186 -0
- package/isValid-m3_OsPaB.js +45 -0
- package/journey-summary/journey-summary.component.js +194 -2
- package/journey-summary.js +4 -5
- package/journey-summary.pure.js +4 -2
- package/package.json +2 -2
- package/pearl-chain/pearl-chain.component.js +165 -2
- package/pearl-chain-time/pearl-chain-time.component.js +157 -2
- package/pearl-chain-time.js +4 -5
- package/pearl-chain-time.pure.js +4 -2
- package/pearl-chain-vertical/pearl-chain-vertical.component.js +17 -2
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +77 -2
- package/pearl-chain-vertical-item.js +4 -5
- package/pearl-chain-vertical-item.pure.js +4 -2
- package/pearl-chain-vertical.js +4 -5
- package/pearl-chain-vertical.pure.js +4 -2
- package/pearl-chain.js +4 -5
- package/pearl-chain.pure.js +4 -2
- package/seat-reservation/common/mapper/icon-mapper.js +71 -71
- package/seat-reservation/common/mapper/mapper.js +89 -95
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +558 -568
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +970 -989
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20366 -20332
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1737 -1729
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9781 -9739
- package/seat-reservation/common/mapper.js +9 -3
- package/seat-reservation/common/svgs.js +243 -2
- package/seat-reservation/common/translations/i18n.js +891 -1084
- package/seat-reservation/common/translations.js +4 -2
- package/seat-reservation/common/types.js +1 -0
- package/seat-reservation/common.js +15 -9
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +810 -832
- package/seat-reservation/seat-reservation/seat-reservation.component.js +420 -2
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +51 -2
- package/seat-reservation/seat-reservation-area.js +7 -4
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +71 -68
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +75 -2
- package/seat-reservation/seat-reservation-graphic.js +7 -4
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +234 -2
- package/seat-reservation/seat-reservation-navigation-coach.js +7 -4
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +85 -2
- package/seat-reservation/seat-reservation-navigation-services.js +7 -4
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +203 -2
- package/seat-reservation/seat-reservation-place-control.js +7 -4
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +13 -2
- package/seat-reservation/seat-reservation-scoped.js +7 -4
- package/seat-reservation/seat-reservation.js +9 -5
- package/seat-reservation.js +39 -17
- package/seat-reservation.pure.js +32 -15
- package/timetable-duration/timetable-duration.component.js +57 -2
- package/timetable-duration.js +4 -5
- package/timetable-duration.pure.js +4 -2
- package/timetable-row/timetable-row.component.js +427 -2
- package/timetable-row.js +13 -6
- package/timetable-row.pure.js +11 -2
- package/toDate-Bw2KTWeq.js +15 -0
- package/autocomplete-grid-cell.component-Dak9wlBr.js +0 -24
- package/autocomplete-grid-option.component-DNRFHOwc.js +0 -37
- package/autocomplete-grid-row.component-DBHZQ0GQ.js +0 -27
- package/date-helper-CGproP5d.js +0 -185
- package/development/autocomplete-grid-cell.component-BBvM4o2H.js +0 -42
- package/development/autocomplete-grid-option.component-QzfM5eIE.js +0 -123
- package/development/autocomplete-grid-row.component-H8sCTCkT.js +0 -104
- package/development/date-helper-8_Y-PuHh.js +0 -520
- package/development/differenceInMinutes-DN_1Rk3O.js +0 -110
- package/development/format-Bbrn2bgo.js +0 -1848
- package/development/isValid-C-HzKv4v.js +0 -178
- package/development/journey-summary.component-uGhZvA4p.js +0 -385
- package/development/pearl-chain-time.component-B8mayTWD.js +0 -415
- package/development/pearl-chain-vertical-item.component-BDzbcIaf.js +0 -435
- package/development/pearl-chain-vertical.component-CswE7b3M.js +0 -39
- package/development/pearl-chain.component-wpsTvoSe.js +0 -704
- package/development/seat-reservation-area.component-BK92ZtFo.js +0 -138
- package/development/seat-reservation-graphic.component-cUnsHh5x.js +0 -193
- package/development/seat-reservation-navigation-coach.component-D6Bglus8.js +0 -828
- package/development/seat-reservation-navigation-services.component-DYJ6Ddkg.js +0 -179
- package/development/seat-reservation-place-control.component-Bg9evKBW.js +0 -726
- package/development/seat-reservation-scoped.component-DRQ_I702.js +0 -31
- package/development/seat-reservation.component-Cq_aJKR0.js +0 -818
- package/development/svgs-C3JMWR26.js +0 -28
- package/development/timetable-duration.component-DI0lET17.js +0 -125
- package/development/timetable-row.component-CAED6Zwc.js +0 -932
- package/development/toDate-Biiv3kyf.js +0 -150
- package/differenceInMinutes-Dr9gRqtu.js +0 -27
- package/format-CM5exOsN.js +0 -1103
- package/isValid-B9oVW3lA.js +0 -36
- package/journey-summary.component-Cq_4kaOp.js +0 -264
- package/pearl-chain-time.component-DGDW5S1c.js +0 -239
- package/pearl-chain-vertical-item.component-G22bWhLU.js +0 -108
- package/pearl-chain-vertical.component-CXIDT5RD.js +0 -21
- package/pearl-chain.component-DmjkVIva.js +0 -194
- package/seat-reservation-area.component-n-9rGn_y.js +0 -75
- package/seat-reservation-graphic.component-YTXRmKt0.js +0 -102
- package/seat-reservation-navigation-coach.component-YJ0vaYmO.js +0 -333
- package/seat-reservation-navigation-services.component-C3xnLJg2.js +0 -127
- package/seat-reservation-place-control.component-DmBAfM6K.js +0 -322
- package/seat-reservation-scoped.component-DPkz6u17.js +0 -17
- package/seat-reservation.component-C_anMkgw.js +0 -364
- package/svgs-D9arBcqr.js +0 -26
- package/timetable-duration.component-DCu8Phts.js +0 -65
- package/timetable-row.component-BVRCB3xK.js +0 -559
- package/toDate-p-Tpkb7t.js +0 -16
|
@@ -1,2 +1,191 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { i18nDurationDay as N, i18nDurationHour as h, i18nDurationMinute as T } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
2
|
+
import { n as w, d as y, i as U } from "../../isValid-m3_OsPaB.js";
|
|
3
|
+
import { t as d, c as g, b as m, m as I } from "../../toDate-Bw2KTWeq.js";
|
|
4
|
+
import { g as C, a as Y, d as F } from "../../differenceInMinutes-COvvdYsJ.js";
|
|
5
|
+
function x(e, t, n) {
|
|
6
|
+
const i = d(e, n?.in);
|
|
7
|
+
return isNaN(t) ? g(e, NaN) : (t && i.setDate(i.getDate() + t), i);
|
|
8
|
+
}
|
|
9
|
+
function z(e, t, n) {
|
|
10
|
+
return g(e, +d(e) + t);
|
|
11
|
+
}
|
|
12
|
+
function H(e, t, n) {
|
|
13
|
+
return z(e, t * m);
|
|
14
|
+
}
|
|
15
|
+
function S(e, t, n) {
|
|
16
|
+
const [i, s] = w(
|
|
17
|
+
n?.in,
|
|
18
|
+
e,
|
|
19
|
+
t
|
|
20
|
+
), r = M(i, s), a = Math.abs(
|
|
21
|
+
y(i, s)
|
|
22
|
+
);
|
|
23
|
+
i.setDate(i.getDate() - r * a);
|
|
24
|
+
const o = +(M(i, s) === -r), u = r * (a - o);
|
|
25
|
+
return u === 0 ? 0 : u;
|
|
26
|
+
}
|
|
27
|
+
function M(e, t) {
|
|
28
|
+
const n = e.getFullYear() - t.getFullYear() || e.getMonth() - t.getMonth() || e.getDate() - t.getDate() || e.getHours() - t.getHours() || e.getMinutes() - t.getMinutes() || e.getSeconds() - t.getSeconds() || e.getMilliseconds() - t.getMilliseconds();
|
|
29
|
+
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
30
|
+
}
|
|
31
|
+
function Z(e, t, n) {
|
|
32
|
+
const [i, s] = w(
|
|
33
|
+
n?.in,
|
|
34
|
+
e,
|
|
35
|
+
t
|
|
36
|
+
), r = (+i - +s) / m;
|
|
37
|
+
return C(n?.roundingMethod)(r);
|
|
38
|
+
}
|
|
39
|
+
function v(e, t, n) {
|
|
40
|
+
return x(e, -t, n);
|
|
41
|
+
}
|
|
42
|
+
function O(e, t) {
|
|
43
|
+
const n = () => g(t?.in, NaN), s = k(e);
|
|
44
|
+
let r;
|
|
45
|
+
if (s.date) {
|
|
46
|
+
const c = W(s.date, 2);
|
|
47
|
+
r = j(c.restDateString, c.year);
|
|
48
|
+
}
|
|
49
|
+
if (!r || isNaN(+r)) return n();
|
|
50
|
+
const a = +r;
|
|
51
|
+
let o = 0, u;
|
|
52
|
+
if (s.time && (o = A(s.time), isNaN(o)))
|
|
53
|
+
return n();
|
|
54
|
+
if (s.timezone) {
|
|
55
|
+
if (u = E(s.timezone), isNaN(u)) return n();
|
|
56
|
+
} else {
|
|
57
|
+
const c = new Date(a + o), p = d(0, t?.in);
|
|
58
|
+
return p.setFullYear(
|
|
59
|
+
c.getUTCFullYear(),
|
|
60
|
+
c.getUTCMonth(),
|
|
61
|
+
c.getUTCDate()
|
|
62
|
+
), p.setHours(
|
|
63
|
+
c.getUTCHours(),
|
|
64
|
+
c.getUTCMinutes(),
|
|
65
|
+
c.getUTCSeconds(),
|
|
66
|
+
c.getUTCMilliseconds()
|
|
67
|
+
), p;
|
|
68
|
+
}
|
|
69
|
+
return d(a + o + u, t?.in);
|
|
70
|
+
}
|
|
71
|
+
const l = {
|
|
72
|
+
dateTimeDelimiter: /[T ]/,
|
|
73
|
+
timeZoneDelimiter: /[Z ]/i,
|
|
74
|
+
timezone: /([Z+-].*)$/
|
|
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(e) {
|
|
77
|
+
const t = {}, n = e.split(l.dateTimeDelimiter);
|
|
78
|
+
let i;
|
|
79
|
+
if (n.length > 2)
|
|
80
|
+
return t;
|
|
81
|
+
if (/:/.test(n[0]) ? i = n[0] : (t.date = n[0], i = n[1], l.timeZoneDelimiter.test(t.date) && (t.date = e.split(l.timeZoneDelimiter)[0], i = e.substr(
|
|
82
|
+
t.date.length,
|
|
83
|
+
e.length
|
|
84
|
+
))), i) {
|
|
85
|
+
const s = l.timezone.exec(i);
|
|
86
|
+
s ? (t.time = i.replace(s[1], ""), t.timezone = s[1]) : t.time = i;
|
|
87
|
+
}
|
|
88
|
+
return t;
|
|
89
|
+
}
|
|
90
|
+
function W(e, t) {
|
|
91
|
+
const n = new RegExp(
|
|
92
|
+
"^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
|
|
93
|
+
), i = e.match(n);
|
|
94
|
+
if (!i) return { year: NaN, restDateString: "" };
|
|
95
|
+
const s = i[1] ? parseInt(i[1]) : null, r = i[2] ? parseInt(i[2]) : null;
|
|
96
|
+
return {
|
|
97
|
+
year: r === null ? s : r * 100,
|
|
98
|
+
restDateString: e.slice((i[1] || i[2]).length)
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function j(e, t) {
|
|
102
|
+
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
103
|
+
const n = e.match(_);
|
|
104
|
+
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
105
|
+
const i = !!n[4], s = f(n[1]), r = f(n[2]) - 1, a = f(n[3]), o = f(n[4]), u = f(n[5]) - 1;
|
|
106
|
+
if (i)
|
|
107
|
+
return G(t, o, u) ? J(t, o, u) : /* @__PURE__ */ new Date(NaN);
|
|
108
|
+
{
|
|
109
|
+
const c = /* @__PURE__ */ new Date(0);
|
|
110
|
+
return !q(t, r, a) || !B(t, s) ? /* @__PURE__ */ new Date(NaN) : (c.setUTCFullYear(t, r, Math.max(s, a)), c);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function f(e) {
|
|
114
|
+
return e ? parseInt(e) : 1;
|
|
115
|
+
}
|
|
116
|
+
function A(e) {
|
|
117
|
+
const t = e.match(b);
|
|
118
|
+
if (!t) return NaN;
|
|
119
|
+
const n = D(t[1]), i = D(t[2]), s = D(t[3]);
|
|
120
|
+
return K(n, i, s) ? n * m + i * I + s * 1e3 : NaN;
|
|
121
|
+
}
|
|
122
|
+
function D(e) {
|
|
123
|
+
return e && parseFloat(e.replace(",", ".")) || 0;
|
|
124
|
+
}
|
|
125
|
+
function E(e) {
|
|
126
|
+
if (e === "Z") return 0;
|
|
127
|
+
const t = e.match(R);
|
|
128
|
+
if (!t) return 0;
|
|
129
|
+
const n = t[1] === "+" ? -1 : 1, i = parseInt(t[2]), s = t[3] && parseInt(t[3]) || 0;
|
|
130
|
+
return P(i, s) ? n * (i * m + s * I) : NaN;
|
|
131
|
+
}
|
|
132
|
+
function J(e, t, n) {
|
|
133
|
+
const i = /* @__PURE__ */ new Date(0);
|
|
134
|
+
i.setUTCFullYear(e, 0, 4);
|
|
135
|
+
const s = i.getUTCDay() || 7, r = (t - 1) * 7 + n + 1 - s;
|
|
136
|
+
return i.setUTCDate(i.getUTCDate() + r), i;
|
|
137
|
+
}
|
|
138
|
+
const V = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
139
|
+
function $(e) {
|
|
140
|
+
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
141
|
+
}
|
|
142
|
+
function q(e, t, n) {
|
|
143
|
+
return t >= 0 && t <= 11 && n >= 1 && n <= (V[t] || ($(e) ? 29 : 28));
|
|
144
|
+
}
|
|
145
|
+
function B(e, t) {
|
|
146
|
+
return t >= 1 && t <= ($(e) ? 366 : 365);
|
|
147
|
+
}
|
|
148
|
+
function G(e, t, n) {
|
|
149
|
+
return t >= 1 && t <= 53 && n >= 0 && n <= 6;
|
|
150
|
+
}
|
|
151
|
+
function K(e, t, n) {
|
|
152
|
+
return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
|
|
153
|
+
}
|
|
154
|
+
function P(e, t) {
|
|
155
|
+
return t >= 0 && t <= 59;
|
|
156
|
+
}
|
|
157
|
+
function Q(e, t, n) {
|
|
158
|
+
return H(e, -t);
|
|
159
|
+
}
|
|
160
|
+
function nt(e) {
|
|
161
|
+
if (!e)
|
|
162
|
+
return;
|
|
163
|
+
const t = O(e);
|
|
164
|
+
if (U(t)) {
|
|
165
|
+
if (e.includes("Z"))
|
|
166
|
+
return new Date(e.replace("Z", ""));
|
|
167
|
+
if (e.includes("T")) {
|
|
168
|
+
const n = e.split("T");
|
|
169
|
+
if (n[1] && (n[1].includes("+") || n[1].includes("-")))
|
|
170
|
+
return /* @__PURE__ */ new Date(`${n[0]}T${n[1].split(/[+-]/)[0]}`);
|
|
171
|
+
}
|
|
172
|
+
return new Date(e);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const it = (e, t) => {
|
|
176
|
+
const n = [], i = [];
|
|
177
|
+
let r = Y(0, e);
|
|
178
|
+
const a = S(r, 0);
|
|
179
|
+
a > 0 && (n.push(`${a} d`), t && i.push(`${a} ${a > 1 ? N.multiple.long[t] : N.single.long[t]}`), r = v(r, a));
|
|
180
|
+
const o = Z(r, 0);
|
|
181
|
+
o > 0 && (n.push(`${o} h`), t && i.push(`${o} ${o > 1 ? h.multiple.long[t] : h.single.long[t]}`), r = Q(r, o));
|
|
182
|
+
const u = F(r, 0);
|
|
183
|
+
return u > 0 && (n.push(`${u} min`), t && i.push(`${u} ${u > 1 ? T.multiple.long[t] : T.single.long[t]}`)), {
|
|
184
|
+
short: n.join(" "),
|
|
185
|
+
long: i.join(" ")
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
export {
|
|
189
|
+
it as durationToTime,
|
|
190
|
+
nt as removeTimezoneFromISOTimeString
|
|
191
|
+
};
|
package/core/datetime.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { durationToTime as m, removeTimezoneFromISOTimeString as r } from "./datetime/date-helper.js";
|
|
2
|
+
export {
|
|
3
|
+
m as durationToTime,
|
|
4
|
+
r as removeTimezoneFromISOTimeString
|
|
5
|
+
};
|
|
@@ -1,96 +1,91 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i18nWalkingDistanceDeparture as T, i18nWalkingDistanceArrival as h } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
2
|
+
import { nothing as u, html as f } from "lit";
|
|
3
|
+
import { isRideLeg as $, isConnectionLeg as L, extractTimeAndStringFromNoticeText as k } from "./timetable-helper.js";
|
|
2
4
|
import "@sbb-esta/lyne-elements/icon.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
text: i?.text?.template || "",
|
|
11
|
-
icon: "walk-small"
|
|
12
|
-
} : null;
|
|
5
|
+
function g(t, r) {
|
|
6
|
+
const i = L(t) ? t : null, n = i ? i?.notices?.filter((e) => r.includes(e.name))[0] : null;
|
|
7
|
+
return n ? {
|
|
8
|
+
duration: i?.duration || 0,
|
|
9
|
+
text: n?.text?.template || "",
|
|
10
|
+
icon: "walk-small"
|
|
11
|
+
} : null;
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
function M(t, r, i, n) {
|
|
14
|
+
const e = $(t) ? t?.serviceJourney?.notices?.filter((m) => ["CI"].includes(m.name))[0] : null, c = e && k(e);
|
|
15
|
+
return e ? {
|
|
16
|
+
duration: (c?.duration || 0) + (r || 0),
|
|
17
|
+
text: i ? T[n] : c?.text || "",
|
|
18
|
+
icon: i ? "wheelchair-small" : `sa-${e?.name?.toLowerCase()}`
|
|
19
|
+
} : null;
|
|
21
20
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
function N(t, r, i, n) {
|
|
22
|
+
const e = $(t) ? t?.serviceJourney?.notices?.filter((m) => ["CO"].includes(m.name))[0] : null, c = e && k(e);
|
|
23
|
+
return e ? {
|
|
24
|
+
duration: (c?.duration || 0) + (r || 0),
|
|
25
|
+
text: i ? h[n] : c?.text || "",
|
|
26
|
+
icon: i ? "wheelchair-small" : `sa-${e?.name?.toLowerCase()}`
|
|
27
|
+
} : null;
|
|
29
28
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
<span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${
|
|
33
|
-
<sbb-icon name=${
|
|
34
|
-
<time datetime=${
|
|
29
|
+
function _(t, r, i, n, e) {
|
|
30
|
+
return f`
|
|
31
|
+
<span class="sbb-pearl-chain__time-transfer sbb-pearl-chain__time-transfer--${r}-${e}">
|
|
32
|
+
<sbb-icon name=${r}></sbb-icon>
|
|
33
|
+
<time datetime=${t + "M"}>
|
|
35
34
|
<span class="sbb-screen-reader-only">
|
|
36
|
-
${!
|
|
37
|
-
${
|
|
35
|
+
${!n && e ? e === "departure" ? T[i] : h[i] : u}
|
|
36
|
+
${n ? f`<span>${n}</span>` : u}
|
|
38
37
|
</span>
|
|
39
|
-
${
|
|
38
|
+
${t}
|
|
40
39
|
<span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
|
|
41
40
|
<span class="sbb-screen-reader-only">min</span>
|
|
42
41
|
</time>
|
|
43
42
|
</span>
|
|
44
43
|
`;
|
|
45
44
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
<span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${
|
|
49
|
-
<sbb-icon name=${
|
|
50
|
-
<time datetime=${
|
|
51
|
-
<span class="sbb-screen-reader-only">${
|
|
52
|
-
${
|
|
45
|
+
function p(t, r, i, n) {
|
|
46
|
+
return f`
|
|
47
|
+
<span class="sbb-pearl-chain__time-walktime sbb-pearl-chain__time-walktime--${n}-${i}">
|
|
48
|
+
<sbb-icon name=${n}></sbb-icon>
|
|
49
|
+
<time datetime=${t + "M"}>
|
|
50
|
+
<span class="sbb-screen-reader-only">${r}</span>
|
|
51
|
+
${t}
|
|
53
52
|
<span class="sbb-pearl-chain__time-walktime-prime-symbol" aria-hidden="true">'</span>
|
|
54
53
|
</time>
|
|
55
54
|
</span>
|
|
56
55
|
`;
|
|
57
56
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
function S() {
|
|
70
|
-
return r`
|
|
71
|
-
${v ? d(v.duration, v.text, "left", v.icon) : i}
|
|
72
|
-
${b && !y && !v ? d(b.duration, b.text, "left", b.icon) : i}
|
|
73
|
-
${y ? h ? d(y.duration, y.text, "left", y.icon) : u(y.duration, y.icon, m, y.text, "departure") : i}
|
|
57
|
+
function B(t, r, i, n, e) {
|
|
58
|
+
const c = t && t.filter((w) => $(w) || L(w))[0], m = ["YM", "YB", "Y", "YT"], o = g(c, m), s = M(c, r, e, n), d = r ? {
|
|
59
|
+
text: T[n],
|
|
60
|
+
duration: r,
|
|
61
|
+
icon: e ? "wheelchair-small" : "walk-small"
|
|
62
|
+
} : null, v = () => o || (d && !s && !o ? d : s || null);
|
|
63
|
+
function C() {
|
|
64
|
+
return f`
|
|
65
|
+
${o ? p(o.duration, o.text, "left", o.icon) : u}
|
|
66
|
+
${d && !s && !o ? p(d.duration, d.text, "left", d.icon) : u}
|
|
67
|
+
${s ? e ? p(s.duration, s.text, "left", s.icon) : _(s.duration, s.icon, n, s.text, "departure") : u}
|
|
74
68
|
`;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
${
|
|
84
|
-
${
|
|
85
|
-
${
|
|
69
|
+
}
|
|
70
|
+
const A = t && t[t.length - 1], x = (L(A) || $(A)) && A, l = x && g(x, m), a = x && N(x, i, e, n), b = i ? {
|
|
71
|
+
text: h[n],
|
|
72
|
+
duration: i,
|
|
73
|
+
icon: e ? "wheelchair-small" : "walk-small"
|
|
74
|
+
} : null, D = () => l || (b && !a && !l ? b : a || null);
|
|
75
|
+
function Y() {
|
|
76
|
+
return f`
|
|
77
|
+
${l ? p(l.duration, l.text, "right", l.icon) : u}
|
|
78
|
+
${b && !a && !l ? p(b.duration, b.text, "right", b.icon) : u}
|
|
79
|
+
${a ? e ? p(a.duration, a.text, "right", a.icon) : _(a.duration, a.icon, n, a.text, "arrival") : u}
|
|
86
80
|
`;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
renderDepartureTimeAttribute: C,
|
|
84
|
+
renderArrivalTimeAttribute: Y,
|
|
85
|
+
departureTimeAttribute: v(),
|
|
86
|
+
arrivalTimeAttribute: D()
|
|
87
|
+
};
|
|
94
88
|
}
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
export {
|
|
90
|
+
B as getDepartureArrivalTimeAttribute
|
|
91
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const r = (t) => t?.__typename === "PTRideLeg", i = (t) => t?.__typename === "PTConnectionLeg", s = (t) => {
|
|
2
|
+
const n = t?.text?.template && t.text.template.indexOf("(") + 1, e = t?.text?.template?.substring(n || 0, t?.text?.template.indexOf(")"));
|
|
3
|
+
return {
|
|
4
|
+
duration: e && +e.substring(0, e.length - 1) || 0,
|
|
5
|
+
text: t?.text?.template?.split("(")[0] || ""
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
s as extractTimeAndStringFromNoticeText,
|
|
10
|
+
i as isConnectionLeg,
|
|
11
|
+
r as isRideLeg
|
|
8
12
|
};
|
|
9
|
-
//#endregion
|
|
10
|
-
export { n as extractTimeAndStringFromNoticeText, t as isConnectionLeg, e as isRideLeg };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/core/timetable.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { extractTimeAndStringFromNoticeText as e, isConnectionLeg as t, isRideLeg as n } from "./timetable/timetable-helper.js";
|
|
2
1
|
import { getDepartureArrivalTimeAttribute as r } from "./timetable/access-leg-helper.js";
|
|
3
|
-
import "./timetable/timetable-
|
|
4
|
-
export {
|
|
2
|
+
import { extractTimeAndStringFromNoticeText as o, isConnectionLeg as m, isRideLeg as n } from "./timetable/timetable-helper.js";
|
|
3
|
+
export {
|
|
4
|
+
o as extractTimeAndStringFromNoticeText,
|
|
5
|
+
r as getDepartureArrivalTimeAttribute,
|
|
6
|
+
m as isConnectionLeg,
|
|
7
|
+
n as isRideLeg
|
|
8
|
+
};
|
package/custom-elements.json
CHANGED
|
@@ -3124,6 +3124,90 @@
|
|
|
3124
3124
|
"declarations": [],
|
|
3125
3125
|
"exports": []
|
|
3126
3126
|
},
|
|
3127
|
+
{
|
|
3128
|
+
"kind": "javascript-module",
|
|
3129
|
+
"path": "seat-reservation/seat-reservation-area/seat-reservation-area.component.js",
|
|
3130
|
+
"declarations": [
|
|
3131
|
+
{
|
|
3132
|
+
"kind": "class",
|
|
3133
|
+
"description": "Visualize an area with a special meaning within a wagon.",
|
|
3134
|
+
"name": "SbbSeatReservationAreaElement",
|
|
3135
|
+
"members": [
|
|
3136
|
+
{
|
|
3137
|
+
"kind": "field",
|
|
3138
|
+
"name": "elementName",
|
|
3139
|
+
"type": {
|
|
3140
|
+
"text": "string"
|
|
3141
|
+
},
|
|
3142
|
+
"privacy": "public",
|
|
3143
|
+
"static": true,
|
|
3144
|
+
"readonly": true,
|
|
3145
|
+
"default": "'sbb-seat-reservation-area'"
|
|
3146
|
+
},
|
|
3147
|
+
{
|
|
3148
|
+
"kind": "field",
|
|
3149
|
+
"name": "mounting",
|
|
3150
|
+
"type": {
|
|
3151
|
+
"text": "'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border'"
|
|
3152
|
+
},
|
|
3153
|
+
"privacy": "public",
|
|
3154
|
+
"default": "'free'",
|
|
3155
|
+
"description": "Mounting Prop",
|
|
3156
|
+
"attribute": "mounting",
|
|
3157
|
+
"reflects": true
|
|
3158
|
+
},
|
|
3159
|
+
{
|
|
3160
|
+
"kind": "field",
|
|
3161
|
+
"name": "background",
|
|
3162
|
+
"type": {
|
|
3163
|
+
"text": "'light' | 'dark'"
|
|
3164
|
+
},
|
|
3165
|
+
"privacy": "public",
|
|
3166
|
+
"default": "'light'",
|
|
3167
|
+
"description": "the background of the area",
|
|
3168
|
+
"attribute": "background",
|
|
3169
|
+
"reflects": true
|
|
3170
|
+
}
|
|
3171
|
+
],
|
|
3172
|
+
"attributes": [
|
|
3173
|
+
{
|
|
3174
|
+
"name": "mounting",
|
|
3175
|
+
"type": {
|
|
3176
|
+
"text": "'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border'"
|
|
3177
|
+
},
|
|
3178
|
+
"default": "'free'",
|
|
3179
|
+
"description": "Mounting Prop",
|
|
3180
|
+
"fieldName": "mounting"
|
|
3181
|
+
},
|
|
3182
|
+
{
|
|
3183
|
+
"name": "background",
|
|
3184
|
+
"type": {
|
|
3185
|
+
"text": "'light' | 'dark'"
|
|
3186
|
+
},
|
|
3187
|
+
"default": "'light'",
|
|
3188
|
+
"description": "the background of the area",
|
|
3189
|
+
"fieldName": "background"
|
|
3190
|
+
}
|
|
3191
|
+
],
|
|
3192
|
+
"superclass": {
|
|
3193
|
+
"name": "SbbElement",
|
|
3194
|
+
"package": "@sbb-esta/lyne-elements/core/base-elements.js"
|
|
3195
|
+
},
|
|
3196
|
+
"tagName": "sbb-seat-reservation-area",
|
|
3197
|
+
"customElement": true
|
|
3198
|
+
}
|
|
3199
|
+
],
|
|
3200
|
+
"exports": [
|
|
3201
|
+
{
|
|
3202
|
+
"kind": "js",
|
|
3203
|
+
"name": "SbbSeatReservationAreaElement",
|
|
3204
|
+
"declaration": {
|
|
3205
|
+
"name": "SbbSeatReservationAreaElement",
|
|
3206
|
+
"module": "seat-reservation/seat-reservation-area/seat-reservation-area.component.js"
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
]
|
|
3210
|
+
},
|
|
3127
3211
|
{
|
|
3128
3212
|
"kind": "javascript-module",
|
|
3129
3213
|
"path": "seat-reservation/seat-reservation/seat-reservation-base-element.js",
|
|
@@ -7225,90 +7309,6 @@
|
|
|
7225
7309
|
}
|
|
7226
7310
|
]
|
|
7227
7311
|
},
|
|
7228
|
-
{
|
|
7229
|
-
"kind": "javascript-module",
|
|
7230
|
-
"path": "seat-reservation/seat-reservation-area/seat-reservation-area.component.js",
|
|
7231
|
-
"declarations": [
|
|
7232
|
-
{
|
|
7233
|
-
"kind": "class",
|
|
7234
|
-
"description": "Visualize an area with a special meaning within a wagon.",
|
|
7235
|
-
"name": "SbbSeatReservationAreaElement",
|
|
7236
|
-
"members": [
|
|
7237
|
-
{
|
|
7238
|
-
"kind": "field",
|
|
7239
|
-
"name": "elementName",
|
|
7240
|
-
"type": {
|
|
7241
|
-
"text": "string"
|
|
7242
|
-
},
|
|
7243
|
-
"privacy": "public",
|
|
7244
|
-
"static": true,
|
|
7245
|
-
"readonly": true,
|
|
7246
|
-
"default": "'sbb-seat-reservation-area'"
|
|
7247
|
-
},
|
|
7248
|
-
{
|
|
7249
|
-
"kind": "field",
|
|
7250
|
-
"name": "mounting",
|
|
7251
|
-
"type": {
|
|
7252
|
-
"text": "'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border'"
|
|
7253
|
-
},
|
|
7254
|
-
"privacy": "public",
|
|
7255
|
-
"default": "'free'",
|
|
7256
|
-
"description": "Mounting Prop",
|
|
7257
|
-
"attribute": "mounting",
|
|
7258
|
-
"reflects": true
|
|
7259
|
-
},
|
|
7260
|
-
{
|
|
7261
|
-
"kind": "field",
|
|
7262
|
-
"name": "background",
|
|
7263
|
-
"type": {
|
|
7264
|
-
"text": "'light' | 'dark'"
|
|
7265
|
-
},
|
|
7266
|
-
"privacy": "public",
|
|
7267
|
-
"default": "'light'",
|
|
7268
|
-
"description": "the background of the area",
|
|
7269
|
-
"attribute": "background",
|
|
7270
|
-
"reflects": true
|
|
7271
|
-
}
|
|
7272
|
-
],
|
|
7273
|
-
"attributes": [
|
|
7274
|
-
{
|
|
7275
|
-
"name": "mounting",
|
|
7276
|
-
"type": {
|
|
7277
|
-
"text": "'free' | 'upper-border' | 'lower-border' | 'upper-to-lower-border'"
|
|
7278
|
-
},
|
|
7279
|
-
"default": "'free'",
|
|
7280
|
-
"description": "Mounting Prop",
|
|
7281
|
-
"fieldName": "mounting"
|
|
7282
|
-
},
|
|
7283
|
-
{
|
|
7284
|
-
"name": "background",
|
|
7285
|
-
"type": {
|
|
7286
|
-
"text": "'light' | 'dark'"
|
|
7287
|
-
},
|
|
7288
|
-
"default": "'light'",
|
|
7289
|
-
"description": "the background of the area",
|
|
7290
|
-
"fieldName": "background"
|
|
7291
|
-
}
|
|
7292
|
-
],
|
|
7293
|
-
"superclass": {
|
|
7294
|
-
"name": "SbbElement",
|
|
7295
|
-
"package": "@sbb-esta/lyne-elements/core/base-elements.js"
|
|
7296
|
-
},
|
|
7297
|
-
"tagName": "sbb-seat-reservation-area",
|
|
7298
|
-
"customElement": true
|
|
7299
|
-
}
|
|
7300
|
-
],
|
|
7301
|
-
"exports": [
|
|
7302
|
-
{
|
|
7303
|
-
"kind": "js",
|
|
7304
|
-
"name": "SbbSeatReservationAreaElement",
|
|
7305
|
-
"declaration": {
|
|
7306
|
-
"name": "SbbSeatReservationAreaElement",
|
|
7307
|
-
"module": "seat-reservation/seat-reservation-area/seat-reservation-area.component.js"
|
|
7308
|
-
}
|
|
7309
|
-
}
|
|
7310
|
-
]
|
|
7311
|
-
},
|
|
7312
7312
|
{
|
|
7313
7313
|
"kind": "javascript-module",
|
|
7314
7314
|
"path": "seat-reservation/seat-reservation-graphic/seat-reservation-assets.js",
|