@volverjs/form-vue 1.0.0-beta.14 → 1.0.0-beta.16

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
@@ -17,132 +17,7 @@ export declare function defineForm<Schema extends FormSchema>(schema: Schema, pr
17
17
  /**
18
18
  * An hack to add types to the default slot
19
19
  */
20
- VvForm: {
21
- new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
22
- continuousValidation: {
23
- type: BooleanConstructor;
24
- default: boolean;
25
- };
26
- modelValue: {
27
- type: ObjectConstructor;
28
- default: () => {};
29
- };
30
- readonly: {
31
- type: BooleanConstructor;
32
- default: boolean;
33
- };
34
- tag: {
35
- type: StringConstructor;
36
- default: string;
37
- };
38
- template: {
39
- type: PropType<FormTemplate<Schema>>;
40
- default: undefined;
41
- };
42
- }>> & {
43
- onInvalid?: ((...args: any[]) => any) | undefined;
44
- onValid?: ((...args: any[]) => any) | undefined;
45
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
46
- onSubmit?: ((...args: any[]) => any) | undefined;
47
- "onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
48
- }, {
49
- formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
50
- submit: () => Promise<boolean>;
51
- validate: (value?: Partial<z.TypeOf<Schema> | undefined>) => Promise<boolean>;
52
- ignoreUpdates: IgnoredUpdater;
53
- stopUpdatesWatch: WatchStopHandle;
54
- errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>>;
55
- status: Readonly<Ref<FormStatus | undefined>>;
56
- invalid: import('vue').ComputedRef<boolean>;
57
- isReadonly: Ref<boolean>;
58
- }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
59
- continuousValidation: {
60
- type: BooleanConstructor;
61
- default: boolean;
62
- };
63
- modelValue: {
64
- type: ObjectConstructor;
65
- default: () => {};
66
- };
67
- readonly: {
68
- type: BooleanConstructor;
69
- default: boolean;
70
- };
71
- tag: {
72
- type: StringConstructor;
73
- default: string;
74
- };
75
- template: {
76
- type: PropType<FormTemplate<Schema>>;
77
- default: undefined;
78
- };
79
- }>> & {
80
- onInvalid?: ((...args: any[]) => any) | undefined;
81
- onValid?: ((...args: any[]) => any) | undefined;
82
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
83
- onSubmit?: ((...args: any[]) => any) | undefined;
84
- "onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
85
- }, {
86
- readonly: boolean;
87
- template: FormTemplate<Schema>;
88
- modelValue: Record<string, any>;
89
- continuousValidation: boolean;
90
- tag: string;
91
- }, true, {}, {}, {
92
- P: {};
93
- B: {};
94
- D: {};
95
- C: {};
96
- M: {};
97
- Defaults: {};
98
- }, Readonly<import('vue').ExtractPropTypes<{
99
- continuousValidation: {
100
- type: BooleanConstructor;
101
- default: boolean;
102
- };
103
- modelValue: {
104
- type: ObjectConstructor;
105
- default: () => {};
106
- };
107
- readonly: {
108
- type: BooleanConstructor;
109
- default: boolean;
110
- };
111
- tag: {
112
- type: StringConstructor;
113
- default: string;
114
- };
115
- template: {
116
- type: PropType<FormTemplate<Schema>>;
117
- default: undefined;
118
- };
119
- }>> & {
120
- onInvalid?: ((...args: any[]) => any) | undefined;
121
- onValid?: ((...args: any[]) => any) | undefined;
122
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
123
- onSubmit?: ((...args: any[]) => any) | undefined;
124
- "onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
125
- }, {
126
- formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
127
- submit: () => Promise<boolean>;
128
- validate: (value?: Partial<z.TypeOf<Schema> | undefined>) => Promise<boolean>;
129
- ignoreUpdates: IgnoredUpdater;
130
- stopUpdatesWatch: WatchStopHandle;
131
- errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>>;
132
- status: Readonly<Ref<FormStatus | undefined>>;
133
- invalid: import('vue').ComputedRef<boolean>;
134
- isReadonly: Ref<boolean>;
135
- }, {}, {}, {}, {
136
- readonly: boolean;
137
- template: FormTemplate<Schema>;
138
- modelValue: Record<string, any>;
139
- continuousValidation: boolean;
140
- tag: string;
141
- }>;
142
- __isFragment?: undefined;
143
- __isTeleport?: undefined;
144
- __isSuspense?: undefined;
145
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
20
+ VvForm: import('vue').DefineComponent<{
146
21
  continuousValidation: {
147
22
  type: BooleanConstructor;
148
23
  default: boolean;
@@ -163,12 +38,6 @@ export declare function defineForm<Schema extends FormSchema>(schema: Schema, pr
163
38
  type: PropType<FormTemplate<Schema>>;
164
39
  default: undefined;
165
40
  };
166
- }>> & {
167
- onInvalid?: ((...args: any[]) => any) | undefined;
168
- onValid?: ((...args: any[]) => any) | undefined;
169
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
170
- onSubmit?: ((...args: any[]) => any) | undefined;
171
- "onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
172
41
  }, {
173
42
  formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
174
43
  submit: () => Promise<boolean>;
@@ -179,25 +48,54 @@ export declare function defineForm<Schema extends FormSchema>(schema: Schema, pr
179
48
  status: Readonly<Ref<FormStatus | undefined>>;
180
49
  invalid: import('vue').ComputedRef<boolean>;
181
50
  isReadonly: Ref<boolean>;
182
- }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", {
51
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
52
+ continuousValidation: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ modelValue: {
57
+ type: ObjectConstructor;
58
+ default: () => {};
59
+ };
60
+ readonly: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ tag: {
65
+ type: StringConstructor;
66
+ default: string;
67
+ };
68
+ template: {
69
+ type: PropType<FormTemplate<Schema>>;
70
+ default: undefined;
71
+ };
72
+ }>> & {
73
+ onInvalid?: ((...args: any[]) => any) | undefined;
74
+ onValid?: ((...args: any[]) => any) | undefined;
75
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
76
+ onSubmit?: ((...args: any[]) => any) | undefined;
77
+ "onUpdate:readonly"?: ((...args: any[]) => any) | undefined;
78
+ }, {
183
79
  readonly: boolean;
184
80
  template: FormTemplate<Schema>;
185
81
  modelValue: Record<string, any>;
186
82
  continuousValidation: boolean;
187
83
  tag: string;
188
- }, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
189
- $slots: {
190
- default: (_: {
191
- formData: unknown extends Partial<z.TypeOf<Schema>> | undefined ? undefined : Partial<z.TypeOf<Schema>> | undefined;
192
- submit: () => Promise<boolean>;
193
- validate: () => Promise<boolean>;
194
- ignoreUpdates: IgnoredUpdater;
195
- stopUpdatesWatch: WatchStopHandle;
196
- errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema>>>>;
197
- status: Ref<DeepReadonly<`${FormStatus}` | undefined>>;
198
- invalid: Ref<DeepReadonly<boolean>>;
199
- readonly: Ref<boolean>;
200
- }) => any;
84
+ }, {}> & {
85
+ new (): {
86
+ $slots: {
87
+ default: (_: {
88
+ formData: unknown extends Partial<z.TypeOf<Schema>> | undefined ? undefined : Partial<z.TypeOf<Schema>> | undefined;
89
+ submit: () => Promise<boolean>;
90
+ validate: () => Promise<boolean>;
91
+ ignoreUpdates: IgnoredUpdater;
92
+ stopUpdatesWatch: WatchStopHandle;
93
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema>>>>;
94
+ status: Ref<DeepReadonly<`${FormStatus}` | undefined>>;
95
+ invalid: Ref<DeepReadonly<boolean>>;
96
+ readonly: Ref<boolean>;
97
+ }) => any;
98
+ };
201
99
  };
202
- });
100
+ };
203
101
  };
