design-angular-kit icon indicating copy to clipboard operation
design-angular-kit copied to clipboard

fix(components): add inputToBoolean transform to all pure-boolean inputs (#546)

Open giulio-leone opened this issue 8 months ago • 2 comments

Summary

Fixes #546

Applies the inputToBoolean transform (which wraps Angular's built-in booleanAttribute) to every @Input that accepts only boolean values but was missing the coercion. This allows idiomatic attribute-only syntax:

<it-chip showCloseButton="true" disabled="true">

<it-chip showCloseButton disabled>

Components updated

Component Inputs
ItAutocompleteComponent required
ItPasswordInputComponent required, useNumber, useCapitalCase, useSmallCase, useSpecialCharacters
ItChipComponent showCloseButton (setter), disabled (setter)
ItDimmerComponent active (setter)
ItDimmerButtonsComponent hasOneButton (setter)

Intentionally excluded

Union-type inputs that accept non-boolean string values are not modified:

  • readonly: boolean | 'plaintext'
  • progress: number | boolean
  • backdrop: 'static' | boolean
  • validationMode: boolean | 'only-valid' | 'only-invalid'

Testing

  • New coercion tests for chip (showCloseButton/disabled attribute-only + string coercion)
  • New coercion test for dimmer (active attribute-only)
  • All 113 tests passing (double gate). 0 lint errors.

⚠️ This reopens #652 which was accidentally closed due to fork deletion.

giulio-leone avatar Mar 25 '26 19:03 giulio-leone

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-angular-kit Ready Ready Preview Mar 28, 2026 4:01pm

Request Review

vercel[bot] avatar Mar 28 '26 16:03 vercel[bot]

@giulio-leone credo ci siano altri input che possono passare a booleanAttribute. Ne ricordo alcuni sulla <it-card>