@sbb-esta/lyne-elements-experimental 5.3.0 → 5.4.1
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.pure.js +1 -1
- package/core.js +1 -1
- package/custom-elements.json +891 -4
- package/development/autocomplete-grid.pure.js +3 -4
- package/development/core.js +2 -1
- package/development/easter-egg/easter-egg.component.d.ts +80 -0
- package/development/easter-egg/i18n.d.ts +10 -0
- package/development/easter-egg/svgs.d.ts +10 -0
- package/development/easter-egg.d.ts +1 -0
- package/development/easter-egg.js +9 -0
- package/development/easter-egg.pure.d.ts +2 -0
- package/development/easter-egg.pure.js +758 -0
- package/development/journey-summary.pure.js +13 -8
- package/development/pearl-chain-time.pure.js +13 -8
- package/development/pearl-chain.pure.js +2 -1
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +4 -0
- package/development/seat-reservation.pure.js +34 -21
- package/development/timetable-row.pure.js +13 -8
- package/easter-egg.js +1 -0
- package/easter-egg.pure.js +567 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/journey-summary.pure.js +1 -1
- package/package.json +12 -2
- package/pearl-chain-time.pure.js +1 -1
- package/pearl-chain.pure.js +2 -2
- package/seat-reservation.pure.js +8 -6
- package/timetable-row.pure.js +1 -1
|
@@ -1437,7 +1437,8 @@ const lightFormatters = {
|
|
|
1437
1437
|
S(date, token) {
|
|
1438
1438
|
const numberOfDigits = token.length;
|
|
1439
1439
|
const milliseconds = date.getMilliseconds();
|
|
1440
|
-
|
|
1440
|
+
const fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
1441
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
1441
1442
|
}
|
|
1442
1443
|
};
|
|
1443
1444
|
|
|
@@ -1475,15 +1476,20 @@ const formatters = {
|
|
|
1475
1476
|
Y: function(date, token, localize, options) {
|
|
1476
1477
|
const signedWeekYear = getWeekYear(date, options);
|
|
1477
1478
|
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
1478
|
-
if (token === "YY")
|
|
1479
|
+
if (token === "YY") {
|
|
1480
|
+
const twoDigitYear = weekYear % 100;
|
|
1481
|
+
return addLeadingZeros(twoDigitYear, 2);
|
|
1482
|
+
}
|
|
1479
1483
|
if (token === "Yo") return localize.ordinalNumber(weekYear, { unit: "year" });
|
|
1480
1484
|
return addLeadingZeros(weekYear, token.length);
|
|
1481
1485
|
},
|
|
1482
1486
|
R: function(date, token) {
|
|
1483
|
-
|
|
1487
|
+
const isoWeekYear = getISOWeekYear(date);
|
|
1488
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
|
1484
1489
|
},
|
|
1485
1490
|
u: function(date, token) {
|
|
1486
|
-
|
|
1491
|
+
const year = date.getFullYear();
|
|
1492
|
+
return addLeadingZeros(year, token.length);
|
|
1487
1493
|
},
|
|
1488
1494
|
Q: function(date, token, localize) {
|
|
1489
1495
|
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
@@ -1826,7 +1832,8 @@ const formatters = {
|
|
|
1826
1832
|
}
|
|
1827
1833
|
},
|
|
1828
1834
|
t: function(date, token, _localize) {
|
|
1829
|
-
|
|
1835
|
+
const timestamp = Math.trunc(+date / 1e3);
|
|
1836
|
+
return addLeadingZeros(timestamp, token.length);
|
|
1830
1837
|
},
|
|
1831
1838
|
T: function(date, token, _localize) {
|
|
1832
1839
|
return addLeadingZeros(+date, token.length);
|
|
@@ -1886,9 +1893,7 @@ const dateTimeLongFormatter = (pattern, formatLong) => {
|
|
|
1886
1893
|
case "PPP":
|
|
1887
1894
|
dateTimeFormat = formatLong.dateTime({ width: "long" });
|
|
1888
1895
|
break;
|
|
1889
|
-
default:
|
|
1890
|
-
dateTimeFormat = formatLong.dateTime({ width: "full" });
|
|
1891
|
-
break;
|
|
1896
|
+
default: dateTimeFormat = formatLong.dateTime({ width: "full" });
|
|
1892
1897
|
}
|
|
1893
1898
|
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
|
1894
1899
|
};
|
|
@@ -1436,7 +1436,8 @@ const lightFormatters = {
|
|
|
1436
1436
|
S(date, token) {
|
|
1437
1437
|
const numberOfDigits = token.length;
|
|
1438
1438
|
const milliseconds = date.getMilliseconds();
|
|
1439
|
-
|
|
1439
|
+
const fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
1440
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
1440
1441
|
}
|
|
1441
1442
|
};
|
|
1442
1443
|
|
|
@@ -1474,15 +1475,20 @@ const formatters = {
|
|
|
1474
1475
|
Y: function(date, token, localize, options) {
|
|
1475
1476
|
const signedWeekYear = getWeekYear(date, options);
|
|
1476
1477
|
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
1477
|
-
if (token === "YY")
|
|
1478
|
+
if (token === "YY") {
|
|
1479
|
+
const twoDigitYear = weekYear % 100;
|
|
1480
|
+
return addLeadingZeros(twoDigitYear, 2);
|
|
1481
|
+
}
|
|
1478
1482
|
if (token === "Yo") return localize.ordinalNumber(weekYear, { unit: "year" });
|
|
1479
1483
|
return addLeadingZeros(weekYear, token.length);
|
|
1480
1484
|
},
|
|
1481
1485
|
R: function(date, token) {
|
|
1482
|
-
|
|
1486
|
+
const isoWeekYear = getISOWeekYear(date);
|
|
1487
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
|
1483
1488
|
},
|
|
1484
1489
|
u: function(date, token) {
|
|
1485
|
-
|
|
1490
|
+
const year = date.getFullYear();
|
|
1491
|
+
return addLeadingZeros(year, token.length);
|
|
1486
1492
|
},
|
|
1487
1493
|
Q: function(date, token, localize) {
|
|
1488
1494
|
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
@@ -1825,7 +1831,8 @@ const formatters = {
|
|
|
1825
1831
|
}
|
|
1826
1832
|
},
|
|
1827
1833
|
t: function(date, token, _localize) {
|
|
1828
|
-
|
|
1834
|
+
const timestamp = Math.trunc(+date / 1e3);
|
|
1835
|
+
return addLeadingZeros(timestamp, token.length);
|
|
1829
1836
|
},
|
|
1830
1837
|
T: function(date, token, _localize) {
|
|
1831
1838
|
return addLeadingZeros(+date, token.length);
|
|
@@ -1885,9 +1892,7 @@ const dateTimeLongFormatter = (pattern, formatLong) => {
|
|
|
1885
1892
|
case "PPP":
|
|
1886
1893
|
dateTimeFormat = formatLong.dateTime({ width: "long" });
|
|
1887
1894
|
break;
|
|
1888
|
-
default:
|
|
1889
|
-
dateTimeFormat = formatLong.dateTime({ width: "full" });
|
|
1890
|
-
break;
|
|
1895
|
+
default: dateTimeFormat = formatLong.dateTime({ width: "full" });
|
|
1891
1896
|
}
|
|
1892
1897
|
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
|
1893
1898
|
};
|
|
@@ -500,7 +500,8 @@ let SbbPearlChainElement = (() => {
|
|
|
500
500
|
_getProgress(now, start, end) {
|
|
501
501
|
if (!start?.time || !end?.time) return 0;
|
|
502
502
|
const startWithDelay = addMinutes(start.time, start.delay ?? 0);
|
|
503
|
-
const
|
|
503
|
+
const endWithDelay = addMinutes(end.time, end.delay ?? 0);
|
|
504
|
+
const total = differenceInMinutes(endWithDelay, startWithDelay);
|
|
504
505
|
const progress = differenceInMinutes(now, startWithDelay);
|
|
505
506
|
return total && progress / total * 100;
|
|
506
507
|
}
|
|
@@ -166,6 +166,10 @@ export declare class SeatReservationBaseElement extends SbbElement {
|
|
|
166
166
|
* @returns An Object with count of free seats and free bicycle places
|
|
167
167
|
*/
|
|
168
168
|
protected getAvailableFreePlacesNumFromCoach(places: Place[] | undefined): CoachNumberOfFreePlaces;
|
|
169
|
+
/**
|
|
170
|
+
* Returns the status whether the seat component with the direction of travel is currently displayed
|
|
171
|
+
*/
|
|
172
|
+
protected hasTravelDirection(): boolean;
|
|
169
173
|
/**
|
|
170
174
|
* At the end of a scroll Event from the coach scrollable area,
|
|
171
175
|
* the reached coach is marked as selected
|
|
@@ -14029,7 +14029,8 @@ let SbbSeatReservationPlaceControlElement = (() => {
|
|
|
14029
14029
|
return `PLACE_${type}_${state}`;
|
|
14030
14030
|
}
|
|
14031
14031
|
_getTitleDescriptionPlace(rotation) {
|
|
14032
|
-
|
|
14032
|
+
const translationKey = "PLACE_CONTROL_" + this.type + "_" + this.state;
|
|
14033
|
+
let description = getI18nSeatReservation(translationKey, this._language.current, [this.text]);
|
|
14033
14034
|
const relativeTravelDirection = this._getRelativeTravelDirection(rotation);
|
|
14034
14035
|
if (this.propertyIds.length || relativeTravelDirection) {
|
|
14035
14036
|
description += ". " + getI18nSeatReservation("PLACE_PROPERTY", this._language.current).concat(": ");
|
|
@@ -14824,13 +14825,10 @@ let SeatReservationBaseElement = (() => {
|
|
|
14824
14825
|
this._navigateToPlaceByKeyboard(pressedUpKeyMapping);
|
|
14825
14826
|
}
|
|
14826
14827
|
break;
|
|
14827
|
-
case this.keyboardNavigationEvents.ArrowDown:
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14831
|
-
}
|
|
14832
|
-
break;
|
|
14833
|
-
default: break;
|
|
14828
|
+
case this.keyboardNavigationEvents.ArrowDown: {
|
|
14829
|
+
const pressedDownKeyMapping = this.alignVertical ? this.keyboardNavigationEvents.ArrowRight : pressedKey;
|
|
14830
|
+
this._navigateToPlaceByKeyboard(pressedDownKeyMapping);
|
|
14831
|
+
}
|
|
14834
14832
|
}
|
|
14835
14833
|
}
|
|
14836
14834
|
}
|
|
@@ -14954,6 +14952,12 @@ let SeatReservationBaseElement = (() => {
|
|
|
14954
14952
|
return freePlaces ? freePlaces : accumulator;
|
|
14955
14953
|
}
|
|
14956
14954
|
/**
|
|
14955
|
+
* Returns the status whether the seat component with the direction of travel is currently displayed
|
|
14956
|
+
*/
|
|
14957
|
+
hasTravelDirection() {
|
|
14958
|
+
return this.travelDirection && this.travelDirection !== "NONE";
|
|
14959
|
+
}
|
|
14960
|
+
/**
|
|
14957
14961
|
* At the end of a scroll Event from the coach scrollable area,
|
|
14958
14962
|
* the reached coach is marked as selected
|
|
14959
14963
|
*/
|
|
@@ -15237,7 +15241,8 @@ let SeatReservationBaseElement = (() => {
|
|
|
15237
15241
|
this.selectedSeatReservationPlaces.bicycles = [];
|
|
15238
15242
|
this.seatReservations?.forEach((seatReservation, coachDeckIndex) => seatReservation.coachItems.map((coach, coachIndex) => {
|
|
15239
15243
|
coach.places?.filter((place) => place.state === "SELECTED")?.forEach((place) => {
|
|
15240
|
-
const
|
|
15244
|
+
const placeId = this.getPlaceElementId(coachDeckIndex, coachIndex, place.number);
|
|
15245
|
+
const preselectedPlaceSelection = mapPlaceInfosToPlaceSelection(place, placeId, seatReservation.deckCoachIndex, coachIndex);
|
|
15241
15246
|
const seatReservationPlaceSelection = this._getSeatReservationPlaceSelection(preselectedPlaceSelection, coachDeckIndex);
|
|
15242
15247
|
if (seatReservationPlaceSelection) if (seatReservationPlaceSelection.placeType === "SEAT") this.selectedSeatReservationPlaces.seats.push(seatReservationPlaceSelection);
|
|
15243
15248
|
else this.selectedSeatReservationPlaces.bicycles.push(seatReservationPlaceSelection);
|
|
@@ -15267,7 +15272,8 @@ let SeatReservationBaseElement = (() => {
|
|
|
15267
15272
|
_getSeatReservationSelectedCoach(coachIndex) {
|
|
15268
15273
|
if (!this.seatReservations[this.currSelectedDeckIndex].coachItems[coachIndex]) return null;
|
|
15269
15274
|
const coach = this.seatReservations[this.currSelectedDeckIndex].coachItems[coachIndex];
|
|
15270
|
-
|
|
15275
|
+
const coachNumberOfFreePlaces = this.getAvailableFreePlacesNumFromCoach(coach.places);
|
|
15276
|
+
return mapCoachInfosToCoachSelection(coachIndex, coach, coachNumberOfFreePlaces);
|
|
15271
15277
|
}
|
|
15272
15278
|
_setCurrSelectedPlaceElementId(place) {
|
|
15273
15279
|
this.currSelectedPlaceElementId = place ? this.getPlaceElementId(this.currSelectedDeckIndex, this.currSelectedCoachIndex, place.number) : null;
|
|
@@ -15371,9 +15377,9 @@ let SeatReservationBaseElement = (() => {
|
|
|
15371
15377
|
seatReservation?.coachItems?.forEach((coachItem) => {
|
|
15372
15378
|
const allElemenets = (coachItem.graphicElements?.filter((e) => e.icon && !this.notAreaElements.includes(e.icon)))?.concat(coachItem.serviceElements || []).concat(coachItem.places || []) || [];
|
|
15373
15379
|
const hasOverhangingElements = this._isOverhangingElementsPresent(coachItem.dimension.w, allElemenets);
|
|
15374
|
-
const areaElements = coachItem.graphicElements?.filter((graphicalElement) => !this.notAreaElements.includes(graphicalElement.icon)).map((ele) => this._getCalculatedDimensionPositionElement(ele, coachItem.dimension,
|
|
15375
|
-
const otherElements = coachItem.graphicElements?.filter((graphicalElement) => this.notAreaElements.includes(graphicalElement.icon)).map((ele) => this._getCalculatedDimensionPositionElement(ele, coachItem.dimension,
|
|
15376
|
-
const serviceElements = coachItem.serviceElements?.map((ele) => this._getCalculatedDimensionPositionElement(ele, coachItem.dimension,
|
|
15380
|
+
const areaElements = coachItem.graphicElements?.filter((graphicalElement) => !this.notAreaElements.includes(graphicalElement.icon)).map((ele) => this._getCalculatedDimensionPositionElement(ele, coachItem.dimension, "AREA"));
|
|
15381
|
+
const otherElements = coachItem.graphicElements?.filter((graphicalElement) => this.notAreaElements.includes(graphicalElement.icon)).map((ele) => this._getCalculatedDimensionPositionElement(ele, coachItem.dimension, "OTHER"));
|
|
15382
|
+
const serviceElements = coachItem.serviceElements?.map((ele) => this._getCalculatedDimensionPositionElement(ele, coachItem.dimension, "SERVICE"));
|
|
15377
15383
|
const borderMiddleElement = this._getCalculatedMiddleBorderElement(coachItem);
|
|
15378
15384
|
const calcCoachDimension = this.getCalculatedDimension({ ...coachItem.dimension });
|
|
15379
15385
|
const coachSturcture = {
|
|
@@ -15448,14 +15454,14 @@ let SeatReservationBaseElement = (() => {
|
|
|
15448
15454
|
* Returns the calculated positions and dimensions of graphical, service and area elements
|
|
15449
15455
|
* @returns BaseElement
|
|
15450
15456
|
*/
|
|
15451
|
-
_getCalculatedDimensionPositionElement(element, coachDimension,
|
|
15457
|
+
_getCalculatedDimensionPositionElement(element, coachDimension, elementType) {
|
|
15452
15458
|
const dim = { ...element.dimension };
|
|
15453
15459
|
const pos = { ...element.position };
|
|
15454
15460
|
const rotation = element.rotation || 0;
|
|
15455
15461
|
const isNotFixedRotationGraphicalElement = this.notAreaElements.concat(this.notFixedRotatableAreaIcons).indexOf(element.icon) === -1;
|
|
15456
15462
|
const calcRotation = this.alignVertical && isNotFixedRotationGraphicalElement ? rotation - 90 : rotation;
|
|
15457
15463
|
let areaMounting = null;
|
|
15458
|
-
if (
|
|
15464
|
+
if (elementType === "AREA") {
|
|
15459
15465
|
const isNotTableGraphic = element.icon?.indexOf("TABLE") === -1;
|
|
15460
15466
|
const areaProperty = element.icon && isNotTableGraphic ? element.icon : null;
|
|
15461
15467
|
const stretchHeight = this.isElementDirectlyOnBorder(element, coachDimension) && areaProperty !== "ENTRY_EXIT";
|
|
@@ -15467,7 +15473,7 @@ let SeatReservationBaseElement = (() => {
|
|
|
15467
15473
|
if (!stretchHeight) pos.y += this.coachBorderOffset - this.coachBorderOffset / 3;
|
|
15468
15474
|
}
|
|
15469
15475
|
if (stretchHeight) dim.h += this.coachBorderOffset - this.coachBorderOffset / 3;
|
|
15470
|
-
} else {
|
|
15476
|
+
} else if (elementType === "OTHER") {
|
|
15471
15477
|
if (element.position.y === 0) pos.y -= this.coachBorderOffset;
|
|
15472
15478
|
if (coachDimension.h === element.position.y + element.dimension.h) dim.h += this.coachBorderOffset * 2;
|
|
15473
15479
|
}
|
|
@@ -15559,7 +15565,7 @@ let SeatReservationBaseElement = (() => {
|
|
|
15559
15565
|
|
|
15560
15566
|
//#endregion
|
|
15561
15567
|
//#region src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.scss?inline
|
|
15562
|
-
var seat_reservation_default = ":host {\n --sbb-seat-reservation-grid-size: 16px;\n --sbb-seat-reservation-height: 0;\n --sbb-seat-reservation-decks: 1;\n display: block;\n height: inherit;\n}\n:host ::part(coach-floor) {\n fill: var(--sbb-background-color-2);\n}\n@media (forced-colors: active) {\n :host ::part(coach-floor) {\n fill: transparent;\n }\n}\n\n:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,\n.sbb-sr-place-ctrl--orientation-90,\n.sbb-sr-place-ctrl--orientation-270,\n.sbb-sr-place-ctrl--state-selected) ::part(coach-floor) {\n rotate: calc(180 * 1deg);\n}\n\n.sbb-sr-popover {\n margin-block: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n:host([align-vertical]) .sbb-sr__component {\n flex-direction: row-reverse;\n justify-content: flex-end;\n gap: calc(22 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n height: inherit;\n}\n@media (min-width: calc(37.5rem)) {\n :host([align-vertical]) .sbb-sr__component {\n gap: calc(54 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n }\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation,\n:host([align-vertical]) .sbb-sr__component ul.sbb-sr-navigation__list-coaches {\n flex-direction: column;\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation {\n padding: calc(16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) 0;\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation .sbb-sr__navigation-control-button {\n left: calc(1 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n top: 0;\n rotate: 90deg;\n}\n@media (min-width: calc(64rem)) {\n :host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation .sbb-sr__navigation-control-button {\n left: calc(-1 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n }\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation ul.sbb-sr-navigation__list-coaches {\n max-width: initial;\n padding: calc(5 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n overflow: hidden scroll;\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation ul.sbb-sr-navigation__list-coaches li {\n display: flex;\n}\n:host([align-vertical]) .sbb-sr__wrapper-coach-decks {\n flex-direction: column;\n}\n:host([align-vertical]) .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels {\n flex-direction: column-reverse;\n width: calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n height: initial;\n}\n:host([align-vertical]) .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b {\n inline-size: calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n block-size: calc(20 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n margin-bottom: calc(16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n rotate: initial;\n writing-mode: initial;\n}\n:host([align-vertical]) .sbb-sr__wrapper-scrollarea {\n width: calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n height: 100%;\n overflow: hidden scroll;\n}\n:host([align-vertical]) .sbb-sr__wrapper-scrollarea .sbb-sr__parent {\n rotate: 90deg;\n}\n:host([align-vertical]) .sbb-sr-travel-direction-wrapper {\n width: calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n margin-block-start: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr-navigation {\n gap: calc(3 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr-navigation .sbb-sr__navigation-control-button {\n position: relative;\n top: calc(2 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n@media (min-width: calc(64rem)) {\n .sbb-sr-navigation .sbb-sr__navigation-control-button {\n top: 0;\n }\n}\n\n.sbb-sr__component {\n display: flex;\n flex-direction: column;\n gap: calc(64 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem) - 16px);\n}\n\n.sbb-sr-travel-direction-wrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n column-gap: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n margin-block: calc(8 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n font-size: var(--sbb-text-font-size-s);\n}\n.sbb-sr-travel-direction-wrapper .sbb-sr__travel-direction--arrow {\n display: flex;\n align-items: center;\n}\n\n.sbb-sr-navigation-wrapper {\n display: flex;\n}\n\n.sbb-sr-navigation {\n display: flex;\n justify-content: center;\n width: 100%;\n padding-inline: 16px;\n}\n\n.sbb-sr-navigation__list-coaches {\n display: flex;\n flex-wrap: nowrap;\n gap: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n padding: calc(6 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) calc(5 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) 0;\n max-width: 856px;\n --sbb-scrollbar-color: transparent;\n overflow: scroll hidden;\n position: relative;\n}\n\n.sbb-sr__wrapper-coach-decks {\n display: flex;\n overflow: hidden;\n height: inherit;\n}\n.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels {\n display: flex;\n justify-content: space-between;\n height: calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n writing-mode: vertical-lr;\n}\n.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b {\n height: calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n width: calc(20 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n margin-block-end: 16px;\n rotate: 180deg;\n text-align: center;\n line-height: calc(20 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr__wrapper-scrollarea {\n overflow: scroll hidden;\n padding-block: calc(8 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) calc(16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n.sbb-sr__wrapper-scrollarea .sbb-sr__parent {\n display: flex;\n flex-direction: column;\n position: relative;\n}\n\n.sbb-sr__list-decks {\n display: flex;\n flex-direction: column;\n}\n\n.sbb-sr__list-decks--gap {\n gap: calc(48 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr__list-item-deck {\n position: relative;\n}\n\n.sbb-sr__list-coaches {\n display: flex;\n gap: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr__list-decks:has(.sbb-sr-coach-has-overhanging-elements) .sbb-sr__list-coaches {\n gap: calc(8 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr__item-coach {\n position: relative;\n}\n\n.sbb-sr-coach-wrapper__table {\n outline: 0;\n}\n";
|
|
15568
|
+
var seat_reservation_default = ":host {\n --sbb-seat-reservation-grid-size: 16px;\n --sbb-seat-reservation-height: 0;\n --sbb-seat-reservation-decks: 1;\n display: block;\n height: inherit;\n}\n:host ::part(coach-floor) {\n fill: var(--sbb-background-color-2);\n}\n@media (forced-colors: active) {\n :host ::part(coach-floor) {\n fill: transparent;\n }\n}\n\n:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,\n.sbb-sr-place-ctrl--orientation-90,\n.sbb-sr-place-ctrl--orientation-270,\n.sbb-sr-place-ctrl--state-selected) ::part(coach-floor) {\n rotate: calc(180 * 1deg);\n}\n\n.sbb-sr-popover {\n margin-block: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n:host([align-vertical]) .sbb-sr__component {\n flex-direction: row-reverse;\n justify-content: flex-end;\n gap: calc(22 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n height: inherit;\n}\n@media (min-width: calc(37.5rem)) {\n :host([align-vertical]) .sbb-sr__component {\n gap: calc(54 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n }\n}\n:host([align-vertical]) .sbb-sr__component--has-travel-direction {\n padding-block-start: calc(36 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation,\n:host([align-vertical]) .sbb-sr__component ul.sbb-sr-navigation__list-coaches {\n flex-direction: column;\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation {\n padding: calc(16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) 0;\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation .sbb-sr__navigation-control-button {\n left: calc(1 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n top: 0;\n rotate: 90deg;\n}\n@media (min-width: calc(64rem)) {\n :host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation .sbb-sr__navigation-control-button {\n left: calc(-1 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n }\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation ul.sbb-sr-navigation__list-coaches {\n max-width: initial;\n padding: calc(5 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n overflow: hidden scroll;\n}\n:host([align-vertical]) .sbb-sr__component nav.sbb-sr-navigation ul.sbb-sr-navigation__list-coaches li {\n display: flex;\n}\n:host([align-vertical]) .sbb-sr__wrapper-coach-decks {\n flex-direction: column;\n}\n:host([align-vertical]) .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels {\n flex-direction: column-reverse;\n width: calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n height: initial;\n}\n:host([align-vertical]) .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b {\n inline-size: calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n block-size: calc(20 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n margin-bottom: calc(16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n rotate: initial;\n writing-mode: initial;\n}\n:host([align-vertical]) .sbb-sr__wrapper-scrollarea {\n width: calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n height: 100%;\n overflow: hidden scroll;\n}\n:host([align-vertical]) .sbb-sr__wrapper-scrollarea .sbb-sr__parent {\n rotate: 90deg;\n}\n:host([align-vertical]) .sbb-sr-travel-direction-wrapper {\n width: calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n margin-block-start: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n position: absolute;\n}\n\n.sbb-sr-navigation {\n gap: calc(3 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr-navigation .sbb-sr__navigation-control-button {\n position: relative;\n top: calc(2 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n@media (min-width: calc(64rem)) {\n .sbb-sr-navigation .sbb-sr__navigation-control-button {\n top: 0;\n }\n}\n\n.sbb-sr__component {\n display: flex;\n flex-direction: column;\n gap: calc(64 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem) - 16px);\n}\n\n.sbb-sr-travel-direction-wrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n column-gap: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n margin-block: calc(8 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n font-size: var(--sbb-text-font-size-s);\n}\n.sbb-sr-travel-direction-wrapper .sbb-sr__travel-direction--arrow {\n display: flex;\n align-items: center;\n}\n\n.sbb-sr-navigation-wrapper {\n display: flex;\n}\n\n.sbb-sr-navigation {\n display: flex;\n justify-content: center;\n width: 100%;\n padding-inline: 16px;\n}\n\n.sbb-sr-navigation__list-coaches {\n display: flex;\n flex-wrap: nowrap;\n gap: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n padding: calc(6 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) calc(5 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) 0;\n max-width: 856px;\n --sbb-scrollbar-color: transparent;\n overflow: scroll hidden;\n position: relative;\n}\n\n.sbb-sr__wrapper-coach-decks {\n display: flex;\n overflow: hidden;\n height: inherit;\n}\n.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels {\n display: flex;\n justify-content: space-between;\n height: calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n writing-mode: vertical-lr;\n}\n.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b {\n height: calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n width: calc(20 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n margin-block-end: 16px;\n rotate: 180deg;\n text-align: center;\n line-height: calc(20 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr__wrapper-scrollarea {\n overflow: scroll hidden;\n padding-block: calc(8 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem)) calc(16 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n.sbb-sr__wrapper-scrollarea .sbb-sr__parent {\n display: flex;\n flex-direction: column;\n position: relative;\n}\n\n.sbb-sr__list-decks {\n display: flex;\n flex-direction: column;\n}\n\n.sbb-sr__list-decks--gap {\n gap: calc(48 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr__list-item-deck {\n position: relative;\n}\n\n.sbb-sr__list-coaches {\n display: flex;\n gap: calc(4 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr__list-decks:has(.sbb-sr-coach-has-overhanging-elements) .sbb-sr__list-coaches {\n gap: calc(8 * var(--sbb-seat-reservation-one-px-rem, 0.0625rem));\n}\n\n.sbb-sr__item-coach {\n position: relative;\n}\n\n.sbb-sr-coach-wrapper__table {\n outline: 0;\n}\n";
|
|
15563
15569
|
|
|
15564
15570
|
//#endregion
|
|
15565
15571
|
//#region src/elements-experimental/seat-reservation/seat-reservation/seat-reservation.component.ts
|
|
@@ -15612,7 +15618,12 @@ var SbbSeatReservationElement = class extends SeatReservationBaseElement {
|
|
|
15612
15618
|
_initVehicleSeatReservationConstruction() {
|
|
15613
15619
|
this._coachesHtmlTemplate = html`
|
|
15614
15620
|
${this._renderTravelDirection()}
|
|
15615
|
-
<div
|
|
15621
|
+
<div
|
|
15622
|
+
class="${classMap({
|
|
15623
|
+
"sbb-sr__component": true,
|
|
15624
|
+
"sbb-sr__component--has-travel-direction": this.hasTravelDirection()
|
|
15625
|
+
})}"
|
|
15626
|
+
>
|
|
15616
15627
|
${this._renderNavigation()}
|
|
15617
15628
|
<div
|
|
15618
15629
|
class="sbb-sr__wrapper-coach-decks"
|
|
@@ -15649,7 +15660,8 @@ var SbbSeatReservationElement = class extends SeatReservationBaseElement {
|
|
|
15649
15660
|
_renderDeckLabels() {
|
|
15650
15661
|
if (!this.hasMultipleDecks) return null;
|
|
15651
15662
|
return this.seatReservations.map((seatReservation) => {
|
|
15652
|
-
|
|
15663
|
+
const deckDescription = getI18nSeatReservation(seatReservation.deckCoachLevel, this._language.current);
|
|
15664
|
+
return html`<b aria-hidden="true">${deckDescription}</b>`;
|
|
15653
15665
|
});
|
|
15654
15666
|
}
|
|
15655
15667
|
_renderNavigationControlButton(btnDirection) {
|
|
@@ -15677,11 +15689,12 @@ var SbbSeatReservationElement = class extends SeatReservationBaseElement {
|
|
|
15677
15689
|
</div>`;
|
|
15678
15690
|
}
|
|
15679
15691
|
_renderTravelDirection() {
|
|
15680
|
-
if (!this.
|
|
15692
|
+
if (!this.hasTravelDirection()) return null;
|
|
15681
15693
|
const labelText = getI18nSeatReservation("SEAT_RESERVATION_TRAVEL_DIRECTION", this._language.current);
|
|
15694
|
+
const iconName = `arrow-${this.alignVertical ? this.travelDirection === "RIGHT" ? "down" : "up" : this.travelDirection === "RIGHT" ? "right" : "left"}-small`;
|
|
15682
15695
|
return html`<div class="sbb-sr-travel-direction-wrapper">
|
|
15683
15696
|
<div class="sbb-sr__travel-direction--arrow">
|
|
15684
|
-
<sbb-icon slot="icon" name="${
|
|
15697
|
+
<sbb-icon slot="icon" name="${iconName}"></sbb-icon>
|
|
15685
15698
|
</div>
|
|
15686
15699
|
<div class="sbb-sr__travel-direction--label">${labelText}</div>
|
|
15687
15700
|
</div>`;
|
|
@@ -1438,7 +1438,8 @@ const lightFormatters = {
|
|
|
1438
1438
|
S(date, token) {
|
|
1439
1439
|
const numberOfDigits = token.length;
|
|
1440
1440
|
const milliseconds = date.getMilliseconds();
|
|
1441
|
-
|
|
1441
|
+
const fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
1442
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
1442
1443
|
}
|
|
1443
1444
|
};
|
|
1444
1445
|
|
|
@@ -1476,15 +1477,20 @@ const formatters = {
|
|
|
1476
1477
|
Y: function(date, token, localize, options) {
|
|
1477
1478
|
const signedWeekYear = getWeekYear(date, options);
|
|
1478
1479
|
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
1479
|
-
if (token === "YY")
|
|
1480
|
+
if (token === "YY") {
|
|
1481
|
+
const twoDigitYear = weekYear % 100;
|
|
1482
|
+
return addLeadingZeros(twoDigitYear, 2);
|
|
1483
|
+
}
|
|
1480
1484
|
if (token === "Yo") return localize.ordinalNumber(weekYear, { unit: "year" });
|
|
1481
1485
|
return addLeadingZeros(weekYear, token.length);
|
|
1482
1486
|
},
|
|
1483
1487
|
R: function(date, token) {
|
|
1484
|
-
|
|
1488
|
+
const isoWeekYear = getISOWeekYear(date);
|
|
1489
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
|
1485
1490
|
},
|
|
1486
1491
|
u: function(date, token) {
|
|
1487
|
-
|
|
1492
|
+
const year = date.getFullYear();
|
|
1493
|
+
return addLeadingZeros(year, token.length);
|
|
1488
1494
|
},
|
|
1489
1495
|
Q: function(date, token, localize) {
|
|
1490
1496
|
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
@@ -1827,7 +1833,8 @@ const formatters = {
|
|
|
1827
1833
|
}
|
|
1828
1834
|
},
|
|
1829
1835
|
t: function(date, token, _localize) {
|
|
1830
|
-
|
|
1836
|
+
const timestamp = Math.trunc(+date / 1e3);
|
|
1837
|
+
return addLeadingZeros(timestamp, token.length);
|
|
1831
1838
|
},
|
|
1832
1839
|
T: function(date, token, _localize) {
|
|
1833
1840
|
return addLeadingZeros(+date, token.length);
|
|
@@ -1887,9 +1894,7 @@ const dateTimeLongFormatter = (pattern, formatLong) => {
|
|
|
1887
1894
|
case "PPP":
|
|
1888
1895
|
dateTimeFormat = formatLong.dateTime({ width: "long" });
|
|
1889
1896
|
break;
|
|
1890
|
-
default:
|
|
1891
|
-
dateTimeFormat = formatLong.dateTime({ width: "full" });
|
|
1892
|
-
break;
|
|
1897
|
+
default: dateTimeFormat = formatLong.dateTime({ width: "full" });
|
|
1893
1898
|
}
|
|
1894
1899
|
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
|
1895
1900
|
};
|
package/easter-egg.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SbbEasterEggElement as e}from"./easter-egg.pure.js";export*from"./easter-egg.pure.js";e.define();
|