@sbb-esta/lyne-elements-experimental-dev 4.8.1-dev.1774250635 → 4.8.1-dev.1774266612

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 (27) hide show
  1. package/custom-elements.json +70 -2
  2. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +3 -0
  3. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  4. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +30 -2
  5. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  6. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +1 -1
  7. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +1 -1
  8. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +1 -1
  9. package/development/seat-reservation/seat-reservation-graphic.js +1 -1
  10. package/development/seat-reservation/seat-reservation.js +1 -1
  11. package/development/seat-reservation-graphic.component-D0xEXmP9.js +203 -0
  12. package/development/{seat-reservation.component-MOv5kHDC.js → seat-reservation.component-BS53sZR3.js} +8 -5
  13. package/development/seat-reservation.js +2 -2
  14. package/development/seat-reservation.pure.js +2 -2
  15. package/package.json +2 -2
  16. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +24 -4
  17. package/seat-reservation/seat-reservation/seat-reservation.component.js +1 -1
  18. package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +1 -1
  19. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +1 -1
  20. package/seat-reservation/seat-reservation-graphic.js +1 -1
  21. package/seat-reservation/seat-reservation.js +1 -1
  22. package/seat-reservation-graphic.component-DCMFf9uY.js +102 -0
  23. package/{seat-reservation.component-DXAhxaI0.js → seat-reservation.component-Dl6bnC7-.js} +7 -4
  24. package/seat-reservation.js +2 -2
  25. package/seat-reservation.pure.js +2 -2
  26. package/development/seat-reservation-graphic.component-lZXqHWIz.js +0 -193
  27. package/seat-reservation-graphic.component-CjqYuXjL.js +0 -102
@@ -3,14 +3,14 @@ import { mapIconToSvg } from "./seat-reservation/common/mapper/icon-mapper.js";
3
3
  import { t as svgs } from "./svgs-kDpBCto5.js";
4
4
  import { getI18nSeatReservation } from "./seat-reservation/common/translations/i18n.js";
5
5
  import { t as SbbSeatReservationAreaElement } from "./seat-reservation-area.component-ORuli_DC.js";
6
- import { t as SbbSeatReservationGraphicElement } from "./seat-reservation-graphic.component-lZXqHWIz.js";
6
+ import { t as SbbSeatReservationGraphicElement } from "./seat-reservation-graphic.component-D0xEXmP9.js";
7
7
  import { assetsTemplate, svgImageByOSDMCode } from "./seat-reservation/seat-reservation-graphic/seat-reservation-assets.js";
8
8
  import { t as SbbSeatReservationNavigationCoachElement } from "./seat-reservation-navigation-coach.component-D2QXTMJJ.js";
9
9
  import { t as SbbSeatReservationNavigationServicesElement } from "./seat-reservation-navigation-services.component-Bg1adRlU.js";
10
10
  import { t as SbbSeatReservationPlaceControlElement } from "./seat-reservation-place-control.component-CwUX-QYO.js";
11
11
  import { t as SbbSeatReservationScopedElement } from "./seat-reservation-scoped.component-uLT33P9y.js";
12
12
  import { SeatReservationBaseElement } from "./seat-reservation/seat-reservation/seat-reservation-base-element.js";
13
- import { t as SbbSeatReservationElement } from "./seat-reservation.component-MOv5kHDC.js";
13
+ import { t as SbbSeatReservationElement } from "./seat-reservation.component-BS53sZR3.js";
14
14
  import "./seat-reservation.pure.js";
15
15
  //#region src/elements-experimental/seat-reservation.ts
16
16
  /** @entrypoint */
@@ -4,12 +4,12 @@ import "./seat-reservation/common/mapper.js";
4
4
  import { t as svgs } from "./svgs-kDpBCto5.js";
5
5
  import { getI18nSeatReservation } from "./seat-reservation/common/translations/i18n.js";
6
6
  import { t as SbbSeatReservationAreaElement } from "./seat-reservation-area.component-ORuli_DC.js";
7
- import { t as SbbSeatReservationGraphicElement } from "./seat-reservation-graphic.component-lZXqHWIz.js";
7
+ import { t as SbbSeatReservationGraphicElement } from "./seat-reservation-graphic.component-D0xEXmP9.js";
8
8
  import { assetsTemplate, svgImageByOSDMCode } from "./seat-reservation/seat-reservation-graphic/seat-reservation-assets.js";
9
9
  import { t as SbbSeatReservationNavigationCoachElement } from "./seat-reservation-navigation-coach.component-D2QXTMJJ.js";
10
10
  import { t as SbbSeatReservationNavigationServicesElement } from "./seat-reservation-navigation-services.component-Bg1adRlU.js";
11
11
  import { t as SbbSeatReservationPlaceControlElement } from "./seat-reservation-place-control.component-CwUX-QYO.js";
12
12
  import { t as SbbSeatReservationScopedElement } from "./seat-reservation-scoped.component-uLT33P9y.js";
13
13
  import { SeatReservationBaseElement } from "./seat-reservation/seat-reservation/seat-reservation-base-element.js";
14
- import { t as SbbSeatReservationElement } from "./seat-reservation.component-MOv5kHDC.js";
14
+ import { t as SbbSeatReservationElement } from "./seat-reservation.component-BS53sZR3.js";
15
15
  export { SbbSeatReservationAreaElement, SbbSeatReservationElement, SbbSeatReservationGraphicElement, SbbSeatReservationNavigationCoachElement, SbbSeatReservationNavigationServicesElement, SbbSeatReservationPlaceControlElement, SbbSeatReservationScopedElement, SeatReservationBaseElement, assetsTemplate, getI18nSeatReservation, mapCoachInfosToCoachSelection, mapIconToSvg, mapPlaceAndCoachToSeatReservationPlaceSelection, mapPlaceInfosToPlaceSelection, mapRawDataToSeatReservation, svgImageByOSDMCode, svgs };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sbb-esta/lyne-elements-experimental-dev",
