vee-validate 4.4.10 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +292 -731
- package/dist/vee-validate.d.ts +145 -85
- package/dist/vee-validate.esm.js +1032 -350
- package/dist/vee-validate.js +638 -348
- package/dist/vee-validate.min.js +2 -2
- package/package.json +5 -2
package/dist/vee-validate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { Ref, DeepReadonly, ComputedRef, PropType, InjectionKey } from 'vue';
|
|
3
3
|
import { AnySchema, AnyObjectSchema, SchemaOf, BaseSchema } from 'yup';
|
|
4
4
|
|
|
5
5
|
interface FieldValidationMetaInfo {
|
|
@@ -15,6 +15,7 @@ declare type ValidationRuleFunction<TValue = unknown, TParams = unknown[] | Reco
|
|
|
15
15
|
declare type SimpleValidationRuleFunction<TValue = unknown, TParams = unknown[] | Record<string, unknown>> = (value: TValue, params: TParams) => boolean | string | Promise<boolean | string>;
|
|
16
16
|
declare type ValidationMessageGenerator = (ctx: FieldValidationMetaInfo) => string;
|
|
17
17
|
|
|
18
|
+
declare type GenericFormValues = Record<string, unknown>;
|
|
18
19
|
interface ValidationResult {
|
|
19
20
|
errors: string[];
|
|
20
21
|
valid: boolean;
|
|
@@ -29,37 +30,71 @@ interface FieldMeta<TValue> {
|
|
|
29
30
|
pending: boolean;
|
|
30
31
|
initialValue?: TValue;
|
|
31
32
|
}
|
|
33
|
+
interface FormMeta<TValues extends Record<string, any>> {
|
|
34
|
+
touched: boolean;
|
|
35
|
+
dirty: boolean;
|
|
36
|
+
valid: boolean;
|
|
37
|
+
validated: boolean;
|
|
38
|
+
pending: boolean;
|
|
39
|
+
initialValues?: TValues;
|
|
40
|
+
}
|
|
32
41
|
interface FieldState<TValue = unknown> {
|
|
33
42
|
value: TValue;
|
|
34
43
|
touched: boolean;
|
|
35
44
|
errors: string[];
|
|
36
45
|
}
|
|
37
|
-
|
|
46
|
+
/**
|
|
47
|
+
* validated-only: only mutate the previously validated fields
|
|
48
|
+
* silent: do not mutate any field
|
|
49
|
+
* force: validate all fields and mutate their state
|
|
50
|
+
*/
|
|
51
|
+
declare type SchemaValidationMode = 'validated-only' | 'silent' | 'force';
|
|
52
|
+
interface ValidationOptions$1 {
|
|
53
|
+
mode: SchemaValidationMode;
|
|
54
|
+
}
|
|
55
|
+
interface FieldEntry<TValue = unknown> {
|
|
56
|
+
value: TValue;
|
|
57
|
+
key: string | number;
|
|
58
|
+
isFirst: boolean;
|
|
59
|
+
isLast: boolean;
|
|
60
|
+
}
|
|
61
|
+
interface FieldArrayContext<TValue = unknown> {
|
|
62
|
+
fields: DeepReadonly<Ref<FieldEntry<TValue>[]>>;
|
|
63
|
+
remove(idx: number): void;
|
|
64
|
+
replace(newArray: TValue[]): void;
|
|
65
|
+
update(idx: number, value: TValue): void;
|
|
66
|
+
push(value: TValue): void;
|
|
67
|
+
swap(indexA: number, indexB: number): void;
|
|
68
|
+
insert(idx: number, value: TValue): void;
|
|
69
|
+
prepend(value: TValue): void;
|
|
70
|
+
}
|
|
71
|
+
interface PrivateFieldArrayContext {
|
|
72
|
+
reset(): void;
|
|
73
|
+
}
|
|
38
74
|
interface PrivateFieldContext<TValue = unknown> {
|
|
39
|
-
|
|
40
|
-
idx: number;
|
|
75
|
+
id: number;
|
|
41
76
|
name: MaybeRef<string>;
|
|
42
|
-
value:
|
|
77
|
+
value: Ref<TValue>;
|
|
43
78
|
meta: FieldMeta<TValue>;
|
|
44
79
|
errors: Ref<string[]>;
|
|
45
|
-
errorMessage:
|
|
80
|
+
errorMessage: Ref<string | undefined>;
|
|
46
81
|
label?: MaybeRef<string | undefined>;
|
|
47
82
|
type?: string;
|
|
48
83
|
bails?: boolean;
|
|
49
84
|
checkedValue?: MaybeRef<TValue>;
|
|
50
85
|
uncheckedValue?: MaybeRef<TValue>;
|
|
51
|
-
checked?:
|
|
86
|
+
checked?: Ref<boolean>;
|
|
52
87
|
resetField(state?: FieldState<TValue>): void;
|
|
53
88
|
handleReset(): void;
|
|
54
|
-
validate(): Promise<ValidationResult>;
|
|
89
|
+
validate(opts?: Partial<ValidationOptions$1>): Promise<ValidationResult>;
|
|
55
90
|
handleChange(e: Event | unknown, shouldValidate?: boolean): void;
|
|
56
91
|
handleBlur(e?: Event): void;
|
|
57
|
-
|
|
58
|
-
setValidationState(state: ValidationResult): void;
|
|
92
|
+
setState(state: Partial<FieldState<TValue>>): void;
|
|
59
93
|
setTouched(isTouched: boolean): void;
|
|
60
94
|
setErrors(message: string | string[]): void;
|
|
95
|
+
setValue(value: TValue): void;
|
|
61
96
|
}
|
|
62
|
-
declare type FieldContext<TValue = unknown> = Omit<PrivateFieldContext<TValue>, '
|
|
97
|
+
declare type FieldContext<TValue = unknown> = Omit<PrivateFieldContext<TValue>, 'id' | 'instances'>;
|
|
63
98
|
declare type GenericValidateFunction = (value: unknown, ctx: FieldValidationMetaInfo) => boolean | string | Promise<boolean | string>;
|
|
64
99
|
interface FormState<TValues> {
|
|
65
100
|
values: TValues;
|
|
@@ -67,12 +102,12 @@ interface FormState<TValues> {
|
|
|
67
102
|
touched: Partial<Record<keyof TValues, boolean>>;
|
|
68
103
|
submitCount: number;
|
|
69
104
|
}
|
|
70
|
-
declare type FormErrors<TValues extends
|
|
71
|
-
declare type FormErrorBag<TValues extends
|
|
105
|
+
declare type FormErrors<TValues extends GenericFormValues> = Partial<Record<keyof TValues, string | undefined>>;
|
|
106
|
+
declare type FormErrorBag<TValues extends GenericFormValues> = Partial<Record<keyof TValues, string[]>>;
|
|
72
107
|
interface SetFieldValueOptions {
|
|
73
108
|
force: boolean;
|
|
74
109
|
}
|
|
75
|
-
interface FormActions<TValues extends
|
|
110
|
+
interface FormActions<TValues extends GenericFormValues> {
|
|
76
111
|
setFieldValue<T extends keyof TValues>(field: T, value: TValues[T], opts?: Partial<SetFieldValueOptions>): void;
|
|
77
112
|
setFieldError: (field: keyof TValues, message: string | string[] | undefined) => void;
|
|
78
113
|
setErrors: (fields: FormErrors<TValues>) => void;
|
|
@@ -86,43 +121,42 @@ interface FormValidationResult<TValues> {
|
|
|
86
121
|
results: Partial<Record<keyof TValues, ValidationResult>>;
|
|
87
122
|
errors: Partial<Record<keyof TValues, string>>;
|
|
88
123
|
}
|
|
89
|
-
interface SubmissionContext<TValues extends
|
|
124
|
+
interface SubmissionContext<TValues extends GenericFormValues = GenericFormValues> extends FormActions<TValues> {
|
|
90
125
|
evt?: Event;
|
|
91
126
|
}
|
|
92
|
-
declare type SubmissionHandler<TValues extends
|
|
127
|
+
declare type SubmissionHandler<TValues extends GenericFormValues = GenericFormValues, TReturn = unknown> = (values: TValues, ctx: SubmissionContext<TValues>) => TReturn;
|
|
128
|
+
interface InvalidSubmissionContext<TValues extends GenericFormValues = GenericFormValues> {
|
|
129
|
+
values: TValues;
|
|
130
|
+
evt?: Event;
|
|
131
|
+
errors: Partial<Record<keyof TValues, string>>;
|
|
132
|
+
results: Partial<Record<keyof TValues, ValidationResult>>;
|
|
133
|
+
}
|
|
134
|
+
declare type InvalidSubmissionHandler<TValues extends GenericFormValues = GenericFormValues> = (ctx: InvalidSubmissionContext<TValues>) => void;
|
|
93
135
|
declare type RawFormSchema<TValues> = Record<keyof TValues, string | GenericValidateFunction | Record<string, any>>;
|
|
94
|
-
|
|
95
|
-
* validated-only: only mutate the previously validated fields
|
|
96
|
-
* silent: do not mutate any field
|
|
97
|
-
* force: validate all fields and mutate their state
|
|
98
|
-
*/
|
|
99
|
-
declare type SchemaValidationMode = 'validated-only' | 'silent' | 'force';
|
|
136
|
+
declare type FieldPathLookup<TValues extends Record<string, any> = Record<string, any>> = Partial<Record<keyof TValues, PrivateFieldContext | PrivateFieldContext[]>>;
|
|
100
137
|
interface PrivateFormContext<TValues extends Record<string, any> = Record<string, any>> extends FormActions<TValues> {
|
|
101
|
-
|
|
102
|
-
unregister(field: PrivateFieldContext): void;
|
|
138
|
+
formId: number;
|
|
103
139
|
values: TValues;
|
|
104
|
-
|
|
140
|
+
fieldsByPath: Ref<FieldPathLookup>;
|
|
141
|
+
fieldArraysLookup: Record<string, PrivateFieldArrayContext>;
|
|
105
142
|
submitCount: Ref<number>;
|
|
106
143
|
schema?: MaybeRef<RawFormSchema<TValues> | SchemaOf<TValues> | undefined>;
|
|
144
|
+
errorBag: Ref<FormErrorBag<TValues>>;
|
|
145
|
+
errors: ComputedRef<FormErrors<TValues>>;
|
|
146
|
+
meta: ComputedRef<FormMeta<TValues>>;
|
|
147
|
+
isSubmitting: Ref<boolean>;
|
|
107
148
|
validateSchema?: (mode: SchemaValidationMode) => Promise<FormValidationResult<TValues>>;
|
|
108
|
-
validate(): Promise<FormValidationResult<TValues>>;
|
|
149
|
+
validate(opts?: Partial<ValidationOptions$1>): Promise<FormValidationResult<TValues>>;
|
|
109
150
|
validateField(field: keyof TValues): Promise<ValidationResult>;
|
|
110
|
-
errorBag: Ref<FormErrorBag<TValues>>;
|
|
111
151
|
setFieldErrorBag(field: string, messages: string | string[]): void;
|
|
112
152
|
stageInitialValue(path: string, value: unknown): void;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
pending: boolean;
|
|
118
|
-
initialValues: TValues;
|
|
119
|
-
}>;
|
|
120
|
-
isSubmitting: Ref<boolean>;
|
|
121
|
-
handleSubmit(cb: SubmissionHandler<TValues>): (e?: Event) => Promise<void>;
|
|
153
|
+
unsetInitialValue(path: string): void;
|
|
154
|
+
register(field: PrivateFieldContext): void;
|
|
155
|
+
unregister(field: PrivateFieldContext): void;
|
|
156
|
+
handleSubmit<TReturn = unknown>(cb: SubmissionHandler<TValues, TReturn>, onSubmitValidationErrorCb?: InvalidSubmissionHandler<TValues>): (e?: Event) => Promise<TReturn | undefined>;
|
|
122
157
|
setFieldInitialValue(path: string, value: unknown): void;
|
|
123
158
|
}
|
|
124
|
-
interface FormContext<TValues extends Record<string, any> = Record<string, any>> extends Omit<PrivateFormContext<TValues>, 'register' | 'unregister' | '
|
|
125
|
-
errors: ComputedRef<FormErrors<TValues>>;
|
|
159
|
+
interface FormContext<TValues extends Record<string, any> = Record<string, any>> extends Omit<PrivateFormContext<TValues>, 'formId' | 'register' | 'unregister' | 'fieldsByPath' | 'schema' | 'validateSchema' | 'errorBag' | 'setFieldErrorBag' | 'stageInitialValue' | 'setFieldInitialValue' | 'unsetInitialValue' | 'fieldArraysLookup'> {
|
|
126
160
|
handleReset: () => void;
|
|
127
161
|
submitForm: (e?: unknown) => Promise<void>;
|
|
128
162
|
}
|
|
@@ -152,6 +186,24 @@ interface VeeValidateConfig {
|
|
|
152
186
|
}
|
|
153
187
|
declare const configure: (newConf: Partial<VeeValidateConfig>) => void;
|
|
154
188
|
|
|
189
|
+
interface FieldOptions<TValue = unknown> {
|
|
190
|
+
initialValue?: MaybeRef<TValue>;
|
|
191
|
+
validateOnValueUpdate: boolean;
|
|
192
|
+
validateOnMount?: boolean;
|
|
193
|
+
bails?: boolean;
|
|
194
|
+
type?: string;
|
|
195
|
+
valueProp?: MaybeRef<TValue>;
|
|
196
|
+
checkedValue?: MaybeRef<TValue>;
|
|
197
|
+
uncheckedValue?: MaybeRef<TValue>;
|
|
198
|
+
label?: MaybeRef<string | undefined>;
|
|
199
|
+
standalone?: boolean;
|
|
200
|
+
}
|
|
201
|
+
declare type RuleExpression<TValue> = string | Record<string, unknown> | GenericValidateFunction | YupValidator | BaseSchema<TValue> | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Creates a field composite.
|
|
204
|
+
*/
|
|
205
|
+
declare function useField<TValue = unknown>(name: MaybeRef<string>, rules?: MaybeRef<RuleExpression<TValue>>, opts?: Partial<FieldOptions<TValue>>): FieldContext<TValue>;
|
|
206
|
+
|
|
155
207
|
declare const Field: vue.DefineComponent<{
|
|
156
208
|
as: {
|
|
157
209
|
type: (ObjectConstructor | StringConstructor)[];
|
|
@@ -162,7 +214,7 @@ declare const Field: vue.DefineComponent<{
|
|
|
162
214
|
required: true;
|
|
163
215
|
};
|
|
164
216
|
rules: {
|
|
165
|
-
type:
|
|
217
|
+
type: PropType<RuleExpression<unknown>>;
|
|
166
218
|
default: any;
|
|
167
219
|
};
|
|
168
220
|
validateOnMount: {
|
|
@@ -238,37 +290,37 @@ declare const Field: vue.DefineComponent<{
|
|
|
238
290
|
'onUpdate:modelValue'?: unknown;
|
|
239
291
|
standalone?: unknown;
|
|
240
292
|
} & {
|
|
241
|
-
name:
|
|
293
|
+
name: string;
|
|
242
294
|
bails: boolean;
|
|
243
|
-
validateOnMount: boolean;
|
|
244
|
-
standalone: boolean;
|
|
245
295
|
modelValue: any;
|
|
296
|
+
standalone: boolean;
|
|
297
|
+
validateOnMount: boolean;
|
|
246
298
|
modelModifiers: any;
|
|
247
299
|
} & {
|
|
248
|
-
label?:
|
|
300
|
+
label?: string;
|
|
301
|
+
as?: string | Record<string, any>;
|
|
249
302
|
uncheckedValue?: any;
|
|
250
303
|
validateOnInput?: boolean;
|
|
251
304
|
validateOnChange?: boolean;
|
|
252
305
|
validateOnBlur?: boolean;
|
|
253
306
|
validateOnModelUpdate?: boolean;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
307
|
+
rules?: RuleExpression<unknown>;
|
|
308
|
+
"onUpdate:modelValue"?: (e: any) => unknown;
|
|
309
|
+
}>, {
|
|
310
|
+
label: string;
|
|
311
|
+
as: string | Record<string, any>;
|
|
259
312
|
bails: boolean;
|
|
260
313
|
uncheckedValue: any;
|
|
261
314
|
validateOnInput: boolean;
|
|
262
315
|
validateOnChange: boolean;
|
|
263
316
|
validateOnBlur: boolean;
|
|
264
317
|
validateOnModelUpdate: boolean;
|
|
265
|
-
validateOnMount: boolean;
|
|
266
|
-
standalone: boolean;
|
|
267
|
-
as: unknown;
|
|
268
|
-
rules: unknown;
|
|
269
318
|
modelValue: any;
|
|
319
|
+
standalone: boolean;
|
|
320
|
+
validateOnMount: boolean;
|
|
321
|
+
rules: RuleExpression<unknown>;
|
|
270
322
|
modelModifiers: any;
|
|
271
|
-
"onUpdate:modelValue": unknown;
|
|
323
|
+
"onUpdate:modelValue": (e: any) => unknown;
|
|
272
324
|
}>;
|
|
273
325
|
|
|
274
326
|
declare const Form: vue.DefineComponent<{
|
|
@@ -297,7 +349,11 @@ declare const Form: vue.DefineComponent<{
|
|
|
297
349
|
default: boolean;
|
|
298
350
|
};
|
|
299
351
|
onSubmit: {
|
|
300
|
-
type: PropType<SubmissionHandler<
|
|
352
|
+
type: PropType<SubmissionHandler<GenericFormValues, unknown>>;
|
|
353
|
+
default: any;
|
|
354
|
+
};
|
|
355
|
+
onInvalidSubmit: {
|
|
356
|
+
type: PropType<InvalidSubmissionHandler<GenericFormValues>>;
|
|
301
357
|
default: any;
|
|
302
358
|
};
|
|
303
359
|
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
@@ -316,25 +372,45 @@ declare const Form: vue.DefineComponent<{
|
|
|
316
372
|
initialTouched?: unknown;
|
|
317
373
|
validateOnMount?: unknown;
|
|
318
374
|
onSubmit?: unknown;
|
|
375
|
+
onInvalidSubmit?: unknown;
|
|
319
376
|
} & {
|
|
377
|
+
as: string;
|
|
320
378
|
validateOnMount: boolean;
|
|
321
|
-
as: unknown;
|
|
322
379
|
} & {
|
|
323
|
-
onSubmit?: unknown
|
|
380
|
+
onSubmit?: SubmissionHandler<GenericFormValues, unknown>;
|
|
324
381
|
initialValues?: Record<string, any>;
|
|
325
382
|
validationSchema?: Record<string, any>;
|
|
326
383
|
initialErrors?: Record<string, any>;
|
|
327
384
|
initialTouched?: Record<string, any>;
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
as:
|
|
385
|
+
onInvalidSubmit?: InvalidSubmissionHandler<GenericFormValues>;
|
|
386
|
+
}>, {
|
|
387
|
+
onSubmit: SubmissionHandler<GenericFormValues, unknown>;
|
|
388
|
+
as: string;
|
|
332
389
|
initialValues: Record<string, any>;
|
|
390
|
+
validateOnMount: boolean;
|
|
333
391
|
validationSchema: Record<string, any>;
|
|
334
392
|
initialErrors: Record<string, any>;
|
|
335
393
|
initialTouched: Record<string, any>;
|
|
394
|
+
onInvalidSubmit: InvalidSubmissionHandler<GenericFormValues>;
|
|
336
395
|
}>;
|
|
337
396
|
|
|
397
|
+
declare const FieldArray: vue.DefineComponent<{
|
|
398
|
+
name: {
|
|
399
|
+
type: StringConstructor;
|
|
400
|
+
required: true;
|
|
401
|
+
};
|
|
402
|
+
}, () => vue.Slot | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
403
|
+
[key: string]: any;
|
|
404
|
+
}>[] | {
|
|
405
|
+
default: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
406
|
+
[key: string]: any;
|
|
407
|
+
}>[];
|
|
408
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<{
|
|
409
|
+
name?: unknown;
|
|
410
|
+
} & {
|
|
411
|
+
name: string;
|
|
412
|
+
} & {}>, {}>;
|
|
413
|
+
|
|
338
414
|
declare const ErrorMessage: vue.DefineComponent<{
|
|
339
415
|
as: {
|
|
340
416
|
type: StringConstructor;
|
|
@@ -356,31 +432,13 @@ declare const ErrorMessage: vue.DefineComponent<{
|
|
|
356
432
|
as?: unknown;
|
|
357
433
|
name?: unknown;
|
|
358
434
|
} & {
|
|
359
|
-
name:
|
|
435
|
+
name: string;
|
|
360
436
|
} & {
|
|
361
|
-
as?:
|
|
362
|
-
}
|
|
363
|
-
as:
|
|
437
|
+
as?: string;
|
|
438
|
+
}>, {
|
|
439
|
+
as: string;
|
|
364
440
|
}>;
|
|
365
441
|
|
|
366
|
-
interface FieldOptions<TValue = unknown> {
|
|
367
|
-
initialValue?: MaybeRef<TValue>;
|
|
368
|
-
validateOnValueUpdate: boolean;
|
|
369
|
-
validateOnMount?: boolean;
|
|
370
|
-
bails?: boolean;
|
|
371
|
-
type?: string;
|
|
372
|
-
valueProp?: MaybeRef<TValue>;
|
|
373
|
-
checkedValue?: MaybeRef<TValue>;
|
|
374
|
-
uncheckedValue?: MaybeRef<TValue>;
|
|
375
|
-
label?: MaybeRef<string | undefined>;
|
|
376
|
-
standalone?: boolean;
|
|
377
|
-
}
|
|
378
|
-
declare type RuleExpression<TValue> = string | Record<string, unknown> | GenericValidateFunction | YupValidator | BaseSchema<TValue> | undefined;
|
|
379
|
-
/**
|
|
380
|
-
* Creates a field composite.
|
|
381
|
-
*/
|
|
382
|
-
declare function useField<TValue = unknown>(name: MaybeRef<string>, rules?: MaybeRef<RuleExpression<TValue>>, opts?: Partial<FieldOptions<TValue>>): FieldContext<TValue>;
|
|
383
|
-
|
|
384
442
|
interface FormOptions<TValues extends Record<string, any>> {
|
|
385
443
|
validationSchema?: MaybeRef<Record<keyof TValues, GenericValidateFunction | string | Record<string, any>> | SchemaOf<TValues> | undefined>;
|
|
386
444
|
initialValues?: MaybeRef<TValues>;
|
|
@@ -390,6 +448,8 @@ interface FormOptions<TValues extends Record<string, any>> {
|
|
|
390
448
|
}
|
|
391
449
|
declare function useForm<TValues extends Record<string, any> = Record<string, any>>(opts?: FormOptions<TValues>): FormContext<TValues>;
|
|
392
450
|
|
|
451
|
+
declare function useFieldArray<TValue = unknown>(arrayPath: MaybeRef<string>): FieldArrayContext<TValue>;
|
|
452
|
+
|
|
393
453
|
declare function useResetForm<TValues extends Record<string, unknown> = Record<string, unknown>>(): (state?: Partial<FormState<TValues>>) => void;
|
|
394
454
|
|
|
395
455
|
/**
|
|
@@ -455,16 +515,16 @@ declare function useFormValues<TValues extends Record<string, unknown> = Record<
|
|
|
455
515
|
/**
|
|
456
516
|
* Gives access to all form errors
|
|
457
517
|
*/
|
|
458
|
-
declare function useFormErrors<TValues extends Record<string, unknown> = Record<string, unknown>>(): ComputedRef<
|
|
518
|
+
declare function useFormErrors<TValues extends Record<string, unknown> = Record<string, unknown>>(): vue.ComputedRef<Partial<Record<keyof TValues, string>>>;
|
|
459
519
|
|
|
460
520
|
/**
|
|
461
521
|
* Gives access to a single field error
|
|
462
522
|
*/
|
|
463
523
|
declare function useFieldError(path?: MaybeRef<string>): vue.ComputedRef<string>;
|
|
464
524
|
|
|
465
|
-
declare function useSubmitForm<TValues extends Record<string, unknown> = Record<string, unknown>>(cb: SubmissionHandler<TValues>): (e?: Event) => Promise<
|
|
525
|
+
declare function useSubmitForm<TValues extends Record<string, unknown> = Record<string, unknown>>(cb: SubmissionHandler<TValues>): (e?: Event) => Promise<unknown>;
|
|
466
526
|
|
|
467
527
|
declare const FormContextKey: InjectionKey<PrivateFormContext>;
|
|
468
528
|
declare const FieldContextKey: InjectionKey<PrivateFieldContext<unknown>>;
|
|
469
529
|
|
|
470
|
-
export { ErrorMessage, Field, FieldContext, FieldContextKey, Form, FormActions, FormContext, FormContextKey, FormState, FormValidationResult, SubmissionContext, SubmissionHandler, ValidationResult, configure, defineRule, useField, useFieldError, useFieldValue, useForm, useFormErrors, useFormValues, useIsFieldDirty, useIsFieldTouched, useIsFieldValid, useIsFormDirty, useIsFormTouched, useIsFormValid, useIsSubmitting, useResetForm, useSubmitCount, useSubmitForm, useValidateField, useValidateForm, validate };
|
|
530
|
+
export { ErrorMessage, Field, FieldArray, FieldContext, FieldContextKey, Form, FormActions, FormContext, FormContextKey, FormState, FormValidationResult, SubmissionContext, SubmissionHandler, ValidationResult, configure, defineRule, useField, useFieldArray, useFieldError, useFieldValue, useForm, useFormErrors, useFormValues, useIsFieldDirty, useIsFieldTouched, useIsFieldValid, useIsFormDirty, useIsFormTouched, useIsFormValid, useIsSubmitting, useResetForm, useSubmitCount, useSubmitForm, useValidateField, useValidateForm, validate };
|