@volverjs/form-vue 1.0.0-beta.10 → 1.0.0-beta.12
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/README.md +4 -4
- package/dist/VvForm.d.ts +15 -15
- package/dist/VvFormField.d.ts +6 -6
- package/dist/VvFormTemplate.d.ts +11 -11
- package/dist/VvFormWrapper.d.ts +8 -8
- package/dist/index.d.ts +332 -332
- package/dist/index.es.js +54 -52
- package/dist/index.umd.js +1 -1
- package/dist/types.d.ts +5 -2
- package/package.json +4 -4
- package/src/VvForm.ts +3 -3
- package/src/VvFormTemplate.ts +18 -5
- package/src/types.ts +4 -2
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ const form = createForm({
|
|
|
56
56
|
schema
|
|
57
57
|
// lazyLoad: boolean - default false
|
|
58
58
|
// updateThrottle: number - default 500
|
|
59
|
-
//
|
|
59
|
+
// continuousValidation: boolean - default false
|
|
60
60
|
// sideEffects?: (data: any) => void
|
|
61
61
|
})
|
|
62
62
|
|
|
@@ -118,7 +118,7 @@ Use the `v-model` directive (or only `:model-value` to set the initial value of
|
|
|
118
118
|
The form data two way binding is **throttled** by default (500ms) to avoid performance issues. The throttle can be changed with the `updateThrottle` option or prop.
|
|
119
119
|
|
|
120
120
|
By default form validation **stops** when a **valid state** is reached.
|
|
121
|
-
To activate **
|
|
121
|
+
To activate **continuous validation** use the `continuousValidation` option or prop.
|
|
122
122
|
|
|
123
123
|
```vue
|
|
124
124
|
<script lang="ts" setup>
|
|
@@ -131,7 +131,7 @@ To activate **continuos validation** use the `continuosValidation` option or pro
|
|
|
131
131
|
</script>
|
|
132
132
|
|
|
133
133
|
<template>
|
|
134
|
-
<VvForm v-model="formData" :update-throttle="1000"
|
|
134
|
+
<VvForm v-model="formData" :update-throttle="1000" continuous-validation>
|
|
135
135
|
<!-- ... -->
|
|
136
136
|
</VvForm>
|
|
137
137
|
</template>
|
|
@@ -155,7 +155,7 @@ The **default settings** are **inherited** from the plugin (if it's installed).
|
|
|
155
155
|
const { VvForm, VvFormWrapper, VvFormField } = useForm(schema, {
|
|
156
156
|
// lazyLoad: boolean - default false
|
|
157
157
|
// updateThrottle: number - default 500
|
|
158
|
-
//
|
|
158
|
+
// continuousValidation: boolean - default false
|
|
159
159
|
// sideEffects?: (formData: any) => void
|
|
160
160
|
})
|
|
161
161
|
</script>
|
package/dist/VvForm.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export declare const defineForm: <Schema extends FormSchema>(schema: Schema, pro
|
|
|
18
18
|
* An hack to add types to the default slot
|
|
19
19
|
*/
|
|
20
20
|
VvForm: {
|
|
21
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import(
|
|
22
|
-
|
|
21
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
22
|
+
continuousValidation: {
|
|
23
23
|
type: BooleanConstructor;
|
|
24
24
|
default: boolean;
|
|
25
25
|
};
|
|
@@ -53,10 +53,10 @@ export declare const defineForm: <Schema extends FormSchema>(schema: Schema, pro
|
|
|
53
53
|
stopUpdatesWatch: WatchStopHandle;
|
|
54
54
|
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>>;
|
|
55
55
|
status: Readonly<Ref<FormStatus | undefined>>;
|
|
56
|
-
invalid: import(
|
|
56
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
57
57
|
isReadonly: Ref<boolean>;
|
|
58
|
-
}, unknown, {}, {}, import(
|
|
59
|
-
|
|
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
60
|
type: BooleanConstructor;
|
|
61
61
|
default: boolean;
|
|
62
62
|
};
|
|
@@ -86,7 +86,7 @@ export declare const defineForm: <Schema extends FormSchema>(schema: Schema, pro
|
|
|
86
86
|
readonly: boolean;
|
|
87
87
|
template: FormTemplate<Schema>;
|
|
88
88
|
modelValue: Record<string, any>;
|
|
89
|
-
|
|
89
|
+
continuousValidation: boolean;
|
|
90
90
|
tag: string;
|
|
91
91
|
}, true, {}, {}, {
|
|
92
92
|
P: {};
|
|
@@ -95,8 +95,8 @@ export declare const defineForm: <Schema extends FormSchema>(schema: Schema, pro
|
|
|
95
95
|
C: {};
|
|
96
96
|
M: {};
|
|
97
97
|
Defaults: {};
|
|
98
|
-
}, Readonly<import(
|
|
99
|
-
|
|
98
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
99
|
+
continuousValidation: {
|
|
100
100
|
type: BooleanConstructor;
|
|
101
101
|
default: boolean;
|
|
102
102
|
};
|
|
@@ -130,20 +130,20 @@ export declare const defineForm: <Schema extends FormSchema>(schema: Schema, pro
|
|
|
130
130
|
stopUpdatesWatch: WatchStopHandle;
|
|
131
131
|
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>>;
|
|
132
132
|
status: Readonly<Ref<FormStatus | undefined>>;
|
|
133
|
-
invalid: import(
|
|
133
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
134
134
|
isReadonly: Ref<boolean>;
|
|
135
135
|
}, {}, {}, {}, {
|
|
136
136
|
readonly: boolean;
|
|
137
137
|
template: FormTemplate<Schema>;
|
|
138
138
|
modelValue: Record<string, any>;
|
|
139
|
-
|
|
139
|
+
continuousValidation: boolean;
|
|
140
140
|
tag: string;
|
|
141
141
|
}>;
|
|
142
142
|
__isFragment?: undefined;
|
|
143
143
|
__isTeleport?: undefined;
|
|
144
144
|
__isSuspense?: undefined;
|
|
145
|
-
} & import('vue').ComponentOptionsBase<Readonly<import(
|
|
146
|
-
|
|
145
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
146
|
+
continuousValidation: {
|
|
147
147
|
type: BooleanConstructor;
|
|
148
148
|
default: boolean;
|
|
149
149
|
};
|
|
@@ -177,13 +177,13 @@ export declare const defineForm: <Schema extends FormSchema>(schema: Schema, pro
|
|
|
177
177
|
stopUpdatesWatch: WatchStopHandle;
|
|
178
178
|
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>>;
|
|
179
179
|
status: Readonly<Ref<FormStatus | undefined>>;
|
|
180
|
-
invalid: import(
|
|
180
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
181
181
|
isReadonly: Ref<boolean>;
|
|
182
|
-
}, unknown, {}, {}, import(
|
|
182
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly")[], "invalid" | "valid" | "update:modelValue" | "submit" | "update:readonly", {
|
|
183
183
|
readonly: boolean;
|
|
184
184
|
template: FormTemplate<Schema>;
|
|
185
185
|
modelValue: Record<string, any>;
|
|
186
|
-
|
|
186
|
+
continuousValidation: boolean;
|
|
187
187
|
tag: string;
|
|
188
188
|
}, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
189
189
|
$slots: {
|
package/dist/VvFormField.d.ts
CHANGED
|
@@ -38,17 +38,17 @@ export declare const defineFormField: <Schema extends FormSchema>(formProvideKey
|
|
|
38
38
|
default: undefined;
|
|
39
39
|
};
|
|
40
40
|
}, {
|
|
41
|
-
component: import(
|
|
41
|
+
component: import('vue').ComputedRef<{
|
|
42
42
|
new (...args: any[]): any;
|
|
43
43
|
__isFragment?: undefined;
|
|
44
44
|
__isTeleport?: undefined;
|
|
45
45
|
__isSuspense?: undefined;
|
|
46
46
|
} | ConcreteComponent>;
|
|
47
|
-
hasProps: import(
|
|
47
|
+
hasProps: import('vue').ComputedRef<{
|
|
48
48
|
name: {} | ([{
|
|
49
49
|
type: PropType<Path<z.TypeOf<Schema>>>;
|
|
50
50
|
required: true;
|
|
51
|
-
}] extends [import(
|
|
51
|
+
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? import('@vue/shared').IfAny<V, V, D> : V : {
|
|
52
52
|
type: PropType<Path<z.TypeOf<Schema>>>;
|
|
53
53
|
required: true;
|
|
54
54
|
});
|
|
@@ -60,8 +60,8 @@ export declare const defineFormField: <Schema extends FormSchema>(formProvideKey
|
|
|
60
60
|
readonly: {} | undefined;
|
|
61
61
|
'onUpdate:modelValue': (value: unknown) => void;
|
|
62
62
|
}>;
|
|
63
|
-
invalid: import(
|
|
64
|
-
}, unknown, {}, {}, import(
|
|
63
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
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
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">;
|
|
67
67
|
validator: (value: FormFieldType) => boolean;
|
|
@@ -105,7 +105,7 @@ export declare const defineFormField: <Schema extends FormSchema>(formProvideKey
|
|
|
105
105
|
props: [{
|
|
106
106
|
type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined) | undefined>>;
|
|
107
107
|
default: () => {};
|
|
108
|
-
}] extends [import(
|
|
108
|
+
}] extends [import('vue').Prop<infer V, infer D>] ? unknown extends V ? import('@vue/shared').IfAny<V, V, D> : V : {
|
|
109
109
|
type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined) | undefined>>;
|
|
110
110
|
default: () => {};
|
|
111
111
|
};
|
package/dist/VvFormTemplate.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { TypeOf, z } from 'zod';
|
|
|
4
4
|
import { Component, PropType, InjectionKey, DeepReadonly, Ref, VNode } from 'vue';
|
|
5
5
|
|
|
6
6
|
export declare const defineFormTemplate: <Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, VvFormField: Component) => {
|
|
7
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import(
|
|
7
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
8
8
|
schema: {
|
|
9
9
|
type: PropType<FormTemplate<Schema>>;
|
|
10
10
|
required: true;
|
|
@@ -13,11 +13,11 @@ export declare const defineFormTemplate: <Schema extends FormSchema>(formProvide
|
|
|
13
13
|
type: PropType<Record<string, unknown>>;
|
|
14
14
|
default: () => {};
|
|
15
15
|
};
|
|
16
|
-
}>>, (() => (VNode<import(
|
|
16
|
+
}>>, (() => (VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
17
17
|
[key: string]: any;
|
|
18
|
-
}> | VNode<import(
|
|
18
|
+
}> | VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
19
19
|
[key: string]: any;
|
|
20
|
-
}>[] | undefined)[]) | undefined, unknown, {}, {}, import(
|
|
20
|
+
}>[] | undefined)[]) | undefined, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
21
21
|
schema: {
|
|
22
22
|
type: PropType<FormTemplate<Schema>>;
|
|
23
23
|
required: true;
|
|
@@ -35,7 +35,7 @@ export declare const defineFormTemplate: <Schema extends FormSchema>(formProvide
|
|
|
35
35
|
C: {};
|
|
36
36
|
M: {};
|
|
37
37
|
Defaults: {};
|
|
38
|
-
}, Readonly<import(
|
|
38
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
39
39
|
schema: {
|
|
40
40
|
type: PropType<FormTemplate<Schema>>;
|
|
41
41
|
required: true;
|
|
@@ -44,9 +44,9 @@ export declare const defineFormTemplate: <Schema extends FormSchema>(formProvide
|
|
|
44
44
|
type: PropType<Record<string, unknown>>;
|
|
45
45
|
default: () => {};
|
|
46
46
|
};
|
|
47
|
-
}>>, {} | (() => (VNode<import(
|
|
47
|
+
}>>, {} | (() => (VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
48
48
|
[key: string]: any;
|
|
49
|
-
}> | VNode<import(
|
|
49
|
+
}> | VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
50
50
|
[key: string]: any;
|
|
51
51
|
}>[] | undefined)[]), {}, {}, {}, {
|
|
52
52
|
scope: Record<string, unknown>;
|
|
@@ -54,7 +54,7 @@ export declare const defineFormTemplate: <Schema extends FormSchema>(formProvide
|
|
|
54
54
|
__isFragment?: undefined;
|
|
55
55
|
__isTeleport?: undefined;
|
|
56
56
|
__isSuspense?: undefined;
|
|
57
|
-
} & import('vue').ComponentOptionsBase<Readonly<import(
|
|
57
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
58
58
|
schema: {
|
|
59
59
|
type: PropType<FormTemplate<Schema>>;
|
|
60
60
|
required: true;
|
|
@@ -63,11 +63,11 @@ export declare const defineFormTemplate: <Schema extends FormSchema>(formProvide
|
|
|
63
63
|
type: PropType<Record<string, unknown>>;
|
|
64
64
|
default: () => {};
|
|
65
65
|
};
|
|
66
|
-
}>>, (() => (VNode<import(
|
|
66
|
+
}>>, (() => (VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
67
67
|
[key: string]: any;
|
|
68
|
-
}> | VNode<import(
|
|
68
|
+
}> | VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
69
69
|
[key: string]: any;
|
|
70
|
-
}>[] | undefined)[]) | undefined, unknown, {}, {}, import(
|
|
70
|
+
}>[] | undefined)[]) | undefined, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
71
71
|
scope: Record<string, unknown>;
|
|
72
72
|
}, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
73
73
|
$slots: {
|
package/dist/VvFormWrapper.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TypeOf, z } from 'zod';
|
|
|
3
3
|
import { InjectionKey, Ref, DeepReadonly } from 'vue';
|
|
4
4
|
|
|
5
5
|
export declare const defineFormWrapper: <Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>) => {
|
|
6
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import(
|
|
6
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
7
7
|
name: {
|
|
8
8
|
type: StringConstructor;
|
|
9
9
|
required: true;
|
|
@@ -20,10 +20,10 @@ export declare const defineFormWrapper: <Schema extends FormSchema>(formProvideK
|
|
|
20
20
|
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
21
21
|
submit: (() => Promise<boolean>) | undefined;
|
|
22
22
|
validate: (() => Promise<boolean>) | undefined;
|
|
23
|
-
invalid: import(
|
|
23
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
24
24
|
fields: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
25
25
|
fieldsErrors: Ref<Map<string, z.inferFormattedError<Schema, string>>>;
|
|
26
|
-
}, unknown, {}, {}, import(
|
|
26
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
27
27
|
name: {
|
|
28
28
|
type: StringConstructor;
|
|
29
29
|
required: true;
|
|
@@ -44,7 +44,7 @@ export declare const defineFormWrapper: <Schema extends FormSchema>(formProvideK
|
|
|
44
44
|
C: {};
|
|
45
45
|
M: {};
|
|
46
46
|
Defaults: {};
|
|
47
|
-
}, Readonly<import(
|
|
47
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
48
48
|
name: {
|
|
49
49
|
type: StringConstructor;
|
|
50
50
|
required: true;
|
|
@@ -61,7 +61,7 @@ export declare const defineFormWrapper: <Schema extends FormSchema>(formProvideK
|
|
|
61
61
|
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
62
62
|
submit: (() => Promise<boolean>) | undefined;
|
|
63
63
|
validate: (() => Promise<boolean>) | undefined;
|
|
64
|
-
invalid: import(
|
|
64
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
65
65
|
fields: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
66
66
|
fieldsErrors: Ref<Map<string, z.inferFormattedError<Schema, string>>>;
|
|
67
67
|
}, {}, {}, {}, {
|
|
@@ -70,7 +70,7 @@ export declare const defineFormWrapper: <Schema extends FormSchema>(formProvideK
|
|
|
70
70
|
__isFragment?: undefined;
|
|
71
71
|
__isTeleport?: undefined;
|
|
72
72
|
__isSuspense?: undefined;
|
|
73
|
-
} & import('vue').ComponentOptionsBase<Readonly<import(
|
|
73
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
74
74
|
name: {
|
|
75
75
|
type: StringConstructor;
|
|
76
76
|
required: true;
|
|
@@ -87,10 +87,10 @@ export declare const defineFormWrapper: <Schema extends FormSchema>(formProvideK
|
|
|
87
87
|
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>> | undefined;
|
|
88
88
|
submit: (() => Promise<boolean>) | undefined;
|
|
89
89
|
validate: (() => Promise<boolean>) | undefined;
|
|
90
|
-
invalid: import(
|
|
90
|
+
invalid: import('vue').ComputedRef<boolean>;
|
|
91
91
|
fields: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>>;
|
|
92
92
|
fieldsErrors: Ref<Map<string, z.inferFormattedError<Schema, string>>>;
|
|
93
|
-
}, unknown, {}, {}, import(
|
|
93
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", {
|
|
94
94
|
tag: string;
|
|
95
95
|
}, {}, string, {}> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
96
96
|
$slots: {
|