3
- "version": "4.8.1-dev.1774250635",
3
+ "version": "4.8.1-dev.1774266612",
4
4
  "description": "Lyne Design System",
5
5
  "keywords": [
6
6
  "design system",
7
7
  "web components",
8
8
  "lit",
9
9
  "storybook",
10
- "https://github.com/sbb-design-systems/lyne-components/commit/bffc26b7eef7b4df53616ef8b57c156c345c4ddf"
10
+ "https://github.com/sbb-design-systems/lyne-components/commit/f8055af23b6c4453b82393888a29dbadd5871118"
11
11
  ],
12
12
  "type": "module",
13
13
  "exports": {
@@ -362,7 +362,10 @@ var ie = 3, ae = [
362
362
  this.#p = e;
363
363
  }
364
364
  constructor() {
365
- super(), this.#e = (t(this, d), t(this, p, null)), this.#t = (t(this, m), t(this, g, "NONE")), this.#n = (t(this, _), t(this, y, !0)), this.#r = (t(this, b), t(this, S, !1)), this.#i = (t(this, C), t(this, T, 16)), this.#a = (t(this, E), t(this, O, null)), this.#o = (t(this, oe), t(this, A, -1)), this.#s = (t(this, j), t(this, N, -1)), this.#c = (t(this, P), t(this, I, !1)), this.#l = (t(this, L), t(this, z, -1)), this.#u = (t(this, B), t(this, H, !1)), this.#d = (t(this, U), t(this, G, -1)), this.#f = (t(this, K), t(this, J, -1)), this.#p = (t(this, Y), t(this, Z, -1)), this.coachBorderPadding = (t(this, Q), 6), this.gapBetweenCoaches = 4, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.gapBetweenCoachDecks = 48, this.coachNavButtonDim = 0, this.coachItemDetailsElements = [], this.currScrollDirection = l.right, this.maxCalcCoachesWidth = 0, this.scrollCoachesAreaWidth = 0, this.scrollNavigationAreaDim = 0, this.triggerCoachPositionsCollection = [], this.navigationScrollArea = null, this.coachScrollArea = null, this.currSelectedPlace = null, this.currSelectedPlaceElementId = null, this.currSelectedCoachIndex = -1, this.currSelectedDeckIndex = 0, this.preventCoachScrollByPlaceClick = !1, this.selectedSeatReservationPlaces = {
365
+ super(), this.#e = (t(this, d), t(this, p, null)), this.#t = (t(this, m), t(this, g, "NONE")), this.#n = (t(this, _), t(this, y, !0)), this.#r = (t(this, b), t(this, S, !1)), this.#i = (t(this, C), t(this, T, 16)), this.#a = (t(this, E), t(this, O, null)), this.#o = (t(this, oe), t(this, A, -1)), this.#s = (t(this, j), t(this, N, -1)), this.#c = (t(this, P), t(this, I, !1)), this.#l = (t(this, L), t(this, z, -1)), this.#u = (t(this, B), t(this, H, !1)), this.#d = (t(this, U), t(this, G, -1)), this.#f = (t(this, K), t(this, J, -1)), this.#p = (t(this, Y), t(this, Z, -1)), this.coachBorderPadding = (t(this, Q), 6), this.gapBetweenCoaches = 4, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.gapBetweenCoachDecks = 48, this.coachNavButtonDim = 0, this.globalAreaIconDim = {
366
+ w: 2,
367
+ h: 2
368
+ }, this.globalAreaIconPadding = .8, this.coachItemDetailsElements = [], this.currScrollDirection = l.right, this.maxCalcCoachesWidth = 0, this.scrollCoachesAreaWidth = 0, this.scrollNavigationAreaDim = 0, this.triggerCoachPositionsCollection = [], this.navigationScrollArea = null, this.coachScrollArea = null, this.currSelectedPlace = null, this.currSelectedPlaceElementId = null, this.currSelectedCoachIndex = -1, this.currSelectedDeckIndex = 0, this.preventCoachScrollByPlaceClick = !1, this.selectedSeatReservationPlaces = {
366
369
  seats: [],
367
370
  bicycles: []
368
371
  }, this.seatReservationWithoutNavigationHasFocus = !1, this.isCoachGridFocusable = !1, this.isAutoScrolling = !1, this.isKeyboardNavigation = !1, this.hasMultipleDecks = !1, this.hasSeatReservationNativeFocus = !1, this.keyboardNavigationEvents = {
@@ -380,7 +383,8 @@ var ie = 3, ae = [
380
383
  "COMPARTMENT_PASSAGE",
381
384
  "COMPARTMENT_PASSAGE_HIGH",
382
385
  "COMPARTMENT_PASSAGE_MIDDLE",
383
- "COMPARTMENT_PASSAGE_LOW"
386
+ "COMPARTMENT_PASSAGE_LOW",
387
+ "COMPARTMENT_WALL"
384
388
  ], this.overHangingElementInformation = [], this._isRunningInitPreselectCoachIndex = !1, this._lastStartScrollPos = -1, this._prepareServiceIconsNavigation = (e) => e && e?.map(function(e) {
385
389
  return {
386
390
  pId: e,
@@ -391,7 +395,7 @@ var ie = 3, ae = [
391
395
  willUpdate(e) {
392
396
  if (super.willUpdate(e), e.has("seatReservations") && (this.hasMultipleDecks = this.seatReservations?.length > 1, this._initPrepareSeatReservationData(), this._prepareCoachWidthAndGapCalculations(), this._initSeatReservationPlaceSelection(), this.initNavigationSelectionByScrollEvent()), e.has("baseGridSize") && (this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this.initNavigationSelectionByScrollEvent()), e.has("height") && this.height) {
393
397
  let e = this.seatReservations[this.currSelectedDeckIndex] || null;
394
- e?.coachItems.length && (this.baseGridSize = this.height / e.coachItems[0].dimension.h, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this.initNavigationSelectionByScrollEvent());
398
+ e?.coachItems.length && (this.baseGridSize = this.height / e.coachItems[0].dimension.h, this.coachBorderOffset = this.coachBorderPadding / this.baseGridSize, this.style?.setProperty("--sbb-seat-reservation-grid-size", `${this.baseGridSize}px`), this._initPrepareSeatReservationData(), this.initNavigationSelectionByScrollEvent());
395
399
  }
396
400
  e.has("alignVertical") && this.alignVertical && this.initNavigationSelectionByScrollEvent(), e.has("preselectCoachIndex") && (this._isRunningInitPreselectCoachIndex = !0, setTimeout(() => this.scrollToSelectedNavCoach(this.preselectCoachIndex), 1));
397
401
  }
@@ -401,7 +405,7 @@ var ie = 3, ae = [
401
405
  e == "DIRECTION_LEFT" && t > 0 ? t = this.currSelectedCoachIndex == -1 ? 0 : this.currSelectedCoachIndex - 1 : e == "DIRECTION_RIGHT" && t < this.seatReservations[this.currSelectedDeckIndex]?.coachItems.length - 1 && (t = this.currSelectedCoachIndex == -1 ? 0 : this.currSelectedCoachIndex + 1), this.scrollToSelectedNavCoach(t);
402
406
  }
403
407
  _initPrepareSeatReservationData() {
404
- this._determineBaseFontSize(), this.hasMultipleDecks && this._initEmptyCoachDeckOffsets(), this._prepareCoachItemDetailsData();
408
+ this._determineBaseFontSize(), this.hasMultipleDecks && this._initEmptyCoachDeckOffsets(), this._prepareCoachItemDetailsData(), this._prepareOptimizeAreaIconDimensionByMedian();
405
409
  }
406
410
  initNavigationSelectionByScrollEvent() {
407
411
  this.coachScrollArea = this.shadowRoot?.querySelector("#sbb-sr__wrapper-scrollarea"), this.navigationScrollArea = this.shadowRoot?.querySelector("#sbb-sr__navigation-list-coaches");
@@ -767,6 +771,22 @@ var ie = 3, ae = [
767
771
  });
768
772
  }
769
773
  }
774
+ _prepareOptimizeAreaIconDimensionByMedian() {
775
+ if (this.seatReservations) {
776
+ let e = [];
777
+ if (this.seatReservations.forEach((t) => t.coachItems.forEach((t) => t.serviceElements?.forEach((t) => e.push(t.dimension)))), e.length) {
778
+ e.sort((e, t) => {
779
+ if (e && t) {
780
+ let n = e.w + e.h, r = t.w + t.h;
781
+ return n > r ? 1 : n < r ? -1 : 0;
782
+ }
783
+ return 0;
784
+ });
785
+ let t = e[Math.floor(e.length / 2)];
786
+ this.globalAreaIconDim = this.getCalculatedDimension(t);
787
+ }
788
+ }
789
+ }
770
790
  _prepareTravelClassNavigation(e) {
771
791
  return e.indexOf("FIRST") === -1 ? e.indexOf("SECOND") === -1 ? "ANY_CLASS" : "SECOND" : "FIRST";
772
792
  }
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../seat-reservation.component-DXAhxaI0.js";
1
+ import { t as e } from "../../seat-reservation.component-Dl6bnC7-.js";
2
2
  export { e as SbbSeatReservationElement };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../seat-reservation-graphic.component-CjqYuXjL.js";
1
+ import { t as e } from "../../seat-reservation-graphic.component-DCMFf9uY.js";
2
2
  import { html as t } from "lit";
3
3
  import { unsafeHTML as n } from "lit/directives/unsafe-html.js";
4
4
  import { mapIconToSvg as r } from "../common/mapper.js";
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../seat-reservation-graphic.component-CjqYuXjL.js";
1
+ import { t as e } from "../../seat-reservation-graphic.component-DCMFf9uY.js";
2
2
  export { e as SbbSeatReservationGraphicElement };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../seat-reservation-graphic.component-CjqYuXjL.js";
1
+ import { t as e } from "../seat-reservation-graphic.component-DCMFf9uY.js";
2
2
  e.define(), console.warn("The entrypoint '@sbb-esta/elements-experimental/seat-reservation/seat-reservation-graphic.js' has been deprecated.\nUse either '@sbb-esta/elements-experimental/seat-reservation.js' or '@sbb-esta/elements-experimental/seat-reservation.pure.js' instead.");
3
3
  //#endregion
4
4
  export { e as SbbSeatReservationGraphicElement };
@@ -1,5 +1,5 @@
1
1
  import { SeatReservationBaseElement as e } from "./seat-reservation/seat-reservation-base-element.js";
2
- import { t } from "../seat-reservation.component-DXAhxaI0.js";
2
+ import { t } from "../seat-reservation.component-Dl6bnC7-.js";
3
3
  t.define(), console.warn("The entrypoint '@sbb-esta/elements-experimental/seat-reservation/seat-reservation.js' has been deprecated.\nUse either '@sbb-esta/elements-experimental/seat-reservation.js' or '@sbb-esta/elements-experimental/seat-reservation.pure.js' instead.");
4
4
  //#endregion
5
5
  export { t as SbbSeatReservationElement, e as SeatReservationBaseElement };
@@ -0,0 +1,102 @@
1
+ import { __esDecorate as e, __runInitializers as t } from "tslib";
2
+ import { SbbElement as n } from "@sbb-esta/lyne-elements/core/base-elements.js";
3
+ import { SbbLanguageController as r } from "@sbb-esta/lyne-elements/core/controllers.js";
4
+ import { forceType as i } from "@sbb-esta/lyne-elements/core/decorators.js";
5
+ import { boxSizingStyles as a } from "@sbb-esta/lyne-elements/core/styles.js";
6
+ import "@sbb-esta/lyne-elements/icon.js";
7
+ import { css as o, html as s, isServer as c } from "lit";
8
+ import { property as l } from "lit/decorators.js";
9
+ import { mapIconToSvg as u } from "./seat-reservation/common/mapper.js";
10
+ import { classMap as d } from "lit/directives/class-map.js";
11
+ import { getI18nSeatReservation as f } from "./seat-reservation/common/translations.js";
12
+ //#region src/elements-experimental/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.scss?lit&inline
13
+ var p = o`:host{--sbb-seat-reservation-graphic-max-width: auto;--sbb-seat-reservation-graphic-max-height: auto;--sbb-seat-reservation-graphic-width: 16;--sbb-seat-reservation-graphic-height: 16;--sbb-seat-reservation-graphic-rotation: 0;--sbb-seat-reservation-graphic-inverse-rotation: 0;--sbb-seat-reservation-graphic-padding-percent: 1;--sbb-seat-reservation-graphic-position: initial;--sbb-seat-reservation-graphic-left: 0;--sbb-seat-reservation-graphic-top: 0;--sbb-icon-svg-width: calc( var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem) );--sbb-icon-svg-height: calc( var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem) );display:flex;justify-content:center;align-items:center;width:calc(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:calc(var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));position:var(--sbb-seat-reservation-graphic-position);inset-inline-start:calc(var(--sbb-seat-reservation-graphic-left) * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-block-start:calc(var(--sbb-seat-reservation-graphic-top) * var(--sbb-seat-reservation-one-px-rem, .0625rem))}:host(.auto-width){--sbb-icon-svg-width: auto;max-width:calc(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:auto}:host(.sbb-sr-graphic__dimension--square-dim){--sbb-icon-svg-width: min(min(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem), var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) * var(--sbb-seat-reservation-graphic-padding-percent), min(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem), var(--sbb-seat-reservation-graphic-max-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)));--sbb-icon-svg-height: min(min(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem), var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) * var(--sbb-seat-reservation-graphic-padding-percent), min(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem), var(--sbb-seat-reservation-graphic-max-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)));width:min(min(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem),var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) * var(--sbb-seat-reservation-graphic-padding-percent),min(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem),var(--sbb-seat-reservation-graphic-max-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)));height:min(min(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem),var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) * var(--sbb-seat-reservation-graphic-padding-percent),min(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem),var(--sbb-seat-reservation-graphic-max-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem)))}:host(.sbb-seat-reservation-graphic--cursor-pointer){cursor:var(--sbb-cursor-pointer)}.sbb-sr-icon,.sbb-sr-graphic{width:inherit;height:inherit;transform-origin:center;rotate:calc(var(--sbb-seat-reservation-graphic-rotation) * 1deg)}.sbb-sr-icon{color:var(--sbb-color-granite);color:light-dark(var(--sbb-color-granite),var(--sbb-color-graphite))}.sbb-sr-graphic svg{width:100%;height:100%}.sbb-sr-graphic svg .fix-rotation-inverse{transform-origin:center;rotate:calc(var(--sbb-seat-reservation-graphic-inverse-rotation) * 1deg)}@media(forced-colors:active){.sbb-sr-graphic svg:not(.color-immutable) [fill]:not([fill=none]){fill:currentcolor}.sbb-sr-graphic .no-bg{fill:transparent}}`, m = (() => {
14
+ let o = n, m, h = [], g = [], _, v = [], y = [];
15
+ return class extends o {
16
+ constructor() {
17
+ super(...arguments), this.#e = t(this, h, ""), this.#t = (t(this, g), t(this, v, !1)), this._language = (t(this, y), new r(this));
18
+ }
19
+ static {
20
+ let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
21
+ m = [i(), l({ attribute: "name" })], _ = [i(), l({
22
+ attribute: "stretch",
23
+ type: Boolean
24
+ })], e(this, null, m, {
25
+ kind: "accessor",
26
+ name: "name",
27
+ static: !1,
28
+ private: !1,
29
+ access: {
30
+ has: (e) => "name" in e,
31
+ get: (e) => e.name,
32
+ set: (e, t) => {
33
+ e.name = t;
34
+ }
35
+ },
36
+ metadata: t
37
+ }, h, g), e(this, null, _, {
38
+ kind: "accessor",
39
+ name: "stretch",
40
+ static: !1,
41
+ private: !1,
42
+ access: {
43
+ has: (e) => "stretch" in e,
44
+ get: (e) => e.stretch,
45
+ set: (e, t) => {
46
+ e.stretch = t;
47
+ }
48
+ },
49
+ metadata: t
50
+ }, v, y), t && Object.defineProperty(this, Symbol.metadata, {
51
+ enumerable: !0,
52
+ configurable: !0,
53
+ writable: !0,
54
+ value: t
55
+ });
56
+ }
57
+ static {
58
+ this.elementName = "sbb-seat-reservation-graphic";
59
+ }
60
+ static {
61
+ this.styles = [a, p];
62
+ }
63
+ #e;
64
+ get name() {
65
+ return this.#e;
66
+ }
67
+ set name(e) {
68
+ this.#e = e;
69
+ }
70
+ #t;
71
+ get stretch() {
72
+ return this.#t;
73
+ }
74
+ set stretch(e) {
75
+ this.#t = e;
76
+ }
77
+ render() {
78
+ let e = u[this.name];
79
+ return !e?.svg && !e?.svgName ? null : s`<span
80
+ class="${d({
81
+ "sbb-sr-icon": !!e.svgName,
82
+ "sbb-sr-graphic": !!e.svg
83
+ })}"
84
+ >
85
+ ${e.svgName ? s` <sbb-icon
86
+ name="${e.svgName || ""}"
87
+ aria-hidden="false"
88
+ aria-label="${f(e.svgName, this._language.current)}"
89
+ ></sbb-icon>` : s`${this._getSvgElement(e.svg)}`}
90
+ </span>`;
91
+ }
92
+ _getSvgElement(e) {
93
+ if (!c) {
94
+ let t = new DOMParser(), n = e || "<svg></svg>", r = t.parseFromString(n, "image/svg+xml").firstElementChild;
95
+ return this.stretch && r?.nodeName.toLowerCase() === "svg" && r.setAttribute("preserveAspectRatio", "none"), r;
96
+ }
97
+ return null;
98
+ }
99
+ };
100
+ })();
101
+ //#endregion
102
+ export { m as t };
@@ -266,14 +266,17 @@ var _ = class extends e {
266
266
  ${d ? i`
267
267
  <sbb-seat-reservation-graphic
268
268
  style=${s({
269
- "--sbb-seat-reservation-graphic-max-width": m.w,
270
- "--sbb-seat-reservation-graphic-height": this.baseGridSize,
271
- "--sbb-seat-reservation-graphic-rotation": t
269
+ "--sbb-seat-reservation-graphic-max-width": this.globalAreaIconDim.w,
270
+ "--sbb-seat-reservation-graphic-max-height": this.globalAreaIconDim.h,
271
+ "--sbb-seat-reservation-graphic-width": m.w,
272
+ "--sbb-seat-reservation-graphic-height": m.h,
273
+ "--sbb-seat-reservation-graphic-rotation": t,
274
+ "--sbb-seat-reservation-graphic-padding-percent": d === "ENTRY_EXIT" ? 1 : this.globalAreaIconPadding
272
275
  })}
273
276
  name=${d}
274
277
  role="img"
275
278
  aria-hidden="true"
276
- class="auto-width"
279
+ class="sbb-sr-graphic__dimension--square-dim"
277
280
  ></sbb-seat-reservation-graphic>
278
281
  ` : o}
279
282
  </sbb-seat-reservation-area>
@@ -3,14 +3,14 @@ import { mapIconToSvg as i } from "./seat-reservation/common/mapper/icon-mapper.
3
3
  import { t as a } from "./svgs-D5DhLHxC.js";
4
4
  import { getI18nSeatReservation as o } from "./seat-reservation/common/translations/i18n.js";
5
5
  import { t as s } from "./seat-reservation-area.component-CY56r75x.js";
6
- import { t as c } from "./seat-reservation-graphic.component-CjqYuXjL.js";
6
+ import { t as c } from "./seat-reservation-graphic.component-DCMFf9uY.js";
7
7
  import { assetsTemplate as l, svgImageByOSDMCode as u } from "./seat-reservation/seat-reservation-graphic/seat-reservation-assets.js";
8
8
  import { t as d } from "./seat-reservation-navigation-coach.component-CXUv1pZM.js";
9
9
  import { t as f } from "./seat-reservation-navigation-services.component-ViyU_adt.js";
10
10
  import { t as p } from "./seat-reservation-place-control.component-Dj5Tm0Oa.js";
11
11
  import { t as m } from "./seat-reservation-scoped.component-CuACI8ST.js";
12
12
  import { SeatReservationBaseElement as h } from "./seat-reservation/seat-reservation/seat-reservation-base-element.js";
13
- import { t as g } from "./seat-reservation.component-DXAhxaI0.js";
13
+ import { t as g } from "./seat-reservation.component-Dl6bnC7-.js";
14
14
  import "./seat-reservation.pure.js";
15
15
  g.define(), s.define(), c.define(), d.define(), f.define(), p.define(), m.define();
16
16
  //#endregion
@@ -4,12 +4,12 @@ import "./seat-reservation/common/mapper.js";
4
4
  import { t as a } from "./svgs-D5DhLHxC.js";
5
5
  import { getI18nSeatReservation as o } from "./seat-reservation/common/translations/i18n.js";
6
6
  import { t as s } from "./seat-reservation-area.component-CY56r75x.js";
7
- import { t as c } from "./seat-reservation-graphic.component-CjqYuXjL.js";
7
+ import { t as c } from "./seat-reservation-graphic.component-DCMFf9uY.js";
8
8
  import { assetsTemplate as l, svgImageByOSDMCode as u } from "./seat-reservation/seat-reservation-graphic/seat-reservation-assets.js";
9
9
  import { t as d } from "./seat-reservation-navigation-coach.component-CXUv1pZM.js";
10
10
  import { t as f } from "./seat-reservation-navigation-services.component-ViyU_adt.js";
11
11
  import { t as p } from "./seat-reservation-place-control.component-Dj5Tm0Oa.js";
12
12
  import { t as m } from "./seat-reservation-scoped.component-CuACI8ST.js";
13
13
  import { SeatReservationBaseElement as h } from "./seat-reservation/seat-reservation/seat-reservation-base-element.js";
14
- import { t as g } from "./seat-reservation.component-DXAhxaI0.js";
14
+ import { t as g } from "./seat-reservation.component-Dl6bnC7-.js";
15
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, r as mapCoachInfosToCoachSelection, i as mapIconToSvg, t as mapPlaceAndCoachToSeatReservationPlaceSelection, n as mapPlaceInfosToPlaceSelection, e as mapRawDataToSeatReservation, u as svgImageByOSDMCode, a as svgs };
@@ -1,193 +0,0 @@
1
- import { __esDecorate, __runInitializers } from "tslib";
2
- import { SbbElement } from "@sbb-esta/lyne-elements/core/base-elements.js";
3
- import { SbbLanguageController } from "@sbb-esta/lyne-elements/core/controllers.js";
4
- import { forceType } from "@sbb-esta/lyne-elements/core/decorators.js";
5
- import { boxSizingStyles } from "@sbb-esta/lyne-elements/core/styles.js";
6
- import "@sbb-esta/lyne-elements/icon.js";
7
- import { css, html, isServer } from "lit";
8
- import { property } from "lit/decorators.js";
9
- import { mapIconToSvg } from "./seat-reservation/common/mapper.js";
10
- import { classMap } from "lit/directives/class-map.js";
11
- import { getI18nSeatReservation } from "./seat-reservation/common/translations.js";
12
- //#region src/elements-experimental/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.scss?lit&inline
13
- var seat_reservation_graphic_default = css`:host {
14
- --sbb-seat-reservation-graphic-width: 16;
15
- --sbb-seat-reservation-graphic-height: 16;
16
- --sbb-seat-reservation-graphic-rotation: 0;
17
- --sbb-seat-reservation-graphic-inverse-rotation: 0;
18
- --sbb-seat-reservation-graphic-position: initial;
19
- --sbb-seat-reservation-graphic-left: 0;
20
- --sbb-seat-reservation-graphic-top: 0;
21
- --sbb-icon-svg-width: calc(
22
- var(--sbb-seat-reservation-graphic-width) *
23
- var(--sbb-seat-reservation-one-px-rem, 0.0625rem)
24
- );
25
- --sbb-icon-svg-height: calc(
26
- var(--sbb-seat-reservation-graphic-height) *
27
- var(--sbb-seat-reservation-one-px-rem, 0.0625rem)
28
- );
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
- width: calc(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));
33
- height: calc(var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));
34
- position: var(--sbb-seat-reservation-graphic-position);
35
- inset-inline-start: calc(var(--sbb-seat-reservation-graphic-left) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));
36
- inset-block-start: calc(var(--sbb-seat-reservation-graphic-top) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));
37
- }
38
-
39
- :host(.auto-width) {
40
- --sbb-icon-svg-width: auto;
41
- max-width: calc(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));
42
- width: auto;
43
- }
44
-
45
- :host(.sbb-seat-reservation-graphic--cursor-pointer) {
46
- cursor: var(--sbb-cursor-pointer);
47
- }
48
-
49
- .sbb-sr-icon,
50
- .sbb-sr-graphic {
51
- width: inherit;
52
- height: inherit;
53
- transform-origin: center;
54
- rotate: calc(var(--sbb-seat-reservation-graphic-rotation) * 1deg);
55
- }
56
-
57
- .sbb-sr-icon {
58
- color: var(--sbb-color-granite);
59
- color: light-dark(var(--sbb-color-granite), var(--sbb-color-graphite));
60
- }
61
-
62
- .sbb-sr-graphic svg {
63
- width: 100%;
64
- height: 100%;
65
- }
66
- .sbb-sr-graphic svg .fix-rotation-inverse {
67
- transform-origin: center;
68
- rotate: calc(var(--sbb-seat-reservation-graphic-inverse-rotation) * 1deg);
69
- }
70
- @media (forced-colors: active) {
71
- .sbb-sr-graphic svg:not(.color-immutable) [fill]:not([fill=none]) {
72
- fill: currentcolor;
73
- }
74
- .sbb-sr-graphic .no-bg {
75
- fill: transparent;
76
- }
77
- }`;
78
- //#endregion
79
- //#region src/elements-experimental/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.ts
80
- /**
81
- * Output one of the SVG graphics based on its code.
82
- */
83
- var SbbSeatReservationGraphicElement = (() => {
84
- let _classSuper = SbbElement;
85
- let _name_decorators;
86
- let _name_initializers = [];
87
- let _name_extraInitializers = [];
88
- let _stretch_decorators;
89
- let _stretch_initializers = [];
90
- let _stretch_extraInitializers = [];
91
- return class SbbSeatReservationGraphicElement extends _classSuper {
92
- constructor() {
93
- super(...arguments);
94
- this.#name_accessor_storage = __runInitializers(this, _name_initializers, "");
95
- this.#stretch_accessor_storage = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _stretch_initializers, false));
96
- this._language = (__runInitializers(this, _stretch_extraInitializers), new SbbLanguageController(this));
97
- }
98
- static {
99
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
100
- _name_decorators = [forceType(), property({ attribute: "name" })];
101
- _stretch_decorators = [forceType(), property({
102
- attribute: "stretch",
103
- type: Boolean
104
- })];
105
- __esDecorate(this, null, _name_decorators, {
106
- kind: "accessor",
107
- name: "name",
108
- static: false,
109
- private: false,
110
- access: {
111
- has: (obj) => "name" in obj,
112
- get: (obj) => obj.name,
113
- set: (obj, value) => {
114
- obj.name = value;
115
- }
116
- },
117
- metadata: _metadata
118
- }, _name_initializers, _name_extraInitializers);
119
- __esDecorate(this, null, _stretch_decorators, {
120
- kind: "accessor",
121
- name: "stretch",
122
- static: false,
123
- private: false,
124
- access: {
125
- has: (obj) => "stretch" in obj,
126
- get: (obj) => obj.stretch,
127
- set: (obj, value) => {
128
- obj.stretch = value;
129
- }
130
- },
131
- metadata: _metadata
132
- }, _stretch_initializers, _stretch_extraInitializers);
133
- if (_metadata) Object.defineProperty(this, Symbol.metadata, {
134
- enumerable: true,
135
- configurable: true,
136
- writable: true,
137
- value: _metadata
138
- });
139
- }
140
- static {
141
- this.elementName = "sbb-seat-reservation-graphic";
142
- }
143
- static {
144
- this.styles = [boxSizingStyles, seat_reservation_graphic_default];
145
- }
146
- #name_accessor_storage;
147
- /** Name of the SVG graphic to be displayed. */
148
- get name() {
149
- return this.#name_accessor_storage;
150
- }
151
- set name(value) {
152
- this.#name_accessor_storage = value;
153
- }
154
- #stretch_accessor_storage;
155
- /** if true, scale the graphic content of the given element non-uniformly if necessary */
156
- get stretch() {
157
- return this.#stretch_accessor_storage;
158
- }
159
- set stretch(value) {
160
- this.#stretch_accessor_storage = value;
161
- }
162
- render() {
163
- const svgObj = mapIconToSvg[this.name];
164
- if (!svgObj?.svg && !svgObj?.svgName) return null;
165
- return html`<span
166
- class="${classMap({
167
- "sbb-sr-icon": !!svgObj.svgName,
168
- "sbb-sr-graphic": !!svgObj.svg
169
- })}"
170
- >
171
- ${svgObj.svgName ? html` <sbb-icon
172
- name="${svgObj.svgName || ""}"
173
- aria-hidden="false"
174
- aria-label="${getI18nSeatReservation(svgObj.svgName, this._language.current)}"
175
- ></sbb-icon>` : html`${this._getSvgElement(svgObj.svg)}`}
176
- </span>`;
177
- }
178
- _getSvgElement(svg) {
179
- if (!isServer) {
180
- const parser = new DOMParser();
181
- const svgString = svg || "<svg></svg>";
182
- const svgElm = parser.parseFromString(svgString, "image/svg+xml").firstElementChild;
183
- if (this.stretch && svgElm?.nodeName.toLowerCase() === "svg") svgElm.setAttribute("preserveAspectRatio", "none");
184
- return svgElm;
185
- }
186
- return null;
187
- }
188
- };
189
- })();
190
- //#endregion
191
- export { SbbSeatReservationGraphicElement as t };
192
-
193
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhdC1yZXNlcnZhdGlvbi1ncmFwaGljLmNvbXBvbmVudC1sWlhxSFdJei5qcyIsIm5hbWVzIjpbXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZWxlbWVudHMtZXhwZXJpbWVudGFsL3NlYXQtcmVzZXJ2YXRpb24vc2VhdC1yZXNlcnZhdGlvbi1ncmFwaGljL3NlYXQtcmVzZXJ2YXRpb24tZ3JhcGhpYy5zY3NzP2xpdCZpbmxpbmUiLCIuLi8uLi8uLi9zcmMvZWxlbWVudHMtZXhwZXJpbWVudGFsL3NlYXQtcmVzZXJ2YXRpb24vc2VhdC1yZXNlcnZhdGlvbi1ncmFwaGljL3NlYXQtcmVzZXJ2YXRpb24tZ3JhcGhpYy5jb21wb25lbnQudHMiXSwic291cmNlc0NvbnRlbnQiOlsi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BQUEsd0JBQUE7O0VBS3BCOztFQUFBLElBQWdCLFVBQU87QUFBQSxVQUFBLE1BQUE7O0VBQXZCLElBQWdCLFFBQU8sT0FBQTtBQUFBLFNBQUEsMkJBQUE7O0VBSUosU0FBTTtHQUN2QixNQUFNLFNBQVMsYUFBYSxLQUFLO0FBRWpDLE9BQUksQ0FBQyxRQUFRLE9BQU8sQ0FBQyxRQUFRLFFBQzNCLFFBQU87QUFHVCxVQUFPLElBQUk7ZUFDQSxTQUFTO0lBQ2hCLGVBQWUsQ0FBQyxDQUFDLE9BQU87SUFDeEIsa0JBQWtCLENBQUMsQ0FBQyxPQUFPO0lBQzVCLENBQUMsQ0FBQTs7UUFFQSxPQUFPLFVBQ0wsSUFBSTtvQkFDTSxPQUFPLFdBQVcsR0FBRTs7MEJBRWQsdUJBQXVCLE9BQU8sU0FBUyxLQUFLLFVBQVUsUUFBUSxDQUFBOzBCQUU5RSxJQUFJLEdBQUcsS0FBSyxlQUFlLE9BQU8sSUFBSyxHQUFBOzs7RUFJdkMsZUFBZSxLQUFXO0FBQ2hDLE9BQUksQ0FBQyxVQUFVO0lBQ2IsTUFBTSxTQUFTLElBQUksV0FBVztJQUM5QixNQUFNLFlBQVksT0FBTztJQUN6QixNQUFNLFNBQVMsT0FBTyxnQkFBZ0IsV0FBVyxnQkFBZ0IsQ0FBQztBQUNsRSxRQUFJLEtBQUssV0FBVyxRQUFRLFNBQVMsYUFBYSxLQUFLLE1BQ3JELFFBQU8sYUFBYSx1QkFBdUIsT0FBTztBQUVwRCxXQUFPOztBQUdULFVBQU8ifQ==
@@ -1,102 +0,0 @@
1
- import { __esDecorate as e, __runInitializers as t } from "tslib";
2
- import { SbbElement as n } from "@sbb-esta/lyne-elements/core/base-elements.js";
3
- import { SbbLanguageController as r } from "@sbb-esta/lyne-elements/core/controllers.js";
4
- import { forceType as i } from "@sbb-esta/lyne-elements/core/decorators.js";
5
- import { boxSizingStyles as a } from "@sbb-esta/lyne-elements/core/styles.js";
6
- import "@sbb-esta/lyne-elements/icon.js";
7
- import { css as o, html as s, isServer as c } from "lit";
8
- import { property as l } from "lit/decorators.js";
9
- import { mapIconToSvg as u } from "./seat-reservation/common/mapper.js";
10
- import { classMap as d } from "lit/directives/class-map.js";
11
- import { getI18nSeatReservation as f } from "./seat-reservation/common/translations.js";
12
- //#region src/elements-experimental/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.scss?lit&inline
13
- var p = o`:host{--sbb-seat-reservation-graphic-width: 16;--sbb-seat-reservation-graphic-height: 16;--sbb-seat-reservation-graphic-rotation: 0;--sbb-seat-reservation-graphic-inverse-rotation: 0;--sbb-seat-reservation-graphic-position: initial;--sbb-seat-reservation-graphic-left: 0;--sbb-seat-reservation-graphic-top: 0;--sbb-icon-svg-width: calc( var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem) );--sbb-icon-svg-height: calc( var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem) );display:flex;justify-content:center;align-items:center;width:calc(var(--sbb-seat-reservation-graphic-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:calc(var(--sbb-seat-reservation-graphic-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));position:var(--sbb-seat-reservation-graphic-position);inset-inline-start:calc(var(--sbb-seat-reservation-graphic-left) * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-block-start:calc(var(--sbb-seat-reservation-graphic-top) * var(--sbb-seat-reservation-one-px-rem, .0625rem))}:host(.auto-width){--sbb-icon-svg-width: auto;max-width:calc(var(--sbb-seat-reservation-graphic-max-width) * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:auto}:host(.sbb-seat-reservation-graphic--cursor-pointer){cursor:var(--sbb-cursor-pointer)}.sbb-sr-icon,.sbb-sr-graphic{width:inherit;height:inherit;transform-origin:center;rotate:calc(var(--sbb-seat-reservation-graphic-rotation) * 1deg)}.sbb-sr-icon{color:var(--sbb-color-granite);color:light-dark(var(--sbb-color-granite),var(--sbb-color-graphite))}.sbb-sr-graphic svg{width:100%;height:100%}.sbb-sr-graphic svg .fix-rotation-inverse{transform-origin:center;rotate:calc(var(--sbb-seat-reservation-graphic-inverse-rotation) * 1deg)}@media(forced-colors:active){.sbb-sr-graphic svg:not(.color-immutable) [fill]:not([fill=none]){fill:currentcolor}.sbb-sr-graphic .no-bg{fill:transparent}}`, m = (() => {
14
- let o = n, m, h = [], g = [], _, v = [], y = [];
15
- return class extends o {
16
- constructor() {
17
- super(...arguments), this.#e = t(this, h, ""), this.#t = (t(this, g), t(this, v, !1)), this._language = (t(this, y), new r(this));
18
- }
19
- static {
20
- let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
21
- m = [i(), l({ attribute: "name" })], _ = [i(), l({
22
- attribute: "stretch",
23
- type: Boolean
24
- })], e(this, null, m, {
25
- kind: "accessor",
26
- name: "name",
27
- static: !1,
28
- private: !1,
29
- access: {
30
- has: (e) => "name" in e,
31
- get: (e) => e.name,
32
- set: (e, t) => {
33
- e.name = t;
34
- }
35
- },
36
- metadata: t
37
- }, h, g), e(this, null, _, {
38
- kind: "accessor",
39
- name: "stretch",
40
- static: !1,
41
- private: !1,
42
- access: {
43
- has: (e) => "stretch" in e,
44
- get: (e) => e.stretch,
45
- set: (e, t) => {
46
- e.stretch = t;
47
- }
48
- },
49
- metadata: t
50
- }, v, y), t && Object.defineProperty(this, Symbol.metadata, {
51
- enumerable: !0,
52
- configurable: !0,
53
- writable: !0,
54
- value: t
55
- });
56
- }
57
- static {
58
- this.elementName = "sbb-seat-reservation-graphic";
59
- }
60
- static {
61
- this.styles = [a, p];
62
- }
63
- #e;
64
- get name() {
65
- return this.#e;
66
- }
67
- set name(e) {
68
- this.#e = e;
69
- }
70
- #t;
71
- get stretch() {
72
- return this.#t;
73
- }
74
- set stretch(e) {
75
- this.#t = e;
76
- }
77
- render() {
78
- let e = u[this.name];
79
- return !e?.svg && !e?.svgName ? null : s`<span
80
- class="${d({
81
- "sbb-sr-icon": !!e.svgName,
82
- "sbb-sr-graphic": !!e.svg
83
- })}"
84
- >
85
- ${e.svgName ? s` <sbb-icon
86
- name="${e.svgName || ""}"
87
- aria-hidden="false"
88
- aria-label="${f(e.svgName, this._language.current)}"
89
- ></sbb-icon>` : s`${this._getSvgElement(e.svg)}`}
90
- </span>`;
91
- }
92
- _getSvgElement(e) {
93
- if (!c) {
94
- let t = new DOMParser(), n = e || "<svg></svg>", r = t.parseFromString(n, "image/svg+xml").firstElementChild;
95
- return this.stretch && r?.nodeName.toLowerCase() === "svg" && r.setAttribute("preserveAspectRatio", "none"), r;
96
- }
97
- return null;
98
- }
99
- };
100
- })();
101
- //#endregion
102
- export { m as t };