@@ -5,20 +5,20 @@ import { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormF
5
5
 
6
6
  export declare function defineFormField<Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>, formFieldInjectionKey: InjectionKey<InjectedFormFieldData<Schema>>, options?: FormFieldComponentOptions): import('vue').DefineComponent<{
7
7
  type: {
8
- type: PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
8
+ type: PropType<`${FormFieldType}`>;
9
9
  validator: (value: FormFieldType) => boolean;
10
10
  default: FormFieldType;
11
11
  };
12
12
  is: {
13
- type: PropType<string | Component>;
13
+ type: PropType<Component | string>;
14
14
  default: undefined;
15
15
  };
16
16
  name: {
17
- type: PropType<Path<z.TypeOf<Schema>>>;
17
+ type: PropType<Path<z.infer<Schema>>>;
18
18
  required: true;
19
19
  };
20
20
  props: {
21
- type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined) | undefined>>;
21
+ type: PropType<Partial<z.infer<Schema> | undefined | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined)>>;
22
22
  default: () => {};
23
23
  };
24
24
  showValid: {
@@ -40,16 +40,16 @@ export declare function defineFormField<Schema extends FormSchema>(formProvideKe
40
40
  }, {
41
41
  component: import('vue').ComputedRef<{
42
42
  new (...args: any[]): any;
43
- __isFragment?: undefined;
44
- __isTeleport?: undefined;
45
- __isSuspense?: undefined;
43
+ __isFragment?: never;
44
+ __isTeleport?: never;
45
+ __isSuspense?: never;
46
46
  } | ConcreteComponent>;
47
47
  hasProps: import('vue').ComputedRef<{
48
48
  name: {} | ([{
49
- type: PropType<Path<z.TypeOf<Schema>>>;
49
+ type: PropType<Path<z.infer<Schema>>>;
50
50
  required: true;
51
51
  }] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? import('@vue/shared').IfAny<V, V, D> : V : {
52
- type: PropType<Path<z.TypeOf<Schema>>>;
52
+ type: PropType<Path<z.infer<Schema>>>;
53
53
  required: true;
54
54
  });
55
55
  invalid: boolean;
@@ -63,20 +63,20 @@ export declare function defineFormField<Schema extends FormSchema>(formProvideKe
63
63
  invalid: import('vue').ComputedRef<boolean>;
64
64
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:formData" | "update:modelValue")[], "invalid" | "valid" | "update:formData" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
65
65
  type: {
66
- type: PropType<"number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom">;
66
+ type: PropType<`${FormFieldType}`>;
67
67
  validator: (value: FormFieldType) => boolean;
68
68
  default: FormFieldType;
69
69
  };
70
70
  is: {
71
- type: PropType<string | Component>;
71
+ type: PropType<Component | string>;
72
72
  default: undefined;
73
73
  };
74
74
  name: {
75
- type: PropType<Path<z.TypeOf<Schema>>>;
75
+ type: PropType<Path<z.infer<Schema>>>;
76
76
  required: true;
77
77
  };
78
78
  props: {
79
- type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined) | undefined>>;
79
+ type: PropType<Partial<z.infer<Schema> | undefined | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined)>>;
80
80
  default: () => {};
81
81
  };
82
82
  showValid: {
@@ -103,10 +103,10 @@ export declare function defineFormField<Schema extends FormSchema>(formProvideKe
103
103
  }, {
104
104
  type: "number" | "text" | "email" | "password" | "tel" | "url" | "search" | "date" | "time" | "datetime-local" | "month" | "week" | "color" | "select" | "checkbox" | "radio" | "textarea" | "radioGroup" | "checkboxGroup" | "combobox" | "custom";
105
105
  props: [{
106
- type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined) | undefined>>;
106
+ type: PropType<Partial<z.infer<Schema> | undefined | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined)>>;
107
107
  default: () => {};
108
108
  }] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? import('@vue/shared').IfAny<V, V, D> : V : {
109
- type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined) | undefined>>;
109
+ type: PropType<Partial<z.infer<Schema> | undefined | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined)>>;
110
110
  default: () => {};
111
111
  };
