-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
story(sbb-pearl-chain): Refactor initial implementation #2335
Comments
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 .
@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 propertiesarrival
anddeparture
Should be getter/setter, which acceptSbbDateLike | null
Defaults tonull
See date parsing logic belowIf the date cannot be parsed in the setter, assignnull
If defined and valid, render as<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
The text was updated successfully, but these errors were encountered: