vmware-archive / clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.
http://clarity.design
MIT License
6.43k stars 763 forks source link

Regression: Accordion (from `@cds/angular`) lost `expanded` event declaration from version 5.5.2 to 5.5.3 (in d.ts file) #6639

Closed thojo closed 2 years ago

thojo commented 2 years ago

Describe the bug

After updating Clarity from 5.5.1 to 5.6.2 I cannot longer use the expanded event of <cds-accordion-panel> because the expandedChange property is missing from the d.ts file of CdsAccordionPanelDirective.

The build fails:

  <cds-accordion-panel [expanded]="someState" (expandedChange)="setSomeState($event.detail)">...</cds-accordion-panel>

error TS2339: Property 'detail' does not exist on type 'Event'.

How to reproduce

Steps to reproduce the behavior:

  1. Go to https://stackblitz.com/edit/clarity-dark-theme-v5-a3szgg?devtoolsheight=33&file=src/app/app.component.html
  2. Wait for npm install / ng serve to finish.
  3. See build errors in terminal.

Expected behavior

No build errors when using expandedChange's $event with <cds-accordion-panel> like with versions up to 5.5.2.

Steps to see working state with version 5.5.2 in StackBlitz demo:

  1. Stop ng serve with ctrl+c.
  2. Change version of @angular/cds to 5.5.2 in package.json.
  3. Run npm install in terminal.
  4. Wait for npm install / ng serve to finish.
  5. Preview is usable and accordion works.

Versions

Clarity project:

Clarity version:

Framework:

Framework version: Angular 11 and 12

coryrylan commented 2 years ago

You can workaround this by using the $any() directive in the template https://stackblitz.com/edit/clarity-dark-theme-v5-sv8hjs

(expandedChange)="collapsed = !$any($event).detail"
thojo commented 2 years ago

Yeah, thanks @coryrylan. I just realized that, too.

But my IDE still complains with a warning and other tooling might do the same.

However, it no longer blocks an update.

github-actions[bot] commented 2 years ago

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.