@sbb-esta/lyne-elements-experimental-dev 4.7.0-dev.1773333596 → 4.7.0-dev.1773388997

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 (199) hide show
  1. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +65 -76
  2. package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +72 -52
  3. package/autocomplete-grid/autocomplete-grid-button.js +3 -6
  4. package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +2 -17
  5. package/autocomplete-grid/autocomplete-grid-cell.js +4 -7
  6. package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +20 -21
  7. package/autocomplete-grid/autocomplete-grid-optgroup.js +3 -6
  8. package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +2 -33
  9. package/autocomplete-grid/autocomplete-grid-option.js +4 -9
  10. package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -22
  11. package/autocomplete-grid/autocomplete-grid-row.js +4 -7
  12. package/autocomplete-grid/autocomplete-grid.js +3 -6
  13. package/autocomplete-grid-cell.component-Dak9wlBr.js +24 -0
  14. package/autocomplete-grid-option.component-DNRFHOwc.js +37 -0
  15. package/autocomplete-grid-row.component-DBHZQ0GQ.js +27 -0
  16. package/autocomplete-grid.js +9 -21
  17. package/autocomplete-grid.pure.js +7 -15
  18. package/core/datetime/date-helper.js +2 -191
  19. package/core/datetime.js +2 -5
  20. package/core/timetable/access-leg-helper.js +76 -71
  21. package/core/timetable/timetable-helper.js +9 -11
  22. package/core/timetable/timetable-properties.js +0 -1
  23. package/core/timetable.js +3 -7
  24. package/date-helper-CGproP5d.js +185 -0
  25. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +114 -122
  26. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +92 -70
  27. package/development/autocomplete-grid/autocomplete-grid-button.js +6 -4
  28. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +2 -29
  29. package/development/autocomplete-grid/autocomplete-grid-cell.js +7 -5
  30. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +27 -22
  31. package/development/autocomplete-grid/autocomplete-grid-optgroup.js +6 -4
  32. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +2 -109
  33. package/development/autocomplete-grid/autocomplete-grid-option.js +7 -7
  34. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -91
  35. package/development/autocomplete-grid/autocomplete-grid-row.js +7 -5
  36. package/development/autocomplete-grid/autocomplete-grid.js +6 -4
  37. package/development/autocomplete-grid-cell.component-BBvM4o2H.js +42 -0
  38. package/development/autocomplete-grid-option.component-QzfM5eIE.js +123 -0
  39. package/development/autocomplete-grid-row.component-H8sCTCkT.js +104 -0
  40. package/development/autocomplete-grid.js +10 -14
  41. package/development/autocomplete-grid.pure.js +4 -13
  42. package/development/core/datetime/date-helper.js +2 -285
  43. package/development/core/datetime.js +2 -6
  44. package/development/core/timetable/access-leg-helper.js +104 -82
  45. package/development/core/timetable/timetable-helper.js +16 -17
  46. package/development/core/timetable/timetable-properties.js +0 -2
  47. package/development/core/timetable.js +3 -8
  48. package/development/date-helper-8_Y-PuHh.js +520 -0
  49. package/development/differenceInMinutes-DN_1Rk3O.js +110 -0
  50. package/development/format-Bbrn2bgo.js +1848 -0
  51. package/development/isValid-C-HzKv4v.js +178 -0
  52. package/development/journey-summary/journey-summary.component.js +2 -288
  53. package/development/journey-summary.component-uGhZvA4p.js +385 -0
  54. package/development/journey-summary.js +8 -5
  55. package/development/journey-summary.pure.js +2 -5
  56. package/development/pearl-chain/pearl-chain.component.js +2 -634
  57. package/development/pearl-chain-time/pearl-chain-time.component.js +2 -306
  58. package/development/pearl-chain-time.component-B8mayTWD.js +415 -0
  59. package/development/pearl-chain-time.js +8 -5
  60. package/development/pearl-chain-time.pure.js +2 -5
  61. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +2 -28
  62. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +2 -393
  63. package/development/pearl-chain-vertical-item.component-BDzbcIaf.js +435 -0
  64. package/development/pearl-chain-vertical-item.js +8 -5
  65. package/development/pearl-chain-vertical-item.pure.js +2 -5
  66. package/development/pearl-chain-vertical.component-CswE7b3M.js +39 -0
  67. package/development/pearl-chain-vertical.js +8 -5
  68. package/development/pearl-chain-vertical.pure.js +2 -5
  69. package/development/pearl-chain.component-wpsTvoSe.js +704 -0
  70. package/development/pearl-chain.js +8 -5
  71. package/development/pearl-chain.pure.js +2 -5
  72. package/development/seat-reservation/common/mapper/icon-mapper.js +168 -71
  73. package/development/seat-reservation/common/mapper/mapper.js +153 -122
  74. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +570 -559
  75. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +992 -972
  76. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20334 -20367
  77. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1731 -1738
  78. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9741 -9782
  79. package/development/seat-reservation/common/mapper.js +1 -8
  80. package/development/seat-reservation/common/svgs.js +2 -46
  81. package/development/seat-reservation/common/translations/i18n.js +1118 -900
  82. package/development/seat-reservation/common/translations.js +1 -4
  83. package/development/seat-reservation/common/types.js +0 -2
  84. package/development/seat-reservation/common.js +7 -11
  85. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +1305 -1230
  86. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +2 -859
  87. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +2 -106
  88. package/development/seat-reservation/seat-reservation-area.js +7 -5
  89. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +35 -34
  90. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +2 -162
  91. package/development/seat-reservation/seat-reservation-graphic.js +7 -5
  92. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +2 -713
  93. package/development/seat-reservation/seat-reservation-navigation-coach.js +7 -5
  94. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -131
  95. package/development/seat-reservation/seat-reservation-navigation-services.js +7 -5
  96. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -601
  97. package/development/seat-reservation/seat-reservation-place-control.js +7 -5
  98. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -22
  99. package/development/seat-reservation/seat-reservation-scoped.js +7 -5
  100. package/development/seat-reservation/seat-reservation.js +7 -6
  101. package/development/seat-reservation-area.component-BK92ZtFo.js +138 -0
  102. package/development/seat-reservation-graphic.component-cUnsHh5x.js +193 -0
  103. package/development/seat-reservation-navigation-coach.component-D6Bglus8.js +828 -0
  104. package/development/seat-reservation-navigation-services.component-DYJ6Ddkg.js +179 -0
  105. package/development/seat-reservation-place-control.component-Bg9evKBW.js +726 -0
  106. package/development/seat-reservation-scoped.component-DRQ_I702.js +31 -0
  107. package/development/seat-reservation.component-Cq_aJKR0.js +818 -0
  108. package/development/seat-reservation.js +15 -28
  109. package/development/seat-reservation.pure.js +10 -28
  110. package/development/svgs-C3JMWR26.js +28 -0
  111. package/development/timetable-duration/timetable-duration.component.js +2 -108
  112. package/development/timetable-duration.component-DI0lET17.js +125 -0
  113. package/development/timetable-duration.js +8 -5
  114. package/development/timetable-duration.pure.js +2 -5
  115. package/development/timetable-row/timetable-row.component.js +2 -781
  116. package/development/timetable-row.component-CAED6Zwc.js +932 -0
  117. package/development/timetable-row.js +8 -13
  118. package/development/timetable-row.pure.js +2 -12
  119. package/development/toDate-Biiv3kyf.js +150 -0
  120. package/differenceInMinutes-Dr9gRqtu.js +27 -0
  121. package/format-CM5exOsN.js +1103 -0
  122. package/isValid-B9oVW3lA.js +36 -0
  123. package/journey-summary/journey-summary.component.js +2 -194
  124. package/journey-summary.component-Cq_4kaOp.js +264 -0
  125. package/journey-summary.js +5 -4
  126. package/journey-summary.pure.js +2 -4
  127. package/package.json +2 -2
  128. package/pearl-chain/pearl-chain.component.js +2 -165
  129. package/pearl-chain-time/pearl-chain-time.component.js +2 -157
  130. package/pearl-chain-time.component-DGDW5S1c.js +239 -0
  131. package/pearl-chain-time.js +5 -4
  132. package/pearl-chain-time.pure.js +2 -4
  133. package/pearl-chain-vertical/pearl-chain-vertical.component.js +2 -17
  134. package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +2 -77
  135. package/pearl-chain-vertical-item.component-G22bWhLU.js +108 -0
  136. package/pearl-chain-vertical-item.js +5 -4
  137. package/pearl-chain-vertical-item.pure.js +2 -4
  138. package/pearl-chain-vertical.component-CXIDT5RD.js +21 -0
  139. package/pearl-chain-vertical.js +5 -4
  140. package/pearl-chain-vertical.pure.js +2 -4
  141. package/pearl-chain.component-DmjkVIva.js +194 -0
  142. package/pearl-chain.js +5 -4
  143. package/pearl-chain.pure.js +2 -4
  144. package/seat-reservation/common/mapper/icon-mapper.js +71 -71
  145. package/seat-reservation/common/mapper/mapper.js +95 -89
  146. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +568 -558
  147. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +989 -970
  148. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20332 -20366
  149. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1729 -1737
  150. package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9739 -9781
  151. package/seat-reservation/common/mapper.js +3 -9
  152. package/seat-reservation/common/svgs.js +2 -243
  153. package/seat-reservation/common/translations/i18n.js +1084 -891
  154. package/seat-reservation/common/translations.js +2 -4
  155. package/seat-reservation/common/types.js +0 -1
  156. package/seat-reservation/common.js +9 -15
  157. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +832 -810
  158. package/seat-reservation/seat-reservation/seat-reservation.component.js +2 -420
  159. package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +2 -51
  160. package/seat-reservation/seat-reservation-area.js +4 -7
  161. package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +68 -71
  162. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +2 -75
  163. package/seat-reservation/seat-reservation-graphic.js +4 -7
  164. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +2 -234
  165. package/seat-reservation/seat-reservation-navigation-coach.js +4 -7
  166. package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -85
  167. package/seat-reservation/seat-reservation-navigation-services.js +4 -7
  168. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -203
  169. package/seat-reservation/seat-reservation-place-control.js +4 -7
  170. package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -13
  171. package/seat-reservation/seat-reservation-scoped.js +4 -7
  172. package/seat-reservation/seat-reservation.js +5 -9
  173. package/seat-reservation-area.component-n-9rGn_y.js +75 -0
  174. package/seat-reservation-graphic.component-YTXRmKt0.js +102 -0
  175. package/seat-reservation-navigation-coach.component-YJ0vaYmO.js +333 -0
  176. package/seat-reservation-navigation-services.component-C3xnLJg2.js +127 -0
  177. package/seat-reservation-place-control.component-DmBAfM6K.js +322 -0
  178. package/seat-reservation-scoped.component-DPkz6u17.js +17 -0
  179. package/seat-reservation.component-C_anMkgw.js +364 -0
  180. package/seat-reservation.js +17 -39
  181. package/seat-reservation.pure.js +15 -32
  182. package/svgs-D9arBcqr.js +26 -0
  183. package/timetable-duration/timetable-duration.component.js +2 -57
  184. package/timetable-duration.component-DCu8Phts.js +65 -0
  185. package/timetable-duration.js +5 -4
  186. package/timetable-duration.pure.js +2 -4
  187. package/timetable-row/timetable-row.component.js +2 -427
  188. package/timetable-row.component-BVRCB3xK.js +559 -0
  189. package/timetable-row.js +6 -13
  190. package/timetable-row.pure.js +2 -11
  191. package/toDate-p-Tpkb7t.js +16 -0
  192. package/development/differenceInMinutes-B0dawX-5.js +0 -26
  193. package/development/format-BMkeaqaF.js +0 -1433
  194. package/development/isValid-BYRch7pV.js +0 -53
  195. package/development/toDate-BWb6Z1JD.js +0 -24
  196. package/differenceInMinutes-COvvdYsJ.js +0 -23
  197. package/format-CmKROkbc.js +0 -1186
  198. package/isValid-m3_OsPaB.js +0 -45
  199. package/toDate-Bw2KTWeq.js +0 -15
