@tanstack/react-form 1.16.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/createFormHook.cjs.map +1 -1
- package/dist/cjs/createFormHook.d.cts +11 -11
- package/dist/cjs/nextjs/createServerValidate.cjs.map +1 -1
- package/dist/cjs/nextjs/createServerValidate.d.cts +2 -2
- package/dist/cjs/nextjs/types.d.cts +1 -1
- package/dist/cjs/remix/createServerValidate.cjs.map +1 -1
- package/dist/cjs/remix/createServerValidate.d.cts +2 -2
- package/dist/cjs/remix/types.d.cts +1 -1
- package/dist/cjs/start/createServerValidate.cjs.map +1 -1
- package/dist/cjs/start/createServerValidate.d.cts +2 -2
- package/dist/cjs/start/types.d.cts +1 -1
- package/dist/cjs/types.d.cts +2 -2
- package/dist/cjs/useField.cjs.map +1 -1
- package/dist/cjs/useField.d.cts +11 -11
- package/dist/cjs/useFieldGroup.cjs.map +1 -1
- package/dist/cjs/useFieldGroup.d.cts +4 -4
- package/dist/cjs/useForm.cjs.map +1 -1
- package/dist/cjs/useForm.d.cts +6 -6
- package/dist/cjs/useTransform.cjs.map +1 -1
- package/dist/cjs/useTransform.d.cts +1 -1
- package/dist/esm/createFormHook.d.ts +11 -11
- package/dist/esm/createFormHook.js.map +1 -1
- package/dist/esm/nextjs/createServerValidate.d.ts +2 -2
- package/dist/esm/nextjs/createServerValidate.js.map +1 -1
- package/dist/esm/nextjs/types.d.ts +1 -1
- package/dist/esm/remix/createServerValidate.d.ts +2 -2
- package/dist/esm/remix/createServerValidate.js.map +1 -1
- package/dist/esm/remix/types.d.ts +1 -1
- package/dist/esm/start/createServerValidate.d.ts +2 -2
- package/dist/esm/start/createServerValidate.js.map +1 -1
- package/dist/esm/start/types.d.ts +1 -1
- package/dist/esm/types.d.ts +2 -2
- package/dist/esm/useField.d.ts +11 -11
- package/dist/esm/useField.js.map +1 -1
- package/dist/esm/useFieldGroup.d.ts +4 -4
- package/dist/esm/useFieldGroup.js.map +1 -1
- package/dist/esm/useForm.d.ts +6 -6
- package/dist/esm/useForm.js.map +1 -1
- package/dist/esm/useTransform.d.ts +1 -1
- package/dist/esm/useTransform.js.map +1 -1
- package/package.json +20 -12
- package/src/createFormHook.tsx +43 -0
- package/src/nextjs/createServerValidate.ts +8 -0
- package/src/nextjs/types.ts +2 -0
- package/src/remix/createServerValidate.ts +8 -0
- package/src/remix/types.ts +2 -0
- package/src/start/createServerValidate.tsx +8 -0
- package/src/start/types.ts +2 -0
- package/src/types.ts +17 -1
- package/src/useField.tsx +90 -2
- package/src/useFieldGroup.tsx +18 -0
- package/src/useForm.tsx +22 -0
- package/src/useTransform.ts +1 -1
package/src/useFieldGroup.tsx
CHANGED
|
@@ -43,6 +43,8 @@ export type AppFieldExtendedReactFieldGroupApi<
|
|
|
43
43
|
TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
44
44
|
TOnSubmit extends undefined | FormValidateOrFn<TFormData>,
|
|
45
45
|
TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
46
|
+
TOnDynamic extends undefined | FormValidateOrFn<TFormData>,
|
|
47
|
+
TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
46
48
|
TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
47
49
|
TSubmitMeta,
|
|
48
50
|
TFieldComponents extends Record<string, ComponentType<any>>,
|
|
@@ -58,6 +60,8 @@ export type AppFieldExtendedReactFieldGroupApi<
|
|
|
58
60
|
TOnBlurAsync,
|
|
59
61
|
TOnSubmit,
|
|
60
62
|
TOnSubmitAsync,
|
|
63
|
+
TOnDynamic,
|
|
64
|
+
TOnDynamicAsync,
|
|
61
65
|
TOnServer,
|
|
62
66
|
TSubmitMeta
|
|
63
67
|
> &
|
|
@@ -95,6 +99,8 @@ export function useFieldGroup<
|
|
|
95
99
|
TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
96
100
|
TOnSubmit extends undefined | FormValidateOrFn<TFormData>,
|
|
97
101
|
TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
102
|
+
TOnDynamic extends undefined | FormValidateOrFn<TFormData>,
|
|
103
|
+
TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
98
104
|
TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
99
105
|
TComponents extends Record<string, ComponentType<any>>,
|
|
100
106
|
TFormComponents extends Record<string, ComponentType<any>>,
|
|
@@ -110,6 +116,8 @@ export function useFieldGroup<
|
|
|
110
116
|
TOnBlurAsync,
|
|
111
117
|
TOnSubmit,
|
|
112
118
|
TOnSubmitAsync,
|
|
119
|
+
TOnDynamic,
|
|
120
|
+
TOnDynamicAsync,
|
|
113
121
|
TOnServer,
|
|
114
122
|
TSubmitMeta,
|
|
115
123
|
TComponents,
|
|
@@ -129,6 +137,8 @@ export function useFieldGroup<
|
|
|
129
137
|
any,
|
|
130
138
|
any,
|
|
131
139
|
any,
|
|
140
|
+
any,
|
|
141
|
+
any,
|
|
132
142
|
TSubmitMeta,
|
|
133
143
|
TComponents,
|
|
134
144
|
TFormComponents
|
|
@@ -148,6 +158,8 @@ export function useFieldGroup<
|
|
|
148
158
|
TOnBlurAsync,
|
|
149
159
|
TOnSubmit,
|
|
150
160
|
TOnSubmitAsync,
|
|
161
|
+
TOnDynamic,
|
|
162
|
+
TOnDynamicAsync,
|
|
151
163
|
TOnServer,
|
|
152
164
|
TSubmitMeta,
|
|
153
165
|
TComponents,
|
|
@@ -166,6 +178,8 @@ export function useFieldGroup<
|
|
|
166
178
|
TOnBlurAsync,
|
|
167
179
|
TOnSubmit,
|
|
168
180
|
TOnSubmitAsync,
|
|
181
|
+
TOnDynamic,
|
|
182
|
+
TOnDynamicAsync,
|
|
169
183
|
TOnServer,
|
|
170
184
|
TSubmitMeta,
|
|
171
185
|
TComponents,
|
|
@@ -184,6 +198,8 @@ export function useFieldGroup<
|
|
|
184
198
|
TOnBlurAsync,
|
|
185
199
|
TOnSubmit,
|
|
186
200
|
TOnSubmitAsync,
|
|
201
|
+
TOnDynamic,
|
|
202
|
+
TOnDynamicAsync,
|
|
187
203
|
TOnServer,
|
|
188
204
|
TSubmitMeta,
|
|
189
205
|
TComponents,
|
|
@@ -235,6 +251,8 @@ export function useFieldGroup<
|
|
|
235
251
|
TOnBlurAsync,
|
|
236
252
|
TOnSubmit,
|
|
237
253
|
TOnSubmitAsync,
|
|
254
|
+
TOnDynamic,
|
|
255
|
+
TOnDynamicAsync,
|
|
238
256
|
TOnServer,
|
|
239
257
|
TSubmitMeta,
|
|
240
258
|
TComponents,
|
package/src/useForm.tsx
CHANGED
|
@@ -28,6 +28,8 @@ export interface ReactFormApi<
|
|
|
28
28
|
in out TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
29
29
|
in out TOnSubmit extends undefined | FormValidateOrFn<TFormData>,
|
|
30
30
|
in out TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
31
|
+
in out TOnDynamic extends undefined | FormValidateOrFn<TFormData>,
|
|
32
|
+
in out TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
31
33
|
in out TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
32
34
|
in out TSubmitMeta,
|
|
33
35
|
> {
|
|
@@ -43,6 +45,8 @@ export interface ReactFormApi<
|
|
|
43
45
|
TOnBlurAsync,
|
|
44
46
|
TOnSubmit,
|
|
45
47
|
TOnSubmitAsync,
|
|
48
|
+
TOnDynamic,
|
|
49
|
+
TOnDynamicAsync,
|
|
46
50
|
TOnServer,
|
|
47
51
|
TSubmitMeta
|
|
48
52
|
>
|
|
@@ -60,6 +64,8 @@ export interface ReactFormApi<
|
|
|
60
64
|
TOnBlurAsync,
|
|
61
65
|
TOnSubmit,
|
|
62
66
|
TOnSubmitAsync,
|
|
67
|
+
TOnDynamic,
|
|
68
|
+
TOnDynamicAsync,
|
|
63
69
|
TOnServer
|
|
64
70
|
>
|
|
65
71
|
>,
|
|
@@ -75,6 +81,8 @@ export interface ReactFormApi<
|
|
|
75
81
|
TOnBlurAsync,
|
|
76
82
|
TOnSubmit,
|
|
77
83
|
TOnSubmitAsync,
|
|
84
|
+
TOnDynamic,
|
|
85
|
+
TOnDynamicAsync,
|
|
78
86
|
TOnServer
|
|
79
87
|
>
|
|
80
88
|
>,
|
|
@@ -95,6 +103,8 @@ export type ReactFormExtendedApi<
|
|
|
95
103
|
TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
96
104
|
TOnSubmit extends undefined | FormValidateOrFn<TFormData>,
|
|
97
105
|
TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
106
|
+
TOnDynamic extends undefined | FormValidateOrFn<TFormData>,
|
|
107
|
+
TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
98
108
|
TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
99
109
|
TSubmitMeta,
|
|
100
110
|
> = FormApi<
|
|
@@ -106,6 +116,8 @@ export type ReactFormExtendedApi<
|
|
|
106
116
|
TOnBlurAsync,
|
|
107
117
|
TOnSubmit,
|
|
108
118
|
TOnSubmitAsync,
|
|
119
|
+
TOnDynamic,
|
|
120
|
+
TOnDynamicAsync,
|
|
109
121
|
TOnServer,
|
|
110
122
|
TSubmitMeta
|
|
111
123
|
> &
|
|
@@ -118,6 +130,8 @@ export type ReactFormExtendedApi<
|
|
|
118
130
|
TOnBlurAsync,
|
|
119
131
|
TOnSubmit,
|
|
120
132
|
TOnSubmitAsync,
|
|
133
|
+
TOnDynamic,
|
|
134
|
+
TOnDynamicAsync,
|
|
121
135
|
TOnServer,
|
|
122
136
|
TSubmitMeta
|
|
123
137
|
>
|
|
@@ -149,6 +163,8 @@ export function useForm<
|
|
|
149
163
|
TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
150
164
|
TOnSubmit extends undefined | FormValidateOrFn<TFormData>,
|
|
151
165
|
TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
166
|
+
TOnDynamic extends undefined | FormValidateOrFn<TFormData>,
|
|
167
|
+
TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
152
168
|
TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>,
|
|
153
169
|
TSubmitMeta,
|
|
154
170
|
>(
|
|
@@ -161,6 +177,8 @@ export function useForm<
|
|
|
161
177
|
TOnBlurAsync,
|
|
162
178
|
TOnSubmit,
|
|
163
179
|
TOnSubmitAsync,
|
|
180
|
+
TOnDynamic,
|
|
181
|
+
TOnDynamicAsync,
|
|
164
182
|
TOnServer,
|
|
165
183
|
TSubmitMeta
|
|
166
184
|
>,
|
|
@@ -175,6 +193,8 @@ export function useForm<
|
|
|
175
193
|
TOnBlurAsync,
|
|
176
194
|
TOnSubmit,
|
|
177
195
|
TOnSubmitAsync,
|
|
196
|
+
TOnDynamic,
|
|
197
|
+
TOnDynamicAsync,
|
|
178
198
|
TOnServer,
|
|
179
199
|
TSubmitMeta
|
|
180
200
|
>(opts)
|
|
@@ -188,6 +208,8 @@ export function useForm<
|
|
|
188
208
|
TOnBlurAsync,
|
|
189
209
|
TOnSubmit,
|
|
190
210
|
TOnSubmitAsync,
|
|
211
|
+
TOnDynamic,
|
|
212
|
+
TOnDynamicAsync,
|
|
191
213
|
TOnServer,
|
|
192
214
|
TSubmitMeta
|
|
193
215
|
> = api as never
|
package/src/useTransform.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
export function useTransform(
|
|
10
10
|
fn: (formBase: AnyFormApi) => AnyFormApi,
|
|
11
11
|
deps: unknown[],
|
|
12
|
-
): FormTransform<any, any, any, any, any, any, any, any, any, any> {
|
|
12
|
+
): FormTransform<any, any, any, any, any, any, any, any, any, any, any, any> {
|
|
13
13
|
return {
|
|
14
14
|
fn,
|
|
15
15
|
deps,
|