@sbb-esta/lyne-elements-experimental-dev 4.7.0-dev.1773333596 → 4.7.0-dev.1773388997
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +65 -76
- package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +72 -52
- package/autocomplete-grid/autocomplete-grid-button.js +3 -6
- package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +2 -17
- package/autocomplete-grid/autocomplete-grid-cell.js +4 -7
- package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +20 -21
- package/autocomplete-grid/autocomplete-grid-optgroup.js +3 -6
- package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +2 -33
- package/autocomplete-grid/autocomplete-grid-option.js +4 -9
- package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -22
- package/autocomplete-grid/autocomplete-grid-row.js +4 -7
- package/autocomplete-grid/autocomplete-grid.js +3 -6
- package/autocomplete-grid-cell.component-Dak9wlBr.js +24 -0
- package/autocomplete-grid-option.component-DNRFHOwc.js +37 -0
- package/autocomplete-grid-row.component-DBHZQ0GQ.js +27 -0
- package/autocomplete-grid.js +9 -21
- package/autocomplete-grid.pure.js +7 -15
- package/core/datetime/date-helper.js +2 -191
- package/core/datetime.js +2 -5
- package/core/timetable/access-leg-helper.js +76 -71
- package/core/timetable/timetable-helper.js +9 -11
- package/core/timetable/timetable-properties.js +0 -1
- package/core/timetable.js +3 -7
- package/date-helper-CGproP5d.js +185 -0
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +114 -122
- package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +92 -70
- package/development/autocomplete-grid/autocomplete-grid-button.js +6 -4
- package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +2 -29
- package/development/autocomplete-grid/autocomplete-grid-cell.js +7 -5
- package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +27 -22
- package/development/autocomplete-grid/autocomplete-grid-optgroup.js +6 -4
- package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +2 -109
- package/development/autocomplete-grid/autocomplete-grid-option.js +7 -7
- package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +2 -91
- package/development/autocomplete-grid/autocomplete-grid-row.js +7 -5
- package/development/autocomplete-grid/autocomplete-grid.js +6 -4
- package/development/autocomplete-grid-cell.component-BBvM4o2H.js +42 -0
- package/development/autocomplete-grid-option.component-QzfM5eIE.js +123 -0
- package/development/autocomplete-grid-row.component-H8sCTCkT.js +104 -0
- package/development/autocomplete-grid.js +10 -14
- package/development/autocomplete-grid.pure.js +4 -13
- package/development/core/datetime/date-helper.js +2 -285
- package/development/core/datetime.js +2 -6
- package/development/core/timetable/access-leg-helper.js +104 -82
- package/development/core/timetable/timetable-helper.js +16 -17
- package/development/core/timetable/timetable-properties.js +0 -2
- package/development/core/timetable.js +3 -8
- package/development/date-helper-8_Y-PuHh.js +520 -0
- package/development/differenceInMinutes-DN_1Rk3O.js +110 -0
- package/development/format-Bbrn2bgo.js +1848 -0
- package/development/isValid-C-HzKv4v.js +178 -0
- package/development/journey-summary/journey-summary.component.js +2 -288
- package/development/journey-summary.component-uGhZvA4p.js +385 -0
- package/development/journey-summary.js +8 -5
- package/development/journey-summary.pure.js +2 -5
- package/development/pearl-chain/pearl-chain.component.js +2 -634
- package/development/pearl-chain-time/pearl-chain-time.component.js +2 -306
- package/development/pearl-chain-time.component-B8mayTWD.js +415 -0
- package/development/pearl-chain-time.js +8 -5
- package/development/pearl-chain-time.pure.js +2 -5
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +2 -28
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +2 -393
- package/development/pearl-chain-vertical-item.component-BDzbcIaf.js +435 -0
- package/development/pearl-chain-vertical-item.js +8 -5
- package/development/pearl-chain-vertical-item.pure.js +2 -5
- package/development/pearl-chain-vertical.component-CswE7b3M.js +39 -0
- package/development/pearl-chain-vertical.js +8 -5
- package/development/pearl-chain-vertical.pure.js +2 -5
- package/development/pearl-chain.component-wpsTvoSe.js +704 -0
- package/development/pearl-chain.js +8 -5
- package/development/pearl-chain.pure.js +2 -5
- package/development/seat-reservation/common/mapper/icon-mapper.js +168 -71
- package/development/seat-reservation/common/mapper/mapper.js +153 -122
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +570 -559
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +992 -972
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20334 -20367
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1731 -1738
- package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9741 -9782
- package/development/seat-reservation/common/mapper.js +1 -8
- package/development/seat-reservation/common/svgs.js +2 -46
- package/development/seat-reservation/common/translations/i18n.js +1118 -900
- package/development/seat-reservation/common/translations.js +1 -4
- package/development/seat-reservation/common/types.js +0 -2
- package/development/seat-reservation/common.js +7 -11
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +1305 -1230
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +2 -859
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +2 -106
- package/development/seat-reservation/seat-reservation-area.js +7 -5
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +35 -34
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +2 -162
- package/development/seat-reservation/seat-reservation-graphic.js +7 -5
- package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +2 -713
- package/development/seat-reservation/seat-reservation-navigation-coach.js +7 -5
- package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -131
- package/development/seat-reservation/seat-reservation-navigation-services.js +7 -5
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -601
- package/development/seat-reservation/seat-reservation-place-control.js +7 -5
- package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -22
- package/development/seat-reservation/seat-reservation-scoped.js +7 -5
- package/development/seat-reservation/seat-reservation.js +7 -6
- package/development/seat-reservation-area.component-BK92ZtFo.js +138 -0
- package/development/seat-reservation-graphic.component-cUnsHh5x.js +193 -0
- package/development/seat-reservation-navigation-coach.component-D6Bglus8.js +828 -0
- package/development/seat-reservation-navigation-services.component-DYJ6Ddkg.js +179 -0
- package/development/seat-reservation-place-control.component-Bg9evKBW.js +726 -0
- package/development/seat-reservation-scoped.component-DRQ_I702.js +31 -0
- package/development/seat-reservation.component-Cq_aJKR0.js +818 -0
- package/development/seat-reservation.js +15 -28
- package/development/seat-reservation.pure.js +10 -28
- package/development/svgs-C3JMWR26.js +28 -0
- package/development/timetable-duration/timetable-duration.component.js +2 -108
- package/development/timetable-duration.component-DI0lET17.js +125 -0
- package/development/timetable-duration.js +8 -5
- package/development/timetable-duration.pure.js +2 -5
- package/development/timetable-row/timetable-row.component.js +2 -781
- package/development/timetable-row.component-CAED6Zwc.js +932 -0
- package/development/timetable-row.js +8 -13
- package/development/timetable-row.pure.js +2 -12
- package/development/toDate-Biiv3kyf.js +150 -0
- package/differenceInMinutes-Dr9gRqtu.js +27 -0
- package/format-CM5exOsN.js +1103 -0
- package/isValid-B9oVW3lA.js +36 -0
- package/journey-summary/journey-summary.component.js +2 -194
- package/journey-summary.component-Cq_4kaOp.js +264 -0
- package/journey-summary.js +5 -4
- package/journey-summary.pure.js +2 -4
- package/package.json +2 -2
- package/pearl-chain/pearl-chain.component.js +2 -165
- package/pearl-chain-time/pearl-chain-time.component.js +2 -157
- package/pearl-chain-time.component-DGDW5S1c.js +239 -0
- package/pearl-chain-time.js +5 -4
- package/pearl-chain-time.pure.js +2 -4
- package/pearl-chain-vertical/pearl-chain-vertical.component.js +2 -17
- package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +2 -77
- package/pearl-chain-vertical-item.component-G22bWhLU.js +108 -0
- package/pearl-chain-vertical-item.js +5 -4
- package/pearl-chain-vertical-item.pure.js +2 -4
- package/pearl-chain-vertical.component-CXIDT5RD.js +21 -0
- package/pearl-chain-vertical.js +5 -4
- package/pearl-chain-vertical.pure.js +2 -4
- package/pearl-chain.component-DmjkVIva.js +194 -0
- package/pearl-chain.js +5 -4
- package/pearl-chain.pure.js +2 -4
- package/seat-reservation/common/mapper/icon-mapper.js +71 -71
- package/seat-reservation/common/mapper/mapper.js +95 -89
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.js +568 -558
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.js +989 -970
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-giruno.js +20332 -20366
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-others.js +1729 -1737
- package/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.js +9739 -9781
- package/seat-reservation/common/mapper.js +3 -9
- package/seat-reservation/common/svgs.js +2 -243
- package/seat-reservation/common/translations/i18n.js +1084 -891
- package/seat-reservation/common/translations.js +2 -4
- package/seat-reservation/common/types.js +0 -1
- package/seat-reservation/common.js +9 -15
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +832 -810
- package/seat-reservation/seat-reservation/seat-reservation.component.js +2 -420
- package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +2 -51
- package/seat-reservation/seat-reservation-area.js +4 -7
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +68 -71
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +2 -75
- package/seat-reservation/seat-reservation-graphic.js +4 -7
- package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +2 -234
- package/seat-reservation/seat-reservation-navigation-coach.js +4 -7
- package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -85
- package/seat-reservation/seat-reservation-navigation-services.js +4 -7
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +2 -203
- package/seat-reservation/seat-reservation-place-control.js +4 -7
- package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +2 -13
- package/seat-reservation/seat-reservation-scoped.js +4 -7
- package/seat-reservation/seat-reservation.js +5 -9
- package/seat-reservation-area.component-n-9rGn_y.js +75 -0
- package/seat-reservation-graphic.component-YTXRmKt0.js +102 -0
- package/seat-reservation-navigation-coach.component-YJ0vaYmO.js +333 -0
- package/seat-reservation-navigation-services.component-C3xnLJg2.js +127 -0
- package/seat-reservation-place-control.component-DmBAfM6K.js +322 -0
- package/seat-reservation-scoped.component-DPkz6u17.js +17 -0
- package/seat-reservation.component-C_anMkgw.js +364 -0
- package/seat-reservation.js +17 -39
- package/seat-reservation.pure.js +15 -32
- package/svgs-D9arBcqr.js +26 -0
- package/timetable-duration/timetable-duration.component.js +2 -57
- package/timetable-duration.component-DCu8Phts.js +65 -0
- package/timetable-duration.js +5 -4
- package/timetable-duration.pure.js +2 -4
- package/timetable-row/timetable-row.component.js +2 -427
- package/timetable-row.component-BVRCB3xK.js +559 -0
- package/timetable-row.js +6 -13
- package/timetable-row.pure.js +2 -11
- package/toDate-p-Tpkb7t.js +16 -0
- package/development/differenceInMinutes-B0dawX-5.js +0 -26
- package/development/format-BMkeaqaF.js +0 -1433
- package/development/isValid-BYRch7pV.js +0 -53
- package/development/toDate-BWb6Z1JD.js +0 -24
- package/differenceInMinutes-COvvdYsJ.js +0 -23
- package/format-CmKROkbc.js +0 -1186
- package/isValid-m3_OsPaB.js +0 -45
- package/toDate-Bw2KTWeq.js +0 -15
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { SeatReservationBaseElement as e } from "./seat-reservation/seat-reservation/seat-reservation-base-element.js";
|
|
2
|
+
import { SbbLanguageController as t } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
3
|
+
import { boxSizingStyles as n } from "@sbb-esta/lyne-elements/core/styles.js";
|
|
4
|
+
import { css as r, html as i, nothing as a } from "lit";
|
|
5
|
+
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
6
|
+
import { styleMap as o } from "lit/directives/style-map.js";
|
|
7
|
+
import { SbbSeatReservationAreaElement as s } from "./seat-reservation/seat-reservation-area/seat-reservation-area.component.js";
|
|
8
|
+
import { classMap as c } from "lit/directives/class-map.js";
|
|
9
|
+
import { getI18nSeatReservation as l } from "./seat-reservation/common/translations.js";
|
|
10
|
+
import { SbbSeatReservationGraphicElement as u } from "./seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js";
|
|
11
|
+
import { repeat as d } from "lit/directives/repeat.js";
|
|
12
|
+
import { SbbSeatReservationNavigationCoachElement as f } from "./seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js";
|
|
13
|
+
import { SbbSeatReservationPlaceControlElement as p } from "./seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js";
|
|
14
|
+
import { SbbSeatReservationScopedElement as m } from "./seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js";
|
|
15
|
+
import "@sbb-esta/lyne-elements/button.js";
|
|
16
|
+
import "@sbb-esta/lyne-elements/popover.js";
|
|
17
|
+
//#region src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.scss?lit&inline
|
|
18
|
+
var h = r`:host{--sbb-seat-reservation-grid-size:16px;--sbb-seat-reservation-height:0;--sbb-seat-reservation-decks:1;height:inherit;display:block}:host ::part(coach-floor){fill:var(--sbb-background-color-2)}@media (forced-colors:active){:host ::part(coach-floor){fill:#0000}}:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,.sbb-sr-place-ctrl--orientation-90,.sbb-sr-place-ctrl--orientation-270,.sbb-sr-place-ctrl--state-selected) ::part(coach-floor){rotate:180deg}[popover]:where(sbb-popover){width:auto;height:auto;color:inherit;pointer-events:none;background-color:#0000;border:none;margin:0;padding:0}[popover]:where(sbb-popover) .sbb-sr-popover{margin-block:calc(4 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}:host([align-vertical]) .sbb-sr__component{justify-content:flex-end;gap:calc(22 * var(--sbb-seat-reservation-one-px-rem,.0625rem));height:inherit;flex-direction:row-reverse}@media (width>=37.5rem){:host([align-vertical]) .sbb-sr__component{gap:calc(54 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}}:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation,:host([align-vertical]) .sbb-sr__component ul.sbb-sr-navigation__list-coaches{flex-direction:column}:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation{padding:calc(16 * var(--sbb-seat-reservation-one-px-rem,.0625rem)) 0}:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation .sbb-sr__navigation-control-button{left:calc(1 * var(--sbb-seat-reservation-one-px-rem,.0625rem));top:0;rotate:90deg}@media (width>=64rem){:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation .sbb-sr__navigation-control-button{left:calc(-1 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}}:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation ul.sbb-sr-navigation__list-coaches{max-width:initial;padding:calc(5 * var(--sbb-seat-reservation-one-px-rem,.0625rem));overflow:hidden scroll}:host([align-vertical]) .sbb-sr__wrapper-coach-decks{flex-direction:column}:host([align-vertical]) .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{width:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem,.0625rem));height:initial;flex-direction:column-reverse}:host([align-vertical]) .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{inline-size:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem,.0625rem));block-size:calc(20 * var(--sbb-seat-reservation-one-px-rem,.0625rem));margin-bottom:calc(16 * var(--sbb-seat-reservation-one-px-rem,.0625rem));rotate:initial;writing-mode:initial}:host([align-vertical]) .sbb-sr__wrapper-scrollarea{width:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem,.0625rem));height:100%;overflow:hidden scroll}:host([align-vertical]) .sbb-sr__wrapper-scrollarea .sbb-sr__parent{rotate:90deg}:host([align-vertical]) .sbb-sr-travel-direction-wrapper{width:calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem,.0625rem));margin-block-start:calc(4 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}.sbb-sr-navigation{gap:calc(3 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}.sbb-sr-navigation .sbb-sr__navigation-control-button{top:calc(2 * var(--sbb-seat-reservation-one-px-rem,.0625rem));position:relative}@media (width>=64rem){.sbb-sr-navigation .sbb-sr__navigation-control-button{top:0}}.sbb-sr__component{gap:calc(64 * var(--sbb-seat-reservation-one-px-rem,.0625rem) - 16px);flex-direction:column;display:flex}.sbb-sr-travel-direction-wrapper{justify-content:center;align-items:center;column-gap:calc(4 * var(--sbb-seat-reservation-one-px-rem,.0625rem));margin-block:calc(8 * var(--sbb-seat-reservation-one-px-rem,.0625rem)) calc(4 * var(--sbb-seat-reservation-one-px-rem,.0625rem));font-size:var(--sbb-text-font-size-s);display:flex}.sbb-sr-travel-direction-wrapper .sbb-sr__travel-direction--arrow{align-items:center;display:flex}.sbb-sr-navigation-wrapper{display:flex}.sbb-sr-navigation{justify-content:center;width:100%;padding-inline:16px;display:flex}.sbb-sr-navigation__list-coaches{font-size:inherit;--sbb-scrollbar-thumb-width:.125rem;--sbb-scrollbar-thumb-width-hover:.25rem;--sbb-scrollbar-width-firefox:thin;--sbb-scrollbar-color:var(--lightningcss-light,color-mix(in srgb, var(--sbb-color-black) 30%, transparent))var(--lightningcss-dark,color-mix(in srgb, var(--sbb-color-white) 30%, transparent));--sbb-scrollbar-color-hover:var(--lightningcss-light,color-mix(in srgb, var(--sbb-color-black) 60%, transparent))var(--lightningcss-dark,color-mix(in srgb, var(--sbb-color-white) 60%, transparent));--sbb-scrollbar-track-color:transparent;--sbb-scrollbar-width:var(--sbb-spacing-fixed-3x);margin:0;padding:0;list-style:none}.sbb-sr-navigation__list-coaches::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color,transparent)}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color,transparent)}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color,currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover,currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-button{display:none}.sbb-sr-navigation__list-coaches::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr-navigation__list-coaches{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color,currentcolor) var(--sbb-scrollbar-track-color,transparent)}}.sbb-sr-navigation__list-coaches{gap:calc(4 * var(--sbb-seat-reservation-one-px-rem,.0625rem));padding:calc(6 * var(--sbb-seat-reservation-one-px-rem,.0625rem)) calc(5 * var(--sbb-seat-reservation-one-px-rem,.0625rem)) 0;--sbb-scrollbar-color:transparent;flex-wrap:nowrap;max-width:856px;display:flex;position:relative;overflow:scroll hidden}.sbb-sr__wrapper-coach-decks{height:inherit;display:flex;overflow:hidden}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{height:calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem,.0625rem));writing-mode:vertical-lr;justify-content:space-between;display:flex}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{height:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem,.0625rem));width:calc(20 * var(--sbb-seat-reservation-one-px-rem,.0625rem));text-align:center;line-height:calc(20 * var(--sbb-seat-reservation-one-px-rem,.0625rem));margin-block-end:16px;rotate:180deg}.sbb-sr__wrapper-scrollarea{--sbb-scrollbar-thumb-width:.125rem;--sbb-scrollbar-thumb-width-hover:.25rem;--sbb-scrollbar-width-firefox:thin;--sbb-scrollbar-color:var(--lightningcss-light,color-mix(in srgb, var(--sbb-color-black) 30%, transparent))var(--lightningcss-dark,color-mix(in srgb, var(--sbb-color-white) 30%, transparent));--sbb-scrollbar-color-hover:var(--lightningcss-light,color-mix(in srgb, var(--sbb-color-black) 60%, transparent))var(--lightningcss-dark,color-mix(in srgb, var(--sbb-color-white) 60%, transparent));--sbb-scrollbar-track-color:transparent;--sbb-scrollbar-width:var(--sbb-spacing-fixed-3x)}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color,transparent)}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color,transparent)}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color,currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover,currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-button{display:none}.sbb-sr__wrapper-scrollarea::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr__wrapper-scrollarea{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color,currentcolor) var(--sbb-scrollbar-track-color,transparent)}}.sbb-sr__wrapper-scrollarea{padding-block:calc(8 * var(--sbb-seat-reservation-one-px-rem,.0625rem)) calc(16 * var(--sbb-seat-reservation-one-px-rem,.0625rem));overflow:scroll hidden}.sbb-sr__wrapper-scrollarea .sbb-sr__parent{flex-direction:column;display:flex;position:relative}.sbb-sr__list-decks{font-size:inherit;flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.sbb-sr__list-decks--gap{gap:calc(48 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}.sbb-sr__list-item-deck{position:relative}.sbb-sr__list-coaches{font-size:inherit;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem,.0625rem));margin:0;padding:0;list-style:none;display:flex}.sbb-sr__list-decks:has(.sbb-sr-coach-has-overhanging-elements) .sbb-sr__list-coaches{gap:calc(8 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}.sbb-sr__item-coach{position:relative}.sbb-sr-coach-wrapper__table{outline:0}`;
|
|
19
|
+
s.define(), u.define(), p.define(), f.define(), m.define();
|
|
20
|
+
var g = class extends e {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments), this._language = new t(this), this._notFixedRotatableAreaIcons = ["ENTRY_EXIT"];
|
|
23
|
+
}
|
|
24
|
+
static {
|
|
25
|
+
this.elementName = "sbb-seat-reservation";
|
|
26
|
+
}
|
|
27
|
+
static {
|
|
28
|
+
this.styles = [n, h];
|
|
29
|
+
}
|
|
30
|
+
willUpdate(e) {
|
|
31
|
+
super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((e) => e.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((e) => e.setAttribute("tabindex", "0")));
|
|
32
|
+
}
|
|
33
|
+
firstUpdated(e) {
|
|
34
|
+
super.firstUpdated(e), this.updateComplete.then(() => {
|
|
35
|
+
this.initNavigationSelectionByScrollEvent();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return this._initVehicleSeatReservationConstruction(), this._coachesHtmlTemplate || null;
|
|
40
|
+
}
|
|
41
|
+
_initVehicleSeatReservationConstruction() {
|
|
42
|
+
this._coachesHtmlTemplate = i`
|
|
43
|
+
${this._renderTravelDirection()}
|
|
44
|
+
<div class="sbb-sr__component">
|
|
45
|
+
${this._renderNavigation()}
|
|
46
|
+
<div
|
|
47
|
+
class="sbb-sr__wrapper-coach-decks"
|
|
48
|
+
@keydown=${(e) => this.keyboardSeatmapEventHandling(e)}
|
|
49
|
+
>
|
|
50
|
+
<div class="sbb-sr__wrapper-deck-labels">${this._renderDeckLabels()}</div>
|
|
51
|
+
<div
|
|
52
|
+
@scroll=${() => this.coachAreaScrollend()}
|
|
53
|
+
id="sbb-sr__wrapper-scrollarea"
|
|
54
|
+
class="sbb-sr__wrapper-scrollarea"
|
|
55
|
+
tabindex="-1"
|
|
56
|
+
>
|
|
57
|
+
<div id="sbb-sr__parent-area" class="sbb-sr__parent">
|
|
58
|
+
<ul
|
|
59
|
+
class="${c({
|
|
60
|
+
"sbb-sr__list-decks": !0,
|
|
61
|
+
"sbb-sr__list-decks--gap": this.hasMultipleDecks
|
|
62
|
+
})}"
|
|
63
|
+
>
|
|
64
|
+
${this.seatReservations?.map((e, t) => i`<li class="sbb-sr__list-item-deck">
|
|
65
|
+
<ul class="sbb-sr__list-coaches" role="presentation">
|
|
66
|
+
${this._renderCoaches(e, t)}
|
|
67
|
+
</ul>
|
|
68
|
+
</li>`)}
|
|
69
|
+
</ul>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
`;
|
|
75
|
+
}
|
|
76
|
+
_renderDeckLabels() {
|
|
77
|
+
return this.hasMultipleDecks ? this.seatReservations.map((e) => i`<b aria-hidden="true">${l(e.deckCoachLevel, this._language.current)}</b>`) : null;
|
|
78
|
+
}
|
|
79
|
+
_renderNavigationControlButton(e) {
|
|
80
|
+
if (!this.hasNavigation || !this.seatReservations) return null;
|
|
81
|
+
let t = e == "DIRECTION_RIGHT" ? "sbb-sr-navigation__wrapper-button-direction--right" : "sbb-sr-navigation__wrapper-button-direction--left", n = e == "DIRECTION_RIGHT" ? "chevron-small-right-small" : "chevron-small-left-small", r = l(e == "DIRECTION_RIGHT" ? "SEAT_RESERVATION_END" : "SEAT_RESERVATION_BEGIN", this._language.current), o = !0;
|
|
82
|
+
return (e == "DIRECTION_LEFT" && this.selectedCoachIndex > 0 || e == "DIRECTION_RIGHT" && this.selectedCoachIndex < this.coachItemDetailsElements.length - 1) && (o = !1), i`<div class="sbb-sr-navigation__wrapper-button-direction">
|
|
83
|
+
<sbb-secondary-button
|
|
84
|
+
@click="${() => this.navigateByDirectionBtn(e)}"
|
|
85
|
+
@focus="${() => this.onFocusNavDirectionButton()}"
|
|
86
|
+
id="${t}"
|
|
87
|
+
class="sbb-sr__navigation-control-button"
|
|
88
|
+
size="m"
|
|
89
|
+
icon-name="${n}"
|
|
90
|
+
type="button"
|
|
91
|
+
aria-label="${r}"
|
|
92
|
+
role="button"
|
|
93
|
+
.disabledInteractive="${o || a}"
|
|
94
|
+
.disabled="${o || a}"
|
|
95
|
+
></sbb-secondary-button>
|
|
96
|
+
</div>`;
|
|
97
|
+
}
|
|
98
|
+
_renderTravelDirection() {
|
|
99
|
+
if (!this.travelDirection || this.travelDirection === "NONE") return null;
|
|
100
|
+
let e = l("SEAT_RESERVATION_TRAVEL_DIRECTION", this._language.current);
|
|
101
|
+
return i`<div class="sbb-sr-travel-direction-wrapper">
|
|
102
|
+
<div class="sbb-sr__travel-direction--arrow">
|
|
103
|
+
<sbb-icon slot="icon" name="${`arrow-${this.alignVertical ? this.travelDirection === "RIGHT" ? "down" : "up" : this.travelDirection === "RIGHT" ? "right" : "left"}-small`}"></sbb-icon>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="sbb-sr__travel-direction--label">${e}</div>
|
|
106
|
+
</div>`;
|
|
107
|
+
}
|
|
108
|
+
_renderNavigation() {
|
|
109
|
+
return !this.hasNavigation || !this.seatReservations ? null : i`<div class="sbb-sr-navigation-wrapper">
|
|
110
|
+
<nav id="sbb-sr-navigation" class="sbb-sr-navigation">
|
|
111
|
+
${this._renderNavigationControlButton("DIRECTION_LEFT")}
|
|
112
|
+
<ul
|
|
113
|
+
id="sbb-sr__navigation-list-coaches"
|
|
114
|
+
class="sbb-sr-navigation__list-coaches"
|
|
115
|
+
aria-label="${l("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
|
|
116
|
+
>
|
|
117
|
+
${this.coachItemDetailsElements.map((e, t) => i`<li>
|
|
118
|
+
<sbb-seat-reservation-navigation-coach
|
|
119
|
+
@selectcoach=${(e) => this._onSelectNavCoach(e)}
|
|
120
|
+
@focuscoach=${() => this._onFocusNavCoach()}
|
|
121
|
+
@keyup=${(e) => this.onKeyNavigationNavCoachButton(e, t)}
|
|
122
|
+
index="${t}"
|
|
123
|
+
.selected=${this.selectedCoachIndex === t}
|
|
124
|
+
.focused=${this.focusedCoachIndex === t}
|
|
125
|
+
.hovered=${this.hoveredCoachIndex === t}
|
|
126
|
+
.nativeFocusActive=${this.hasSeatReservationNativeFocus}
|
|
127
|
+
.coachItemDetails="${e}"
|
|
128
|
+
?vertical="${this.alignVertical}"
|
|
129
|
+
?showTitleInfo="${this.showTitleInfo}"
|
|
130
|
+
>
|
|
131
|
+
</sbb-seat-reservation-navigation-coach>
|
|
132
|
+
</li>`)}
|
|
133
|
+
</ul>
|
|
134
|
+
${this._renderNavigationControlButton("DIRECTION_RIGHT")}
|
|
135
|
+
</nav>
|
|
136
|
+
</div>`;
|
|
137
|
+
}
|
|
138
|
+
_renderCoaches(e, t) {
|
|
139
|
+
let n = JSON.parse(JSON.stringify(e?.coachItems));
|
|
140
|
+
return n ? n.map((n, r) => i`
|
|
141
|
+
<li class="sbb-sr__item-coach">
|
|
142
|
+
${this._renderCoachElement(n, r, t, e.deckCoachIndex)}
|
|
143
|
+
</li>
|
|
144
|
+
`) : null;
|
|
145
|
+
}
|
|
146
|
+
_renderCoachElement(e, t, n, r) {
|
|
147
|
+
let a = this.getCalculatedDimension(e.dimension), s = this._getDescriptionTableCoach(e);
|
|
148
|
+
return i`<sbb-seat-reservation-scoped
|
|
149
|
+
style=${o({
|
|
150
|
+
"--sbb-seat-reservation-scoped-width": a.w,
|
|
151
|
+
"--sbb-seat-reservation-scoped-height": a.h
|
|
152
|
+
})}
|
|
153
|
+
>
|
|
154
|
+
${this._getRenderedCoachBorders(e, t)}
|
|
155
|
+
${this._getRenderedGraphicalElements(e.graphicElements || [], e.dimension, t, n)}
|
|
156
|
+
${this._getRenderedServiceElements(t, n, e.serviceElements)}
|
|
157
|
+
|
|
158
|
+
<table
|
|
159
|
+
@focus=${() => this.onFocusTableCoachAndPreselectPlace(t)}
|
|
160
|
+
id="sbb-sr-coach-${t}"
|
|
161
|
+
class="sbb-sr-coach-wrapper__table"
|
|
162
|
+
aria-describedby="sbb-sr-coach-caption-${t}"
|
|
163
|
+
tabindex="-1"
|
|
164
|
+
>
|
|
165
|
+
<caption id="sbb-sr-coach-caption-${t}" tabindex="-1">
|
|
166
|
+
<sbb-screen-reader-only>${s}</sbb-screen-reader-only>
|
|
167
|
+
</caption>
|
|
168
|
+
${this._getRenderedRowPlaces(e, t, n, r)}
|
|
169
|
+
</table>
|
|
170
|
+
</sbb-seat-reservation-scoped>`;
|
|
171
|
+
}
|
|
172
|
+
_getRenderedCoachBorders(e, t) {
|
|
173
|
+
if (!e.graphicElements) return null;
|
|
174
|
+
let n = this.coachItemDetailsElements[t]?.driverAreaElements?.driverArea, r = this.coachItemDetailsElements[t]?.driverAreaElements?.driverAreaNoVerticalWall, a = n ? e.dimension.w - n.dimension.w - 1 : e.dimension.w - 2;
|
|
175
|
+
a *= this.baseGridSize;
|
|
176
|
+
let s = (e.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize, l = n && n.position.x === 0 ? n?.dimension.w * this.baseGridSize : this.baseGridSize;
|
|
177
|
+
r && (a = this.getCalculatedDimension(e.dimension).w - 2 * (r.dimension.w * this.baseGridSize), l = r.dimension.w * this.baseGridSize);
|
|
178
|
+
let u = this.overHangingElementInformation.find((t) => t.coachId == e.id);
|
|
179
|
+
return (u?.overhangingPlaces || u?.overhangingGraphicAreas) && (a += 2 * this.baseGridSize, l = 0), i`
|
|
180
|
+
<sbb-seat-reservation-graphic
|
|
181
|
+
class="${c({ "sbb-sr-coach-has-overhanging-elements": u?.overhangingPlaces || u?.overhangingGraphicAreas || !1 })}"
|
|
182
|
+
style=${o({
|
|
183
|
+
"--sbb-seat-reservation-graphic-width": a,
|
|
184
|
+
"--sbb-seat-reservation-graphic-height": s,
|
|
185
|
+
"--sbb-seat-reservation-graphic-top": this.coachBorderPadding * -1,
|
|
186
|
+
"--sbb-seat-reservation-graphic-left": l,
|
|
187
|
+
"--sbb-seat-reservation-graphic-position": "absolute"
|
|
188
|
+
})}
|
|
189
|
+
name="COACH_BORDER_MIDDLE"
|
|
190
|
+
?stretch=${!0}
|
|
191
|
+
role="presentation"
|
|
192
|
+
></sbb-seat-reservation-graphic>
|
|
193
|
+
`;
|
|
194
|
+
}
|
|
195
|
+
_getRenderedRowPlaces(e, t, n, r) {
|
|
196
|
+
if (!e.places) return null;
|
|
197
|
+
let a = {};
|
|
198
|
+
for (let t of e.places) a[t.position.y] ? a[t.position.y].push(t) : a[t.position.y] = [t];
|
|
199
|
+
return Object.values(a).map((e, a) => i`
|
|
200
|
+
<tr id="row-${t}-${e[0].position.y}" data-row-index=${a}>
|
|
201
|
+
${this._getRenderedColumnPlaces(e, t, n, r)}
|
|
202
|
+
</tr>
|
|
203
|
+
`).flatMap((e) => e);
|
|
204
|
+
}
|
|
205
|
+
_getRenderedColumnPlaces(e, t, n, r) {
|
|
206
|
+
e.sort((e, t) => Number(e.position.x) - Number(t.position.x));
|
|
207
|
+
let a = t + "-" + r;
|
|
208
|
+
return i`${d(e, (e) => a + "-" + e.number, (e, a) => {
|
|
209
|
+
let s = this.getCalculatedDimension(e.dimension), c = this.getCalculatedPosition(e.position), l = e.rotation || 0, u = this.alignVertical ? -90 : 0, d = this.getPlaceElementId(n, t, e.number);
|
|
210
|
+
return i`
|
|
211
|
+
<td
|
|
212
|
+
id="cell-${n}-${t}-${e.position.y}-${a}"
|
|
213
|
+
class="graphical-element"
|
|
214
|
+
>
|
|
215
|
+
<sbb-seat-reservation-place-control
|
|
216
|
+
style=${o({
|
|
217
|
+
"--sbb-seat-reservation-place-control-text-scale-value": Math.min(s.w, s.h),
|
|
218
|
+
"--sbb-seat-reservation-place-control-width": s.w,
|
|
219
|
+
"--sbb-seat-reservation-place-control-height": s.h,
|
|
220
|
+
"--sbb-seat-reservation-place-control-top": c.y,
|
|
221
|
+
"--sbb-seat-reservation-place-control-left": c.x,
|
|
222
|
+
"--sbb-seat-reservation-place-control-rotation": l,
|
|
223
|
+
"--sbb-seat-reservation-place-control-text-rotation": u
|
|
224
|
+
})}
|
|
225
|
+
@selectplace=${(e) => this._onSelectPlace(e)}
|
|
226
|
+
exportparts="sbb-sr-place-part"
|
|
227
|
+
id=${d}
|
|
228
|
+
class="seat-reservation-place-control"
|
|
229
|
+
text=${e.number}
|
|
230
|
+
type=${e.type}
|
|
231
|
+
state=${e.state}
|
|
232
|
+
travel-direction=${this.travelDirection}
|
|
233
|
+
coach-index=${t}
|
|
234
|
+
deck-index=${r}
|
|
235
|
+
data-deck-index=${n}
|
|
236
|
+
.propertyIds=${e.propertyIds}
|
|
237
|
+
.preventClick=${this.preventPlaceClick}
|
|
238
|
+
?showTitleInfo="${this.showTitleInfo}"
|
|
239
|
+
></sbb-seat-reservation-place-control>
|
|
240
|
+
</td>
|
|
241
|
+
`;
|
|
242
|
+
})}`;
|
|
243
|
+
}
|
|
244
|
+
_getRenderedGraphicalElements(e, t, n, r) {
|
|
245
|
+
return e ? e?.map((e) => {
|
|
246
|
+
let i = e.icon ?? "", a = e.rotation || 0, o = this._notFixedRotatableAreaIcons.indexOf(e.icon) === -1, s = this.alignVertical && o ? a - 90 : a;
|
|
247
|
+
return this.notAreaElements.findIndex((e) => e === i) > -1 ? this._getRenderElementWithoutArea(e, a, t) : this._getRenderElementWithArea(e, s, t, n, r);
|
|
248
|
+
}) : null;
|
|
249
|
+
}
|
|
250
|
+
_getRenderElementWithArea(e, t, n, r, s) {
|
|
251
|
+
let u = e.icon?.indexOf("TABLE") === -1, d = e.icon && u ? e.icon : null, f = this.isElementDirectlyOnBorder(e, n) && d !== "ENTRY_EXIT", p = e.icon ? l(e.icon, this._language.current) : a, m = this.getCalculatedDimension(e.dimension, n, !0, f), h = this.getCalculatedPosition(e.position, e.dimension, n, !0), g = `popover-trigger-${s}-${r}-${h.x}-${h.y}`, _ = "free";
|
|
252
|
+
return e.position.y === this.coachBorderOffset * -1 ? _ = "upper-border" : e.position.y + e.dimension.h === n.h + this.coachBorderOffset && (_ = "lower-border"), _ !== "free" && (h.y += _ === "upper-border" ? 2 : 1, m.h -= 3), i`
|
|
253
|
+
<sbb-seat-reservation-area
|
|
254
|
+
id="${g}"
|
|
255
|
+
class="${c({ "sbb-seat-reservation-area--cursor-pointer": d !== null })}"
|
|
256
|
+
style=${o({
|
|
257
|
+
"--sbb-seat-reservation-area-width": m.w,
|
|
258
|
+
"--sbb-seat-reservation-area-height": m.h,
|
|
259
|
+
"--sbb-seat-reservation-area-top": h.y,
|
|
260
|
+
"--sbb-seat-reservation-area-left": h.x
|
|
261
|
+
})}
|
|
262
|
+
mounting=${_}
|
|
263
|
+
background="dark"
|
|
264
|
+
aria-hidden="true"
|
|
265
|
+
>
|
|
266
|
+
${d ? i`
|
|
267
|
+
<sbb-seat-reservation-graphic
|
|
268
|
+
style=${o({
|
|
269
|
+
"--sbb-seat-reservation-graphic-max-width": m.w,
|
|
270
|
+
"--sbb-seat-reservation-graphic-height": this.baseGridSize,
|
|
271
|
+
"--sbb-seat-reservation-graphic-rotation": t
|
|
272
|
+
})}
|
|
273
|
+
name=${d}
|
|
274
|
+
role="img"
|
|
275
|
+
aria-hidden="true"
|
|
276
|
+
class="auto-width"
|
|
277
|
+
></sbb-seat-reservation-graphic>
|
|
278
|
+
` : a}
|
|
279
|
+
</sbb-seat-reservation-area>
|
|
280
|
+
${d ? this._popover(g, p) : a}
|
|
281
|
+
`;
|
|
282
|
+
}
|
|
283
|
+
_getRenderElementWithoutArea(e, t, n) {
|
|
284
|
+
let r = this.getCalculatedDimension(e.dimension, n), s = this.getCalculatedPosition(e.position, e.dimension, n), c = e.icon && e.icon.endsWith("DRIVER_AREA") ? e.icon?.concat("_", this.seatReservations[this.currSelectedDeckIndex].vehicleType) : e.icon;
|
|
285
|
+
return i` <sbb-seat-reservation-graphic
|
|
286
|
+
style=${o({
|
|
287
|
+
"--sbb-seat-reservation-graphic-width": r.w,
|
|
288
|
+
"--sbb-seat-reservation-graphic-height": r.h,
|
|
289
|
+
"--sbb-seat-reservation-graphic-top": s.y,
|
|
290
|
+
"--sbb-seat-reservation-graphic-left": s.x,
|
|
291
|
+
"--sbb-seat-reservation-graphic-position": "absolute",
|
|
292
|
+
"--sbb-seat-reservation-graphic-rotation": t
|
|
293
|
+
})}
|
|
294
|
+
name=${c ?? a}
|
|
295
|
+
aria-hidden="true"
|
|
296
|
+
?stretch=${!0}
|
|
297
|
+
></sbb-seat-reservation-graphic>`;
|
|
298
|
+
}
|
|
299
|
+
_getRenderedServiceElements(e, t, n) {
|
|
300
|
+
return n ? n?.map((n) => {
|
|
301
|
+
let r = n.icon ? l(n.icon, this._language.current) : null, s = this.getCalculatedDimension(n.dimension), c = this.getCalculatedPosition(n.position), u = n.rotation || 0, d = this.alignVertical ? u - 90 : u, f = `popover-trigger-${t}-${e}-${c.x}-${c.y}`;
|
|
302
|
+
return i`
|
|
303
|
+
<sbb-seat-reservation-graphic
|
|
304
|
+
id="${f}"
|
|
305
|
+
style=${o({
|
|
306
|
+
"--sbb-seat-reservation-graphic-width": s.w,
|
|
307
|
+
"--sbb-seat-reservation-graphic-height": s.h,
|
|
308
|
+
"--sbb-seat-reservation-graphic-top": c.y,
|
|
309
|
+
"--sbb-seat-reservation-graphic-left": c.x,
|
|
310
|
+
"--sbb-seat-reservation-graphic-position": "absolute",
|
|
311
|
+
"--sbb-seat-reservation-graphic-rotation": d
|
|
312
|
+
})}
|
|
313
|
+
class="sbb-seat-reservation-graphic--cursor-pointer"
|
|
314
|
+
name=${n.icon ?? a}
|
|
315
|
+
role="img"
|
|
316
|
+
aria-hidden="true"
|
|
317
|
+
></sbb-seat-reservation-graphic>
|
|
318
|
+
${this._popover(f, r)}
|
|
319
|
+
`;
|
|
320
|
+
}) : null;
|
|
321
|
+
}
|
|
322
|
+
_onSelectPlace(e) {
|
|
323
|
+
let t = e.detail;
|
|
324
|
+
this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.focusedCoachIndex = -1, this.hasSeatReservationNativeFocus ||= !0, this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(t), this.updateCurrentSelectedPlaceInCoach(t));
|
|
325
|
+
}
|
|
326
|
+
_onSelectNavCoach(e) {
|
|
327
|
+
let t = e.detail;
|
|
328
|
+
this.isKeyboardNavigation = !1, this.preventCoachScrollByPlaceClick = !1, this.hasSeatReservationNativeFocus = !0, t !== null && t !== this.currSelectedCoachIndex ? (this.unfocusPlaceElement(), this.scrollToSelectedNavCoach(t)) : t === this.currSelectedCoachIndex && (this.updateCurrentSelectedCoach(), this.preselectPlaceInCoach()), this._closePopover();
|
|
329
|
+
}
|
|
330
|
+
_onFocusNavCoach() {
|
|
331
|
+
this.preventCoachScrollByPlaceClick ? this.focusPlaceElement(this.currSelectedPlace) : this.preselectPlaceInCoach(), this.isAutoScrolling = !1;
|
|
332
|
+
}
|
|
333
|
+
_popover(e, t) {
|
|
334
|
+
return i`
|
|
335
|
+
<sbb-popover trigger="${e}" hover-trigger="">
|
|
336
|
+
<p class="sbb-text-s sbb-sr-popover">${t}</p>
|
|
337
|
+
</sbb-popover>
|
|
338
|
+
`;
|
|
339
|
+
}
|
|
340
|
+
_closePopover() {
|
|
341
|
+
this.shadowRoot?.querySelectorAll("sbb-popover:is(:state(state-opened),[state--state-opened])").forEach((e) => e.close());
|
|
342
|
+
}
|
|
343
|
+
_getDescriptionTableCoach(e) {
|
|
344
|
+
if (e.type === "LOCOMOTIVE_COACH") return l("COACH_LOCOMOTIVE", this._language.current);
|
|
345
|
+
if (!e.places?.length) return l("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [e.id]);
|
|
346
|
+
let t, n = this._getTitleDescriptionListString(e.graphicElements), r = this._getTitleDescriptionListString(e.serviceElements);
|
|
347
|
+
if (t = l("COACH_TABLE_CAPTION", this._language.current, [e.id]), !this.hasNavigation) {
|
|
348
|
+
let n = this.getAvailableFreePlacesNumFromCoach(e.places), r = l("COACH_AVAILABLE_NUMBER_OF_PLACES", this._language.current, [n.seats, n.bicycles]);
|
|
349
|
+
t = t.concat(". ").concat(r).concat(". ");
|
|
350
|
+
}
|
|
351
|
+
return (n || r) && (t += ". " + l("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", t += r + ", " + n + "."), t;
|
|
352
|
+
}
|
|
353
|
+
_getTitleDescriptionListString(e) {
|
|
354
|
+
let t = [];
|
|
355
|
+
return e?.map((e) => {
|
|
356
|
+
let n = e.icon;
|
|
357
|
+
if (!n) return null;
|
|
358
|
+
let r = t.indexOf(n) > -1, i = l(e.icon, this._language.current), a = this._notFixedRotatableAreaIcons.indexOf(n) === -1 && this.notAreaElements.indexOf(n) === -1;
|
|
359
|
+
return r || t.push(e.icon), i && !r && a ? i : null;
|
|
360
|
+
}).filter((e) => !!e).join(", ");
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
//#endregion
|
|
364
|
+
export { g as t };
|
package/seat-reservation.js
CHANGED
|
@@ -1,39 +1,17 @@
|
|
|
1
|
-
import { mapCoachInfosToCoachSelection as
|
|
2
|
-
import { mapIconToSvg as
|
|
3
|
-
import {
|
|
4
|
-
import { getI18nSeatReservation as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SeatReservationBaseElement as
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
t
|
|
18
|
-
a.define();
|
|
19
|
-
r.define();
|
|
20
|
-
n.define();
|
|
21
|
-
export {
|
|
22
|
-
e as SbbSeatReservationAreaElement,
|
|
23
|
-
m as SbbSeatReservationElement,
|
|
24
|
-
o as SbbSeatReservationGraphicElement,
|
|
25
|
-
t as SbbSeatReservationNavigationCoachElement,
|
|
26
|
-
a as SbbSeatReservationNavigationServicesElement,
|
|
27
|
-
r as SbbSeatReservationPlaceControlElement,
|
|
28
|
-
n as SbbSeatReservationScopedElement,
|
|
29
|
-
w as SeatReservationBaseElement,
|
|
30
|
-
B as assetsTemplate,
|
|
31
|
-
P as getI18nSeatReservation,
|
|
32
|
-
R as mapCoachInfosToCoachSelection,
|
|
33
|
-
C as mapIconToSvg,
|
|
34
|
-
d as mapPlaceAndCoachToSeatReservationPlaceSelection,
|
|
35
|
-
E as mapPlaceInfosToPlaceSelection,
|
|
36
|
-
g as mapRawDataToSeatReservation,
|
|
37
|
-
D as svgImageByOSDMCode,
|
|
38
|
-
h as svgs
|
|
39
|
-
};
|
|
1
|
+
import { mapCoachInfosToCoachSelection as e, mapPlaceAndCoachToSeatReservationPlaceSelection as t, mapPlaceInfosToPlaceSelection as n, mapRawDataToSeatReservation as r } from "./seat-reservation/common/mapper/mapper.js";
|
|
2
|
+
import { mapIconToSvg as i } from "./seat-reservation/common/mapper/icon-mapper.js";
|
|
3
|
+
import { t as a } from "./svgs-D9arBcqr.js";
|
|
4
|
+
import { getI18nSeatReservation as o } from "./seat-reservation/common/translations/i18n.js";
|
|
5
|
+
import { t as s } from "./seat-reservation-area.component-n-9rGn_y.js";
|
|
6
|
+
import { t as c } from "./seat-reservation-graphic.component-YTXRmKt0.js";
|
|
7
|
+
import { assetsTemplate as l, svgImageByOSDMCode as u } from "./seat-reservation/seat-reservation-graphic/seat-reservation-assets.js";
|
|
8
|
+
import { t as d } from "./seat-reservation-navigation-coach.component-YJ0vaYmO.js";
|
|
9
|
+
import { t as f } from "./seat-reservation-navigation-services.component-C3xnLJg2.js";
|
|
10
|
+
import { t as p } from "./seat-reservation-place-control.component-DmBAfM6K.js";
|
|
11
|
+
import { t as m } from "./seat-reservation-scoped.component-DPkz6u17.js";
|
|
12
|
+
import { SeatReservationBaseElement as h } from "./seat-reservation/seat-reservation/seat-reservation-base-element.js";
|
|
13
|
+
import { t as g } from "./seat-reservation.component-C_anMkgw.js";
|
|
14
|
+
import "./seat-reservation.pure.js";
|
|
15
|
+
g.define(), s.define(), c.define(), d.define(), f.define(), p.define(), m.define();
|
|
16
|
+
//#endregion
|
|
17
|
+
export { s as SbbSeatReservationAreaElement, g as SbbSeatReservationElement, c as SbbSeatReservationGraphicElement, d as SbbSeatReservationNavigationCoachElement, f as SbbSeatReservationNavigationServicesElement, p as SbbSeatReservationPlaceControlElement, m as SbbSeatReservationScopedElement, h as SeatReservationBaseElement, l as assetsTemplate, o as getI18nSeatReservation, e as mapCoachInfosToCoachSelection, i as mapIconToSvg, t as mapPlaceAndCoachToSeatReservationPlaceSelection, n as mapPlaceInfosToPlaceSelection, r as mapRawDataToSeatReservation, u as svgImageByOSDMCode, a as svgs };
|
package/seat-reservation.pure.js
CHANGED
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
import { mapCoachInfosToCoachSelection as
|
|
2
|
-
import { mapIconToSvg as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
w as SbbSeatReservationElement,
|
|
17
|
-
E as SbbSeatReservationGraphicElement,
|
|
18
|
-
C as SbbSeatReservationNavigationCoachElement,
|
|
19
|
-
h as SbbSeatReservationNavigationServicesElement,
|
|
20
|
-
P as SbbSeatReservationPlaceControlElement,
|
|
21
|
-
A as SbbSeatReservationScopedElement,
|
|
22
|
-
D as SeatReservationBaseElement,
|
|
23
|
-
b as assetsTemplate,
|
|
24
|
-
l as getI18nSeatReservation,
|
|
25
|
-
t as mapCoachInfosToCoachSelection,
|
|
26
|
-
S as mapIconToSvg,
|
|
27
|
-
a as mapPlaceAndCoachToSeatReservationPlaceSelection,
|
|
28
|
-
r as mapPlaceInfosToPlaceSelection,
|
|
29
|
-
n as mapRawDataToSeatReservation,
|
|
30
|
-
x as svgImageByOSDMCode,
|
|
31
|
-
s as svgs
|
|
32
|
-
};
|
|
1
|
+
import { mapCoachInfosToCoachSelection as e, mapPlaceAndCoachToSeatReservationPlaceSelection as t, mapPlaceInfosToPlaceSelection as n, mapRawDataToSeatReservation as r } from "./seat-reservation/common/mapper/mapper.js";
|
|
2
|
+
import { mapIconToSvg as i } from "./seat-reservation/common/mapper/icon-mapper.js";
|
|
3
|
+
import "./seat-reservation/common/mapper.js";
|
|
4
|
+
import { t as a } from "./svgs-D9arBcqr.js";
|
|
5
|
+
import { getI18nSeatReservation as o } from "./seat-reservation/common/translations/i18n.js";
|
|
6
|
+
import { t as s } from "./seat-reservation-area.component-n-9rGn_y.js";
|
|
7
|
+
import { t as c } from "./seat-reservation-graphic.component-YTXRmKt0.js";
|
|
8
|
+
import { assetsTemplate as l, svgImageByOSDMCode as u } from "./seat-reservation/seat-reservation-graphic/seat-reservation-assets.js";
|
|
9
|
+
import { t as d } from "./seat-reservation-navigation-coach.component-YJ0vaYmO.js";
|
|
10
|
+
import { t as f } from "./seat-reservation-navigation-services.component-C3xnLJg2.js";
|
|
11
|
+
import { t as p } from "./seat-reservation-place-control.component-DmBAfM6K.js";
|
|
12
|
+
import { t as m } from "./seat-reservation-scoped.component-DPkz6u17.js";
|
|
13
|
+
import { SeatReservationBaseElement as h } from "./seat-reservation/seat-reservation/seat-reservation-base-element.js";
|
|
14
|
+
import { t as g } from "./seat-reservation.component-C_anMkgw.js";
|
|
15
|
+
export { s as SbbSeatReservationAreaElement, g as SbbSeatReservationElement, c as SbbSeatReservationGraphicElement, d as SbbSeatReservationNavigationCoachElement, f as SbbSeatReservationNavigationServicesElement, p as SbbSeatReservationPlaceControlElement, m as SbbSeatReservationScopedElement, h as SeatReservationBaseElement, l as assetsTemplate, o as getI18nSeatReservation, e as mapCoachInfosToCoachSelection, i as mapIconToSvg, t as mapPlaceAndCoachToSeatReservationPlaceSelection, n as mapPlaceInfosToPlaceSelection, r as mapRawDataToSeatReservation, u as svgImageByOSDMCode, a as svgs };
|