@sbb-esta/lyne-elements-experimental 2.11.0 → 2.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/core/datetime/date-helper.js +142 -142
  2. package/core/timetable/access-leg-helper.js +49 -52
  3. package/core/timetable/timetable-helper.js +7 -8
  4. package/custom-elements.json +106 -35
  5. package/development/core/datetime/date-helper.js +10 -10
  6. package/development/core/timetable/access-leg-helper.js +12 -15
  7. package/development/core/timetable/timetable-helper.js +6 -7
  8. package/development/{differenceInMinutes-CHSyWiQs.js → differenceInMinutes-D5Nj8Stc.js} +3 -3
  9. package/development/{format-D0-yhzi4.js → format-BQfaa1ZT.js} +22 -26
  10. package/development/{isValid-Bo4R7iA7.js → isValid-DvieCZVi.js} +3 -3
  11. package/development/journey-summary/journey-summary.component.js +4 -5
  12. package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
  13. package/development/pearl-chain/pearl-chain.component.js +28 -39
  14. package/development/pearl-chain-time/pearl-chain-time.component.js +5 -6
  15. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
  16. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
  17. package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
  18. package/development/seat-reservation/common/mapper/mapper.d.ts +5 -5
  19. package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  20. package/development/seat-reservation/common/mapper/mapper.js +17 -19
  21. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
  22. package/development/seat-reservation/common/svgs.js +1 -1
  23. package/development/seat-reservation/common/translations/i18n.js +2 -3
  24. package/development/seat-reservation/common/types.d.ts +71 -0
  25. package/development/seat-reservation/common/types.d.ts.map +1 -0
  26. package/development/seat-reservation/common/types.js +2 -0
  27. package/development/seat-reservation/common.d.ts +6 -3
  28. package/development/seat-reservation/common.d.ts.map +1 -1
  29. package/development/seat-reservation/common.js +3 -7
  30. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +4 -3
  31. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  32. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +27 -38
  33. package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
  34. package/development/seat-reservation/seat-reservation/{seat-reservation-scoped-component → seat-reservation-scoped}/seat-reservation-scoped.component.js +6 -7
  35. package/development/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts +5 -0
  36. package/development/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts.map +1 -0
  37. package/development/seat-reservation/seat-reservation/seat-reservation-scoped.js +5 -0
  38. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +4 -4
  39. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  40. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +20 -27
  41. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
  42. package/development/seat-reservation/seat-reservation-area.d.ts +3 -0
  43. package/development/seat-reservation/seat-reservation-area.d.ts.map +1 -1
  44. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +2 -3
  45. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +7 -8
  46. package/development/seat-reservation/seat-reservation-graphic.d.ts +3 -0
  47. package/development/seat-reservation/seat-reservation-graphic.d.ts.map +1 -1
  48. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +6 -5
  49. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
  50. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +7 -11
  51. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts +3 -0
  52. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +1 -1
  53. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -3
  54. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts +3 -0
  55. package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +1 -1
  56. package/development/seat-reservation/seat-reservation-navigation.d.ts +6 -0
  57. package/development/seat-reservation/seat-reservation-navigation.d.ts.map +1 -0
  58. package/development/seat-reservation/seat-reservation-navigation.js +7 -0
  59. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -2
  60. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
  61. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +5 -6
  62. package/development/seat-reservation/seat-reservation-place-control.d.ts +3 -0
  63. package/development/seat-reservation/seat-reservation-place-control.d.ts.map +1 -1
  64. package/development/seat-reservation/seat-reservation.d.ts +5 -71
  65. package/development/seat-reservation/seat-reservation.d.ts.map +1 -1
  66. package/development/seat-reservation/seat-reservation.js +4 -2
  67. package/development/seat-reservation.d.ts +5 -0
  68. package/development/seat-reservation.d.ts.map +1 -1
  69. package/development/seat-reservation.js +26 -3
  70. package/development/timetable-duration/timetable-duration.component.js +1 -1
  71. package/development/timetable-row/timetable-row.component.js +58 -89
  72. package/differenceInMinutes-CP_C5onR.js +23 -0
  73. package/{format-Dg8rkk7h.js → format-lqeCzmzS.js} +438 -442
  74. package/index.d.ts +1 -1
  75. package/index.js +1 -1
  76. package/isValid-Ceq2O0NQ.js +45 -0
  77. package/journey-summary/journey-summary.component.js +3 -4
  78. package/package.json +47 -2
  79. package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
  80. package/pearl-chain/pearl-chain.component.js +78 -95
  81. package/pearl-chain-time/pearl-chain-time.component.js +44 -45
  82. package/seat-reservation/common/mapper/mapper.d.ts +5 -5
  83. package/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  84. package/seat-reservation/common/mapper/mapper.js +50 -54
  85. package/seat-reservation/common/translations/i18n.js +5 -6
  86. package/seat-reservation/common/types.d.ts +71 -0
  87. package/seat-reservation/common/types.d.ts.map +1 -0
  88. package/seat-reservation/common/types.js +1 -0
  89. package/seat-reservation/common.d.ts +6 -3
  90. package/seat-reservation/common.d.ts.map +1 -1
  91. package/seat-reservation/common.js +11 -15
  92. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +4 -3
  93. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  94. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +107 -118
  95. package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
  96. package/seat-reservation/seat-reservation/{seat-reservation-scoped-component → seat-reservation-scoped}/seat-reservation-scoped.component.js +40 -41
  97. package/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts +5 -0
  98. package/seat-reservation/seat-reservation/seat-reservation-scoped.d.ts.map +1 -0
  99. package/seat-reservation/seat-reservation/{seat-reservation-scoped-component.js → seat-reservation-scoped.js} +1 -1
  100. package/seat-reservation/seat-reservation/seat-reservation.component.d.ts +4 -4
  101. package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  102. package/seat-reservation/seat-reservation/seat-reservation.component.js +82 -91
  103. package/seat-reservation/seat-reservation-area.d.ts +3 -0
  104. package/seat-reservation/seat-reservation-area.d.ts.map +1 -1
  105. package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +15 -18
  106. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +58 -59
  107. package/seat-reservation/seat-reservation-graphic.d.ts +3 -0
  108. package/seat-reservation/seat-reservation-graphic.d.ts.map +1 -1
  109. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +6 -5
  110. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -1
  111. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +71 -75
  112. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts +3 -0
  113. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach.d.ts.map +1 -1
  114. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +12 -13
  115. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts +3 -0
  116. package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services.d.ts.map +1 -1
  117. package/seat-reservation/seat-reservation-navigation.d.ts +6 -0
  118. package/seat-reservation/seat-reservation-navigation.d.ts.map +1 -0
  119. package/seat-reservation/seat-reservation-navigation.js +6 -0
  120. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -2
  121. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
  122. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +24 -25
  123. package/seat-reservation/seat-reservation-place-control.d.ts +3 -0
  124. package/seat-reservation/seat-reservation-place-control.d.ts.map +1 -1
  125. package/seat-reservation/seat-reservation.d.ts +5 -71
  126. package/seat-reservation/seat-reservation.d.ts.map +1 -1
  127. package/seat-reservation/seat-reservation.js +6 -4
  128. package/seat-reservation.d.ts +5 -0
  129. package/seat-reservation.d.ts.map +1 -1
  130. package/seat-reservation.js +27 -4
  131. package/timetable-row/timetable-row.component.js +207 -247
  132. package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.d.ts.map +0 -1
  133. package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts +0 -2
  134. package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts.map +0 -1
  135. package/development/seat-reservation/seat-reservation/seat-reservation-scoped-component.js +0 -5
  136. package/differenceInMinutes-BMqUZdhj.js +0 -23
  137. package/isValid-DJ69OMZJ.js +0 -45
  138. package/seat-reservation/seat-reservation/seat-reservation-scoped-component/seat-reservation-scoped.component.d.ts.map +0 -1
  139. package/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts +0 -2
  140. package/seat-reservation/seat-reservation/seat-reservation-scoped-component.d.ts.map +0 -1
  141. /package/development/seat-reservation/seat-reservation/{seat-reservation-scoped-component → seat-reservation-scoped}/seat-reservation-scoped.component.d.ts +0 -0
  142. /package/seat-reservation/seat-reservation/{seat-reservation-scoped-component → seat-reservation-scoped}/seat-reservation-scoped.component.d.ts +0 -0
