From 72d4678ea16b59992a10b14686a5418683590f44 Mon Sep 17 00:00:00 2001 From: planctus Date: Fri, 26 Jan 2024 10:28:25 +0200 Subject: [PATCH 1/2] fix(accordion): Fixing markup of the item, removing unneeded title-id - FRONT-4228 --- src/components.d.ts | 6 ++-- .../ecl-accordion/ecl-accordion-item.tsx | 20 +++++++---- .../ecl-accordion/ecl-accordion.stories.ts | 9 +++-- src/components/ecl-accordion/readme.md | 17 +++++----- .../__snapshots__/ecl-accordion.spec.tsx.snap | 33 ++++++++++++------- .../ecl-accordion/test/ecl-accordion.spec.tsx | 12 +++++-- 6 files changed, 63 insertions(+), 34 deletions(-) diff --git a/src/components.d.ts b/src/components.d.ts index d01dd726..85ac00e6 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -16,9 +16,10 @@ export namespace Components { "expanded": boolean; "itemId": string; "label": string; + "labelCollapsed": string; + "labelExpanded": string; "styleClass": string; "theme": string; - "titleId": string; } interface EclBanner { "bannerTitle": string; @@ -1442,9 +1443,10 @@ declare namespace LocalJSX { "expanded"?: boolean; "itemId"?: string; "label"?: string; + "labelCollapsed"?: string; + "labelExpanded"?: string; "styleClass"?: string; "theme"?: string; - "titleId"?: string; } interface EclBanner { "bannerTitle"?: string; diff --git a/src/components/ecl-accordion/ecl-accordion-item.tsx b/src/components/ecl-accordion/ecl-accordion-item.tsx index 15bf6be0..bf12bbbd 100644 --- a/src/components/ecl-accordion/ecl-accordion-item.tsx +++ b/src/components/ecl-accordion/ecl-accordion-item.tsx @@ -13,9 +13,10 @@ export class EclAccordionItem { @Prop() styleClass: string; @Prop() label: string; @Prop() itemId: string; - @Prop() titleId: string; @Prop({reflect:true}) expanded: boolean; @Prop() theme: string = 'ec'; + @Prop() labelExpanded = ''; + @Prop() labelCollapsed = ''; getClass(): string { return [ @@ -26,24 +27,31 @@ export class EclAccordionItem { } render() { + const titleId = `${this.itemId}-title`; + const contentId = `${this.itemId}-content`; return (

- + -
-

-

- + -
-

-