@sbb-esta/lyne-elements-experimental 2.6.0 → 2.7.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.
Files changed (100) hide show
  1. package/core/datetime/date-helper.js +191 -0
  2. package/core/datetime.d.ts +3 -0
  3. package/core/datetime.d.ts.map +1 -1
  4. package/core/datetime.js +3 -189
  5. package/core/timetable/access-leg-helper.js +94 -0
  6. package/core/timetable/timetable-helper.js +13 -0
  7. package/core/timetable/timetable-properties.js +1 -0
  8. package/core/timetable.d.ts +3 -0
  9. package/core/timetable.d.ts.map +1 -1
  10. package/core/timetable.js +6 -102
  11. package/custom-elements.json +598 -439
  12. package/development/core/datetime/date-helper.js +285 -0
  13. package/development/core/datetime.d.ts +3 -0
  14. package/development/core/datetime.d.ts.map +1 -1
  15. package/development/core/datetime.js +2 -281
  16. package/development/core/timetable/access-leg-helper.js +128 -0
  17. package/development/core/timetable/timetable-helper.js +21 -0
  18. package/development/core/timetable/timetable-properties.js +2 -0
  19. package/development/core/timetable.d.ts +3 -0
  20. package/development/core/timetable.d.ts.map +1 -1
  21. package/development/core/timetable.js +3 -139
  22. package/development/{differenceInMinutes-Cmyza6nm.js → differenceInMinutes-CHSyWiQs.js} +2 -2
  23. package/development/{format-BU7bjY-L.js → format-D0-yhzi4.js} +3 -3
  24. package/development/{isValid-DO_pHwcW.js → isValid-Bo4R7iA7.js} +2 -2
  25. package/development/journey-summary/journey-summary.js +297 -0
  26. package/development/journey-summary.d.ts +3 -0
  27. package/development/journey-summary.d.ts.map +1 -1
  28. package/development/journey-summary.js +2 -294
  29. package/development/pearl-chain/pearl-chain.js +649 -0
  30. package/development/pearl-chain-time/pearl-chain-time.js +315 -0
  31. package/development/pearl-chain-time.d.ts +3 -0
  32. package/development/pearl-chain-time.d.ts.map +1 -1
  33. package/development/pearl-chain-time.js +2 -312
  34. package/development/pearl-chain-vertical/pearl-chain-vertical.js +45 -0
  35. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.js +395 -0
  36. package/development/pearl-chain-vertical-item.d.ts +3 -0
  37. package/development/pearl-chain-vertical-item.d.ts.map +1 -1
  38. package/development/pearl-chain-vertical-item.js +2 -392
  39. package/development/pearl-chain-vertical.d.ts +3 -0
  40. package/development/pearl-chain-vertical.d.ts.map +1 -1
  41. package/development/pearl-chain-vertical.js +2 -42
  42. package/development/pearl-chain.d.ts +3 -0
  43. package/development/pearl-chain.d.ts.map +1 -1
  44. package/development/pearl-chain.js +2 -646
  45. package/development/timetable-duration/timetable-duration.js +119 -0
  46. package/development/timetable-duration.d.ts +3 -0
  47. package/development/timetable-duration.d.ts.map +1 -1
  48. package/development/timetable-duration.js +2 -116
  49. package/development/timetable-row/timetable-row.js +820 -0
  50. package/development/timetable-row.d.ts +3 -0
  51. package/development/timetable-row.d.ts.map +1 -1
  52. package/development/timetable-row.js +2 -810
  53. package/development/{toDate-B6IBgPYH.js → toDate-D_Vjps95.js} +5 -5
  54. package/{differenceInMinutes-BI2zjbtS.js → differenceInMinutes-BMqUZdhj.js} +1 -1
  55. package/{format-CUYwLzoN.js → format-Dg8rkk7h.js} +2 -2
  56. package/index.d.ts +7 -7
  57. package/index.js +7 -7
  58. package/{isValid-mroh13Xp.js → isValid-DJ69OMZJ.js} +6 -6
  59. package/journey-summary/journey-summary.js +190 -0
  60. package/journey-summary.d.ts +3 -0
  61. package/journey-summary.d.ts.map +1 -1
  62. package/journey-summary.js +2 -188
  63. package/package.json +3 -3
  64. package/pearl-chain/pearl-chain.js +177 -0
  65. package/pearl-chain-time/pearl-chain-time.js +153 -0
  66. package/pearl-chain-time.d.ts +3 -0
  67. package/pearl-chain-time.d.ts.map +1 -1
  68. package/pearl-chain-time.js +2 -151
  69. package/pearl-chain-vertical/pearl-chain-vertical.js +23 -0
  70. package/pearl-chain-vertical-item/pearl-chain-vertical-item.js +71 -0
  71. package/pearl-chain-vertical-item.d.ts +3 -0
  72. package/pearl-chain-vertical-item.d.ts.map +1 -1
  73. package/pearl-chain-vertical-item.js +2 -69
  74. package/pearl-chain-vertical.d.ts +3 -0
  75. package/pearl-chain-vertical.d.ts.map +1 -1
  76. package/pearl-chain-vertical.js +2 -21
  77. package/pearl-chain.d.ts +3 -0
  78. package/pearl-chain.d.ts.map +1 -1
  79. package/pearl-chain.js +2 -175
  80. package/timetable-duration/timetable-duration.js +55 -0
  81. package/timetable-duration.d.ts +3 -0
  82. package/timetable-duration.d.ts.map +1 -1
  83. package/timetable-duration.js +2 -53
  84. package/timetable-row/timetable-row.js +462 -0
  85. package/timetable-row.d.ts +3 -0
  86. package/timetable-row.d.ts.map +1 -1
  87. package/timetable-row.js +9 -460
  88. package/{toDate-DQg4ZFnf.js → toDate-BCXKL_wM.js} +4 -4
  89. package/development/pearl-chain/pearl-chain.sample-data.d.ts +0 -141
  90. package/development/pearl-chain/pearl-chain.sample-data.d.ts.map +0 -1
  91. package/development/timetable-duration/timetable-duration.sample-data.d.ts +0 -6
  92. package/development/timetable-duration/timetable-duration.sample-data.d.ts.map +0 -1
  93. package/development/timetable-row/timetable-row.sample-data.d.ts +0 -25
  94. package/development/timetable-row/timetable-row.sample-data.d.ts.map +0 -1
  95. package/pearl-chain/pearl-chain.sample-data.d.ts +0 -141
  96. package/pearl-chain/pearl-chain.sample-data.d.ts.map +0 -1
  97. package/timetable-duration/timetable-duration.sample-data.d.ts +0 -6
  98. package/timetable-duration/timetable-duration.sample-data.d.ts.map +0 -1
  99. package/timetable-row/timetable-row.sample-data.d.ts +0 -25
  100. package/timetable-row/timetable-row.sample-data.d.ts.map +0 -1