@@ -1,36 +1,36 @@
1
- var q = (n) => {
2
- throw TypeError(n);
1
+ var U = (r) => {
2
+ throw TypeError(r);
3
3
  };
4
- var K = (n, o, c) => o.has(n) || q("Cannot " + c);
5
- var R = (n, o, c) => (K(n, o, "read from private field"), c ? c.call(n) : o.get(n)), x = (n, o, c) => o.has(n) ? q("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(n) : o.set(n, c), b = (n, o, c, u) => (K(n, o, "write to private field"), u ? u.call(n, c) : o.set(n, c), c);
4
+ var q = (r, o, l) => o.has(r) || U("Cannot " + l);
5
+ var R = (r, o, l) => (q(r, o, "read from private field"), l ? l.call(r) : o.get(r)), x = (r, o, l) => o.has(r) ? U("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(r) : o.set(r, l), b = (r, o, l, u) => (q(r, o, "write to private field"), u ? u.call(r, l) : o.set(r, l), l);
6
6
  import { __runInitializers as p, __esDecorate as S } from "tslib";
7
- import { SbbLanguageController as X } from "@sbb-esta/lyne-elements/core/controllers.js";
7
+ import { SbbLanguageController as K } from "@sbb-esta/lyne-elements/core/controllers.js";
8
8
  import { forceType as P } from "@sbb-esta/lyne-elements/core/decorators.js";
9
- import { css as J, html as h, nothing as A } from "lit";
10
- import { customElement as Y, property as y } from "lit/decorators.js";
11
- import { classMap as Q } from "lit/directives/class-map.js";
12
- import { styleMap as Z } from "lit/directives/style-map.js";
9
+ import { css as X, html as d, nothing as A } from "lit";
10
+ import { customElement as J, property as y } from "lit/decorators.js";
11
+ import { classMap as Y } from "lit/directives/class-map.js";
12
+ import { styleMap as Q } from "lit/directives/style-map.js";
13
13
  import { getI18nSeatReservation as _ } from "../common.js";
14
- import { SeatReservationBaseElement as ee } from "./seat-reservation-base-element.js";
14
+ import { SeatReservationBaseElement as Z } from "./seat-reservation-base-element.js";
15
15
  import "@sbb-esta/lyne-elements/screen-reader-only.js";
16
16
  import "../seat-reservation-area.js";
17
17
  import "../seat-reservation-graphic.js";
18
18
  import "../seat-reservation-place-control.js";
19
19
  import "../seat-reservation-navigation/seat-reservation-navigation-coach.js";
20
- import "./seat-reservation-scoped-component/seat-reservation-scoped.component.js";
21
- const te = J`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-vertical-offset: 0;display:block}:host ::part(coach-floor){fill:var(--sbb-color-white)}@media (forced-colors: active){:host ::part(coach-floor){fill:transparent}}.sbb-sr__wrapper--vertical{width:fit-content;position:relative;inset-inline-start:var(--sbb-seat-reservation-vertical-offset);rotate:90deg;transform-origin:top left}.sbb-sr__wrapper--vertical .sbb-sr__parent{overflow-y:hidden}.sbb-sr__wrapper--vertical .sbb-sr__list-coaches{width:100vw}.sbb-sr-navigation--vertical{inset-inline-start:var(--sbb-seat-reservation-vertical-offset);margin-inline-start:1.25rem;position:absolute}.sbb-sr-navigation--vertical .sbb-sr-navigation__list-coaches{flex-direction:column}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;justify-content:center;flex-wrap:nowrap;gap:var(--sbb-spacing-fixed-1x);min-height:3.75rem}.sbb-sr__parent{overflow-x:scroll;padding:3rem 0}.sbb-sr__list-coaches{display:flex;gap:.25rem;padding:0;margin:0;list-style:none}.sbb-sr__item-coach{padding:0;margin:0;position:relative}.sbb-sr-coach-wrapper__table{outline:0}`;
20
+ import "./seat-reservation-scoped/seat-reservation-scoped.component.js";
21
+ const ee = X`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-vertical-offset: 0;display:block}:host ::part(coach-floor){fill:var(--sbb-color-white)}@media (forced-colors: active){:host ::part(coach-floor){fill:transparent}}.sbb-sr__wrapper--vertical{width:fit-content;position:relative;inset-inline-start:var(--sbb-seat-reservation-vertical-offset);rotate:90deg;transform-origin:top left}.sbb-sr__wrapper--vertical .sbb-sr__parent{overflow-y:hidden}.sbb-sr__wrapper--vertical .sbb-sr__list-coaches{width:100vw}.sbb-sr-navigation--vertical{inset-inline-start:var(--sbb-seat-reservation-vertical-offset);margin-inline-start:1.25rem;position:absolute}.sbb-sr-navigation--vertical .sbb-sr-navigation__list-coaches{flex-direction:column}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;justify-content:center;flex-wrap:nowrap;gap:var(--sbb-spacing-fixed-1x);min-height:3.75rem}.sbb-sr__parent{overflow-x:scroll;padding:3rem 0}.sbb-sr__list-coaches{display:flex;gap:.25rem;padding:0;margin:0;list-style:none}.sbb-sr__item-coach{padding:0;margin:0;position:relative}.sbb-sr-coach-wrapper__table{outline:0}`;
22
22
  let me = (() => {
23
- var g, f, m, $, C, d;
24
- let n = [Y("sbb-seat-reservation")], o, c = [], u, N = ee, T, z = [], O = [], k, D = [], G = [], I, V = [], E = [], B, L = [], F = [], M, H = [], W = [];
25
- return d = class extends N {
23
+ var g, m, f, $, C, c;
24
+ let r = [J("sbb-seat-reservation")], o, l = [], u, N = Z, T, z = [], O = [], E, k = [], D = [], G, I = [], V = [], B, L = [], F = [], M, H = [], W = [];
25
+ return c = class extends N {
26
26
  constructor() {
27
27
  super(...arguments);
28
28
  x(this, g);
29
- x(this, f);
30
29
  x(this, m);
30
+ x(this, f);
31
31
  x(this, $);
32
32
  x(this, C);
33
- b(this, g, p(this, z, null)), b(this, f, (p(this, O), p(this, D, !0))), b(this, m, (p(this, G), p(this, V, !1))), b(this, $, (p(this, E), p(this, L, null))), b(this, C, (p(this, F), p(this, H, !1))), this._language = (p(this, W), new X(this)), this._notAreaElements = [
33
+ b(this, g, p(this, z, null)), b(this, m, (p(this, O), p(this, k, !0))), b(this, f, (p(this, D), p(this, I, !1))), b(this, $, (p(this, V), p(this, L, null))), b(this, C, (p(this, F), p(this, H, !1))), this._language = (p(this, W), new K(this)), this._notAreaElements = [
34
34
  "DRIVER_AREA_FULL",
35
35
  "COACH_PASSAGE",
36
36
  "COACH_WALL_NO_PASSAGE",
@@ -47,19 +47,19 @@ let me = (() => {
47
47
  set seatReservation(e) {
48
48
  b(this, g, e);
49
49
  }
50
- /** The seat resvervation navigation can be toggled by this property */
50
+ /** The seat reservation navigation can be toggled by this property */
51
51
  get hasNavigation() {
52
- return R(this, f);
52
+ return R(this, m);
53
53
  }
54
54
  set hasNavigation(e) {
55
- b(this, f, e);
55
+ b(this, m, e);
56
56
  }
57
- /** controls the visual represention of seat reservation in a horizonal or vertical alignment */
57
+ /** Controls the visual representation of seat reservation in a horizonal or vertical alignment */
58
58
  get alignVertical() {
59
- return R(this, m);
59
+ return R(this, f);
60
60
  }
61
61
  set alignVertical(e) {
62
- b(this, m, e);
62
+ b(this, f, e);
63
63
  }
64
64
  /** Maximal number of possible clickable seats */
65
65
  get maxReservations() {
@@ -76,8 +76,7 @@ let me = (() => {
76
76
  b(this, C, e);
77
77
  }
78
78
  willUpdate(e) {
79
- var t, i;
80
- super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? (t = this.shadowRoot) == null || t.querySelectorAll("table").forEach((s) => s.removeAttribute("tabindex")) : (i = this.shadowRoot) == null || i.querySelectorAll("table").forEach((s) => s.setAttribute("tabindex", "0")));
79
+ super.willUpdate(e), e.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((t) => t.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((t) => t.setAttribute("tabindex", "0")));
81
80
  }
82
81
  firstUpdated(e) {
83
82
  super.firstUpdated(e), this._componentSetup();
@@ -89,9 +88,8 @@ let me = (() => {
89
88
  this.initNavigationSelectionByScrollEvent();
90
89
  }
91
90
  _initVehicleSeatReservationConstruction() {
92
- var i;
93
- const e = JSON.parse(JSON.stringify((i = this.seatReservation) == null ? void 0 : i.coachItems)), t = this.alignVertical ? "sbb-sr__wrapper--vertical" : "";
94
- this._coachesHtmlTemplate = h`
91
+ const e = JSON.parse(JSON.stringify(this.seatReservation?.coachItems)), t = this.alignVertical ? "sbb-sr__wrapper--vertical" : "";
92
+ this._coachesHtmlTemplate = d`
95
93
  <div>
96
94
  <sbb-screen-reader-only>
97
95
  <input
@@ -103,7 +101,7 @@ let me = (() => {
103
101
  />
104
102
  </sbb-screen-reader-only>
105
103
 
106
- <div @keydown=${(s) => this.handleKeyboardEvent(s)}>
104
+ <div @keydown=${(i) => this.handleKeyboardEvent(i)}>
107
105
  ${this._renderNavigation()}
108
106
  <div class="sbb-sr__wrapper ${t}">
109
107
  <div id="sbb-sr__parent-area" class="sbb-sr__parent" tabindex="-1">
@@ -127,33 +125,29 @@ let me = (() => {
127
125
  `;
128
126
  }
129
127
  _renderNavigation() {
130
- var e;
131
- return this.hasNavigation ? h`
132
- <nav class="${Q({ "sbb-sr-navigation--vertical": this.alignVertical })}">
128
+ return this.hasNavigation ? d`
129
+ <nav class="${Y({ "sbb-sr-navigation--vertical": this.alignVertical })}">
133
130
  <ul
134
131
  class="sbb-sr-navigation__list-coaches"
135
132
  aria-label="${_("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
136
133
  >
137
- ${(e = this.seatReservation) == null ? void 0 : e.coachItems.map((t, i) => {
138
- var s, a;
139
- return h`<li>
134
+ ${this.seatReservation?.coachItems.map((e, t) => d`<li>
140
135
  <sbb-seat-reservation-navigation-coach
141
- @selectCoach=${(r) => this._onSelectNavCoach(r)}
136
+ @selectCoach=${(i) => this._onSelectNavCoach(i)}
142
137
  @focusCoach=${() => this._onFocusNavCoach()}
143
- index="${i}"
144
- coach-id="${t.id}"
145
- .selected=${this.selectedCoachIndex === i}
146
- .focused=${this.focusedCoachIndex === i}
147
- .propertyIds="${t.propertyIds}"
148
- .travelClass="${t.travelClass}"
149
- ?driver-area="${!((s = t.places) != null && s.length)}"
150
- ?first="${i === 0}"
151
- ?last="${i === ((a = this.seatReservation) == null ? void 0 : a.coachItems.length) - 1}"
138
+ index="${t}"
139
+ coach-id="${e.id}"
140
+ .selected=${this.selectedCoachIndex === t}
141
+ .focused=${this.focusedCoachIndex === t}
142
+ .propertyIds="${e.propertyIds}"
143
+ .travelClass="${e.travelClass}"
144
+ ?driver-area="${!e.places?.length}"
145
+ ?first="${t === 0}"
146
+ ?last="${t === this.seatReservation?.coachItems.length - 1}"
152
147
  ?vertical="${this.alignVertical}"
153
148
  >
154
149
  </sbb-seat-reservation-navigation-coach>
155
- </li>`;
156
- })}
150
+ </li>`)}
157
151
  </ul>
158
152
  </nav>
159
153
  ` : null;
@@ -164,13 +158,13 @@ let me = (() => {
164
158
  * @returns
165
159
  */
166
160
  _renderCoaches(e) {
167
- return e ? e.map((t, i) => h`
161
+ return e ? e.map((t, i) => d`
168
162
  <li class="sbb-sr__item-coach">${this._renderCoachElement(t, i)}</li>
169
163
  `) : null;
170
164
  }
171
165
  _renderCoachElement(e, t) {
172
166
  const i = this.getCalculatedDimension(e.dimension), s = this._getDescriptionTableCoach(e);
173
- return h` <sbb-seat-reservation-scoped
167
+ return d` <sbb-seat-reservation-scoped
174
168
  scoped-classes="coach-wrapper"
175
169
  height="${i.h}px"
176
170
  width="${i.w}px"
@@ -192,16 +186,16 @@ let me = (() => {
192
186
  </sbb-seat-reservation-scoped>`;
193
187
  }
194
188
  _getRenderedCoachBorders(e, t) {
195
- const i = e.graphicElements, s = 1, a = i == null ? void 0 : i.find((v) => v.icon === "DRIVER_AREA_FULL"), r = a ? e.dimension.w - a.dimension.w - s : e.dimension.w - s * 2, l = t === 0 && a ? (a == null ? void 0 : a.dimension.w) * this.baseGridSize : this.baseGridSize;
196
- return h`
189
+ const i = e.graphicElements, s = 1, a = i?.find((v) => v.icon === "DRIVER_AREA_FULL"), n = a ? e.dimension.w - a.dimension.w - s : e.dimension.w - s * 2, h = t === 0 && a ? a?.dimension.w * this.baseGridSize : this.baseGridSize;
190
+ return d`
197
191
  <sbb-seat-reservation-scoped
198
192
  scoped-classes="coach-border"
199
193
  inset-block-start="${this.coachBorderPadding * -1}px"
200
- inset-inline-start="${l}px"
194
+ inset-inline-start="${h}px"
201
195
  >
202
196
  <sbb-seat-reservation-graphic
203
197
  name="COACH_BORDER_MIDDLE"
204
- width=${r * this.baseGridSize}
198
+ width=${n * this.baseGridSize}
205
199
  height=${(e.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize}
206
200
  ?stretch=${!0}
207
201
  role="presentation"
@@ -215,20 +209,20 @@ let me = (() => {
215
209
  const i = {};
216
210
  for (const s of e.places)
217
211
  i[s.position.y] ? i[s.position.y].push(s) : i[s.position.y] = [s];
218
- return Object.values(i).map((s, a) => h`
212
+ return Object.values(i).map((s, a) => d`
219
213
  <tr id="row-${t}-${s[0].position.y}" data-row-index=${a}>
220
214
  ${this._getRenderedColumnPlaces(s, t)}
221
215
  </tr>
222
216
  `).flatMap((s) => s);
223
217
  }
224
218
  _getRenderedColumnPlaces(e, t) {
225
- return e.sort((i, s) => Number(i.position.x) - Number(s.position.x)), e == null ? void 0 : e.map((i, s) => {
226
- const a = this.getCalculatedDimension(i.dimension), r = this.getCalculatedPosition(i.position), l = this.alignVertical ? -90 : 0;
227
- return h`
219
+ return e.sort((i, s) => Number(i.position.x) - Number(s.position.x)), e?.map((i, s) => {
220
+ const a = this.getCalculatedDimension(i.dimension), n = this.getCalculatedPosition(i.position), h = this.alignVertical ? -90 : 0;
221
+ return d`
228
222
  <sbb-seat-reservation-scoped
229
223
  scoped-classes="graphical-element"
230
- inset-block-start="${r.y}px"
231
- inset-inline-start="${r.x}px"
224
+ inset-block-start="${n.y}px"
225
+ inset-inline-start="${n.x}px"
232
226
  width="${a.w}px"
233
227
  height="${a.h}px"
234
228
  z-index="${i.position.z}"
@@ -246,7 +240,7 @@ let me = (() => {
246
240
  width=${i.dimension.w * this.baseGridSize}
247
241
  height=${i.dimension.h * this.baseGridSize}
248
242
  rotation=${i.rotation ?? A}
249
- text-rotation=${l}
243
+ text-rotation=${h}
250
244
  coach-index=${t}
251
245
  .propertyIds=${i.propertyIds}
252
246
  .preventClick=${this.preventPlaceClick}
@@ -256,16 +250,15 @@ let me = (() => {
256
250
  });
257
251
  }
258
252
  _getRenderedGraphicalElements(e, t) {
259
- return e ? e == null ? void 0 : e.map((i) => {
260
- const s = i.icon ?? "", a = i.rotation || 0, r = this._notFixedRotatableAreaIcons.indexOf(i.icon) === -1, l = this.alignVertical && r ? a - 90 : a;
261
- return this._notAreaElements.findIndex((v) => v === s) > -1 ? this._getRenderElementWithoutArea(i, a, t) : this._getRenderElementWithArea(i, l, t);
253
+ return e ? e?.map((i) => {
254
+ const s = i.icon ?? "", a = i.rotation || 0, n = this._notFixedRotatableAreaIcons.indexOf(i.icon) === -1, h = this.alignVertical && n ? a - 90 : a;
255
+ return this._notAreaElements.findIndex((v) => v === s) > -1 ? this._getRenderElementWithoutArea(i, a, t) : this._getRenderElementWithArea(i, h, t);
262
256
  }) : null;
263
257
  }
264
258
  _getRenderElementWithArea(e, t, i) {
265
- var U;
266
- const s = ((U = e.icon) == null ? void 0 : U.indexOf("TABLE")) === -1, a = e.icon && s ? e.icon : null, r = a !== "ENTRY_EXIT", l = e.icon ? _(e.icon, this._language.current) : A, v = this.getCalculatedDimension(e.dimension, i, !0, r), j = this.getCalculatedPosition(e.position, e.dimension, i, !0);
259
+ const s = e.icon?.indexOf("TABLE") === -1, a = e.icon && s ? e.icon : null, n = a !== "ENTRY_EXIT", h = e.icon ? _(e.icon, this._language.current) : A, v = this.getCalculatedDimension(e.dimension, i, !0, n), j = this.getCalculatedPosition(e.position, e.dimension, i, !0);
267
260
  let w = "free";
268
- return e.position.y === this.coachBorderOffset * -1 ? w = "upper-border" : e.position.y + e.dimension.h === i.h + this.coachBorderOffset && (w = "lower-border"), h`
261
+ return e.position.y === this.coachBorderOffset * -1 ? w = "upper-border" : e.position.y + e.dimension.h === i.h + this.coachBorderOffset && (w = "lower-border"), d`
269
262
  <sbb-seat-reservation-scoped
270
263
  scoped-classes="graphical-element"
271
264
  inset-block-start="${j.y}px"
@@ -275,16 +268,16 @@ let me = (() => {
275
268
  z-index="${e.position.z}"
276
269
  >
277
270
  <sbb-seat-reservation-area
278
- style=${Z({
271
+ style=${Q({
279
272
  "--sbb-reservation-area-width": e.dimension.w * this.baseGridSize,
280
273
  "--sbb-reservation-area-height": e.dimension.h * this.baseGridSize
281
274
  })}
282
275
  mounting=${w}
283
276
  background="dark"
284
277
  aria-hidden="true"
285
- title=${l}
278
+ title=${h}
286
279
  >
287
- ${a ? h`
280
+ ${a ? d`
288
281
  <sbb-seat-reservation-graphic
289
282
  name=${a}
290
283
  rotation=${t}
@@ -299,9 +292,8 @@ let me = (() => {
299
292
  `;
300
293
  }
301
294
  _getRenderElementWithoutArea(e, t, i) {
302
- var l;
303
- const s = this.getCalculatedDimension(e.dimension, i), a = this.getCalculatedPosition(e.position, e.dimension, i), r = e.icon && e.icon.indexOf("DRIVER_AREA") === -1 ? e.icon : (l = e.icon) == null ? void 0 : l.concat("_", this.seatReservation.vehicleType);
304
- return h`
295
+ const s = this.getCalculatedDimension(e.dimension, i), a = this.getCalculatedPosition(e.position, e.dimension, i), n = e.icon && e.icon.indexOf("DRIVER_AREA") === -1 ? e.icon : e.icon?.concat("_", this.seatReservation.vehicleType);
296
+ return d`
305
297
  <sbb-seat-reservation-scoped
306
298
  scoped-classes="graphical-element"
307
299
  inset-block-start="${a.y}px"
@@ -311,7 +303,7 @@ let me = (() => {
311
303
  z-index="${e.position.z}"
312
304
  >
313
305
  <sbb-seat-reservation-graphic
314
- name=${r ?? A}
306
+ name=${n ?? A}
315
307
  width=${e.dimension.w * this.baseGridSize}
316
308
  height=${e.dimension.h * this.baseGridSize}
317
309
  rotation=${t}
@@ -322,9 +314,9 @@ let me = (() => {
322
314
  `;
323
315
  }
324
316
  _getRenderedServiceElements(e) {
325
- return e ? e == null ? void 0 : e.map((t) => {
326
- const i = t.icon ? _(t.icon, this._language.current) : null, s = this.getCalculatedDimension(t.dimension), a = this.getCalculatedPosition(t.position), r = t.rotation || 0, l = this.alignVertical ? r - 90 : r;
327
- return h`
317
+ return e ? e?.map((t) => {
318
+ const i = t.icon ? _(t.icon, this._language.current) : null, s = this.getCalculatedDimension(t.dimension), a = this.getCalculatedPosition(t.position), n = t.rotation || 0, h = this.alignVertical ? n - 90 : n;
319
+ return d`
328
320
  <sbb-seat-reservation-scoped
329
321
  scoped-classes="graphical-element"
330
322
  inset-block-start="${a.y}px"
@@ -337,7 +329,7 @@ let me = (() => {
337
329
  name=${t.icon ?? A}
338
330
  width=${t.dimension.w * this.baseGridSize}
339
331
  height=${t.dimension.h * this.baseGridSize}
340
- .rotation=${l}
332
+ .rotation=${h}
341
333
  role="img"
342
334
  aria-hidden="true"
343
335
  title=${i ?? A}
@@ -353,7 +345,7 @@ let me = (() => {
353
345
  */
354
346
  _onSelectPlace(e) {
355
347
  const t = e.detail;
356
- this.preventCoachScrollByPlaceClick = !0, this.isCochGridFocusable = !1, this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(t), this.updateCurrentSelectedPlaceInCoach(t));
348
+ this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(t), this.updateCurrentSelectedPlaceInCoach(t));
357
349
  }
358
350
  _onSelectNavCoach(e) {
359
351
  const t = e.detail;
@@ -363,8 +355,7 @@ let me = (() => {
363
355
  this.preventCoachScrollByPlaceClick ? this.focusPlaceElement(this.currSelectedPlace) : this.preselectPlaceInCoach(), this.isAutoScrolling = !1;
364
356
  }
365
357
  _getDescriptionTableCoach(e) {
366
- var a;
367
- if (!((a = e.places) != null && a.length))
358
+ if (!e.places?.length)
368
359
  return _("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [
369
360
  e.id
370
361
  ]);
@@ -376,28 +367,28 @@ let me = (() => {
376
367
  }
377
368
  _getTitleDescriptionListString(e) {
378
369
  const t = [];
379
- return e == null ? void 0 : e.map((i) => {
370
+ return e?.map((i) => {
380
371
  const s = i.icon;
381
372
  if (!s)
382
373
  return null;
383
- const a = t.indexOf(s) > -1, r = _(i.icon, this._language.current), l = this._notFixedRotatableAreaIcons.indexOf(s) === -1 && this._notAreaElements.indexOf(s) === -1;
384
- return a || t.push(i.icon), r && !a && l ? r : null;
374
+ const a = t.indexOf(s) > -1, n = _(i.icon, this._language.current), h = this._notFixedRotatableAreaIcons.indexOf(s) === -1 && this._notAreaElements.indexOf(s) === -1;
375
+ return a || t.push(i.icon), n && !a && h ? n : null;
385
376
  }).filter((i) => !!i).join(", ");
386
377
  }
387
- }, g = new WeakMap(), f = new WeakMap(), m = new WeakMap(), $ = new WeakMap(), C = new WeakMap(), u = d, (() => {
378
+ }, g = new WeakMap(), m = new WeakMap(), f = new WeakMap(), $ = new WeakMap(), C = new WeakMap(), u = c, (() => {
388
379
  const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(N[Symbol.metadata] ?? null) : void 0;
389
- T = [y({ attribute: "seat-reservation", type: Object })], k = [P(), y({ attribute: "has-navigation", type: Boolean })], I = [P(), y({ attribute: "align-vertical", type: Boolean })], B = [P(), y({ attribute: "max-reservations", type: Number })], M = [P(), y({ attribute: "prevent-place-click", type: Boolean })], S(d, null, T, { kind: "accessor", name: "seatReservation", static: !1, private: !1, access: { has: (t) => "seatReservation" in t, get: (t) => t.seatReservation, set: (t, i) => {
380
+ T = [y({ attribute: "seat-reservation", type: Object })], E = [P(), y({ attribute: "has-navigation", type: Boolean })], G = [P(), y({ attribute: "align-vertical", type: Boolean })], B = [P(), y({ attribute: "max-reservations", type: Number })], M = [P(), y({ attribute: "prevent-place-click", type: Boolean })], S(c, null, T, { kind: "accessor", name: "seatReservation", static: !1, private: !1, access: { has: (t) => "seatReservation" in t, get: (t) => t.seatReservation, set: (t, i) => {
390
381
  t.seatReservation = i;
391
- } }, metadata: e }, z, O), S(d, null, k, { kind: "accessor", name: "hasNavigation", static: !1, private: !1, access: { has: (t) => "hasNavigation" in t, get: (t) => t.hasNavigation, set: (t, i) => {
382
+ } }, metadata: e }, z, O), S(c, null, E, { kind: "accessor", name: "hasNavigation", static: !1, private: !1, access: { has: (t) => "hasNavigation" in t, get: (t) => t.hasNavigation, set: (t, i) => {
392
383
  t.hasNavigation = i;
393
- } }, metadata: e }, D, G), S(d, null, I, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, i) => {
384
+ } }, metadata: e }, k, D), S(c, null, G, { kind: "accessor", name: "alignVertical", static: !1, private: !1, access: { has: (t) => "alignVertical" in t, get: (t) => t.alignVertical, set: (t, i) => {
394
385
  t.alignVertical = i;
395
- } }, metadata: e }, V, E), S(d, null, B, { kind: "accessor", name: "maxReservations", static: !1, private: !1, access: { has: (t) => "maxReservations" in t, get: (t) => t.maxReservations, set: (t, i) => {
386
+ } }, metadata: e }, I, V), S(c, null, B, { kind: "accessor", name: "maxReservations", static: !1, private: !1, access: { has: (t) => "maxReservations" in t, get: (t) => t.maxReservations, set: (t, i) => {
396
387
  t.maxReservations = i;
397
- } }, metadata: e }, L, F), S(d, null, M, { kind: "accessor", name: "preventPlaceClick", static: !1, private: !1, access: { has: (t) => "preventPlaceClick" in t, get: (t) => t.preventPlaceClick, set: (t, i) => {
388
+ } }, metadata: e }, L, F), S(c, null, M, { kind: "accessor", name: "preventPlaceClick", static: !1, private: !1, access: { has: (t) => "preventPlaceClick" in t, get: (t) => t.preventPlaceClick, set: (t, i) => {
398
389
  t.preventPlaceClick = i;
399
- } }, metadata: e }, H, W), S(null, o = { value: u }, n, { kind: "class", name: u.name, metadata: e }, null, c), u = o.value, e && Object.defineProperty(u, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
400
- })(), d.styles = te, p(u, c), u;
390
+ } }, metadata: e }, H, W), S(null, o = { value: u }, r, { kind: "class", name: u.name, metadata: e }, null, l), u = o.value, e && Object.defineProperty(u, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
391
+ })(), c.styles = ee, p(u, l), u;
401
392
  })();
402
393
  export {
403
394
  me as SbbSeatReservationElement
@@ -1,2 +1,5 @@
1
+ /**
2
+ * @entrypoint
3
+ */
1
4
  export * from './seat-reservation-area/seat-reservation-area.component.js';
2
5
  //# sourceMappingURL=seat-reservation-area.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"seat-reservation-area.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/seat-reservation/seat-reservation-area.ts"],"names":[],"mappings":"AAAA,cAAc,4DAA4D,CAAC"}
1
+ {"version":3,"file":"seat-reservation-area.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/seat-reservation/seat-reservation-area.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,4DAA4D,CAAC"}
@@ -1,16 +1,13 @@
1
1
  import { html as d } from "lit";
2
- import { unsafeHTML as s } from "lit/directives/unsafe-html.js";
3
- import { svgs as _, mapIconToSvg as r } from "../common.js";
2
+ import { unsafeHTML as a } from "lit/directives/unsafe-html.js";
3
+ import { svgs as e, mapIconToSvg as r } from "../common.js";
4
4
  import "@sbb-esta/lyne-elements/table.js";
5
5
  import "../seat-reservation-graphic.js";
6
6
  const E = (A) => d`
7
7
  <div class="story-asset">
8
- <span class="story-asset__preview">${s(A)}</span>
8
+ <span class="story-asset__preview">${a(A)}</span>
9
9
  </div>
10
- `, t = (A) => {
11
- var e, a;
12
- return (e = r[A]) != null && e.svg ? E(r[A].svg) : (a = r[A]) != null && a.svgName ? d`<sbb-icon name="${r[A].svgName}"></sbb-icon>` : null;
13
- }, R = d`
10
+ `, t = (A) => r[A]?.svg ? E(r[A].svg) : r[A]?.svgName ? d`<sbb-icon name="${r[A].svgName}"></sbb-icon>` : null, _ = d`
14
11
  <sbb-table-wrapper>
15
12
  <table class="sbb-table">
16
13
  <thead>
@@ -64,7 +61,7 @@ const E = (A) => d`
64
61
  </tbody>
65
62
  </table>
66
63
  </sbb-table-wrapper>
67
- `, o = d`
64
+ `, s = d`
68
65
  <sbb-table-wrapper>
69
66
  <table class="sbb-table">
70
67
  <thead>
@@ -133,7 +130,7 @@ const E = (A) => d`
133
130
  </tbody>
134
131
  </table>
135
132
  </sbb-table-wrapper>
136
- `, l = d`
133
+ `, R = d`
137
134
  <sbb-table-wrapper>
138
135
  <table aria-label="Available Service Icons" class="sbb-table">
139
136
  <thead>
@@ -212,7 +209,7 @@ const E = (A) => d`
212
209
  </tbody>
213
210
  </table>
214
211
  </sbb-table-wrapper>
215
- `, T = d`
212
+ `, o = d`
216
213
  <sbb-table-wrapper>
217
214
  <table class="sbb-table">
218
215
  <thead>
@@ -259,7 +256,7 @@ const E = (A) => d`
259
256
  <td>COACH_PASSAGE</td>
260
257
  </tr>
261
258
  <tr>
262
- <td>${E(_.chassisPassageWaggonBottomRight)}</td>
259
+ <td>${E(e.chassisPassageWaggonBottomRight)}</td>
263
260
  <td>Passage-Waggon Type: Right</td>
264
261
  <td
265
262
  style="background: linear-gradient(90deg, var(--sbb-color-white) 5%, var(--sbb-color-red));"
@@ -278,7 +275,7 @@ const E = (A) => d`
278
275
  <td>COACH_BORDER_MIDDLE</td>
279
276
  </tr>
280
277
  <tr>
281
- <td>${E(_.chassisSeparator)}</td>
278
+ <td>${E(e.chassisSeparator)}</td>
282
279
  <td>Separator</td>
283
280
  <td
284
281
  style="background: linear-gradient(90deg, var(--sbb-color-white) 5%, var(--sbb-color-red))"
@@ -294,7 +291,7 @@ const E = (A) => d`
294
291
  </tbody>
295
292
  </table>
296
293
  </sbb-table-wrapper>
297
- `, I = d`
294
+ `, L = d`
298
295
  <style>
299
296
  .story-asset {
300
297
  width: max-content;
@@ -303,15 +300,15 @@ const E = (A) => d`
303
300
  </style>
304
301
  <h1>List of all currently available assets.</h1>
305
302
  <h2>Interior</h2>
306
- ${R}
303
+ ${_}
307
304
  <h2>Layout</h2>
308
- ${o}
305
+ ${s}
309
306
  <h2>Service Icons</h2>
310
- ${l}
307
+ ${R}
311
308
  <h2>Chassis</h2>
312
- ${T}
309
+ ${o}
313
310
  `;
314
311
  export {
315
- I as assetsTemplate,
312
+ L as assetsTemplate,
316
313
  t as svgImageByOSDMCode
317
314
  };