@volverjs/form-vue 1.0.0-beta.16 → 1.0.0-beta.18
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/VvForm.d.ts +41 -43
- package/dist/VvFormField.d.ts +25 -13
- package/dist/VvFormTemplate.d.ts +17 -20
- package/dist/VvFormWrapper.d.ts +29 -29
- package/dist/enums.d.ts +1 -0
- package/dist/index.d.ts +559 -1072
- package/dist/index.es.js +504 -439
- package/dist/index.umd.js +1 -1
- package/dist/types.d.ts +4 -2
- package/dist/utils.d.ts +0 -1
- package/package.json +18 -18
- package/src/VvForm.ts +110 -76
- package/src/VvFormField.ts +69 -41
- package/src/VvFormTemplate.ts +129 -137
- package/src/VvFormWrapper.ts +60 -62
- package/src/enums.ts +1 -0
- package/src/index.ts +32 -28
- package/src/types.ts +31 -28
- package/src/utils.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,136 +5,57 @@ import { defineForm } from './VvForm';
|
|
|
5
5
|
import { defineFormWrapper } from './VvFormWrapper';
|
|
6
6
|
import { defineFormTemplate } from './VvFormTemplate';
|
|
7
7
|
import { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormComposableOptions, FormPluginOptions, FormTemplateItem, Path, PathValue, FormSchema, FormTemplate } from './types';
|
|
8
|
-
|
|
9
8
|
export declare const pluginInjectionKey: InjectionKey<FormPluginOptions>;
|
|
10
9
|
export declare function createForm(options: FormPluginOptions): Plugin & Partial<ReturnType<typeof useForm>>;
|
|
11
10
|
export declare function useForm<Schema extends FormSchema>(schema: Schema, options?: FormComposableOptions<Schema>): {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
type: BooleanConstructor;
|
|
61
|
-
default: boolean;
|
|
62
|
-
};
|
|
63
|
-
tag: {
|
|
64
|
-
type: StringConstructor;
|
|
65
|
-
default: string;
|
|
66
|
-
};
|
|
67
|
-
template: {
|
|
68
|
-
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
69
|
-
default: undefined;
|
|
70
|
-
};
|
|
71
|
-
}>> & {
|
|
72
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
73
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
74
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
75
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
76
|
-
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
77
|
-
}, {
|
|
78
|
-
readonly: boolean;
|
|
79
|
-
template: FormTemplate<Schema>;
|
|
80
|
-
modelValue: Record<string, any>;
|
|
81
|
-
continuousValidation: boolean;
|
|
82
|
-
tag: string;
|
|
83
|
-
}, true, {}, {}, {
|
|
84
|
-
P: {};
|
|
85
|
-
B: {};
|
|
86
|
-
D: {};
|
|
87
|
-
C: {};
|
|
88
|
-
M: {};
|
|
89
|
-
Defaults: {};
|
|
90
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
91
|
-
continuousValidation: {
|
|
92
|
-
type: BooleanConstructor;
|
|
93
|
-
default: boolean;
|
|
94
|
-
};
|
|
95
|
-
modelValue: {
|
|
96
|
-
type: ObjectConstructor;
|
|
97
|
-
default: () => {};
|
|
98
|
-
};
|
|
99
|
-
readonly: {
|
|
100
|
-
type: BooleanConstructor;
|
|
101
|
-
default: boolean;
|
|
102
|
-
};
|
|
103
|
-
tag: {
|
|
104
|
-
type: StringConstructor;
|
|
105
|
-
default: string;
|
|
106
|
-
};
|
|
107
|
-
template: {
|
|
108
|
-
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
109
|
-
default: undefined;
|
|
110
|
-
};
|
|
111
|
-
}>> & {
|
|
112
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
113
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
114
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
115
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
116
|
-
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
117
|
-
}, {
|
|
118
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
119
|
-
submit: () => Promise<boolean>;
|
|
120
|
-
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
121
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
122
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
123
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>>;
|
|
124
|
-
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined>>;
|
|
125
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
126
|
-
isReadonly: import('vue').Ref<boolean>;
|
|
127
|
-
}, {}, {}, {}, {
|
|
128
|
-
readonly: boolean;
|
|
129
|
-
template: FormTemplate<Schema>;
|
|
130
|
-
modelValue: Record<string, any>;
|
|
131
|
-
continuousValidation: boolean;
|
|
132
|
-
tag: string;
|
|
133
|
-
}>;
|
|
134
|
-
__isFragment?: never;
|
|
135
|
-
__isTeleport?: never;
|
|
136
|
-
__isSuspense?: never;
|
|
137
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
11
|
+
clear: () => void;
|
|
12
|
+
errors: import('vue').Ref<import('zod').inferFormattedError<Schema, string> | undefined, import('zod').inferFormattedError<Schema, string> | undefined>;
|
|
13
|
+
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>, Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
14
|
+
formFieldInjectionKey: InjectionKey<InjectedFormFieldData<Schema>>;
|
|
15
|
+
formInjectionKey: InjectionKey<InjectedFormData<Schema>>;
|
|
16
|
+
formWrapperInjectionKey: InjectionKey<InjectedFormWrapperData<Schema>>;
|
|
17
|
+
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
18
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
19
|
+
readonly: import('vue').Ref<boolean, boolean>;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
status: import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>;
|
|
22
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
23
|
+
submit: () => Promise<boolean>;
|
|
24
|
+
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
25
|
+
VvForm: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
26
|
+
continuousValidation: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: ObjectConstructor;
|
|
32
|
+
default: () => {};
|
|
33
|
+
};
|
|
34
|
+
readonly: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
tag: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
template: {
|
|
43
|
+
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
44
|
+
default: undefined;
|
|
45
|
+
};
|
|
46
|
+
}>, {
|
|
47
|
+
clear: () => void;
|
|
48
|
+
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined, import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>>;
|
|
49
|
+
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>, Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
50
|
+
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
51
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
52
|
+
isReadonly: import('vue').Ref<boolean, boolean>;
|
|
53
|
+
reset: () => void;
|
|
54
|
+
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>>;
|
|
55
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
56
|
+
submit: () => Promise<boolean>;
|
|
57
|
+
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
58
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "reset" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "reset" | "update:modelValue" | "submit" | "update:readonly", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
138
59
|
continuousValidation: {
|
|
139
60
|
type: BooleanConstructor;
|
|
140
61
|
default: boolean;
|
|
@@ -155,148 +76,35 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
155
76
|
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
156
77
|
default: undefined;
|
|
157
78
|
};
|
|
158
|
-
}>> & {
|
|
79
|
+
}>> & Readonly<{
|
|
159
80
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
160
81
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
161
82
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
83
|
+
onReset?: ((...args: any[]) => any) | undefined;
|
|
162
84
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
163
85
|
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
164
|
-
}
|
|
165
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
166
|
-
submit: () => Promise<boolean>;
|
|
167
|
-
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
168
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
169
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
170
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>>;
|
|
171
|
-
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined>>;
|
|
172
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
173
|
-
isReadonly: import('vue').Ref<boolean>;
|
|
174
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", {
|
|
86
|
+
}>, {
|
|
175
87
|
readonly: boolean;
|
|
176
88
|
template: FormTemplate<Schema>;
|
|
177
89
|
modelValue: Record<string, any>;
|
|
178
|
-
continuousValidation: boolean;
|
|
179
90
|
tag: string;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
187
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
188
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema>>>>;
|
|
189
|
-
status: import('vue').Ref<import('vue').DeepReadonly<`${import('./enums').FormStatus}` | undefined>>;
|
|
190
|
-
invalid: import('vue').Ref<import('vue').DeepReadonly<boolean>>;
|
|
191
|
-
readonly: import('vue').Ref<boolean>;
|
|
192
|
-
}) => any;
|
|
193
|
-
};
|
|
194
|
-
});
|
|
195
|
-
VvFormWrapper: {
|
|
196
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
197
|
-
name: {
|
|
198
|
-
type: StringConstructor;
|
|
199
|
-
required: true;
|
|
200
|
-
};
|
|
201
|
-
tag: {
|
|
202
|
-
type: StringConstructor;
|
|
203
|
-
default: undefined;
|
|
204
|
-
};
|
|
205
|
-
}>> & {
|
|
206
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
207
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
208
|
-
}, {
|
|
209
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema>> | undefined> | undefined;
|
|
210
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
211
|
-
submit: (() => Promise<boolean>) | undefined;
|
|
212
|
-
validate: (() => Promise<boolean>) | undefined;
|
|
213
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
214
|
-
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
215
|
-
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<Schema, string>>>;
|
|
216
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
217
|
-
name: {
|
|
218
|
-
type: StringConstructor;
|
|
219
|
-
required: true;
|
|
220
|
-
};
|
|
221
|
-
tag: {
|
|
222
|
-
type: StringConstructor;
|
|
223
|
-
default: undefined;
|
|
224
|
-
};
|
|
225
|
-
}>> & {
|
|
226
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
227
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
228
|
-
}, {
|
|
229
|
-
tag: string;
|
|
230
|
-
}, true, {}, {}, {
|
|
231
|
-
P: {};
|
|
232
|
-
B: {};
|
|
233
|
-
D: {};
|
|
234
|
-
C: {};
|
|
235
|
-
M: {};
|
|
236
|
-
Defaults: {};
|
|
237
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
238
|
-
name: {
|
|
239
|
-
type: StringConstructor;
|
|
240
|
-
required: true;
|
|
241
|
-
};
|
|
242
|
-
tag: {
|
|
243
|
-
type: StringConstructor;
|
|
244
|
-
default: undefined;
|
|
245
|
-
};
|
|
246
|
-
}>> & {
|
|
247
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
248
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
249
|
-
}, {
|
|
250
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema>> | undefined> | undefined;
|
|
251
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
252
|
-
submit: (() => Promise<boolean>) | undefined;
|
|
253
|
-
validate: (() => Promise<boolean>) | undefined;
|
|
91
|
+
continuousValidation: boolean;
|
|
92
|
+
}, import('vue').SlotsType<{
|
|
93
|
+
default: {
|
|
94
|
+
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined, import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>>;
|
|
95
|
+
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>, Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
96
|
+
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
254
97
|
invalid: import('vue').ComputedRef<boolean>;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
__isSuspense?: never;
|
|
263
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
264
|
-
name: {
|
|
265
|
-
type: StringConstructor;
|
|
266
|
-
required: true;
|
|
267
|
-
};
|
|
268
|
-
tag: {
|
|
269
|
-
type: StringConstructor;
|
|
270
|
-
default: undefined;
|
|
98
|
+
readonly: import('vue').Ref<boolean, boolean>;
|
|
99
|
+
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>>;
|
|
100
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
101
|
+
submit: () => Promise<boolean>;
|
|
102
|
+
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
103
|
+
clear: () => void;
|
|
104
|
+
reset: () => void;
|
|
271
105
|
};
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
275
|
-
}, {
|
|
276
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema>> | undefined> | undefined;
|
|
277
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
278
|
-
submit: (() => Promise<boolean>) | undefined;
|
|
279
|
-
validate: (() => Promise<boolean>) | undefined;
|
|
280
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
281
|
-
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
282
|
-
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<Schema, string>>>;
|
|
283
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", {
|
|
284
|
-
tag: string;
|
|
285
|
-
}, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
286
|
-
$slots: {
|
|
287
|
-
default: (_: {
|
|
288
|
-
invalid: boolean;
|
|
289
|
-
formData: unknown extends Partial<import('zod').TypeOf<Schema>> | undefined ? undefined : Partial<import('zod').TypeOf<Schema>> | undefined;
|
|
290
|
-
submit: () => Promise<boolean>;
|
|
291
|
-
validate: () => Promise<boolean>;
|
|
292
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema>>>>;
|
|
293
|
-
fieldsErrors: Map<string, Record<string, {
|
|
294
|
-
_errors: string[];
|
|
295
|
-
}>>;
|
|
296
|
-
}) => any;
|
|
297
|
-
};
|
|
298
|
-
});
|
|
299
|
-
VvFormField: import('vue').DefineComponent<{
|
|
106
|
+
}>, {}, {}, "invalid" | "valid" | "reset" | "status" | "clear" | "errors" | "submit" | "validate" | "readonly" | "template" | "tag", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
107
|
+
VvFormField: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
300
108
|
type: {
|
|
301
109
|
type: import('vue').PropType<`${import('./enums').FormFieldType}`>;
|
|
302
110
|
validator: (value: import('./enums').FormFieldType) => boolean;
|
|
@@ -330,7 +138,7 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
330
138
|
type: BooleanConstructor;
|
|
331
139
|
default: undefined;
|
|
332
140
|
};
|
|
333
|
-
}
|
|
141
|
+
}>, {
|
|
334
142
|
component: import('vue').ComputedRef<{
|
|
335
143
|
new (...args: any[]): any;
|
|
336
144
|
__isFragment?: never;
|
|
@@ -341,7 +149,7 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
341
149
|
name: {} | ([{
|
|
342
150
|
type: import('vue').PropType<Path<import('zod').TypeOf<Schema>>>;
|
|
343
151
|
required: true;
|
|
344
|
-
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? import('@vue/shared').IfAny<V, V, D> : V : {
|
|
152
|
+
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? import('@vue/shared').IfAny<V, V, D> : V : V : {
|
|
345
153
|
type: import('vue').PropType<Path<import('zod').TypeOf<Schema>>>;
|
|
346
154
|
required: true;
|
|
347
155
|
});
|
|
@@ -350,11 +158,11 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
350
158
|
type: import('./enums').FormFieldType | undefined;
|
|
351
159
|
invalidLabel: any;
|
|
352
160
|
modelValue: any;
|
|
353
|
-
readonly:
|
|
161
|
+
readonly: boolean;
|
|
354
162
|
'onUpdate:modelValue': (value: unknown) => void;
|
|
355
163
|
}>;
|
|
356
164
|
invalid: import('vue').ComputedRef<boolean>;
|
|
357
|
-
},
|
|
165
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:formData" | "update:modelValue")[], "invalid" | "valid" | "update:formData" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
358
166
|
type: {
|
|
359
167
|
type: import('vue').PropType<`${import('./enums').FormFieldType}`>;
|
|
360
168
|
validator: (value: import('./enums').FormFieldType) => boolean;
|
|
@@ -388,17 +196,17 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
388
196
|
type: BooleanConstructor;
|
|
389
197
|
default: undefined;
|
|
390
198
|
};
|
|
391
|
-
}>> & {
|
|
199
|
+
}>> & Readonly<{
|
|
392
200
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
393
201
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
394
202
|
"onUpdate:formData"?: ((...args: any[]) => any) | undefined;
|
|
395
203
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
396
|
-
}
|
|
204
|
+
}>, {
|
|
397
205
|
type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
|
|
398
206
|
props: [{
|
|
399
207
|
type: import('vue').PropType<Partial<import('zod').TypeOf<Schema> | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<import('zod').TypeOf<Schema>> | undefined) | undefined>>;
|
|
400
208
|
default: () => {};
|
|
401
|
-
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? import('@vue/shared').IfAny<V, V, D> : V : {
|
|
209
|
+
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? import('@vue/shared').IfAny<V, V, D> : V : V : {
|
|
402
210
|
type: import('vue').PropType<Partial<import('zod').TypeOf<Schema> | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<import('zod').TypeOf<Schema>> | undefined) | undefined>>;
|
|
403
211
|
default: () => {};
|
|
404
212
|
};
|
|
@@ -407,59 +215,21 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
407
215
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
408
216
|
lazyLoad: boolean;
|
|
409
217
|
readonly: boolean;
|
|
410
|
-
}, {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}>[] | undefined)[]) | undefined, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
426
|
-
schema: {
|
|
427
|
-
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
428
|
-
required: true;
|
|
429
|
-
};
|
|
430
|
-
scope: {
|
|
431
|
-
type: import('vue').PropType<Record<string, unknown>>;
|
|
432
|
-
default: () => {};
|
|
433
|
-
};
|
|
434
|
-
}>>, {
|
|
435
|
-
scope: Record<string, unknown>;
|
|
436
|
-
}, true, {}, {}, {
|
|
437
|
-
P: {};
|
|
438
|
-
B: {};
|
|
439
|
-
D: {};
|
|
440
|
-
C: {};
|
|
441
|
-
M: {};
|
|
442
|
-
Defaults: {};
|
|
443
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
444
|
-
schema: {
|
|
445
|
-
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
446
|
-
required: true;
|
|
447
|
-
};
|
|
448
|
-
scope: {
|
|
449
|
-
type: import('vue').PropType<Record<string, unknown>>;
|
|
450
|
-
default: () => {};
|
|
451
|
-
};
|
|
452
|
-
}>>, {} | (() => (import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
453
|
-
[key: string]: any;
|
|
454
|
-
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
455
|
-
[key: string]: any;
|
|
456
|
-
}>[] | undefined)[]), {}, {}, {}, {
|
|
457
|
-
scope: Record<string, unknown>;
|
|
458
|
-
}>;
|
|
459
|
-
__isFragment?: never;
|
|
460
|
-
__isTeleport?: never;
|
|
461
|
-
__isSuspense?: never;
|
|
462
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
218
|
+
}, import('vue').SlotsType<{
|
|
219
|
+
default: {
|
|
220
|
+
errors: import('zod').inferFormattedError<Schema, string>;
|
|
221
|
+
formData?: Partial<import('zod').TypeOf<Schema>> | undefined;
|
|
222
|
+
formErrors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
223
|
+
invalid: boolean;
|
|
224
|
+
invalidLabel: string;
|
|
225
|
+
modelValue: unknown;
|
|
226
|
+
onUpdate: (value: unknown) => void;
|
|
227
|
+
readonly: boolean;
|
|
228
|
+
submit?: InjectedFormData<Schema_1>["submit"];
|
|
229
|
+
validate?: ((formData?: Partial<import('zod').TypeOf<Schema>> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
230
|
+
};
|
|
231
|
+
}>, {}, {}, "invalid" | "type" | "component" | "errors" | "hasProps" | "invalidLabel" | "is", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
232
|
+
VvFormTemplate: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
463
233
|
schema: {
|
|
464
234
|
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
465
235
|
required: true;
|
|
@@ -468,181 +238,103 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
468
238
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
469
239
|
default: () => {};
|
|
470
240
|
};
|
|
471
|
-
}
|
|
241
|
+
}>, (() => (import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
472
242
|
[key: string]: any;
|
|
473
243
|
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
474
244
|
[key: string]: any;
|
|
475
|
-
}>[] | undefined)[]) | undefined,
|
|
245
|
+
}>[] | undefined)[]) | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
246
|
+
schema: {
|
|
247
|
+
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
248
|
+
required: true;
|
|
249
|
+
};
|
|
250
|
+
scope: {
|
|
251
|
+
type: import('vue').PropType<Record<string, unknown>>;
|
|
252
|
+
default: () => {};
|
|
253
|
+
};
|
|
254
|
+
}>> & Readonly<{}>, {
|
|
476
255
|
scope: Record<string, unknown>;
|
|
477
|
-
},
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
};
|
|
488
|
-
})
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
256
|
+
}, import('vue').SlotsType<{
|
|
257
|
+
default: {
|
|
258
|
+
errors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
259
|
+
formData?: Partial<import('zod').TypeOf<Schema>> | undefined;
|
|
260
|
+
invalid: boolean;
|
|
261
|
+
status?: import('./enums').FormStatus;
|
|
262
|
+
submit?: InjectedFormData<Schema_2>["submit"];
|
|
263
|
+
validate?: ((formData?: Partial<import('zod').TypeOf<Schema>> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
264
|
+
clear?: InjectedFormData<Schema_2>["clear"];
|
|
265
|
+
reset?: InjectedFormData<Schema_2>["reset"];
|
|
266
|
+
};
|
|
267
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
268
|
+
VvFormWrapper: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
269
|
+
name: {
|
|
270
|
+
type: StringConstructor;
|
|
271
|
+
required: true;
|
|
272
|
+
};
|
|
273
|
+
tag: {
|
|
274
|
+
type: StringConstructor;
|
|
275
|
+
default: undefined;
|
|
276
|
+
};
|
|
277
|
+
}>, {
|
|
278
|
+
clear: (() => void) | undefined;
|
|
279
|
+
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined, import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
280
|
+
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>, Set<string> | (Set<string> & Omit<Set<string>, keyof Set<any>>)>;
|
|
281
|
+
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<Schema, string>>, Map<string, import('zod').inferFormattedError<Schema, string>>>;
|
|
282
|
+
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema>> | undefined, Partial<import('zod').TypeOf<Schema>> | undefined> | undefined;
|
|
283
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
284
|
+
reset: (() => void) | undefined;
|
|
285
|
+
submit: (() => Promise<boolean>) | undefined;
|
|
286
|
+
validate: ((formData?: Partial<import('zod').TypeOf<Schema>> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
287
|
+
validateWrapper: () => Promise<boolean>;
|
|
288
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
289
|
+
name: {
|
|
290
|
+
type: StringConstructor;
|
|
291
|
+
required: true;
|
|
292
|
+
};
|
|
293
|
+
tag: {
|
|
294
|
+
type: StringConstructor;
|
|
295
|
+
default: undefined;
|
|
296
|
+
};
|
|
297
|
+
}>> & Readonly<{
|
|
298
|
+
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
299
|
+
onValid?: ((...args: any[]) => any) | undefined;
|
|
300
|
+
}>, {
|
|
301
|
+
tag: string;
|
|
302
|
+
}, import('vue').SlotsType<{
|
|
303
|
+
default: {
|
|
304
|
+
errors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
305
|
+
formData?: Partial<import('zod').TypeOf<Schema>> | undefined;
|
|
306
|
+
formErrors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
307
|
+
invalid: boolean;
|
|
308
|
+
submit?: InjectedFormData<Schema_3>["submit"];
|
|
309
|
+
validate?: ((formData?: Partial<import('zod').TypeOf<Schema>> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
310
|
+
validateWrapper?: (() => Promise<boolean>) | undefined;
|
|
311
|
+
fieldsErrors: Map<string, import('zod').inferFormattedError<Schema, string>>;
|
|
312
|
+
clear?: InjectedFormData<Schema_3>["clear"];
|
|
313
|
+
reset?: InjectedFormData<Schema_3>["reset"];
|
|
314
|
+
};
|
|
315
|
+
}>, {}, {}, "invalid" | "reset" | "clear" | "errors" | "submit" | "validate" | "formData" | "tag" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
316
|
+
} | {
|
|
317
|
+
clear: () => void;
|
|
318
|
+
errors: import('vue').Ref<import('zod').inferFormattedError<AnyZodObject, string> | undefined, import('zod').inferFormattedError<AnyZodObject, string> | undefined>;
|
|
319
|
+
formData: import('vue').Ref<Partial<{
|
|
320
|
+
[x: string]: any;
|
|
321
|
+
} | undefined>, Partial<{
|
|
322
|
+
[x: string]: any;
|
|
323
|
+
} | undefined>>;
|
|
324
|
+
formFieldInjectionKey: InjectionKey<InjectedFormFieldData<AnyZodObject>>;
|
|
325
|
+
formInjectionKey: InjectionKey<InjectedFormData<AnyZodObject>>;
|
|
326
|
+
formWrapperInjectionKey: InjectionKey<InjectedFormWrapperData<AnyZodObject>>;
|
|
499
327
|
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
328
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
329
|
+
readonly: import('vue').Ref<boolean, boolean>;
|
|
330
|
+
reset: () => void;
|
|
331
|
+
status: import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>;
|
|
500
332
|
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
default: boolean;
|
|
507
|
-
};
|
|
508
|
-
modelValue: {
|
|
509
|
-
type: ObjectConstructor;
|
|
510
|
-
default: () => {};
|
|
511
|
-
};
|
|
512
|
-
readonly: {
|
|
513
|
-
type: BooleanConstructor;
|
|
514
|
-
default: boolean;
|
|
515
|
-
};
|
|
516
|
-
tag: {
|
|
517
|
-
type: StringConstructor;
|
|
518
|
-
default: string;
|
|
519
|
-
};
|
|
520
|
-
template: {
|
|
521
|
-
type: import('vue').PropType<FormTemplate<AnyZodObject>>;
|
|
522
|
-
default: undefined;
|
|
523
|
-
};
|
|
524
|
-
}>> & {
|
|
525
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
526
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
527
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
528
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
529
|
-
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
530
|
-
}, {
|
|
531
|
-
formData: import('vue').Ref<Partial<{
|
|
532
|
-
[x: string]: any;
|
|
533
|
-
} | undefined>>;
|
|
534
|
-
submit: () => Promise<boolean>;
|
|
535
|
-
validate: (value?: Partial<{
|
|
536
|
-
[x: string]: any;
|
|
537
|
-
} | undefined>) => Promise<boolean>;
|
|
538
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
539
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
540
|
-
errors: Readonly<import('vue').Ref<{
|
|
541
|
-
readonly [x: string]: {
|
|
542
|
-
readonly _errors: readonly string[];
|
|
543
|
-
} | undefined;
|
|
544
|
-
readonly _errors: readonly string[];
|
|
545
|
-
} | undefined>>;
|
|
546
|
-
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined>>;
|
|
547
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
548
|
-
isReadonly: import('vue').Ref<boolean>;
|
|
549
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
550
|
-
continuousValidation: {
|
|
551
|
-
type: BooleanConstructor;
|
|
552
|
-
default: boolean;
|
|
553
|
-
};
|
|
554
|
-
modelValue: {
|
|
555
|
-
type: ObjectConstructor;
|
|
556
|
-
default: () => {};
|
|
557
|
-
};
|
|
558
|
-
readonly: {
|
|
559
|
-
type: BooleanConstructor;
|
|
560
|
-
default: boolean;
|
|
561
|
-
};
|
|
562
|
-
tag: {
|
|
563
|
-
type: StringConstructor;
|
|
564
|
-
default: string;
|
|
565
|
-
};
|
|
566
|
-
template: {
|
|
567
|
-
type: import('vue').PropType<FormTemplate<AnyZodObject>>;
|
|
568
|
-
default: undefined;
|
|
569
|
-
};
|
|
570
|
-
}>> & {
|
|
571
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
572
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
573
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
574
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
575
|
-
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
576
|
-
}, {
|
|
577
|
-
readonly: boolean;
|
|
578
|
-
template: FormTemplate<AnyZodObject>;
|
|
579
|
-
modelValue: Record<string, any>;
|
|
580
|
-
continuousValidation: boolean;
|
|
581
|
-
tag: string;
|
|
582
|
-
}, true, {}, {}, {
|
|
583
|
-
P: {};
|
|
584
|
-
B: {};
|
|
585
|
-
D: {};
|
|
586
|
-
C: {};
|
|
587
|
-
M: {};
|
|
588
|
-
Defaults: {};
|
|
589
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
590
|
-
continuousValidation: {
|
|
591
|
-
type: BooleanConstructor;
|
|
592
|
-
default: boolean;
|
|
593
|
-
};
|
|
594
|
-
modelValue: {
|
|
595
|
-
type: ObjectConstructor;
|
|
596
|
-
default: () => {};
|
|
597
|
-
};
|
|
598
|
-
readonly: {
|
|
599
|
-
type: BooleanConstructor;
|
|
600
|
-
default: boolean;
|
|
601
|
-
};
|
|
602
|
-
tag: {
|
|
603
|
-
type: StringConstructor;
|
|
604
|
-
default: string;
|
|
605
|
-
};
|
|
606
|
-
template: {
|
|
607
|
-
type: import('vue').PropType<FormTemplate<AnyZodObject>>;
|
|
608
|
-
default: undefined;
|
|
609
|
-
};
|
|
610
|
-
}>> & {
|
|
611
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
612
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
613
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
614
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
615
|
-
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
616
|
-
}, {
|
|
617
|
-
formData: import('vue').Ref<Partial<{
|
|
618
|
-
[x: string]: any;
|
|
619
|
-
} | undefined>>;
|
|
620
|
-
submit: () => Promise<boolean>;
|
|
621
|
-
validate: (value?: Partial<{
|
|
622
|
-
[x: string]: any;
|
|
623
|
-
} | undefined>) => Promise<boolean>;
|
|
624
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
625
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
626
|
-
errors: Readonly<import('vue').Ref<{
|
|
627
|
-
readonly [x: string]: {
|
|
628
|
-
readonly _errors: readonly string[];
|
|
629
|
-
} | undefined;
|
|
630
|
-
readonly _errors: readonly string[];
|
|
631
|
-
} | undefined>>;
|
|
632
|
-
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined>>;
|
|
633
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
634
|
-
isReadonly: import('vue').Ref<boolean>;
|
|
635
|
-
}, {}, {}, {}, {
|
|
636
|
-
readonly: boolean;
|
|
637
|
-
template: FormTemplate<AnyZodObject>;
|
|
638
|
-
modelValue: Record<string, any>;
|
|
639
|
-
continuousValidation: boolean;
|
|
640
|
-
tag: string;
|
|
641
|
-
}>;
|
|
642
|
-
__isFragment?: never;
|
|
643
|
-
__isTeleport?: never;
|
|
644
|
-
__isSuspense?: never;
|
|
645
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
333
|
+
submit: () => Promise<boolean>;
|
|
334
|
+
validate: (value?: Partial<{
|
|
335
|
+
[x: string]: any;
|
|
336
|
+
} | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
337
|
+
VvForm: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
646
338
|
continuousValidation: {
|
|
647
339
|
type: BooleanConstructor;
|
|
648
340
|
default: boolean;
|
|
@@ -663,178 +355,100 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
663
355
|
type: import('vue').PropType<FormTemplate<AnyZodObject>>;
|
|
664
356
|
default: undefined;
|
|
665
357
|
};
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
669
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
670
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
671
|
-
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
672
|
-
}, {
|
|
673
|
-
formData: import('vue').Ref<Partial<{
|
|
674
|
-
[x: string]: any;
|
|
675
|
-
} | undefined>>;
|
|
676
|
-
submit: () => Promise<boolean>;
|
|
677
|
-
validate: (value?: Partial<{
|
|
678
|
-
[x: string]: any;
|
|
679
|
-
} | undefined>) => Promise<boolean>;
|
|
680
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
681
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
358
|
+
}>, {
|
|
359
|
+
clear: () => void;
|
|
682
360
|
errors: Readonly<import('vue').Ref<{
|
|
683
361
|
readonly [x: string]: {
|
|
684
362
|
readonly _errors: readonly string[];
|
|
685
363
|
} | undefined;
|
|
686
364
|
readonly _errors: readonly string[];
|
|
365
|
+
} | undefined, {
|
|
366
|
+
readonly [x: string]: {
|
|
367
|
+
readonly _errors: readonly string[];
|
|
368
|
+
} | undefined;
|
|
369
|
+
readonly _errors: readonly string[];
|
|
370
|
+
} | undefined>>;
|
|
371
|
+
formData: import('vue').Ref<Partial<{
|
|
372
|
+
[x: string]: any;
|
|
373
|
+
} | undefined>, Partial<{
|
|
374
|
+
[x: string]: any;
|
|
687
375
|
} | undefined>>;
|
|
688
|
-
|
|
376
|
+
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
689
377
|
invalid: import('vue').ComputedRef<boolean>;
|
|
690
|
-
isReadonly: import('vue').Ref<boolean>;
|
|
691
|
-
|
|
378
|
+
isReadonly: import('vue').Ref<boolean, boolean>;
|
|
379
|
+
reset: () => void;
|
|
380
|
+
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>>;
|
|
381
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
382
|
+
submit: () => Promise<boolean>;
|
|
383
|
+
validate: (value?: Partial<{
|
|
384
|
+
[x: string]: any;
|
|
385
|
+
} | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
386
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "reset" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "reset" | "update:modelValue" | "submit" | "update:readonly", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
387
|
+
continuousValidation: {
|
|
388
|
+
type: BooleanConstructor;
|
|
389
|
+
default: boolean;
|
|
390
|
+
};
|
|
391
|
+
modelValue: {
|
|
392
|
+
type: ObjectConstructor;
|
|
393
|
+
default: () => {};
|
|
394
|
+
};
|
|
395
|
+
readonly: {
|
|
396
|
+
type: BooleanConstructor;
|
|
397
|
+
default: boolean;
|
|
398
|
+
};
|
|
399
|
+
tag: {
|
|
400
|
+
type: StringConstructor;
|
|
401
|
+
default: string;
|
|
402
|
+
};
|
|
403
|
+
template: {
|
|
404
|
+
type: import('vue').PropType<FormTemplate<AnyZodObject>>;
|
|
405
|
+
default: undefined;
|
|
406
|
+
};
|
|
407
|
+
}>> & Readonly<{
|
|
408
|
+
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
409
|
+
onValid?: ((...args: any[]) => any) | undefined;
|
|
410
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
411
|
+
onReset?: ((...args: any[]) => any) | undefined;
|
|
412
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
413
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
414
|
+
}>, {
|
|
692
415
|
readonly: boolean;
|
|
693
416
|
template: FormTemplate<AnyZodObject>;
|
|
694
417
|
modelValue: Record<string, any>;
|
|
695
|
-
continuousValidation: boolean;
|
|
696
418
|
tag: string;
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
formData: unknown extends Partial<import('zod').TypeOf<AnyZodObject>> | undefined ? undefined : Partial<import('zod').TypeOf<AnyZodObject>> | undefined;
|
|
701
|
-
submit: () => Promise<boolean>;
|
|
702
|
-
validate: () => Promise<boolean>;
|
|
703
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
704
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
705
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<AnyZodObject>>>>;
|
|
706
|
-
status: import('vue').Ref<import('vue').DeepReadonly<`${import('./enums').FormStatus}` | undefined>>;
|
|
707
|
-
invalid: import('vue').Ref<import('vue').DeepReadonly<boolean>>;
|
|
708
|
-
readonly: import('vue').Ref<boolean>;
|
|
709
|
-
}) => any;
|
|
710
|
-
};
|
|
711
|
-
});
|
|
712
|
-
VvFormWrapper: {
|
|
713
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
714
|
-
name: {
|
|
715
|
-
type: StringConstructor;
|
|
716
|
-
required: true;
|
|
717
|
-
};
|
|
718
|
-
tag: {
|
|
719
|
-
type: StringConstructor;
|
|
720
|
-
default: undefined;
|
|
721
|
-
};
|
|
722
|
-
}>> & {
|
|
723
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
724
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
725
|
-
}, {
|
|
726
|
-
formData: import('vue').Ref<Partial<{
|
|
727
|
-
[x: string]: any;
|
|
728
|
-
}> | undefined> | undefined;
|
|
419
|
+
continuousValidation: boolean;
|
|
420
|
+
}, import('vue').SlotsType<{
|
|
421
|
+
default: {
|
|
729
422
|
errors: Readonly<import('vue').Ref<{
|
|
730
423
|
readonly [x: string]: {
|
|
731
424
|
readonly _errors: readonly string[];
|
|
732
425
|
} | undefined;
|
|
733
426
|
readonly _errors: readonly string[];
|
|
734
|
-
} | undefined
|
|
735
|
-
submit: (() => Promise<boolean>) | undefined;
|
|
736
|
-
validate: (() => Promise<boolean>) | undefined;
|
|
737
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
738
|
-
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
739
|
-
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<AnyZodObject, string>>>;
|
|
740
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
741
|
-
name: {
|
|
742
|
-
type: StringConstructor;
|
|
743
|
-
required: true;
|
|
744
|
-
};
|
|
745
|
-
tag: {
|
|
746
|
-
type: StringConstructor;
|
|
747
|
-
default: undefined;
|
|
748
|
-
};
|
|
749
|
-
}>> & {
|
|
750
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
751
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
752
|
-
}, {
|
|
753
|
-
tag: string;
|
|
754
|
-
}, true, {}, {}, {
|
|
755
|
-
P: {};
|
|
756
|
-
B: {};
|
|
757
|
-
D: {};
|
|
758
|
-
C: {};
|
|
759
|
-
M: {};
|
|
760
|
-
Defaults: {};
|
|
761
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
762
|
-
name: {
|
|
763
|
-
type: StringConstructor;
|
|
764
|
-
required: true;
|
|
765
|
-
};
|
|
766
|
-
tag: {
|
|
767
|
-
type: StringConstructor;
|
|
768
|
-
default: undefined;
|
|
769
|
-
};
|
|
770
|
-
}>> & {
|
|
771
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
772
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
773
|
-
}, {
|
|
774
|
-
formData: import('vue').Ref<Partial<{
|
|
775
|
-
[x: string]: any;
|
|
776
|
-
}> | undefined> | undefined;
|
|
777
|
-
errors: Readonly<import('vue').Ref<{
|
|
427
|
+
} | undefined, {
|
|
778
428
|
readonly [x: string]: {
|
|
779
429
|
readonly _errors: readonly string[];
|
|
780
430
|
} | undefined;
|
|
781
431
|
readonly _errors: readonly string[];
|
|
782
|
-
} | undefined
|
|
783
|
-
|
|
784
|
-
|
|
432
|
+
} | undefined>>;
|
|
433
|
+
formData: import('vue').Ref<Partial<{
|
|
434
|
+
[x: string]: any;
|
|
435
|
+
} | undefined>, Partial<{
|
|
436
|
+
[x: string]: any;
|
|
437
|
+
} | undefined>>;
|
|
438
|
+
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
785
439
|
invalid: import('vue').ComputedRef<boolean>;
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
name: {
|
|
796
|
-
type: StringConstructor;
|
|
797
|
-
required: true;
|
|
798
|
-
};
|
|
799
|
-
tag: {
|
|
800
|
-
type: StringConstructor;
|
|
801
|
-
default: undefined;
|
|
440
|
+
readonly: import('vue').Ref<boolean, boolean>;
|
|
441
|
+
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>>;
|
|
442
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
443
|
+
submit: () => Promise<boolean>;
|
|
444
|
+
validate: (value?: Partial<{
|
|
445
|
+
[x: string]: any;
|
|
446
|
+
} | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
447
|
+
clear: () => void;
|
|
448
|
+
reset: () => void;
|
|
802
449
|
};
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
806
|
-
}, {
|
|
807
|
-
formData: import('vue').Ref<Partial<{
|
|
808
|
-
[x: string]: any;
|
|
809
|
-
}> | undefined> | undefined;
|
|
810
|
-
errors: Readonly<import('vue').Ref<{
|
|
811
|
-
readonly [x: string]: {
|
|
812
|
-
readonly _errors: readonly string[];
|
|
813
|
-
} | undefined;
|
|
814
|
-
readonly _errors: readonly string[];
|
|
815
|
-
} | undefined>> | undefined;
|
|
816
|
-
submit: (() => Promise<boolean>) | undefined;
|
|
817
|
-
validate: (() => Promise<boolean>) | undefined;
|
|
818
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
819
|
-
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
820
|
-
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<AnyZodObject, string>>>;
|
|
821
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", {
|
|
822
|
-
tag: string;
|
|
823
|
-
}, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
824
|
-
$slots: {
|
|
825
|
-
default: (_: {
|
|
826
|
-
invalid: boolean;
|
|
827
|
-
formData: unknown extends Partial<import('zod').TypeOf<AnyZodObject>> | undefined ? undefined : Partial<import('zod').TypeOf<AnyZodObject>> | undefined;
|
|
828
|
-
submit: () => Promise<boolean>;
|
|
829
|
-
validate: () => Promise<boolean>;
|
|
830
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<AnyZodObject>>>>;
|
|
831
|
-
fieldsErrors: Map<string, Record<string, {
|
|
832
|
-
_errors: string[];
|
|
833
|
-
}>>;
|
|
834
|
-
}) => any;
|
|
835
|
-
};
|
|
836
|
-
});
|
|
837
|
-
VvFormField: import('vue').DefineComponent<{
|
|
450
|
+
}>, {}, {}, "invalid" | "valid" | "reset" | "status" | "clear" | "errors" | "submit" | "validate" | "readonly" | "template" | "tag", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
451
|
+
VvFormField: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
838
452
|
type: {
|
|
839
453
|
type: import('vue').PropType<`${import('./enums').FormFieldType}`>;
|
|
840
454
|
validator: (value: import('./enums').FormFieldType) => boolean;
|
|
@@ -851,7 +465,9 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
851
465
|
props: {
|
|
852
466
|
type: import('vue').PropType<Partial<{
|
|
853
467
|
[x: string]: any;
|
|
854
|
-
} | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<
|
|
468
|
+
} | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<{
|
|
469
|
+
[x: string]: any;
|
|
470
|
+
}> | undefined) | undefined>>;
|
|
855
471
|
default: () => {};
|
|
856
472
|
};
|
|
857
473
|
showValid: {
|
|
@@ -870,7 +486,7 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
870
486
|
type: BooleanConstructor;
|
|
871
487
|
default: undefined;
|
|
872
488
|
};
|
|
873
|
-
}
|
|
489
|
+
}>, {
|
|
874
490
|
component: import('vue').ComputedRef<{
|
|
875
491
|
new (...args: any[]): any;
|
|
876
492
|
__isFragment?: never;
|
|
@@ -884,11 +500,11 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
884
500
|
type: import('./enums').FormFieldType | undefined;
|
|
885
501
|
invalidLabel: any;
|
|
886
502
|
modelValue: any;
|
|
887
|
-
readonly:
|
|
503
|
+
readonly: boolean;
|
|
888
504
|
'onUpdate:modelValue': (value: unknown) => void;
|
|
889
505
|
}>;
|
|
890
506
|
invalid: import('vue').ComputedRef<boolean>;
|
|
891
|
-
},
|
|
507
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:formData" | "update:modelValue")[], "invalid" | "valid" | "update:formData" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
892
508
|
type: {
|
|
893
509
|
type: import('vue').PropType<`${import('./enums').FormFieldType}`>;
|
|
894
510
|
validator: (value: import('./enums').FormFieldType) => boolean;
|
|
@@ -905,7 +521,9 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
905
521
|
props: {
|
|
906
522
|
type: import('vue').PropType<Partial<{
|
|
907
523
|
[x: string]: any;
|
|
908
|
-
} | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<
|
|
524
|
+
} | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<{
|
|
525
|
+
[x: string]: any;
|
|
526
|
+
}> | undefined) | undefined>>;
|
|
909
527
|
default: () => {};
|
|
910
528
|
};
|
|
911
529
|
showValid: {
|
|
@@ -924,74 +542,47 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
924
542
|
type: BooleanConstructor;
|
|
925
543
|
default: undefined;
|
|
926
544
|
};
|
|
927
|
-
}>> & {
|
|
545
|
+
}>> & Readonly<{
|
|
928
546
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
929
547
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
930
548
|
"onUpdate:formData"?: ((...args: any[]) => any) | undefined;
|
|
931
549
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
932
|
-
}
|
|
550
|
+
}>, {
|
|
933
551
|
type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
|
|
934
552
|
props: Partial<{
|
|
935
553
|
[x: string]: any;
|
|
936
|
-
} | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<
|
|
554
|
+
} | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<{
|
|
555
|
+
[x: string]: any;
|
|
556
|
+
}> | undefined) | undefined>;
|
|
937
557
|
is: string | import('vue').Component;
|
|
938
558
|
showValid: boolean;
|
|
939
559
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
940
560
|
lazyLoad: boolean;
|
|
941
561
|
readonly: boolean;
|
|
942
|
-
}, {
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
}>>, {
|
|
967
|
-
scope: Record<string, unknown>;
|
|
968
|
-
}, true, {}, {}, {
|
|
969
|
-
P: {};
|
|
970
|
-
B: {};
|
|
971
|
-
D: {};
|
|
972
|
-
C: {};
|
|
973
|
-
M: {};
|
|
974
|
-
Defaults: {};
|
|
975
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
976
|
-
schema: {
|
|
977
|
-
type: import('vue').PropType<FormTemplate<AnyZodObject>>;
|
|
978
|
-
required: true;
|
|
979
|
-
};
|
|
980
|
-
scope: {
|
|
981
|
-
type: import('vue').PropType<Record<string, unknown>>;
|
|
982
|
-
default: () => {};
|
|
983
|
-
};
|
|
984
|
-
}>>, {} | (() => (import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
985
|
-
[key: string]: any;
|
|
986
|
-
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
987
|
-
[key: string]: any;
|
|
988
|
-
}>[] | undefined)[]), {}, {}, {}, {
|
|
989
|
-
scope: Record<string, unknown>;
|
|
990
|
-
}>;
|
|
991
|
-
__isFragment?: never;
|
|
992
|
-
__isTeleport?: never;
|
|
993
|
-
__isSuspense?: never;
|
|
994
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
562
|
+
}, import('vue').SlotsType<{
|
|
563
|
+
default: {
|
|
564
|
+
errors: import('zod').inferFormattedError<AnyZodObject, string>;
|
|
565
|
+
formData?: Partial<{
|
|
566
|
+
[x: string]: any;
|
|
567
|
+
}> | undefined;
|
|
568
|
+
formErrors?: {
|
|
569
|
+
readonly [x: string]: {
|
|
570
|
+
readonly _errors: readonly string[];
|
|
571
|
+
} | undefined;
|
|
572
|
+
readonly _errors: readonly string[];
|
|
573
|
+
} | undefined;
|
|
574
|
+
invalid: boolean;
|
|
575
|
+
invalidLabel: string;
|
|
576
|
+
modelValue: unknown;
|
|
577
|
+
onUpdate: (value: unknown) => void;
|
|
578
|
+
readonly: boolean;
|
|
579
|
+
submit?: InjectedFormData<Schema_1>["submit"];
|
|
580
|
+
validate?: ((formData?: Partial<{
|
|
581
|
+
[x: string]: any;
|
|
582
|
+
}> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
583
|
+
};
|
|
584
|
+
}>, {}, {}, "invalid" | "type" | "component" | "errors" | "hasProps" | "invalidLabel" | "is", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
585
|
+
VvFormTemplate: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
995
586
|
schema: {
|
|
996
587
|
type: import('vue').PropType<FormTemplate<AnyZodObject>>;
|
|
997
588
|
required: true;
|
|
@@ -1000,40 +591,120 @@ export declare function useForm<Schema extends FormSchema>(schema: Schema, optio
|
|
|
1000
591
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1001
592
|
default: () => {};
|
|
1002
593
|
};
|
|
1003
|
-
}
|
|
594
|
+
}>, (() => (import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
1004
595
|
[key: string]: any;
|
|
1005
596
|
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
1006
597
|
[key: string]: any;
|
|
1007
|
-
}>[] | undefined)[]) | undefined,
|
|
598
|
+
}>[] | undefined)[]) | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
599
|
+
schema: {
|
|
600
|
+
type: import('vue').PropType<FormTemplate<AnyZodObject>>;
|
|
601
|
+
required: true;
|
|
602
|
+
};
|
|
603
|
+
scope: {
|
|
604
|
+
type: import('vue').PropType<Record<string, unknown>>;
|
|
605
|
+
default: () => {};
|
|
606
|
+
};
|
|
607
|
+
}>> & Readonly<{}>, {
|
|
1008
608
|
scope: Record<string, unknown>;
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
609
|
+
}, import('vue').SlotsType<{
|
|
610
|
+
default: {
|
|
611
|
+
errors?: {
|
|
612
|
+
readonly [x: string]: {
|
|
613
|
+
readonly _errors: readonly string[];
|
|
614
|
+
} | undefined;
|
|
615
|
+
readonly _errors: readonly string[];
|
|
616
|
+
} | undefined;
|
|
617
|
+
formData?: Partial<{
|
|
618
|
+
[x: string]: any;
|
|
619
|
+
}> | undefined;
|
|
620
|
+
invalid: boolean;
|
|
621
|
+
status?: import('./enums').FormStatus;
|
|
622
|
+
submit?: InjectedFormData<Schema_2>["submit"];
|
|
623
|
+
validate?: ((formData?: Partial<{
|
|
624
|
+
[x: string]: any;
|
|
625
|
+
}> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
626
|
+
clear?: InjectedFormData<Schema_2>["clear"];
|
|
627
|
+
reset?: InjectedFormData<Schema_2>["reset"];
|
|
628
|
+
};
|
|
629
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
630
|
+
VvFormWrapper: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
631
|
+
name: {
|
|
632
|
+
type: StringConstructor;
|
|
633
|
+
required: true;
|
|
634
|
+
};
|
|
635
|
+
tag: {
|
|
636
|
+
type: StringConstructor;
|
|
637
|
+
default: undefined;
|
|
638
|
+
};
|
|
639
|
+
}>, {
|
|
640
|
+
clear: (() => void) | undefined;
|
|
641
|
+
errors: Readonly<import('vue').Ref<{
|
|
642
|
+
readonly [x: string]: {
|
|
643
|
+
readonly _errors: readonly string[];
|
|
644
|
+
} | undefined;
|
|
645
|
+
readonly _errors: readonly string[];
|
|
646
|
+
} | undefined, {
|
|
647
|
+
readonly [x: string]: {
|
|
648
|
+
readonly _errors: readonly string[];
|
|
649
|
+
} | undefined;
|
|
650
|
+
readonly _errors: readonly string[];
|
|
651
|
+
} | undefined>> | undefined;
|
|
652
|
+
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>, Set<string> | (Set<string> & Omit<Set<string>, keyof Set<any>>)>;
|
|
653
|
+
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<AnyZodObject, string>>, Map<string, import('zod').inferFormattedError<AnyZodObject, string>>>;
|
|
654
|
+
formData: import('vue').Ref<Partial<{
|
|
655
|
+
[x: string]: any;
|
|
656
|
+
}> | undefined, Partial<{
|
|
657
|
+
[x: string]: any;
|
|
658
|
+
}> | undefined> | undefined;
|
|
659
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
660
|
+
reset: (() => void) | undefined;
|
|
661
|
+
submit: (() => Promise<boolean>) | undefined;
|
|
662
|
+
validate: ((formData?: Partial<{
|
|
663
|
+
[x: string]: any;
|
|
664
|
+
}> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
665
|
+
validateWrapper: () => Promise<boolean>;
|
|
666
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
667
|
+
name: {
|
|
668
|
+
type: StringConstructor;
|
|
669
|
+
required: true;
|
|
670
|
+
};
|
|
671
|
+
tag: {
|
|
672
|
+
type: StringConstructor;
|
|
673
|
+
default: undefined;
|
|
674
|
+
};
|
|
675
|
+
}>> & Readonly<{
|
|
676
|
+
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
677
|
+
onValid?: ((...args: any[]) => any) | undefined;
|
|
678
|
+
}>, {
|
|
679
|
+
tag: string;
|
|
680
|
+
}, import('vue').SlotsType<{
|
|
681
|
+
default: {
|
|
682
|
+
errors?: {
|
|
683
|
+
readonly [x: string]: {
|
|
684
|
+
readonly _errors: readonly string[];
|
|
685
|
+
} | undefined;
|
|
686
|
+
readonly _errors: readonly string[];
|
|
687
|
+
} | undefined;
|
|
688
|
+
formData?: Partial<{
|
|
689
|
+
[x: string]: any;
|
|
690
|
+
}> | undefined;
|
|
691
|
+
formErrors?: {
|
|
692
|
+
readonly [x: string]: {
|
|
693
|
+
readonly _errors: readonly string[];
|
|
694
|
+
} | undefined;
|
|
695
|
+
readonly _errors: readonly string[];
|
|
696
|
+
} | undefined;
|
|
697
|
+
invalid: boolean;
|
|
698
|
+
submit?: InjectedFormData<Schema_3>["submit"];
|
|
699
|
+
validate?: ((formData?: Partial<{
|
|
700
|
+
[x: string]: any;
|
|
701
|
+
}> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
702
|
+
validateWrapper?: (() => Promise<boolean>) | undefined;
|
|
703
|
+
fieldsErrors: Map<string, import('zod').inferFormattedError<AnyZodObject, string>>;
|
|
704
|
+
clear?: InjectedFormData<Schema_3>["clear"];
|
|
705
|
+
reset?: InjectedFormData<Schema_3>["reset"];
|
|
706
|
+
};
|
|
707
|
+
}>, {}, {}, "invalid" | "reset" | "clear" | "errors" | "submit" | "validate" | "formData" | "tag" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1037
708
|
};
|
|
1038
709
|
export { FormFieldType } from './enums';
|
|
1039
710
|
export { defaultObjectBySchema } from './utils';
|
|
@@ -1041,137 +712,59 @@ type FormComponent = ReturnType<typeof defineForm>;
|
|
|
1041
712
|
type FormWrapperComponent = ReturnType<typeof defineFormWrapper>;
|
|
1042
713
|
type FormFieldComponent = ReturnType<typeof defineFormField>;
|
|
1043
714
|
type FormTemplateComponent = ReturnType<typeof defineFormTemplate>;
|
|
1044
|
-
export type {
|
|
715
|
+
export type { FormComponent, FormComposableOptions, FormFieldComponent, FormPluginOptions, FormSchema, FormTemplate, FormTemplateComponent, FormTemplateItem, FormWrapperComponent, InjectedFormData, InjectedFormFieldData, InjectedFormWrapperData, Path, PathValue, };
|
|
1045
716
|
/**
|
|
1046
717
|
* @deprecated Use `useForm()` instead
|
|
1047
718
|
*/
|
|
1048
719
|
export declare function formFactory<Schema extends FormSchema>(schema: Schema, options?: FormComposableOptions<Schema>): {
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
};
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
type: BooleanConstructor;
|
|
1098
|
-
default: boolean;
|
|
1099
|
-
};
|
|
1100
|
-
tag: {
|
|
1101
|
-
type: StringConstructor;
|
|
1102
|
-
default: string;
|
|
1103
|
-
};
|
|
1104
|
-
template: {
|
|
1105
|
-
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
1106
|
-
default: undefined;
|
|
1107
|
-
};
|
|
1108
|
-
}>> & {
|
|
1109
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1110
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
1111
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1112
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
1113
|
-
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
1114
|
-
}, {
|
|
1115
|
-
readonly: boolean;
|
|
1116
|
-
template: FormTemplate<Schema>;
|
|
1117
|
-
modelValue: Record<string, any>;
|
|
1118
|
-
continuousValidation: boolean;
|
|
1119
|
-
tag: string;
|
|
1120
|
-
}, true, {}, {}, {
|
|
1121
|
-
P: {};
|
|
1122
|
-
B: {};
|
|
1123
|
-
D: {};
|
|
1124
|
-
C: {};
|
|
1125
|
-
M: {};
|
|
1126
|
-
Defaults: {};
|
|
1127
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
1128
|
-
continuousValidation: {
|
|
1129
|
-
type: BooleanConstructor;
|
|
1130
|
-
default: boolean;
|
|
1131
|
-
};
|
|
1132
|
-
modelValue: {
|
|
1133
|
-
type: ObjectConstructor;
|
|
1134
|
-
default: () => {};
|
|
1135
|
-
};
|
|
1136
|
-
readonly: {
|
|
1137
|
-
type: BooleanConstructor;
|
|
1138
|
-
default: boolean;
|
|
1139
|
-
};
|
|
1140
|
-
tag: {
|
|
1141
|
-
type: StringConstructor;
|
|
1142
|
-
default: string;
|
|
1143
|
-
};
|
|
1144
|
-
template: {
|
|
1145
|
-
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
1146
|
-
default: undefined;
|
|
1147
|
-
};
|
|
1148
|
-
}>> & {
|
|
1149
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1150
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
1151
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1152
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
1153
|
-
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
1154
|
-
}, {
|
|
1155
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
1156
|
-
submit: () => Promise<boolean>;
|
|
1157
|
-
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
1158
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
1159
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
1160
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>>;
|
|
1161
|
-
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined>>;
|
|
1162
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
1163
|
-
isReadonly: import('vue').Ref<boolean>;
|
|
1164
|
-
}, {}, {}, {}, {
|
|
1165
|
-
readonly: boolean;
|
|
1166
|
-
template: FormTemplate<Schema>;
|
|
1167
|
-
modelValue: Record<string, any>;
|
|
1168
|
-
continuousValidation: boolean;
|
|
1169
|
-
tag: string;
|
|
1170
|
-
}>;
|
|
1171
|
-
__isFragment?: never;
|
|
1172
|
-
__isTeleport?: never;
|
|
1173
|
-
__isSuspense?: never;
|
|
1174
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
720
|
+
clear: () => void;
|
|
721
|
+
errors: import('vue').Ref<import('zod').inferFormattedError<Schema, string> | undefined, import('zod').inferFormattedError<Schema, string> | undefined>;
|
|
722
|
+
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>, Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
723
|
+
formFieldInjectionKey: InjectionKey<InjectedFormFieldData<Schema>>;
|
|
724
|
+
formInjectionKey: InjectionKey<InjectedFormData<Schema>>;
|
|
725
|
+
formWrapperInjectionKey: InjectionKey<InjectedFormWrapperData<Schema>>;
|
|
726
|
+
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
727
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
728
|
+
readonly: import('vue').Ref<boolean, boolean>;
|
|
729
|
+
reset: () => void;
|
|
730
|
+
status: import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>;
|
|
731
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
732
|
+
submit: () => Promise<boolean>;
|
|
733
|
+
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
734
|
+
VvForm: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
735
|
+
continuousValidation: {
|
|
736
|
+
type: BooleanConstructor;
|
|
737
|
+
default: boolean;
|
|
738
|
+
};
|
|
739
|
+
modelValue: {
|
|
740
|
+
type: ObjectConstructor;
|
|
741
|
+
default: () => {};
|
|
742
|
+
};
|
|
743
|
+
readonly: {
|
|
744
|
+
type: BooleanConstructor;
|
|
745
|
+
default: boolean;
|
|
746
|
+
};
|
|
747
|
+
tag: {
|
|
748
|
+
type: StringConstructor;
|
|
749
|
+
default: string;
|
|
750
|
+
};
|
|
751
|
+
template: {
|
|
752
|
+
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
753
|
+
default: undefined;
|
|
754
|
+
};
|
|
755
|
+
}>, {
|
|
756
|
+
clear: () => void;
|
|
757
|
+
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined, import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>>;
|
|
758
|
+
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>, Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
759
|
+
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
760
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
761
|
+
isReadonly: import('vue').Ref<boolean, boolean>;
|
|
762
|
+
reset: () => void;
|
|
763
|
+
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>>;
|
|
764
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
765
|
+
submit: () => Promise<boolean>;
|
|
766
|
+
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
767
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "reset" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "reset" | "update:modelValue" | "submit" | "update:readonly", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
1175
768
|
continuousValidation: {
|
|
1176
769
|
type: BooleanConstructor;
|
|
1177
770
|
default: boolean;
|
|
@@ -1192,148 +785,35 @@ export declare function formFactory<Schema extends FormSchema>(schema: Schema, o
|
|
|
1192
785
|
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
1193
786
|
default: undefined;
|
|
1194
787
|
};
|
|
1195
|
-
}>> & {
|
|
788
|
+
}>> & Readonly<{
|
|
1196
789
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1197
790
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
1198
791
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
792
|
+
onReset?: ((...args: any[]) => any) | undefined;
|
|
1199
793
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
1200
794
|
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
1201
|
-
}
|
|
1202
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
1203
|
-
submit: () => Promise<boolean>;
|
|
1204
|
-
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
1205
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
1206
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
1207
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>>;
|
|
1208
|
-
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined>>;
|
|
1209
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
1210
|
-
isReadonly: import('vue').Ref<boolean>;
|
|
1211
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", {
|
|
795
|
+
}>, {
|
|
1212
796
|
readonly: boolean;
|
|
1213
797
|
template: FormTemplate<Schema>;
|
|
1214
798
|
modelValue: Record<string, any>;
|
|
1215
|
-
continuousValidation: boolean;
|
|
1216
799
|
tag: string;
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
1224
|
-
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
1225
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema>>>>;
|
|
1226
|
-
status: import('vue').Ref<import('vue').DeepReadonly<`${import('./enums').FormStatus}` | undefined>>;
|
|
1227
|
-
invalid: import('vue').Ref<import('vue').DeepReadonly<boolean>>;
|
|
1228
|
-
readonly: import('vue').Ref<boolean>;
|
|
1229
|
-
}) => any;
|
|
1230
|
-
};
|
|
1231
|
-
});
|
|
1232
|
-
VvFormWrapper: {
|
|
1233
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
1234
|
-
name: {
|
|
1235
|
-
type: StringConstructor;
|
|
1236
|
-
required: true;
|
|
1237
|
-
};
|
|
1238
|
-
tag: {
|
|
1239
|
-
type: StringConstructor;
|
|
1240
|
-
default: undefined;
|
|
1241
|
-
};
|
|
1242
|
-
}>> & {
|
|
1243
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1244
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
1245
|
-
}, {
|
|
1246
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema>> | undefined> | undefined;
|
|
1247
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
1248
|
-
submit: (() => Promise<boolean>) | undefined;
|
|
1249
|
-
validate: (() => Promise<boolean>) | undefined;
|
|
1250
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
1251
|
-
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
1252
|
-
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<Schema, string>>>;
|
|
1253
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
1254
|
-
name: {
|
|
1255
|
-
type: StringConstructor;
|
|
1256
|
-
required: true;
|
|
1257
|
-
};
|
|
1258
|
-
tag: {
|
|
1259
|
-
type: StringConstructor;
|
|
1260
|
-
default: undefined;
|
|
1261
|
-
};
|
|
1262
|
-
}>> & {
|
|
1263
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1264
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
1265
|
-
}, {
|
|
1266
|
-
tag: string;
|
|
1267
|
-
}, true, {}, {}, {
|
|
1268
|
-
P: {};
|
|
1269
|
-
B: {};
|
|
1270
|
-
D: {};
|
|
1271
|
-
C: {};
|
|
1272
|
-
M: {};
|
|
1273
|
-
Defaults: {};
|
|
1274
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
1275
|
-
name: {
|
|
1276
|
-
type: StringConstructor;
|
|
1277
|
-
required: true;
|
|
1278
|
-
};
|
|
1279
|
-
tag: {
|
|
1280
|
-
type: StringConstructor;
|
|
1281
|
-
default: undefined;
|
|
1282
|
-
};
|
|
1283
|
-
}>> & {
|
|
1284
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1285
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
1286
|
-
}, {
|
|
1287
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema>> | undefined> | undefined;
|
|
1288
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
1289
|
-
submit: (() => Promise<boolean>) | undefined;
|
|
1290
|
-
validate: (() => Promise<boolean>) | undefined;
|
|
800
|
+
continuousValidation: boolean;
|
|
801
|
+
}, import('vue').SlotsType<{
|
|
802
|
+
default: {
|
|
803
|
+
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined, import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>>;
|
|
804
|
+
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema> | undefined>, Partial<import('zod').TypeOf<Schema> | undefined>>;
|
|
805
|
+
ignoreUpdates: import('@vueuse/shared').IgnoredUpdater;
|
|
1291
806
|
invalid: import('vue').ComputedRef<boolean>;
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
__isSuspense?: never;
|
|
1300
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
1301
|
-
name: {
|
|
1302
|
-
type: StringConstructor;
|
|
1303
|
-
required: true;
|
|
1304
|
-
};
|
|
1305
|
-
tag: {
|
|
1306
|
-
type: StringConstructor;
|
|
1307
|
-
default: undefined;
|
|
807
|
+
readonly: import('vue').Ref<boolean, boolean>;
|
|
808
|
+
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>>;
|
|
809
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
810
|
+
submit: () => Promise<boolean>;
|
|
811
|
+
validate: (value?: Partial<import('zod').TypeOf<Schema> | undefined>, fields?: Set<string>) => Promise<boolean>;
|
|
812
|
+
clear: () => void;
|
|
813
|
+
reset: () => void;
|
|
1308
814
|
};
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
1312
|
-
}, {
|
|
1313
|
-
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema>> | undefined> | undefined;
|
|
1314
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
1315
|
-
submit: (() => Promise<boolean>) | undefined;
|
|
1316
|
-
validate: (() => Promise<boolean>) | undefined;
|
|
1317
|
-
invalid: import('vue').ComputedRef<boolean>;
|
|
1318
|
-
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
1319
|
-
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<Schema, string>>>;
|
|
1320
|
-
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", {
|
|
1321
|
-
tag: string;
|
|
1322
|
-
}, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
1323
|
-
$slots: {
|
|
1324
|
-
default: (_: {
|
|
1325
|
-
invalid: boolean;
|
|
1326
|
-
formData: unknown extends Partial<import('zod').TypeOf<Schema>> | undefined ? undefined : Partial<import('zod').TypeOf<Schema>> | undefined;
|
|
1327
|
-
submit: () => Promise<boolean>;
|
|
1328
|
-
validate: () => Promise<boolean>;
|
|
1329
|
-
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema>>>>;
|
|
1330
|
-
fieldsErrors: Map<string, Record<string, {
|
|
1331
|
-
_errors: string[];
|
|
1332
|
-
}>>;
|
|
1333
|
-
}) => any;
|
|
1334
|
-
};
|
|
1335
|
-
});
|
|
1336
|
-
VvFormField: import('vue').DefineComponent<{
|
|
815
|
+
}>, {}, {}, "invalid" | "valid" | "reset" | "status" | "clear" | "errors" | "submit" | "validate" | "readonly" | "template" | "tag", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
816
|
+
VvFormField: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1337
817
|
type: {
|
|
1338
818
|
type: import('vue').PropType<`${import('./enums').FormFieldType}`>;
|
|
1339
819
|
validator: (value: import('./enums').FormFieldType) => boolean;
|
|
@@ -1367,7 +847,7 @@ export declare function formFactory<Schema extends FormSchema>(schema: Schema, o
|
|
|
1367
847
|
type: BooleanConstructor;
|
|
1368
848
|
default: undefined;
|
|
1369
849
|
};
|
|
1370
|
-
}
|
|
850
|
+
}>, {
|
|
1371
851
|
component: import('vue').ComputedRef<{
|
|
1372
852
|
new (...args: any[]): any;
|
|
1373
853
|
__isFragment?: never;
|
|
@@ -1378,7 +858,7 @@ export declare function formFactory<Schema extends FormSchema>(schema: Schema, o
|
|
|
1378
858
|
name: {} | ([{
|
|
1379
859
|
type: import('vue').PropType<Path<import('zod').TypeOf<Schema>>>;
|
|
1380
860
|
required: true;
|
|
1381
|
-
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? import('@vue/shared').IfAny<V, V, D> : V : {
|
|
861
|
+
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? import('@vue/shared').IfAny<V, V, D> : V : V : {
|
|
1382
862
|
type: import('vue').PropType<Path<import('zod').TypeOf<Schema>>>;
|
|
1383
863
|
required: true;
|
|
1384
864
|
});
|
|
@@ -1387,11 +867,11 @@ export declare function formFactory<Schema extends FormSchema>(schema: Schema, o
|
|
|
1387
867
|
type: import('./enums').FormFieldType | undefined;
|
|
1388
868
|
invalidLabel: any;
|
|
1389
869
|
modelValue: any;
|
|
1390
|
-
readonly:
|
|
870
|
+
readonly: boolean;
|
|
1391
871
|
'onUpdate:modelValue': (value: unknown) => void;
|
|
1392
872
|
}>;
|
|
1393
873
|
invalid: import('vue').ComputedRef<boolean>;
|
|
1394
|
-
},
|
|
874
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:formData" | "update:modelValue")[], "invalid" | "valid" | "update:formData" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
1395
875
|
type: {
|
|
1396
876
|
type: import('vue').PropType<`${import('./enums').FormFieldType}`>;
|
|
1397
877
|
validator: (value: import('./enums').FormFieldType) => boolean;
|
|
@@ -1425,17 +905,17 @@ export declare function formFactory<Schema extends FormSchema>(schema: Schema, o
|
|
|
1425
905
|
type: BooleanConstructor;
|
|
1426
906
|
default: undefined;
|
|
1427
907
|
};
|
|
1428
|
-
}>> & {
|
|
908
|
+
}>> & Readonly<{
|
|
1429
909
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1430
910
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
1431
911
|
"onUpdate:formData"?: ((...args: any[]) => any) | undefined;
|
|
1432
912
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1433
|
-
}
|
|
913
|
+
}>, {
|
|
1434
914
|
type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
|
|
1435
915
|
props: [{
|
|
1436
916
|
type: import('vue').PropType<Partial<import('zod').TypeOf<Schema> | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<import('zod').TypeOf<Schema>> | undefined) | undefined>>;
|
|
1437
917
|
default: () => {};
|
|
1438
|
-
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? import('@vue/shared').IfAny<V, V, D> : V : {
|
|
918
|
+
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? import('@vue/shared').IfAny<V, V, D> : V : V : {
|
|
1439
919
|
type: import('vue').PropType<Partial<import('zod').TypeOf<Schema> | ((formData?: import('vue').Ref<ObjectConstructor>) => Partial<import('zod').TypeOf<Schema>> | undefined) | undefined>>;
|
|
1440
920
|
default: () => {};
|
|
1441
921
|
};
|
|
@@ -1444,59 +924,21 @@ export declare function formFactory<Schema extends FormSchema>(schema: Schema, o
|
|
|
1444
924
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
1445
925
|
lazyLoad: boolean;
|
|
1446
926
|
readonly: boolean;
|
|
1447
|
-
}, {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
}>[] | undefined)[]) | undefined, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
1463
|
-
schema: {
|
|
1464
|
-
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
1465
|
-
required: true;
|
|
1466
|
-
};
|
|
1467
|
-
scope: {
|
|
1468
|
-
type: import('vue').PropType<Record<string, unknown>>;
|
|
1469
|
-
default: () => {};
|
|
1470
|
-
};
|
|
1471
|
-
}>>, {
|
|
1472
|
-
scope: Record<string, unknown>;
|
|
1473
|
-
}, true, {}, {}, {
|
|
1474
|
-
P: {};
|
|
1475
|
-
B: {};
|
|
1476
|
-
D: {};
|
|
1477
|
-
C: {};
|
|
1478
|
-
M: {};
|
|
1479
|
-
Defaults: {};
|
|
1480
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
1481
|
-
schema: {
|
|
1482
|
-
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
1483
|
-
required: true;
|
|
1484
|
-
};
|
|
1485
|
-
scope: {
|
|
1486
|
-
type: import('vue').PropType<Record<string, unknown>>;
|
|
1487
|
-
default: () => {};
|
|
1488
|
-
};
|
|
1489
|
-
}>>, {} | (() => (import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
1490
|
-
[key: string]: any;
|
|
1491
|
-
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
1492
|
-
[key: string]: any;
|
|
1493
|
-
}>[] | undefined)[]), {}, {}, {}, {
|
|
1494
|
-
scope: Record<string, unknown>;
|
|
1495
|
-
}>;
|
|
1496
|
-
__isFragment?: never;
|
|
1497
|
-
__isTeleport?: never;
|
|
1498
|
-
__isSuspense?: never;
|
|
1499
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
927
|
+
}, import('vue').SlotsType<{
|
|
928
|
+
default: {
|
|
929
|
+
errors: import('zod').inferFormattedError<Schema, string>;
|
|
930
|
+
formData?: Partial<import('zod').TypeOf<Schema>> | undefined;
|
|
931
|
+
formErrors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
932
|
+
invalid: boolean;
|
|
933
|
+
invalidLabel: string;
|
|
934
|
+
modelValue: unknown;
|
|
935
|
+
onUpdate: (value: unknown) => void;
|
|
936
|
+
readonly: boolean;
|
|
937
|
+
submit?: InjectedFormData<Schema_1>["submit"];
|
|
938
|
+
validate?: ((formData?: Partial<import('zod').TypeOf<Schema>> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
939
|
+
};
|
|
940
|
+
}>, {}, {}, "invalid" | "type" | "component" | "errors" | "hasProps" | "invalidLabel" | "is", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
941
|
+
VvFormTemplate: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
1500
942
|
schema: {
|
|
1501
943
|
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
1502
944
|
required: true;
|
|
@@ -1505,34 +947,79 @@ export declare function formFactory<Schema extends FormSchema>(schema: Schema, o
|
|
|
1505
947
|
type: import('vue').PropType<Record<string, unknown>>;
|
|
1506
948
|
default: () => {};
|
|
1507
949
|
};
|
|
1508
|
-
}
|
|
950
|
+
}>, (() => (import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
1509
951
|
[key: string]: any;
|
|
1510
952
|
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
1511
953
|
[key: string]: any;
|
|
1512
|
-
}>[] | undefined)[]) | undefined,
|
|
954
|
+
}>[] | undefined)[]) | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
955
|
+
schema: {
|
|
956
|
+
type: import('vue').PropType<FormTemplate<Schema>>;
|
|
957
|
+
required: true;
|
|
958
|
+
};
|
|
959
|
+
scope: {
|
|
960
|
+
type: import('vue').PropType<Record<string, unknown>>;
|
|
961
|
+
default: () => {};
|
|
962
|
+
};
|
|
963
|
+
}>> & Readonly<{}>, {
|
|
1513
964
|
scope: Record<string, unknown>;
|
|
1514
|
-
},
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
};
|
|
1525
|
-
})
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
965
|
+
}, import('vue').SlotsType<{
|
|
966
|
+
default: {
|
|
967
|
+
errors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
968
|
+
formData?: Partial<import('zod').TypeOf<Schema>> | undefined;
|
|
969
|
+
invalid: boolean;
|
|
970
|
+
status?: import('./enums').FormStatus;
|
|
971
|
+
submit?: InjectedFormData<Schema_2>["submit"];
|
|
972
|
+
validate?: ((formData?: Partial<import('zod').TypeOf<Schema>> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
973
|
+
clear?: InjectedFormData<Schema_2>["clear"];
|
|
974
|
+
reset?: InjectedFormData<Schema_2>["reset"];
|
|
975
|
+
};
|
|
976
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
977
|
+
VvFormWrapper: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
978
|
+
name: {
|
|
979
|
+
type: StringConstructor;
|
|
980
|
+
required: true;
|
|
981
|
+
};
|
|
982
|
+
tag: {
|
|
983
|
+
type: StringConstructor;
|
|
984
|
+
default: undefined;
|
|
985
|
+
};
|
|
986
|
+
}>, {
|
|
987
|
+
clear: (() => void) | undefined;
|
|
988
|
+
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined, import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
989
|
+
fields: import('vue').Ref<Set<string> & Omit<Set<string>, keyof Set<any>>, Set<string> | (Set<string> & Omit<Set<string>, keyof Set<any>>)>;
|
|
990
|
+
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<Schema, string>>, Map<string, import('zod').inferFormattedError<Schema, string>>>;
|
|
991
|
+
formData: import('vue').Ref<Partial<import('zod').TypeOf<Schema>> | undefined, Partial<import('zod').TypeOf<Schema>> | undefined> | undefined;
|
|
992
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
993
|
+
reset: (() => void) | undefined;
|
|
994
|
+
submit: (() => Promise<boolean>) | undefined;
|
|
995
|
+
validate: ((formData?: Partial<import('zod').TypeOf<Schema>> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
996
|
+
validateWrapper: () => Promise<boolean>;
|
|
997
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
998
|
+
name: {
|
|
999
|
+
type: StringConstructor;
|
|
1000
|
+
required: true;
|
|
1001
|
+
};
|
|
1002
|
+
tag: {
|
|
1003
|
+
type: StringConstructor;
|
|
1004
|
+
default: undefined;
|
|
1005
|
+
};
|
|
1006
|
+
}>> & Readonly<{
|
|
1007
|
+
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1008
|
+
onValid?: ((...args: any[]) => any) | undefined;
|
|
1009
|
+
}>, {
|
|
1010
|
+
tag: string;
|
|
1011
|
+
}, import('vue').SlotsType<{
|
|
1012
|
+
default: {
|
|
1013
|
+
errors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
1014
|
+
formData?: Partial<import('zod').TypeOf<Schema>> | undefined;
|
|
1015
|
+
formErrors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
1016
|
+
invalid: boolean;
|
|
1017
|
+
submit?: InjectedFormData<Schema_3>["submit"];
|
|
1018
|
+
validate?: ((formData?: Partial<import('zod').TypeOf<Schema>> | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
1019
|
+
validateWrapper?: (() => Promise<boolean>) | undefined;
|
|
1020
|
+
fieldsErrors: Map<string, import('zod').inferFormattedError<Schema, string>>;
|
|
1021
|
+
clear?: InjectedFormData<Schema_3>["clear"];
|
|
1022
|
+
reset?: InjectedFormData<Schema_3>["reset"];
|
|
1023
|
+
};
|
|
1024
|
+
}>, {}, {}, "invalid" | "reset" | "clear" | "errors" | "submit" | "validate" | "formData" | "tag" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
1538
1025
|
};
|