From 61bd6fecf60f8d4d9f4e36b977249c42ee326535 Mon Sep 17 00:00:00 2001 From: Osman Minaz Date: Tue, 27 Aug 2024 10:59:39 +0200 Subject: [PATCH 01/12] feat: initial implementation --- .../core/timetable/access-leg-helper.ts | 11 +++++++++++ .../pearl-chain-time/pearl-chain-time.ts | 5 +++++ .../timetable-row/timetable-row.ts | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/src/elements-experimental/core/timetable/access-leg-helper.ts b/src/elements-experimental/core/timetable/access-leg-helper.ts index fe638ffa10..5ba082c16d 100644 --- a/src/elements-experimental/core/timetable/access-leg-helper.ts +++ b/src/elements-experimental/core/timetable/access-leg-helper.ts @@ -158,6 +158,7 @@ export function getDepartureArrivalTimeAttribute( departureWalk: number, arrivalWalk: number, currentLanguage: string, + a11yFootpath?: boolean, ): { renderDepartureTimeAttribute: () => TemplateResult; renderArrivalTimeAttribute: () => TemplateResult; @@ -195,6 +196,16 @@ export function getDepartureArrivalTimeAttribute( }; function renderDepartureTimeAttribute(): TemplateResult { + if (a11yFootpath) { + renderTransferTime( + connectionFirstLeg?.duration || 0, + 'wheelchair-small', + currentLanguage, + connectionFirstLeg?.text || '', + 'departure', + ); + } + return html` ${connectionFirstLeg ? renderWalkTime(connectionFirstLeg.duration, connectionFirstLeg.text, 'left') diff --git a/src/elements-experimental/pearl-chain-time/pearl-chain-time.ts b/src/elements-experimental/pearl-chain-time/pearl-chain-time.ts index 1dff9a0554..9126585171 100644 --- a/src/elements-experimental/pearl-chain-time/pearl-chain-time.ts +++ b/src/elements-experimental/pearl-chain-time/pearl-chain-time.ts @@ -54,6 +54,11 @@ export class SbbPearlChainTimeElement extends LitElement { */ @property({ attribute: 'disable-animation', type: Boolean }) public disableAnimation?: boolean; + /** + * TODO: comment + */ + @property({ attribute: 'a11y-footpath', type: Boolean }) public a11yFootpath?: boolean; + /** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */ @property() public set now(value: SbbDateLike | undefined) { diff --git a/src/elements-experimental/timetable-row/timetable-row.ts b/src/elements-experimental/timetable-row/timetable-row.ts index ead6ff8091..9c28c4ca21 100644 --- a/src/elements-experimental/timetable-row/timetable-row.ts +++ b/src/elements-experimental/timetable-row/timetable-row.ts @@ -226,6 +226,11 @@ export class SbbTimetableRowElement extends LitElement { */ @property({ attribute: 'loading-trip', type: Boolean }) public loadingTrip = false; + /** + * The Footpath attribute for rendering different icons + */ + @property({ attribute: 'a11y-footpath', type: Boolean }) public a11yFootpath?: boolean; + /** * The loading state - * when this is true it will be render skeleton with an idling animation @@ -539,6 +544,7 @@ export class SbbTimetableRowElement extends LitElement { .departureWalk=${departureWalk} .arrivalWalk=${arrivalWalk} ?disable-animation=${this.disableAnimation} + ?a11y-footpath=${this.a11yFootpath} .now=${this.now} >