@sbb-esta/lyne-elements-experimental-dev 0.0.0 → 4.5.1-dev.1771849274
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +86 -0
- package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +54 -0
- package/autocomplete-grid/autocomplete-grid-button.js +4 -0
- package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +25 -0
- package/autocomplete-grid/autocomplete-grid-cell.js +4 -0
- package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +29 -0
- package/autocomplete-grid/autocomplete-grid-optgroup.js +4 -0
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +41 -0
- package/autocomplete-grid/autocomplete-grid-option.js +5 -0
- package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +28 -0
- package/autocomplete-grid/autocomplete-grid-row.js +4 -0
- package/autocomplete-grid/autocomplete-grid.js +4 -0
- package/autocomplete-grid.js +15 -0
- package/core/datetime/date-helper.js +191 -0
- package/core/datetime.js +5 -0
- package/core/timetable/access-leg-helper.js +91 -0
- package/core/timetable/timetable-helper.js +12 -0
- package/core/timetable/timetable-properties.js +1 -0
- package/core/timetable.js +8 -0
- package/custom-elements.json +8211 -0
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +39 -0
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +141 -0
- package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts +31 -0
- package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +82 -0
- package/development/autocomplete-grid/autocomplete-grid-button.d.ts +5 -0
- package/development/autocomplete-grid/autocomplete-grid-button.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-button.js +5 -0
- package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts +19 -0
- package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +40 -0
- package/development/autocomplete-grid/autocomplete-grid-cell.d.ts +5 -0
- package/development/autocomplete-grid/autocomplete-grid-cell.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-cell.js +5 -0
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts +19 -0
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +40 -0
- package/development/autocomplete-grid/autocomplete-grid-optgroup.d.ts +5 -0
- package/development/autocomplete-grid/autocomplete-grid-optgroup.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-optgroup.js +5 -0
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts +26 -0
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +134 -0
- package/development/autocomplete-grid/autocomplete-grid-option.d.ts +5 -0
- package/development/autocomplete-grid/autocomplete-grid-option.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-option.js +6 -0
- package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts +20 -0
- package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +115 -0
- package/development/autocomplete-grid/autocomplete-grid-row.d.ts +5 -0
- package/development/autocomplete-grid/autocomplete-grid-row.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid-row.js +5 -0
- package/development/autocomplete-grid/autocomplete-grid.d.ts +5 -0
- package/development/autocomplete-grid/autocomplete-grid.d.ts.map +1 -0
- package/development/autocomplete-grid/autocomplete-grid.js +5 -0
- package/development/autocomplete-grid.d.ts +10 -0
- package/development/autocomplete-grid.d.ts.map +1 -0
- package/development/autocomplete-grid.js +16 -0
- package/development/core/datetime/date-helper.d.ts +27 -0
- package/development/core/datetime/date-helper.d.ts.map +1 -0
- package/development/core/datetime/date-helper.js +285 -0
- package/development/core/datetime.d.ts +5 -0
- package/development/core/datetime.d.ts.map +1 -0
- package/development/core/datetime.js +6 -0
- package/development/core/timetable/access-leg-helper.d.ts +26 -0
- package/development/core/timetable/access-leg-helper.d.ts.map +1 -0
- package/development/core/timetable/access-leg-helper.js +125 -0
- package/development/core/timetable/timetable-helper.d.ts +12 -0
- package/development/core/timetable/timetable-helper.d.ts.map +1 -0
- package/development/core/timetable/timetable-helper.js +20 -0
- package/development/core/timetable/timetable-properties.d.ts +308 -0
- package/development/core/timetable/timetable-properties.d.ts.map +1 -0
- package/development/core/timetable/timetable-properties.js +2 -0
- package/development/core/timetable.d.ts +7 -0
- package/development/core/timetable.d.ts.map +1 -0
- package/development/core/timetable.js +9 -0
- package/development/differenceInMinutes-B0dawX-5.js +26 -0
- package/development/format-BMkeaqaF.js +1433 -0
- package/development/isValid-BYRch7pV.js +53 -0
- package/development/journey-summary/journey-summary.component.d.ts +65 -0
- package/development/journey-summary/journey-summary.component.d.ts.map +1 -0
- package/development/journey-summary/journey-summary.component.js +294 -0
- package/development/journey-summary.d.ts +5 -0
- package/development/journey-summary.d.ts.map +1 -0
- package/development/journey-summary.js +5 -0
- package/development/pearl-chain/pearl-chain.component.d.ts +42 -0
- package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -0
- package/development/pearl-chain/pearl-chain.component.js +639 -0
- package/development/pearl-chain-time/pearl-chain-time.component.d.ts +47 -0
- package/development/pearl-chain-time/pearl-chain-time.component.d.ts.map +1 -0
- package/development/pearl-chain-time/pearl-chain-time.component.js +312 -0
- package/development/pearl-chain-time.d.ts +5 -0
- package/development/pearl-chain-time.d.ts.map +1 -0
- package/development/pearl-chain-time.js +5 -0
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts +16 -0
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts.map +1 -0
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +40 -0
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts +34 -0
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts.map +1 -0
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +398 -0
- package/development/pearl-chain-vertical-item.d.ts +5 -0
- package/development/pearl-chain-vertical-item.d.ts.map +1 -0
- package/development/pearl-chain-vertical-item.js +5 -0
- package/development/pearl-chain-vertical.d.ts +5 -0
- package/development/pearl-chain-vertical.d.ts.map +1 -0
- package/development/pearl-chain-vertical.js +5 -0
- package/development/pearl-chain.d.ts +5 -0
- package/development/pearl-chain.d.ts.map +1 -0
- package/development/pearl-chain.js +5 -0
- package/development/seat-reservation/common/mapper/icon-mapper.d.ts +106 -0
- package/development/seat-reservation/common/mapper/icon-mapper.d.ts.map +1 -0
- package/development/seat-reservation/common/mapper/icon-mapper.js +72 -0
- package/development/seat-reservation/common/mapper/mapper.d.ts +34 -0
- package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -0
- package/development/seat-reservation/common/mapper/mapper.js +129 -0
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +372 -0
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -0
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +31673 -0
- package/development/seat-reservation/common/mapper.d.ts +3 -0
- package/development/seat-reservation/common/mapper.d.ts.map +1 -0
- package/development/seat-reservation/common/mapper.js +10 -0
- package/development/seat-reservation/common/svgs.d.ts +24 -0
- package/development/seat-reservation/common/svgs.d.ts.map +1 -0
- package/development/seat-reservation/common/svgs.js +46 -0
- package/development/seat-reservation/common/translations/i18n.d.ts +28 -0
- package/development/seat-reservation/common/translations/i18n.d.ts.map +1 -0
- package/development/seat-reservation/common/translations/i18n.js +871 -0
- package/development/seat-reservation/common/translations.d.ts +2 -0
- package/development/seat-reservation/common/translations.d.ts.map +1 -0
- package/development/seat-reservation/common/translations.js +5 -0
- package/development/seat-reservation/common/types.d.ts +97 -0
- package/development/seat-reservation/common/types.d.ts.map +1 -0
- package/development/seat-reservation/common/types.js +2 -0
- package/development/seat-reservation/common.d.ts +8 -0
- package/development/seat-reservation/common.d.ts.map +1 -0
- package/development/seat-reservation/common.js +14 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +273 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +1171 -0
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +75 -0
- package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +832 -0
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts +18 -0
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +112 -0
- package/development/seat-reservation/seat-reservation-area.d.ts +5 -0
- package/development/seat-reservation/seat-reservation-area.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-area.js +5 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts +9 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +303 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +20 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +167 -0
- package/development/seat-reservation/seat-reservation-graphic.d.ts +5 -0
- package/development/seat-reservation/seat-reservation-graphic.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-graphic.js +5 -0
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +65 -0
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +798 -0
- package/development/seat-reservation/seat-reservation-navigation-coach.d.ts +5 -0
- package/development/seat-reservation/seat-reservation-navigation-coach.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation-coach.js +5 -0
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts +21 -0
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +120 -0
- package/development/seat-reservation/seat-reservation-navigation-services.d.ts +5 -0
- package/development/seat-reservation/seat-reservation-navigation-services.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-navigation-services.js +5 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +42 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +462 -0
- package/development/seat-reservation/seat-reservation-place-control.d.ts +5 -0
- package/development/seat-reservation/seat-reservation-place-control.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-place-control.js +5 -0
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts +14 -0
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +34 -0
- package/development/seat-reservation/seat-reservation-scoped.d.ts +5 -0
- package/development/seat-reservation/seat-reservation-scoped.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation-scoped.js +5 -0
- package/development/seat-reservation/seat-reservation.d.ts +6 -0
- package/development/seat-reservation/seat-reservation.d.ts.map +1 -0
- package/development/seat-reservation/seat-reservation.js +7 -0
- package/development/seat-reservation.d.ts +12 -0
- package/development/seat-reservation.d.ts.map +1 -0
- package/development/seat-reservation.js +30 -0
- package/development/timetable-duration/timetable-duration.component.d.ts +22 -0
- package/development/timetable-duration/timetable-duration.component.d.ts.map +1 -0
- package/development/timetable-duration/timetable-duration.component.js +114 -0
- package/development/timetable-duration.d.ts +5 -0
- package/development/timetable-duration.d.ts.map +1 -0
- package/development/timetable-duration.js +5 -0
- package/development/timetable-row/timetable-row.component.d.ts +87 -0
- package/development/timetable-row/timetable-row.component.d.ts.map +1 -0
- package/development/timetable-row/timetable-row.component.js +787 -0
- package/development/timetable-row.d.ts +5 -0
- package/development/timetable-row.d.ts.map +1 -0
- package/development/timetable-row.js +12 -0
- package/development/toDate-BWb6Z1JD.js +24 -0
- package/differenceInMinutes-COvvdYsJ.js +23 -0
- package/format-CmKROkbc.js +1186 -0
- package/index.d.ts +44 -0
- package/index.js +43 -0
- package/isValid-m3_OsPaB.js +45 -0
- package/journey-summary/journey-summary.component.js +193 -0
- package/journey-summary.js +4 -0
- package/package.json +161 -1
- package/pearl-chain/pearl-chain.component.js +164 -0
- package/pearl-chain-time/pearl-chain-time.component.js +156 -0
- package/pearl-chain-time.js +4 -0
- package/pearl-chain-vertical/pearl-chain-vertical.component.js +24 -0
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +76 -0
- package/pearl-chain-vertical-item.js +4 -0
- package/pearl-chain-vertical.js +4 -0
- package/pearl-chain.js +4 -0
- package/seat-reservation/common/mapper/icon-mapper.js +71 -0
- package/seat-reservation/common/mapper/mapper.js +89 -0
- package/seat-reservation/common/mapper/seat-reservation-sample-data.js +31668 -0
- package/seat-reservation/common/mapper.js +9 -0
- package/seat-reservation/common/svgs.js +243 -0
- package/seat-reservation/common/translations/i18n.js +861 -0
- package/seat-reservation/common/translations.js +4 -0
- package/seat-reservation/common/types.js +1 -0
- package/seat-reservation/common.js +13 -0
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +756 -0
- package/seat-reservation/seat-reservation/seat-reservation.component.js +410 -0
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +50 -0
- package/seat-reservation/seat-reservation-area.js +4 -0
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +292 -0
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +73 -0
- package/seat-reservation/seat-reservation-graphic.js +4 -0
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +277 -0
- package/seat-reservation/seat-reservation-navigation-coach.js +4 -0
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +73 -0
- package/seat-reservation/seat-reservation-navigation-services.js +4 -0
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +167 -0
- package/seat-reservation/seat-reservation-place-control.js +4 -0
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +20 -0
- package/seat-reservation/seat-reservation-scoped.js +4 -0
- package/seat-reservation/seat-reservation.js +6 -0
- package/seat-reservation.js +29 -0
- package/timetable-duration/timetable-duration.component.js +56 -0
- package/timetable-duration.js +4 -0
- package/timetable-row/timetable-row.component.js +426 -0
- package/timetable-row.js +11 -0
- package/toDate-Bw2KTWeq.js +15 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
var X = (t) => {
|
|
2
|
+
throw TypeError(t);
|
|
3
|
+
};
|
|
4
|
+
var q = (t, l, n) => l.has(t) || X("Cannot " + n);
|
|
5
|
+
var E = (t, l, n) => (q(t, l, "read from private field"), n ? n.call(t) : l.get(t)), P = (t, l, n) => l.has(t) ? X("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(t) : l.set(t, n), m = (t, l, n, p) => (q(t, l, "write to private field"), p ? p.call(t, n) : l.set(t, n), n);
|
|
6
|
+
import { __runInitializers as v, __esDecorate as w } from "tslib";
|
|
7
|
+
import { defaultDateAdapter as K } from "@sbb-esta/lyne-elements/core/datetime.js";
|
|
8
|
+
import { forceType as pe } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
+
import { boxSizingStyles as he } from "@sbb-esta/lyne-elements/core/styles.js";
|
|
10
|
+
import { css as de, LitElement as ue, html as f, nothing as Q } from "lit";
|
|
11
|
+
import { customElement as _e, property as I } from "lit/decorators.js";
|
|
12
|
+
import { styleMap as U } from "lit/directives/style-map.js";
|
|
13
|
+
import { removeTimezoneFromISOTimeString as o } from "../core/datetime.js";
|
|
14
|
+
import { isRideLeg as ge } from "../core/timetable.js";
|
|
15
|
+
import { d as z, a as x } from "../differenceInMinutes-COvvdYsJ.js";
|
|
16
|
+
import { t as S } from "../toDate-Bw2KTWeq.js";
|
|
17
|
+
function ve(t, l) {
|
|
18
|
+
return +S(t) > +S(l);
|
|
19
|
+
}
|
|
20
|
+
function Z(t, l) {
|
|
21
|
+
return +S(t) < +S(l);
|
|
22
|
+
}
|
|
23
|
+
const me = de`: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-background-color-3-inverted);--sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-past: light-dark(var(--sbb-color-metal), var(--sbb-color-granite));--sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-irrelevant: light-dark( var(--sbb-color-metal), var(--sbb-color-granite) );--sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-primary);--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 color-mix(in srgb,var(--sbb-color-primary) 20%,transparent)}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;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-path:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
24
|
+
let Pe = (() => {
|
|
25
|
+
var _, g, h;
|
|
26
|
+
let t = [_e("sbb-pearl-chain")], l, n = [], p, H = ue, O = [], J, R = [], L = [], W, G = [], V = [], B;
|
|
27
|
+
return h = class extends H {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
P(this, _);
|
|
31
|
+
P(this, g);
|
|
32
|
+
m(this, _, (v(this, O), v(this, R, []))), m(this, g, (v(this, L), v(this, G, !1))), this._now = (v(this, V), null);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Define the legs of the pearl-chain.
|
|
36
|
+
* Format:
|
|
37
|
+
* `{"legs": [{"duration": 25}, ...]}`
|
|
38
|
+
* `duration` in minutes. Duration of the leg is relative
|
|
39
|
+
* to the total travel time. Example: departure 16:30, change at 16:40,
|
|
40
|
+
* arrival at 17:00. So the change should have a duration of 33.33%.
|
|
41
|
+
*/
|
|
42
|
+
get legs() {
|
|
43
|
+
return E(this, _);
|
|
44
|
+
}
|
|
45
|
+
set legs(a) {
|
|
46
|
+
m(this, _, a);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Per default, the current location has a pulsating animation. You can
|
|
50
|
+
* disable the animation with this property.
|
|
51
|
+
*/
|
|
52
|
+
get disableAnimation() {
|
|
53
|
+
return E(this, g);
|
|
54
|
+
}
|
|
55
|
+
set disableAnimation(a) {
|
|
56
|
+
m(this, g, a);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A configured date which acts as the current date instead of the real current date.
|
|
60
|
+
* Only recommended for testing purposes.
|
|
61
|
+
*/
|
|
62
|
+
set now(a) {
|
|
63
|
+
this._now = K.getValidDateOrNull(K.deserialize(a));
|
|
64
|
+
}
|
|
65
|
+
get now() {
|
|
66
|
+
return this._now;
|
|
67
|
+
}
|
|
68
|
+
_getAllDuration(a) {
|
|
69
|
+
return a?.reduce((e, r) => {
|
|
70
|
+
const i = o(r.arrival?.time), s = o(r.departure?.time);
|
|
71
|
+
return i && s ? e + z(o(r.arrival.time), o(r.departure.time)) : e;
|
|
72
|
+
}, 0);
|
|
73
|
+
}
|
|
74
|
+
_isAllCancelled(a) {
|
|
75
|
+
return a?.every((e) => e?.serviceJourney?.serviceAlteration?.cancelled);
|
|
76
|
+
}
|
|
77
|
+
_getRelativeDuration(a, e) {
|
|
78
|
+
const r = o(e.arrival?.time), i = o(e.departure?.time);
|
|
79
|
+
if (r && i) {
|
|
80
|
+
const s = z(o(e.arrival.time), o(e.departure.time)), b = this._getAllDuration(a);
|
|
81
|
+
return b === 0 ? 100 : s / b * 100;
|
|
82
|
+
}
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
_getProgress(a, e, r) {
|
|
86
|
+
if (!e?.time || !r?.time)
|
|
87
|
+
return 0;
|
|
88
|
+
const i = x(e.time, e.delay ?? 0), s = x(r.time, r.delay ?? 0), b = z(s, i), D = z(a, i);
|
|
89
|
+
return b && D / b * 100;
|
|
90
|
+
}
|
|
91
|
+
_getStatus(a, e, r) {
|
|
92
|
+
const i = e && e.time && x(e.time, e.delay ?? 0), s = r && r.time && x(r.time, r.delay ?? 0);
|
|
93
|
+
return i && Z(i, a) && s && ve(s, a) ? "progress" : s && Z(s, a) ? "past" : "future";
|
|
94
|
+
}
|
|
95
|
+
_renderPosition(a, e, r) {
|
|
96
|
+
const i = this._getProgress(a, e, r);
|
|
97
|
+
if (i < 0 && i > 100)
|
|
98
|
+
return;
|
|
99
|
+
const s = () => ({
|
|
100
|
+
"--sbb-pearl-chain-status-position": `${i}%`,
|
|
101
|
+
...i >= 50 ? { transform: "translateX(-100%)" } : {}
|
|
102
|
+
}), b = this.disableAnimation ? "sbb-pearl-chain__position--no-animation" : "";
|
|
103
|
+
return f`<span
|
|
104
|
+
style=${U(s())}
|
|
105
|
+
class="sbb-pearl-chain__position ${b}"
|
|
106
|
+
></span>`;
|
|
107
|
+
}
|
|
108
|
+
render() {
|
|
109
|
+
const a = this.now ?? /* @__PURE__ */ new Date(), e = this.legs?.filter((c) => ge(c)), r = e?.length && o(e[0]?.departure?.time), i = r && {
|
|
110
|
+
time: r,
|
|
111
|
+
delay: e[0].departure.delay ?? 0
|
|
112
|
+
}, s = e?.length && o(e[e.length - 1].arrival?.time), b = s && {
|
|
113
|
+
time: s,
|
|
114
|
+
delay: e[e.length - 1]?.arrival.delay ?? 0
|
|
115
|
+
}, D = e && e[0]?.serviceJourney?.stopPoints && e[0]?.serviceJourney?.stopPoints[0].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--departure-skipped" : "", ee = (() => {
|
|
116
|
+
const c = e && e[e.length - 1], d = c && c.serviceJourney?.stopPoints;
|
|
117
|
+
return d && d[d.length - 1].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--arrival-skipped" : "";
|
|
118
|
+
})(), j = e && e[0]?.serviceJourney?.serviceAlteration?.cancelled ? "sbb-pearl-chain--departure-disruption" : "", M = e && e[e.length - 1]?.serviceJourney?.serviceAlteration?.cancelled ? "sbb-pearl-chain--arrival-disruption" : "", A = i && b && this._getStatus(a, i, b), ae = e && A && !j ? "sbb-pearl-chain__bullet--" + A : "", re = e && A && !M ? "sbb-pearl-chain__bullet--" + this._getStatus(a, void 0, b) : "";
|
|
119
|
+
return this._isAllCancelled(e) ? f`
|
|
120
|
+
<div class="sbb-pearl-chain">
|
|
121
|
+
<span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
|
|
122
|
+
<div class="sbb-pearl-chain__leg sbb-pearl-chain__leg--disruption"></div>
|
|
123
|
+
<span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
|
|
124
|
+
</div>
|
|
125
|
+
` : f`
|
|
126
|
+
<div class="sbb-pearl-chain">
|
|
127
|
+
<span
|
|
128
|
+
class="sbb-pearl-chain__bullet ${ae} ${D} ${j}"
|
|
129
|
+
></span>
|
|
130
|
+
${e?.map((c, d) => {
|
|
131
|
+
const { stopPoints: u, serviceAlteration: Y } = c?.serviceJourney || {}, te = this._getRelativeDuration(e, c), le = o(c.departure?.time), ie = o(c.arrival?.time), se = u && u[u.length - 1]?.stopStatus === "NOT_SERVICED", ne = u && u[u.length - 1]?.stopStatus === "PLANNED", F = u && u[0]?.stopStatus === "NOT_SERVICED", T = d > 0 && e[d - 1].serviceJourney.stopPoints, oe = T && T[T.length - 1]?.stopStatus === "NOT_SERVICED", k = se || F && ne ? "sbb-pearl-chain__leg--skipped" : "", be = F || oe ? "sbb-pearl-chain__stop--departure-skipped" : "", y = Y?.cancelled || Y?.partiallyCancelled ? "sbb-pearl-chain__leg--disruption" : "", C = { time: le, delay: c.departure?.delay ?? 0 }, $ = { time: ie, delay: c.arrival?.delay ?? 0 }, N = this._getStatus(a, C, $), ce = !y && !k && "sbb-pearl-chain__leg--" + N;
|
|
132
|
+
return f` <div
|
|
133
|
+
class="sbb-pearl-chain__leg ${ce || ""} ${y} ${k}"
|
|
134
|
+
style=${U({
|
|
135
|
+
"--sbb-pearl-chain-leg-width": `${te}%`,
|
|
136
|
+
...N === "progress" && !y && !k ? {
|
|
137
|
+
"--sbb-pearl-chain-leg-status": `${this._getProgress(a, C, $)}%`
|
|
138
|
+
} : {}
|
|
139
|
+
})}
|
|
140
|
+
>
|
|
141
|
+
${d > 0 && d < e.length ? f`<span class="sbb-pearl-chain__stop ${be}"></span>` : Q}
|
|
142
|
+
${N === "progress" && !y && !k ? this._renderPosition(a, C, $) : Q}
|
|
143
|
+
</div>`;
|
|
144
|
+
})}
|
|
145
|
+
<span
|
|
146
|
+
class="sbb-pearl-chain__bullet ${re} ${ee} ${M}"
|
|
147
|
+
></span>
|
|
148
|
+
</div>
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
}, _ = new WeakMap(), g = new WeakMap(), p = h, (() => {
|
|
152
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(H[Symbol.metadata] ?? null) : void 0;
|
|
153
|
+
J = [I({ type: Array })], W = [pe(), I({ attribute: "disable-animation", type: Boolean })], B = [I()], w(h, null, J, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, r) => {
|
|
154
|
+
e.legs = r;
|
|
155
|
+
} }, metadata: a }, R, L), w(h, null, W, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, r) => {
|
|
156
|
+
e.disableAnimation = r;
|
|
157
|
+
} }, metadata: a }, G, V), w(h, null, B, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, r) => {
|
|
158
|
+
e.now = r;
|
|
159
|
+
} }, metadata: a }, null, O), w(null, l = { value: p }, t, { kind: "class", name: p.name, metadata: a }, null, n), p = l.value, a && Object.defineProperty(p, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
160
|
+
})(), h.styles = [he, me], v(p, n), p;
|
|
161
|
+
})();
|
|
162
|
+
export {
|
|
163
|
+
Pe as SbbPearlChainElement
|
|
164
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
var Q = (a) => {
|
|
2
|
+
throw TypeError(a);
|
|
3
|
+
};
|
|
4
|
+
var U = (a, s, o) => s.has(a) || Q("Cannot " + o);
|
|
5
|
+
var h = (a, s, o) => (U(a, s, "read from private field"), o ? o.call(a) : s.get(a)), p = (a, s, o) => s.has(a) ? Q("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(a) : s.set(a, o), n = (a, s, o, m) => (U(a, s, "write to private field"), m ? m.call(a, o) : s.set(a, o), o);
|
|
6
|
+
import { __runInitializers as r, __esDecorate as c } from "tslib";
|
|
7
|
+
import { SbbLanguageController as ae } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
|
+
import { defaultDateAdapter as X } from "@sbb-esta/lyne-elements/core/datetime.js";
|
|
9
|
+
import { forceType as x } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
10
|
+
import { i18nDeparture as ie, i18nTransferProcedures as re, i18nArrival as se } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
11
|
+
import { boxSizingStyles as le } from "@sbb-esta/lyne-elements/core/styles.js";
|
|
12
|
+
import { css as ne, LitElement as oe, nothing as w, html as k } from "lit";
|
|
13
|
+
import { customElement as me, property as b } from "lit/decorators.js";
|
|
14
|
+
import { removeTimezoneFromISOTimeString as Y } from "../core/datetime.js";
|
|
15
|
+
import { getDepartureArrivalTimeAttribute as ce, isRideLeg as he } from "../core/timetable.js";
|
|
16
|
+
import "../pearl-chain.js";
|
|
17
|
+
import { f as Z } from "../format-CmKROkbc.js";
|
|
18
|
+
const pe = ne`:host{display:block;--sbb-pearl-chain-time-height: auto}@media(min-width:37.5rem){:host{--sbb-pearl-chain-time-height: 1.5625rem}}@media(min-width:64rem){:host{--sbb-pearl-chain-time-height: 1.75rem}}.sbb-pearl-chain__time{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;height:var(--sbb-pearl-chain-time-height)}.sbb-pearl-chain__time-walktime,.sbb-pearl-chain__time-transfer{--sbb-text-font-size: var(--sbb-text-font-size-xxs);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);display:inline-flex;align-items:center}.sbb-pearl-chain__time-walktime--walk-small-left{transform:translate(-.4375rem);margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem)}.sbb-pearl-chain__time-walktime--walk-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-left{transform:translate(-.375rem);margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime-prime-symbol{float:right}.sbb-pearl-chain__time-transfer{gap:var(--sbb-spacing-fixed-1x)}.sbb-pearl-chain__time-transfer--sa-ci-departure{margin-inline-end:var(--sbb-spacing-fixed-2x)}.sbb-pearl-chain__time-transfer--sa-ci-arrival{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-chain{flex:1 1 auto;align-self:center;margin-inline:var(--sbb-spacing-fixed-3x)}.sbb-pearl-chain__time-time{--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);font-weight:700;color:var(--sbb-color-2)}.sbb-screen-reader-only{border:0;clip-path:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
19
|
+
let Ae = (() => {
|
|
20
|
+
var d, _, g, u, f, v, y, l;
|
|
21
|
+
let a = [me("sbb-pearl-chain-time")], s, o = [], m, T = oe, z = [], W, A = [], $ = [], F, I = [], S = [], D, N = [], E = [], H, L = [], O = [], j, P = [], B = [], C, R = [], V = [], q, G = [], J = [], K;
|
|
22
|
+
return l = class extends T {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
p(this, d);
|
|
26
|
+
p(this, _);
|
|
27
|
+
p(this, g);
|
|
28
|
+
p(this, u);
|
|
29
|
+
p(this, f);
|
|
30
|
+
p(this, v);
|
|
31
|
+
p(this, y);
|
|
32
|
+
n(this, d, (r(this, z), r(this, A, []))), n(this, _, (r(this, $), r(this, I, ""))), n(this, g, (r(this, S), r(this, N, ""))), n(this, u, (r(this, E), r(this, L, NaN))), n(this, f, (r(this, O), r(this, P, NaN))), n(this, v, (r(this, B), r(this, R, !1))), n(this, y, (r(this, V), r(this, G, !1))), this._now = (r(this, J), null), this._language = new ae(this);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* define the legs of the pearl-chain.
|
|
36
|
+
* Format:
|
|
37
|
+
* `{"legs": [{"duration": 25}, ...]}`
|
|
38
|
+
* `duration` in minutes. Duration of the leg is relative
|
|
39
|
+
* to the total travel time. Example: departure 16:30, change at 16:40,
|
|
40
|
+
* arrival at 17:00. So the change should have a duration of 33.33%.
|
|
41
|
+
*/
|
|
42
|
+
get legs() {
|
|
43
|
+
return h(this, d);
|
|
44
|
+
}
|
|
45
|
+
set legs(t) {
|
|
46
|
+
n(this, d, t);
|
|
47
|
+
}
|
|
48
|
+
/** Prop to render the departure time - will be formatted as "H:mm" */
|
|
49
|
+
get departureTime() {
|
|
50
|
+
return h(this, _);
|
|
51
|
+
}
|
|
52
|
+
set departureTime(t) {
|
|
53
|
+
n(this, _, t);
|
|
54
|
+
}
|
|
55
|
+
/** Prop to render the arrival time - will be formatted as "H:mm" */
|
|
56
|
+
get arrivalTime() {
|
|
57
|
+
return h(this, g);
|
|
58
|
+
}
|
|
59
|
+
set arrivalTime(t) {
|
|
60
|
+
n(this, g, t);
|
|
61
|
+
}
|
|
62
|
+
/** Optional prop to render the walk time (in minutes) before departure */
|
|
63
|
+
get departureWalk() {
|
|
64
|
+
return h(this, u);
|
|
65
|
+
}
|
|
66
|
+
set departureWalk(t) {
|
|
67
|
+
n(this, u, t);
|
|
68
|
+
}
|
|
69
|
+
/** Optional prop to render the walk time (in minutes) after arrival */
|
|
70
|
+
get arrivalWalk() {
|
|
71
|
+
return h(this, f);
|
|
72
|
+
}
|
|
73
|
+
set arrivalWalk(t) {
|
|
74
|
+
n(this, f, t);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Per default, the current location has a pulsating animation. You can
|
|
78
|
+
* disable the animation with this property.
|
|
79
|
+
*/
|
|
80
|
+
get disableAnimation() {
|
|
81
|
+
return h(this, v);
|
|
82
|
+
}
|
|
83
|
+
set disableAnimation(t) {
|
|
84
|
+
n(this, v, t);
|
|
85
|
+
}
|
|
86
|
+
/** Optional prop to render wheelchair-small instead of walk-small */
|
|
87
|
+
get a11yFootpath() {
|
|
88
|
+
return h(this, y);
|
|
89
|
+
}
|
|
90
|
+
set a11yFootpath(t) {
|
|
91
|
+
n(this, y, t);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A configured date which acts as the current date instead of the real current date.
|
|
95
|
+
* Only recommended for testing purposes.
|
|
96
|
+
*/
|
|
97
|
+
set now(t) {
|
|
98
|
+
this._now = X.getValidDateOrNull(X.deserialize(t));
|
|
99
|
+
}
|
|
100
|
+
get now() {
|
|
101
|
+
return this._now ?? /* @__PURE__ */ new Date();
|
|
102
|
+
}
|
|
103
|
+
render() {
|
|
104
|
+
const t = this.departureTime ? Y(this.departureTime) : void 0, e = this.arrivalTime ? Y(this.arrivalTime) : void 0, { renderDepartureTimeAttribute: i, renderArrivalTimeAttribute: ee } = ce(this.legs, this.departureWalk || 0, this.arrivalWalk || 0, this._language.current, this.a11yFootpath), M = this.legs?.filter((te) => he(te));
|
|
105
|
+
return k`
|
|
106
|
+
<div class="sbb-pearl-chain__time">
|
|
107
|
+
${i()}
|
|
108
|
+
${t ? k`<time class="sbb-pearl-chain__time-time" datetime=${this.departureTime}>
|
|
109
|
+
<span class="sbb-screen-reader-only"
|
|
110
|
+
>${ie[this._language.current]}: </span
|
|
111
|
+
>
|
|
112
|
+
${Z(t, "HH:mm")}
|
|
113
|
+
</time>` : w}
|
|
114
|
+
${M?.length > 1 ? k`<span class="sbb-screen-reader-only" role="paragraph">
|
|
115
|
+
${M?.length - 1} ${re[this._language.current]}
|
|
116
|
+
</span>` : w}
|
|
117
|
+
<sbb-pearl-chain
|
|
118
|
+
class="sbb-pearl-chain__time-chain"
|
|
119
|
+
.legs=${this.legs}
|
|
120
|
+
.disableAnimation=${this.disableAnimation}
|
|
121
|
+
.now=${this.now}
|
|
122
|
+
></sbb-pearl-chain>
|
|
123
|
+
${e ? k`<time class="sbb-pearl-chain__time-time" datetime=${this.arrivalTime}>
|
|
124
|
+
<span class="sbb-screen-reader-only"
|
|
125
|
+
>${se[this._language.current]}: </span
|
|
126
|
+
>
|
|
127
|
+
${Z(e, "HH:mm")}
|
|
128
|
+
</time>` : w}
|
|
129
|
+
${ee()}
|
|
130
|
+
</div>
|
|
131
|
+
`;
|
|
132
|
+
}
|
|
133
|
+
}, d = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), u = new WeakMap(), f = new WeakMap(), v = new WeakMap(), y = new WeakMap(), m = l, (() => {
|
|
134
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(T[Symbol.metadata] ?? null) : void 0;
|
|
135
|
+
W = [b({ type: Array })], F = [x(), b({ attribute: "departure-time" })], D = [x(), b({ attribute: "arrival-time" })], H = [x(), b({ attribute: "departure-walk", type: Number })], j = [x(), b({ attribute: "arrival-walk", type: Number })], C = [x(), b({ attribute: "disable-animation", type: Boolean })], q = [x(), b({ attribute: "a11y-footpath", type: Boolean })], K = [b()], c(l, null, W, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, i) => {
|
|
136
|
+
e.legs = i;
|
|
137
|
+
} }, metadata: t }, A, $), c(l, null, F, { kind: "accessor", name: "departureTime", static: !1, private: !1, access: { has: (e) => "departureTime" in e, get: (e) => e.departureTime, set: (e, i) => {
|
|
138
|
+
e.departureTime = i;
|
|
139
|
+
} }, metadata: t }, I, S), c(l, null, D, { kind: "accessor", name: "arrivalTime", static: !1, private: !1, access: { has: (e) => "arrivalTime" in e, get: (e) => e.arrivalTime, set: (e, i) => {
|
|
140
|
+
e.arrivalTime = i;
|
|
141
|
+
} }, metadata: t }, N, E), c(l, null, H, { kind: "accessor", name: "departureWalk", static: !1, private: !1, access: { has: (e) => "departureWalk" in e, get: (e) => e.departureWalk, set: (e, i) => {
|
|
142
|
+
e.departureWalk = i;
|
|
143
|
+
} }, metadata: t }, L, O), c(l, null, j, { kind: "accessor", name: "arrivalWalk", static: !1, private: !1, access: { has: (e) => "arrivalWalk" in e, get: (e) => e.arrivalWalk, set: (e, i) => {
|
|
144
|
+
e.arrivalWalk = i;
|
|
145
|
+
} }, metadata: t }, P, B), c(l, null, C, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, i) => {
|
|
146
|
+
e.disableAnimation = i;
|
|
147
|
+
} }, metadata: t }, R, V), c(l, null, q, { kind: "accessor", name: "a11yFootpath", static: !1, private: !1, access: { has: (e) => "a11yFootpath" in e, get: (e) => e.a11yFootpath, set: (e, i) => {
|
|
148
|
+
e.a11yFootpath = i;
|
|
149
|
+
} }, metadata: t }, G, J), c(l, null, K, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, i) => {
|
|
150
|
+
e.now = i;
|
|
151
|
+
} }, metadata: t }, null, z), c(null, s = { value: m }, a, { kind: "class", name: m.name, metadata: t }, null, o), m = s.value, t && Object.defineProperty(m, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
152
|
+
})(), l.styles = [le, pe], r(m, o), m;
|
|
153
|
+
})();
|
|
154
|
+
export {
|
|
155
|
+
Ae as SbbPearlChainTimeElement
|
|
156
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __esDecorate as c, __runInitializers as n } from "tslib";
|
|
2
|
+
import { boxSizingStyles as o } from "@sbb-esta/lyne-elements/core/styles.js";
|
|
3
|
+
import { css as m, LitElement as b, html as d } from "lit";
|
|
4
|
+
import { customElement as u } from "lit/decorators.js";
|
|
5
|
+
const p = m`:host{--sbb-pearl-chain-vertical-width: 100%;display:block}.sbb-pearl-chain-vertical{display:table;width:var(--sbb-pearl-chain-vertical-width)}`;
|
|
6
|
+
let f = (() => {
|
|
7
|
+
var e;
|
|
8
|
+
let r = [u("sbb-pearl-chain-vertical")], l, s = [], t, i = b;
|
|
9
|
+
return e = class extends i {
|
|
10
|
+
render() {
|
|
11
|
+
return d`
|
|
12
|
+
<div class="sbb-pearl-chain-vertical">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
`;
|
|
16
|
+
}
|
|
17
|
+
}, t = e, (() => {
|
|
18
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(i[Symbol.metadata] ?? null) : void 0;
|
|
19
|
+
c(null, l = { value: t }, r, { kind: "class", name: t.name, metadata: a }, null, s), t = l.value, a && Object.defineProperty(t, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
20
|
+
})(), e.styles = [o, p], n(t, s), t;
|
|
21
|
+
})();
|
|
22
|
+
export {
|
|
23
|
+
f as SbbPearlChainVerticalElement
|
|
24
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var A = (e) => {
|
|
2
|
+
throw TypeError(e);
|
|
3
|
+
};
|
|
4
|
+
var I = (e, a, t) => a.has(e) || A("Cannot " + t);
|
|
5
|
+
var d = (e, a, t) => (I(e, a, "read from private field"), t ? t.call(e) : a.get(e)), m = (e, a, t) => a.has(e) ? A("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(e) : a.set(e, t), v = (e, a, t, l) => (I(e, a, "write to private field"), l ? l.call(e, t) : a.set(e, t), t);
|
|
6
|
+
import { __esDecorate as u, __runInitializers as h } from "tslib";
|
|
7
|
+
import { forceType as E } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
8
|
+
import { boxSizingStyles as j } from "@sbb-esta/lyne-elements/core/styles.js";
|
|
9
|
+
import { css as D, LitElement as G, nothing as _, html as p } from "lit";
|
|
10
|
+
import { customElement as O, property as $ } from "lit/decorators.js";
|
|
11
|
+
import { styleMap as g } from "lit/directives/style-map.js";
|
|
12
|
+
const L = D`:host{--sbb-pearl-chain-bullet-size-start-end: .625rem;--sbb-pearl-chain-bullet-size-stop: .5rem;--sbb-pearl-chain-bullet-color: var(--sbb-background-color-3-inverted);--sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-past: light-dark(var(--sbb-color-metal), var(--sbb-color-granite));--sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-irrelevant: light-dark( var(--sbb-color-metal), var(--sbb-color-granite) );--sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-primary);--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-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 color-mix(in srgb,var(--sbb-color-primary) 20%,transparent)}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}`;
|
|
13
|
+
let K = (() => {
|
|
14
|
+
var c, n, b;
|
|
15
|
+
let e = [O("sbb-pearl-chain-vertical-item")], a, t = [], l, f = G, w, k = [], z = [], y, x = [], C = [];
|
|
16
|
+
return b = class extends f {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
m(this, c, h(this, k, null));
|
|
20
|
+
m(this, n, (h(this, z), h(this, x, !1)));
|
|
21
|
+
h(this, C);
|
|
22
|
+
}
|
|
23
|
+
/** The pearlChainVerticalItemAttributes Prop for styling the bullets and line.*/
|
|
24
|
+
get pearlChainVerticalItemAttributes() {
|
|
25
|
+
return d(this, c);
|
|
26
|
+
}
|
|
27
|
+
set pearlChainVerticalItemAttributes(r) {
|
|
28
|
+
v(this, c, r);
|
|
29
|
+
}
|
|
30
|
+
/** If true, the position won't be animated. */
|
|
31
|
+
get disableAnimation() {
|
|
32
|
+
return d(this, n);
|
|
33
|
+
}
|
|
34
|
+
set disableAnimation(r) {
|
|
35
|
+
v(this, n, r);
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
const { bulletType: r, lineType: i, lineColor: o, hideLine: V, minHeight: T, bulletSize: S, position: s } = this.pearlChainVerticalItemAttributes || {}, H = s && s > 0 && s <= 100 ? "sbb-pearl-chain-vertical-item__bullet--past" : `sbb-pearl-chain-vertical-item__bullet--${r}`;
|
|
39
|
+
return p`
|
|
40
|
+
<div
|
|
41
|
+
class="sbb-pearl-chain-vertical-item__column"
|
|
42
|
+
style=${g({ height: `${T}px` })}
|
|
43
|
+
>
|
|
44
|
+
<slot name="left"></slot>
|
|
45
|
+
</div>
|
|
46
|
+
<div
|
|
47
|
+
aria-hidden="true"
|
|
48
|
+
class="sbb-pearl-chain-vertical-item__column sbb-pearl-chain-vertical-item__column--middle"
|
|
49
|
+
>
|
|
50
|
+
${V ? _ : p`<div
|
|
51
|
+
style=${g({ "--sbb-pearl-chain-vertical-item-leg-status": `${s}%` })}
|
|
52
|
+
class="sbb-pearl-chain-vertical-item__line sbb-pearl-chain-vertical-item__line--${i} sbb-pearl-chain-vertical-item__line--${o}"
|
|
53
|
+
></div>`}
|
|
54
|
+
${r ? p`<div
|
|
55
|
+
class="sbb-pearl-chain-vertical-item__bullet sbb-pearl-chain-vertical-item__bullet--${S} ${H}"
|
|
56
|
+
></div>` : _}
|
|
57
|
+
${s && s > 0 ? p`<div
|
|
58
|
+
style=${g({ "--sbb-pearl-chain-vertical-item-position": `${s}%` })}
|
|
59
|
+
class="sbb-pearl-chain-vertical-item__bullet--position"
|
|
60
|
+
></div>` : _}
|
|
61
|
+
</div>
|
|
62
|
+
<slot name="right"></slot>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
}, c = new WeakMap(), n = new WeakMap(), l = b, (() => {
|
|
66
|
+
const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(f[Symbol.metadata] ?? null) : void 0;
|
|
67
|
+
w = [$({ attribute: "pearl-chain-vertical-item-attributes", type: Object })], y = [E(), $({ attribute: "disable-animation", reflect: !0, type: Boolean })], u(b, null, w, { kind: "accessor", name: "pearlChainVerticalItemAttributes", static: !1, private: !1, access: { has: (i) => "pearlChainVerticalItemAttributes" in i, get: (i) => i.pearlChainVerticalItemAttributes, set: (i, o) => {
|
|
68
|
+
i.pearlChainVerticalItemAttributes = o;
|
|
69
|
+
} }, metadata: r }, k, z), u(b, null, y, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (i) => "disableAnimation" in i, get: (i) => i.disableAnimation, set: (i, o) => {
|
|
70
|
+
i.disableAnimation = o;
|
|
71
|
+
} }, metadata: r }, x, C), u(null, a = { value: l }, e, { kind: "class", name: l.name, metadata: r }, null, t), l = a.value, r && Object.defineProperty(l, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r });
|
|
72
|
+
})(), b.styles = [j, L], h(l, t), l;
|
|
73
|
+
})();
|
|
74
|
+
export {
|
|
75
|
+
K as SbbPearlChainVerticalItemElement
|
|
76
|
+
};
|
package/pearl-chain.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { svgs as a } from "../svgs.js";
|
|
2
|
+
const E = {
|
|
3
|
+
BICYCLE: { svgName: "sa-vo" },
|
|
4
|
+
BICYCLE_HIGH: { svgName: "sa-vo" },
|
|
5
|
+
BICYCLE_HIGH_ICON: { svgName: "sa-vo" },
|
|
6
|
+
BICYCLE_ICON: { svgName: "sa-vo" },
|
|
7
|
+
BICYCLE_LOW: { svgName: "sa-vo" },
|
|
8
|
+
BICYCLE_LOW_ICON: { svgName: "sa-vo" },
|
|
9
|
+
BICYCLE_MIDDLE: { svgName: "sa-vo" },
|
|
10
|
+
BICYCLE_MIDDLE_ICON: { svgName: "sa-vo" },
|
|
11
|
+
BISTRO: { svgName: "sa-mi" },
|
|
12
|
+
BISTRO_ICON: { svgName: "sa-mi" },
|
|
13
|
+
BUSINESS: { svgName: "sa-bz" },
|
|
14
|
+
BUSINESS_COMFORT: { svgName: "sa-bz" },
|
|
15
|
+
BUSINESS_ICON: { svgName: "sa-bz" },
|
|
16
|
+
COACH_BORDER_MIDDLE: { svg: a.chassisRowMiddle },
|
|
17
|
+
COACH_WALL_NO_PASSAGE: { svg: a.chassisRowOuter },
|
|
18
|
+
COACH_PASSAGE: { svg: a.chassisPassageWaggonTopLeft },
|
|
19
|
+
COMPARTMENT_PASSAGE: { svg: a.chassisPassageCompartmentMiddle },
|
|
20
|
+
COMPARTMENT_PASSAGE_HIGH: { svg: a.chassisPassageCompartmentLeftTop },
|
|
21
|
+
COMPARTMENT_PASSAGE_LOW: { svg: a.chassisPassageCompartmentRightBottom },
|
|
22
|
+
COMPARTMENT_WALL: { svg: a.chassisSeparator },
|
|
23
|
+
DRIVER_AREA: { svg: a.chassisDriverTrain },
|
|
24
|
+
DRIVER_AREA_BUS: { svg: a.chassisDriverBus },
|
|
25
|
+
DRIVER_AREA_TRAIN: { svg: a.chassisDriverTrainFull },
|
|
26
|
+
EASY_ACCESS: { svgName: "sa-em" },
|
|
27
|
+
EASY_ACCESS_AREA: { svgName: "sa-em" },
|
|
28
|
+
EASY_ACCESS_ICON: { svgName: "sa-em" },
|
|
29
|
+
ENTRY_EXIT: { svg: a.layoutEntrance },
|
|
30
|
+
FAMILY: { svgName: "sa-fa" },
|
|
31
|
+
LUGGAGE_AREA: { svgName: "sa-ga" },
|
|
32
|
+
LUGGAGE_ICON: { svgName: "sa-ga" },
|
|
33
|
+
MULTI_FUNCTION_AREA: { svgName: "sa-mf" },
|
|
34
|
+
MULTI_FUNCTION_ICON: { svgName: "sa-mf" },
|
|
35
|
+
PLACE_BICYCLE_ALLOCATED: { svg: a.interiorPlaceBikeUnavailable },
|
|
36
|
+
PLACE_BICYCLE_FREE: { svg: a.interiorPlaceBikeDefault },
|
|
37
|
+
PLACE_BICYCLE_RESTRICTED: { svg: a.interiorPlaceBikeNotBookable },
|
|
38
|
+
PLACE_BICYCLE_SELECTED: { svg: a.interiorPlaceBikeSelected },
|
|
39
|
+
PLACE_SEAT_ALLOCATED: { svg: a.interiorPlaceSeatUnavailable },
|
|
40
|
+
PLACE_SEAT_FREE: { svg: a.interiorPlaceSeatDefault },
|
|
41
|
+
PLACE_SEAT_RESTRICTED: { svg: a.interiorPlaceSeatNotBookable },
|
|
42
|
+
PLACE_SEAT_SELECTED: { svg: a.interiorPlaceSeatSelected },
|
|
43
|
+
PLAYGROUND_AREA: { svgName: "sa-fa" },
|
|
44
|
+
PLAYGROUND_ICON: { svgName: "sa-fa" },
|
|
45
|
+
PRAM: { svgName: "sa-abteilkinderwagen" },
|
|
46
|
+
PRAM_AREA: { svgName: "sa-abteilkinderwagen" },
|
|
47
|
+
PRAM_ICON: { svgName: "sa-abteilkinderwagen" },
|
|
48
|
+
RESTAURANT: { svgName: "sa-wr" },
|
|
49
|
+
RESTAURANT_AREA: { svgName: "sa-wr" },
|
|
50
|
+
RESTAURANT_ICON: { svgName: "sa-wr" },
|
|
51
|
+
SILENCE: { svgName: "sa-rz" },
|
|
52
|
+
SILENCE_AREA_ICON: { svgName: "sa-rz" },
|
|
53
|
+
SILENCE_ICON: { svgName: "sa-rz" },
|
|
54
|
+
SKI_AREA: { svgName: "sa-sa" },
|
|
55
|
+
SKI_ICON: { svgName: "sa-sa" },
|
|
56
|
+
STAFF_AREA: { svgName: "avatar-train-staff-medium" },
|
|
57
|
+
STAIR_AREA: { svgName: "sa-ac" },
|
|
58
|
+
TOILET_AREA: { svgName: "sa-wc" },
|
|
59
|
+
TOILET_ICON: { svgName: "sa-wc" },
|
|
60
|
+
TOILET_WHEELCHAIR_AREA: { svgName: "sa-rw" },
|
|
61
|
+
TOILET_WHEELCHAIR_ICON: { svgName: "sa-rw" },
|
|
62
|
+
WARDROBE_AREA: { svgName: "sa-ka" },
|
|
63
|
+
WHEELCHAIR: { svgName: "sa-rs" },
|
|
64
|
+
WHEELCHAIR_AND_SEAT: { svgName: "sa-rs" },
|
|
65
|
+
WHEELCHAIR_ICON: { svgName: "sa-rs" },
|
|
66
|
+
WHEELCHAIR_NO_SEAT: { svgName: "sa-rn" },
|
|
67
|
+
WIFI: { svgName: "sa-wv" }
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
E as mapIconToSvg
|
|
71
|
+
};
|