Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
🥢 feat: extra form values by form state#12936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
github-actionsbot commentedJul 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Size Change: +505 B (+0.92%) Total Size: 55.7 kB
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR adds support for returning extra form values based on form state (dirty or touched) via a newGetValuesConfig
option.
- Introduces
extractFormValues
utility to filter values by state - Adds
GetValuesConfig
type and overloads toUseFormGetValues
- Integrates
extractFormValues
intocreateFormControl.getValues
and updates tests & API report
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/utils/extractFormValues.ts | New helper to recursively extract form values based on state |
src/types/form.ts | DefinedEitherOption &GetValuesConfig , updatedgetValues overloads |
src/logic/createFormControl.ts | WiredGetValuesConfig intogetValues implementation |
src/tests/utils/extractFormValues.test.ts | Added unit test forextractFormValues |
reports/api-extractor.md.api.md | Updated API extractor output for new types |
package.json | Tweaked test script flags |
Comments suppressed due to low confidence (3)
src/tests/utils/extractFormValues.test.ts:4
- Consider adding a test for the
dirtyFields
path to ensureextractFormValues
correctly filters values whendirtyFields
is passed.
it('should return extracted form values based on form state', () => {
src/types/form.ts:273
- [nitpick]
EitherOption
may be ambiguous; consider renaming to something more descriptive likeExclusiveOption
orOneOfOptions
to clarify its purpose.
type EitherOption<T> = {
reports/api-extractor.md.api.md:367
- The public type
GetValuesConfig
relies onEitherOption
, butEitherOption
isn't exported from the entry point. Please add it to the package exports or adjust the API so no internal type is leaked.
// Warning: (ae-forgotten-export) The symbol "EitherOption" needs to be exported by the entry point index.d.ts
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
close#12931