Open kyubisation opened 10 months ago
thank you for the specification!
my thoughts:
sbb-pearl-chain:
sbb-pearl-chain-leg:
-Question about 'skipped': 'Skipped' can represent either the departure stop or the arrival stop. Should the leg siblings be aware of each skipped property, or should we implement it with two separate properties: 'departureSkipped' and 'arrivalSkipped'?
@kyubisation . Thanks for writing the specification. It looks good for me in general. Some topics:
@WalkingOS I think it's better to use arrivalSkipped and departureSkipped.
Feature Description
We want to refactor the pearl chain to be more idiomatic to web components.
<sbb-pearl-chain>
:After discussion, we decided to exclude arrival and departure properties from
sbb-pearl-chain
, but we will later create designated components likesbb-pearl-chain-time
.~Should have properties
arrival
anddeparture
~SbbDateLike | null
~null
~null
~<time>
elements in the Shadow DOM (similar to how it is now)~It should handle the logic for the progress of a journey
marker: 'static' | 'pulsing' = 'static'
, which controls whether the active state marker should pulse or not (static)With the attribute
now
, it should be possible to override the current timeWhen the whole trip is cancelled, only one leg (cancelled) should be displayed. This is left to the consumer and should be documented in the readme.
<sbb-pearl-chain-leg>
:disruption
,past
and string propertyskip: 'departure' | 'arrival' = 'departure'
arrival
anddeparture
SbbDateLike | null
--sbb-pearl-chain-leg-weight
, which is applied to the flex ruleflex: var(--sbb-pearl-chain-leg-weight, 1) var(--sbb-pearl-chain-leg-weight, 1);
(see example https://stackblitz.com/edit/js-vjmxgz?file=style.css) (This allows just subtracting the departure Date from the arrival Date and setting this value as--sbb-pearl-chain-leg-weight
and flex will automatically calculate width)DOM Examples
Without time being displayed
With time being displayed
Definition of Done