@volverjs/form-vue 1.0.0-beta.12 → 1.0.0-beta.14
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 +247 -239
- package/dist/VvForm.d.ts +5 -5
- package/dist/VvFormField.d.ts +7 -7
- package/dist/VvFormTemplate.d.ts +4 -4
- package/dist/VvFormWrapper.d.ts +3 -3
- package/dist/index.d.ts +17 -17
- package/dist/index.es.js +490 -463
- package/dist/index.umd.js +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/utils.d.ts +2 -2
- package/package.json +53 -57
- package/src/VvForm.ts +287 -291
- package/src/VvFormField.ts +323 -325
- package/src/VvFormTemplate.ts +193 -188
- package/src/VvFormWrapper.ts +144 -147
- package/src/enums.ts +26 -26
- package/src/index.ts +117 -128
- package/src/types.ts +111 -117
- package/src/utils.ts +103 -97
package/dist/VvForm.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FormStatus } from './enums';
|
|
2
|
-
import { FormComponentOptions, FormSchema, FormTemplate, InjectedFormData } from './types';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { IgnoredUpdater } from '@vueuse/core';
|
|
5
1
|
import { Component, InjectionKey, DeepReadonly, Ref, PropType, WatchStopHandle } from 'vue';
|
|
2
|
+
import { IgnoredUpdater } from '@vueuse/core';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { FormComponentOptions, FormSchema, FormTemplate, InjectedFormData } from './types';
|
|
5
|
+
import { FormStatus } from './enums';
|
|
6
6
|
|
|
7
|
-
export declare
|
|
7
|
+
export declare function defineForm<Schema extends FormSchema>(schema: Schema, provideKey: InjectionKey<InjectedFormData<Schema>>, options?: FormComponentOptions<Schema>, VvFormTemplate?: Component): {
|
|
8
8
|
errors: Ref<z.inferFormattedError<Schema, string> | undefined>;
|
|
9
9
|
status: Ref<FormStatus | undefined>;
|
|
10
10
|
invalid: import('vue').ComputedRef<boolean>;
|
package/dist/VvFormField.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormFieldComponentOptions, Path, FormSchema } from './types';
|
|
2
|
-
import { FormFieldType } from './enums';
|
|
3
|
-
import { z } from 'zod';
|
|
4
1
|
import { Component, InjectionKey, PropType, Ref, ConcreteComponent } from 'vue';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { FormFieldType } from './enums';
|
|
4
|
+
import { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormFieldComponentOptions, Path, FormSchema } from './types';
|
|
5
5
|
|
|
6
|
-
export declare
|
|
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
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">;
|
|
9
9
|
validator: (value: FormFieldType) => boolean;
|
|
10
10
|
default: FormFieldType;
|
|
11
11
|
};
|
|
12
12
|
is: {
|
|
13
|
-
type: PropType<Component>;
|
|
13
|
+
type: PropType<string | Component>;
|
|
14
14
|
default: undefined;
|
|
15
15
|
};
|
|
16
16
|
name: {
|
|
@@ -68,7 +68,7 @@ export declare const defineFormField: <Schema extends FormSchema>(formProvideKey
|
|
|
68
68
|
default: FormFieldType;
|
|
69
69
|
};
|
|
70
70
|
is: {
|
|
71
|
-
type: PropType<Component>;
|
|
71
|
+
type: PropType<string | Component>;
|
|
72
72
|
default: undefined;
|
|
73
73
|
};
|
|
74
74
|
name: {
|
|
@@ -109,7 +109,7 @@ export declare const defineFormField: <Schema extends FormSchema>(formProvideKey
|
|
|
109
109
|
type: PropType<Partial<z.TypeOf<Schema> | ((formData?: Ref<ObjectConstructor>) => Partial<z.infer<Schema>> | undefined) | undefined>>;
|
|
110
110
|
default: () => {};
|
|
111
111
|
};
|
|
112
|
-
is: Component;
|
|
112
|
+
is: string | Component;
|
|
113
113
|
showValid: boolean;
|
|
114
114
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
115
115
|
lazyLoad: boolean;
|
package/dist/VvFormTemplate.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FormStatus } from './enums';
|
|
2
|
-
import { FormSchema, InjectedFormData, FormTemplate } from './types';
|
|
3
|
-
import { TypeOf, z } from 'zod';
|
|
4
1
|
import { Component, PropType, InjectionKey, DeepReadonly, Ref, VNode } from 'vue';
|
|
2
|
+
import { TypeOf, z } from 'zod';
|
|
3
|
+
import { FormSchema, InjectedFormData, FormTemplate } from './types';
|
|
4
|
+
import { FormStatus } from './enums';
|
|
5
5
|
|
|
6
|
-
export declare
|
|
6
|
+
export declare function defineFormTemplate<Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, VvFormField: Component): {
|
|
7
7
|
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
8
8
|
schema: {
|
|
9
9
|
type: PropType<FormTemplate<Schema>>;
|
package/dist/VvFormWrapper.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FormSchema, InjectedFormData, InjectedFormWrapperData } from './types';
|
|
2
|
-
import { TypeOf, z } from 'zod';
|
|
3
1
|
import { InjectionKey, Ref, DeepReadonly } from 'vue';
|
|
2
|
+
import { TypeOf, z } from 'zod';
|
|
3
|
+
import { FormSchema, InjectedFormData, InjectedFormWrapperData } from './types';
|
|
4
4
|
|
|
5
|
-
export declare
|
|
5
|
+
export declare function defineFormWrapper<Schema extends FormSchema>(formProvideKey: InjectionKey<InjectedFormData<Schema>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>): {
|
|
6
6
|
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
7
7
|
name: {
|
|
8
8
|
type: StringConstructor;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { InjectionKey, Plugin } from 'vue';
|
|
1
2
|
import { AnyZodObject } from 'zod';
|
|
2
|
-
import { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormComposableOptions, FormPluginOptions, FormTemplateItem, Path, PathValue, FormSchema, FormTemplate } from './types';
|
|
3
|
-
import { defineFormTemplate } from './VvFormTemplate';
|
|
4
|
-
import { defineFormWrapper } from './VvFormWrapper';
|
|
5
|
-
import { defineForm } from './VvForm';
|
|
6
3
|
import { defineFormField } from './VvFormField';
|
|
7
|
-
import {
|
|
4
|
+
import { defineForm } from './VvForm';
|
|
5
|
+
import { defineFormWrapper } from './VvFormWrapper';
|
|
6
|
+
import { defineFormTemplate } from './VvFormTemplate';
|
|
7
|
+
import { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData, FormComposableOptions, FormPluginOptions, FormTemplateItem, Path, PathValue, FormSchema, FormTemplate } from './types';
|
|
8
8
|
|
|
9
9
|
export declare const pluginInjectionKey: InjectionKey<FormPluginOptions>;
|
|
10
|
-
export declare
|
|
11
|
-
export declare
|
|
10
|
+
export declare function createForm(options: FormPluginOptions): Plugin & Partial<ReturnType<typeof useForm>>;
|
|
11
|
+
export declare function useForm<Schema extends FormSchema>(schema: Schema, options?: FormComposableOptions<Schema>): {
|
|
12
12
|
VvForm: {
|
|
13
13
|
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
14
14
|
continuousValidation: {
|
|
@@ -303,7 +303,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
303
303
|
default: import('./enums').FormFieldType;
|
|
304
304
|
};
|
|
305
305
|
is: {
|
|
306
|
-
type: import('vue').PropType<import('vue').Component>;
|
|
306
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
307
307
|
default: undefined;
|
|
308
308
|
};
|
|
309
309
|
name: {
|
|
@@ -361,7 +361,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
361
361
|
default: import('./enums').FormFieldType;
|
|
362
362
|
};
|
|
363
363
|
is: {
|
|
364
|
-
type: import('vue').PropType<import('vue').Component>;
|
|
364
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
365
365
|
default: undefined;
|
|
366
366
|
};
|
|
367
367
|
name: {
|
|
@@ -402,7 +402,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
402
402
|
type: import('vue').PropType<Partial<import('zod').TypeOf<Schema> | ((formData?: import('vue').Ref<ObjectConstructor> | undefined) => Partial<import('zod').TypeOf<Schema>> | undefined) | undefined>>;
|
|
403
403
|
default: () => {};
|
|
404
404
|
};
|
|
405
|
-
is: import('vue').Component;
|
|
405
|
+
is: string | import('vue').Component;
|
|
406
406
|
showValid: boolean;
|
|
407
407
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
408
408
|
lazyLoad: boolean;
|
|
@@ -855,7 +855,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
855
855
|
default: import('./enums').FormFieldType;
|
|
856
856
|
};
|
|
857
857
|
is: {
|
|
858
|
-
type: import('vue').PropType<import('vue').Component>;
|
|
858
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
859
859
|
default: undefined;
|
|
860
860
|
};
|
|
861
861
|
name: {
|
|
@@ -911,7 +911,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
911
911
|
default: import('./enums').FormFieldType;
|
|
912
912
|
};
|
|
913
913
|
is: {
|
|
914
|
-
type: import('vue').PropType<import('vue').Component>;
|
|
914
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
915
915
|
default: undefined;
|
|
916
916
|
};
|
|
917
917
|
name: {
|
|
@@ -954,7 +954,7 @@ export declare const useForm: <Schema extends FormSchema>(schema: Schema, option
|
|
|
954
954
|
} | ((formData?: import('vue').Ref<ObjectConstructor> | undefined) => Partial<{
|
|
955
955
|
[x: string]: any;
|
|
956
956
|
}> | undefined) | undefined>;
|
|
957
|
-
is: import('vue').Component;
|
|
957
|
+
is: string | import('vue').Component;
|
|
958
958
|
showValid: boolean;
|
|
959
959
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
960
960
|
lazyLoad: boolean;
|
|
@@ -1072,7 +1072,7 @@ export type { InjectedFormData, InjectedFormWrapperData, InjectedFormFieldData,
|
|
|
1072
1072
|
/**
|
|
1073
1073
|
* @deprecated Use `useForm()` instead
|
|
1074
1074
|
*/
|
|
1075
|
-
export declare
|
|
1075
|
+
export declare function formFactory<Schema extends FormSchema>(schema: Schema, options?: FormComposableOptions<Schema>): {
|
|
1076
1076
|
VvForm: {
|
|
1077
1077
|
new (...args: any[]): import('vue').CreateComponentPublicInstance<Readonly<import('vue').ExtractPropTypes<{
|
|
1078
1078
|
continuousValidation: {
|
|
@@ -1367,7 +1367,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1367
1367
|
default: import('./enums').FormFieldType;
|
|
1368
1368
|
};
|
|
1369
1369
|
is: {
|
|
1370
|
-
type: import('vue').PropType<import('vue').Component>;
|
|
1370
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
1371
1371
|
default: undefined;
|
|
1372
1372
|
};
|
|
1373
1373
|
name: {
|
|
@@ -1425,7 +1425,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1425
1425
|
default: import('./enums').FormFieldType;
|
|
1426
1426
|
};
|
|
1427
1427
|
is: {
|
|
1428
|
-
type: import('vue').PropType<import('vue').Component>;
|
|
1428
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
1429
1429
|
default: undefined;
|
|
1430
1430
|
};
|
|
1431
1431
|
name: {
|
|
@@ -1466,7 +1466,7 @@ export declare const formFactory: <Schema extends FormSchema>(schema: Schema, op
|
|
|
1466
1466
|
type: import('vue').PropType<Partial<import('zod').TypeOf<Schema> | ((formData?: import('vue').Ref<ObjectConstructor> | undefined) => Partial<import('zod').TypeOf<Schema>> | undefined) | undefined>>;
|
|
1467
1467
|
default: () => {};
|
|
1468
1468
|
};
|
|
1469
|
-
is: import('vue').Component;
|
|
1469
|
+
is: string | import('vue').Component;
|
|
1470
1470
|
showValid: boolean;
|
|
1471
1471
|
defaultValue: string | number | boolean | unknown[] | Record<string, any>;
|
|
1472
1472
|
lazyLoad: boolean;
|