Skip to content

Commit 25b7543

Browse files
harry-whorlowHarry Whorlowautofix-ci[bot]crutchcorn
authored
feat(core): onSubmit meta (#1167)
* chore: core api implementation * chore: angular implementation * chore: lit implementation * chore: react-form implementation * chore: solid form implementation * chore: vue form implementation * fix: ts build errors * chore: default to never * ci: apply automated fixes and generate docs * chore: pr comments * ci: apply automated fixes and generate docs * ci: apply automated fixes and generate docs * chore: add default passing of onSubmitMeta --------- Co-authored-by: Harry Whorlow <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Corbin Crutchley <[email protected]>
1 parent 1ba2006 commit 25b7543

File tree

82 files changed

+754
-403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+754
-403
lines changed

docs/framework/angular/reference/classes/tanstackfield.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: TanStackField
55

66
<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
77

8-
# Class: TanStackField\<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer\>
8+
# Class: TanStackField\<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta\>
99

1010
Defined in: [tanstack-field.directive.ts:32](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L32)
1111

@@ -47,6 +47,8 @@ Defined in: [tanstack-field.directive.ts:32](https://github.com/TanStack/form/bl
4747

4848
**TFormOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TParentData`\>
4949

50+
**TSubmitMeta**
51+
5052
## Implements
5153

5254
- `OnInit`
@@ -59,22 +61,22 @@ Defined in: [tanstack-field.directive.ts:32](https://github.com/TanStack/form/bl
5961
### new TanStackField()
6062

6163
```ts
62-
new TanStackField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer>(): TanStackField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer>
64+
new TanStackField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>(): TanStackField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>
6365
```
6466

6567
#### Returns
6668

67-
[`TanStackField`](tanstackfield.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`\>
69+
[`TanStackField`](tanstackfield.md)\<`TParentData`, `TName`, `TData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TFormOnMount`, `TFormOnChange`, `TFormOnChangeAsync`, `TFormOnBlur`, `TFormOnBlurAsync`, `TFormOnSubmit`, `TFormOnSubmitAsync`, `TFormOnServer`, `TSubmitMeta`\>
6870

6971
## Properties
7072

7173
### api
7274

7375
```ts
74-
api: FieldApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer>;
76+
api: FieldApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>;
7577
```
7678

77-
Defined in: [tanstack-field.directive.ts:131](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L131)
79+
Defined in: [tanstack-field.directive.ts:133](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L133)
7880

7981
***
8082

@@ -84,7 +86,7 @@ Defined in: [tanstack-field.directive.ts:131](https://github.com/TanStack/form/b
8486
optional asyncAlways: boolean;
8587
```
8688

87-
Defined in: [tanstack-field.directive.ts:81](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L81)
89+
Defined in: [tanstack-field.directive.ts:82](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L82)
8890

8991
If `true`, always run async validation, even if there are errors emitted during synchronous validation.
9092

@@ -102,7 +104,7 @@ FieldOptions.asyncAlways
102104
optional asyncDebounceMs: number;
103105
```
104106

105-
Defined in: [tanstack-field.directive.ts:80](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L80)
107+
Defined in: [tanstack-field.directive.ts:81](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L81)
106108

107109
The default time to debounce async validation if there is not a more specific debounce time passed.
108110

@@ -120,7 +122,7 @@ FieldOptions.asyncDebounceMs
120122
optional defaultMeta: Partial<FieldMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync>>;
121123
```
122124

123-
Defined in: [tanstack-field.directive.ts:108](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L108)
125+
Defined in: [tanstack-field.directive.ts:110](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L110)
124126

125127
An optional object with default metadata for the field.
126128

@@ -138,7 +140,7 @@ FieldOptions.defaultMeta
138140
optional defaultValue: NoInfer<TData>;
139141
```
140142

141-
Defined in: [tanstack-field.directive.ts:79](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L79)
143+
Defined in: [tanstack-field.directive.ts:80](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L80)
142144

143145
An optional default value for the field.
144146

@@ -156,7 +158,7 @@ FieldOptions.defaultValue
156158
optional disableErrorFlat: boolean;
157159
```
158160

159-
Defined in: [tanstack-field.directive.ts:129](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L129)
161+
Defined in: [tanstack-field.directive.ts:131](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L131)
160162

161163
Disable the `flat(1)` operation on `field.errors`. This is useful if you want to keep the error structure as is. Not suggested for most use-cases.
162164

@@ -174,7 +176,7 @@ FieldOptions.disableErrorFlat
174176
optional listeners: NoInfer<FieldListeners<TParentData, TName, TData>>;
175177
```
176178

177-
Defined in: [tanstack-field.directive.ts:107](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L107)
179+
Defined in: [tanstack-field.directive.ts:109](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L109)
178180

179181
A list of listeners which attach to the corresponding events
180182

@@ -192,7 +194,7 @@ FieldOptions.listeners
192194
name: TName;
193195
```
194196

195-
Defined in: [tanstack-field.directive.ts:75](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L75)
197+
Defined in: [tanstack-field.directive.ts:76](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L76)
196198

197199
The field name. The type will be `DeepKeys<TParentData>` to ensure your name is a deep key of the parent dataset.
198200

@@ -207,10 +209,10 @@ FieldOptions.name
207209
### tanstackField
208210

209211
```ts
210-
tanstackField: FormApi<TParentData, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer>;
212+
tanstackField: FormApi<TParentData, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TSubmitMeta>;
211213
```
212214

213-
Defined in: [tanstack-field.directive.ts:82](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L82)
215+
Defined in: [tanstack-field.directive.ts:83](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L83)
214216

215217
***
216218

@@ -220,7 +222,7 @@ Defined in: [tanstack-field.directive.ts:82](https://github.com/TanStack/form/bl
220222
optional unmount: () => void;
221223
```
222224

223-
Defined in: [tanstack-field.directive.ts:185](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L185)
225+
Defined in: [tanstack-field.directive.ts:189](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L189)
224226

225227
#### Returns
226228

@@ -234,7 +236,7 @@ Defined in: [tanstack-field.directive.ts:185](https://github.com/TanStack/form/b
234236
optional validators: NoInfer<FieldValidators<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync>>;
235237
```
236238

237-
Defined in: [tanstack-field.directive.ts:93](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L93)
239+
Defined in: [tanstack-field.directive.ts:95](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L95)
238240

239241
A list of validators to pass to the field
240242

@@ -252,7 +254,7 @@ FieldOptions.validators
252254
ngOnChanges(): void
253255
```
254256

255-
Defined in: [tanstack-field.directive.ts:197](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L197)
257+
Defined in: [tanstack-field.directive.ts:201](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L201)
256258

257259
A callback method that is invoked immediately after the
258260
default change detector has checked data-bound properties
@@ -277,7 +279,7 @@ OnChanges.ngOnChanges
277279
ngOnDestroy(): void
278280
```
279281

280-
Defined in: [tanstack-field.directive.ts:193](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L193)
282+
Defined in: [tanstack-field.directive.ts:197](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L197)
281283

282284
A callback method that performs custom clean-up, invoked immediately
283285
before a directive, pipe, or service instance is destroyed.
@@ -300,7 +302,7 @@ OnDestroy.ngOnDestroy
300302
ngOnInit(): void
301303
```
302304

303-
Defined in: [tanstack-field.directive.ts:187](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L187)
305+
Defined in: [tanstack-field.directive.ts:191](https://github.com/TanStack/form/blob/main/packages/angular-form/src/tanstack-field.directive.ts#L191)
304306

305307
A callback method that is invoked immediately after the
306308
default change detector has checked the directive's

docs/framework/angular/reference/functions/injectform.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: injectForm
88
# Function: injectForm()
99

1010
```ts
11-
function injectForm<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer>(opts?): FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer>
11+
function injectForm<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>(opts?): FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>
1212
```
1313

1414
Defined in: [inject-form.ts:9](https://github.com/TanStack/form/blob/main/packages/angular-form/src/inject-form.ts#L9)
@@ -33,12 +33,14 @@ Defined in: [inject-form.ts:9](https://github.com/TanStack/form/blob/main/packag
3333

3434
**TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
3535

36+
**TSubmitMeta**
37+
3638
## Parameters
3739

3840
### opts?
3941

40-
`FormOptions`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`\>
42+
`FormOptions`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
4143

4244
## Returns
4345

44-
`FormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`\>
46+
`FormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>

docs/framework/angular/reference/functions/injectstore.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: injectStore
88
# Function: injectStore()
99

1010
```ts
11-
function injectStore<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSelected>(form, selector?): Signal<TSelected>
11+
function injectStore<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, TSelected>(form, selector?): Signal<TSelected>
1212
```
1313

1414
Defined in: [inject-store.ts:9](https://github.com/TanStack/form/blob/main/packages/angular-form/src/inject-store.ts#L9)
@@ -33,13 +33,15 @@ Defined in: [inject-store.ts:9](https://github.com/TanStack/form/blob/main/packa
3333

3434
**TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
3535

36+
**TSubmitMeta**
37+
3638
**TSelected** = `NoInfer`\<`FormState`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`\>\>
3739

3840
## Parameters
3941

4042
### form
4143

42-
`FormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`\>
44+
`FormApi`\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
4345

4446
### selector?
4547

0 commit comments

Comments
 (0)