112
112
  is: string | Component;
@@ -3,58 +3,7 @@ import { TypeOf, z } from 'zod';
3
3
  import { FormSchema, InjectedFormData, FormTemplate } from './types';
4
4
  import { FormStatus } from './enums';
5
5
 
6
- export declare function defineFormTemplate<Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, VvFormField: Component): {
7
- new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
8
- schema: {
9
- type: PropType<FormTemplate<Schema>>;
10
- required: true;
11
- };
12
- scope: {
13
- type: PropType<Record<string, unknown>>;
14
- default: () => {};
15
- };
16
- }>>, (() => (VNode<import('vue').RendererNode, import('vue').RendererElement, {
17
- [key: string]: any;
18
- }> | VNode<import('vue').RendererNode, import('vue').RendererElement, {
19
- [key: string]: any;
20
- }>[] | undefined)[]) | undefined, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
21
- schema: {
22
- type: PropType<FormTemplate<Schema>>;
23
- required: true;
24
- };
25
- scope: {
26
- type: PropType<Record<string, unknown>>;
27
- default: () => {};
28
- };
29
- }>>, {
30
- scope: Record<string, unknown>;
31
- }, true, {}, {}, {
32
- P: {};
33
- B: {};
34
- D: {};
35
- C: {};
36
- M: {};
37
- Defaults: {};
38
- }, Readonly<import('vue').ExtractPropTypes<{
39
- schema: {
40
- type: PropType<FormTemplate<Schema>>;
41
- required: true;
42
- };
43
- scope: {
44
- type: PropType<Record<string, unknown>>;
45
- default: () => {};
46
- };
47
- }>>, {} | (() => (VNode<import('vue').RendererNode, import('vue').RendererElement, {
48
- [key: string]: any;
49
- }> | VNode<import('vue').RendererNode, import('vue').RendererElement, {
50
- [key: string]: any;
51
- }>[] | undefined)[]), {}, {}, {}, {
52
- scope: Record<string, unknown>;
53
- }>;
54
- __isFragment?: undefined;
55
- __isTeleport?: undefined;
56
- __isSuspense?: undefined;
57
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
6
+ export declare function defineFormTemplate<Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, VvFormField: Component): import('vue').DefineComponent<{
58
7
  schema: {
59
8
  type: PropType<FormTemplate<Schema>>;
60
9
  required: true;
@@ -63,21 +12,32 @@ export declare function defineFormTemplate<Schema extends FormSchema>(formProvid
63
12
  type: PropType<Record<string, unknown>>;
64
13
  default: () => {};
65
14
  };
66
- }>>, (() => (VNode<import('vue').RendererNode, import('vue').RendererElement, {
15
+ }, (() => (VNode<import('vue').RendererNode, import('vue').RendererElement, {
67
16
  [key: string]: any;
68
17
  }> | VNode<import('vue').RendererNode, import('vue').RendererElement, {
69
18
  [key: string]: any;
70
- }>[] | undefined)[]) | undefined, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
19
+ }>[] | undefined)[]) | undefined, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
20
+ schema: {
21
+ type: PropType<FormTemplate<Schema>>;
22
+ required: true;
23
+ };
24
+ scope: {
25
+ type: PropType<Record<string, unknown>>;
26
+ default: () => {};
27
+ };
28
+ }>>, {
71
29
  scope: Record<string, unknown>;
72
- }, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
73
- $slots: {
74
- default: (_: {
75
- formData: unknown extends Partial<TypeOf<Schema>> | undefined ? undefined : Partial<TypeOf<Schema>> | undefined;
76
- submit: () => Promise<boolean>;
77
- validate: () => Promise<boolean>;
78
- errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema>>>>;
79
- status: Ref<DeepReadonly<`${FormStatus}` | undefined>>;
80
- invalid: Ref<DeepReadonly<boolean>>;
81
- }) => any;
30
+ }, {}> & {
31
+ new (): {
32
+ $slots: {
33
+ default: (_: {
34
+ formData: unknown extends Partial<TypeOf<Schema>> | undefined ? undefined : Partial<TypeOf<Schema>> | undefined;
35
+ submit: () => Promise<boolean>;
36
+ validate: () => Promise<boolean>;
37
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema>>>>;
38
+ status: Ref<DeepReadonly<`${FormStatus}` | undefined>>;
39
+ invalid: Ref<DeepReadonly<boolean>>;
40
+ }) => any;
41
+ };
82
42
  };
83
- });
43
+ };
@@ -2,75 +2,7 @@ import { InjectionKey, Ref, DeepReadonly } from 'vue';
2
2
  import { TypeOf, z } from 'zod';