@@ -1,2 +1,5 @@
1
+ /**
2
+ * @entrypoint
3
+ */
1
4
  export * from './pearl-chain-vertical-item/pearl-chain-vertical-item.js';
2
5
  //# sourceMappingURL=pearl-chain-vertical-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pearl-chain-vertical-item.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/pearl-chain-vertical-item.ts"],"names":[],"mappings":"AAAA,cAAc,0DAA0D,CAAC"}
1
+ {"version":3,"file":"pearl-chain-vertical-item.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/pearl-chain-vertical-item.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,0DAA0D,CAAC"}
@@ -1,71 +1,4 @@
1
- var C = (e) => {
2
- throw TypeError(e);
3
- };
4
- var A = (e, a, t) => a.has(e) || C("Cannot " + t);
5
- var d = (e, a, t) => (A(e, a, "read from private field"), t ? t.call(e) : a.get(e)), v = (e, a, t) => a.has(e) ? C("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(e) : a.set(e, t), m = (e, a, t, r) => (A(e, a, "write to private field"), r ? r.call(e, t) : a.set(e, t), t);
6
- import { __esDecorate as u, __runInitializers as h } from "tslib";
7
- import { forceType as S } from "@sbb-esta/lyne-elements/core/decorators.js";
8
- import { css as E, LitElement as j, nothing as _, html as p } from "lit";
9
- import { customElement as D, property as I } from "lit/decorators.js";
10
- const G = E`*,:before,:after{box-sizing:border-box}:host{--sbb-pearl-chain-bullet-size-start-end: .625rem;--sbb-pearl-chain-bullet-size-stop: .5rem;--sbb-pearl-chain-bullet-color: var(--sbb-color-charcoal);--sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-red);--sbb-pearl-chain-bullet-border-width: var(--sbb-border-width-2x);--sbb-pearl-chain-bullet-animation-duration: 1.92s;--sbb-pearl-chain-bullet-animation-easing: ease-out;--sbb-pearl-chain-bullet-crossed-width: .88375rem;--sbb-pearl-chain-bullet-crossed-height: .21875rem;--sbb-pearl-chain-bullet-crossed-border-width: .09375rem;display:table-row;position:relative;--sbb-pearl-chain-vertical-right-item-width: 100%;--sbb-pearl-chain-vertical-middle-item-min-width: var(--sbb-pearl-chain-bullet-size-start-end);--sbb-pearl-chain-vertical-item-border-width: var(--sbb-border-width-2x);--sbb-pearl-chain-vertical-item-border-width-thin: var(--sbb-border-width-1x);--sbb-pearl-chain-vertical-item-spacing-small: var(--sbb-spacing-fixed-1x);--sbb-pearl-chain-vertical-item-spacing-medium: var(--sbb-spacing-fixed-4x);--sbb-pearl-chain-vertical-item-color-default: var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-vertical-item-color-disruption: var(--sbb-pearl-chain-bullet-color-disruption);--sbb-pearl-chain-vertical-item-color-past: var(--sbb-pearl-chain-bullet-color-past);--sbb-pearl-chain-vertical-item-color-walk: var(--sbb-color-sky);--sbb-pearl-chain-vertical-item-inline-start: 50%;--sbb-pearl-chain-vertical-item-transform: translateX(-50%)}slot[name=right],.sbb-pearl-chain-vertical-item__column{display:table-cell;position:relative;vertical-align:top}slot[name=right]{width:var(--sbb-pearl-chain-vertical-right-item-width)}.sbb-pearl-chain-vertical-item__column--middle{min-width:var(--sbb-pearl-chain-vertical-middle-item-min-width, --sbb-pearl-chain-vertical-middle-min-width)}slot[name=left]::slotted(*){margin-block-start:var(--sbb-pearl-chain-vertical-left-item-block-start);padding-inline-end:var(--sbb-pearl-chain-vertical-left-item-inline-end)}slot[name=right]::slotted(*){margin-block-start:var(--sbb-pearl-chain-vertical-right-item-block-start);padding-inline-start:var(--sbb-pearl-chain-vertical-right-item-inline-start)}.sbb-pearl-chain-vertical-item__middle{vertical-align:top;border-spacing:0}.sbb-pearl-chain-vertical-item__line{position:absolute;bottom:0;inset-inline-start:var(--sbb-pearl-chain-vertical-item-inline-start);transform:var(--sbb-pearl-chain-vertical-item-transform);width:var(--sbb-border-width-2x);inset-block-start:calc(var(--sbb-pearl-chain-bullet-size-start-end) / 2)}.sbb-pearl-chain-vertical-item__line:after{content:"";position:absolute;inset-inline-start:0;inset-block-start:0;height:var(--sbb-pearl-chain-vertical-item-leg-status);width:var(--sbb-pearl-chain-vertical-item-border-width);background-color:var(--sbb-pearl-chain-vertical-item-color-past)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line:after{--sbb-pearl-chain-vertical-item-color-past: GrayText}}.sbb-pearl-chain-vertical-item__line--dotted{background-color:unset;border-color:unset;background-image:linear-gradient(to bottom,currentcolor 0%,currentcolor 50%,Canvas 50%);background-repeat:repeat-y;background-size:calc(2 * var(--sbb-pearl-chain-vertical-item-spacing-small)) var(--sbb-pearl-chain-vertical-item-spacing-small)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line--dotted{background-color:unset!important;border-inline-start:.0625rem dashed Highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain-vertical-item__line--thin{width:var(--sbb-pearl-chain-vertical-item-border-width-thin)}.sbb-pearl-chain-vertical-item__line--default{background-color:var(--sbb-pearl-chain-vertical-item-color-default);border-color:var(--sbb-pearl-chain-vertical-item-color-default);color:var(--sbb-pearl-chain-vertical-item-color-default)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line--default{--sbb-pearl-chain-vertical-item-color-default: CanvasText}}.sbb-pearl-chain-vertical-item__line--disruption{border-color:var(--sbb-pearl-chain-vertical-item-color-disruption);background-color:var(--sbb-pearl-chain-vertical-item-color-disruption);color:var(--sbb-pearl-chain-vertical-item-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line--disruption{--sbb-pearl-chain-vertical-item-color-disruption: Highlight}}.sbb-pearl-chain-vertical-item__line--past{border-color:var(--sbb-pearl-chain-vertical-item-color-past);background-color:var(--sbb-pearl-chain-vertical-item-color-past);color:var(--sbb-pearl-chain-vertical-item-color-past)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__line--past{--sbb-pearl-chain-vertical-item-color-past: GrayText}}.sbb-pearl-chain-vertical-item__line--walk{border-color:var(--sbb-pearl-chain-vertical-item-color-walk);background-color:var(--sbb-pearl-chain-vertical-item-color-walk);color:var(--sbb-pearl-chain-vertical-item-color-walk)}.sbb-pearl-chain-vertical-item__bullet{position:relative;inset-inline-start:var(--sbb-pearl-chain-vertical-item-inline-start);transform:var(--sbb-pearl-chain-vertical-item-transform);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain-vertical-item__bullet--start-end{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end)}.sbb-pearl-chain-vertical-item__bullet--stop{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain-vertical-item__bullet--disruption{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--disruption{--sbb-pearl-chain-bullet-color: Highlight}}.sbb-pearl-chain-vertical-item__bullet--irrelevant,.sbb-pearl-chain-vertical-item__bullet--past{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--irrelevant,.sbb-pearl-chain-vertical-item__bullet--past{--sbb-pearl-chain-bullet-color: GrayText !important}}.sbb-pearl-chain-vertical-item__bullet--stop.sbb-pearl-chain-vertical-item__bullet--irrelevant{--sbb-pearl-chain-bullet-border-width: var(--sbb-border-width-1x);min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain-vertical-item__bullet--start-end.sbb-pearl-chain-vertical-item__bullet--skipped{border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain-vertical-item__bullet--start-end.sbb-pearl-chain-vertical-item__bullet--skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--start-end.sbb-pearl-chain-vertical-item__bullet--skipped:before{background:Highlight}}.sbb-pearl-chain-vertical-item__bullet--stop.sbb-pearl-chain-vertical-item__bullet--skipped{--sbb-pearl-chain-bullet-crossed-width: .706875rem;--sbb-pearl-chain-bullet-crossed-height: .1875rem;min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain-vertical-item__bullet--stop.sbb-pearl-chain-vertical-item__bullet--skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--stop.sbb-pearl-chain-vertical-item__bullet--skipped:before{background:Highlight}}.sbb-pearl-chain-vertical-item__bullet--position{inset-block-start:var(--sbb-pearl-chain-vertical-item-position);position:absolute;left:50%;transform:translate(-50%);min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--position{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain-vertical-item__bullet--position{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain-vertical-item__bullet--position{--sbb-pearl-chain-bullet-color: Highlight}}@keyframes pearl-chain-bullet-position-pulse{0%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}25%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}50%{box-shadow:0 0 0 .1875rem var(--sbb-color-red-alpha-20)}to{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}}.sbb-pearl-chain-vertical-item__bullet--position{animation:pearl-chain-bullet-position-pulse var(--sbb-pearl-chain-bullet-animation-duration) var(--sbb-pearl-chain-bullet-animation-easing) infinite}:host([disable-animation]) .sbb-pearl-chain-vertical-item__bullet--position{animation:unset!important}`;
11
- let q = (() => {
12
- var c, n, b;
13
- let e = [D("sbb-pearl-chain-vertical-item")], a, t = [], r, g = j, f, w = [], k = [], z, x = [], y = [];
14
- return b = class extends g {
15
- constructor() {
16
- super(...arguments);
17
- v(this, c, h(this, w, null));
18
- v(this, n, (h(this, k), h(this, x, !1)));
19
- h(this, y);
20
- }
21
- /** The pearlChainVerticalItemAttributes Prop for styling the bullets and line.*/
22
- get pearlChainVerticalItemAttributes() {
23
- return d(this, c);
24
- }
25
- set pearlChainVerticalItemAttributes(l) {
26
- m(this, c, l);
27
- }
28
- /** If true, the position won't be animated. */
29
- get disableAnimation() {
30
- return d(this, n);
31
- }
32
- set disableAnimation(l) {
33
- m(this, n, l);
34
- }
35
- render() {
36
- const { bulletType: l, lineType: i, lineColor: o, hideLine: V, minHeight: T, bulletSize: $, position: s } = this.pearlChainVerticalItemAttributes || {}, H = s && s > 0 && s <= 100 ? "sbb-pearl-chain-vertical-item__bullet--past" : `sbb-pearl-chain-vertical-item__bullet--${l}`;
37
- return p`
38
- <div class="sbb-pearl-chain-vertical-item__column" style="height: ${T}px;">
39
- <slot name="left"></slot>
40
- </div>
41
- <div
42
- aria-hidden="true"
43
- class="sbb-pearl-chain-vertical-item__column sbb-pearl-chain-vertical-item__column--middle"
44
- >
45
- ${V ? _ : p`<div
46
- style="--sbb-pearl-chain-vertical-item-leg-status:${s}%;"
47
- class="sbb-pearl-chain-vertical-item__line sbb-pearl-chain-vertical-item__line--${i} sbb-pearl-chain-vertical-item__line--${o}"
48
- ></div>`}
49
- ${l ? p`<div
50
- class="sbb-pearl-chain-vertical-item__bullet sbb-pearl-chain-vertical-item__bullet--${$} ${H}"
51
- ></div>` : _}
52
- ${s && s > 0 ? p`<div
53
- style="--sbb-pearl-chain-vertical-item-position:${s}%;"
54
- class="sbb-pearl-chain-vertical-item__bullet--position"
55
- ></div>` : _}
56
- </div>
57
- <slot name="right"></slot>
58
- `;
59
- }
60
- }, c = new WeakMap(), n = new WeakMap(), r = b, (() => {
61
- const l = typeof Symbol == "function" && Symbol.metadata ? Object.create(g[Symbol.metadata] ?? null) : void 0;
62
- f = [I({ attribute: "pearl-chain-vertical-item-attributes", type: Object })], z = [S(), I({ attribute: "disable-animation", reflect: !0, type: Boolean })], u(b, null, f, { kind: "accessor", name: "pearlChainVerticalItemAttributes", static: !1, private: !1, access: { has: (i) => "pearlChainVerticalItemAttributes" in i, get: (i) => i.pearlChainVerticalItemAttributes, set: (i, o) => {
63
- i.pearlChainVerticalItemAttributes = o;
64
- } }, metadata: l }, w, k), u(b, null, z, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (i) => "disableAnimation" in i, get: (i) => i.disableAnimation, set: (i, o) => {
65
- i.disableAnimation = o;
66
- } }, metadata: l }, x, y), u(null, a = { value: r }, e, { kind: "class", name: r.name, metadata: l }, null, t), r = a.value, l && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: l });
67
- })(), b.styles = G, h(r, t), r;
68
- })();
1
+ import { SbbPearlChainVerticalItemElement as t } from "./pearl-chain-vertical-item/pearl-chain-vertical-item.js";
69
2
  export {
70
- q as SbbPearlChainVerticalItemElement
3
+ t as SbbPearlChainVerticalItemElement
71
4
  };
