@sbb-esta/lyne-elements-dev 5.11.0-dev.1791968952 → 5.11.0-dev.1791974141

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.
@@ -3979,12 +3979,14 @@ var SbbScrollController = class {
3979
3979
  this._scrollProperties.savedTop = document.body.style.top;
3980
3980
  this._scrollProperties.savedInsetInline = document.body.style.insetInline;
3981
3981
  this._scrollProperties.savedOverflow = document.body.style.overflow;
3982
+ this._scrollProperties.savedMinHeight = document.body.style.minHeight;
3982
3983
  const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
3983
3984
  document.body.style.position = "fixed";
3984
3985
  document.body.style.top = `-${this._scrollProperties.scrollPosition}px`;
3985
3986
  document.body.style.insetInline = `0 ${scrollbarWidth}px`;
3986
3987
  document.body.style.overflow = "hidden";
3987
3988
  document.body.style.setProperty("--sbb-scrollbar-reserved-space", `${scrollbarWidth}px`);
3989
+ document.body.style.minHeight = "100dvh";
3988
3990
  document.addEventListener("touchstart", this._touchStart, { passive: true });
3989
3991
  document.addEventListener("touchmove", this._touchMove, { passive: false });
3990
3992
  document.body.toggleAttribute("data-sbb-scroll-disabled", true);
@@ -3999,6 +4001,7 @@ var SbbScrollController = class {
3999
4001
  document.body.style.insetInline = this._scrollProperties.savedInsetInline || "";
4000
4002
  document.body.style.overflow = this._scrollProperties.savedOverflow || "";
4001
4003
  document.body.style.removeProperty("--sbb-scrollbar-reserved-space");
4004
+ document.body.style.minHeight = this._scrollProperties.savedMinHeight || "";
4002
4005
  document.removeEventListener("touchstart", this._touchStart);
4003
4006
  document.removeEventListener("touchmove", this._touchMove);
4004
4007
  document.body.removeAttribute("data-sbb-scroll-disabled");
@@ -0,0 +1,82 @@
1
+ import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'lit';
2
+ import { SbbElement } from '../../core.ts';
3
+ import type { SbbPearlChainNodeElement } from '../../pearl-chain.pure.ts';
4
+ /**
5
+ * It displays a chain of `sbb-pearl-chain-node` elements connected by lines,
6
+ * representing a journey with its stops.
7
+ */
8
+ export declare class SbbPearlChainElement extends SbbElement {
9
+ static readonly elementName: string;
10
+ static styles: CSSResultGroup;
11
+ /**
12
+ * A configured date which acts as the current date instead of the real current date.
13
+ * Only recommended for testing purposes.
14
+ */
15
+ set now(value: Date | string | null);
16
+ get now(): Date;
17
+ private _userNow;
18
+ private _systemNow;
19
+ /** Returns the registered `sbb-pearl-chain-node` elements, in DOM order. */
20
+ get nodes(): readonly SbbPearlChainNodeElement[];
21
+ private _svgElem;
22
+ private _nodes;
23
+ private _orientation;
24
+ private _systemNowIntervalId;
25
+ private _debounceId;
26
+ constructor();
27
+ /**
28
+ * Returns the relative position (0 for the first node, 1 for the last one) of each node,
29
+ * in DOM order, proportional to its `departure` time (or `arrival` if there is no `departure`).
30
+ */
31
+ calculateNodeWeights(): number[];
32
+ /**
33
+ * Registers a `sbb-pearl-chain-node` with this pearl chain.
34
+ * @internal
35
+ */
36
+ addNode(node: SbbPearlChainNodeElement): void;
37
+ /**
38
+ * Unregisters a `sbb-pearl-chain-node` from this pearl chain.
39
+ * @internal
40
+ */
41
+ removeNode(node: SbbPearlChainNodeElement): void;
42
+ connectedCallback(): void;
43
+ disconnectedCallback(): void;
44
+ protected updated(changedProperties: PropertyValues<this>): void;
45
+ protected firstUpdated(changedProperties: PropertyValues<this>): void;
46
+ /**
47
+ * Optimizes `_positionLines()` calls by debouncing them (called by observers).
48
+ */
49
+ private _debouncedPositionLines;
50
+ /**
51
+ * Positions the rendered lines (and dot) to connect the bullet nodes, and toggles
52
+ * `:state(horizontal)` based on whether nodes are spread more horizontally than vertically.
53
+ */
54
+ private _positionLines;
55
+ /** Sets the coordinates of a line svg element. */
56
+ private _setLineCords;
57
+ /** Toggles `:state(horizontal)` when the nodes are spread more horizontally than vertically. */
58
+ private _updateOrientation;
59
+ /** No gap for `start` or `end` bullets. */
60
+ private _needsGap;
61
+ /**
62
+ * Ratio (0-1) of "now" between the line's start departure and end arrival, or
63
+ * `null` if "now" is outside that window (or either date is missing).
64
+ */
65
+ private _progressRatio;
66
+ /**
67
+ * Returns a map of CSS classes for a line segment between two nodes, based on its state.
68
+ */
69
+ private _lineClasses;
70
+ /** A line is "past" once we've already arrived at its ending node. */
71
+ private _isLinePast;
72
+ /** A line is "current" if "now" falls between its start departure and end arrival. */
73
+ private _isLineCurrent;
74
+ /** Renders one segment: a single line, or (when "now" falls within it) a gray/normal split + pulsing dot. */
75
+ private _renderSegment;
76
+ protected render(): TemplateResult;
77
+ }
78
+ declare global {
79
+ interface HTMLElementTagNameMap {
80
+ 'sbb-pearl-chain': SbbPearlChainElement;
81
+ }
82
+ }
@@ -0,0 +1,48 @@
1
+ import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'lit';
2
+ import { SbbElement } from '../../core.ts';
3
+ /**
4
+ * The possible bullet types of a `sbb-pearl-chain-node`.
5
+ */
6
+ export type SbbPearlChainNodeType = 'start' | 'end' | 'stop' | 'skip' | 'commercial' | 'boarding' | 'alighting' | 'exceptional' | 'exceptional-skip' | 'exceptional-boarding' | 'exceptional-alighting' | 'stop-duty' | 'stop-on-demand' | 'boarding-on-demand' | 'alighting-on-demand';
7
+ /**
8
+ * Represents a station/point of interest within a `sbb-pearl-chain`.
9
+ */
10
+ export declare class SbbPearlChainNodeElement extends SbbElement {
11
+ static readonly elementName: string;
12
+ static styles: CSSResultGroup;
13
+ /** Decides how the bullet is rendered. Defaults to _empty_ (no bullet). */
14
+ accessor type: SbbPearlChainNodeType | null;
15
+ /** Marks the node as disrupted, coloring the bullet red (if rendered). */
16
+ accessor disrupted: 'arrival' | 'departure' | true | null;
17
+ /** Marks the node as a walk connection. Does not affect the bullet color. */
18
+ accessor walk: 'arrival' | 'departure' | true | null;
19
+ /** Marks the connection as unsure, rendering the line dashed. Does not affect the bullet. */
20
+ accessor unsure: 'arrival' | 'departure' | true | null;
21
+ /** Marks the node as irrelevant, coloring the bullet gray (if rendered); supersedes `disrupted`. */
22
+ accessor irrelevant: 'arrival' | 'departure' | true | null;
23
+ /** The arrival date/time at this node. Accepts ISO 8601 datetime strings. */
24
+ set arrival(value: Date | string | null);
25
+ get arrival(): Date | null;
26
+ private _arrival;
27
+ /** The departure date/time at this node. Accepts ISO 8601 datetime strings. */
28
+ set departure(value: Date | string | null);
29
+ get departure(): Date | null;
30
+ private _departure;
31
+ protected get now(): Date;
32
+ private _now;
33
+ /** The bullet svg; read by the parent chain to measure the exact bullet position. */
34
+ protected svgElem: Element | undefined;
35
+ private _chain;
36
+ constructor();
37
+ connectedCallback(): void;
38
+ disconnectedCallback(): void;
39
+ protected updated(changedProperties: PropertyValues<this>): void;
40
+ private _isPast;
41
+ private _renderBullet;
42
+ protected render(): TemplateResult;
43
+ }
44
+ declare global {
45
+ interface HTMLElementTagNameMap {
46
+ 'sbb-pearl-chain-node': SbbPearlChainNodeElement;
47
+ }
48
+ }
@@ -0,0 +1 @@
1
+ export * from './pearl-chain.pure.ts';
@@ -0,0 +1,10 @@
1
+ import { SbbPearlChainElement, SbbPearlChainNodeElement } from "./pearl-chain.pure.js";
2
+
3
+ export * from "./pearl-chain.pure.js"
4
+
5
+ //#region src/elements/pearl-chain.ts
6
+ /** @entrypoint */
7
+ SbbPearlChainElement.define();
8
+ SbbPearlChainNodeElement.define();
9
+
10
+ //#endregion
@@ -0,0 +1,3 @@
1
+ /** @entrypoint */
2
+ export * from './pearl-chain/pearl-chain-node/pearl-chain-node.component.ts';
3
+ export * from './pearl-chain/pearl-chain/pearl-chain.component.ts';