@volverjs/form-vue 0.0.10-beta.4 → 0.0.10-beta.6

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