@@ -1,2 +1,5 @@
1
+ /**
2
+ * @entrypoint
3
+ */
1
4
  export * from './pearl-chain-vertical/pearl-chain-vertical.js';
2
5
  //# sourceMappingURL=pearl-chain-vertical.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pearl-chain-vertical.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/pearl-chain-vertical.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC"}
1
+ {"version":3,"file":"pearl-chain-vertical.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/pearl-chain-vertical.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gDAAgD,CAAC"}
@@ -1,23 +1,4 @@
1
- import { __esDecorate as c, __runInitializers as o } from "tslib";
2
- import { css as n, LitElement as b, html as m } from "lit";
3
- import { customElement as d } from "lit/decorators.js";
4
- const u = n`*,:before,:after{box-sizing:border-box}:host{--sbb-pearl-chain-vertical-width: 100%;display:block}.sbb-pearl-chain-vertical{display:table;width:var(--sbb-pearl-chain-vertical-width)}`;
5
- let f = (() => {
6
- var e;
7
- let i = [d("sbb-pearl-chain-vertical")], l, r = [], t, s = b;
8
- return e = class extends s {
9
- render() {
10
- return m`
11
- <div class="sbb-pearl-chain-vertical">
12
- <slot></slot>
13
- </div>
14
- `;
15
- }
16
- }, t = e, (() => {
17
- const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(s[Symbol.metadata] ?? null) : void 0;
18
- c(null, l = { value: t }, i, { kind: "class", name: t.name, metadata: a }, null, r), t = l.value, a && Object.defineProperty(t, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
19
- })(), e.styles = u, o(t, r), t;
20
- })();
1
+ import { SbbPearlChainVerticalElement as a } from "./pearl-chain-vertical/pearl-chain-vertical.js";
21
2
  export {
22
- f as SbbPearlChainVerticalElement
3
+ a as SbbPearlChainVerticalElement
23
4
  };
package/pearl-chain.d.ts CHANGED
@@ -1,2 +1,5 @@
1
+ /**
2
+ * @entrypoint
3
+ */
1
4
  export * from './pearl-chain/pearl-chain.js';
2
5
  //# sourceMappingURL=pearl-chain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pearl-chain.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/pearl-chain.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"pearl-chain.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/pearl-chain.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,8BAA8B,CAAC"}
package/pearl-chain.js CHANGED
@@ -1,177 +1,4 @@
1
- var oe = (l) => {
2
- throw TypeError(l);
3
- };
4
- var be = (l, n, p) => n.has(l) || oe("Cannot " + p);
5
- var I = (l, n, p) => (be(l, n, "read from private field"), p ? p.call(l) : n.get(l)), H = (l, n, p) => n.has(l) ? oe("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(l) : n.set(l, p), k = (l, n, p, d) => (be(l, n, "write to private field"), d ? d.call(l, p) : n.set(l, p), p);
6
- import { __runInitializers as f, __esDecorate as S } from "tslib";
7
- import { defaultDateAdapter as ce } from "@sbb-esta/lyne-elements/core/datetime.js";
8
- import { forceType as xe } from "@sbb-esta/lyne-elements/core/decorators.js";
9
- import { css as Se, LitElement as De, html as y, nothing as pe } from "lit";
10
- import { customElement as Te, property as O } from "lit/decorators.js";
11
- import { styleMap as he } from "lit/directives/style-map.js";
12
- import { removeTimezoneFromISOTimeString as h } from "./core/datetime.js";
13
- import { isRideLeg as Ae } from "./core/timetable.js";
14
- import { d as D, a as T } from "./differenceInMinutes-BI2zjbtS.js";
15
- import { t as A } from "./toDate-DQg4ZFnf.js";
16
- function Ce(l, n) {
17
- return +A(l) > +A(n);
18
- }
19
- function de(l, n) {
20
- return +A(l) < +A(n);
21
- }
22
- const $e = Se`*,:before,:after{box-sizing:border-box}:host{--sbb-pearl-chain-height: var(--sbb-border-width-2x);--sbb-pearl-chain-spacing-small: .125rem;--sbb-pearl-chain-color: var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-color-disruption: var(--sbb-pearl-chain-bullet-color-disruption);--sbb-pearl-chain-color-past: var(--sbb-pearl-chain-bullet-color-past);--sbb-pearl-chain-leg-width: 100%;display:block;--sbb-pearl-chain-bullet-size-start-end: .625rem;--sbb-pearl-chain-bullet-size-stop: .5rem;--sbb-pearl-chain-bullet-color: var(--sbb-color-charcoal);--sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-red);--sbb-pearl-chain-bullet-border-width: var(--sbb-border-width-2x);--sbb-pearl-chain-bullet-animation-duration: 1.92s;--sbb-pearl-chain-bullet-animation-easing: ease-out;--sbb-pearl-chain-bullet-crossed-width: .88375rem;--sbb-pearl-chain-bullet-crossed-height: .21875rem;--sbb-pearl-chain-bullet-crossed-border-width: .09375rem}.sbb-pearl-chain{position:relative;display:flex;justify-content:space-between;flex-wrap:nowrap;color:var(--sbb-pearl-chain-color);width:100%;padding-block:calc((var(--sbb-pearl-chain-bullet-size-start-end) - var(--sbb-pearl-chain-height)) / 2);padding-inline-end:var(--sbb-pearl-chain-bullet-size-start-end)}.sbb-pearl-chain__bullet{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain__bullet{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain__bullet{content:"";position:absolute;background-color:currentcolor;inset-block-start:0;z-index:3}.sbb-pearl-chain__bullet:first-of-type{inset-inline-start:0}.sbb-pearl-chain__bullet:last-of-type{inset-inline-end:0}.sbb-pearl-chain__leg{flex-shrink:0;flex-grow:0;position:relative;height:var(--sbb-pearl-chain-height);border-inline-end:var(--sbb-pearl-chain-spacing-small) solid Canvas;background-color:currentcolor;width:var(--sbb-pearl-chain-leg-width);display:flex;align-items:center}@media (forced-colors: active){.sbb-pearl-chain__leg{background-color:CanvasText}.sbb-pearl-chain--past .sbb-pearl-chain__leg{background-color:GrayText}}.sbb-pearl-chain__leg:last-of-type{border:none}.sbb-pearl-chain__stop{position:relative;z-index:2;background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain__stop{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain__bullet--future{background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain__bullet--future{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{color:var(--sbb-pearl-chain-color-past);--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors: active){.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{--sbb-pearl-chain-bullet-color: GrayText !important}}@media (forced-colors: active){.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{background-color:GrayText!important}}.sbb-pearl-chain__bullet--progress{background:var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors: active){.sbb-pearl-chain__bullet--progress{--sbb-pearl-chain-bullet-color: GrayText !important}}.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{color:var(--sbb-pearl-chain-color-disruption);--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{--sbb-pearl-chain-bullet-color: Highlight}}@media (forced-colors: active){.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{color:Highlight;background:Highlight}}.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: Highlight}}.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors: active){.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color: GrayText !important}}.sbb-pearl-chain__leg--disruption:after{background-color:unset;background-image:linear-gradient(to right,currentcolor 0%,currentcolor 50%,Canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors: active){.sbb-pearl-chain__leg--disruption:after{background:unset;border-block-start:.0625rem dashed Highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__leg--skipped{color:var(--sbb-pearl-chain-color-disruption)}.sbb-pearl-chain__leg--skipped:after{background-color:unset;background-image:linear-gradient(to right,currentcolor 0%,currentcolor 50%,Canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors: active){.sbb-pearl-chain__leg--skipped:after{background:unset;border-block-start:.0625rem dashed Highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__stop--departure-skipped{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain__stop--departure-skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width)}@media (forced-colors: active){.sbb-pearl-chain__stop--departure-skipped:before{background:Highlight}}.sbb-pearl-chain--arrival-skipped,.sbb-pearl-chain--departure-skipped{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:Canvas}.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width)}@media (forced-colors: active){.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{background:Highlight}}.sbb-pearl-chain__leg:after{content:"";position:absolute;inset-block:0;inset-inline-start:0;background-color:currentcolor;border-radius:var(--sbb-pearl-chain-height);z-index:1}@media (forced-colors: active){.sbb-pearl-chain__leg:after{background-color:CanvasText}.sbb-pearl-chain--past .sbb-pearl-chain__leg:after{background-color:GrayText}}.sbb-pearl-chain__leg:last-of-type:after{inset-inline-end:calc(-1 * var(--sbb-pearl-chain-height))}.sbb-pearl-chain__leg--progress:after{background-color:var(--sbb-pearl-chain-color-past);width:var(--sbb-pearl-chain-leg-status)}.sbb-pearl-chain__position{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors: active){.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color: CanvasText}}.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color: Highlight}}@keyframes pearl-chain-bullet-position-pulse{0%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}25%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}50%{box-shadow:0 0 0 .1875rem var(--sbb-color-red-alpha-20)}to{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}}.sbb-pearl-chain__position{animation:pearl-chain-bullet-position-pulse var(--sbb-pearl-chain-bullet-animation-duration) var(--sbb-pearl-chain-bullet-animation-easing) infinite}.sbb-pearl-chain__position{position:absolute;inset-block-start:-200%;z-index:4;inset-inline-start:var(--sbb-pearl-chain-status-position)}.sbb-pearl-chain__position--no-animation{animation:unset}.sbb-screen-reader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
23
- let Me = (() => {
24
- var v, g, u;
25
- let l = [Te("sbb-pearl-chain")], n, p = [], d, J = De, R = [], W, G = [], V = [], B, j = [], M = [], Y;
26
- return u = class extends J {
27
- constructor() {
28
- super(...arguments);
29
- H(this, v);
30
- H(this, g);
31
- k(this, v, (f(this, R), f(this, G, []))), k(this, g, (f(this, V), f(this, j, !1))), this._now = (f(this, M), null);
32
- }
33
- /**
34
- * Define the legs of the pearl-chain.
35
- * Format:
36
- * `{"legs": [{"duration": 25}, ...]}`
37
- * `duration` in minutes. Duration of the leg is relative
38
- * to the total travel time. Example: departure 16:30, change at 16:40,
39
- * arrival at 17:00. So the change should have a duration of 33.33%.
40
- */
41
- get legs() {
42
- return I(this, v);
43
- }
44
- set legs(a) {
45
- k(this, v, a);
46
- }
47
- /**
48
- * Per default, the current location has a pulsating animation. You can
49
- * disable the animation with this property.
50
- */
51
- get disableAnimation() {
52
- return I(this, g);
53
- }
54
- set disableAnimation(a) {
55
- k(this, g, a);
56
- }
57
- /** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */
58
- set now(a) {
59
- this._now = ce.getValidDateOrNull(ce.deserialize(a));
60
- }
61
- get now() {
62
- return this._now;
63
- }
64
- _getAllDuration(a) {
65
- return a == null ? void 0 : a.reduce((e, r) => {
66
- var c, _;
67
- const i = h((c = r.arrival) == null ? void 0 : c.time), b = h((_ = r.departure) == null ? void 0 : _.time);
68
- return i && b ? e + D(h(r.arrival.time), h(r.departure.time)) : e;
69
- }, 0);
70
- }
71
- _isAllCancelled(a) {
72
- return a == null ? void 0 : a.every((e) => {
73
- var r, i;
74
- return (i = (r = e == null ? void 0 : e.serviceJourney) == null ? void 0 : r.serviceAlteration) == null ? void 0 : i.cancelled;
75
- });
76
- }
77
- _getRelativeDuration(a, e) {
78
- var b, c;
79
- const r = h((b = e.arrival) == null ? void 0 : b.time), i = h((c = e.departure) == null ? void 0 : c.time);
80
- if (r && i) {
81
- const _ = D(h(e.arrival.time), h(e.departure.time)), w = this._getAllDuration(a);
82
- return w === 0 ? 100 : _ / w * 100;
83
- }
84
- return 0;
85
- }
86
- _getProgress(a, e, r) {
87
- if (!(e != null && e.time) || !(r != null && r.time))
88
- return 0;
89
- const i = T(e.time, e.delay ?? 0), b = T(r.time, r.delay ?? 0), c = D(b, i), _ = D(a, i);
90
- return c && _ / c * 100;
91
- }
92
- _getStatus(a, e, r) {
93
- const i = e && e.time && T(e.time, e.delay ?? 0), b = r && r.time && T(r.time, r.delay ?? 0);
94
- return i && de(i, a) && b && Ce(b, a) ? "progress" : b && de(b, a) ? "past" : "future";
95
- }
96
- _renderPosition(a, e, r) {
97
- const i = this._getProgress(a, e, r);
98
- if (i < 0 && i > 100)
99
- return;
100
- const b = () => ({
101
- "--sbb-pearl-chain-status-position": `${i}%`,
102
- ...i >= 50 ? { transform: "translateX(-100%)" } : {}
103
- }), c = this.disableAnimation ? "sbb-pearl-chain__position--no-animation" : "";
104
- return y`<span
105
- style=${he(b())}
106
- class="sbb-pearl-chain__position ${c}"
107
- ></span>`;
108
- }
109
- render() {
110
- var X, q, K, Q, U;
111
- const a = this.now ?? /* @__PURE__ */ new Date(), e = (X = this.legs) == null ? void 0 : X.filter((t) => Ae(t)), r = (e == null ? void 0 : e.length) && h((K = (q = e[0]) == null ? void 0 : q.departure) == null ? void 0 : K.time), i = r && {
112
- time: r,
113
- delay: e[0].departure.delay ?? 0
114
- }, b = (e == null ? void 0 : e.length) && h((Q = e[e.length - 1].arrival) == null ? void 0 : Q.time), c = b && {
115
- time: b,
116
- delay: ((U = e[e.length - 1]) == null ? void 0 : U.arrival.delay) ?? 0
117
- }, _ = (() => {
118
- var t, o, s, m;
119
- return e && ((o = (t = e[0]) == null ? void 0 : t.serviceJourney) != null && o.stopPoints) && ((m = (s = e[0]) == null ? void 0 : s.serviceJourney) == null ? void 0 : m.stopPoints[0].stopStatus) === "NOT_SERVICED" ? "sbb-pearl-chain--departure-skipped" : "";
120
- })(), w = (() => {
121
- var s;
122
- const t = e && e[e.length - 1], o = t && ((s = t.serviceJourney) == null ? void 0 : s.stopPoints);
123
- return o && o[o.length - 1].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--arrival-skipped" : "";
124
- })(), F = (() => {
125
- var t, o, s;
126
- return e && ((s = (o = (t = e[0]) == null ? void 0 : t.serviceJourney) == null ? void 0 : o.serviceAlteration) != null && s.cancelled) ? "sbb-pearl-chain--departure-disruption" : "";
127
- })(), L = (() => {
128
- var t, o, s;
129
- return e && ((s = (o = (t = e[e.length - 1]) == null ? void 0 : t.serviceJourney) == null ? void 0 : o.serviceAlteration) != null && s.cancelled) ? "sbb-pearl-chain--arrival-disruption" : "";
130
- })(), C = i && c && this._getStatus(a, i, c), ue = e && C && !F ? "sbb-pearl-chain__bullet--" + C : "", _e = e && C && !L ? "sbb-pearl-chain__bullet--" + this._getStatus(a, void 0, c) : "";
131
- return this._isAllCancelled(e) ? y`
132
- <div class="sbb-pearl-chain">
133
- <span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
134
- <div class="sbb-pearl-chain__leg sbb-pearl-chain__leg--disruption"></div>
135
- <span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
136
- </div>
137
- ` : y`
138
- <div class="sbb-pearl-chain">
139
- <span
140
- class="sbb-pearl-chain__bullet ${ue} ${_} ${F}"
141
- ></span>
142
- ${e == null ? void 0 : e.map((t, o) => {
143
- var ee, ae, re, te, le, ie, se, ne;
144
- const { stopPoints: s, serviceAlteration: m } = (t == null ? void 0 : t.serviceJourney) || {}, ve = this._getRelativeDuration(e, t), ge = h((ee = t.departure) == null ? void 0 : ee.time), me = h((ae = t.arrival) == null ? void 0 : ae.time), fe = s && ((re = s[s.length - 1]) == null ? void 0 : re.stopStatus) === "NOT_SERVICED", ke = s && ((te = s[s.length - 1]) == null ? void 0 : te.stopStatus) === "PLANNED", Z = s && ((le = s[0]) == null ? void 0 : le.stopStatus) === "NOT_SERVICED", $ = o > 0 && e[o - 1].serviceJourney.stopPoints, ye = $ && ((ie = $[$.length - 1]) == null ? void 0 : ie.stopStatus) === "NOT_SERVICED", z = fe || Z && ke ? "sbb-pearl-chain__leg--skipped" : "", we = Z || ye ? "sbb-pearl-chain__stop--departure-skipped" : "", x = m != null && m.cancelled ? "sbb-pearl-chain__leg--disruption" : "", N = { time: ge, delay: ((se = t.departure) == null ? void 0 : se.delay) ?? 0 }, E = { time: me, delay: ((ne = t.arrival) == null ? void 0 : ne.delay) ?? 0 }, P = this._getStatus(a, N, E), ze = !x && !z && "sbb-pearl-chain__leg--" + P;
145
- return y` <div
146
- class="sbb-pearl-chain__leg ${ze || ""} ${x} ${z}"
147
- style=${he({
148
- "--sbb-pearl-chain-leg-width": `${ve}%`,
149
- ...P === "progress" && !x && !z ? {
150
- "--sbb-pearl-chain-leg-status": `${this._getProgress(a, N, E)}%`
151
- } : {}
152
- })}
153
- >
154
- ${o > 0 && o < e.length ? y`<span class="sbb-pearl-chain__stop ${we}"></span>` : pe}
155
- ${P === "progress" && !x && !z ? this._renderPosition(a, N, E) : pe}
156
- </div>`;
157
- })}
158
- <span
159
- class="sbb-pearl-chain__bullet ${_e} ${w} ${L}"
160
- ></span>
161
- </div>
162
- `;
163
- }
164
- }, v = new WeakMap(), g = new WeakMap(), d = u, (() => {
165
- const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(J[Symbol.metadata] ?? null) : void 0;
166
- W = [O({ type: Array })], B = [xe(), O({ attribute: "disable-animation", type: Boolean })], Y = [O()], S(u, null, W, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, r) => {
167
- e.legs = r;
168
- } }, metadata: a }, G, V), S(u, null, B, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, r) => {
169
- e.disableAnimation = r;
170
- } }, metadata: a }, j, M), S(u, null, Y, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, r) => {
171
- e.now = r;
172
- } }, metadata: a }, null, R), S(null, n = { value: d }, l, { kind: "class", name: d.name, metadata: a }, null, p), d = n.value, a && Object.defineProperty(d, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
173
- })(), u.styles = $e, f(d, p), d;
174
- })();
1
+ import { SbbPearlChainElement as a } from "./pearl-chain/pearl-chain.js";
175
2
  export {
176
- Me as SbbPearlChainElement
3
+ a as SbbPearlChainElement
177
4
  };
@@ -0,0 +1,55 @@
1
+ var v = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var $ = (t, e, a) => e.has(t) || v("Cannot " + a);
5
+ var S = (t, e, a) => ($(t, e, "read from private field"), a ? a.call(t) : e.get(t)), w = (t, e, a) => e.has(t) ? v("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), g = (t, e, a, s) => ($(t, e, "write to private field"), s ? s.call(t, a) : e.set(t, a), a);
6
+ import { __runInitializers as m, __esDecorate as z } from "tslib";
7
+ import { SbbLanguageController as L } from "@sbb-esta/lyne-elements/core/controllers.js";
8
+ import { forceType as D } from "@sbb-esta/lyne-elements/core/decorators.js";
9
+ import { i18nDurationHour as h, i18nDurationMinute as b } from "@sbb-esta/lyne-elements/core/i18n.js";
10
+ import { css as E, LitElement as T, html as k } from "lit";
11
+ import { customElement as I, property as O } from "lit/decorators.js";
12
+ const j = E`*,:before,:after{box-sizing:border-box}:host{display:inline-block}.duration{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);margin:0;white-space:nowrap}.duration__text--visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
13
+ let B = (() => {
14
+ var o, n;
15
+ let t = [I("sbb-timetable-duration")], e, a = [], s, p = T, f, d = [], _ = [];
16
+ return n = class extends p {
17
+ constructor() {
18
+ super(...arguments);
19
+ w(this, o);
20
+ g(this, o, m(this, d, "")), this._language = (m(this, _), new L(this));
21
+ }
22
+ /**
23
+ * Stringified JSON which defines most of the
24
+ * content of the component. Please check the
25
+ * individual stories to get an idea of the
26
+ * structure.
27
+ */
28
+ get config() {
29
+ return S(this, o);
30
+ }
31
+ set config(i) {
32
+ g(this, o, i);
33
+ }
34
+ render() {
35
+ const i = JSON.parse(this.config), r = h.multiple.short[this._language.current], u = b.multiple.short[this._language.current];
36
+ let c = "", l = "", y = h.multiple.long[this._language.current], x = b.multiple.long[this._language.current];
37
+ return i.hours === 1 && (y = h.single.long[this._language.current]), i.minutes === 1 && (x = b.single.long[this._language.current]), i.hours !== 0 && (c += `${i.hours} ${r}`, l += `${i.hours} ${y}`), c += ` ${i.minutes} ${u}`, l += ` ${i.minutes} ${x}.`, k`
38
+ <p aria-label=${l} class="duration" role="text">
39
+ <span aria-hidden="true" class="duration__text--visual" role="presentation">
40
+ ${c}
41
+ </span>
42
+ <span class="duration__text--visually-hidden">${l}</span>
43
+ </p>
44
+ `;
45
+ }
46
+ }, o = new WeakMap(), s = n, (() => {
47
+ const i = typeof Symbol == "function" && Symbol.metadata ? Object.create(p[Symbol.metadata] ?? null) : void 0;
48
+ f = [D(), O()], z(n, null, f, { kind: "accessor", name: "config", static: !1, private: !1, access: { has: (r) => "config" in r, get: (r) => r.config, set: (r, u) => {
49
+ r.config = u;
50
+ } }, metadata: i }, d, _), z(null, e = { value: s }, t, { kind: "class", name: s.name, metadata: i }, null, a), s = e.value, i && Object.defineProperty(s, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: i });
51
+ })(), n.styles = j, m(s, a), s;
52
+ })();
53
+ export {
54
+ B as SbbTimetableDurationElement
55
+ };
@@ -1,2 +1,5 @@
1
+ /**
2
+ * @entrypoint
3
+ */
1
4
  export * from './timetable-duration/timetable-duration.js';
