@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.
Files changed (123) hide show
  1. package/README.md +55 -0
  2. package/constants-ClrwyPF-.js +12 -0
  3. package/core/datetime/date-helper.d.ts +27 -0
  4. package/core/datetime/date-helper.d.ts.map +1 -0
  5. package/core/datetime.d.ts +2 -0
  6. package/core/datetime.d.ts.map +1 -0
  7. package/core/datetime.js +193 -0
  8. package/core/timetable/access-leg-helper.d.ts +26 -0
  9. package/core/timetable/access-leg-helper.d.ts.map +1 -0
  10. package/core/timetable/timetable-helper.d.ts +9 -0
  11. package/core/timetable/timetable-helper.d.ts.map +1 -0
  12. package/core/timetable/timetable-properties.d.ts +308 -0
  13. package/core/timetable/timetable-properties.d.ts.map +1 -0
  14. package/core/timetable.d.ts +4 -0
  15. package/core/timetable.d.ts.map +1 -0
  16. package/core/timetable.js +123 -0
  17. package/custom-elements.json +1606 -0
  18. package/development/constants-D72r1E-c.js +22 -0
  19. package/development/core/datetime/date-helper.d.ts +27 -0
  20. package/development/core/datetime/date-helper.d.ts.map +1 -0
  21. package/development/core/datetime.d.ts +2 -0
  22. package/development/core/datetime.d.ts.map +1 -0
  23. package/development/core/datetime.js +290 -0
  24. package/development/core/timetable/access-leg-helper.d.ts +26 -0
  25. package/development/core/timetable/access-leg-helper.d.ts.map +1 -0
  26. package/development/core/timetable/timetable-helper.d.ts +9 -0
  27. package/development/core/timetable/timetable-helper.d.ts.map +1 -0
  28. package/development/core/timetable/timetable-properties.d.ts +308 -0
  29. package/development/core/timetable/timetable-properties.d.ts.map +1 -0
  30. package/development/core/timetable.d.ts +4 -0
  31. package/development/core/timetable.d.ts.map +1 -0
  32. package/development/core/timetable.js +164 -0
  33. package/development/differenceInMinutes-D47vcSvy.js +21 -0
  34. package/development/format-BOXfsJCN.js +1373 -0
  35. package/development/isValid-YTpbhEHG.js +52 -0
  36. package/development/journey-summary/journey-summary.d.ts +57 -0
  37. package/development/journey-summary/journey-summary.d.ts.map +1 -0
  38. package/development/journey-summary.d.ts +2 -0
  39. package/development/journey-summary.d.ts.map +1 -0
  40. package/development/journey-summary.js +209 -0
  41. package/development/pearl-chain/pearl-chain.d.ts +41 -0
  42. package/development/pearl-chain/pearl-chain.d.ts.map +1 -0
  43. package/development/pearl-chain/pearl-chain.sample-data.d.ts +121 -0
  44. package/development/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -0
  45. package/development/pearl-chain-time/pearl-chain-time.d.ts +44 -0
  46. package/development/pearl-chain-time/pearl-chain-time.d.ts.map +1 -0
  47. package/development/pearl-chain-time.d.ts +2 -0
  48. package/development/pearl-chain-time.d.ts.map +1 -0
  49. package/development/pearl-chain-time.js +208 -0
  50. package/development/pearl-chain-vertical/pearl-chain-vertical.d.ts +17 -0
  51. package/development/pearl-chain-vertical/pearl-chain-vertical.d.ts.map +1 -0
  52. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts +35 -0
  53. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts.map +1 -0
  54. package/development/pearl-chain-vertical-item.d.ts +2 -0
  55. package/development/pearl-chain-vertical-item.d.ts.map +1 -0
  56. package/development/pearl-chain-vertical-item.js +368 -0
  57. package/development/pearl-chain-vertical.d.ts +2 -0
  58. package/development/pearl-chain-vertical.d.ts.map +1 -0
  59. package/development/pearl-chain-vertical.js +58 -0
  60. package/development/pearl-chain.d.ts +2 -0
  61. package/development/pearl-chain.d.ts.map +1 -0
  62. package/development/pearl-chain.js +597 -0
  63. package/development/timetable-duration/timetable-duration.d.ts +23 -0
  64. package/development/timetable-duration/timetable-duration.d.ts.map +1 -0
  65. package/development/timetable-duration/timetable-duration.sample-data.d.ts +6 -0
  66. package/development/timetable-duration/timetable-duration.sample-data.d.ts.map +1 -0
  67. package/development/timetable-duration.d.ts +2 -0
  68. package/development/timetable-duration.d.ts.map +1 -0
  69. package/development/timetable-duration.js +106 -0
  70. package/development/timetable-row/timetable-row.d.ts +79 -0
  71. package/development/timetable-row/timetable-row.d.ts.map +1 -0
  72. package/development/timetable-row/timetable-row.sample-data.d.ts +24 -0
  73. package/development/timetable-row/timetable-row.sample-data.d.ts.map +1 -0
  74. package/development/timetable-row.d.ts +2 -0
  75. package/development/timetable-row.d.ts.map +1 -0
  76. package/development/timetable-row.js +687 -0
  77. package/differenceInMinutes-CDpgJIgL.js +19 -0
  78. package/format-qHhIvnY8.js +1164 -0
  79. package/index.d.ts +19 -0
  80. package/index.js +17 -0
  81. package/isValid-Df_caLp4.js +40 -0
  82. package/journey-summary/journey-summary.d.ts +57 -0
  83. package/journey-summary/journey-summary.d.ts.map +1 -0
  84. package/journey-summary.d.ts +2 -0
  85. package/journey-summary.d.ts.map +1 -0
  86. package/journey-summary.js +130 -0
  87. package/package.json +79 -2
  88. package/pearl-chain/pearl-chain.d.ts +41 -0
  89. package/pearl-chain/pearl-chain.d.ts.map +1 -0
  90. package/pearl-chain/pearl-chain.sample-data.d.ts +121 -0
  91. package/pearl-chain/pearl-chain.sample-data.d.ts.map +1 -0
  92. package/pearl-chain-time/pearl-chain-time.d.ts +44 -0
  93. package/pearl-chain-time/pearl-chain-time.d.ts.map +1 -0
  94. package/pearl-chain-time.d.ts +2 -0
  95. package/pearl-chain-time.d.ts.map +1 -0
  96. package/pearl-chain-time.js +90 -0
  97. package/pearl-chain-vertical/pearl-chain-vertical.d.ts +17 -0
  98. package/pearl-chain-vertical/pearl-chain-vertical.d.ts.map +1 -0
  99. package/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts +35 -0
  100. package/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts.map +1 -0
  101. package/pearl-chain-vertical-item.d.ts +2 -0
  102. package/pearl-chain-vertical-item.d.ts.map +1 -0
  103. package/pearl-chain-vertical-item.js +48 -0
  104. package/pearl-chain-vertical.d.ts +2 -0
  105. package/pearl-chain-vertical.d.ts.map +1 -0
  106. package/pearl-chain-vertical.js +24 -0
  107. package/pearl-chain.d.ts +2 -0
  108. package/pearl-chain.d.ts.map +1 -0
  109. package/pearl-chain.js +147 -0
  110. package/timetable-duration/timetable-duration.d.ts +23 -0
  111. package/timetable-duration/timetable-duration.d.ts.map +1 -0
  112. package/timetable-duration/timetable-duration.sample-data.d.ts +6 -0
  113. package/timetable-duration/timetable-duration.sample-data.d.ts.map +1 -0
  114. package/timetable-duration.d.ts +2 -0
  115. package/timetable-duration.d.ts.map +1 -0
  116. package/timetable-duration.js +37 -0
  117. package/timetable-row/timetable-row.d.ts +79 -0
  118. package/timetable-row/timetable-row.d.ts.map +1 -0
  119. package/timetable-row/timetable-row.sample-data.d.ts +24 -0
  120. package/timetable-row/timetable-row.sample-data.d.ts.map +1 -0
  121. package/timetable-row.d.ts +2 -0
  122. package/timetable-row.d.ts.map +1 -0
  123. package/timetable-row.js +386 -0
@@ -0,0 +1,4 @@
1
+ export * from './timetable/access-leg-helper.js';
2
+ export * from './timetable/timetable-helper.js';
3
+ export * from './timetable/timetable-properties.js';
4
+ //# sourceMappingURL=timetable.d.ts.map
@@ -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}&nbsp;
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
+ };