vue-form-craft 4.0.9 → 4.2.0
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 +12 -3
- package/dist/index.d.ts +47 -2
- package/dist/style.css +2 -2
- package/dist/vue-form-craft.js +22815 -29182
- package/dist/vue-form-craft.umd.cjs +140 -130
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
使用了最新的前端技术栈,可以让你免去vue项目中表单的烦恼。
|
|
6
6
|
|
|
7
|
-
- [在线预览](https://xinnian999.github.io/vue-form-craft/form-design)
|
|
8
|
-
- [官方文档](https://xinnian999.github.io/vue-form-craft/)
|
|
7
|
+
- [在线预览](https://xinnian999.github.io/vue-form-craft/zh/form-design)
|
|
8
|
+
- [官方文档](https://xinnian999.github.io/vue-form-craft/zh/)
|
|
9
9
|
- 作者:Elin
|
|
10
10
|
- 联系方式:17803000829
|
|
11
11
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
- vuedraggable
|
|
29
29
|
- element-plus
|
|
30
|
-
-
|
|
30
|
+
- vue-form-craft
|
|
31
31
|
- lodash
|
|
32
32
|
|
|
33
33
|
## 使用
|
|
@@ -122,3 +122,12 @@ const handleSubmit = async () => {
|
|
|
122
122
|
}
|
|
123
123
|
</script>
|
|
124
124
|
```
|
|
125
|
+
|
|
126
|
+
## 捐赠 vue-form-craft 的开发
|
|
127
|
+
|
|
128
|
+
`vue-form-craft` 的文档和代码完全开源,如果该项目有帮助到你的开发工作,你可以捐赠`vue-form-craft`的研发工作,捐赠无门槛,哪怕是一杯可乐也好。
|
|
129
|
+
|
|
130
|
+
<div style="display:flex;gap:15px">
|
|
131
|
+
<img src="./docs/assets/wechat.png" style="height:400px" />
|
|
132
|
+
<img src="./docs/assets/zhifubao.png" style="height:400px" />
|
|
133
|
+
</div>
|
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export declare const FormDesign: DefineComponent<ExtractPropTypes< {
|
|
|
51
51
|
modelValue: PropType<FormSchema>;
|
|
52
52
|
schemaContext: {
|
|
53
53
|
type: PropType<Record<string, any>>;
|
|
54
|
+
default: () => {};
|
|
54
55
|
};
|
|
55
56
|
templates: {
|
|
56
57
|
type: PropType<TemplateData>;
|
|
@@ -59,12 +60,14 @@ omitMenus: {
|
|
|
59
60
|
type: PropType<string[]>;
|
|
60
61
|
};
|
|
61
62
|
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
63
|
+
add: (element: FormElement) => void;
|
|
62
64
|
onSave: () => void;
|
|
63
65
|
save: () => void;
|
|
64
66
|
}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
65
67
|
modelValue: PropType<FormSchema>;
|
|
66
68
|
schemaContext: {
|
|
67
69
|
type: PropType<Record<string, any>>;
|
|
70
|
+
default: () => {};
|
|
68
71
|
};
|
|
69
72
|
templates: {
|
|
70
73
|
type: PropType<TemplateData>;
|
|
@@ -73,15 +76,18 @@ omitMenus: {
|
|
|
73
76
|
type: PropType<string[]>;
|
|
74
77
|
};
|
|
75
78
|
}>> & Readonly<{
|
|
79
|
+
onAdd?: ((element: FormElement) => any) | undefined;
|
|
76
80
|
onOnSave?: (() => any) | undefined;
|
|
77
81
|
onSave?: (() => any) | undefined;
|
|
78
|
-
}>, {
|
|
82
|
+
}>, {
|
|
83
|
+
schemaContext: Record<string, any>;
|
|
84
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
79
85
|
|
|
80
86
|
export declare type FormElement = {
|
|
81
87
|
name: string;
|
|
82
88
|
component: string | VNode | Component;
|
|
83
89
|
icon: string | VNode | Component;
|
|
84
|
-
type: 'assist' | 'layout' | 'basic';
|
|
90
|
+
type: 'assist' | 'layout' | 'basic' | 'highBasic';
|
|
85
91
|
order: number;
|
|
86
92
|
initialValues: Omit<FormItemType, 'name'>;
|
|
87
93
|
modelName?: string;
|
|
@@ -114,12 +120,14 @@ schema: FormSchema;
|
|
|
114
120
|
schemaContext?: Record<string, any> | undefined;
|
|
115
121
|
design?: boolean | undefined;
|
|
116
122
|
footer?: boolean | undefined;
|
|
123
|
+
read?: boolean | undefined;
|
|
117
124
|
}>>>, {
|
|
118
125
|
validate: () => FormValidationResult | undefined;
|
|
119
126
|
context: ComputedRef< {
|
|
120
127
|
$values: {};
|
|
121
128
|
$selectData: Record<string, Record<string, any>>;
|
|
122
129
|
$initialValues: Record<string, any>;
|
|
130
|
+
$locale: Locale;
|
|
123
131
|
}>;
|
|
124
132
|
resetFields: (names?: string[] | undefined) => void;
|
|
125
133
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -131,6 +139,7 @@ schema: FormSchema;
|
|
|
131
139
|
schemaContext?: Record<string, any> | undefined;
|
|
132
140
|
design?: boolean | undefined;
|
|
133
141
|
footer?: boolean | undefined;
|
|
142
|
+
read?: boolean | undefined;
|
|
134
143
|
}>>>> & Readonly<{
|
|
135
144
|
"onUpdate:modelValue"?: ((values: Record<string, any>) => any) | undefined;
|
|
136
145
|
onOnFinish?: ((values: Record<string, any>) => any) | undefined;
|
|
@@ -150,6 +159,7 @@ declare type FormRule = {
|
|
|
150
159
|
export declare type FormSchema = {
|
|
151
160
|
labelWidth?: number;
|
|
152
161
|
labelAlign?: 'top' | 'left' | 'right';
|
|
162
|
+
labelSuffix?: string;
|
|
153
163
|
size?: 'default' | 'small' | 'large';
|
|
154
164
|
disabled?: boolean;
|
|
155
165
|
hideRequiredAsterisk?: boolean;
|
|
@@ -157,6 +167,41 @@ export declare type FormSchema = {
|
|
|
157
167
|
items: FormItemType[];
|
|
158
168
|
};
|
|
159
169
|
|
|
170
|
+
declare type Locale = {
|
|
171
|
+
menus: {
|
|
172
|
+
basicTitle: string;
|
|
173
|
+
highBasicTitle: string;
|
|
174
|
+
layoutTitle: string;
|
|
175
|
+
assistTitle: string;
|
|
176
|
+
useTemplateBtn: string;
|
|
177
|
+
};
|
|
178
|
+
actions: {
|
|
179
|
+
previewJson: string;
|
|
180
|
+
previewVueCode: string;
|
|
181
|
+
previewForm: string;
|
|
182
|
+
clear: string;
|
|
183
|
+
save: string;
|
|
184
|
+
};
|
|
185
|
+
canvas: {
|
|
186
|
+
emptyTip: string;
|
|
187
|
+
wrapperEmptyTip: string;
|
|
188
|
+
};
|
|
189
|
+
attr: {
|
|
190
|
+
tab1: {
|
|
191
|
+
title: string;
|
|
192
|
+
emptyTip: string;
|
|
193
|
+
linkage: {
|
|
194
|
+
text: string;
|
|
195
|
+
action1: string;
|
|
196
|
+
action2: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
tab2: {
|
|
200
|
+
title: string;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
|
|
160
205
|
export declare type TemplateData = {
|
|
161
206
|
name: string;
|
|
162
207
|
schema: FormSchema;
|