@sbb-esta/lyne-elements-dev 5.0.0-next.1-dev.1777358786 → 5.0.0-next.1-dev.1777393579
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/core/i18n/i18n.js +103 -98
- package/core/styles/core.scss +15 -38
- package/core.css +57 -31
- package/core.js +22 -22
- package/custom-elements.json +6013 -2585
- package/development/core/i18n/i18n.d.ts +1 -0
- package/development/core/i18n/i18n.d.ts.map +1 -1
- package/development/core/i18n/i18n.js +8 -2
- package/development/core.js +2 -2
- package/development/train/train/train.component.d.ts +2 -5
- package/development/train/train/train.component.d.ts.map +1 -1
- package/development/train/train/train.component.js +1 -1
- package/development/train/train-blocked-passage/train-blocked-passage.component.d.ts +4 -3
- package/development/train/train-blocked-passage/train-blocked-passage.component.d.ts.map +1 -1
- package/development/train/train-blocked-passage/train-blocked-passage.component.js +1 -1
- package/development/train/train-formation/train-formation.component.d.ts +6 -2
- package/development/train/train-formation/train-formation.component.d.ts.map +1 -1
- package/development/train/train-formation/train-formation.component.js +1 -1
- package/development/train/train-formation-orientation-mixin.d.ts +12 -0
- package/development/train/train-formation-orientation-mixin.d.ts.map +1 -0
- package/development/train/train-formation-orientation-mixin.js +62 -0
- package/development/train/train-wagon/train-wagon.component.d.ts +5 -32
- package/development/train/train-wagon/train-wagon.component.d.ts.map +1 -1
- package/development/train/train-wagon/train-wagon.component.js +19 -1
- package/development/train/train-wagon-button/train-wagon-button.component.d.ts +18 -0
- package/development/train/train-wagon-button/train-wagon-button.component.d.ts.map +1 -0
- package/development/train/train-wagon-button/train-wagon-button.component.js +18 -0
- package/development/train/train-wagon-common.d.ts +15 -0
- package/development/train/train-wagon-common.d.ts.map +1 -0
- package/development/train/train-wagon-common.js +2 -0
- package/development/train/train-wagon-link/train-wagon-link.component.d.ts +18 -0
- package/development/train/train-wagon-link/train-wagon-link.component.d.ts.map +1 -0
- package/development/train/train-wagon-link/train-wagon-link.component.js +18 -0
- package/development/train-blocked-passage.component-BgBnEOfh.js +22 -0
- package/development/train-formation.component-CDKR5KCm.js +194 -0
- package/development/train-wagon-common-S3OJdguG.js +441 -0
- package/development/train.component-CP9QaQk8.js +239 -0
- package/development/train.d.ts.map +1 -1
- package/development/train.js +13 -7
- package/development/train.pure.d.ts +4 -0
- package/development/train.pure.d.ts.map +1 -1
- package/development/train.pure.js +9 -5
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/off-brand-theme.css +57 -31
- package/package.json +2 -2
- package/safety-theme.css +57 -31
- package/standard-theme.css +57 -31
- package/train/train/train.component.js +1 -1
- package/train/train-blocked-passage/train-blocked-passage.component.js +1 -1
- package/train/train-formation/train-formation.component.js +1 -1
- package/train/train-formation-orientation-mixin.js +45 -0
- package/train/train-wagon/train-wagon.component.js +13 -2
- package/train/train-wagon-button/train-wagon-button.component.js +10 -0
- package/train/train-wagon-common.js +2 -0
- package/train/train-wagon-link/train-wagon-link.component.js +10 -0
- package/train-blocked-passage.component-voZ8fxiB.js +14 -0
- package/train-formation.component-6XQVXPue.js +147 -0
- package/train-wagon-common-DTN_G78z.js +354 -0
- package/train.component-3vmLxVCZ.js +181 -0
- package/train.js +10 -6
- package/train.pure.js +9 -5
- package/development/train-blocked-passage.component-Bh2dR1gn.js +0 -30
- package/development/train-formation.component-Dm0t9N_h.js +0 -149
- package/development/train-wagon.component-B6V4dPKn.js +0 -334
- package/development/train.component-BvbNBkZF.js +0 -229
- package/train-blocked-passage.component-DIh8dbU9.js +0 -22
- package/train-formation.component-DS4EDwPY.js +0 -117
- package/train-wagon.component-LwKwwuta.js +0 -257
- package/train.component-DuFi_iBX.js +0 -174
package/standard-theme.css
CHANGED
|
@@ -1916,6 +1916,59 @@ slot[name=error]::slotted(*) {
|
|
|
1916
1916
|
--sbb-tab-label-amount-color: light-dark(var(--sbb-color-metal), var(--sbb-color-smoke));
|
|
1917
1917
|
--sbb-tab-label-line-color: var(--sbb-border-color-4-inverted);
|
|
1918
1918
|
--sbb-tab-label-cursor: var(--sbb-cursor-pointer);
|
|
1919
|
+
--sbb-train-blocked-passage-background-color: var(--sbb-color-error);
|
|
1920
|
+
--sbb-train-blocked-passage-bar-color: var(--sbb-color-white);
|
|
1921
|
+
--sbb-train-blocked-passage-icon-bar-width: 0.625rem;
|
|
1922
|
+
--sbb-train-blocked-passage-icon-bar-height: 0.25rem;
|
|
1923
|
+
--sbb-train-blocked-passage-icon-bar-border-radius: var(--sbb-border-radius-1x);
|
|
1924
|
+
--sbb-train-formation-wagon-dimension-short: 2.25rem;
|
|
1925
|
+
--sbb-train-formation-wagon-dimension-long: 5.25rem;
|
|
1926
|
+
--sbb-train-formation-wagon-gap: var(--sbb-spacing-fixed-1x);
|
|
1927
|
+
--sbb-train-formation-sector-line-color: var(--sbb-color-cement);
|
|
1928
|
+
--sbb-train-formation-sector-line-color: light-dark(
|
|
1929
|
+
var(--sbb-color-cement),
|
|
1930
|
+
var(--sbb-color-smoke)
|
|
1931
|
+
);
|
|
1932
|
+
--sbb-train-formation-sector-line-width: var(--sbb-border-width-1x);
|
|
1933
|
+
--sbb-train-formation-blocked-passage-dimension: 1rem;
|
|
1934
|
+
--sbb-train-formation-text-color: var(--sbb-color-3);
|
|
1935
|
+
--sbb-train-formation-gap: var(--sbb-spacing-fixed-2x);
|
|
1936
|
+
--sbb-train-formation-sector-padding: var(--sbb-spacing-fixed-1x);
|
|
1937
|
+
--sbb-train-formation-sector-margin: var(--sbb-spacing-fixed-2x);
|
|
1938
|
+
--sbb-train-formation-padding: var(--sbb-spacing-fixed-1x);
|
|
1939
|
+
--_sbb-train-formation-flex-direction: row;
|
|
1940
|
+
--_sbb-train-formation-flex-direction-inverted: column;
|
|
1941
|
+
--sbb-train-wagon-font-size: var(--sbb-text-font-size-xxs);
|
|
1942
|
+
--sbb-train-wagon-shape-color: var(--sbb-color-3);
|
|
1943
|
+
--sbb-train-wagon-vertical-gap: 0.125rem;
|
|
1944
|
+
--sbb-train-wagon-padding-inline: var(--sbb-spacing-fixed-3x);
|
|
1945
|
+
--sbb-train-wagon-border-width: var(--sbb-border-width-1x);
|
|
1946
|
+
--sbb-train-wagon-main-icon-height: 1.25rem;
|
|
1947
|
+
--sbb-train-wagon-attribute-icon-gap: 0.125rem;
|
|
1948
|
+
--sbb-train-wagon-attribute-icon-height: 0.875rem;
|
|
1949
|
+
--sbb-train-wagon-attribute-icon-color: var(--sbb-color-1);
|
|
1950
|
+
--sbb-train-wagon-attributes-max-width: 3.4375rem;
|
|
1951
|
+
--sbb-train-wagon-attributes-mean-width: 1.75rem;
|
|
1952
|
+
--sbb-train-wagon-occupancy-height: 0.75rem;
|
|
1953
|
+
--sbb-train-wagon-background-color-hover: var(--sbb-background-color-3);
|
|
1954
|
+
--sbb-train-wagon-background-color-active: var(--sbb-background-color-4);
|
|
1955
|
+
--sbb-train-wagon-border-radius: var(--sbb-border-radius-6x);
|
|
1956
|
+
--sbb-train-wagon-information-gap: var(--sbb-spacing-fixed-1x);
|
|
1957
|
+
--sbb-train-wagon-information-min-width: 1.875rem;
|
|
1958
|
+
--sbb-train-wagon-class-dimension: 1.125rem;
|
|
1959
|
+
--sbb-train-wagon-class-color: var(--sbb-color-anthracite);
|
|
1960
|
+
--sbb-train-wagon-class-color: light-dark(var(--sbb-color-anthracite), var(--sbb-color-graphite));
|
|
1961
|
+
--sbb-train-wagon-class-background-color: var(--sbb-background-color-3);
|
|
1962
|
+
--sbb-train-wagon-class-border-width: var(--sbb-border-width-1x);
|
|
1963
|
+
--sbb-train-wagon-class-border: var(--sbb-train-wagon-class-border-width) solid
|
|
1964
|
+
var(--sbb-color-graphite);
|
|
1965
|
+
--sbb-train-wagon-class-border: var(--sbb-train-wagon-class-border-width) solid
|
|
1966
|
+
light-dark(var(--sbb-color-graphite), var(--sbb-color-anthracite));
|
|
1967
|
+
--sbb-train-wagon-class-border-radius: var(--sbb-border-radius-2x);
|
|
1968
|
+
--sbb-train-wagon-class-font-weight: bold;
|
|
1969
|
+
--sbb-train-wagon-class-first-thickness: 0.25rem;
|
|
1970
|
+
--sbb-train-wagon-class-first-color: var(--sbb-color-lemon);
|
|
1971
|
+
--sbb-train-wagon-class-first-border-radius: var(--sbb-border-radius-1x);
|
|
1919
1972
|
--sbb-tag-animation-easing: var(--sbb-animation-easing);
|
|
1920
1973
|
--sbb-tag-background-color: var(--sbb-background-color-1);
|
|
1921
1974
|
--sbb-tag-border-color: var(--sbb-border-color-4-inverted);
|
|
@@ -2113,12 +2166,13 @@ slot[name=error]::slotted(*) {
|
|
|
2113
2166
|
--sbb-toggle-check-circle-background-color: Canvas;
|
|
2114
2167
|
--sbb-toggle-selected-option-border-width: var(--sbb-border-width-2x);
|
|
2115
2168
|
--sbb-toggle-selected-option-border-color: Highlight;
|
|
2169
|
+
--sbb-train-blocked-passage-background-color: CanvasText;
|
|
2170
|
+
--sbb-train-blocked-passage-bar-color: Canvas;
|
|
2171
|
+
--sbb-train-formation-sector-line-color: CanvasText;
|
|
2172
|
+
--sbb-train-wagon-shape-color: CanvasText;
|
|
2116
2173
|
}
|
|
2117
2174
|
}
|
|
2118
2175
|
:root {
|
|
2119
|
-
--sbb-train-formation-wagon-width: 5rem;
|
|
2120
|
-
--sbb-train-formation-wagon-height: 2.5rem;
|
|
2121
|
-
--sbb-train-formation-wagon-gap: var(--sbb-spacing-fixed-1x);
|
|
2122
2176
|
--sbb-overlay-default-z-index: 1000;
|
|
2123
2177
|
--sbb-cursor-default: default;
|
|
2124
2178
|
--sbb-cursor-pointer: pointer;
|
|
@@ -2795,34 +2849,6 @@ img {
|
|
|
2795
2849
|
transition: filter var(--sbb-teaser-image-animation-duration) var(--sbb-teaser-image-animation-easing);
|
|
2796
2850
|
}
|
|
2797
2851
|
|
|
2798
|
-
sbb-train-formation:has(sbb-train[direction-label]) {
|
|
2799
|
-
--sbb-train-formation-reserve-spacing-display: block;
|
|
2800
|
-
}
|
|
2801
|
-
|
|
2802
|
-
sbb-train-formation:has(sbb-train-wagon[sector]) {
|
|
2803
|
-
--sbb-train-formation-show-sectors-gap: 1;
|
|
2804
|
-
}
|
|
2805
|
-
|
|
2806
|
-
sbb-train-formation:not(:has(sbb-train-wagon[label])) {
|
|
2807
|
-
--sbb-train-formation-wagon-label-display: none;
|
|
2808
|
-
}
|
|
2809
|
-
|
|
2810
|
-
sbb-train-formation[view=side] sbb-train-wagon {
|
|
2811
|
-
--sbb-train-wagon-wagon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M12.5,0.5 h55 a12,12 0 0 1 12,12 v15 a12,12 0 0 1 -12,12 h-55 a12,12 0 0 1 -12,-12 v-15 a12,12 0 0 1 12,-12 z' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E");
|
|
2812
|
-
--sbb-train-wagon-wagon-closed-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Crect x='0.5' y='0.5' width='79' height='39' rx='11.5' stroke='%23000000'/%3E%3Cpath d='M76 4L4 36' stroke='%23000000'/%3E%3Cpath d='M76 36L4 4' stroke='%23000000'/%3E%3C/svg%3E");
|
|
2813
|
-
--sbb-train-wagon-wagon-end-left-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M10.745 7.90416C13.5624 3.30431 18.5686 0.5 23.9627 0.5H68C74.3513 0.5 79.5 5.64873 79.5 12V28C79.5 34.3513 74.3513 39.5 68 39.5H11.922C2.93614 39.5 -2.57807 29.6562 2.11537 21.9934L10.745 7.90416Z' stroke='%23000000'/%3E%3C/svg%3E");
|
|
2814
|
-
--sbb-train-wagon-locomotive-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M10.745 7.90416C13.5624 3.30431 18.5686 0.5 23.9627 0.5H56.0373C61.4314 0.5 66.4376 3.30432 69.255 7.90416L77.8846 21.9934C82.5781 29.6562 77.0639 39.5 68.078 39.5H11.922C2.93615 39.5 -2.57807 29.6562 2.11537 21.9934L10.745 7.90416Z' stroke='%23000000'/%3E%3C/svg%3E");
|
|
2815
|
-
--sbb-train-wagon-wagon-end-right-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M0.5 12C0.5 5.64873 5.64873 0.5 12 0.5H56.0373C61.4314 0.5 66.4376 3.30432 69.255 7.90416L77.8846 21.9934C82.5781 29.6562 77.0638 39.5 68.0779 39.5H12C5.64873 39.5 0.5 34.3513 0.5 28V12Z' stroke='%23000000'/%3E%3C/svg%3E");
|
|
2816
|
-
}
|
|
2817
|
-
|
|
2818
|
-
sbb-train-formation[view=top] sbb-train-wagon {
|
|
2819
|
-
--sbb-train-wagon-wagon-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M8.5,0.5 h63 a8,8 0 0 1 8,8 v23 a8,8 0 0 1 -8,8 h-63 a8,8 0 0 1 -8,-8 v-23 a8,8 0 0 1 8,-8 z' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E%0A");
|
|
2820
|
-
--sbb-train-wagon-wagon-closed-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Crect x='0.5' y='0.5' width='79' height='39' rx='7.5' stroke='%23000000'/%3E%3Cpath d='M77.5 2.5L2.5 37.5' stroke='%23000000'/%3E%3Cpath d='M77.5 37.5L2.5 2.5' stroke='%23000000'/%3E%3C/svg%3E");
|
|
2821
|
-
--sbb-train-wagon-wagon-end-left-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath transform='translate(80,40) rotate(180)' d='M8.5,0.5 h51.5 a19.5,19.5 0 0 1 19.5,19.5 v0 a19.5,19.5 0 0 1 -19.5,19.5 h-51.5 a8,8 0 0 1 -8,-8 v-23 a8,8 0 0 1 8,-8 z' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E");
|
|
2822
|
-
--sbb-train-wagon-locomotive-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M20,0.5 h40 a19.5,19.5 0 0 1 19.5,19.5 v0 a19.5,19.5 0 0 1 -19.5,19.5 h-40 a19.5,19.5 0 0 1 -19.5,-19.5 v0 a19.5,19.5 0 0 1 19.5,-19.5 z' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E%0A");
|
|
2823
|
-
--sbb-train-wagon-wagon-end-right-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M8.5,0.5 h51.5 a19.5,19.5 0 0 1 19.5,19.5 v0 a19.5,19.5 0 0 1 -19.5,19.5 h-51.5 a8,8 0 0 1 -8,-8 v-23 a8,8 0 0 1 8,-8 z' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E");
|
|
2824
|
-
}
|
|
2825
|
-
|
|
2826
2852
|
.sbb-overlay-outlet {
|
|
2827
2853
|
position: fixed;
|
|
2828
2854
|
inset: 0;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../train.component-
|
|
1
|
+
import { t as e } from "../../train.component-3vmLxVCZ.js";
|
|
2
2
|
export { e as SbbTrainElement };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../train-blocked-passage.component-
|
|
1
|
+
import { t as e } from "../../train-blocked-passage.component-voZ8fxiB.js";
|
|
2
2
|
export { e as SbbTrainBlockedPassageElement };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../train-formation.component-
|
|
1
|
+
import { t as e } from "../../train-formation.component-6XQVXPue.js";
|
|
2
2
|
export { e as SbbTrainFormationElement };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __esDecorate as e, __runInitializers as t } from "tslib";
|
|
2
|
+
import { state as n } from "lit/decorators.js";
|
|
3
|
+
import { SbbPropertyWatcherController as r } from "../core.js";
|
|
4
|
+
//#region src/elements/train/train-formation-orientation-mixin.ts
|
|
5
|
+
var i = (i) => (() => {
|
|
6
|
+
let a = i, o, s = [], c = [];
|
|
7
|
+
return class extends a {
|
|
8
|
+
static {
|
|
9
|
+
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(a[Symbol.metadata] ?? null) : void 0;
|
|
10
|
+
o = [n()], e(this, null, o, {
|
|
11
|
+
kind: "accessor",
|
|
12
|
+
name: "orientation",
|
|
13
|
+
static: !1,
|
|
14
|
+
private: !1,
|
|
15
|
+
access: {
|
|
16
|
+
has: (e) => "orientation" in e,
|
|
17
|
+
get: (e) => e.orientation,
|
|
18
|
+
set: (e, t) => {
|
|
19
|
+
e.orientation = t;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
metadata: t
|
|
23
|
+
}, s, c), t && Object.defineProperty(this, Symbol.metadata, {
|
|
24
|
+
enumerable: !0,
|
|
25
|
+
configurable: !0,
|
|
26
|
+
writable: !0,
|
|
27
|
+
value: t
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
#e = t(this, s, null);
|
|
31
|
+
get orientation() {
|
|
32
|
+
return this.#e;
|
|
33
|
+
}
|
|
34
|
+
set orientation(e) {
|
|
35
|
+
this.#e = e;
|
|
36
|
+
}
|
|
37
|
+
constructor(...e) {
|
|
38
|
+
super(...e), t(this, c), this.addController(new r(this, () => this.closest("sbb-train-formation"), { orientation: (e) => {
|
|
39
|
+
this.orientation && this.internals.states.delete(`orientation-${this.orientation}`), this.orientation = e.orientation, this.orientation && this.internals.states.add(`orientation-${this.orientation}`);
|
|
40
|
+
} }));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
//#endregion
|
|
45
|
+
export { i as SbbTrainFormationOrientationMixin };
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SbbElement as e } from "../../core.js";
|
|
2
|
+
import { SbbTrainWagonMixin as t } from "../train-wagon-common.js";
|
|
3
|
+
//#region src/elements/train/train-wagon/train-wagon.component.ts
|
|
4
|
+
var n = class extends t(e) {
|
|
5
|
+
static {
|
|
6
|
+
this.elementName = "sbb-train-wagon";
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
return this.renderTemplate();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as SbbTrainWagonElement };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SbbButtonBaseElement as e } from "../../core.js";
|
|
2
|
+
import { SbbTrainWagonMixin as t } from "../train-wagon-common.js";
|
|
3
|
+
//#region src/elements/train/train-wagon-button/train-wagon-button.component.ts
|
|
4
|
+
var n = class extends t(e) {
|
|
5
|
+
static {
|
|
6
|
+
this.elementName = "sbb-train-wagon-button";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as SbbTrainWagonButtonElement };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SbbLinkBaseElement as e } from "../../core.js";
|
|
2
|
+
import { SbbTrainWagonMixin as t } from "../train-wagon-common.js";
|
|
3
|
+
//#region src/elements/train/train-wagon-link/train-wagon-link.component.ts
|
|
4
|
+
var n = class extends t(e) {
|
|
5
|
+
static {
|
|
6
|
+
this.elementName = "sbb-train-wagon-link";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as SbbTrainWagonLinkElement };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { unsafeCSS as e } from "lit";
|
|
2
|
+
import { SbbElement as t, boxSizingStyles as n } from "./core.js";
|
|
3
|
+
import { SbbTrainFormationOrientationMixin as r } from "./train/train-formation-orientation-mixin.js";
|
|
4
|
+
//#region src/elements/train/train-blocked-passage/train-blocked-passage.scss?inline
|
|
5
|
+
var i = ":host{display:grid;grid-template-areas:\"icon\";align-items:center;width:var(--sbb-train-formation-blocked-passage-dimension);height:var(--_sbb-train-formation-wagon-height)}:host(:is(:state(orientation-vertical),[state--orientation-vertical])){width:var(--_sbb-train-formation-wagon-width);height:var(--sbb-train-formation-blocked-passage-dimension)}:host:before,:host:after{content:\"\";grid-area:icon;justify-self:center}:host:before{width:var(--sbb-train-formation-blocked-passage-dimension);height:var(--sbb-train-formation-blocked-passage-dimension);border-radius:50%;background-color:var(--sbb-train-blocked-passage-background-color)}:host:after{width:var(--sbb-train-blocked-passage-icon-bar-width);height:var(--sbb-train-blocked-passage-icon-bar-height);border-radius:var(--sbb-train-blocked-passage-icon-bar-border-radius);background-color:var(--sbb-train-blocked-passage-bar-color)}", a = class extends r(t) {
|
|
6
|
+
static {
|
|
7
|
+
this.elementName = "sbb-train-blocked-passage";
|
|
8
|
+
}
|
|
9
|
+
static {
|
|
10
|
+
this.styles = [n, e(i)];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { a as t };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { __esDecorate as e, __runInitializers as t } from "tslib";
|
|
2
|
+
import { html as n, nothing as r, unsafeCSS as i } from "lit";
|
|
3
|
+
import { property as a, state as o } from "lit/decorators.js";
|
|
4
|
+
import { SbbElement as s, SbbLanguageController as c, SbbNamedSlotListMixin as l, boxSizingStyles as u, hostScrollbarStyles as d, i18nSector as f, i18nSectorShort as p, i18nTrains as m } from "./core.js";
|
|
5
|
+
import { styleMap as h } from "lit/directives/style-map.js";
|
|
6
|
+
//#region src/elements/train/train-formation/train-formation.scss?inline
|
|
7
|
+
var g = ":host{--sbb-train-formation-scroll-padding: var(--sbb-train-formation-padding);--_sbb-train-formation-wagon-width: var(--sbb-train-formation-wagon-dimension-long);--_sbb-train-formation-wagon-height: var(--sbb-train-formation-wagon-dimension-short);display:grid;grid-template:\"start sectors end\" auto \"start trains end\" auto/auto 1fr auto;position:relative;overflow:auto visible;gap:var(--_sbb-train-formation-sectors-to-train-gap, 0) 0;padding-block:var(--sbb-train-formation-padding);color:var(--sbb-train-formation-text-color);font-size:var(--sbb-text-font-size-xs);letter-spacing:var(--sbb-typo-letter-spacing-text);line-height:var(--sbb-typo-line-height-text)}:host:before,:host:after{content:\"\";display:block;width:var(--sbb-train-formation-scroll-padding)}:host:before{grid-area:start}:host:after{grid-area:end}:host(:focus-visible){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}:host(:is(:state(has-sectors),[state--has-sectors])){--_sbb-train-formation-sectors-to-train-gap: var(--sbb-train-formation-gap)}:host(:is(:state(has-direction-label),[state--has-direction-label])){--_sbb-train-formation-reserve-spacing-display: block}:host([orientation=vertical]){--_sbb-train-formation-wagon-width: var(--sbb-train-formation-wagon-dimension-short);--_sbb-train-formation-wagon-height: var(--sbb-train-formation-wagon-dimension-long);--_sbb-train-formation-flex-direction: column;--_sbb-train-formation-flex-direction-inverted: row;grid-template:\"start start\" auto \"sectors trains\" 1fr \"end end\" auto;overflow:visible auto;padding-block:unset;padding-inline:var(--sbb-train-formation-padding);gap:0 var(--_sbb-train-formation-sectors-to-train-gap, 0);width:fit-content}:host([orientation=vertical]):before,:host([orientation=vertical]):after{width:auto;height:var(--sbb-train-formation-scroll-padding)}.sbb-train-formation__sectors{display:flex;grid-area:sectors;gap:var(--sbb-train-formation-wagon-gap);flex-direction:var(--_sbb-train-formation-flex-direction)}.sbb-train-formation__sector{--_wagon-sum: var(--sbb-train-formation-wagon-count) * var(--sbb-train-formation-wagon-dimension-long);--_blocked-passage-sum: var(--sbb-train-formation-wagon-blocked-passage-count) * var(--sbb-train-formation-blocked-passage-dimension);--_total-count: calc( var(--sbb-train-formation-wagon-count) + var(--sbb-train-formation-wagon-blocked-passage-count) );--_gap-sum: calc((var(--_total-count) - 1) * var(--sbb-train-formation-wagon-gap));--_sector-width: calc(var(--_wagon-sum) + var(--_blocked-passage-sum) + var(--_gap-sum));--_sector-line-length: calc(.5 * var(--_sector-width));flex:0 0 var(--_sector-width);display:flex;flex-direction:var(--_sbb-train-formation-flex-direction);justify-content:center;overflow:clip visible}:host([orientation=vertical]) .sbb-train-formation__sector{overflow:visible clip}.sbb-train-formation__sector-sticky-wrapper{position:sticky;inset:auto 0;padding:0 var(--sbb-train-formation-sector-padding);margin:0 var(--sbb-train-formation-sector-margin);white-space:nowrap}:host([orientation=vertical]) .sbb-train-formation__sector-sticky-wrapper{writing-mode:sideways-lr;inset:0 auto;padding:var(--sbb-train-formation-sector-padding) 0;margin:var(--sbb-train-formation-sector-margin) 0}.sbb-train-formation__sector-sticky-wrapper:before,.sbb-train-formation__sector-sticky-wrapper:after{content:\"\";position:absolute;inset-block:calc(50% - var(--sbb-train-formation-sector-line-width) / 2);border-block-end:var(--sbb-train-formation-sector-line-width) solid var(--sbb-train-formation-sector-line-color);width:var(--_sector-line-length)}:host([orientation=vertical]) .sbb-train-formation__sector-sticky-wrapper:before,:host([orientation=vertical]) .sbb-train-formation__sector-sticky-wrapper:after{width:auto;height:var(--_sector-line-length)}.sbb-train-formation__sector-sticky-wrapper:before{inset-inline-end:100%}.sbb-train-formation__sector-sticky-wrapper:after{inset-inline-start:100%}.sbb-train-formation__trains{grid-area:trains}.sbb-train-formation__train-list{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-direction:var(--_sbb-train-formation-flex-direction);gap:var(--sbb-train-formation-wagon-gap)}.sbb-train-formation__train-list>:is(li,span){display:inline-flex}", _ = (() => {
|
|
8
|
+
let _ = l(s), v, y = [], b = [], x, S = [], C = [], w, T = [], E = [];
|
|
9
|
+
return class extends _ {
|
|
10
|
+
static {
|
|
11
|
+
let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(_[Symbol.metadata] ?? null) : void 0;
|
|
12
|
+
v = [a({ reflect: !0 })], x = [a({ reflect: !0 })], w = [o()], e(this, null, v, {
|
|
13
|
+
kind: "accessor",
|
|
14
|
+
name: "view",
|
|
15
|
+
static: !1,
|
|
16
|
+
private: !1,
|
|
17
|
+
access: {
|
|
18
|
+
has: (e) => "view" in e,
|
|
19
|
+
get: (e) => e.view,
|
|
20
|
+
set: (e, t) => {
|
|
21
|
+
e.view = t;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
metadata: t
|
|
25
|
+
}, y, b), e(this, null, x, {
|
|
26
|
+
kind: "accessor",
|
|
27
|
+
name: "orientation",
|
|
28
|
+
static: !1,
|
|
29
|
+
private: !1,
|
|
30
|
+
access: {
|
|
31
|
+
has: (e) => "orientation" in e,
|
|
32
|
+
get: (e) => e.orientation,
|
|
33
|
+
set: (e, t) => {
|
|
34
|
+
e.orientation = t;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
metadata: t
|
|
38
|
+
}, S, C), e(this, null, w, {
|
|
39
|
+
kind: "accessor",
|
|
40
|
+
name: "_sectors",
|
|
41
|
+
static: !1,
|
|
42
|
+
private: !1,
|
|
43
|
+
access: {
|
|
44
|
+
has: (e) => "_sectors" in e,
|
|
45
|
+
get: (e) => e._sectors,
|
|
46
|
+
set: (e, t) => {
|
|
47
|
+
e._sectors = t;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
metadata: t
|
|
51
|
+
}, T, E), t && Object.defineProperty(this, Symbol.metadata, {
|
|
52
|
+
enumerable: !0,
|
|
53
|
+
configurable: !0,
|
|
54
|
+
writable: !0,
|
|
55
|
+
value: t
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static {
|
|
59
|
+
this.elementName = "sbb-train-formation";
|
|
60
|
+
}
|
|
61
|
+
static {
|
|
62
|
+
this.styles = [
|
|
63
|
+
d,
|
|
64
|
+
u,
|
|
65
|
+
i(g)
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
#e;
|
|
69
|
+
get view() {
|
|
70
|
+
return this.#e;
|
|
71
|
+
}
|
|
72
|
+
set view(e) {
|
|
73
|
+
this.#e = e;
|
|
74
|
+
}
|
|
75
|
+
#t;
|
|
76
|
+
get orientation() {
|
|
77
|
+
return this.#t;
|
|
78
|
+
}
|
|
79
|
+
set orientation(e) {
|
|
80
|
+
this.#t = e;
|
|
81
|
+
}
|
|
82
|
+
#n;
|
|
83
|
+
get _sectors() {
|
|
84
|
+
return this.#n;
|
|
85
|
+
}
|
|
86
|
+
set _sectors(e) {
|
|
87
|
+
this.#n = e;
|
|
88
|
+
}
|
|
89
|
+
constructor() {
|
|
90
|
+
super(), this.listChildLocalNames = ["sbb-train"], this.#e = t(this, y, "side"), this.#t = (t(this, b), t(this, S, "horizontal")), this.#n = (t(this, C), t(this, T, [])), this._language = (t(this, E), new c(this)), this.addEventListener?.("trainslotchange", (e) => {
|
|
91
|
+
this._readSectors(e), this._readDirectionLabel(e);
|
|
92
|
+
}), this.addEventListener?.("sectorchange", (e) => this._readSectors(e)), this.addEventListener?.("directionlabelchange", (e) => this._readDirectionLabel(e));
|
|
93
|
+
}
|
|
94
|
+
connectedCallback() {
|
|
95
|
+
super.connectedCallback(), this.classList.add("sbb-scrollbar");
|
|
96
|
+
}
|
|
97
|
+
_readDirectionLabel(e) {
|
|
98
|
+
e?.stopPropagation(), this.toggleState("has-direction-label", Array.from(this.querySelectorAll?.("sbb-train") ?? []).some((e) => !!e.directionLabel));
|
|
99
|
+
}
|
|
100
|
+
_readSectors(e) {
|
|
101
|
+
e?.stopPropagation(), this._sectors = Array.from(this.querySelectorAll?.("sbb-train-wagon,sbb-train-wagon-button,sbb-train-wagon-link,sbb-train-blocked-passage") ?? []).reduce((e, t) => {
|
|
102
|
+
let n = e[e.length - 1];
|
|
103
|
+
if (t.localName.startsWith("sbb-train-wagon")) {
|
|
104
|
+
let r = t.sector ?? t.getAttribute("sector");
|
|
105
|
+
!n.label && r && (n.label = r), !r || n.label === r ? n.wagonCount++ : e.push({
|
|
106
|
+
label: r,
|
|
107
|
+
wagonCount: 1,
|
|
108
|
+
blockedPassageCount: 0
|
|
109
|
+
});
|
|
110
|
+
} else t.localName === "sbb-train-blocked-passage" && n.blockedPassageCount++;
|
|
111
|
+
return e;
|
|
112
|
+
}, [{
|
|
113
|
+
wagonCount: 0,
|
|
114
|
+
blockedPassageCount: 0
|
|
115
|
+
}]), this.toggleState("has-sectors", this._sectors.some((e) => !!e.label));
|
|
116
|
+
}
|
|
117
|
+
willUpdate(e) {
|
|
118
|
+
super.willUpdate(e), e.has("listChildren") && (this._readSectors(), this._readDirectionLabel());
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
return n`
|
|
122
|
+
${this._sectors.length && this._sectors[0].label !== void 0 ? n`<div class="sbb-train-formation__sectors" aria-hidden="true">
|
|
123
|
+
${this._sectors.map((e) => n`<span
|
|
124
|
+
class="sbb-train-formation__sector"
|
|
125
|
+
style=${h({
|
|
126
|
+
"--sbb-train-formation-wagon-count": e.wagonCount,
|
|
127
|
+
"--sbb-train-formation-wagon-blocked-passage-count": e.blockedPassageCount
|
|
128
|
+
})}
|
|
129
|
+
>
|
|
130
|
+
<span class="sbb-train-formation__sector-sticky-wrapper">
|
|
131
|
+
${`${e.wagonCount === 1 && e.label ? p[this._language.current] : f[this._language.current]} ${e.label ? e.label : ""}`}
|
|
132
|
+
</span>
|
|
133
|
+
</span>`)}
|
|
134
|
+
</div>` : r}
|
|
135
|
+
|
|
136
|
+
<div class="sbb-train-formation__trains">
|
|
137
|
+
${this.renderList({
|
|
138
|
+
class: "sbb-train-formation__train-list",
|
|
139
|
+
ariaLabel: m[this._language.current]
|
|
140
|
+
})}
|
|
141
|
+
</div>
|
|
142
|
+
`;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
})();
|
|
146
|
+
//#endregion
|
|
147
|
+
export { _ as t };
|