@volverjs/form-vue 0.0.14 → 1.0.0-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/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/VvForm.d.ts +203 -0
- package/dist/{src/VvFormField.d.ts → VvFormField.d.ts} +20 -9
- package/dist/VvFormTemplate.d.ts +83 -0
- package/dist/VvFormWrapper.d.ts +108 -0
- package/dist/{src/enums.d.ts → enums.d.ts} +4 -1
- package/dist/index.d.ts +1565 -1
- package/dist/index.es.js +447 -356
- package/dist/index.umd.js +1 -1
- package/dist/{src/types.d.ts → types.d.ts} +22 -17
- package/dist/utils.d.ts +4 -0
- package/package.json +28 -28
- package/src/VvForm.ts +162 -73
- package/src/VvFormField.ts +15 -1
- package/src/VvFormTemplate.ts +21 -9
- package/src/VvFormWrapper.ts +3 -3
- package/src/enums.ts +3 -0
- package/src/index.ts +18 -6
- package/src/types.ts +56 -33
- package/src/utils.ts +5 -3
- package/dist/src/VvForm.d.ts +0 -216
- package/dist/src/VvFormTemplate.d.ts +0 -131
- package/dist/src/VvFormWrapper.d.ts +0 -172
- package/dist/src/index.d.ts +0 -1919
- package/dist/src/utils.d.ts +0 -3
- package/dist/test-playwright/VvForm.spec.d.ts +0 -1
- package/dist/test-playwright/VvFormField.spec.d.ts +0 -1
- package/dist/test-playwright/VvFormWrapper.spec.d.ts +0 -1
- package/dist/test-vitest/defaultObjectBySchema.test.d.ts +0 -1
- package/dist/test-vitest/useForm.test.d.ts +0 -1
package/src/VvFormTemplate.ts
CHANGED
|
@@ -20,11 +20,16 @@ export const defineFormTemplate = <Schema extends FormSchema>(
|
|
|
20
20
|
VvFormField: Component,
|
|
21
21
|
) => {
|
|
22
22
|
const VvFormTemplate = defineComponent({
|
|
23
|
+
name: 'VvFormTemplate',
|
|
23
24
|
props: {
|
|
24
25
|
schema: {
|
|
25
26
|
type: [Array, Function] as PropType<FormTemplate<Schema>>,
|
|
26
27
|
required: true,
|
|
27
28
|
},
|
|
29
|
+
scope: {
|
|
30
|
+
type: Object as PropType<Record<string, unknown>>,
|
|
31
|
+
default: () => ({}),
|
|
32
|
+
},
|
|
28
33
|
},
|
|
29
34
|
setup(templateProps, { slots: templateSlots }) {
|
|
30
35
|
const injectedFormData = inject(formProvideKey)
|
|
@@ -32,7 +37,10 @@ export const defineFormTemplate = <Schema extends FormSchema>(
|
|
|
32
37
|
return () => {
|
|
33
38
|
const normalizedSchema =
|
|
34
39
|
typeof templateProps.schema === 'function'
|
|
35
|
-
? templateProps.schema(
|
|
40
|
+
? templateProps.schema(
|
|
41
|
+
injectedFormData,
|
|
42
|
+
templateProps.scope,
|
|
43
|
+
)
|
|
36
44
|
: templateProps.schema
|
|
37
45
|
let lastIf: boolean | undefined = undefined
|
|
38
46
|
const toReturn = normalizedSchema.reduce<
|
|
@@ -40,7 +48,7 @@ export const defineFormTemplate = <Schema extends FormSchema>(
|
|
|
40
48
|
>((acc, field) => {
|
|
41
49
|
const normalizedField =
|
|
42
50
|
typeof field === 'function'
|
|
43
|
-
? field(injectedFormData)
|
|
51
|
+
? field(injectedFormData, templateProps.scope)
|
|
44
52
|
: field
|
|
45
53
|
const {
|
|
46
54
|
vvIs,
|
|
@@ -97,9 +105,13 @@ export const defineFormTemplate = <Schema extends FormSchema>(
|
|
|
97
105
|
}
|
|
98
106
|
// children
|
|
99
107
|
const hChildren = vvChildren
|
|
100
|
-
?
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
? {
|
|
109
|
+
default: (scope: Record<string, unknown>) =>
|
|
110
|
+
h(VvFormTemplate, {
|
|
111
|
+
schema: vvChildren,
|
|
112
|
+
scope,
|
|
113
|
+
}),
|
|
114
|
+
}
|
|
103
115
|
: undefined
|
|
104
116
|
// render
|
|
105
117
|
if (vvName) {
|
|
@@ -129,8 +141,8 @@ export const defineFormTemplate = <Schema extends FormSchema>(
|
|
|
129
141
|
)
|
|
130
142
|
return acc
|
|
131
143
|
}
|
|
132
|
-
if (
|
|
133
|
-
acc.push(hChildren)
|
|
144
|
+
if (hChildren) {
|
|
145
|
+
acc.push(hChildren.default(templateProps.scope))
|
|
134
146
|
return acc
|
|
135
147
|
}
|
|
136
148
|
return acc
|
|
@@ -162,8 +174,8 @@ export const defineFormTemplate = <Schema extends FormSchema>(
|
|
|
162
174
|
| undefined
|
|
163
175
|
? undefined
|
|
164
176
|
: Partial<TypeOf<Schema>> | undefined
|
|
165
|
-
submit: () => boolean
|
|
166
|
-
validate: () => boolean
|
|
177
|
+
submit: () => Promise<boolean>
|
|
178
|
+
validate: () => Promise<boolean>
|
|
167
179
|
errors: Readonly<
|
|
168
180
|
Ref<DeepReadonly<z.inferFormattedError<Schema>>>
|
|
169
181
|
>
|
package/src/VvFormWrapper.ts
CHANGED
|
@@ -24,7 +24,7 @@ export const defineFormWrapper = <Schema extends FormSchema>(
|
|
|
24
24
|
wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>,
|
|
25
25
|
) => {
|
|
26
26
|
const VvFormWrapper = defineComponent({
|
|
27
|
-
name: '
|
|
27
|
+
name: 'VvFormWrapper',
|
|
28
28
|
props: {
|
|
29
29
|
name: {
|
|
30
30
|
type: String,
|
|
@@ -149,8 +149,8 @@ export const defineFormWrapper = <Schema extends FormSchema>(
|
|
|
149
149
|
| undefined
|
|
150
150
|
? undefined
|
|
151
151
|
: Partial<TypeOf<Schema>> | undefined
|
|
152
|
-
submit: () => boolean
|
|
153
|
-
validate: () => boolean
|
|
152
|
+
submit: () => Promise<boolean>
|
|
153
|
+
validate: () => Promise<boolean>
|
|
154
154
|
errors: Readonly<
|
|
155
155
|
Ref<DeepReadonly<z.inferFormattedError<Schema>>>
|
|
156
156
|
>
|
package/src/enums.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -48,12 +48,18 @@ const _formFactory = <Schema extends FormSchema>(
|
|
|
48
48
|
options,
|
|
49
49
|
)
|
|
50
50
|
const VvFormTemplate = defineFormTemplate(formInjectionKey, VvFormField)
|
|
51
|
-
const {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
const {
|
|
52
|
+
VvForm,
|
|
53
|
+
errors,
|
|
54
|
+
status,
|
|
55
|
+
invalid,
|
|
56
|
+
readonly,
|
|
57
|
+
formData,
|
|
58
|
+
validate,
|
|
59
|
+
submit,
|
|
60
|
+
ignoreUpdates,
|
|
61
|
+
stopUpdatesWatch,
|
|
62
|
+
} = defineForm(schema, formInjectionKey, options, VvFormTemplate)
|
|
57
63
|
|
|
58
64
|
return {
|
|
59
65
|
VvForm,
|
|
@@ -65,7 +71,13 @@ const _formFactory = <Schema extends FormSchema>(
|
|
|
65
71
|
formFieldInjectionKey,
|
|
66
72
|
errors,
|
|
67
73
|
status,
|
|
74
|
+
invalid,
|
|
75
|
+
readonly,
|
|
68
76
|
formData,
|
|
77
|
+
validate,
|
|
78
|
+
submit,
|
|
79
|
+
ignoreUpdates,
|
|
80
|
+
stopUpdatesWatch,
|
|
69
81
|
}
|
|
70
82
|
}
|
|
71
83
|
|
package/src/types.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { z
|
|
1
|
+
import type { Component, DeepReadonly, Ref, WatchStopHandle } from 'vue'
|
|
2
|
+
import type { z } from 'zod'
|
|
3
|
+
import type { IgnoredUpdater } from '@vueuse/core'
|
|
3
4
|
import type { FormFieldType, FormStatus } from './enums'
|
|
4
5
|
|
|
5
6
|
export type FormSchema =
|
|
6
|
-
| AnyZodObject
|
|
7
|
-
| ZodEffects<AnyZodObject>
|
|
8
|
-
| ZodEffects<ZodEffects<AnyZodObject>>
|
|
7
|
+
| z.AnyZodObject
|
|
8
|
+
| z.ZodEffects<z.AnyZodObject>
|
|
9
|
+
| z.ZodEffects<z.ZodEffects<z.AnyZodObject>>
|
|
9
10
|
|
|
10
11
|
export type FormFieldComponentOptions = {
|
|
11
12
|
lazyLoad?: boolean
|
|
@@ -15,18 +16,19 @@ export type FormFieldComponentOptions = {
|
|
|
15
16
|
export type FormComponentOptions<Schema> = {
|
|
16
17
|
updateThrottle?: number
|
|
17
18
|
continuosValidation?: boolean
|
|
19
|
+
readonly?: boolean
|
|
18
20
|
template?: Schema extends FormSchema ? FormTemplate<Schema> : never
|
|
19
21
|
onUpdate?: Schema extends FormSchema
|
|
20
|
-
? (data
|
|
22
|
+
? (data?: Partial<z.infer<Schema>>) => void
|
|
21
23
|
: never
|
|
22
24
|
onSubmit?: Schema extends FormSchema
|
|
23
|
-
? (data
|
|
25
|
+
? (data?: z.infer<Schema>) => void
|
|
24
26
|
: never
|
|
25
27
|
onInvalid?: Schema extends FormSchema
|
|
26
|
-
? (error
|
|
28
|
+
? (error?: z.inferFormattedError<Schema>) => void
|
|
27
29
|
: never
|
|
28
30
|
onValid?: Schema extends FormSchema
|
|
29
|
-
? (data
|
|
31
|
+
? (data?: z.infer<Schema>) => void
|
|
30
32
|
: never
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -45,16 +47,19 @@ export type InjectedFormData<Schema extends FormSchema> = {
|
|
|
45
47
|
errors: Readonly<
|
|
46
48
|
Ref<DeepReadonly<z.inferFormattedError<Schema>> | undefined>
|
|
47
49
|
>
|
|
48
|
-
submit: () => boolean
|
|
49
|
-
validate: () => boolean
|
|
50
|
+
submit: () => Promise<boolean>
|
|
51
|
+
validate: () => Promise<boolean>
|
|
52
|
+
ignoreUpdates: IgnoredUpdater
|
|
53
|
+
stopUpdatesWatch: WatchStopHandle
|
|
50
54
|
status: Readonly<Ref<FormStatus | undefined>>
|
|
51
55
|
invalid: Readonly<Ref<boolean>>
|
|
56
|
+
readonly: Ref<boolean>
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
export type InjectedFormWrapperData<Schema extends FormSchema> = {
|
|
55
60
|
name: Ref<string>
|
|
56
61
|
fields: Ref<Set<string>>
|
|
57
|
-
errors: Ref<Map<string, z.inferFormattedError<Schema
|
|
62
|
+
errors: Ref<Map<string, z.inferFormattedError<Schema>>>
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
export type InjectedFormFieldData<Schema extends FormSchema> = {
|
|
@@ -71,8 +76,6 @@ export type Primitive =
|
|
|
71
76
|
| symbol
|
|
72
77
|
| bigint
|
|
73
78
|
|
|
74
|
-
type ArrayKey = number
|
|
75
|
-
|
|
76
79
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
77
80
|
type IsTuple<T extends readonly any[]> = number extends T['length']
|
|
78
81
|
? false
|
|
@@ -90,11 +93,11 @@ export type Path<T> = T extends readonly (infer V)[]
|
|
|
90
93
|
? IsTuple<T> extends true
|
|
91
94
|
? {
|
|
92
95
|
[K in TupleKeys<T>]-?: PathConcat<K & string, T[K]>
|
|
93
|
-
|
|
94
|
-
: PathConcat<
|
|
96
|
+
}[TupleKeys<T>]
|
|
97
|
+
: PathConcat<number, V>
|
|
95
98
|
: {
|
|
96
99
|
[K in keyof T]-?: PathConcat<K & string, T[K]>
|
|
97
|
-
|
|
100
|
+
}[keyof T]
|
|
98
101
|
|
|
99
102
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
103
|
export type PathValue<T, TPath extends Path<T> | Path<T>[]> = T extends any
|
|
@@ -105,18 +108,18 @@ export type PathValue<T, TPath extends Path<T> | Path<T>[]> = T extends any
|
|
|
105
108
|
? PathValue<T[K], R> | undefined
|
|
106
109
|
: PathValue<T[K], R>
|
|
107
110
|
: never
|
|
108
|
-
: K extends `${
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
: K extends `${number}`
|
|
112
|
+
? T extends readonly (infer V)[]
|
|
113
|
+
? PathValue<V, R & Path<V>>
|
|
114
|
+
: never
|
|
111
115
|
: never
|
|
112
|
-
: never
|
|
113
116
|
: TPath extends keyof T
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
? T[TPath]
|
|
118
|
+
: TPath extends `${number}`
|
|
119
|
+
? T extends readonly (infer V)[]
|
|
120
|
+
? V
|
|
121
|
+
: never
|
|
122
|
+
: never
|
|
120
123
|
: never
|
|
121
124
|
|
|
122
125
|
export type AnyBoolean<Schema extends FormSchema> =
|
|
@@ -133,10 +136,24 @@ export type SimpleFormTemplateItem<Schema extends FormSchema> = Record<
|
|
|
133
136
|
vvName?: Path<z.infer<Schema>>
|
|
134
137
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
138
|
vvSlots?: Record<string, any>
|
|
136
|
-
vvChildren?:
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
vvChildren?:
|
|
140
|
+
| Array<
|
|
141
|
+
| SimpleFormTemplateItem<Schema>
|
|
142
|
+
| ((
|
|
143
|
+
data?: InjectedFormData<Schema>,
|
|
144
|
+
scope?: Record<string, unknown>,
|
|
145
|
+
) => SimpleFormTemplateItem<Schema>)
|
|
146
|
+
>
|
|
147
|
+
| ((
|
|
148
|
+
data?: InjectedFormData<Schema>,
|
|
149
|
+
scope?: Record<string, unknown>,
|
|
150
|
+
) => Array<
|
|
151
|
+
| SimpleFormTemplateItem<Schema>
|
|
152
|
+
| ((
|
|
153
|
+
data?: InjectedFormData<Schema>,
|
|
154
|
+
scope?: Record<string, unknown>,
|
|
155
|
+
) => SimpleFormTemplateItem<Schema>)
|
|
156
|
+
>)
|
|
140
157
|
vvIf?: AnyBoolean<Schema> | Path<z.infer<Schema>>
|
|
141
158
|
vvElseIf?: AnyBoolean<Schema> | Path<z.infer<Schema>>
|
|
142
159
|
vvType?: `${FormFieldType}`
|
|
@@ -148,8 +165,14 @@ export type SimpleFormTemplateItem<Schema extends FormSchema> = Record<
|
|
|
148
165
|
|
|
149
166
|
export type FormTemplateItem<Schema extends FormSchema> =
|
|
150
167
|
| SimpleFormTemplateItem<Schema>
|
|
151
|
-
| ((
|
|
168
|
+
| ((
|
|
169
|
+
data?: InjectedFormData<Schema>,
|
|
170
|
+
scope?: Record<string, unknown>,
|
|
171
|
+
) => SimpleFormTemplateItem<Schema>)
|
|
152
172
|
|
|
153
173
|
export type FormTemplate<Schema extends FormSchema> =
|
|
154
174
|
| FormTemplateItem<Schema>[]
|
|
155
|
-
| ((
|
|
175
|
+
| ((
|
|
176
|
+
data?: InjectedFormData<Schema>,
|
|
177
|
+
scope?: Record<string, unknown>,
|
|
178
|
+
) => FormTemplateItem<Schema>[])
|
package/src/utils.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type { FormSchema } from './types'
|
|
|
14
14
|
|
|
15
15
|
export const defaultObjectBySchema = <Schema extends FormSchema>(
|
|
16
16
|
schema: Schema,
|
|
17
|
-
original: Partial<z.infer<Schema>> = {},
|
|
17
|
+
original: Partial<z.infer<Schema>> & Record<string, unknown> = {},
|
|
18
18
|
): Partial<z.infer<Schema>> => {
|
|
19
19
|
const getInnerType = <Type extends ZodTypeAny>(
|
|
20
20
|
schema:
|
|
@@ -74,9 +74,11 @@ export const defaultObjectBySchema = <Schema extends FormSchema>(
|
|
|
74
74
|
originalValue.map((element: unknown) =>
|
|
75
75
|
defaultObjectBySchema(
|
|
76
76
|
arrayType,
|
|
77
|
-
element && typeof element === 'object'
|
|
77
|
+
(element && typeof element === 'object'
|
|
78
78
|
? element
|
|
79
|
-
: undefined
|
|
79
|
+
: undefined) as Partial<
|
|
80
|
+
typeof arrayType
|
|
81
|
+
>,
|
|
80
82
|
),
|
|
81
83
|
) ?? defaultValue,
|
|
82
84
|
]
|
package/dist/src/VvForm.d.ts
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { type Component, type InjectionKey, type DeepReadonly, type Ref, type PropType } from 'vue';
|
|
2
|
-
import type { z, TypeOf } from 'zod';
|
|
3
|
-
import type { FormComponentOptions, FormSchema, FormTemplate, InjectedFormData } from './types';
|
|
4
|
-
import { FormStatus } from './enums';
|
|
5
|
-
export declare const defineForm: <Schema extends FormSchema>(schema: Schema, provideKey: InjectionKey<InjectedFormData<Schema>>, options?: FormComponentOptions<Schema> | undefined, VvFormTemplate?: Component) => {
|
|
6
|
-
errors: Ref<z.inferFormattedError<Schema, string> | 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: {
|
|
17
|
-
template?: FormTemplate<Schema> | undefined;
|
|
18
|
-
modelValue?: Record<string, any> | undefined;
|
|
19
|
-
updateThrottle?: number | undefined;
|
|
20
|
-
continuosValidation?: boolean | undefined;
|
|
21
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
22
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
23
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
key?: string | number | symbol | undefined;
|
|
25
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
26
|
-
ref?: import("vue").VNodeRef | undefined;
|
|
27
|
-
ref_for?: boolean | undefined;
|
|
28
|
-
ref_key?: string | undefined;
|
|
29
|
-
onVnodeBeforeMount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
}>) => void)[] | undefined;
|
|
34
|
-
onVnodeMounted?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
35
|
-
[key: string]: any;
|
|
36
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
37
|
-
[key: string]: any;
|
|
38
|
-
}>) => void)[] | undefined;
|
|
39
|
-
onVnodeBeforeUpdate?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
}>) => void)[] | undefined;
|
|
48
|
-
onVnodeUpdated?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
51
|
-
[key: string]: any;
|
|
52
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
53
|
-
[key: string]: any;
|
|
54
|
-
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
55
|
-
[key: string]: any;
|
|
56
|
-
}>) => void)[] | undefined;
|
|
57
|
-
onVnodeBeforeUnmount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
60
|
-
[key: string]: any;
|
|
61
|
-
}>) => void)[] | undefined;
|
|
62
|
-
onVnodeUnmounted?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
63
|
-
[key: string]: any;
|
|
64
|
-
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
65
|
-
[key: string]: any;
|
|
66
|
-
}>) => void)[] | undefined;
|
|
67
|
-
class?: unknown;
|
|
68
|
-
style?: unknown;
|
|
69
|
-
};
|
|
70
|
-
$attrs: {
|
|
71
|
-
[x: string]: unknown;
|
|
72
|
-
};
|
|
73
|
-
$refs: {
|
|
74
|
-
[x: string]: unknown;
|
|
75
|
-
};
|
|
76
|
-
$slots: Readonly<{
|
|
77
|
-
[name: string]: import("vue").Slot<any> | undefined;
|
|
78
|
-
}>;
|
|
79
|
-
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
80
|
-
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
81
|
-
$emit: (event: "invalid" | "valid" | "update:modelValue" | "submit", ...args: any[]) => void;
|
|
82
|
-
$el: any;
|
|
83
|
-
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
84
|
-
modelValue: {
|
|
85
|
-
type: ObjectConstructor;
|
|
86
|
-
default: () => {};
|
|
87
|
-
};
|
|
88
|
-
updateThrottle: {
|
|
89
|
-
type: NumberConstructor;
|
|
90
|
-
default: number;
|
|
91
|
-
};
|
|
92
|
-
continuosValidation: {
|
|
93
|
-
type: BooleanConstructor;
|
|
94
|
-
default: boolean;
|
|
95
|
-
};
|
|
96
|
-
template: {
|
|
97
|
-
type: PropType<FormTemplate<Schema>>;
|
|
98
|
-
default: undefined;
|
|
99
|
-
};
|
|
100
|
-
}>> & {
|
|
101
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
102
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
103
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
104
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
105
|
-
}, {
|
|
106
|
-
formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
|
|
107
|
-
submit: () => boolean;
|
|
108
|
-
validate: (value?: Partial<z.TypeOf<Schema> | undefined>) => boolean;
|
|
109
|
-
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>>;
|
|
110
|
-
status: Readonly<Ref<FormStatus | undefined>>;
|
|
111
|
-
invalid: import("vue").ComputedRef<boolean>;
|
|
112
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit")[], string, {
|
|
113
|
-
template: FormTemplate<Schema>;
|
|
114
|
-
modelValue: Record<string, any>;
|
|
115
|
-
updateThrottle: number;
|
|
116
|
-
continuosValidation: boolean;
|
|
117
|
-
}, {}, string, {}> & {
|
|
118
|
-
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
119
|
-
created?: ((() => void) | (() => void)[]) | undefined;
|
|
120
|
-
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
121
|
-
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
122
|
-
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
123
|
-
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
124
|
-
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
125
|
-
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
126
|
-
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
127
|
-
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
128
|
-
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
129
|
-
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
130
|
-
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
131
|
-
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
132
|
-
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;
|
|
133
|
-
};
|
|
134
|
-
$forceUpdate: () => void;
|
|
135
|
-
$nextTick: typeof import("vue").nextTick;
|
|
136
|
-
$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;
|
|
137
|
-
} & Readonly<import("vue").ExtractPropTypes<{
|
|
138
|
-
modelValue: {
|
|
139
|
-
type: ObjectConstructor;
|
|
140
|
-
default: () => {};
|
|
141
|
-
};
|
|
142
|
-
updateThrottle: {
|
|
143
|
-
type: NumberConstructor;
|
|
144
|
-
default: number;
|
|
145
|
-
};
|
|
146
|
-
continuosValidation: {
|
|
147
|
-
type: BooleanConstructor;
|
|
148
|
-
default: boolean;
|
|
149
|
-
};
|
|
150
|
-
template: {
|
|
151
|
-
type: PropType<FormTemplate<Schema>>;
|
|
152
|
-
default: undefined;
|
|
153
|
-
};
|
|
154
|
-
}>> & {
|
|
155
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
156
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
157
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
158
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
159
|
-
} & import("vue").ShallowUnwrapRef<{
|
|
160
|
-
formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
|
|
161
|
-
submit: () => boolean;
|
|
162
|
-
validate: (value?: Partial<z.TypeOf<Schema> | undefined>) => boolean;
|
|
163
|
-
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>>;
|
|
164
|
-
status: Readonly<Ref<FormStatus | undefined>>;
|
|
165
|
-
invalid: import("vue").ComputedRef<boolean>;
|
|
166
|
-
}> & {} & import("vue").ComponentCustomProperties & {};
|
|
167
|
-
__isFragment?: undefined;
|
|
168
|
-
__isTeleport?: undefined;
|
|
169
|
-
__isSuspense?: undefined;
|
|
170
|
-
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
171
|
-
modelValue: {
|
|
172
|
-
type: ObjectConstructor;
|
|
173
|
-
default: () => {};
|
|
174
|
-
};
|
|
175
|
-
updateThrottle: {
|
|
176
|
-
type: NumberConstructor;
|
|
177
|
-
default: number;
|
|
178
|
-
};
|
|
179
|
-
continuosValidation: {
|
|
180
|
-
type: BooleanConstructor;
|
|
181
|
-
default: boolean;
|
|
182
|
-
};
|
|
183
|
-
template: {
|
|
184
|
-
type: PropType<FormTemplate<Schema>>;
|
|
185
|
-
default: undefined;
|
|
186
|
-
};
|
|
187
|
-
}>> & {
|
|
188
|
-
onInvalid?: ((...args: any[]) => any) | undefined;
|
|
189
|
-
onValid?: ((...args: any[]) => any) | undefined;
|
|
190
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
191
|
-
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
192
|
-
}, {
|
|
193
|
-
formData: Ref<Partial<z.TypeOf<Schema> | undefined>>;
|
|
194
|
-
submit: () => boolean;
|
|
195
|
-
validate: (value?: Partial<z.TypeOf<Schema> | undefined>) => boolean;
|
|
196
|
-
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>> | undefined>>;
|
|
197
|
-
status: Readonly<Ref<FormStatus | undefined>>;
|
|
198
|
-
invalid: import("vue").ComputedRef<boolean>;
|
|
199
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("invalid" | "valid" | "update:modelValue" | "submit")[], "invalid" | "valid" | "update:modelValue" | "submit", {
|
|
200
|
-
template: FormTemplate<Schema>;
|
|
201
|
-
modelValue: Record<string, any>;
|
|
202
|
-
updateThrottle: number;
|
|
203
|
-
continuosValidation: boolean;
|
|
204
|
-
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
205
|
-
$slots: {
|
|
206
|
-
default: (_: {
|
|
207
|
-
formData: unknown extends Partial<z.TypeOf<Schema>> | undefined ? undefined : Partial<z.TypeOf<Schema>> | undefined;
|
|
208
|
-
submit: () => boolean;
|
|
209
|
-
validate: () => boolean;
|
|
210
|
-
errors: Readonly<Ref<DeepReadonly<z.inferFormattedError<Schema, string>>>>;
|
|
211
|
-
status: Ref<DeepReadonly<`${FormStatus}` | undefined>>;
|
|
212
|
-
invalid: Ref<DeepReadonly<boolean>>;
|
|
213
|
-
}) => any;
|
|
214
|
-
};
|
|
215
|
-
});
|
|
216
|
-
};
|