@saas-ui/forms 2.6.5 → 2.6.7
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +16 -0
- package/dist/ajv/index.d.mts +1 -1
- package/dist/ajv/index.d.ts +1 -1
- package/dist/index.d.mts +33 -34
- package/dist/index.d.ts +33 -34
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -4
- package/dist/index.mjs.map +1 -1
- package/dist/yup/index.d.mts +60 -65
- package/dist/yup/index.d.ts +60 -65
- package/dist/yup/index.js +1 -2
- package/dist/yup/index.js.map +1 -1
- package/dist/yup/index.mjs +1 -2
- package/dist/yup/index.mjs.map +1 -1
- package/dist/zod/index.d.mts +52 -57
- package/dist/zod/index.d.ts +52 -57
- package/package.json +9 -9
package/dist/zod/index.d.mts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as _chakra_ui_button from '@chakra-ui/button';
|
2
2
|
import * as _saas_ui_modals from '@saas-ui/modals';
|
3
|
-
import { BaseModalProps } from '@saas-ui/modals';
|
3
|
+
import { BaseModalProps, FormDialogFieldOverrides } from '@saas-ui/modals';
|
4
4
|
import * as _chakra_ui_checkbox from '@chakra-ui/checkbox';
|
5
5
|
import * as react_hook_form from 'react-hook-form';
|
6
6
|
import * as react from 'react';
|
@@ -61,11 +61,9 @@ type ZodFormType<FieldDefs, ExtraProps = object, ExtraFieldProps extends object
|
|
61
61
|
displayName?: string;
|
62
62
|
id?: string;
|
63
63
|
};
|
64
|
-
declare const createZodForm: <FieldDefs, TGetBaseField extends GetBaseField<any> = GetBaseField<any>>(options?: CreateZodFormProps<FieldDefs, TGetBaseField>) => ZodFormType<FieldDefs, object, TGetBaseField extends GetBaseField<infer ExtraFieldProps extends object> ? ExtraFieldProps : object
|
64
|
+
declare const createZodForm: <FieldDefs, TGetBaseField extends GetBaseField<any> = GetBaseField<any>>(options?: CreateZodFormProps<FieldDefs, TGetBaseField>) => ZodFormType<FieldDefs, object, TGetBaseField extends GetBaseField<infer ExtraFieldProps extends object> ? ExtraFieldProps : object>;
|
65
65
|
|
66
|
-
declare function createZodFormDialog<FieldDefs = any, ExtraProps = object, ExtraFieldProps extends object = object, ExtraOverrides = object>(Form: ZodFormType<FieldDefs, ExtraProps, ExtraFieldProps, ExtraOverrides>): ZodFormType<FieldDefs, ExtraProps & Omit<BaseModalProps, "children">, ExtraFieldProps, ExtraOverrides &
|
67
|
-
cancel?: _chakra_ui_button.ButtonProps | undefined;
|
68
|
-
}>;
|
66
|
+
declare function createZodFormDialog<FieldDefs = any, ExtraProps = object, ExtraFieldProps extends object = object, ExtraOverrides = object>(Form: ZodFormType<FieldDefs, ExtraProps, ExtraFieldProps, ExtraOverrides>): ZodFormType<FieldDefs, ExtraProps & Omit<BaseModalProps, "children">, ExtraFieldProps, ExtraOverrides & FormDialogFieldOverrides>;
|
69
67
|
|
70
68
|
type ResolverArgs = Parameters<typeof zodResolver>;
|
71
69
|
interface CreateZodStepFormProps<FieldDefs, TGetBaseField extends GetBaseField = GetBaseField> extends CreateStepFormProps<FieldDefs, TGetBaseField> {
|
@@ -85,13 +83,10 @@ type ZodStepFormType<FieldDefs, ExtraProps = object, ExtraFieldProps extends obj
|
|
85
83
|
displayName?: string;
|
86
84
|
id?: string;
|
87
85
|
};
|
88
|
-
declare const createZodStepForm: <FieldDefs, TGetBaseField extends GetBaseField = GetBaseField>(options?: CreateZodStepFormProps<FieldDefs, TGetBaseField>) => ZodStepFormType<FieldDefs, object, TGetBaseField extends GetBaseField<infer ExtraFieldProps extends object> ? ExtraFieldProps : object
|
86
|
+
declare const createZodStepForm: <FieldDefs, TGetBaseField extends GetBaseField = GetBaseField>(options?: CreateZodStepFormProps<FieldDefs, TGetBaseField>) => ZodStepFormType<FieldDefs, object, TGetBaseField extends GetBaseField<infer ExtraFieldProps extends object> ? ExtraFieldProps : object>;
|
89
87
|
|
90
88
|
declare const Form: ZodFormType<unknown, object, any, object, "zod">;
|
91
|
-
declare const StepForm: (<TSteps extends {
|
92
|
-
name: string;
|
93
|
-
schema?: zod.AnyZodObject | undefined;
|
94
|
-
}[] = {
|
89
|
+
declare const StepForm: (<TSteps extends Required<dist.StepsOptions<zod.AnyZodObject>> = {
|
95
90
|
name: string;
|
96
91
|
schema?: zod.AnyZodObject | undefined;
|
97
92
|
}[], TFieldValues extends TSteps extends [infer Step, ...infer Rest] ? Step extends {
|
@@ -154,52 +149,52 @@ declare const StepForm: (<TSteps extends {
|
|
154
149
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
155
150
|
name: string;
|
156
151
|
schema?: zod.AnyZodObject | undefined;
|
157
|
-
}[] ? Rest extends infer
|
152
|
+
}[] ? Rest extends infer T ? T extends Rest ? T extends [infer Step, ...infer Rest] ? Step extends {
|
158
153
|
schema: zod.AnyZodObject;
|
159
154
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
160
155
|
name: string;
|
161
156
|
schema?: zod.AnyZodObject | undefined;
|
162
|
-
}[] ? Rest extends infer
|
157
|
+
}[] ? Rest extends infer T_1 ? T_1 extends Rest ? T_1 extends [infer Step, ...infer Rest] ? Step extends {
|
163
158
|
schema: zod.AnyZodObject;
|
164
159
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
165
160
|
name: string;
|
166
161
|
schema?: zod.AnyZodObject | undefined;
|
167
|
-
}[] ? Rest extends infer
|
162
|
+
}[] ? Rest extends infer T_2 ? T_2 extends Rest ? T_2 extends [infer Step, ...infer Rest] ? Step extends {
|
168
163
|
schema: zod.AnyZodObject;
|
169
164
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
170
165
|
name: string;
|
171
166
|
schema?: zod.AnyZodObject | undefined;
|
172
|
-
}[] ? Rest extends infer
|
167
|
+
}[] ? Rest extends infer T_3 ? T_3 extends Rest ? T_3 extends [infer Step, ...infer Rest] ? Step extends {
|
173
168
|
schema: zod.AnyZodObject;
|
174
169
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
175
170
|
name: string;
|
176
171
|
schema?: zod.AnyZodObject | undefined;
|
177
|
-
}[] ? Rest extends infer
|
172
|
+
}[] ? Rest extends infer T_4 ? T_4 extends Rest ? T_4 extends [infer Step, ...infer Rest] ? Step extends {
|
178
173
|
schema: zod.AnyZodObject;
|
179
174
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
180
175
|
name: string;
|
181
176
|
schema?: zod.AnyZodObject | undefined;
|
182
|
-
}[] ? Rest extends infer
|
177
|
+
}[] ? Rest extends infer T_5 ? T_5 extends Rest ? T_5 extends [infer Step, ...infer Rest] ? Step extends {
|
183
178
|
schema: zod.AnyZodObject;
|
184
179
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
185
180
|
name: string;
|
186
181
|
schema?: zod.AnyZodObject | undefined;
|
187
|
-
}[] ? Rest extends infer
|
182
|
+
}[] ? Rest extends infer T_6 ? T_6 extends Rest ? T_6 extends [infer Step, ...infer Rest] ? Step extends {
|
188
183
|
schema: zod.AnyZodObject;
|
189
184
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
190
185
|
name: string;
|
191
186
|
schema?: zod.AnyZodObject | undefined;
|
192
|
-
}[] ? Rest extends infer
|
187
|
+
}[] ? Rest extends infer T_7 ? T_7 extends Rest ? T_7 extends [infer Step, ...infer Rest] ? Step extends {
|
193
188
|
schema: zod.AnyZodObject;
|
194
189
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
195
190
|
name: string;
|
196
191
|
schema?: zod.AnyZodObject | undefined;
|
197
|
-
}[] ? Rest extends infer
|
192
|
+
}[] ? Rest extends infer T_8 ? T_8 extends Rest ? T_8 extends [infer Step, ...infer Rest] ? Step extends {
|
198
193
|
schema: zod.AnyZodObject;
|
199
194
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
200
195
|
name: string;
|
201
196
|
schema?: zod.AnyZodObject | undefined;
|
202
|
-
}[] ? Rest extends infer
|
197
|
+
}[] ? Rest extends infer T_9 ? T_9 extends Rest ? T_9 extends [infer Step, ...infer Rest] ? Step extends {
|
203
198
|
schema: zod.AnyZodObject;
|
204
199
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
205
200
|
name: string;
|
@@ -207,77 +202,77 @@ declare const StepForm: (<TSteps extends {
|
|
207
202
|
}[] ? any : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object, TContext extends object = object>(props: Omit<dist.UseStepFormProps<TSteps, TFieldValues, TContext>, "children" | "fields"> & {
|
208
203
|
children?: react.ReactNode | ((props: dist.StepFormRenderContext<TSteps, TFieldValues, TContext, ({
|
209
204
|
type?: "number" | undefined;
|
210
|
-
} & Omit<Omit<
|
205
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.NumberInputFieldProps> & dist.NumberInputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
211
206
|
type?: "select" | undefined;
|
212
|
-
} & Omit<Omit<
|
207
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.SelectFieldProps> & dist.SelectFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
213
208
|
type?: "textarea" | undefined;
|
214
|
-
} & Omit<Omit<
|
209
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.TextareaFieldProps> & dist.TextareaFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
215
210
|
type?: "time" | undefined;
|
216
|
-
} & Omit<Omit<
|
211
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
217
212
|
type?: "switch" | undefined;
|
218
|
-
} & Omit<Omit<
|
213
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.SwitchFieldProps> & dist.SwitchFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
219
214
|
type?: "text" | undefined;
|
220
|
-
} & Omit<Omit<
|
215
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
221
216
|
type?: "checkbox" | undefined;
|
222
|
-
} & Omit<Omit<
|
217
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof _chakra_ui_checkbox.CheckboxProps> & _chakra_ui_checkbox.CheckboxProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
223
218
|
type?: "radio" | undefined;
|
224
|
-
} & Omit<Omit<
|
219
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.RadioInputProps> & dist.RadioInputProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
225
220
|
type?: "url" | undefined;
|
226
|
-
} & Omit<Omit<
|
221
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
227
222
|
type?: "email" | undefined;
|
228
|
-
} & Omit<Omit<
|
223
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
229
224
|
type?: "phone" | undefined;
|
230
|
-
} & Omit<Omit<
|
225
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
231
226
|
type?: "password" | undefined;
|
232
|
-
} & Omit<Omit<
|
227
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.PasswordInputProps> & dist.PasswordInputProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
233
228
|
type?: "pin" | undefined;
|
234
|
-
} & Omit<Omit<
|
229
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.PinFieldProps> & dist.PinFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
235
230
|
type?: "native-select" | undefined;
|
236
|
-
} & Omit<Omit<
|
237
|
-
fields?: ({ [K in react_hook_form.Path<TFieldValues> | (react_hook_form.Path<TFieldValues> extends infer
|
231
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.NativeSelectProps> & dist.NativeSelectProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object)>) => React.ReactNode);
|
232
|
+
fields?: ({ [K in react_hook_form.Path<TFieldValues> | (react_hook_form.Path<TFieldValues> extends infer T_10 ? T_10 extends react_hook_form.Path<TFieldValues> ? T_10 extends string ? (string extends T_10 ? (T_10 & string)[] : T_10 extends infer T_11 ? T_11 extends T_10 ? T_11 extends "" ? [] : T_11 extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...any] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [T_11] : never : never) extends infer T_13 ? T_13 extends (string extends T_10 ? (T_10 & string)[] : T_10 extends infer T_11 ? T_11 extends T_10 ? T_11 extends "" ? [] : T_11 extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...any] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [T_11] : never : never) ? T_13 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_14 ? T_14 extends R ? T_14 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_15 ? T_15 extends R ? T_15 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_16 ? T_16 extends R ? T_16 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_17 ? T_17 extends R ? T_17 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_18 ? T_18 extends R ? T_18 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_19 ? T_19 extends R ? T_19 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_20 ? T_20 extends R ? T_20 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_21 ? T_21 extends R ? T_21 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_22 ? T_22 extends R ? T_22 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_23 ? T_23 extends R ? T_23 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? any : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : never : never : never)]?: (({
|
238
233
|
type?: "number" | undefined;
|
239
|
-
} & Omit<Omit<Omit<
|
234
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.NumberInputFieldProps> & dist.NumberInputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
240
235
|
type?: "select" | undefined;
|
241
|
-
} & Omit<Omit<Omit<
|
236
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.SelectFieldProps> & dist.SelectFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
242
237
|
type?: "textarea" | undefined;
|
243
|
-
} & Omit<Omit<Omit<
|
238
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.TextareaFieldProps> & dist.TextareaFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
244
239
|
type?: "time" | undefined;
|
245
|
-
} & Omit<Omit<Omit<
|
240
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
246
241
|
type?: "switch" | undefined;
|
247
|
-
} & Omit<Omit<Omit<
|
242
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.SwitchFieldProps> & dist.SwitchFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
248
243
|
type?: "text" | undefined;
|
249
|
-
} & Omit<Omit<Omit<
|
244
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
250
245
|
type?: "checkbox" | undefined;
|
251
|
-
} & Omit<Omit<Omit<
|
246
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof _chakra_ui_checkbox.CheckboxProps> & _chakra_ui_checkbox.CheckboxProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
252
247
|
type?: "radio" | undefined;
|
253
|
-
} & Omit<Omit<Omit<
|
248
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.RadioInputProps> & dist.RadioInputProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
254
249
|
type?: "url" | undefined;
|
255
|
-
} & Omit<Omit<Omit<
|
250
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
256
251
|
type?: "email" | undefined;
|
257
|
-
} & Omit<Omit<Omit<
|
252
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
258
253
|
type?: "phone" | undefined;
|
259
|
-
} & Omit<Omit<Omit<
|
254
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
260
255
|
type?: "password" | undefined;
|
261
|
-
} & Omit<Omit<Omit<
|
256
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.PasswordInputProps> & dist.PasswordInputProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
262
257
|
type?: "pin" | undefined;
|
263
|
-
} & Omit<Omit<Omit<
|
258
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.PinFieldProps> & dist.PinFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
264
259
|
type?: "native-select" | undefined;
|
265
|
-
} & Omit<Omit<Omit<
|
266
|
-
type?: "object"
|
260
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.NativeSelectProps> & dist.NativeSelectProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">)) | ({
|
261
|
+
type?: "object";
|
267
262
|
} & Omit<dist.ObjectFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name" | "children">) | ({
|
268
|
-
type?: "array"
|
263
|
+
type?: "array";
|
269
264
|
} & Omit<dist.ArrayFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name" | "children">) | undefined; } & {
|
270
|
-
submit?: dist.SubmitButtonProps
|
265
|
+
submit?: dist.SubmitButtonProps;
|
271
266
|
} & object) | undefined;
|
272
267
|
} & {
|
273
268
|
steps: TSteps;
|
274
|
-
ref?: react.ForwardedRef<HTMLFormElement
|
275
|
-
} & object) => react.ReactElement
|
276
|
-
displayName?: string
|
277
|
-
id?: string
|
269
|
+
ref?: react.ForwardedRef<HTMLFormElement>;
|
270
|
+
} & object) => react.ReactElement) & {
|
271
|
+
displayName?: string;
|
272
|
+
id?: string;
|
278
273
|
};
|
279
274
|
declare const FormDialog: ZodFormType<unknown, object & Omit<_saas_ui_modals.BaseModalProps, "children">, any, object & dist.DefaultFieldOverrides & {
|
280
|
-
cancel?: _chakra_ui_button.ButtonProps
|
275
|
+
cancel?: _chakra_ui_button.ButtonProps;
|
281
276
|
}>;
|
282
277
|
|
283
278
|
export { Form, FormDialog, StepForm, type ZodFormType, type ZodMeta, createZodForm, createZodFormDialog, createZodStepForm, getFieldsFromSchema, getNestedSchema, zodFieldResolver, zodMeta, zodParseMeta };
|
package/dist/zod/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as _chakra_ui_button from '@chakra-ui/button';
|
2
2
|
import * as _saas_ui_modals from '@saas-ui/modals';
|
3
|
-
import { BaseModalProps } from '@saas-ui/modals';
|
3
|
+
import { BaseModalProps, FormDialogFieldOverrides } from '@saas-ui/modals';
|
4
4
|
import * as _chakra_ui_checkbox from '@chakra-ui/checkbox';
|
5
5
|
import * as react_hook_form from 'react-hook-form';
|
6
6
|
import * as react from 'react';
|
@@ -61,11 +61,9 @@ type ZodFormType<FieldDefs, ExtraProps = object, ExtraFieldProps extends object
|
|
61
61
|
displayName?: string;
|
62
62
|
id?: string;
|
63
63
|
};
|
64
|
-
declare const createZodForm: <FieldDefs, TGetBaseField extends GetBaseField<any> = GetBaseField<any>>(options?: CreateZodFormProps<FieldDefs, TGetBaseField>) => ZodFormType<FieldDefs, object, TGetBaseField extends GetBaseField<infer ExtraFieldProps extends object> ? ExtraFieldProps : object
|
64
|
+
declare const createZodForm: <FieldDefs, TGetBaseField extends GetBaseField<any> = GetBaseField<any>>(options?: CreateZodFormProps<FieldDefs, TGetBaseField>) => ZodFormType<FieldDefs, object, TGetBaseField extends GetBaseField<infer ExtraFieldProps extends object> ? ExtraFieldProps : object>;
|
65
65
|
|
66
|
-
declare function createZodFormDialog<FieldDefs = any, ExtraProps = object, ExtraFieldProps extends object = object, ExtraOverrides = object>(Form: ZodFormType<FieldDefs, ExtraProps, ExtraFieldProps, ExtraOverrides>): ZodFormType<FieldDefs, ExtraProps & Omit<BaseModalProps, "children">, ExtraFieldProps, ExtraOverrides &
|
67
|
-
cancel?: _chakra_ui_button.ButtonProps | undefined;
|
68
|
-
}>;
|
66
|
+
declare function createZodFormDialog<FieldDefs = any, ExtraProps = object, ExtraFieldProps extends object = object, ExtraOverrides = object>(Form: ZodFormType<FieldDefs, ExtraProps, ExtraFieldProps, ExtraOverrides>): ZodFormType<FieldDefs, ExtraProps & Omit<BaseModalProps, "children">, ExtraFieldProps, ExtraOverrides & FormDialogFieldOverrides>;
|
69
67
|
|
70
68
|
type ResolverArgs = Parameters<typeof zodResolver>;
|
71
69
|
interface CreateZodStepFormProps<FieldDefs, TGetBaseField extends GetBaseField = GetBaseField> extends CreateStepFormProps<FieldDefs, TGetBaseField> {
|
@@ -85,13 +83,10 @@ type ZodStepFormType<FieldDefs, ExtraProps = object, ExtraFieldProps extends obj
|
|
85
83
|
displayName?: string;
|
86
84
|
id?: string;
|
87
85
|
};
|
88
|
-
declare const createZodStepForm: <FieldDefs, TGetBaseField extends GetBaseField = GetBaseField>(options?: CreateZodStepFormProps<FieldDefs, TGetBaseField>) => ZodStepFormType<FieldDefs, object, TGetBaseField extends GetBaseField<infer ExtraFieldProps extends object> ? ExtraFieldProps : object
|
86
|
+
declare const createZodStepForm: <FieldDefs, TGetBaseField extends GetBaseField = GetBaseField>(options?: CreateZodStepFormProps<FieldDefs, TGetBaseField>) => ZodStepFormType<FieldDefs, object, TGetBaseField extends GetBaseField<infer ExtraFieldProps extends object> ? ExtraFieldProps : object>;
|
89
87
|
|
90
88
|
declare const Form: ZodFormType<unknown, object, any, object, "zod">;
|
91
|
-
declare const StepForm: (<TSteps extends {
|
92
|
-
name: string;
|
93
|
-
schema?: zod.AnyZodObject | undefined;
|
94
|
-
}[] = {
|
89
|
+
declare const StepForm: (<TSteps extends Required<dist.StepsOptions<zod.AnyZodObject>> = {
|
95
90
|
name: string;
|
96
91
|
schema?: zod.AnyZodObject | undefined;
|
97
92
|
}[], TFieldValues extends TSteps extends [infer Step, ...infer Rest] ? Step extends {
|
@@ -154,52 +149,52 @@ declare const StepForm: (<TSteps extends {
|
|
154
149
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
155
150
|
name: string;
|
156
151
|
schema?: zod.AnyZodObject | undefined;
|
157
|
-
}[] ? Rest extends infer
|
152
|
+
}[] ? Rest extends infer T ? T extends Rest ? T extends [infer Step, ...infer Rest] ? Step extends {
|
158
153
|
schema: zod.AnyZodObject;
|
159
154
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
160
155
|
name: string;
|
161
156
|
schema?: zod.AnyZodObject | undefined;
|
162
|
-
}[] ? Rest extends infer
|
157
|
+
}[] ? Rest extends infer T_1 ? T_1 extends Rest ? T_1 extends [infer Step, ...infer Rest] ? Step extends {
|
163
158
|
schema: zod.AnyZodObject;
|
164
159
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
165
160
|
name: string;
|
166
161
|
schema?: zod.AnyZodObject | undefined;
|
167
|
-
}[] ? Rest extends infer
|
162
|
+
}[] ? Rest extends infer T_2 ? T_2 extends Rest ? T_2 extends [infer Step, ...infer Rest] ? Step extends {
|
168
163
|
schema: zod.AnyZodObject;
|
169
164
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
170
165
|
name: string;
|
171
166
|
schema?: zod.AnyZodObject | undefined;
|
172
|
-
}[] ? Rest extends infer
|
167
|
+
}[] ? Rest extends infer T_3 ? T_3 extends Rest ? T_3 extends [infer Step, ...infer Rest] ? Step extends {
|
173
168
|
schema: zod.AnyZodObject;
|
174
169
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
175
170
|
name: string;
|
176
171
|
schema?: zod.AnyZodObject | undefined;
|
177
|
-
}[] ? Rest extends infer
|
172
|
+
}[] ? Rest extends infer T_4 ? T_4 extends Rest ? T_4 extends [infer Step, ...infer Rest] ? Step extends {
|
178
173
|
schema: zod.AnyZodObject;
|
179
174
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
180
175
|
name: string;
|
181
176
|
schema?: zod.AnyZodObject | undefined;
|
182
|
-
}[] ? Rest extends infer
|
177
|
+
}[] ? Rest extends infer T_5 ? T_5 extends Rest ? T_5 extends [infer Step, ...infer Rest] ? Step extends {
|
183
178
|
schema: zod.AnyZodObject;
|
184
179
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
185
180
|
name: string;
|
186
181
|
schema?: zod.AnyZodObject | undefined;
|
187
|
-
}[] ? Rest extends infer
|
182
|
+
}[] ? Rest extends infer T_6 ? T_6 extends Rest ? T_6 extends [infer Step, ...infer Rest] ? Step extends {
|
188
183
|
schema: zod.AnyZodObject;
|
189
184
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
190
185
|
name: string;
|
191
186
|
schema?: zod.AnyZodObject | undefined;
|
192
|
-
}[] ? Rest extends infer
|
187
|
+
}[] ? Rest extends infer T_7 ? T_7 extends Rest ? T_7 extends [infer Step, ...infer Rest] ? Step extends {
|
193
188
|
schema: zod.AnyZodObject;
|
194
189
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
195
190
|
name: string;
|
196
191
|
schema?: zod.AnyZodObject | undefined;
|
197
|
-
}[] ? Rest extends infer
|
192
|
+
}[] ? Rest extends infer T_8 ? T_8 extends Rest ? T_8 extends [infer Step, ...infer Rest] ? Step extends {
|
198
193
|
schema: zod.AnyZodObject;
|
199
194
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
200
195
|
name: string;
|
201
196
|
schema?: zod.AnyZodObject | undefined;
|
202
|
-
}[] ? Rest extends infer
|
197
|
+
}[] ? Rest extends infer T_9 ? T_9 extends Rest ? T_9 extends [infer Step, ...infer Rest] ? Step extends {
|
203
198
|
schema: zod.AnyZodObject;
|
204
199
|
} ? zod.TypeOf<Step["schema"]> & (Rest extends {
|
205
200
|
name: string;
|
@@ -207,77 +202,77 @@ declare const StepForm: (<TSteps extends {
|
|
207
202
|
}[] ? any : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object : never : never : object) : object : object, TContext extends object = object>(props: Omit<dist.UseStepFormProps<TSteps, TFieldValues, TContext>, "children" | "fields"> & {
|
208
203
|
children?: react.ReactNode | ((props: dist.StepFormRenderContext<TSteps, TFieldValues, TContext, ({
|
209
204
|
type?: "number" | undefined;
|
210
|
-
} & Omit<Omit<
|
205
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.NumberInputFieldProps> & dist.NumberInputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
211
206
|
type?: "select" | undefined;
|
212
|
-
} & Omit<Omit<
|
207
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.SelectFieldProps> & dist.SelectFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
213
208
|
type?: "textarea" | undefined;
|
214
|
-
} & Omit<Omit<
|
209
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.TextareaFieldProps> & dist.TextareaFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
215
210
|
type?: "time" | undefined;
|
216
|
-
} & Omit<Omit<
|
211
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
217
212
|
type?: "switch" | undefined;
|
218
|
-
} & Omit<Omit<
|
213
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.SwitchFieldProps> & dist.SwitchFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
219
214
|
type?: "text" | undefined;
|
220
|
-
} & Omit<Omit<
|
215
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
221
216
|
type?: "checkbox" | undefined;
|
222
|
-
} & Omit<Omit<
|
217
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof _chakra_ui_checkbox.CheckboxProps> & _chakra_ui_checkbox.CheckboxProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
223
218
|
type?: "radio" | undefined;
|
224
|
-
} & Omit<Omit<
|
219
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.RadioInputProps> & dist.RadioInputProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
225
220
|
type?: "url" | undefined;
|
226
|
-
} & Omit<Omit<
|
221
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
227
222
|
type?: "email" | undefined;
|
228
|
-
} & Omit<Omit<
|
223
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
229
224
|
type?: "phone" | undefined;
|
230
|
-
} & Omit<Omit<
|
225
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
231
226
|
type?: "password" | undefined;
|
232
|
-
} & Omit<Omit<
|
227
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.PasswordInputProps> & dist.PasswordInputProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
233
228
|
type?: "pin" | undefined;
|
234
|
-
} & Omit<Omit<
|
229
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.PinFieldProps> & dist.PinFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object) | ({
|
235
230
|
type?: "native-select" | undefined;
|
236
|
-
} & Omit<Omit<
|
237
|
-
fields?: ({ [K in react_hook_form.Path<TFieldValues> | (react_hook_form.Path<TFieldValues> extends infer
|
231
|
+
} & Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.NativeSelectProps> & dist.NativeSelectProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>> & object)>) => React.ReactNode);
|
232
|
+
fields?: ({ [K in react_hook_form.Path<TFieldValues> | (react_hook_form.Path<TFieldValues> extends infer T_10 ? T_10 extends react_hook_form.Path<TFieldValues> ? T_10 extends string ? (string extends T_10 ? (T_10 & string)[] : T_10 extends infer T_11 ? T_11 extends T_10 ? T_11 extends "" ? [] : T_11 extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...any] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [T_11] : never : never) extends infer T_13 ? T_13 extends (string extends T_10 ? (T_10 & string)[] : T_10 extends infer T_11 ? T_11 extends T_10 ? T_11 extends "" ? [] : T_11 extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...string extends U ? U[] : U extends "" ? [] : U extends `${infer T_12}.${infer U}` ? [T_12, ...any] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [U]] : [T_11] : never : never) ? T_13 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_14 ? T_14 extends R ? T_14 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_15 ? T_15 extends R ? T_15 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_16 ? T_16 extends R ? T_16 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_17 ? T_17 extends R ? T_17 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_18 ? T_18 extends R ? T_18 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_19 ? T_19 extends R ? T_19 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_20 ? T_20 extends R ? T_20 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_21 ? T_21 extends R ? T_21 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_22 ? T_22 extends R ? T_22 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? R extends infer T_23 ? T_23 extends R ? T_23 extends [infer U_1, ...infer R] ? U_1 extends string ? `${U_1 extends `${number}` ? "$" : U_1}${R[0] extends string ? "." : ""}${R extends string[] ? any : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : ""}` : "" : "" : never : never : never : never : never)]?: (({
|
238
233
|
type?: "number" | undefined;
|
239
|
-
} & Omit<Omit<Omit<
|
234
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.NumberInputFieldProps> & dist.NumberInputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
240
235
|
type?: "select" | undefined;
|
241
|
-
} & Omit<Omit<Omit<
|
236
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.SelectFieldProps> & dist.SelectFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
242
237
|
type?: "textarea" | undefined;
|
243
|
-
} & Omit<Omit<Omit<
|
238
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.TextareaFieldProps> & dist.TextareaFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
244
239
|
type?: "time" | undefined;
|
245
|
-
} & Omit<Omit<Omit<
|
240
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
246
241
|
type?: "switch" | undefined;
|
247
|
-
} & Omit<Omit<Omit<
|
242
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.SwitchFieldProps> & dist.SwitchFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
248
243
|
type?: "text" | undefined;
|
249
|
-
} & Omit<Omit<Omit<
|
244
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
250
245
|
type?: "checkbox" | undefined;
|
251
|
-
} & Omit<Omit<Omit<
|
246
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof _chakra_ui_checkbox.CheckboxProps> & _chakra_ui_checkbox.CheckboxProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
252
247
|
type?: "radio" | undefined;
|
253
|
-
} & Omit<Omit<Omit<
|
248
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.RadioInputProps> & dist.RadioInputProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
254
249
|
type?: "url" | undefined;
|
255
|
-
} & Omit<Omit<Omit<
|
250
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
256
251
|
type?: "email" | undefined;
|
257
|
-
} & Omit<Omit<Omit<
|
252
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
258
253
|
type?: "phone" | undefined;
|
259
|
-
} & Omit<Omit<Omit<
|
254
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.InputFieldProps> & dist.InputFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
260
255
|
type?: "password" | undefined;
|
261
|
-
} & Omit<Omit<Omit<
|
256
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.PasswordInputProps> & dist.PasswordInputProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
262
257
|
type?: "pin" | undefined;
|
263
|
-
} & Omit<Omit<Omit<
|
258
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.PinFieldProps> & dist.PinFieldProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">) | ({
|
264
259
|
type?: "native-select" | undefined;
|
265
|
-
} & Omit<Omit<Omit<
|
266
|
-
type?: "object"
|
260
|
+
} & Omit<Omit<Omit<dist.BaseFieldProps<react_hook_form.FieldValues, string>, keyof dist.NativeSelectProps> & dist.NativeSelectProps, keyof dist.BaseFieldProps<TFieldValues_1, TName>> & dist.BaseFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name">)) | ({
|
261
|
+
type?: "object";
|
267
262
|
} & Omit<dist.ObjectFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name" | "children">) | ({
|
268
|
-
type?: "array"
|
263
|
+
type?: "array";
|
269
264
|
} & Omit<dist.ArrayFieldProps<TFieldValues, react_hook_form.Path<TFieldValues>>, "name" | "children">) | undefined; } & {
|
270
|
-
submit?: dist.SubmitButtonProps
|
265
|
+
submit?: dist.SubmitButtonProps;
|
271
266
|
} & object) | undefined;
|
272
267
|
} & {
|
273
268
|
steps: TSteps;
|
274
|
-
ref?: react.ForwardedRef<HTMLFormElement
|
275
|
-
} & object) => react.ReactElement
|
276
|
-
displayName?: string
|
277
|
-
id?: string
|
269
|
+
ref?: react.ForwardedRef<HTMLFormElement>;
|
270
|
+
} & object) => react.ReactElement) & {
|
271
|
+
displayName?: string;
|
272
|
+
id?: string;
|
278
273
|
};
|
279
274
|
declare const FormDialog: ZodFormType<unknown, object & Omit<_saas_ui_modals.BaseModalProps, "children">, any, object & dist.DefaultFieldOverrides & {
|
280
|
-
cancel?: _chakra_ui_button.ButtonProps
|
275
|
+
cancel?: _chakra_ui_button.ButtonProps;
|
281
276
|
}>;
|
282
277
|
|
283
278
|
export { Form, FormDialog, StepForm, type ZodFormType, type ZodMeta, createZodForm, createZodFormDialog, createZodStepForm, getFieldsFromSchema, getNestedSchema, zodFieldResolver, zodMeta, zodParseMeta };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@saas-ui/forms",
|
3
|
-
"version": "2.6.
|
3
|
+
"version": "2.6.7",
|
4
4
|
"description": "Fully functional forms for Chakra UI.",
|
5
5
|
"source": "src/index.ts",
|
6
6
|
"exports": {
|
@@ -103,9 +103,9 @@
|
|
103
103
|
"dependencies": {
|
104
104
|
"@chakra-ui/react-utils": "^2.0.12",
|
105
105
|
"@chakra-ui/utils": "^2.0.15",
|
106
|
-
"@hookform/resolvers": "^3.
|
107
|
-
"@saas-ui/core": "2.5.
|
108
|
-
"react-hook-form": "^7.
|
106
|
+
"@hookform/resolvers": "^3.6.0",
|
107
|
+
"@saas-ui/core": "2.5.5",
|
108
|
+
"react-hook-form": "^7.52.0"
|
109
109
|
},
|
110
110
|
"peerDependencies": {
|
111
111
|
"@chakra-ui/react": ">=2.4.9",
|
@@ -117,14 +117,14 @@
|
|
117
117
|
},
|
118
118
|
"devDependencies": {
|
119
119
|
"@types/json-schema": "^7.0.15",
|
120
|
-
"ajv": "^8.
|
120
|
+
"ajv": "^8.16.0",
|
121
121
|
"ajv-errors": "^3.0.0",
|
122
122
|
"json-schema-to-ts": "^2.12.0",
|
123
|
-
"tsd": "^0.
|
124
|
-
"tsup": "^8.0
|
125
|
-
"typescript": "^5.
|
123
|
+
"tsd": "^0.31.1",
|
124
|
+
"tsup": "^8.1.0",
|
125
|
+
"typescript": "^5.5.2",
|
126
126
|
"yup": "^1.4.0",
|
127
|
-
"zod": "^3.
|
127
|
+
"zod": "^3.23.8"
|
128
128
|
},
|
129
129
|
"tsd": {
|
130
130
|
"directory": "tests"
|