@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
|
@@ -1,420 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { css as C, html as n, nothing as v } from "lit";
|
|
4
|
-
import { classMap as m } from "lit/directives/class-map.js";
|
|
5
|
-
import { repeat as $ } from "lit/directives/repeat.js";
|
|
6
|
-
import { styleMap as g } from "lit/directives/style-map.js";
|
|
7
|
-
import { getI18nSeatReservation as h } from "../common/translations.js";
|
|
8
|
-
import { SbbSeatReservationAreaElement as k } from "../seat-reservation-area/seat-reservation-area.component.js";
|
|
9
|
-
import { SbbSeatReservationGraphicElement as y } from "../seat-reservation-graphic/seat-reservation-graphic.component.js";
|
|
10
|
-
import { SbbSeatReservationNavigationCoachElement as R } from "../seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js";
|
|
11
|
-
import { SbbSeatReservationPlaceControlElement as S } from "../seat-reservation-place-control/seat-reservation-place-control.component.js";
|
|
12
|
-
import { SbbSeatReservationScopedElement as A } from "../seat-reservation-scoped/seat-reservation-scoped.component.js";
|
|
13
|
-
import { SeatReservationBaseElement as N } from "./seat-reservation-base-element.js";
|
|
14
|
-
import "@sbb-esta/lyne-elements/button.js";
|
|
15
|
-
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
16
|
-
import "@sbb-esta/lyne-elements/popover.js";
|
|
17
|
-
const T = C`:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-height: 0;--sbb-seat-reservation-decks: 1;display:block;height:inherit}:host ::part(coach-floor){fill:var(--sbb-background-color-2)}@media(forced-colors:active){:host ::part(coach-floor){fill:transparent}}: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){margin:0;padding:0;border:none;width:auto;height:auto;background-color:transparent;color:inherit;pointer-events:none}[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{flex-direction:row-reverse;justify-content:flex-end;gap:calc(22 * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:inherit}@media(min-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(min-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{flex-direction:column-reverse;width:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:initial}: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{position:relative;top:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}@media(min-width:64rem){.sbb-sr-navigation .sbb-sr__navigation-control-button{top:0}}.sbb-sr__component{display:flex;flex-direction:column;gap:calc(64 * var(--sbb-seat-reservation-one-px-rem, .0625rem) - 16px)}.sbb-sr-travel-direction-wrapper{display:flex;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)}.sbb-sr-travel-direction-wrapper .sbb-sr__travel-direction--arrow{display:flex;align-items:center}.sbb-sr-navigation-wrapper{display:flex}.sbb-sr-navigation{display:flex;justify-content:center;width:100%;padding-inline:16px}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: color-mix(in srgb, var(--sbb-color-black) 30%, transparent);--sbb-scrollbar-color: light-dark( color-mix(in srgb, var(--sbb-color-black) 30%, transparent), color-mix(in srgb, var(--sbb-color-white) 30%, transparent) );--sbb-scrollbar-color-hover: color-mix(in srgb, var(--sbb-color-black) 60%, transparent);--sbb-scrollbar-color-hover: light-dark( color-mix(in srgb, var(--sbb-color-black) 60%, transparent), 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-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,.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{display:flex;flex-wrap:nowrap;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;max-width:856px;--sbb-scrollbar-color: transparent;overflow:scroll hidden;position:relative}.sbb-sr__wrapper-coach-decks{display:flex;overflow:hidden;height:inherit}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{display:flex;justify-content:space-between;height:calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));writing-mode:vertical-lr}.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));margin-block-end:16px;rotate:180deg;text-align:center;line-height:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper-scrollarea{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: color-mix(in srgb, var(--sbb-color-black) 30%, transparent);--sbb-scrollbar-color: light-dark( color-mix(in srgb, var(--sbb-color-black) 30%, transparent), color-mix(in srgb, var(--sbb-color-white) 30%, transparent) );--sbb-scrollbar-color-hover: color-mix(in srgb, var(--sbb-color-black) 60%, transparent);--sbb-scrollbar-color-hover: light-dark( color-mix(in srgb, var(--sbb-color-black) 60%, transparent), 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,.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{overflow:scroll hidden;padding-block:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper-scrollarea .sbb-sr__parent{display:flex;flex-direction:column;position:relative}.sbb-sr__list-decks{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-direction:column}.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{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.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}`;
|
|
18
|
-
k.define();
|
|
19
|
-
y.define();
|
|
20
|
-
S.define();
|
|
21
|
-
R.define();
|
|
22
|
-
A.define();
|
|
23
|
-
const _ = class _ extends N {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments), this._language = new w(this), this._notFixedRotatableAreaIcons = ["ENTRY_EXIT"];
|
|
26
|
-
}
|
|
27
|
-
willUpdate(e) {
|
|
28
|
-
super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((r) => r.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((r) => r.setAttribute("tabindex", "0")));
|
|
29
|
-
}
|
|
30
|
-
firstUpdated(e) {
|
|
31
|
-
super.firstUpdated(e), this.updateComplete.then(() => {
|
|
32
|
-
this.initNavigationSelectionByScrollEvent();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
render() {
|
|
36
|
-
return this._initVehicleSeatReservationConstruction(), this._coachesHtmlTemplate || null;
|
|
37
|
-
}
|
|
38
|
-
_initVehicleSeatReservationConstruction() {
|
|
39
|
-
this._coachesHtmlTemplate = n`
|
|
40
|
-
${this._renderTravelDirection()}
|
|
41
|
-
<div class="sbb-sr__component">
|
|
42
|
-
${this._renderNavigation()}
|
|
43
|
-
<div
|
|
44
|
-
class="sbb-sr__wrapper-coach-decks"
|
|
45
|
-
@keydown=${(e) => this.keyboardSeatmapEventHandling(e)}
|
|
46
|
-
>
|
|
47
|
-
<div class="sbb-sr__wrapper-deck-labels">${this._renderDeckLabels()}</div>
|
|
48
|
-
<div
|
|
49
|
-
@scroll=${() => this.coachAreaScrollend()}
|
|
50
|
-
id="sbb-sr__wrapper-scrollarea"
|
|
51
|
-
class="sbb-sr__wrapper-scrollarea"
|
|
52
|
-
tabindex="-1"
|
|
53
|
-
>
|
|
54
|
-
<div id="sbb-sr__parent-area" class="sbb-sr__parent">
|
|
55
|
-
<ul
|
|
56
|
-
class="${m({
|
|
57
|
-
"sbb-sr__list-decks": !0,
|
|
58
|
-
"sbb-sr__list-decks--gap": this.hasMultipleDecks
|
|
59
|
-
})}"
|
|
60
|
-
>
|
|
61
|
-
${this.seatReservations?.map((e, r) => n`<li class="sbb-sr__list-item-deck">
|
|
62
|
-
<ul class="sbb-sr__list-coaches" role="presentation">
|
|
63
|
-
${this._renderCoaches(e, r)}
|
|
64
|
-
</ul>
|
|
65
|
-
</li>`)}
|
|
66
|
-
</ul>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
`;
|
|
72
|
-
}
|
|
73
|
-
_renderDeckLabels() {
|
|
74
|
-
return this.hasMultipleDecks ? this.seatReservations.map((e) => {
|
|
75
|
-
const r = h(e.deckCoachLevel, this._language.current);
|
|
76
|
-
return n`<b aria-hidden="true">${r}</b>`;
|
|
77
|
-
}) : null;
|
|
78
|
-
}
|
|
79
|
-
_renderNavigationControlButton(e) {
|
|
80
|
-
if (!this.hasNavigation || !this.seatReservations)
|
|
81
|
-
return null;
|
|
82
|
-
const r = e == "DIRECTION_RIGHT" ? "sbb-sr-navigation__wrapper-button-direction--right" : "sbb-sr-navigation__wrapper-button-direction--left", t = e == "DIRECTION_RIGHT" ? "chevron-small-right-small" : "chevron-small-left-small", i = e == "DIRECTION_RIGHT" ? h("SEAT_RESERVATION_END", this._language.current) : h("SEAT_RESERVATION_BEGIN", this._language.current);
|
|
83
|
-
let a = !0;
|
|
84
|
-
return (e == "DIRECTION_LEFT" && this.selectedCoachIndex > 0 || e == "DIRECTION_RIGHT" && this.selectedCoachIndex < this.coachItemDetailsElements.length - 1) && (a = !1), n`<div class="sbb-sr-navigation__wrapper-button-direction">
|
|
85
|
-
<sbb-secondary-button
|
|
86
|
-
@click="${() => this.navigateByDirectionBtn(e)}"
|
|
87
|
-
@focus="${() => this.onFocusNavDirectionButton()}"
|
|
88
|
-
id="${r}"
|
|
89
|
-
class="sbb-sr__navigation-control-button"
|
|
90
|
-
size="m"
|
|
91
|
-
icon-name="${t}"
|
|
92
|
-
type="button"
|
|
93
|
-
aria-label="${i}"
|
|
94
|
-
role="button"
|
|
95
|
-
.disabledInteractive="${a || v}"
|
|
96
|
-
.disabled="${a || v}"
|
|
97
|
-
></sbb-secondary-button>
|
|
98
|
-
</div>`;
|
|
99
|
-
}
|
|
100
|
-
_renderTravelDirection() {
|
|
101
|
-
if (!this.travelDirection || this.travelDirection === "NONE")
|
|
102
|
-
return null;
|
|
103
|
-
const e = h("SEAT_RESERVATION_TRAVEL_DIRECTION", this._language.current), t = `arrow-${this.alignVertical ? this.travelDirection === "RIGHT" ? "down" : "up" : this.travelDirection === "RIGHT" ? "right" : "left"}-small`;
|
|
104
|
-
return n`<div class="sbb-sr-travel-direction-wrapper">
|
|
105
|
-
<div class="sbb-sr__travel-direction--arrow">
|
|
106
|
-
<sbb-icon slot="icon" name="${t}"></sbb-icon>
|
|
107
|
-
</div>
|
|
108
|
-
<div class="sbb-sr__travel-direction--label">${e}</div>
|
|
109
|
-
</div>`;
|
|
110
|
-
}
|
|
111
|
-
_renderNavigation() {
|
|
112
|
-
return !this.hasNavigation || !this.seatReservations ? null : n`<div class="sbb-sr-navigation-wrapper">
|
|
113
|
-
<nav id="sbb-sr-navigation" class="sbb-sr-navigation">
|
|
114
|
-
${this._renderNavigationControlButton("DIRECTION_LEFT")}
|
|
115
|
-
<ul
|
|
116
|
-
id="sbb-sr__navigation-list-coaches"
|
|
117
|
-
class="sbb-sr-navigation__list-coaches"
|
|
118
|
-
aria-label="${h("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
|
|
119
|
-
>
|
|
120
|
-
${this.coachItemDetailsElements.map((e, r) => n`<li>
|
|
121
|
-
<sbb-seat-reservation-navigation-coach
|
|
122
|
-
@selectcoach=${(t) => this._onSelectNavCoach(t)}
|
|
123
|
-
@focuscoach=${() => this._onFocusNavCoach()}
|
|
124
|
-
@keyup=${(t) => this.onKeyNavigationNavCoachButton(t, r)}
|
|
125
|
-
index="${r}"
|
|
126
|
-
.selected=${this.selectedCoachIndex === r}
|
|
127
|
-
.focused=${this.focusedCoachIndex === r}
|
|
128
|
-
.hovered=${this.hoveredCoachIndex === r}
|
|
129
|
-
.nativeFocusActive=${this.hasSeatReservationNativeFocus}
|
|
130
|
-
.coachItemDetails="${e}"
|
|
131
|
-
?vertical="${this.alignVertical}"
|
|
132
|
-
?showTitleInfo="${this.showTitleInfo}"
|
|
133
|
-
>
|
|
134
|
-
</sbb-seat-reservation-navigation-coach>
|
|
135
|
-
</li>`)}
|
|
136
|
-
</ul>
|
|
137
|
-
${this._renderNavigationControlButton("DIRECTION_RIGHT")}
|
|
138
|
-
</nav>
|
|
139
|
-
</div>`;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
*
|
|
143
|
-
* @returns
|
|
144
|
-
* @param seatReservation
|
|
145
|
-
* @param coachDeckIndex
|
|
146
|
-
*/
|
|
147
|
-
_renderCoaches(e, r) {
|
|
148
|
-
const t = JSON.parse(JSON.stringify(e?.coachItems));
|
|
149
|
-
return t ? t.map((i, a) => n`
|
|
150
|
-
<li class="sbb-sr__item-coach">
|
|
151
|
-
${this._renderCoachElement(i, a, r, e.deckCoachIndex)}
|
|
152
|
-
</li>
|
|
153
|
-
`) : null;
|
|
154
|
-
}
|
|
155
|
-
_renderCoachElement(e, r, t, i) {
|
|
156
|
-
const a = this.getCalculatedDimension(e.dimension), s = this._getDescriptionTableCoach(e);
|
|
157
|
-
return n`<sbb-seat-reservation-scoped
|
|
158
|
-
style=${g({
|
|
159
|
-
"--sbb-seat-reservation-scoped-width": a.w,
|
|
160
|
-
"--sbb-seat-reservation-scoped-height": a.h
|
|
161
|
-
})}
|
|
162
|
-
>
|
|
163
|
-
${this._getRenderedCoachBorders(e, r)}
|
|
164
|
-
${this._getRenderedGraphicalElements(e.graphicElements || [], e.dimension, r, t)}
|
|
165
|
-
${this._getRenderedServiceElements(r, t, e.serviceElements)}
|
|
166
|
-
|
|
167
|
-
<table
|
|
168
|
-
@focus=${() => this.onFocusTableCoachAndPreselectPlace(r)}
|
|
169
|
-
id="sbb-sr-coach-${r}"
|
|
170
|
-
class="sbb-sr-coach-wrapper__table"
|
|
171
|
-
aria-describedby="sbb-sr-coach-caption-${r}"
|
|
172
|
-
tabindex="-1"
|
|
173
|
-
>
|
|
174
|
-
<caption id="sbb-sr-coach-caption-${r}" tabindex="-1">
|
|
175
|
-
<sbb-screen-reader-only>${s}</sbb-screen-reader-only>
|
|
176
|
-
</caption>
|
|
177
|
-
${this._getRenderedRowPlaces(e, r, t, i)}
|
|
178
|
-
</table>
|
|
179
|
-
</sbb-seat-reservation-scoped>`;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* @returns Returns the border graphic (COACH_BORDER_MIDDLE) of a coach with calculated border gap and coach width,
|
|
183
|
-
* depending on whether the coach is with a driver area or without.
|
|
184
|
-
*/
|
|
185
|
-
_getRenderedCoachBorders(e, r) {
|
|
186
|
-
if (!e.graphicElements)
|
|
187
|
-
return null;
|
|
188
|
-
const t = 1, i = this.coachItemDetailsElements[r]?.driverAreaElements?.driverArea, a = this.coachItemDetailsElements[r]?.driverAreaElements?.driverAreaNoVerticalWall;
|
|
189
|
-
let s = i ? e.dimension.w - i.dimension.w - t : e.dimension.w - t * 2;
|
|
190
|
-
s *= this.baseGridSize;
|
|
191
|
-
const o = (e.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize;
|
|
192
|
-
let l = i && i.position.x === 0 ? i?.dimension.w * this.baseGridSize : this.baseGridSize;
|
|
193
|
-
a && (s = this.getCalculatedDimension(e.dimension).w - 2 * (a.dimension.w * this.baseGridSize), l = a.dimension.w * this.baseGridSize);
|
|
194
|
-
const b = this.overHangingElementInformation.find((c) => c.coachId == e.id);
|
|
195
|
-
return (b?.overhangingPlaces || b?.overhangingGraphicAreas) && (s += 2 * this.baseGridSize, l = 0), n`
|
|
196
|
-
<sbb-seat-reservation-graphic
|
|
197
|
-
class="${m({
|
|
198
|
-
"sbb-sr-coach-has-overhanging-elements": b?.overhangingPlaces || b?.overhangingGraphicAreas || !1
|
|
199
|
-
})}"
|
|
200
|
-
style=${g({
|
|
201
|
-
"--sbb-seat-reservation-graphic-width": s,
|
|
202
|
-
"--sbb-seat-reservation-graphic-height": o,
|
|
203
|
-
"--sbb-seat-reservation-graphic-top": this.coachBorderPadding * -1,
|
|
204
|
-
"--sbb-seat-reservation-graphic-left": l,
|
|
205
|
-
"--sbb-seat-reservation-graphic-position": "absolute"
|
|
206
|
-
})}
|
|
207
|
-
name="COACH_BORDER_MIDDLE"
|
|
208
|
-
?stretch=${!0}
|
|
209
|
-
role="presentation"
|
|
210
|
-
></sbb-seat-reservation-graphic>
|
|
211
|
-
`;
|
|
212
|
-
}
|
|
213
|
-
_getRenderedRowPlaces(e, r, t, i) {
|
|
214
|
-
if (!e.places)
|
|
215
|
-
return null;
|
|
216
|
-
const a = {};
|
|
217
|
-
for (const s of e.places)
|
|
218
|
-
a[s.position.y] ? a[s.position.y].push(s) : a[s.position.y] = [s];
|
|
219
|
-
return Object.values(a).map((s, o) => n`
|
|
220
|
-
<tr id="row-${r}-${s[0].position.y}" data-row-index=${o}>
|
|
221
|
-
${this._getRenderedColumnPlaces(s, r, t, i)}
|
|
222
|
-
</tr>
|
|
223
|
-
`).flatMap((s) => s);
|
|
224
|
-
}
|
|
225
|
-
_getRenderedColumnPlaces(e, r, t, i) {
|
|
226
|
-
e.sort((s, o) => Number(s.position.x) - Number(o.position.x));
|
|
227
|
-
const a = r + "-" + i;
|
|
228
|
-
return n`${$(e, (s) => a + "-" + s.number, (s, o) => {
|
|
229
|
-
const l = this.getCalculatedDimension(s.dimension), b = this.getCalculatedPosition(s.position), c = s.rotation || 0, d = this.alignVertical ? -90 : 0, u = this.getPlaceElementId(t, r, s.number);
|
|
230
|
-
return n`
|
|
231
|
-
<td
|
|
232
|
-
id="cell-${t}-${r}-${s.position.y}-${o}"
|
|
233
|
-
class="graphical-element"
|
|
234
|
-
>
|
|
235
|
-
<sbb-seat-reservation-place-control
|
|
236
|
-
style=${g({
|
|
237
|
-
"--sbb-seat-reservation-place-control-text-scale-value": Math.min(l.w, l.h),
|
|
238
|
-
"--sbb-seat-reservation-place-control-width": l.w,
|
|
239
|
-
"--sbb-seat-reservation-place-control-height": l.h,
|
|
240
|
-
"--sbb-seat-reservation-place-control-top": b.y,
|
|
241
|
-
"--sbb-seat-reservation-place-control-left": b.x,
|
|
242
|
-
"--sbb-seat-reservation-place-control-rotation": c,
|
|
243
|
-
"--sbb-seat-reservation-place-control-text-rotation": d
|
|
244
|
-
})}
|
|
245
|
-
@selectplace=${(p) => this._onSelectPlace(p)}
|
|
246
|
-
exportparts="sbb-sr-place-part"
|
|
247
|
-
id=${u}
|
|
248
|
-
class="seat-reservation-place-control"
|
|
249
|
-
text=${s.number}
|
|
250
|
-
type=${s.type}
|
|
251
|
-
state=${s.state}
|
|
252
|
-
travel-direction=${this.travelDirection}
|
|
253
|
-
coach-index=${r}
|
|
254
|
-
deck-index=${i}
|
|
255
|
-
data-deck-index=${t}
|
|
256
|
-
.propertyIds=${s.propertyIds}
|
|
257
|
-
.preventClick=${this.preventPlaceClick}
|
|
258
|
-
?showTitleInfo="${this.showTitleInfo}"
|
|
259
|
-
></sbb-seat-reservation-place-control>
|
|
260
|
-
</td>
|
|
261
|
-
`;
|
|
262
|
-
})}`;
|
|
263
|
-
}
|
|
264
|
-
_getRenderedGraphicalElements(e, r, t, i) {
|
|
265
|
-
return e ? e?.map((a) => {
|
|
266
|
-
const s = a.icon ?? "", o = a.rotation || 0, l = this._notFixedRotatableAreaIcons.indexOf(a.icon) === -1, b = this.alignVertical && l ? o - 90 : o;
|
|
267
|
-
return this.notAreaElements.findIndex((c) => c === s) > -1 ? this._getRenderElementWithoutArea(a, o, r) : this._getRenderElementWithArea(a, b, r, t, i);
|
|
268
|
-
}) : null;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* creates a rendered element with an area component
|
|
272
|
-
* @param graphicalElement
|
|
273
|
-
* @param rotation
|
|
274
|
-
* @param coachDimension
|
|
275
|
-
* @param coachIndex used to generate a unique id for the popover trigger
|
|
276
|
-
* @param coachDeckIndex used to generate a unique id
|
|
277
|
-
* @private
|
|
278
|
-
*/
|
|
279
|
-
_getRenderElementWithArea(e, r, t, i, a) {
|
|
280
|
-
const s = e.icon?.indexOf("TABLE") === -1, o = e.icon && s ? e.icon : null, l = this.isElementDirectlyOnBorder(e, t) && o !== "ENTRY_EXIT", b = e.icon ? h(e.icon, this._language.current) : v, c = this.getCalculatedDimension(e.dimension, t, !0, l), d = this.getCalculatedPosition(e.position, e.dimension, t, !0), u = `popover-trigger-${a}-${i}-${d.x}-${d.y}`;
|
|
281
|
-
let p = "free";
|
|
282
|
-
return e.position.y === this.coachBorderOffset * -1 ? p = "upper-border" : e.position.y + e.dimension.h === t.h + this.coachBorderOffset && (p = "lower-border"), p !== "free" && (d.y += p === "upper-border" ? 2 : 1, c.h -= 3), n`
|
|
283
|
-
<sbb-seat-reservation-area
|
|
284
|
-
id="${u}"
|
|
285
|
-
class="${m({ "sbb-seat-reservation-area--cursor-pointer": o !== null })}"
|
|
286
|
-
style=${g({
|
|
287
|
-
"--sbb-seat-reservation-area-width": c.w,
|
|
288
|
-
"--sbb-seat-reservation-area-height": c.h,
|
|
289
|
-
"--sbb-seat-reservation-area-top": d.y,
|
|
290
|
-
"--sbb-seat-reservation-area-left": d.x
|
|
291
|
-
})}
|
|
292
|
-
mounting=${p}
|
|
293
|
-
background="dark"
|
|
294
|
-
aria-hidden="true"
|
|
295
|
-
>
|
|
296
|
-
${o ? n`
|
|
297
|
-
<sbb-seat-reservation-graphic
|
|
298
|
-
style=${g({
|
|
299
|
-
"--sbb-seat-reservation-graphic-max-width": c.w,
|
|
300
|
-
"--sbb-seat-reservation-graphic-height": this.baseGridSize,
|
|
301
|
-
"--sbb-seat-reservation-graphic-rotation": r
|
|
302
|
-
})}
|
|
303
|
-
name=${o}
|
|
304
|
-
role="img"
|
|
305
|
-
aria-hidden="true"
|
|
306
|
-
class="auto-width"
|
|
307
|
-
></sbb-seat-reservation-graphic>
|
|
308
|
-
` : v}
|
|
309
|
-
</sbb-seat-reservation-area>
|
|
310
|
-
${o ? this._popover(u, b) : v}
|
|
311
|
-
`;
|
|
312
|
-
}
|
|
313
|
-
_getRenderElementWithoutArea(e, r, t) {
|
|
314
|
-
const i = this.getCalculatedDimension(e.dimension, t), a = this.getCalculatedPosition(e.position, e.dimension, t), s = e.icon && e.icon.endsWith("DRIVER_AREA") ? e.icon?.concat("_", this.seatReservations[this.currSelectedDeckIndex].vehicleType) : e.icon;
|
|
315
|
-
return n` <sbb-seat-reservation-graphic
|
|
316
|
-
style=${g({
|
|
317
|
-
"--sbb-seat-reservation-graphic-width": i.w,
|
|
318
|
-
"--sbb-seat-reservation-graphic-height": i.h,
|
|
319
|
-
"--sbb-seat-reservation-graphic-top": a.y,
|
|
320
|
-
"--sbb-seat-reservation-graphic-left": a.x,
|
|
321
|
-
"--sbb-seat-reservation-graphic-position": "absolute",
|
|
322
|
-
"--sbb-seat-reservation-graphic-rotation": r
|
|
323
|
-
})}
|
|
324
|
-
name=${s ?? v}
|
|
325
|
-
aria-hidden="true"
|
|
326
|
-
?stretch=${!0}
|
|
327
|
-
></sbb-seat-reservation-graphic>`;
|
|
328
|
-
}
|
|
329
|
-
_getRenderedServiceElements(e, r, t) {
|
|
330
|
-
return t ? t?.map((i) => {
|
|
331
|
-
const a = i.icon ? h(i.icon, this._language.current) : null, s = this.getCalculatedDimension(i.dimension), o = this.getCalculatedPosition(i.position), l = i.rotation || 0, b = this.alignVertical ? l - 90 : l, c = `popover-trigger-${r}-${e}-${o.x}-${o.y}`;
|
|
332
|
-
return n`
|
|
333
|
-
<sbb-seat-reservation-graphic
|
|
334
|
-
id="${c}"
|
|
335
|
-
style=${g({
|
|
336
|
-
"--sbb-seat-reservation-graphic-width": s.w,
|
|
337
|
-
"--sbb-seat-reservation-graphic-height": s.h,
|
|
338
|
-
"--sbb-seat-reservation-graphic-top": o.y,
|
|
339
|
-
"--sbb-seat-reservation-graphic-left": o.x,
|
|
340
|
-
"--sbb-seat-reservation-graphic-position": "absolute",
|
|
341
|
-
"--sbb-seat-reservation-graphic-rotation": b
|
|
342
|
-
})}
|
|
343
|
-
class="sbb-seat-reservation-graphic--cursor-pointer"
|
|
344
|
-
name=${i.icon ?? v}
|
|
345
|
-
role="img"
|
|
346
|
-
aria-hidden="true"
|
|
347
|
-
></sbb-seat-reservation-graphic>
|
|
348
|
-
${this._popover(c, a)}
|
|
349
|
-
`;
|
|
350
|
-
}) : null;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Manages the selected place event triggered from the place
|
|
354
|
-
* Each selection emits an array of all selected places
|
|
355
|
-
* @param selectPlaceEvent
|
|
356
|
-
*/
|
|
357
|
-
_onSelectPlace(e) {
|
|
358
|
-
const r = e.detail;
|
|
359
|
-
this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.focusedCoachIndex = -1, this.hasSeatReservationNativeFocus || (this.hasSeatReservationNativeFocus = !0), this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(r), this.updateCurrentSelectedPlaceInCoach(r));
|
|
360
|
-
}
|
|
361
|
-
_onSelectNavCoach(e) {
|
|
362
|
-
const r = e.detail;
|
|
363
|
-
this.isKeyboardNavigation = !1, this.preventCoachScrollByPlaceClick = !1, this.hasSeatReservationNativeFocus = !0, r !== null && r !== this.currSelectedCoachIndex ? (this.unfocusPlaceElement(), this.scrollToSelectedNavCoach(r)) : r === this.currSelectedCoachIndex && (this.updateCurrentSelectedCoach(), this.preselectPlaceInCoach()), this._closePopover();
|
|
364
|
-
}
|
|
365
|
-
_onFocusNavCoach() {
|
|
366
|
-
this.preventCoachScrollByPlaceClick ? this.focusPlaceElement(this.currSelectedPlace) : this.preselectPlaceInCoach(), this.isAutoScrolling = !1;
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Creates a popover for extra service information
|
|
370
|
-
* @param triggerId
|
|
371
|
-
* @param popoverContent
|
|
372
|
-
* @private
|
|
373
|
-
*/
|
|
374
|
-
_popover(e, r) {
|
|
375
|
-
return n`
|
|
376
|
-
<sbb-popover trigger="${e}" hover-trigger="">
|
|
377
|
-
<p class="sbb-text-s sbb-sr-popover">${r}</p>
|
|
378
|
-
</sbb-popover>
|
|
379
|
-
`;
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* trigger to close all opened popovers (normally only one is opened at a time)
|
|
383
|
-
* @private
|
|
384
|
-
*/
|
|
385
|
-
_closePopover() {
|
|
386
|
-
this.shadowRoot?.querySelectorAll("sbb-popover:is(:state(state-opened),[state--state-opened])").forEach((e) => e.close());
|
|
387
|
-
}
|
|
388
|
-
_getDescriptionTableCoach(e) {
|
|
389
|
-
if (e.type === "LOCOMOTIVE_COACH")
|
|
390
|
-
return h("COACH_LOCOMOTIVE", this._language.current);
|
|
391
|
-
if (!e.places?.length)
|
|
392
|
-
return h("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [
|
|
393
|
-
e.id
|
|
394
|
-
]);
|
|
395
|
-
let r;
|
|
396
|
-
const t = this._getTitleDescriptionListString(e.graphicElements), i = this._getTitleDescriptionListString(e.serviceElements);
|
|
397
|
-
if (r = h("COACH_TABLE_CAPTION", this._language.current, [
|
|
398
|
-
e.id
|
|
399
|
-
]), !this.hasNavigation) {
|
|
400
|
-
const a = this.getAvailableFreePlacesNumFromCoach(e.places), s = h("COACH_AVAILABLE_NUMBER_OF_PLACES", this._language.current, [a.seats, a.bicycles]);
|
|
401
|
-
r = r.concat(". ").concat(s).concat(". ");
|
|
402
|
-
}
|
|
403
|
-
return (t || i) && (r += ". " + h("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", r += i + ", " + t + "."), r;
|
|
404
|
-
}
|
|
405
|
-
_getTitleDescriptionListString(e) {
|
|
406
|
-
const r = [];
|
|
407
|
-
return e?.map((t) => {
|
|
408
|
-
const i = t.icon;
|
|
409
|
-
if (!i)
|
|
410
|
-
return null;
|
|
411
|
-
const a = r.indexOf(i) > -1, s = h(t.icon, this._language.current), o = this._notFixedRotatableAreaIcons.indexOf(i) === -1 && this.notAreaElements.indexOf(i) === -1;
|
|
412
|
-
return a || r.push(t.icon), s && !a && o ? s : null;
|
|
413
|
-
}).filter((t) => !!t).join(", ");
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
_.elementName = "sbb-seat-reservation", _.styles = [x, T];
|
|
417
|
-
let f = _;
|
|
418
|
-
export {
|
|
419
|
-
f as SbbSeatReservationElement
|
|
420
|
-
};
|
|
1
|
+
import { t as e } from "../../seat-reservation.component-C_anMkgw.js";
|
|
2
|
+
export { e as SbbSeatReservationElement };
|
|
@@ -1,51 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
var k = (r, e, t) => e.has(r) || p("Cannot " + t);
|
|
5
|
-
var l = (r, e, t) => (k(r, e, "read from private field"), t ? t.call(r) : e.get(r)), u = (r, e, t) => e.has(r) ? p("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), m = (r, e, t, i) => (k(r, e, "write to private field"), i ? i.call(r, t) : e.set(r, t), t);
|
|
6
|
-
import { __esDecorate as f, __runInitializers as c } from "tslib";
|
|
7
|
-
import { SbbElement as y } from "@sbb-esta/lyne-elements/core/base-elements.js";
|
|
8
|
-
import { forceType as _ } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
-
import { boxSizingStyles as w } from "@sbb-esta/lyne-elements/core/styles.js";
|
|
10
|
-
import { css as z, html as j } from "lit";
|
|
11
|
-
import { property as x } from "lit/decorators.js";
|
|
12
|
-
const I = z`:host{--sbb-seat-reservation-area-border-radius: var(--sbb-border-width-4x);--sbb-seat-reservation-area-rotation: 0;display:flex;justify-content:center;align-items:center;height:calc(var(--sbb-seat-reservation-area-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:calc(var(--sbb-seat-reservation-area-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));border:var(--sbb-border-width-1x) solid var(--sbb-color-graphite);border:var(--sbb-border-width-1x) solid light-dark(var(--sbb-color-graphite),var(--sbb-color-granite));border-radius:var(--sbb-seat-reservation-area-border-radius);position:absolute;inset-block-start:calc(var(--sbb-seat-reservation-area-top) * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(var(--sbb-seat-reservation-area-left) * var(--sbb-seat-reservation-one-px-rem, .0625rem));rotate:calc(var(--sbb-seat-reservation-area-rotation) * 1deg);line-height:normal;background-color:var(--sbb-background-color-2)}:host([background=dark]){background-color:var(--sbb-color-milk);background-color:light-dark(var(--sbb-color-milk),var(--sbb-color-iron))}:host([mounting=upper-border]){border-block-start-width:0;border-radius:0 0 var(--sbb-seat-reservation-area-border-radius) var(--sbb-seat-reservation-area-border-radius)}:host([mounting=lower-border]){border-block-end-width:0;border-radius:var(--sbb-seat-reservation-area-border-radius) var(--sbb-seat-reservation-area-border-radius) 0 0}:host([mounting=upper-to-lower-border]){border-block-start:none;border-block-end:none;border-radius:0}:host(.sbb-seat-reservation-area--cursor-pointer){cursor:var(--sbb-cursor-pointer)}`;
|
|
13
|
-
let C = (() => {
|
|
14
|
-
var n, b, o;
|
|
15
|
-
let r = y, e, t = [], i = [], g, v = [], h = [];
|
|
16
|
-
return o = class extends r {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
u(this, n, c(this, t, "free"));
|
|
20
|
-
u(this, b, (c(this, i), c(this, v, "light")));
|
|
21
|
-
c(this, h);
|
|
22
|
-
}
|
|
23
|
-
/** Mounting Prop */
|
|
24
|
-
get mounting() {
|
|
25
|
-
return l(this, n);
|
|
26
|
-
}
|
|
27
|
-
set mounting(s) {
|
|
28
|
-
m(this, n, s);
|
|
29
|
-
}
|
|
30
|
-
/** the background of the area */
|
|
31
|
-
get background() {
|
|
32
|
-
return l(this, b);
|
|
33
|
-
}
|
|
34
|
-
set background(s) {
|
|
35
|
-
m(this, b, s);
|
|
36
|
-
}
|
|
37
|
-
render() {
|
|
38
|
-
return j`<slot></slot>`;
|
|
39
|
-
}
|
|
40
|
-
}, n = new WeakMap(), b = new WeakMap(), (() => {
|
|
41
|
-
const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(r[Symbol.metadata] ?? null) : void 0;
|
|
42
|
-
e = [_(), x({ reflect: !0 })], g = [_(), x({ reflect: !0 })], f(o, null, e, { kind: "accessor", name: "mounting", static: !1, private: !1, access: { has: (a) => "mounting" in a, get: (a) => a.mounting, set: (a, d) => {
|
|
43
|
-
a.mounting = d;
|
|
44
|
-
} }, metadata: s }, t, i), f(o, null, g, { kind: "accessor", name: "background", static: !1, private: !1, access: { has: (a) => "background" in a, get: (a) => a.background, set: (a, d) => {
|
|
45
|
-
a.background = d;
|
|
46
|
-
} }, metadata: s }, v, h), s && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s });
|
|
47
|
-
})(), o.elementName = "sbb-seat-reservation-area", o.styles = [w, I], o;
|
|
48
|
-
})();
|
|
49
|
-
export {
|
|
50
|
-
C as SbbSeatReservationAreaElement
|
|
51
|
-
};
|
|
1
|
+
import { t as e } from "../../seat-reservation-area.component-n-9rGn_y.js";
|
|
2
|
+
export { e as SbbSeatReservationAreaElement };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
e.define();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
e as SbbSeatReservationAreaElement
|
|
7
|
-
};
|
|
1
|
+
import { t as e } from "../seat-reservation-area.component-n-9rGn_y.js";
|
|
2
|
+
e.define(), console.warn("The entrypoint '@sbb-esta/elements-experimental/seat-reservation/seat-reservation-area.js' has been deprecated.\nUse either '@sbb-esta/elements-experimental/seat-reservation.js' or '@sbb-esta/elements-experimental/seat-reservation.pure.js' instead.");
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as SbbSeatReservationAreaElement };
|