@@ -0,0 +1,36 @@
1
+ import { n as e, r as t, t as n } from "./toDate-p-Tpkb7t.js";
2
+ //#region node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
3
+ function r(e) {
4
+ let t = n(e), r = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
5
+ return r.setUTCFullYear(t.getFullYear()), e - +r;
6
+ }
7
+ //#endregion
8
+ //#region node_modules/date-fns/_lib/normalizeDates.js
9
+ function i(t, ...n) {
10
+ let r = e.bind(null, t || n.find((e) => typeof e == "object"));
11
+ return n.map(r);
12
+ }
13
+ //#endregion
14
+ //#region node_modules/date-fns/startOfDay.js
15
+ function a(e, t) {
16
+ let r = n(e, t?.in);
17
+ return r.setHours(0, 0, 0, 0), r;
18
+ }
19
+ //#endregion
20
+ //#region node_modules/date-fns/differenceInCalendarDays.js
21
+ function o(e, n, o) {
22
+ let [s, c] = i(o?.in, e, n), l = a(s), u = a(c), d = +l - r(l), f = +u - r(u);
23
+ return Math.round((d - f) / t);
24
+ }
25
+ //#endregion
26
+ //#region node_modules/date-fns/isDate.js
27
+ function s(e) {
28
+ return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
29
+ }
30
+ //#endregion
31
+ //#region node_modules/date-fns/isValid.js
32
+ function c(e) {
33
+ return !(!s(e) && typeof e != "number" || isNaN(+n(e)));
34
+ }
35
+ //#endregion
36
+ export { o as n, i as r, c as t };
@@ -1,194 +1,2 @@
1
- var G = (a) => {
2
- throw TypeError(a);
3
- };
4
- var H = (a, s, o) => s.has(a) || G("Cannot " + o);
5
- var h = (a, s, o) => (H(a, s, "read from private field"), o ? o.call(a) : s.get(a)), m = (a, s, o) => s.has(a) ? G("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(a) : s.set(a, o), n = (a, s, o, $) => (H(a, s, "write to private field"), $ ? $.call(a, o) : s.set(a, o), o);
6
- import { __runInitializers as l, __esDecorate as u } from "tslib";
7
- import { SbbElement as X } from "@sbb-esta/lyne-elements/core/base-elements.js";
8
- import { SbbLanguageController as Y } from "@sbb-esta/lyne-elements/core/controllers.js";
9
- import { defaultDateAdapter as x } from "@sbb-esta/lyne-elements/core/datetime.js";
10
- import { forceType as w } from "@sbb-esta/lyne-elements/core/decorators.js";
11
- import { i18nTripDuration as Z } from "@sbb-esta/lyne-elements/core/i18n.js";
12
- import { boxSizingStyles as J } from "@sbb-esta/lyne-elements/core/styles.js";
13
- import { css as E, nothing as d, html as c } from "lit";
14
- import { property as b } from "lit/decorators.js";
15
- import { durationToTime as tt, removeTimezoneFromISOTimeString as et } from "../core/datetime.js";
16
- import "@sbb-esta/lyne-elements/divider.js";
17
- import "@sbb-esta/lyne-elements/screen-reader-only.js";
18
- import "@sbb-esta/lyne-elements/journey-header.js";
19
- import "../pearl-chain-time.js";
20
- import { i as it } from "../isValid-m3_OsPaB.js";
21
- import { f as K } from "../format-CmKROkbc.js";
22
- const at = E`:host{display:block}.sbb-journey-summary{--sbb-text-font-size: var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);color:var(--sbb-color-4);display:flex;flex-direction:column}.sbb-journey-summary__via-block{display:flex}.sbb-journey-summary__vias{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-block:0;padding-inline-start:var(--sbb-spacing-fixed-1x)}.sbb-journey-summary__date{margin-block-end:var(--sbb-spacing-fixed-2x)}.sbb-journey-summary__via{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sbb-journey-summary__divider{margin-block:var(--sbb-spacing-fixed-6x)}ul li{list-style:none;display:inline}`;
23
- let $t = (() => {
24
- var _, y, f, v, g, k, r;
25
- let a = X, s = [], o, $ = [], j = [], z, T = [], B = [], A, F = [], I = [], L, O = [], C = [], V, D = [], W = [], N, q = [], M = [], P;
26
- return r = class extends a {
27
- constructor() {
28
- super(...arguments);
29
- m(this, _);
30
- m(this, y);
31
- m(this, f);
32
- m(this, v);
33
- m(this, g);
34
- m(this, k);
35
- n(this, _, (l(this, s), l(this, $, null))), n(this, y, (l(this, j), l(this, T, null))), n(this, f, (l(this, B), l(this, F, !1))), n(this, v, (l(this, I), l(this, O, "3"))), n(this, g, (l(this, C), l(this, D, !1))), n(this, k, (l(this, W), l(this, q, !1))), this._now = (l(this, M), null), this._hasContentSlot = !1, this._language = new Y(this);
36
- }
37
- /** The trip prop */
38
- get trip() {
39
- return h(this, _);
40
- }
41
- set trip(e) {
42
- n(this, _, e);
43
- }
44
- /** The tripBack prop */
45
- get tripBack() {
46
- return h(this, y);
47
- }
48
- set tripBack(e) {
49
- n(this, y, e);
50
- }
51
- /**
52
- * The RoundTrip prop. This prop controls if one or two arrows are displayed in the header.
53
- */
54
- get roundTrip() {
55
- return h(this, f);
56
- }
57
- set roundTrip(e) {
58
- n(this, f, e);
59
- }
60
- /** Heading level of the journey header element (e.g. h1-h6). */
61
- get headerLevel() {
62
- return h(this, v);
63
- }
64
- set headerLevel(e) {
65
- n(this, v, e);
66
- }
67
- /**
68
- * Per default, the current location has a pulsating animation. You can
69
- * disable the animation with this property.
70
- */
71
- get disableAnimation() {
72
- return h(this, g);
73
- }
74
- set disableAnimation(e) {
75
- n(this, g, e);
76
- }
77
- /**
78
- * The Footpath attribute for rendering different icons
79
- * true: render a11y-icon
80
- * false: render walk-icon
81
- * default: render walk-icon
82
- */
83
- get a11yFootpath() {
84
- return h(this, k);
85
- }
86
- set a11yFootpath(e) {
87
- n(this, k, e);
88
- }
89
- /**
90
- * A configured date which acts as the current date instead of the real current date.
91
- * Only recommended for testing purposes.
92
- */
93
- set now(e) {
94
- this._now = x.getValidDateOrNull(x.deserialize(e));
95
- }
96
- get now() {
97
- return this._now ?? /* @__PURE__ */ new Date();
98
- }
99
- connectedCallback() {
100
- super.connectedCallback(), this._hasContentSlot = !!this.querySelector?.('[slot="content"]');
101
- }
102
- /** renders the date of the journey or if it is the current or next day */
103
- _renderJourneyStart(e, t) {
104
- const i = x, p = t ? tt(t, this._language.current) : null;
105
- if (it(e))
106
- return c`
107
- <time datetime=${K(e, "d") + " " + K(e, "M")}>
108
- ${i.format(e).replace(",", ".")}</time
109
- >${t && t > 0 ? c`,<time>
110
- <sbb-screen-reader-only>
111
- ${Z[this._language.current]} ${p.long}
112
- </sbb-screen-reader-only>
113
- <span aria-hidden="true">${p.short}</span>
114
- </time>` : d}
115
- `;
116
- }
117
- _renderJourneyVias(e) {
118
- const t = e.slice(0, 5);
119
- return c`
120
- <div class="sbb-journey-summary__via-block">
121
- <span class="sbb-journey-summary__via-text">Via</span>
122
- <ul class="sbb-journey-summary__vias" role=${e.length <= 1 ? "presentation" : d}>
123
- ${t.map((i, p) => c`<li class="sbb-journey-summary__via">
124
- ${i}${p !== t.length - 1 && p < 4 ? c`<span>,</span>` : d}
125
- </li>`)}
126
- </ul>
127
- </div>
128
- `;
129
- }
130
- _renderJourneyInformation(e) {
131
- const { vias: t, duration: i, departureWalk: p, departure: S, arrivalWalk: Q, arrival: R, legs: U } = e || {};
132
- return c`
133
- <div>
134
- ${t && t.length > 0 ? this._renderJourneyVias(t) : d}
135
- <div class="sbb-journey-summary__date">
136
- ${this._renderJourneyStart(et(S), i)}
137
- </div>
138
- <sbb-pearl-chain-time
139
- .arrivalTime=${R}
140
- .departureTime=${S}
141
- .departureWalk=${p}
142
- .arrivalWalk=${Q}
143
- .legs=${U}
144
- .disableAnimation=${this.disableAnimation}
145
- .a11yFootpath=${this.a11yFootpath}
146
- .now=${this.now}
147
- ></sbb-pearl-chain-time>
148
- </div>
149
- `;
150
- }
151
- render() {
152
- const { origin: e, destination: t } = this.trip || {};
153
- return c`
154
- <div class="sbb-journey-summary">
155
- ${e ? c`<sbb-journey-header
156
- size="l"
157
- .level=${this.headerLevel || d}
158
- .origin=${e}
159
- .destination=${t}
160
- .roundTrip=${this.roundTrip ?? d}
161
- ></sbb-journey-header>` : d}
162
- ${this._renderJourneyInformation(this.trip)}
163
- ${this.tripBack ? c`<div>
164
- <sbb-divider class="sbb-journey-summary__divider"></sbb-divider>
165
- ${this._renderJourneyInformation(this.tripBack)}
166
- </div>` : d}
167
- ${this._hasContentSlot ? c` <div class="sbb-journey-summary__slot">
168
- <slot name="content"></slot>
169
- </div>` : d}
170
- </div>
171
- `;
172
- }
173
- }, _ = new WeakMap(), y = new WeakMap(), f = new WeakMap(), v = new WeakMap(), g = new WeakMap(), k = new WeakMap(), (() => {
174
- const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(a[Symbol.metadata] ?? null) : void 0;
175
- o = [b({ type: Object })], z = [b({ attribute: "trip-back", type: Object })], A = [w(), b({ attribute: "round-trip", type: Boolean })], L = [b({ attribute: "header-level" })], V = [w(), b({ attribute: "disable-animation", type: Boolean })], N = [w(), b({ attribute: "a11y-footpath", type: Boolean })], P = [b()], u(r, null, o, { kind: "accessor", name: "trip", static: !1, private: !1, access: { has: (t) => "trip" in t, get: (t) => t.trip, set: (t, i) => {
176
- t.trip = i;
177
- } }, metadata: e }, $, j), u(r, null, z, { kind: "accessor", name: "tripBack", static: !1, private: !1, access: { has: (t) => "tripBack" in t, get: (t) => t.tripBack, set: (t, i) => {
178
- t.tripBack = i;
179
- } }, metadata: e }, T, B), u(r, null, A, { kind: "accessor", name: "roundTrip", static: !1, private: !1, access: { has: (t) => "roundTrip" in t, get: (t) => t.roundTrip, set: (t, i) => {
180
- t.roundTrip = i;
181
- } }, metadata: e }, F, I), u(r, null, L, { kind: "accessor", name: "headerLevel", static: !1, private: !1, access: { has: (t) => "headerLevel" in t, get: (t) => t.headerLevel, set: (t, i) => {
182
- t.headerLevel = i;
183
- } }, metadata: e }, O, C), u(r, null, V, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (t) => "disableAnimation" in t, get: (t) => t.disableAnimation, set: (t, i) => {
184
- t.disableAnimation = i;
185
- } }, metadata: e }, D, W), u(r, null, N, { kind: "accessor", name: "a11yFootpath", static: !1, private: !1, access: { has: (t) => "a11yFootpath" in t, get: (t) => t.a11yFootpath, set: (t, i) => {
186
- t.a11yFootpath = i;
187
- } }, metadata: e }, q, M), u(r, null, P, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (t) => "now" in t, set: (t, i) => {
188
- t.now = i;
189
- } }, metadata: e }, null, s), e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
190
- })(), r.elementName = "sbb-journey-summary", r.styles = [J, at], r;
191
- })();
192
- export {
193
- $t as SbbJourneySummaryElement
194
- };
1
+ import { t as e } from "../journey-summary.component-Cq_4kaOp.js";
2
+ export { e as SbbJourneySummaryElement };
@@ -0,0 +1,264 @@
1
+ import { t as e } from "./format-CM5exOsN.js";
2
+ import { t } from "./isValid-B9oVW3lA.js";
3
+ import { __esDecorate as n, __runInitializers as r } from "tslib";
4
+ import { SbbElement as i } from "@sbb-esta/lyne-elements/core/base-elements.js";
5
+ import { SbbLanguageController as a } from "@sbb-esta/lyne-elements/core/controllers.js";
6
+ import { forceType as o } from "@sbb-esta/lyne-elements/core/decorators.js";
7
+ import { boxSizingStyles as s } from "@sbb-esta/lyne-elements/core/styles.js";
8
+ import { css as c, html as l, nothing as u } from "lit";
9
+ import { defaultDateAdapter as d } from "@sbb-esta/lyne-elements/core/datetime.js";
10
+ import { i18nTripDuration as f } from "@sbb-esta/lyne-elements/core/i18n.js";
11
+ import { property as p } from "lit/decorators.js";
12
+ import { durationToTime as m, removeTimezoneFromISOTimeString as h } from "./core/datetime.js";
13
+ import "@sbb-esta/lyne-elements/divider.js";
14
+ import "@sbb-esta/lyne-elements/screen-reader-only.js";
15
+ import "@sbb-esta/lyne-elements/journey-header.js";
16
+ import "./pearl-chain-time.js";
17
+ //#region src/elements-experimental/journey-summary/journey-summary.scss?lit&inline
18
+ var g = c`:host{display:block}.sbb-journey-summary{--sbb-text-font-size:var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);color:var(--sbb-color-4);flex-direction:column;display:flex}.sbb-journey-summary__via-block{display:flex}.sbb-journey-summary__vias{white-space:nowrap;text-overflow:ellipsis;margin-block:0;padding-inline-start:var(--sbb-spacing-fixed-1x);overflow:hidden}.sbb-journey-summary__date{margin-block-end:var(--sbb-spacing-fixed-2x)}.sbb-journey-summary__via{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.sbb-journey-summary__divider{margin-block:var(--sbb-spacing-fixed-6x)}ul li{list-style:none;display:inline}`, _ = (() => {
19
+ let c = i, _ = [], v, y = [], b = [], x, S = [], C = [], w, T = [], E = [], D, O = [], k = [], A, j = [], M = [], N, P = [], F = [], I;
20
+ return class extends c {
21
+ constructor() {
22
+ super(...arguments), this.#e = (r(this, _), r(this, y, null)), this.#t = (r(this, b), r(this, S, null)), this.#n = (r(this, C), r(this, T, !1)), this.#r = (r(this, E), r(this, O, "3")), this.#i = (r(this, k), r(this, j, !1)), this.#a = (r(this, M), r(this, P, !1)), this._now = (r(this, F), null), this._hasContentSlot = !1, this._language = new a(this);
23
+ }
24
+ static {
25
+ let e = typeof Symbol == "function" && Symbol.metadata ? Object.create(c[Symbol.metadata] ?? null) : void 0;
26
+ v = [p({ type: Object })], x = [p({
27
+ attribute: "trip-back",
28
+ type: Object
29
+ })], w = [o(), p({
30
+ attribute: "round-trip",
31
+ type: Boolean
32
+ })], D = [p({ attribute: "header-level" })], A = [o(), p({
33
+ attribute: "disable-animation",
34
+ type: Boolean
35
+ })], N = [o(), p({
36
+ attribute: "a11y-footpath",
37
+ type: Boolean
38
+ })], I = [p()], n(this, null, v, {
39
+ kind: "accessor",
40
+ name: "trip",
41
+ static: !1,
42
+ private: !1,
43
+ access: {
44
+ has: (e) => "trip" in e,
45
+ get: (e) => e.trip,
46
+ set: (e, t) => {
47
+ e.trip = t;
48
+ }
49
+ },
50
+ metadata: e
51
+ }, y, b), n(this, null, x, {
52
+ kind: "accessor",
53
+ name: "tripBack",
54
+ static: !1,
55
+ private: !1,
56
+ access: {
57
+ has: (e) => "tripBack" in e,
58
+ get: (e) => e.tripBack,
59
+ set: (e, t) => {
60
+ e.tripBack = t;
61
+ }
62
+ },
63
+ metadata: e
64
+ }, S, C), n(this, null, w, {
65
+ kind: "accessor",
66
+ name: "roundTrip",
67
+ static: !1,
68
+ private: !1,
69
+ access: {
70
+ has: (e) => "roundTrip" in e,
71
+ get: (e) => e.roundTrip,
72
+ set: (e, t) => {
73
+ e.roundTrip = t;
74
+ }
75
+ },
76
+ metadata: e
77
+ }, T, E), n(this, null, D, {
78
+ kind: "accessor",
79
+ name: "headerLevel",
80
+ static: !1,
81
+ private: !1,
82
+ access: {
83
+ has: (e) => "headerLevel" in e,
84
+ get: (e) => e.headerLevel,
85
+ set: (e, t) => {
86
+ e.headerLevel = t;
87
+ }
88
+ },
89
+ metadata: e
90
+ }, O, k), n(this, null, A, {
91
+ kind: "accessor",
92
+ name: "disableAnimation",
93
+ static: !1,
94
+ private: !1,
95
+ access: {
96
+ has: (e) => "disableAnimation" in e,
97
+ get: (e) => e.disableAnimation,
98
+ set: (e, t) => {
99
+ e.disableAnimation = t;
100
+ }
101
+ },
102
+ metadata: e
103
+ }, j, M), n(this, null, N, {
104
+ kind: "accessor",
105
+ name: "a11yFootpath",
106
+ static: !1,
107
+ private: !1,
108
+ access: {
109
+ has: (e) => "a11yFootpath" in e,
110
+ get: (e) => e.a11yFootpath,
111
+ set: (e, t) => {
112
+ e.a11yFootpath = t;
113
+ }
114
+ },
115
+ metadata: e
116
+ }, P, F), n(this, null, I, {
117
+ kind: "setter",
118
+ name: "now",
119
+ static: !1,
120
+ private: !1,
121
+ access: {
122
+ has: (e) => "now" in e,
123
+ set: (e, t) => {
124
+ e.now = t;
125
+ }
126
+ },
127
+ metadata: e
128
+ }, null, _), e && Object.defineProperty(this, Symbol.metadata, {
129
+ enumerable: !0,
130
+ configurable: !0,
131
+ writable: !0,
132
+ value: e
133
+ });
134
+ }
135
+ static {
136
+ this.elementName = "sbb-journey-summary";
137
+ }
138
+ static {
139
+ this.styles = [s, g];
140
+ }
141
+ #e;
142
+ get trip() {
143
+ return this.#e;
144
+ }
145
+ set trip(e) {
146
+ this.#e = e;
147
+ }
148
+ #t;
149
+ get tripBack() {
150
+ return this.#t;
151
+ }
152
+ set tripBack(e) {
153
+ this.#t = e;
154
+ }
155
+ #n;
156
+ get roundTrip() {
157
+ return this.#n;
158
+ }
159
+ set roundTrip(e) {
160
+ this.#n = e;
161
+ }
162
+ #r;
163
+ get headerLevel() {
164
+ return this.#r;
165
+ }
166
+ set headerLevel(e) {
167
+ this.#r = e;
168
+ }
169
+ #i;
170
+ get disableAnimation() {
171
+ return this.#i;
172
+ }
173
+ set disableAnimation(e) {
174
+ this.#i = e;
175
+ }
176
+ #a;
177
+ get a11yFootpath() {
178
+ return this.#a;
179
+ }
180
+ set a11yFootpath(e) {
181
+ this.#a = e;
182
+ }
183
+ set now(e) {
184
+ this._now = d.getValidDateOrNull(d.deserialize(e));
185
+ }
186
+ get now() {
187
+ return this._now ?? /* @__PURE__ */ new Date();
188
+ }
189
+ connectedCallback() {
190
+ super.connectedCallback(), this._hasContentSlot = !!this.querySelector?.("[slot=\"content\"]");
191
+ }
192
+ _renderJourneyStart(n, r) {
193
+ let i = d, a = r ? m(r, this._language.current) : null;
194
+ if (t(n)) return l`
195
+ <time datetime=${e(n, "d") + " " + e(n, "M")}>
196
+ ${i.format(n).replace(",", ".")}</time
197
+ >${r && r > 0 ? l`,<time>
198
+ <sbb-screen-reader-only>
199
+ ${f[this._language.current]} ${a.long}
200
+ </sbb-screen-reader-only>
201
+ <span aria-hidden="true">${a.short}</span>
202
+ </time>` : u}
203
+ `;
204
+ }
205
+ _renderJourneyVias(e) {
206
+ let t = e.slice(0, 5);
207
+ return l`
208
+ <div class="sbb-journey-summary__via-block">
209
+ <span class="sbb-journey-summary__via-text">Via</span>
210
+ <ul class="sbb-journey-summary__vias" role=${e.length <= 1 ? "presentation" : u}>
211
+ ${t.map((e, n) => l`<li class="sbb-journey-summary__via">
212
+ ${e}${n !== t.length - 1 && n < 4 ? l`<span>,</span>` : u}
213
+ </li>`)}
214
+ </ul>
215
+ </div>
216
+ `;
217
+ }
218
+ _renderJourneyInformation(e) {
219
+ let { vias: t, duration: n, departureWalk: r, departure: i, arrivalWalk: a, arrival: o, legs: s } = e || {};
220
+ return l`
221
+ <div>
222
+ ${t && t.length > 0 ? this._renderJourneyVias(t) : u}
223
+ <div class="sbb-journey-summary__date">
224
+ ${this._renderJourneyStart(h(i), n)}
225
+ </div>
226
+ <sbb-pearl-chain-time
227
+ .arrivalTime=${o}
228
+ .departureTime=${i}
229
+ .departureWalk=${r}
230
+ .arrivalWalk=${a}
231
+ .legs=${s}
232
+ .disableAnimation=${this.disableAnimation}
233
+ .a11yFootpath=${this.a11yFootpath}
234
+ .now=${this.now}
235
+ ></sbb-pearl-chain-time>
236
+ </div>
237
+ `;
238
+ }
239
+ render() {
240
+ let { origin: e, destination: t } = this.trip || {};
241
+ return l`
242
+ <div class="sbb-journey-summary">
243
+ ${e ? l`<sbb-journey-header
244
+ size="l"
245
+ .level=${this.headerLevel || u}
246
+ .origin=${e}
247
+ .destination=${t}
248
+ .roundTrip=${this.roundTrip ?? u}
249
+ ></sbb-journey-header>` : u}
250
+ ${this._renderJourneyInformation(this.trip)}
251
+ ${this.tripBack ? l`<div>
252
+ <sbb-divider class="sbb-journey-summary__divider"></sbb-divider>
253
+ ${this._renderJourneyInformation(this.tripBack)}
254
+ </div>` : u}
255
+ ${this._hasContentSlot ? l` <div class="sbb-journey-summary__slot">
256
+ <slot name="content"></slot>
257
+ </div>` : u}
258
+ </div>
259
+ `;
260
+ }
261
+ };
262
+ })();
263
+ //#endregion
264
+ export { _ as t };
@@ -1,5 +1,6 @@
1
- import { SbbJourneySummaryElement as e } from "./journey-summary/journey-summary.component.js";
1
+ import { t as e } from "./journey-summary.component-Cq_4kaOp.js";
2
+ import "./journey-summary.pure.js";
3
+ //#region src/elements-experimental/journey-summary.ts
2
4
  e.define();
3
- export {
4
- e as SbbJourneySummaryElement
5
- };
5
+ //#endregion
6
+ export { e as SbbJourneySummaryElement };
@@ -1,4 +1,2 @@
1
- import { SbbJourneySummaryElement as r } from "./journey-summary/journey-summary.component.js";
2
- export {
3
- r as SbbJourneySummaryElement
4
- };
1
+ import { t as e } from "./journey-summary.component-Cq_4kaOp.js";
2
+ export { e as SbbJourneySummaryElement };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sbb-esta/lyne-elements-experimental-dev",
3
- "version": "4.7.0-dev.1773333596",
3
+ "version": "4.7.0-dev.1773388997",
4
4
  "description": "Lyne Design System",
5
5
  "keywords": [
6
6
  "design system",
7
7
  "web components",
8
8
  "lit",
9
9
  "storybook",
10
- "https://github.com/sbb-design-systems/lyne-components/commit/dc93eed64ffcb2a136df7b1adff07825b3787e6b"
10
+ "https://github.com/sbb-design-systems/lyne-components/commit/a53df7a865e5e9799d60718ee7796e7cc0d6646e"
11
11
  ],
12
12
  "type": "module",
13
13
  "exports": {