spartan icon indicating copy to clipboard operation
spartan copied to clipboard

feat: improved form field integration

Open thatsamsonkid opened this issue 1 month ago • 5 comments

  • fix #591

PR Checklist

Please check if your PR fulfills the following requirements:

  • [ ] The commit message follows our guidelines: https://github.com/spartan-ng/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [x] Bugfix
  • [x] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Documentation content changes
  • [ ] Other... Please describe:

Which package are you modifying?

Primitives

  • [ ] accordion
  • [ ] alert
  • [ ] alert-dialog
  • [ ] aspect-ratio
  • [ ] autocomplete
  • [ ] avatar
  • [ ] badge
  • [ ] breadcrumb
  • [ ] button
  • [ ] calendar
  • [ ] card
  • [ ] carousel
  • [ ] checkbox
  • [ ] collapsible
  • [ ] combobox
  • [ ] command
  • [ ] context-menu
  • [ ] data-table
  • [ ] date-picker
  • [ ] dialog
  • [ ] dropdown-menu
  • [x] form-field
  • [ ] hover-card
  • [ ] icon
  • [x] input
  • [ ] input-group
  • [ ] input-otp
  • [ ] label
  • [ ] menubar
  • [ ] navigation-menu
  • [ ] pagination
  • [ ] popover
  • [ ] progress
  • [ ] radio-group
  • [ ] scroll-area
  • [x] select
  • [ ] separator
  • [ ] sheet
  • [ ] sidebar
  • [ ] skeleton
  • [ ] slider
  • [ ] sonner
  • [ ] spinner
  • [ ] switch
  • [ ] table
  • [ ] tabs
  • [ ] textarea
  • [ ] toggle
  • [ ] toggle-group
  • [ ] tooltip
  • [ ] typography

Others

  • [ ] trpc
  • [ ] nx
  • [ ] repo
  • [ ] cli

What is the current behavior?

Closes #

What is the new behavior?

Does this PR introduce a breaking change?

  • [ ] Yes
  • [ ] No

Other information

thatsamsonkid avatar Oct 05 '25 11:10 thatsamsonkid

Maybe we can imlement that as well for the autocomplete and the date picker? This would be a awesome addition :)

Sure let me see what I can do

thatsamsonkid avatar Oct 06 '25 13:10 thatsamsonkid

hey @thatsamsonkid, the angular signal form will not carry over the .ng-invalid and .ng-touched .ng-dirty classes, can we add our own data-states for that and align all our component which are listening to the classes?

MerlinMoos avatar Oct 16 '25 20:10 MerlinMoos

hey @thatsamsonkid, the angular signal form will not carry over the .ng-invalid and .ng-touched .ng-dirty classes, can we add our own data-states for that and align all our component which are listening to the classes?

Oh really is that the case, I wasn't aware. Hmmm ok will see. I would maybe consider doing that separately just to keep this PR focused. I've made progress, just havent pushed the change. I have this working for datepicker and autocomplete just facing some change detection issues and also checking on your other comment to change to a signal

thatsamsonkid avatar Oct 17 '25 13:10 thatsamsonkid

Looks really good already! I recently added a new directive for Textarea (https://github.com/spartan-ng/spartan/pull/934) we might need to add support for that as well.

marcjulian avatar Oct 21 '25 08:10 marcjulian

Looks really good already! I recently added a new directive for Textarea (#934) we might need to add support for that as well.

Thanks and ok will take a look at it, I'm just missing adding tests and just need to verify the error state look and feel, autocomplete doesn't look quite right so I need to check that one.

thatsamsonkid avatar Oct 21 '25 11:10 thatsamsonkid