2
5
  //# sourceMappingURL=timetable-duration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"timetable-duration.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/timetable-duration.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
1
+ {"version":3,"file":"timetable-duration.d.ts","sourceRoot":"","sources":["../../src/elements-experimental/timetable-duration.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,4CAA4C,CAAC"}
@@ -1,55 +1,4 @@
1
- var v = (t) => {
2
- throw TypeError(t);
3
- };
4
- var $ = (t, e, a) => e.has(t) || v("Cannot " + a);
5
- var S = (t, e, a) => ($(t, e, "read from private field"), a ? a.call(t) : e.get(t)), w = (t, e, a) => e.has(t) ? v("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), g = (t, e, a, s) => ($(t, e, "write to private field"), s ? s.call(t, a) : e.set(t, a), a);
6
- import { __runInitializers as m, __esDecorate as z } from "tslib";
7
- import { SbbLanguageController as L } from "@sbb-esta/lyne-elements/core/controllers.js";
8
- import { forceType as D } from "@sbb-esta/lyne-elements/core/decorators.js";
9
- import { i18nDurationHour as h, i18nDurationMinute as b } from "@sbb-esta/lyne-elements/core/i18n.js";
10
- import { css as E, LitElement as T, html as k } from "lit";
11
- import { customElement as I, property as O } from "lit/decorators.js";
12
- const j = E`*,:before,:after{box-sizing:border-box}:host{display:inline-block}.duration{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);margin:0;white-space:nowrap}.duration__text--visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
13
- let B = (() => {
14
- var o, n;
15
- let t = [I("sbb-timetable-duration")], e, a = [], s, p = T, f, d = [], _ = [];
16
- return n = class extends p {
17
- constructor() {
18
- super(...arguments);
19
- w(this, o);
20
- g(this, o, m(this, d, "")), this._language = (m(this, _), new L(this));
21
- }
22
- /**
23
- * Stringified JSON which defines most of the
24
- * content of the component. Please check the
25
- * individual stories to get an idea of the
26
- * structure.
27
- */
28
- get config() {
29
- return S(this, o);
30
- }
31
- set config(i) {
32
- g(this, o, i);
33
- }
34
- render() {
35
- const i = JSON.parse(this.config), r = h.multiple.short[this._language.current], u = b.multiple.short[this._language.current];
36
- let c = "", l = "", y = h.multiple.long[this._language.current], x = b.multiple.long[this._language.current];
37
- return i.hours === 1 && (y = h.single.long[this._language.current]), i.minutes === 1 && (x = b.single.long[this._language.current]), i.hours !== 0 && (c += `${i.hours} ${r}`, l += `${i.hours} ${y}`), c += ` ${i.minutes} ${u}`, l += ` ${i.minutes} ${x}.`, k`
38
- <p aria-label=${l} class="duration" role="text">
39
- <span aria-hidden="true" class="duration__text--visual" role="presentation">
40
- ${c}
41
- </span>
42
- <span class="duration__text--visually-hidden">${l}</span>
43
- </p>
44
- `;
45
- }
46
- }, o = new WeakMap(), s = n, (() => {
47
- const i = typeof Symbol == "function" && Symbol.metadata ? Object.create(p[Symbol.metadata] ?? null) : void 0;
48
- f = [D(), O()], z(n, null, f, { kind: "accessor", name: "config", static: !1, private: !1, access: { has: (r) => "config" in r, get: (r) => r.config, set: (r, u) => {
49
- r.config = u;
50
- } }, metadata: i }, d, _), z(null, e = { value: s }, t, { kind: "class", name: s.name, metadata: i }, null, a), s = e.value, i && Object.defineProperty(s, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: i });
51
- })(), n.styles = j, m(s, a), s;
52
- })();
1
+ import { SbbTimetableDurationElement as b } from "./timetable-duration/timetable-duration.js";
53
2
  export {
54
- B as SbbTimetableDurationElement
3
+ b as SbbTimetableDurationElement
55
4
  };