@volverjs/form-vue 1.0.0-beta.6 → 1.0.0-beta.7
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/index.es.js +329 -285
- package/dist/index.umd.js +1 -1
- package/dist/src/VvForm.d.ts +34 -4
- package/dist/src/VvFormField.d.ts +10 -0
- package/dist/src/index.d.ts +132 -12
- package/dist/src/types.d.ts +2 -0
- package/package.json +14 -14
- package/src/VvForm.ts +56 -7
- package/src/VvFormField.ts +15 -0
- package/src/index.ts +2 -0
- package/src/types.ts +12 -10
package/dist/src/index.d.ts
CHANGED
|
@@ -13,11 +13,13 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
13
13
|
$: import("vue").ComponentInternalInstance;
|
|
14
14
|
$data: {};
|
|
15
15
|
$props: Partial<{
|
|
16
|
+
readonly: boolean;
|
|
16
17
|
template: FormTemplate<Schema>;
|
|
17
18
|
modelValue: Record<string, any>;
|
|
18
19
|
continuosValidation: boolean;
|
|
19
20
|
tag: string;
|
|
20
21
|
}> & Omit<{
|
|
22
|
+
readonly readonly: boolean;
|
|
21
23
|
readonly modelValue: Record<string, any>;
|
|
22
24
|
readonly continuosValidation: boolean;
|
|
23
25
|
readonly tag: string;
|
|
@@ -26,6 +28,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
26
28
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
27
29
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
28
30
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
31
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
29
32
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
30
33
|
continuosValidation: {
|
|
31
34
|
type: BooleanConstructor;
|
|
@@ -35,6 +38,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
35
38
|
type: ObjectConstructor;
|
|
36
39
|
default: () => {};
|
|
37
40
|
};
|
|
41
|
+
readonly: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
38
45
|
tag: {
|
|
39
46
|
type: StringConstructor;
|
|
40
47
|
default: string;
|
|
@@ -48,7 +55,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
48
55
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
49
56
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
50
57
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
51
|
-
|
|
58
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
59
|
+
}, "readonly" | "template" | "modelValue" | "continuosValidation" | "tag">;
|
|
52
60
|
$attrs: {
|
|
53
61
|
[x: string]: unknown;
|
|
54
62
|
};
|
|
@@ -60,7 +68,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
60
68
|
}>;
|
|
61
69
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
62
70
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
63
|
-
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit", ...args: any[]) => void;
|
|
71
|
+
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", ...args: any[]) => void;
|
|
64
72
|
$el: any;
|
|
65
73
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
66
74
|
continuosValidation: {
|
|
@@ -71,6 +79,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
71
79
|
type: ObjectConstructor;
|
|
72
80
|
default: () => {};
|
|
73
81
|
};
|
|
82
|
+
readonly: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
74
86
|
tag: {
|
|
75
87
|
type: StringConstructor;
|
|
76
88
|
default: string;
|
|
@@ -84,6 +96,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
84
96
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
85
97
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
86
98
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
99
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
87
100
|
}, {
|
|
88
101
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
89
102
|
submit: () => Promise<boolean>;
|
|
@@ -93,7 +106,9 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
93
106
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
94
107
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
95
108
|
invalid: import("vue").ComputedRef<boolean>;
|
|
96
|
-
|
|
109
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
110
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], string, {
|
|
111
|
+
readonly: boolean;
|
|
97
112
|
template: FormTemplate<Schema>;
|
|
98
113
|
modelValue: Record<string, any>;
|
|
99
114
|
continuosValidation: boolean;
|
|
@@ -127,6 +142,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
127
142
|
type: ObjectConstructor;
|
|
128
143
|
default: () => {};
|
|
129
144
|
};
|
|
145
|
+
readonly: {
|
|
146
|
+
type: BooleanConstructor;
|
|
147
|
+
default: boolean;
|
|
148
|
+
};
|
|
130
149
|
tag: {
|
|
131
150
|
type: StringConstructor;
|
|
132
151
|
default: string;
|
|
@@ -140,6 +159,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
140
159
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
141
160
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
142
161
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
162
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
143
163
|
} & import("vue").ShallowUnwrapRef<{
|
|
144
164
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
145
165
|
submit: () => Promise<boolean>;
|
|
@@ -149,6 +169,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
149
169
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
150
170
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
151
171
|
invalid: import("vue").ComputedRef<boolean>;
|
|
172
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
152
173
|
}> & {} & import("vue").ComponentCustomProperties & {};
|
|
153
174
|
__isFragment?: undefined;
|
|
154
175
|
__isTeleport?: undefined;
|
|
@@ -162,6 +183,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
162
183
|
type: ObjectConstructor;
|
|
163
184
|
default: () => {};
|
|
164
185
|
};
|
|
186
|
+
readonly: {
|
|
187
|
+
type: BooleanConstructor;
|
|
188
|
+
default: boolean;
|
|
189
|
+
};
|
|
165
190
|
tag: {
|
|
166
191
|
type: StringConstructor;
|
|
167
192
|
default: string;
|
|
@@ -175,6 +200,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
175
200
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
176
201
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
177
202
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
203
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
178
204
|
}, {
|
|
179
205
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
180
206
|
submit: () => Promise<boolean>;
|
|
@@ -184,7 +210,9 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
184
210
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
185
211
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
186
212
|
invalid: import("vue").ComputedRef<boolean>;
|
|
187
|
-
|
|
213
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
214
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", {
|
|
215
|
+
readonly: boolean;
|
|
188
216
|
template: FormTemplate<Schema>;
|
|
189
217
|
modelValue: Record<string, any>;
|
|
190
218
|
continuosValidation: boolean;
|
|
@@ -200,6 +228,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
200
228
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>>>>;
|
|
201
229
|
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
202
230
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
231
|
+
readonly: import("vue").Ref<boolean>;
|
|
203
232
|
}) => any;
|
|
204
233
|
};
|
|
205
234
|
});
|
|
@@ -372,6 +401,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
372
401
|
type: BooleanConstructor;
|
|
373
402
|
default: boolean;
|
|
374
403
|
};
|
|
404
|
+
readonly: {
|
|
405
|
+
type: BooleanConstructor;
|
|
406
|
+
default: undefined;
|
|
407
|
+
};
|
|
375
408
|
}, {
|
|
376
409
|
component: import("vue").ComputedRef<{
|
|
377
410
|
new (...args: any[]): any;
|
|
@@ -392,6 +425,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
392
425
|
type: import("./enums").FormFieldType | undefined;
|
|
393
426
|
invalidLabel: any;
|
|
394
427
|
modelValue: any;
|
|
428
|
+
readonly: {} | undefined;
|
|
395
429
|
'onUpdate:modelValue': (value: unknown) => void;
|
|
396
430
|
}>;
|
|
397
431
|
invalid: import("vue").ComputedRef<boolean>;
|
|
@@ -425,6 +459,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
425
459
|
type: BooleanConstructor;
|
|
426
460
|
default: boolean;
|
|
427
461
|
};
|
|
462
|
+
readonly: {
|
|
463
|
+
type: BooleanConstructor;
|
|
464
|
+
default: undefined;
|
|
465
|
+
};
|
|
428
466
|
}>> & {
|
|
429
467
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
430
468
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
@@ -443,6 +481,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
443
481
|
showValid: boolean;
|
|
444
482
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
445
483
|
lazyLoad: boolean;
|
|
484
|
+
readonly: boolean;
|
|
446
485
|
}, {}>;
|
|
447
486
|
VvFormTemplate: {
|
|
448
487
|
new (...args: any[]): {
|
|
@@ -538,6 +577,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
538
577
|
errors: import("vue").Ref<import("zod").inferFormattedError<Schema, string> | undefined>;
|
|
539
578
|
status: import("vue").Ref<import("./enums").FormStatus | undefined>;
|
|
540
579
|
invalid: import("vue").ComputedRef<boolean>;
|
|
580
|
+
readonly: import("vue").Ref<boolean>;
|
|
541
581
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
542
582
|
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
543
583
|
submit: () => Promise<boolean>;
|
|
@@ -549,11 +589,13 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
549
589
|
$: import("vue").ComponentInternalInstance;
|
|
550
590
|
$data: {};
|
|
551
591
|
$props: Partial<{
|
|
592
|
+
readonly: boolean;
|
|
552
593
|
template: FormTemplate<AnyZodObject>;
|
|
553
594
|
modelValue: Record<string, any>;
|
|
554
595
|
continuosValidation: boolean;
|
|
555
596
|
tag: string;
|
|
556
597
|
}> & Omit<{
|
|
598
|
+
readonly readonly: boolean;
|
|
557
599
|
readonly modelValue: Record<string, any>;
|
|
558
600
|
readonly continuosValidation: boolean;
|
|
559
601
|
readonly tag: string;
|
|
@@ -562,6 +604,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
562
604
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
563
605
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
564
606
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
607
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
565
608
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
566
609
|
continuosValidation: {
|
|
567
610
|
type: BooleanConstructor;
|
|
@@ -571,6 +614,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
571
614
|
type: ObjectConstructor;
|
|
572
615
|
default: () => {};
|
|
573
616
|
};
|
|
617
|
+
readonly: {
|
|
618
|
+
type: BooleanConstructor;
|
|
619
|
+
default: boolean;
|
|
620
|
+
};
|
|
574
621
|
tag: {
|
|
575
622
|
type: StringConstructor;
|
|
576
623
|
default: string;
|
|
@@ -584,7 +631,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
584
631
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
585
632
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
586
633
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
587
|
-
|
|
634
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
635
|
+
}, "readonly" | "template" | "modelValue" | "continuosValidation" | "tag">;
|
|
588
636
|
$attrs: {
|
|
589
637
|
[x: string]: unknown;
|
|
590
638
|
};
|
|
@@ -596,7 +644,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
596
644
|
}>;
|
|
597
645
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
598
646
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
599
|
-
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit", ...args: any[]) => void;
|
|
647
|
+
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", ...args: any[]) => void;
|
|
600
648
|
$el: any;
|
|
601
649
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
602
650
|
continuosValidation: {
|
|
@@ -607,6 +655,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
607
655
|
type: ObjectConstructor;
|
|
608
656
|
default: () => {};
|
|
609
657
|
};
|
|
658
|
+
readonly: {
|
|
659
|
+
type: BooleanConstructor;
|
|
660
|
+
default: boolean;
|
|
661
|
+
};
|
|
610
662
|
tag: {
|
|
611
663
|
type: StringConstructor;
|
|
612
664
|
default: string;
|
|
@@ -620,6 +672,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
620
672
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
621
673
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
622
674
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
675
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
623
676
|
}, {
|
|
624
677
|
formData: import("vue").Ref<Partial<{
|
|
625
678
|
[x: string]: any;
|
|
@@ -638,7 +691,9 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
638
691
|
} | undefined>>;
|
|
639
692
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
640
693
|
invalid: import("vue").ComputedRef<boolean>;
|
|
641
|
-
|
|
694
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
695
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], string, {
|
|
696
|
+
readonly: boolean;
|
|
642
697
|
template: FormTemplate<AnyZodObject>;
|
|
643
698
|
modelValue: Record<string, any>;
|
|
644
699
|
continuosValidation: boolean;
|
|
@@ -672,6 +727,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
672
727
|
type: ObjectConstructor;
|
|
673
728
|
default: () => {};
|
|
674
729
|
};
|
|
730
|
+
readonly: {
|
|
731
|
+
type: BooleanConstructor;
|
|
732
|
+
default: boolean;
|
|
733
|
+
};
|
|
675
734
|
tag: {
|
|
676
735
|
type: StringConstructor;
|
|
677
736
|
default: string;
|
|
@@ -685,6 +744,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
685
744
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
686
745
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
687
746
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
747
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
688
748
|
} & import("vue").ShallowUnwrapRef<{
|
|
689
749
|
formData: import("vue").Ref<Partial<{
|
|
690
750
|
[x: string]: any;
|
|
@@ -703,6 +763,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
703
763
|
} | undefined>>;
|
|
704
764
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
705
765
|
invalid: import("vue").ComputedRef<boolean>;
|
|
766
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
706
767
|
}> & {} & import("vue").ComponentCustomProperties & {};
|
|
707
768
|
__isFragment?: undefined;
|
|
708
769
|
__isTeleport?: undefined;
|
|
@@ -716,6 +777,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
716
777
|
type: ObjectConstructor;
|
|
717
778
|
default: () => {};
|
|
718
779
|
};
|
|
780
|
+
readonly: {
|
|
781
|
+
type: BooleanConstructor;
|
|
782
|
+
default: boolean;
|
|
783
|
+
};
|
|
719
784
|
tag: {
|
|
720
785
|
type: StringConstructor;
|
|
721
786
|
default: string;
|
|
@@ -729,6 +794,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
729
794
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
730
795
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
731
796
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
797
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
732
798
|
}, {
|
|
733
799
|
formData: import("vue").Ref<Partial<{
|
|
734
800
|
[x: string]: any;
|
|
@@ -747,7 +813,9 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
747
813
|
} | undefined>>;
|
|
748
814
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
749
815
|
invalid: import("vue").ComputedRef<boolean>;
|
|
750
|
-
|
|
816
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
817
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", {
|
|
818
|
+
readonly: boolean;
|
|
751
819
|
template: FormTemplate<AnyZodObject>;
|
|
752
820
|
modelValue: Record<string, any>;
|
|
753
821
|
continuosValidation: boolean;
|
|
@@ -770,6 +838,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
770
838
|
}>>;
|
|
771
839
|
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
772
840
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
841
|
+
readonly: import("vue").Ref<boolean>;
|
|
773
842
|
}) => any;
|
|
774
843
|
};
|
|
775
844
|
});
|
|
@@ -974,6 +1043,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
974
1043
|
type: BooleanConstructor;
|
|
975
1044
|
default: boolean;
|
|
976
1045
|
};
|
|
1046
|
+
readonly: {
|
|
1047
|
+
type: BooleanConstructor;
|
|
1048
|
+
default: undefined;
|
|
1049
|
+
};
|
|
977
1050
|
}, {
|
|
978
1051
|
component: import("vue").ComputedRef<{
|
|
979
1052
|
new (...args: any[]): any;
|
|
@@ -988,6 +1061,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
988
1061
|
type: import("./enums").FormFieldType | undefined;
|
|
989
1062
|
invalidLabel: any;
|
|
990
1063
|
modelValue: any;
|
|
1064
|
+
readonly: {} | undefined;
|
|
991
1065
|
'onUpdate:modelValue': (value: unknown) => void;
|
|
992
1066
|
}>;
|
|
993
1067
|
invalid: import("vue").ComputedRef<boolean>;
|
|
@@ -1025,6 +1099,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
1025
1099
|
type: BooleanConstructor;
|
|
1026
1100
|
default: boolean;
|
|
1027
1101
|
};
|
|
1102
|
+
readonly: {
|
|
1103
|
+
type: BooleanConstructor;
|
|
1104
|
+
default: undefined;
|
|
1105
|
+
};
|
|
1028
1106
|
}>> & {
|
|
1029
1107
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1030
1108
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
@@ -1041,6 +1119,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
1041
1119
|
showValid: boolean;
|
|
1042
1120
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
1043
1121
|
lazyLoad: boolean;
|
|
1122
|
+
readonly: boolean;
|
|
1044
1123
|
}, {}>;
|
|
1045
1124
|
VvFormTemplate: {
|
|
1046
1125
|
new (...args: any[]): {
|
|
@@ -1143,6 +1222,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
1143
1222
|
errors: import("vue").Ref<import("zod").inferFormattedError<AnyZodObject, string> | undefined>;
|
|
1144
1223
|
status: import("vue").Ref<import("./enums").FormStatus | undefined>;
|
|
1145
1224
|
invalid: import("vue").ComputedRef<boolean>;
|
|
1225
|
+
readonly: import("vue").Ref<boolean>;
|
|
1146
1226
|
formData: import("vue").Ref<Partial<{
|
|
1147
1227
|
[x: string]: any;
|
|
1148
1228
|
} | undefined>>;
|
|
@@ -1169,11 +1249,13 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1169
1249
|
$: import("vue").ComponentInternalInstance;
|
|
1170
1250
|
$data: {};
|
|
1171
1251
|
$props: Partial<{
|
|
1252
|
+
readonly: boolean;
|
|
1172
1253
|
template: FormTemplate<Schema>;
|
|
1173
1254
|
modelValue: Record<string, any>;
|
|
1174
1255
|
continuosValidation: boolean;
|
|
1175
1256
|
tag: string;
|
|
1176
1257
|
}> & Omit<{
|
|
1258
|
+
readonly readonly: boolean;
|
|
1177
1259
|
readonly modelValue: Record<string, any>;
|
|
1178
1260
|
readonly continuosValidation: boolean;
|
|
1179
1261
|
readonly tag: string;
|
|
@@ -1182,6 +1264,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1182
1264
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
1183
1265
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1184
1266
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
1267
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
1185
1268
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
1186
1269
|
continuosValidation: {
|
|
1187
1270
|
type: BooleanConstructor;
|
|
@@ -1191,6 +1274,10 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1191
1274
|
type: ObjectConstructor;
|
|
1192
1275
|
default: () => {};
|
|
1193
1276
|
};
|
|
1277
|
+
readonly: {
|
|
1278
|
+
type: BooleanConstructor;
|
|
1279
|
+
default: boolean;
|
|
1280
|
+
};
|
|
1194
1281
|
tag: {
|
|
1195
1282
|
type: StringConstructor;
|
|
1196
1283
|
default: string;
|
|
@@ -1204,7 +1291,8 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1204
1291
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
1205
1292
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1206
1293
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
1207
|
-
|
|
1294
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
1295
|
+
}, "readonly" | "template" | "modelValue" | "continuosValidation" | "tag">;
|
|
1208
1296
|
$attrs: {
|
|
1209
1297
|
[x: string]: unknown;
|
|
1210
1298
|
};
|
|
@@ -1216,7 +1304,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1216
1304
|
}>;
|
|
1217
1305
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
1218
1306
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
1219
|
-
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit", ...args: any[]) => void;
|
|
1307
|
+
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", ...args: any[]) => void;
|
|
1220
1308
|
$el: any;
|
|
1221
1309
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
1222
1310
|
continuosValidation: {
|
|
@@ -1227,6 +1315,10 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1227
1315
|
type: ObjectConstructor;
|
|
1228
1316
|
default: () => {};
|
|
1229
1317
|
};
|
|
1318
|
+
readonly: {
|
|
1319
|
+
type: BooleanConstructor;
|
|
1320
|
+
default: boolean;
|
|
1321
|
+
};
|
|
1230
1322
|
tag: {
|
|
1231
1323
|
type: StringConstructor;
|
|
1232
1324
|
default: string;
|
|
@@ -1240,6 +1332,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1240
1332
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
1241
1333
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1242
1334
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
1335
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
1243
1336
|
}, {
|
|
1244
1337
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
1245
1338
|
submit: () => Promise<boolean>;
|
|
@@ -1249,7 +1342,9 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1249
1342
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
1250
1343
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
1251
1344
|
invalid: import("vue").ComputedRef<boolean>;
|
|
1252
|
-
|
|
1345
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
1346
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], string, {
|
|
1347
|
+
readonly: boolean;
|
|
1253
1348
|
template: FormTemplate<Schema>;
|
|
1254
1349
|
modelValue: Record<string, any>;
|
|
1255
1350
|
continuosValidation: boolean;
|
|
@@ -1283,6 +1378,10 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1283
1378
|
type: ObjectConstructor;
|
|
1284
1379
|
default: () => {};
|
|
1285
1380
|
};
|
|
1381
|
+
readonly: {
|
|
1382
|
+
type: BooleanConstructor;
|
|
1383
|
+
default: boolean;
|
|
1384
|
+
};
|
|
1286
1385
|
tag: {
|
|
1287
1386
|
type: StringConstructor;
|
|
1288
1387
|
default: string;
|
|
@@ -1296,6 +1395,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1296
1395
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
1297
1396
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1298
1397
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
1398
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
1299
1399
|
} & import("vue").ShallowUnwrapRef<{
|
|
1300
1400
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
1301
1401
|
submit: () => Promise<boolean>;
|
|
@@ -1305,6 +1405,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1305
1405
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
1306
1406
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
1307
1407
|
invalid: import("vue").ComputedRef<boolean>;
|
|
1408
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
1308
1409
|
}> & {} & import("vue").ComponentCustomProperties & {};
|
|
1309
1410
|
__isFragment?: undefined;
|
|
1310
1411
|
__isTeleport?: undefined;
|
|
@@ -1318,6 +1419,10 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1318
1419
|
type: ObjectConstructor;
|
|
1319
1420
|
default: () => {};
|
|
1320
1421
|
};
|
|
1422
|
+
readonly: {
|
|
1423
|
+
type: BooleanConstructor;
|
|
1424
|
+
default: boolean;
|
|
1425
|
+
};
|
|
1321
1426
|
tag: {
|
|
1322
1427
|
type: StringConstructor;
|
|
1323
1428
|
default: string;
|
|
@@ -1331,6 +1436,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1331
1436
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
1332
1437
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1333
1438
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
1439
|
+
"onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
|
|
1334
1440
|
}, {
|
|
1335
1441
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
1336
1442
|
submit: () => Promise<boolean>;
|
|
@@ -1340,7 +1446,9 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1340
1446
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
1341
1447
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
1342
1448
|
invalid: import("vue").ComputedRef<boolean>;
|
|
1343
|
-
|
|
1449
|
+
isReadonly: import("vue").Ref<boolean>;
|
|
1450
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", {
|
|
1451
|
+
readonly: boolean;
|
|
1344
1452
|
template: FormTemplate<Schema>;
|
|
1345
1453
|
modelValue: Record<string, any>;
|
|
1346
1454
|
continuosValidation: boolean;
|
|
@@ -1356,6 +1464,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1356
1464
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>>>>;
|
|
1357
1465
|
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
1358
1466
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
1467
|
+
readonly: import("vue").Ref<boolean>;
|
|
1359
1468
|
}) => any;
|
|
1360
1469
|
};
|
|
1361
1470
|
});
|
|
@@ -1528,6 +1637,10 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1528
1637
|
type: BooleanConstructor;
|
|
1529
1638
|
default: boolean;
|
|
1530
1639
|
};
|
|
1640
|
+
readonly: {
|
|
1641
|
+
type: BooleanConstructor;
|
|
1642
|
+
default: undefined;
|
|
1643
|
+
};
|
|
1531
1644
|
}, {
|
|
1532
1645
|
component: import("vue").ComputedRef<{
|
|
1533
1646
|
new (...args: any[]): any;
|
|
@@ -1548,6 +1661,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1548
1661
|
type: import("./enums").FormFieldType | undefined;
|
|
1549
1662
|
invalidLabel: any;
|
|
1550
1663
|
modelValue: any;
|
|
1664
|
+
readonly: {} | undefined;
|
|
1551
1665
|
'onUpdate:modelValue': (value: unknown) => void;
|
|
1552
1666
|
}>;
|
|
1553
1667
|
invalid: import("vue").ComputedRef<boolean>;
|
|
@@ -1581,6 +1695,10 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1581
1695
|
type: BooleanConstructor;
|
|
1582
1696
|
default: boolean;
|
|
1583
1697
|
};
|
|
1698
|
+
readonly: {
|
|
1699
|
+
type: BooleanConstructor;
|
|
1700
|
+
default: undefined;
|
|
1701
|
+
};
|
|
1584
1702
|
}>> & {
|
|
1585
1703
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1586
1704
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
@@ -1599,6 +1717,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1599
1717
|
showValid: boolean;
|
|
1600
1718
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
1601
1719
|
lazyLoad: boolean;
|
|
1720
|
+
readonly: boolean;
|
|
1602
1721
|
}, {}>;
|
|
1603
1722
|
VvFormTemplate: {
|
|
1604
1723
|
new (...args: any[]): {
|
|
@@ -1694,6 +1813,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1694
1813
|
errors: import("vue").Ref<import("zod").inferFormattedError<Schema, string> | undefined>;
|
|
1695
1814
|
status: import("vue").Ref<import("./enums").FormStatus | undefined>;
|
|
1696
1815
|
invalid: import("vue").ComputedRef<boolean>;
|
|
1816
|
+
readonly: import("vue").Ref<boolean>;
|
|
1697
1817
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
1698
1818
|
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
1699
1819
|
submit: () => Promise<boolean>;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type FormFieldComponentOptions = {
|
|
|
10
10
|
export type FormComponentOptions<Schema> = {
|
|
11
11
|
updateThrottle?: number;
|
|
12
12
|
continuosValidation?: boolean;
|
|
13
|
+
readonly?: boolean;
|
|
13
14
|
template?: Schema extends FormSchema ? FormTemplate<Schema> : never;
|
|
14
15
|
onUpdate?: Schema extends FormSchema ? (data: Partial<z.infer<Schema> | undefined>) => void : never;
|
|
15
16
|
onSubmit?: Schema extends FormSchema ? (data: z.infer<Schema>) => void : never;
|
|
@@ -30,6 +31,7 @@ export type InjectedFormData<Schema extends FormSchema> = {
|
|
|
30
31
|
stopUpdatesWatch: WatchStopHandle;
|
|
31
32
|
status: Readonly<Ref<FormStatus | undefined>>;
|
|
32
33
|
invalid: Readonly<Ref<boolean>>;
|
|
34
|
+
readonly: Ref<boolean>;
|
|
33
35
|
};
|
|
34
36
|
export type InjectedFormWrapperData<Schema extends FormSchema> = {
|
|
35
37
|
name: Ref<string>;
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/volverjs/form-vue/issues"
|
|
21
21
|
},
|
|
22
|
-
"version": "1.0.0-beta.
|
|
22
|
+
"version": "1.0.0-beta.7",
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">= 16.x"
|
|
25
25
|
},
|
|
@@ -36,30 +36,30 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@volverjs/ui-vue": "^0.0.9",
|
|
39
|
-
"@vueuse/core": "^10.
|
|
39
|
+
"@vueuse/core": "^10.6.1",
|
|
40
40
|
"ts-dot-prop": "^2.1.3",
|
|
41
|
-
"vue": "^3.3.
|
|
41
|
+
"vue": "^3.3.8",
|
|
42
42
|
"zod": "^3.22.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@playwright/experimental-ct-vue": "1.
|
|
46
|
-
"@testing-library/vue": "^8.0.
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
48
|
-
"@vitejs/plugin-vue": "^4.
|
|
45
|
+
"@playwright/experimental-ct-vue": "1.40.0",
|
|
46
|
+
"@testing-library/vue": "^8.0.1",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
48
|
+
"@vitejs/plugin-vue": "^4.5.0",
|
|
49
49
|
"@volverjs/style": "^0.1.11",
|
|
50
|
-
"@vue/compiler-sfc": "^3.3.
|
|
50
|
+
"@vue/compiler-sfc": "^3.3.8",
|
|
51
51
|
"@vue/eslint-config-typescript": "^12.0.0",
|
|
52
|
-
"@vue/runtime-core": "^3.3.
|
|
53
|
-
"@vue/test-utils": "^2.4.
|
|
52
|
+
"@vue/runtime-core": "^3.3.8",
|
|
53
|
+
"@vue/test-utils": "^2.4.2",
|
|
54
54
|
"copy": "^0.3.2",
|
|
55
|
-
"eslint": "^8.
|
|
55
|
+
"eslint": "^8.54.0",
|
|
56
56
|
"eslint-config-prettier": "^9.0.0",
|
|
57
57
|
"eslint-plugin-prettier": "^5.0.1",
|
|
58
58
|
"eslint-plugin-vue": "^9.18.1",
|
|
59
59
|
"happy-dom": "^12.10.3",
|
|
60
|
-
"prettier": "^3.0
|
|
61
|
-
"typescript": "^5.
|
|
62
|
-
"vite": "^
|
|
60
|
+
"prettier": "^3.1.0",
|
|
61
|
+
"typescript": "^5.3.2",
|
|
62
|
+
"vite": "^5.0.2",
|
|
63
63
|
"vite-plugin-dts": "^3.6.3",
|
|
64
64
|
"vite-plugin-eslint": "^1.8.1",
|
|
65
65
|
"vite-plugin-externalize-deps": "^0.7.0",
|