@volverjs/form-vue 1.0.0-beta.33 → 1.0.0-beta.35
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/LICENSE +1 -1
- package/dist/VvForm.d.ts +3 -3
- package/dist/VvFormField.d.ts +1 -1
- package/dist/VvFormWrapper.d.ts +12 -1
- package/dist/index.d.ts +30 -8
- package/dist/index.es.js +282 -274
- package/dist/index.umd.js +1 -1
- package/dist/types.d.ts +3 -2
- package/package.json +16 -16
- package/src/VvForm.ts +10 -13
- package/src/VvFormField.ts +20 -23
- package/src/VvFormFieldsGroup.ts +9 -14
- package/src/VvFormTemplate.ts +7 -12
- package/src/VvFormWrapper.ts +24 -15
- package/src/index.ts +3 -3
- package/src/types.ts +3 -2
- package/src/utils.ts +2 -3
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2022-present 8 wave S.r.l. and contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/VvForm.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function defineForm<Schema extends FormSchema, Type, FormTemplate
|
|
|
12
12
|
reset: () => void;
|
|
13
13
|
status: import('vue').Ref<FormStatus | undefined, FormStatus | undefined>;
|
|
14
14
|
wrappers: Map<string, InjectedFormWrapperData<Schema>>;
|
|
15
|
-
stopUpdatesWatch: import('
|
|
15
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
16
16
|
submit: () => Promise<boolean>;
|
|
17
17
|
validate: (value?: (undefined extends Type ? Partial<z.TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
18
18
|
VvForm: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
@@ -45,7 +45,7 @@ export declare function defineForm<Schema extends FormSchema, Type, FormTemplate
|
|
|
45
45
|
isReadonly: import('vue').Ref<boolean, boolean>;
|
|
46
46
|
reset: () => void;
|
|
47
47
|
status: Readonly<import('vue').Ref<FormStatus | undefined, FormStatus | undefined>>;
|
|
48
|
-
stopUpdatesWatch: import('
|
|
48
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
49
49
|
submit: () => Promise<boolean>;
|
|
50
50
|
validate: (value?: (undefined extends Type ? Partial<z.TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
51
51
|
wrappers: Map<string, InjectedFormWrapperData<Schema>>;
|
|
@@ -94,7 +94,7 @@ export declare function defineForm<Schema extends FormSchema, Type, FormTemplate
|
|
|
94
94
|
clear: () => void;
|
|
95
95
|
ignoreUpdates: import('@vueuse/core').IgnoredUpdater;
|
|
96
96
|
reset: () => void;
|
|
97
|
-
stopUpdatesWatch: import('
|
|
97
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
98
98
|
submit: () => Promise<boolean>;
|
|
99
99
|
validate: (value?: (undefined extends Type ? Partial<z.TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
100
100
|
};
|
package/dist/VvFormField.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, ConcreteComponent, DeepReadonly, InjectionKey, PropType, Ref, SlotsType } from 'vue';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { FormFieldType } from './enums';
|
|
4
3
|
import { FormFieldComponentOptions, FormSchema, InjectedFormData, InjectedFormFieldData, InjectedFormWrapperData, Path } from './types';
|
|
4
|
+
import { FormFieldType } from './enums';
|
|
5
5
|
export declare function defineFormField<Schema extends FormSchema, Type = undefined>(formProvideKey: InjectionKey<InjectedFormData<Schema, Type>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>, formFieldInjectionKey: InjectionKey<InjectedFormFieldData<Schema>>, options?: FormFieldComponentOptions): import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
6
|
type: {
|
|
7
7
|
type: PropType<`${FormFieldType}`>;
|
package/dist/VvFormWrapper.d.ts
CHANGED
|
@@ -10,12 +10,17 @@ export declare function defineFormWrapper<Schema extends FormSchema, Type = unde
|
|
|
10
10
|
type: StringConstructor;
|
|
11
11
|
default: undefined;
|
|
12
12
|
};
|
|
13
|
+
readonly: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
13
17
|
}>, {
|
|
14
18
|
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined, DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
15
19
|
fields: Ref<Map<string, string>, Map<string, string>>;
|
|
16
20
|
fieldsErrors: Ref<Map<string, z.inferFormattedError<Schema, string>>, Map<string, z.inferFormattedError<Schema, string>>>;
|
|
17
21
|
formData: Ref<(undefined extends Type ? Partial<z.TypeOf<Schema>> : Type) | undefined, (undefined extends Type ? Partial<z.TypeOf<Schema>> : Type) | undefined> | undefined;
|
|
18
22
|
invalid: import('vue').ComputedRef<boolean>;
|
|
23
|
+
readonly: import('vue').ComputedRef<boolean>;
|
|
19
24
|
clear: (() => void) | undefined;
|
|
20
25
|
reset: (() => void) | undefined;
|
|
21
26
|
submit: (() => Promise<boolean>) | undefined;
|
|
@@ -30,10 +35,15 @@ export declare function defineFormWrapper<Schema extends FormSchema, Type = unde
|
|
|
30
35
|
type: StringConstructor;
|
|
31
36
|
default: undefined;
|
|
32
37
|
};
|
|
38
|
+
readonly: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
33
42
|
}>> & Readonly<{
|
|
34
43
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
35
44
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
36
45
|
}>, {
|
|
46
|
+
readonly: boolean;
|
|
37
47
|
tag: string;
|
|
38
48
|
}, SlotsType<{
|
|
39
49
|
default: {
|
|
@@ -42,10 +52,11 @@ export declare function defineFormWrapper<Schema extends FormSchema, Type = unde
|
|
|
42
52
|
formData?: undefined extends Type ? Partial<z.infer<Schema>> : Type;
|
|
43
53
|
formErrors?: DeepReadonly<z.inferFormattedError<Schema>>;
|
|
44
54
|
invalid: boolean;
|
|
55
|
+
readonly: boolean;
|
|
45
56
|
clear?: InjectedFormData<Schema, Type>["clear"];
|
|
46
57
|
reset?: InjectedFormData<Schema, Type>["reset"];
|
|
47
58
|
submit?: InjectedFormData<Schema, Type>["submit"];
|
|
48
59
|
validate?: InjectedFormData<Schema, Type>["validate"];
|
|
49
60
|
validateWrapper?: () => Promise<boolean>;
|
|
50
61
|
};
|
|
51
|
-
}>, {}, {}, "invalid" | "reset" | "clear" | "submit" | "errors" | "tag" | "validate" | "formData" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
62
|
+
}>, {}, {}, "invalid" | "reset" | "readonly" | "clear" | "submit" | "errors" | "tag" | "validate" | "formData" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ declare function _formType<Schema extends FormSchema, Type>(schema: Schema, opti
|
|
|
16
16
|
readonly: import('vue').Ref<boolean, boolean>;
|
|
17
17
|
reset: () => void;
|
|
18
18
|
status: import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>;
|
|
19
|
-
stopUpdatesWatch: import('
|
|
19
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
20
20
|
submit: () => Promise<boolean>;
|
|
21
21
|
validate: (value?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
22
22
|
wrappers: Map<string, InjectedFormWrapperData<Schema>>;
|
|
@@ -50,7 +50,7 @@ declare function _formType<Schema extends FormSchema, Type>(schema: Schema, opti
|
|
|
50
50
|
isReadonly: import('vue').Ref<boolean, boolean>;
|
|
51
51
|
reset: () => void;
|
|
52
52
|
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>>;
|
|
53
|
-
stopUpdatesWatch: import('
|
|
53
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
54
54
|
submit: () => Promise<boolean>;
|
|
55
55
|
validate: (value?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
56
56
|
wrappers: Map<string, InjectedFormWrapperData<Schema>>;
|
|
@@ -99,7 +99,7 @@ declare function _formType<Schema extends FormSchema, Type>(schema: Schema, opti
|
|
|
99
99
|
clear: () => void;
|
|
100
100
|
ignoreUpdates: import('@vueuse/core').IgnoredUpdater;
|
|
101
101
|
reset: () => void;
|
|
102
|
-
stopUpdatesWatch: import('
|
|
102
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
103
103
|
submit: () => Promise<boolean>;
|
|
104
104
|
validate: (value?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
105
105
|
};
|
|
@@ -381,12 +381,17 @@ declare function _formType<Schema extends FormSchema, Type>(schema: Schema, opti
|
|
|
381
381
|
type: StringConstructor;
|
|
382
382
|
default: undefined;
|
|
383
383
|
};
|
|
384
|
+
readonly: {
|
|
385
|
+
type: BooleanConstructor;
|
|
386
|
+
default: boolean;
|
|
387
|
+
};
|
|
384
388
|
}>, {
|
|
385
389
|
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined, import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
386
390
|
fields: import('vue').Ref<Map<string, string>, Map<string, string>>;
|
|
387
391
|
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<Schema, string>>, Map<string, import('zod').inferFormattedError<Schema, string>>>;
|
|
388
392
|
formData: import('vue').Ref<(undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined> | undefined;
|
|
389
393
|
invalid: import('vue').ComputedRef<boolean>;
|
|
394
|
+
readonly: import('vue').ComputedRef<boolean>;
|
|
390
395
|
clear: (() => void) | undefined;
|
|
391
396
|
reset: (() => void) | undefined;
|
|
392
397
|
submit: (() => Promise<boolean>) | undefined;
|
|
@@ -401,10 +406,15 @@ declare function _formType<Schema extends FormSchema, Type>(schema: Schema, opti
|
|
|
401
406
|
type: StringConstructor;
|
|
402
407
|
default: undefined;
|
|
403
408
|
};
|
|
409
|
+
readonly: {
|
|
410
|
+
type: BooleanConstructor;
|
|
411
|
+
default: boolean;
|
|
412
|
+
};
|
|
404
413
|
}>> & Readonly<{
|
|
405
414
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
406
415
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
407
416
|
}>, {
|
|
417
|
+
readonly: boolean;
|
|
408
418
|
tag: string;
|
|
409
419
|
}, import('vue').SlotsType<{
|
|
410
420
|
default: {
|
|
@@ -413,13 +423,14 @@ declare function _formType<Schema extends FormSchema, Type>(schema: Schema, opti
|
|
|
413
423
|
formData?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined;
|
|
414
424
|
formErrors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
415
425
|
invalid: boolean;
|
|
426
|
+
readonly: boolean;
|
|
416
427
|
clear?: InjectedFormData<Schema_4, Type_4>["clear"];
|
|
417
428
|
reset?: InjectedFormData<Schema_4, Type_4>["reset"];
|
|
418
429
|
submit?: InjectedFormData<Schema_4, Type_4>["submit"];
|
|
419
430
|
validate?: ((formData?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
420
431
|
validateWrapper?: (() => Promise<boolean>) | undefined;
|
|
421
432
|
};
|
|
422
|
-
}>, {}, {}, "invalid" | "reset" | "clear" | "submit" | "errors" | "tag" | "validate" | "formData" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
433
|
+
}>, {}, {}, "invalid" | "reset" | "readonly" | "clear" | "submit" | "errors" | "tag" | "validate" | "formData" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
423
434
|
};
|
|
424
435
|
export declare const pluginInjectionKey: InjectionKey<FormPluginOptions>;
|
|
425
436
|
export declare function createForm(options: FormPluginOptions): Plugin & Partial<ReturnType<typeof useForm>>;
|
|
@@ -447,7 +458,7 @@ export declare function formType<Schema extends FormSchema, Type>(schema: Schema
|
|
|
447
458
|
readonly: import('vue').Ref<boolean, boolean>;
|
|
448
459
|
reset: () => void;
|
|
449
460
|
status: import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>;
|
|
450
|
-
stopUpdatesWatch: import('
|
|
461
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
451
462
|
submit: () => Promise<boolean>;
|
|
452
463
|
validate: (value?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
453
464
|
wrappers: Map<string, InjectedFormWrapperData<Schema>>;
|
|
@@ -481,7 +492,7 @@ export declare function formType<Schema extends FormSchema, Type>(schema: Schema
|
|
|
481
492
|
isReadonly: import('vue').Ref<boolean, boolean>;
|
|
482
493
|
reset: () => void;
|
|
483
494
|
status: Readonly<import('vue').Ref<import('./enums').FormStatus | undefined, import('./enums').FormStatus | undefined>>;
|
|
484
|
-
stopUpdatesWatch: import('
|
|
495
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
485
496
|
submit: () => Promise<boolean>;
|
|
486
497
|
validate: (value?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
487
498
|
wrappers: Map<string, InjectedFormWrapperData<Schema>>;
|
|
@@ -530,7 +541,7 @@ export declare function formType<Schema extends FormSchema, Type>(schema: Schema
|
|
|
530
541
|
clear: () => void;
|
|
531
542
|
ignoreUpdates: import('@vueuse/core').IgnoredUpdater;
|
|
532
543
|
reset: () => void;
|
|
533
|
-
stopUpdatesWatch: import('
|
|
544
|
+
stopUpdatesWatch: import('vue').WatchStopHandle;
|
|
534
545
|
submit: () => Promise<boolean>;
|
|
535
546
|
validate: (value?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>;
|
|
536
547
|
};
|
|
@@ -812,12 +823,17 @@ export declare function formType<Schema extends FormSchema, Type>(schema: Schema
|
|
|
812
823
|
type: StringConstructor;
|
|
813
824
|
default: undefined;
|
|
814
825
|
};
|
|
826
|
+
readonly: {
|
|
827
|
+
type: BooleanConstructor;
|
|
828
|
+
default: boolean;
|
|
829
|
+
};
|
|
815
830
|
}>, {
|
|
816
831
|
errors: Readonly<import('vue').Ref<import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined, import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
817
832
|
fields: import('vue').Ref<Map<string, string>, Map<string, string>>;
|
|
818
833
|
fieldsErrors: import('vue').Ref<Map<string, import('zod').inferFormattedError<Schema, string>>, Map<string, import('zod').inferFormattedError<Schema, string>>>;
|
|
819
834
|
formData: import('vue').Ref<(undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined> | undefined;
|
|
820
835
|
invalid: import('vue').ComputedRef<boolean>;
|
|
836
|
+
readonly: import('vue').ComputedRef<boolean>;
|
|
821
837
|
clear: (() => void) | undefined;
|
|
822
838
|
reset: (() => void) | undefined;
|
|
823
839
|
submit: (() => Promise<boolean>) | undefined;
|
|
@@ -832,10 +848,15 @@ export declare function formType<Schema extends FormSchema, Type>(schema: Schema
|
|
|
832
848
|
type: StringConstructor;
|
|
833
849
|
default: undefined;
|
|
834
850
|
};
|
|
851
|
+
readonly: {
|
|
852
|
+
type: BooleanConstructor;
|
|
853
|
+
default: boolean;
|
|
854
|
+
};
|
|
835
855
|
}>> & Readonly<{
|
|
836
856
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
837
857
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
838
858
|
}>, {
|
|
859
|
+
readonly: boolean;
|
|
839
860
|
tag: string;
|
|
840
861
|
}, import('vue').SlotsType<{
|
|
841
862
|
default: {
|
|
@@ -844,11 +865,12 @@ export declare function formType<Schema extends FormSchema, Type>(schema: Schema
|
|
|
844
865
|
formData?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined;
|
|
845
866
|
formErrors?: import('vue').DeepReadonly<import('zod').inferFormattedError<Schema, string>> | undefined;
|
|
846
867
|
invalid: boolean;
|
|
868
|
+
readonly: boolean;
|
|
847
869
|
clear?: InjectedFormData<Schema_4, Type_4>["clear"];
|
|
848
870
|
reset?: InjectedFormData<Schema_4, Type_4>["reset"];
|
|
849
871
|
submit?: InjectedFormData<Schema_4, Type_4>["submit"];
|
|
850
872
|
validate?: ((formData?: (undefined extends Type ? Partial<import('zod').TypeOf<Schema>> : Type) | undefined, fields?: Set<string>) => Promise<boolean>) | undefined;
|
|
851
873
|
validateWrapper?: (() => Promise<boolean>) | undefined;
|
|
852
874
|
};
|
|
853
|
-
}>, {}, {}, "invalid" | "reset" | "clear" | "submit" | "errors" | "tag" | "validate" | "formData" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
875
|
+
}>, {}, {}, "invalid" | "reset" | "readonly" | "clear" | "submit" | "errors" | "tag" | "validate" | "formData" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;
|
|
854
876
|
};
|