Skip to content

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

Open
giulio-leone wants to merge 2 commits into
italia:mainfrom
giulio-leone:fix/546-boolean-attribute-inputs
Open

fix(components): add inputToBoolean transform to all pure-boolean inputs (#546)#696
giulio-leone wants to merge 2 commits into
italia:mainfrom
giulio-leone:fix/546-boolean-attribute-inputs

Conversation

@giulio-leone

Copy link
Copy Markdown
Contributor

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.

…uts (italia#546)

Apply the inputToBoolean transform (wrapping Angular's booleanAttribute)
to every @input that accepts only boolean values but was missing the
coercion. This allows idiomatic attribute-only syntax:

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

Components updated:
- ItAutocompleteComponent: required
- ItPasswordInputComponent: required, useNumber, useCapitalCase,
  useSmallCase, useSpecialCharacters
- ItChipComponent: showCloseButton, disabled (setters)
- ItDimmerComponent: active (setter)
- ItDimmerButtonsComponent: hasOneButton (setter)

Union-type inputs (readonly, progress, backdrop, validationMode) are
intentionally excluded — they accept non-boolean string values.

Includes coercion tests for chip and dimmer components.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented Mar 28, 2026

Copy link
Copy Markdown

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

@simionato-ennovaresearch

Copy link
Copy Markdown

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

@valeriocomo valeriocomo requested a review from astagi April 7, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Utilizzare booleanAttribute per la definizione degli input booleani di tutti i componenti

2 participants