@volverjs/form-vue 1.0.0-beta.1 → 1.0.0-beta.2
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 +390 -349
- package/dist/index.umd.js +1 -1
- package/dist/src/VvForm.d.ts +40 -27
- package/dist/src/enums.d.ts +4 -1
- package/dist/src/index.d.ts +116 -78
- package/dist/src/types.d.ts +4 -1
- package/package.json +14 -14
- package/src/VvForm.ts +99 -60
- package/src/VvFormField.ts +1 -1
- package/src/VvFormTemplate.ts +1 -0
- package/src/VvFormWrapper.ts +1 -1
- package/src/enums.ts +3 -0
- package/src/index.ts +14 -6
- package/src/types.ts +4 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
15
15
|
$props: {
|
|
16
16
|
template?: FormTemplate<Schema> | undefined;
|
|
17
17
|
modelValue?: Record<string, any> | undefined;
|
|
18
|
-
updateThrottle?: number | undefined;
|
|
19
18
|
continuosValidation?: boolean | undefined;
|
|
19
|
+
tag?: string | undefined;
|
|
20
20
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
21
21
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
22
22
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -80,17 +80,17 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
80
80
|
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit", ...args: any[]) => void;
|
|
81
81
|
$el: any;
|
|
82
82
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
83
|
+
continuosValidation: {
|
|
84
|
+
type: BooleanConstructor;
|
|
85
|
+
default: boolean;
|
|
86
|
+
};
|
|
83
87
|
modelValue: {
|
|
84
88
|
type: ObjectConstructor;
|
|
85
89
|
default: () => {};
|
|
86
90
|
};
|
|
87
|
-
|
|
88
|
-
type:
|
|
89
|
-
default:
|
|
90
|
-
};
|
|
91
|
-
continuosValidation: {
|
|
92
|
-
type: BooleanConstructor;
|
|
93
|
-
default: boolean;
|
|
91
|
+
tag: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
default: string;
|
|
94
94
|
};
|
|
95
95
|
template: {
|
|
96
96
|
type: import("vue").PropType<FormTemplate<Schema>>;
|
|
@@ -105,14 +105,16 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
105
105
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
106
106
|
submit: () => Promise<boolean>;
|
|
107
107
|
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
108
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
109
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
108
110
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
109
111
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
110
112
|
invalid: import("vue").ComputedRef<boolean>;
|
|
111
113
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit")[], string, {
|
|
112
114
|
template: FormTemplate<Schema>;
|
|
113
115
|
modelValue: Record<string, any>;
|
|
114
|
-
updateThrottle: number;
|
|
115
116
|
continuosValidation: boolean;
|
|
117
|
+
tag: string;
|
|
116
118
|
}, {}, string, {}> & {
|
|
117
119
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
118
120
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -134,17 +136,17 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
134
136
|
$nextTick: typeof import("vue").nextTick;
|
|
135
137
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
136
138
|
} & Readonly<import("vue").ExtractPropTypes<{
|
|
139
|
+
continuosValidation: {
|
|
140
|
+
type: BooleanConstructor;
|
|
141
|
+
default: boolean;
|
|
142
|
+
};
|
|
137
143
|
modelValue: {
|
|
138
144
|
type: ObjectConstructor;
|
|
139
145
|
default: () => {};
|
|
140
146
|
};
|
|
141
|
-
|
|
142
|
-
type:
|
|
143
|
-
default:
|
|
144
|
-
};
|
|
145
|
-
continuosValidation: {
|
|
146
|
-
type: BooleanConstructor;
|
|
147
|
-
default: boolean;
|
|
147
|
+
tag: {
|
|
148
|
+
type: StringConstructor;
|
|
149
|
+
default: string;
|
|
148
150
|
};
|
|
149
151
|
template: {
|
|
150
152
|
type: import("vue").PropType<FormTemplate<Schema>>;
|
|
@@ -159,6 +161,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
159
161
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
160
162
|
submit: () => Promise<boolean>;
|
|
161
163
|
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
164
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
165
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
162
166
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
163
167
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
164
168
|
invalid: import("vue").ComputedRef<boolean>;
|
|
@@ -167,17 +171,17 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
167
171
|
__isTeleport?: undefined;
|
|
168
172
|
__isSuspense?: undefined;
|
|
169
173
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
174
|
+
continuosValidation: {
|
|
175
|
+
type: BooleanConstructor;
|
|
176
|
+
default: boolean;
|
|
177
|
+
};
|
|
170
178
|
modelValue: {
|
|
171
179
|
type: ObjectConstructor;
|
|
172
180
|
default: () => {};
|
|
173
181
|
};
|
|
174
|
-
|
|
175
|
-
type:
|
|
176
|
-
default:
|
|
177
|
-
};
|
|
178
|
-
continuosValidation: {
|
|
179
|
-
type: BooleanConstructor;
|
|
180
|
-
default: boolean;
|
|
182
|
+
tag: {
|
|
183
|
+
type: StringConstructor;
|
|
184
|
+
default: string;
|
|
181
185
|
};
|
|
182
186
|
template: {
|
|
183
187
|
type: import("vue").PropType<FormTemplate<Schema>>;
|
|
@@ -192,22 +196,26 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
192
196
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
193
197
|
submit: () => Promise<boolean>;
|
|
194
198
|
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
199
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
200
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
195
201
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
196
202
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
197
203
|
invalid: import("vue").ComputedRef<boolean>;
|
|
198
204
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit")[], "invalid" | "valid" | "update:modelValue" | "submit", {
|
|
199
205
|
template: FormTemplate<Schema>;
|
|
200
206
|
modelValue: Record<string, any>;
|
|
201
|
-
updateThrottle: number;
|
|
202
207
|
continuosValidation: boolean;
|
|
208
|
+
tag: string;
|
|
203
209
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
204
210
|
$slots: {
|
|
205
211
|
default: (_: {
|
|
206
212
|
formData: unknown extends Partial<import("zod").TypeOf<Schema>> | undefined ? undefined : Partial<import("zod").TypeOf<Schema>> | undefined;
|
|
207
213
|
submit: () => Promise<boolean>;
|
|
208
214
|
validate: () => Promise<boolean>;
|
|
215
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
216
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
209
217
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>>>>;
|
|
210
|
-
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | undefined>>;
|
|
218
|
+
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
211
219
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
212
220
|
}) => any;
|
|
213
221
|
};
|
|
@@ -605,7 +613,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
605
613
|
submit: () => Promise<boolean>;
|
|
606
614
|
validate: () => Promise<boolean>;
|
|
607
615
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>>>>;
|
|
608
|
-
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | undefined>>;
|
|
616
|
+
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
609
617
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
610
618
|
}) => any;
|
|
611
619
|
};
|
|
@@ -616,6 +624,10 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
616
624
|
errors: import("vue").Ref<import("zod").inferFormattedError<Schema, string> | undefined>;
|
|
617
625
|
status: import("vue").Ref<import("./enums").FormStatus | undefined>;
|
|
618
626
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
627
|
+
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
628
|
+
submit: () => Promise<boolean>;
|
|
629
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
630
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
619
631
|
} | {
|
|
620
632
|
VvForm: {
|
|
621
633
|
new (...args: any[]): {
|
|
@@ -624,8 +636,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
624
636
|
$props: {
|
|
625
637
|
template?: FormTemplate<AnyZodObject> | undefined;
|
|
626
638
|
modelValue?: Record<string, any> | undefined;
|
|
627
|
-
updateThrottle?: number | undefined;
|
|
628
639
|
continuosValidation?: boolean | undefined;
|
|
640
|
+
tag?: string | undefined;
|
|
629
641
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
630
642
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
631
643
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -689,17 +701,17 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
689
701
|
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit", ...args: any[]) => void;
|
|
690
702
|
$el: any;
|
|
691
703
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
704
|
+
continuosValidation: {
|
|
705
|
+
type: BooleanConstructor;
|
|
706
|
+
default: boolean;
|
|
707
|
+
};
|
|
692
708
|
modelValue: {
|
|
693
709
|
type: ObjectConstructor;
|
|
694
710
|
default: () => {};
|
|
695
711
|
};
|
|
696
|
-
|
|
697
|
-
type:
|
|
698
|
-
default:
|
|
699
|
-
};
|
|
700
|
-
continuosValidation: {
|
|
701
|
-
type: BooleanConstructor;
|
|
702
|
-
default: boolean;
|
|
712
|
+
tag: {
|
|
713
|
+
type: StringConstructor;
|
|
714
|
+
default: string;
|
|
703
715
|
};
|
|
704
716
|
template: {
|
|
705
717
|
type: import("vue").PropType<FormTemplate<AnyZodObject>>;
|
|
@@ -718,6 +730,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
718
730
|
validate: (value?: Partial<{
|
|
719
731
|
[x: string]: any;
|
|
720
732
|
} | undefined>) => Promise<boolean>;
|
|
733
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
734
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
721
735
|
errors: Readonly<import("vue").Ref<{
|
|
722
736
|
readonly [x: string]: {
|
|
723
737
|
readonly _errors: readonly string[];
|
|
@@ -729,8 +743,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
729
743
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit")[], string, {
|
|
730
744
|
template: FormTemplate<AnyZodObject>;
|
|
731
745
|
modelValue: Record<string, any>;
|
|
732
|
-
updateThrottle: number;
|
|
733
746
|
continuosValidation: boolean;
|
|
747
|
+
tag: string;
|
|
734
748
|
}, {}, string, {}> & {
|
|
735
749
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
736
750
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -752,17 +766,17 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
752
766
|
$nextTick: typeof import("vue").nextTick;
|
|
753
767
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
754
768
|
} & Readonly<import("vue").ExtractPropTypes<{
|
|
769
|
+
continuosValidation: {
|
|
770
|
+
type: BooleanConstructor;
|
|
771
|
+
default: boolean;
|
|
772
|
+
};
|
|
755
773
|
modelValue: {
|
|
756
774
|
type: ObjectConstructor;
|
|
757
775
|
default: () => {};
|
|
758
776
|
};
|
|
759
|
-
|
|
760
|
-
type:
|
|
761
|
-
default:
|
|
762
|
-
};
|
|
763
|
-
continuosValidation: {
|
|
764
|
-
type: BooleanConstructor;
|
|
765
|
-
default: boolean;
|
|
777
|
+
tag: {
|
|
778
|
+
type: StringConstructor;
|
|
779
|
+
default: string;
|
|
766
780
|
};
|
|
767
781
|
template: {
|
|
768
782
|
type: import("vue").PropType<FormTemplate<AnyZodObject>>;
|
|
@@ -781,6 +795,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
781
795
|
validate: (value?: Partial<{
|
|
782
796
|
[x: string]: any;
|
|
783
797
|
} | undefined>) => Promise<boolean>;
|
|
798
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
799
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
784
800
|
errors: Readonly<import("vue").Ref<{
|
|
785
801
|
readonly [x: string]: {
|
|
786
802
|
readonly _errors: readonly string[];
|
|
@@ -794,17 +810,17 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
794
810
|
__isTeleport?: undefined;
|
|
795
811
|
__isSuspense?: undefined;
|
|
796
812
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
813
|
+
continuosValidation: {
|
|
814
|
+
type: BooleanConstructor;
|
|
815
|
+
default: boolean;
|
|
816
|
+
};
|
|
797
817
|
modelValue: {
|
|
798
818
|
type: ObjectConstructor;
|
|
799
819
|
default: () => {};
|
|
800
820
|
};
|
|
801
|
-
|
|
802
|
-
type:
|
|
803
|
-
default:
|
|
804
|
-
};
|
|
805
|
-
continuosValidation: {
|
|
806
|
-
type: BooleanConstructor;
|
|
807
|
-
default: boolean;
|
|
821
|
+
tag: {
|
|
822
|
+
type: StringConstructor;
|
|
823
|
+
default: string;
|
|
808
824
|
};
|
|
809
825
|
template: {
|
|
810
826
|
type: import("vue").PropType<FormTemplate<AnyZodObject>>;
|
|
@@ -823,6 +839,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
823
839
|
validate: (value?: Partial<{
|
|
824
840
|
[x: string]: any;
|
|
825
841
|
} | undefined>) => Promise<boolean>;
|
|
842
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
843
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
826
844
|
errors: Readonly<import("vue").Ref<{
|
|
827
845
|
readonly [x: string]: {
|
|
828
846
|
readonly _errors: readonly string[];
|
|
@@ -834,8 +852,8 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
834
852
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit")[], "invalid" | "valid" | "update:modelValue" | "submit", {
|
|
835
853
|
template: FormTemplate<AnyZodObject>;
|
|
836
854
|
modelValue: Record<string, any>;
|
|
837
|
-
updateThrottle: number;
|
|
838
855
|
continuosValidation: boolean;
|
|
856
|
+
tag: string;
|
|
839
857
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
840
858
|
$slots: {
|
|
841
859
|
default: (_: {
|
|
@@ -844,13 +862,15 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
844
862
|
}> | undefined;
|
|
845
863
|
submit: () => Promise<boolean>;
|
|
846
864
|
validate: () => Promise<boolean>;
|
|
865
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
866
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
847
867
|
errors: Readonly<import("vue").Ref<{
|
|
848
868
|
readonly [x: string]: {
|
|
849
869
|
readonly _errors: readonly string[];
|
|
850
870
|
} | undefined;
|
|
851
871
|
readonly _errors: readonly string[];
|
|
852
872
|
}>>;
|
|
853
|
-
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | undefined>>;
|
|
873
|
+
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
854
874
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
855
875
|
}) => any;
|
|
856
876
|
};
|
|
@@ -1283,7 +1303,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
1283
1303
|
} | undefined;
|
|
1284
1304
|
readonly _errors: readonly string[];
|
|
1285
1305
|
}>>;
|
|
1286
|
-
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | undefined>>;
|
|
1306
|
+
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
1287
1307
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
1288
1308
|
}) => any;
|
|
1289
1309
|
};
|
|
@@ -1296,6 +1316,12 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
1296
1316
|
formData: import("vue").Ref<Partial<{
|
|
1297
1317
|
[x: string]: any;
|
|
1298
1318
|
} | undefined>>;
|
|
1319
|
+
validate: (value?: Partial<{
|
|
1320
|
+
[x: string]: any;
|
|
1321
|
+
} | undefined>) => Promise<boolean>;
|
|
1322
|
+
submit: () => Promise<boolean>;
|
|
1323
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
1324
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
1299
1325
|
};
|
|
1300
1326
|
export { FormFieldType } from './enums';
|
|
1301
1327
|
export { defaultObjectBySchema } from './utils';
|
|
@@ -1315,8 +1341,8 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1315
1341
|
$props: {
|
|
1316
1342
|
template?: FormTemplate<Schema> | undefined;
|
|
1317
1343
|
modelValue?: Record<string, any> | undefined;
|
|
1318
|
-
updateThrottle?: number | undefined;
|
|
1319
1344
|
continuosValidation?: boolean | undefined;
|
|
1345
|
+
tag?: string | undefined;
|
|
1320
1346
|
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
1321
1347
|
onValid?: ((...args: any[]) => any) | undefined;
|
|
1322
1348
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -1380,17 +1406,17 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1380
1406
|
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit", ...args: any[]) => void;
|
|
1381
1407
|
$el: any;
|
|
1382
1408
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
1409
|
+
continuosValidation: {
|
|
1410
|
+
type: BooleanConstructor;
|
|
1411
|
+
default: boolean;
|
|
1412
|
+
};
|
|
1383
1413
|
modelValue: {
|
|
1384
1414
|
type: ObjectConstructor;
|
|
1385
1415
|
default: () => {};
|
|
1386
1416
|
};
|
|
1387
|
-
|
|
1388
|
-
type:
|
|
1389
|
-
default:
|
|
1390
|
-
};
|
|
1391
|
-
continuosValidation: {
|
|
1392
|
-
type: BooleanConstructor;
|
|
1393
|
-
default: boolean;
|
|
1417
|
+
tag: {
|
|
1418
|
+
type: StringConstructor;
|
|
1419
|
+
default: string;
|
|
1394
1420
|
};
|
|
1395
1421
|
template: {
|
|
1396
1422
|
type: import("vue").PropType<FormTemplate<Schema>>;
|
|
@@ -1405,14 +1431,16 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1405
1431
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
1406
1432
|
submit: () => Promise<boolean>;
|
|
1407
1433
|
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
1434
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
1435
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
1408
1436
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
1409
1437
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
1410
1438
|
invalid: import("vue").ComputedRef<boolean>;
|
|
1411
1439
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit")[], string, {
|
|
1412
1440
|
template: FormTemplate<Schema>;
|
|
1413
1441
|
modelValue: Record<string, any>;
|
|
1414
|
-
updateThrottle: number;
|
|
1415
1442
|
continuosValidation: boolean;
|
|
1443
|
+
tag: string;
|
|
1416
1444
|
}, {}, string, {}> & {
|
|
1417
1445
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
1418
1446
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -1434,17 +1462,17 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1434
1462
|
$nextTick: typeof import("vue").nextTick;
|
|
1435
1463
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
1436
1464
|
} & Readonly<import("vue").ExtractPropTypes<{
|
|
1465
|
+
continuosValidation: {
|
|
1466
|
+
type: BooleanConstructor;
|
|
1467
|
+
default: boolean;
|
|
1468
|
+
};
|
|
1437
1469
|
modelValue: {
|
|
1438
1470
|
type: ObjectConstructor;
|
|
1439
1471
|
default: () => {};
|
|
1440
1472
|
};
|
|
1441
|
-
|
|
1442
|
-
type:
|
|
1443
|
-
default:
|
|
1444
|
-
};
|
|
1445
|
-
continuosValidation: {
|
|
1446
|
-
type: BooleanConstructor;
|
|
1447
|
-
default: boolean;
|
|
1473
|
+
tag: {
|
|
1474
|
+
type: StringConstructor;
|
|
1475
|
+
default: string;
|
|
1448
1476
|
};
|
|
1449
1477
|
template: {
|
|
1450
1478
|
type: import("vue").PropType<FormTemplate<Schema>>;
|
|
@@ -1459,6 +1487,8 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1459
1487
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
1460
1488
|
submit: () => Promise<boolean>;
|
|
1461
1489
|
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
1490
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
1491
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
1462
1492
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
1463
1493
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
1464
1494
|
invalid: import("vue").ComputedRef<boolean>;
|
|
@@ -1467,17 +1497,17 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1467
1497
|
__isTeleport?: undefined;
|
|
1468
1498
|
__isSuspense?: undefined;
|
|
1469
1499
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
1500
|
+
continuosValidation: {
|
|
1501
|
+
type: BooleanConstructor;
|
|
1502
|
+
default: boolean;
|
|
1503
|
+
};
|
|
1470
1504
|
modelValue: {
|
|
1471
1505
|
type: ObjectConstructor;
|
|
1472
1506
|
default: () => {};
|
|
1473
1507
|
};
|
|
1474
|
-
|
|
1475
|
-
type:
|
|
1476
|
-
default:
|
|
1477
|
-
};
|
|
1478
|
-
continuosValidation: {
|
|
1479
|
-
type: BooleanConstructor;
|
|
1480
|
-
default: boolean;
|
|
1508
|
+
tag: {
|
|
1509
|
+
type: StringConstructor;
|
|
1510
|
+
default: string;
|
|
1481
1511
|
};
|
|
1482
1512
|
template: {
|
|
1483
1513
|
type: import("vue").PropType<FormTemplate<Schema>>;
|
|
@@ -1492,22 +1522,26 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1492
1522
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
1493
1523
|
submit: () => Promise<boolean>;
|
|
1494
1524
|
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
1525
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
1526
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
1495
1527
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>> | undefined>>;
|
|
1496
1528
|
status: Readonly<import("vue").Ref<import("./enums").FormStatus | undefined>>;
|
|
1497
1529
|
invalid: import("vue").ComputedRef<boolean>;
|
|
1498
1530
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit")[], "invalid" | "valid" | "update:modelValue" | "submit", {
|
|
1499
1531
|
template: FormTemplate<Schema>;
|
|
1500
1532
|
modelValue: Record<string, any>;
|
|
1501
|
-
updateThrottle: number;
|
|
1502
1533
|
continuosValidation: boolean;
|
|
1534
|
+
tag: string;
|
|
1503
1535
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
1504
1536
|
$slots: {
|
|
1505
1537
|
default: (_: {
|
|
1506
1538
|
formData: unknown extends Partial<import("zod").TypeOf<Schema>> | undefined ? undefined : Partial<import("zod").TypeOf<Schema>> | undefined;
|
|
1507
1539
|
submit: () => Promise<boolean>;
|
|
1508
1540
|
validate: () => Promise<boolean>;
|
|
1541
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
1542
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
1509
1543
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>>>>;
|
|
1510
|
-
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | undefined>>;
|
|
1544
|
+
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
1511
1545
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
1512
1546
|
}) => any;
|
|
1513
1547
|
};
|
|
@@ -1905,7 +1939,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1905
1939
|
submit: () => Promise<boolean>;
|
|
1906
1940
|
validate: () => Promise<boolean>;
|
|
1907
1941
|
errors: Readonly<import("vue").Ref<import("vue").DeepReadonly<import("zod").inferFormattedError<Schema, string>>>>;
|
|
1908
|
-
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | undefined>>;
|
|
1942
|
+
status: import("vue").Ref<import("vue").DeepReadonly<"invalid" | "valid" | "submitting" | "updated" | "unknown" | undefined>>;
|
|
1909
1943
|
invalid: import("vue").Ref<import("vue").DeepReadonly<boolean>>;
|
|
1910
1944
|
}) => any;
|
|
1911
1945
|
};
|
|
@@ -1916,4 +1950,8 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1916
1950
|
errors: import("vue").Ref<import("zod").inferFormattedError<Schema, string> | undefined>;
|
|
1917
1951
|
status: import("vue").Ref<import("./enums").FormStatus | undefined>;
|
|
1918
1952
|
formData: import("vue").Ref<Partial<import("zod").TypeOf<Schema> | undefined>>;
|
|
1953
|
+
validate: (value?: Partial<import("zod").TypeOf<Schema> | undefined>) => Promise<boolean>;
|
|
1954
|
+
submit: () => Promise<boolean>;
|
|
1955
|
+
ignoreUpdates: import("@vueuse/shared").IgnoredUpdater;
|
|
1956
|
+
stopUpdatesWatch: import("vue").WatchStopHandle;
|
|
1919
1957
|
};
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Component, DeepReadonly, Ref, WatchStopHandle } from 'vue';
|
|
2
2
|
import type { z, AnyZodObject, ZodEffects, inferFormattedError } from 'zod';
|
|
3
|
+
import type { IgnoredUpdater } from '@vueuse/core';
|
|
3
4
|
import type { FormFieldType, FormStatus } from './enums';
|
|
4
5
|
export type FormSchema = AnyZodObject | ZodEffects<AnyZodObject> | ZodEffects<ZodEffects<AnyZodObject>>;
|
|
5
6
|
export type FormFieldComponentOptions = {
|
|
@@ -25,6 +26,8 @@ export type InjectedFormData<Schema extends FormSchema> = {
|
|
|
25
26
|
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema>> | undefined>>;
|
|
26
27
|
submit: () => Promise<boolean>;
|
|
27
28
|
validate: () => Promise<boolean>;
|
|
29
|
+
ignoreUpdates: IgnoredUpdater;
|
|
30
|
+
stopUpdatesWatch: WatchStopHandle;
|
|
28
31
|
status: Readonly<Ref<FormStatus | undefined>>;
|
|
29
32
|
invalid: Readonly<Ref<boolean>>;
|
|
30
33
|
};
|
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.2",
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">= 16.x"
|
|
25
25
|
},
|
|
@@ -36,34 +36,34 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@volverjs/ui-vue": "next",
|
|
39
|
-
"@vueuse/core": "^10.
|
|
39
|
+
"@vueuse/core": "^10.5.0",
|
|
40
40
|
"ts-dot-prop": "^2.1.3",
|
|
41
|
-
"vue": "^3.3.
|
|
42
|
-
"zod": "^3.22.
|
|
41
|
+
"vue": "^3.3.6",
|
|
42
|
+
"zod": "^3.22.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@playwright/experimental-ct-vue": "1.
|
|
45
|
+
"@playwright/experimental-ct-vue": "1.39.0",
|
|
46
46
|
"@testing-library/vue": "^7.0.0",
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
48
|
-
"@vitejs/plugin-vue": "^4.
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^6.8.0",
|
|
48
|
+
"@vitejs/plugin-vue": "^4.4.0",
|
|
49
49
|
"@volverjs/style": "^0.1.11",
|
|
50
|
-
"@vue/compiler-sfc": "^3.3.
|
|
50
|
+
"@vue/compiler-sfc": "^3.3.6",
|
|
51
51
|
"@vue/eslint-config-typescript": "^12.0.0",
|
|
52
|
-
"@vue/runtime-core": "^3.3.
|
|
52
|
+
"@vue/runtime-core": "^3.3.6",
|
|
53
53
|
"@vue/test-utils": "^2.4.1",
|
|
54
54
|
"copy": "^0.3.2",
|
|
55
|
-
"eslint": "^8.
|
|
55
|
+
"eslint": "^8.52.0",
|
|
56
56
|
"eslint-config-prettier": "^9.0.0",
|
|
57
|
-
"eslint-plugin-prettier": "^5.0.
|
|
57
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
58
58
|
"eslint-plugin-vue": "^9.17.0",
|
|
59
|
-
"happy-dom": "^12.
|
|
59
|
+
"happy-dom": "^12.9.1",
|
|
60
60
|
"prettier": "^3.0.3",
|
|
61
61
|
"typescript": "^5.2.2",
|
|
62
|
-
"vite": "^4.
|
|
62
|
+
"vite": "^4.5.0",
|
|
63
63
|
"vite-plugin-dts": "^3.6.0",
|
|
64
64
|
"vite-plugin-eslint": "^1.8.1",
|
|
65
65
|
"vite-plugin-externalize-deps": "^0.7.0",
|
|
66
|
-
"vitest": "^0.34.
|
|
66
|
+
"vitest": "^0.34.6"
|
|
67
67
|
},
|
|
68
68
|
"typesVersions": {
|
|
69
69
|
"*": {
|