@volverjs/form-vue 0.0.9 → 0.0.10-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/VvForm.d.ts CHANGED
@@ -1,39 +1,167 @@
1
- import { type InjectionKey } from 'vue';
2
- import type { AnyZodObject, ZodEffects } from 'zod';
3
- import type { InjectedFormData } from './types';
4
- export declare enum FormStatus {
5
- invalid = "invalid",
6
- valid = "valid"
7
- }
8
- export declare const defineForm: (schema: AnyZodObject | ZodEffects<AnyZodObject>, provideKey: InjectionKey<InjectedFormData>, options?: {
9
- updateThrottle?: number;
10
- continuosValidation?: boolean;
11
- }) => import("vue").DefineComponent<{
12
- modelValue: {
13
- type: ObjectConstructor;
14
- default: () => {};
15
- };
16
- continuosValidation: {
17
- type: BooleanConstructor;
18
- default: boolean;
19
- };
20
- }, {
21
- submit: () => boolean;
22
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("valid" | "invalid" | "submit" | "update:modelValue")[], "valid" | "invalid" | "submit" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
- modelValue: {
24
- type: ObjectConstructor;
25
- default: () => {};
26
- };
27
- continuosValidation: {
28
- type: BooleanConstructor;
29
- default: boolean;
30
- };
31
- }>> & {
32
- onValid?: ((...args: any[]) => any) | undefined;
33
- onInvalid?: ((...args: any[]) => any) | undefined;
34
- onSubmit?: ((...args: any[]) => any) | undefined;
35
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
36
- }, {
37
- modelValue: Record<string, any>;
38
- continuosValidation: boolean;
39
- }>;
1
+ import { type InjectionKey, type DeepReadonly, type Ref } from 'vue';
2
+ import type { z, TypeOf } from 'zod';
3
+ import type { FormComponentOptions, FormSchema, InjectedFormData } from './types';
4
+ import { FormStatus } from './enums';
5
+ export declare const defineForm: <Schema extends FormSchema>(schema: Schema, provideKey: InjectionKey<InjectedFormData<Schema>>, options?: FormComponentOptions) => {
6
+ errors: Ref<z.ZodFormattedError<z.TypeOf<Schema>> | undefined>;
7
+ status: Ref<FormStatus | undefined>;
8
+ formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
9
+ /**
10
+ * An hack to add types to the default slot
11
+ */
12
+ VvForm: {
13
+ new (...args: any[]): {
14
+ $: import("vue").ComponentInternalInstance;
15
+ $data: {};
16
+ $props: Partial<{
17
+ modelValue: Record<string, any>;
18
+ updateThrottle: number;
19
+ continuosValidation: boolean;
20
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<{
21
+ modelValue: {
22
+ type: ObjectConstructor;
23
+ default: () => {};
24
+ };
25
+ updateThrottle: {
26
+ type: NumberConstructor;
27
+ default: number;
28
+ };
29
+ continuosValidation: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ }>> & {
34
+ onInvalid?: ((...args: any[]) => any) | undefined;
35
+ onValid?: ((...args: any[]) => any) | undefined;
36
+ onSubmit?: ((...args: any[]) => any) | undefined;
37
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
38
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "modelValue" | "updateThrottle" | "continuosValidation">;
39
+ $attrs: {
40
+ [x: string]: unknown;
41
+ };
42
+ $refs: {
43
+ [x: string]: unknown;
44
+ };
45
+ $slots: Readonly<{
46
+ [name: string]: import("vue").Slot | undefined;
47
+ }>;
48
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
49
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
50
+ $emit: (event: "invalid" | "valid" | "submit" | "update:modelValue", ...args: any[]) => void;
51
+ $el: any;
52
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
53
+ modelValue: {
54
+ type: ObjectConstructor;
55
+ default: () => {};
56
+ };
57
+ updateThrottle: {
58
+ type: NumberConstructor;
59
+ default: number;
60
+ };
61
+ continuosValidation: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ };
65
+ }>> & {
66
+ onInvalid?: ((...args: any[]) => any) | undefined;
67
+ onValid?: ((...args: any[]) => any) | undefined;
68
+ onSubmit?: ((...args: any[]) => any) | undefined;
69
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
70
+ }, {
71
+ formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
72
+ submit: () => boolean;
73
+ errors: Readonly<Ref<DeepReadonly<z.ZodFormattedError<z.TypeOf<Schema>>> | undefined>>;
74
+ status: Readonly<Ref<FormStatus | undefined>>;
75
+ invalid: import("vue").ComputedRef<boolean>;
76
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "submit" | "update:modelValue")[], string, {
77
+ modelValue: Record<string, any>;
78
+ updateThrottle: number;
79
+ continuosValidation: boolean;
80
+ }, {}, string> & {
81
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
82
+ created?: ((() => void) | (() => void)[]) | undefined;
83
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
84
+ mounted?: ((() => void) | (() => void)[]) | undefined;
85
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
86
+ updated?: ((() => void) | (() => void)[]) | undefined;
87
+ activated?: ((() => void) | (() => void)[]) | undefined;
88
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
89
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
90
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
91
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
92
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
93
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
94
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
95
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
96
+ };
97
+ $forceUpdate: () => void;
98
+ $nextTick: typeof import("vue").nextTick;
99
+ $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;
100
+ } & Readonly<import("vue").ExtractPropTypes<{
101
+ modelValue: {
102
+ type: ObjectConstructor;
103
+ default: () => {};
104
+ };
105
+ updateThrottle: {
106
+ type: NumberConstructor;
107
+ default: number;
108
+ };
109
+ continuosValidation: {
110
+ type: BooleanConstructor;
111
+ default: boolean;
112
+ };
113
+ }>> & {
114
+ onInvalid?: ((...args: any[]) => any) | undefined;
115
+ onValid?: ((...args: any[]) => any) | undefined;
116
+ onSubmit?: ((...args: any[]) => any) | undefined;
117
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
118
+ } & import("vue").ShallowUnwrapRef<{
119
+ formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
120
+ submit: () => boolean;
121
+ errors: Readonly<Ref<DeepReadonly<z.ZodFormattedError<z.TypeOf<Schema>>> | undefined>>;
122
+ status: Readonly<Ref<FormStatus | undefined>>;
123
+ invalid: import("vue").ComputedRef<boolean>;
124
+ }> & {} & import("vue").ComponentCustomProperties & {};
125
+ __isFragment?: undefined;
126
+ __isTeleport?: undefined;
127
+ __isSuspense?: undefined;
128
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
129
+ modelValue: {
130
+ type: ObjectConstructor;
131
+ default: () => {};
132
+ };
133
+ updateThrottle: {
134
+ type: NumberConstructor;
135
+ default: number;
136
+ };
137
+ continuosValidation: {
138
+ type: BooleanConstructor;
139
+ default: boolean;
140
+ };
141
+ }>> & {
142
+ onInvalid?: ((...args: any[]) => any) | undefined;
143
+ onValid?: ((...args: any[]) => any) | undefined;
144
+ onSubmit?: ((...args: any[]) => any) | undefined;
145
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
146
+ }, {
147
+ formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
148
+ submit: () => boolean;
149
+ errors: Readonly<Ref<DeepReadonly<z.ZodFormattedError<z.TypeOf<Schema>>> | undefined>>;
150
+ status: Readonly<Ref<FormStatus | undefined>>;
151
+ invalid: import("vue").ComputedRef<boolean>;
152
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "submit" | "update:modelValue")[], "invalid" | "valid" | "submit" | "update:modelValue", {
153
+ modelValue: Record<string, any>;
154
+ updateThrottle: number;
155
+ continuosValidation: boolean;
156
+ }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
157
+ $slots: {
158
+ default: (_: {
159
+ formData: unknown extends Partial<z.TypeOf<Schema>> | undefined ? undefined : Partial<z.TypeOf<Schema>> | undefined;
160
+ submit: () => boolean;
161
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>>>>;
162
+ status: Ref<DeepReadonly<`${FormStatus}` | undefined>>;
163
+ invalid: Ref<DeepReadonly<boolean>>;
164
+ }) => any;
165
+ };
166
+ });
167
+ };
@@ -1,3 +1,92 @@
1
- import { type Component, type InjectionKey } from 'vue';
2
- import type { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormComposableOptions } from './types';
3
- export declare const defineFormField: (formProvideKey: InjectionKey<InjectedFormData>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData>, formFieldInjectionKey: InjectionKey<InjectedFormFieldData>, options?: FormComposableOptions) => Component;
1
+ import { type Component, type InjectionKey, type PropType, type Ref, type ConcreteComponent } from 'vue';
2
+ import type { z } from 'zod';
3
+ import { FormFieldType } from './enums';
4
+ import type { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormFieldComponentOptions, Path, FormSchema } from './types';
5
+ export declare const defineFormField: <Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>, formFieldInjectionKey: InjectionKey<InjectedFormFieldData<Schema>>, options?: FormFieldComponentOptions) => import("vue").DefineComponent<{
6
+ type: {
7
+ type: PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
8
+ validator: (value: FormFieldType) => boolean;
9
+ default: FormFieldType;
10
+ };
11
+ is: {
12
+ type: PropType<Component>;
13
+ default: undefined;
14
+ };
15
+ name: {
16
+ type: PropType<Path<z.TypeOf<Schema>>>;
17
+ required: true;
18
+ };
19
+ props: {
20
+ type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.TypeOf<Schema>> | undefined) | undefined>>;
21
+ default: () => {};
22
+ };
23
+ showValid: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ defaultValue: {
28
+ type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor | ArrayConstructor)[];
29
+ default: undefined;
30
+ };
31
+ lazyLoad: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ }, {
36
+ component: import("vue").ComputedRef<{
37
+ new (...args: any[]): any;
38
+ __isFragment?: undefined;
39
+ __isTeleport?: undefined;
40
+ __isSuspense?: undefined;
41
+ } | ConcreteComponent>;
42
+ hasProps: import("vue").ComputedRef<any>;
43
+ invalid: import("vue").ComputedRef<boolean>;
44
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "update:formData")[], "invalid" | "valid" | "update:modelValue" | "update:formData", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
45
+ type: {
46
+ type: PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
47
+ validator: (value: FormFieldType) => boolean;
48
+ default: FormFieldType;
49
+ };
50
+ is: {
51
+ type: PropType<Component>;
52
+ default: undefined;
53
+ };
54
+ name: {
55
+ type: PropType<Path<z.TypeOf<Schema>>>;
56
+ required: true;
57
+ };
58
+ props: {
59
+ type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.TypeOf<Schema>> | undefined) | undefined>>;
60
+ default: () => {};
61
+ };
62
+ showValid: {
63
+ type: BooleanConstructor;
64
+ default: boolean;
65
+ };
66
+ defaultValue: {
67
+ type: (ObjectConstructor | NumberConstructor | BooleanConstructor | StringConstructor | ArrayConstructor)[];
68
+ default: undefined;
69
+ };
70
+ lazyLoad: {
71
+ type: BooleanConstructor;
72
+ default: boolean;
73
+ };
74
+ }>> & {
75
+ onInvalid?: ((...args: any[]) => any) | undefined;
76
+ onValid?: ((...args: any[]) => any) | undefined;
77
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
78
+ "onUpdate:formData"?: ((...args: any[]) => any) | undefined;
79
+ }, {
80
+ type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetimeLocal" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
81
+ props: [{
82
+ type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.TypeOf<Schema>> | undefined) | undefined>>;
83
+ default: () => {};
84
+ }] extends [import("vue").Prop<infer V, infer D>] ? unknown extends V ? import("@vue/shared").IfAny<V, V, D> : V : {
85
+ type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.TypeOf<Schema>> | undefined) | undefined>>;
86
+ default: () => {};
87
+ };
88
+ is: Component;
89
+ showValid: boolean;
90
+ defaultValue: string | number | boolean | unknown[] | Record<string, any>;
91
+ lazyLoad: boolean;
92
+ }>;
@@ -0,0 +1,20 @@
1
+ import { type Component, type InjectionKey, type DeepReadonly, type Ref } from 'vue';
2
+ import type { TypeOf, z } from 'zod';
3
+ import type { FormSchema, InjectedFormData } from './types';
4
+ import type { FormStatus } from './enums';
5
+ export declare const defineFormTemplate: <Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, VvFormField: Component) => (import("vue").ComponentOptions<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, any, any, any> | {
6
+ new (...args: any[]): any;
7
+ __isFragment?: undefined;
8
+ __isTeleport?: undefined;
9
+ __isSuspense?: undefined;
10
+ }) & (new () => {
11
+ $slots: {
12
+ default: (_: {
13
+ formData: unknown extends Partial<TypeOf<Schema>> | undefined ? undefined : Partial<TypeOf<Schema>> | undefined;
14
+ submit: () => boolean;
15
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>>>>;
16
+ status: Ref<DeepReadonly<`${FormStatus}` | undefined>>;
17
+ invalid: Ref<DeepReadonly<boolean>>;
18
+ }) => any;
19
+ };
20
+ });
@@ -1,6 +1,105 @@
1
- import { type InjectionKey, type Ref } from 'vue';
2
- import type { InjectedFormData, InjectedFormWrapperData } from './types';
3
- export declare const defineFormWrapper: (formProvideKey: InjectionKey<InjectedFormData>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData>) => import("vue").DefineComponent<{
1
+ import { type InjectionKey, type Ref, type DeepReadonly } from 'vue';
2
+ import type { TypeOf, z } from 'zod';
3
+ import type { FormSchema, InjectedFormData, InjectedFormWrapperData } from './types';
4
+ export declare const defineFormWrapper: <Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>) => {
5
+ new (...args: any[]): {
6
+ $: import("vue").ComponentInternalInstance;
7
+ $data: {};
8
+ $props: Partial<{
9
+ tag: string;
10
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<{
11
+ name: {
12
+ type: StringConstructor;
13
+ required: true;
14
+ };
15
+ tag: {
16
+ type: StringConstructor;
17
+ default: undefined;
18
+ };
19
+ }>> & {
20
+ onInvalid?: ((...args: any[]) => any) | undefined;
21
+ onValid?: ((...args: any[]) => any) | undefined;
22
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "tag">;
23
+ $attrs: {
24
+ [x: string]: unknown;
25
+ };
26
+ $refs: {
27
+ [x: string]: unknown;
28
+ };
29
+ $slots: Readonly<{
30
+ [name: string]: import("vue").Slot | undefined;
31
+ }>;
32
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
33
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
34
+ $emit: (event: "invalid" | "valid", ...args: any[]) => void;
35
+ $el: any;
36
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
37
+ name: {
38
+ type: StringConstructor;
39
+ required: true;
40
+ };
41
+ tag: {
42
+ type: StringConstructor;
43
+ default: undefined;
44
+ };
45
+ }>> & {
46
+ onInvalid?: ((...args: any[]) => any) | undefined;
47
+ onValid?: ((...args: any[]) => any) | undefined;
48
+ }, {
49
+ formData: Ref<Partial<TypeOf<Schema>> | undefined> | undefined;
50
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema_1, string>>>> | undefined;
51
+ invalid: import("vue").ComputedRef<boolean>;
52
+ fields: Ref<Set<string>>;
53
+ fieldsErrors: Ref<Map<string, Record<string, {
54
+ _errors: string[];
55
+ }>>>;
56
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid")[], string, {
57
+ tag: string;
58
+ }, {}, string> & {
59
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
60
+ created?: ((() => void) | (() => void)[]) | undefined;
61
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
62
+ mounted?: ((() => void) | (() => void)[]) | undefined;
63
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
64
+ updated?: ((() => void) | (() => void)[]) | undefined;
65
+ activated?: ((() => void) | (() => void)[]) | undefined;
66
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
67
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
68
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
69
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
70
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
71
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
72
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
73
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
74
+ };
75
+ $forceUpdate: () => void;
76
+ $nextTick: typeof import("vue").nextTick;
77
+ $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;
78
+ } & Readonly<import("vue").ExtractPropTypes<{
79
+ name: {
80
+ type: StringConstructor;
81
+ required: true;
82
+ };
83
+ tag: {
84
+ type: StringConstructor;
85
+ default: undefined;
86
+ };
87
+ }>> & {
88
+ onInvalid?: ((...args: any[]) => any) | undefined;
89
+ onValid?: ((...args: any[]) => any) | undefined;
90
+ } & import("vue").ShallowUnwrapRef<{
91
+ formData: Ref<Partial<TypeOf<Schema>> | undefined> | undefined;
92
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema_1, string>>>> | undefined;
93
+ invalid: import("vue").ComputedRef<boolean>;
94
+ fields: Ref<Set<string>>;
95
+ fieldsErrors: Ref<Map<string, Record<string, {
96
+ _errors: string[];
97
+ }>>>;
98
+ }> & {} & import("vue").ComponentCustomProperties & {};
99
+ __isFragment?: undefined;
100
+ __isTeleport?: undefined;
101
+ __isSuspense?: undefined;
102
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
4
103
  name: {
5
104
  type: StringConstructor;
6
105
  required: true;
@@ -9,25 +108,28 @@ export declare const defineFormWrapper: (formProvideKey: InjectionKey<InjectedFo
9
108
  type: StringConstructor;
10
109
  default: undefined;
11
110
  };
111
+ }>> & {
112
+ onInvalid?: ((...args: any[]) => any) | undefined;
113
+ onValid?: ((...args: any[]) => any) | undefined;
12
114
  }, {
13
- formProvided: InjectedFormData | undefined;
115
+ formData: Ref<Partial<TypeOf<Schema>> | undefined> | undefined;
116
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema_1, string>>>> | undefined;
14
117
  invalid: import("vue").ComputedRef<boolean>;
15
118
  fields: Ref<Set<string>>;
16
- errors: Ref<Map<string, Record<string, {
119
+ fieldsErrors: Ref<Map<string, Record<string, {
17
120
  _errors: string[];
18
121
  }>>>;
19
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("valid" | "invalid")[], "valid" | "invalid", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
20
- name: {
21
- type: StringConstructor;
22
- required: true;
23
- };
24
- tag: {
25
- type: StringConstructor;
26
- default: undefined;
27
- };
28
- }>> & {
29
- onValid?: ((...args: any[]) => any) | undefined;
30
- onInvalid?: ((...args: any[]) => any) | undefined;
31
- }, {
122
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", {
32
123
  tag: string;
33
- }>;
124
+ }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
125
+ $slots: {
126
+ default: (_: {
127
+ invalid: boolean;
128
+ formData: unknown extends Partial<TypeOf<Schema>> | undefined ? undefined : Partial<TypeOf<Schema>> | undefined;
129
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>>>>;
130
+ fieldsErrors: Map<string, Record<string, {
131
+ _errors: string[];
132
+ }>>;
133
+ }) => any;
134
+ };
135
+ });
package/dist/enums.d.ts CHANGED
@@ -21,3 +21,7 @@ export declare enum FormFieldType {
21
21
  combobox = "combobox",
22
22
  custom = "custom"
23
23
  }
24
+ export declare enum FormStatus {
25
+ invalid = "invalid",
26
+ valid = "valid"
27
+ }