3
3
  import { FormSchema, InjectedFormData, InjectedFormWrapperData } from './types';
4
4
 
5
- export declare function defineFormWrapper<Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>): {
6
- new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
7
- name: {
8
- type: StringConstructor;
9
- required: true;
10
- };
11
- tag: {
12
- type: StringConstructor;
13
- default: undefined;
14
- };
15
- }>> & {
16
- onInvalid?: ((...args: any[]) => any) | undefined;
17
- onValid?: ((...args: any[]) => any) | undefined;
18
- }, {
19
- formData: Ref<Partial<TypeOf<Schema>> | undefined> | undefined;
20
- errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>> | undefined;
21
- submit: (() => Promise<boolean>) | undefined;
22
- validate: (() => Promise<boolean>) | undefined;
23
- invalid: import('vue').ComputedRef<boolean>;
24
- fields: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
25
- fieldsErrors: Ref<Map<string, z.inferFormattedError<Schema, string>>>;
26
- }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
27
- name: {
28
- type: StringConstructor;
29
- required: true;
30
- };
31
- tag: {
32
- type: StringConstructor;
33
- default: undefined;
34
- };
35
- }>> & {
36
- onInvalid?: ((...args: any[]) => any) | undefined;
37
- onValid?: ((...args: any[]) => any) | undefined;
38
- }, {
39
- tag: string;
40
- }, true, {}, {}, {
41
- P: {};
42
- B: {};
43
- D: {};
44
- C: {};
45
- M: {};
46
- Defaults: {};
47
- }, Readonly<import('vue').ExtractPropTypes<{
48
- name: {
49
- type: StringConstructor;
50
- required: true;
51
- };
52
- tag: {
53
- type: StringConstructor;
54
- default: undefined;
55
- };
56
- }>> & {
57
- onInvalid?: ((...args: any[]) => any) | undefined;
58
- onValid?: ((...args: any[]) => any) | undefined;
59
- }, {
60
- formData: Ref<Partial<TypeOf<Schema>> | undefined> | undefined;
61
- errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>> | undefined;
62
- submit: (() => Promise<boolean>) | undefined;
63
- validate: (() => Promise<boolean>) | undefined;
64
- invalid: import('vue').ComputedRef<boolean>;
65
- fields: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
66
- fieldsErrors: Ref<Map<string, z.inferFormattedError<Schema, string>>>;
67
- }, {}, {}, {}, {
68
- tag: string;
69
- }>;
70
- __isFragment?: undefined;
71
- __isTeleport?: undefined;
72
- __isSuspense?: undefined;
73
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
5
+ export declare function defineFormWrapper<Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>): import('vue').DefineComponent<{
74
6
  name: {
75
7
  type: StringConstructor;
76
8
  required: true;
@@ -79,9 +11,6 @@ export declare function defineFormWrapper<Schema extends FormSchema>(formProvide
79
11
  type: StringConstructor;
80
12
  default: undefined;
81
13
  };
82
- }>> & {
83
- onInvalid?: ((...args: any[]) => any) | undefined;
84
- onValid?: ((...args: any[]) => any) | undefined;
85
14
  }, {
86
15
  formData: Ref<Partial<TypeOf<Schema>> | undefined> | undefined;
87
16
  errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>> | undefined;
@@ -90,19 +19,33 @@ export declare function defineFormWrapper<Schema extends FormSchema>(formProvide
90
19
  invalid: import('vue').ComputedRef<boolean>;
91
20
  fields: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
92
21
  fieldsErrors: Ref<Map<string, z.inferFormattedError<Schema, string>>>;
93
- }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", {
22
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
23
+ name: {
24
+ type: StringConstructor;
25
+ required: true;
26
+ };
27
+ tag: {
28
+ type: StringConstructor;
29
+ default: undefined;
30
+ };
31
+ }>> & {
32
+ onInvalid?: ((...args: any[]) => any) | undefined;
33
+ onValid?: ((...args: any[]) => any) | undefined;
34
+ }, {
94
35
  tag: string;
95
- }, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
96
- $slots: {
97
- default: (_: {
98
- invalid: boolean;
99
- formData: unknown extends Partial<TypeOf<Schema>> | undefined ? undefined : Partial<TypeOf<Schema>> | undefined;
100
- submit: () => Promise<boolean>;
101
- validate: () => Promise<boolean>;
102
- errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema>>>>;
103
- fieldsErrors: Map<string, Record<string, {
104
- _errors: string[];
105
- }>>;
106
- }) => any;
36
+ }, {}> & {
37
+ new (): {
38
+ $slots: {
39
+ default: (_: {
40
+ invalid: boolean;
41
+ formData: unknown extends Partial<TypeOf<Schema>> | undefined ? undefined : Partial<TypeOf<Schema>> | undefined;
42
+ submit: () => Promise<boolean>;
43
+ validate: () => Promise<boolean>;
44
+ errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema>>>>;
45
+ fieldsErrors: Map<string, Record<string, {
46
+ _errors: string[];
47
+ }>>;
48
+ }) => any;
49
+ };
107
50
  };
108
- });
51
+ };