@king-one/form-design 0.0.17 → 0.0.19
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/CHANGELOG.md +12 -0
- package/dist/es/index.mjs +16 -13
- package/dist/es/src/components/base/Carousel.vue.mjs +92 -0
- package/dist/es/src/components/base/Carousel.vue2.mjs +4 -0
- package/dist/es/src/components/base/json-preview.vue.mjs +215 -151
- package/dist/es/src/components/form-material.vue.mjs +168 -94
- package/dist/es/src/components/form-panel.vue.mjs +65 -60
- package/dist/es/src/components/panel/index.mjs +26 -13
- package/dist/es/src/components/panel/panel-item.vue.mjs +39 -39
- package/dist/es/src/components/panel/panel-wrapper.mjs +25 -15
- package/dist/es/src/components/panel/widget/array-card.vue2.mjs +39 -26
- package/dist/es/src/components/panel/widget/array-table.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/array-table.vue2.mjs +105 -0
- package/dist/es/src/components/panel/widget/date-range.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/date-range.vue2.mjs +28 -0
- package/dist/es/src/components/panel/widget/date-single.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/date-single.vue2.mjs +28 -0
- package/dist/es/src/components/panel/widget/kit.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/kit.vue2.mjs +48 -0
- package/dist/es/src/components/panel/widget/object.vue2.mjs +41 -30
- package/dist/es/src/components/panel/widget/select.vue2.mjs +3 -3
- package/dist/es/src/components/props/form-config.vue.mjs +1 -1
- package/dist/es/src/components/props/widget/BaseProps.vue2.mjs +31 -46
- package/dist/es/src/components/props/widget/InputNumberProps.vue2.mjs +94 -109
- package/dist/es/src/components/props/widget/InputProps.vue2.mjs +49 -64
- package/dist/es/src/components/props/widget/OvertimeProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/OvertimeProps.vue2.mjs +17 -0
- package/dist/es/src/components/props/widget/PropsDecorator.mjs +34 -0
- package/dist/es/src/components/props/widget/SelectProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/SelectProps.vue2.mjs +88 -0
- package/dist/es/src/components/props/widget/TextareaProps.vue2.mjs +48 -63
- package/dist/es/src/components/props/widget/index.mjs +44 -36
- package/dist/es/src/config/index.mjs +235 -16
- package/dist/es/src/core/Design.mjs +24 -16
- package/dist/es/src/core/Field.mjs +1 -1
- package/dist/es/src/core/FormSchema.mjs +29 -27
- package/dist/es/src/index.mjs +15 -13
- package/dist/es/src/internal.mjs +5 -4
- package/dist/es/src/plugins/index.mjs +23 -8
- package/dist/es/src/plugins/modules/drag-add.mjs +23 -0
- package/dist/es/src/utils/debounce.mjs +16 -0
- package/dist/es/src/utils/index.mjs +15 -13
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/base/Carousel.vue.js +1 -0
- package/dist/lib/src/components/base/Carousel.vue2.js +1 -0
- package/dist/lib/src/components/base/json-preview.vue.js +6 -6
- package/dist/lib/src/components/form-material.vue.js +10 -1
- package/dist/lib/src/components/form-panel.vue.js +2 -2
- package/dist/lib/src/components/panel/index.js +1 -1
- package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
- package/dist/lib/src/components/panel/panel-wrapper.js +1 -1
- package/dist/lib/src/components/panel/widget/array-card.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/array-table.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/array-table.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/date-range.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/date-range.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/date-single.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/date-single.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/kit.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/kit.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/select.vue2.js +1 -1
- package/dist/lib/src/components/props/form-config.vue.js +1 -1
- package/dist/lib/src/components/props/widget/BaseProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/InputNumberProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/InputProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/OvertimeProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/OvertimeProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/PropsDecorator.js +1 -0
- package/dist/lib/src/components/props/widget/SelectProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/SelectProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/TextareaProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/index.js +1 -1
- package/dist/lib/src/config/index.js +1 -1
- package/dist/lib/src/core/Design.js +1 -1
- package/dist/lib/src/core/Field.js +1 -1
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/internal.js +1 -1
- package/dist/lib/src/plugins/index.js +1 -1
- package/dist/lib/src/plugins/modules/drag-add.js +1 -0
- package/dist/lib/src/utils/debounce.js +1 -0
- package/dist/lib/src/utils/index.js +1 -1
- package/dist/theme-chalk/array-table.css +1 -0
- package/dist/theme-chalk/carousel.css +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/json-preview.css +1 -1
- package/dist/theme-chalk/kit-panel.css +1 -0
- package/dist/theme-chalk/material.css +1 -1
- package/dist/theme-chalk/panel-item.css +1 -1
- package/dist/theme-chalk/panel.css +1 -1
- package/dist/types/src/components/base/Carousel.vue.d.ts +65 -0
- package/dist/types/src/components/panel/panel-item.vue.d.ts +2 -0
- package/dist/types/src/components/panel/panel-wrapper.d.ts +11 -1
- package/dist/types/src/components/panel/widget/array-table.vue.d.ts +20 -0
- package/dist/types/src/components/panel/widget/date-range.vue.d.ts +8 -0
- package/dist/types/src/components/panel/widget/date-single.vue.d.ts +8 -0
- package/dist/types/src/components/panel/widget/kit.vue.d.ts +8 -0
- package/dist/types/src/components/props/widget/OvertimeProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/PropsDecorator.d.ts +3 -0
- package/dist/types/src/components/props/widget/SelectProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/index.d.ts +1 -9
- package/dist/types/src/components/types.d.ts +4 -3
- package/dist/types/src/config/index.d.ts +2 -1
- package/dist/types/src/core/Design.d.ts +95 -42
- package/dist/types/src/core/FormSchema.d.ts +22 -10
- package/dist/types/src/hooks/usePolling.d.ts +5 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/internal.d.ts +1 -0
- package/dist/types/src/plugins/index.d.ts +5 -2
- package/dist/types/src/plugins/modules/drag-add.d.ts +6 -0
- package/dist/types/src/types.d.ts +29 -6
- package/dist/types/src/utils/debounce.d.ts +10 -0
- package/dist/types/src/utils/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ComponentWidgetType, DesignParams, DesignSchema, FieldSchema, FormDesignPlugin, PropsWidgetType, valueType } from '@king-one/form-design/src/types';
|
|
1
|
+
import { ComponentWidgetType, DesignParams, DesignSchema, FieldSchema, FormDesignPlugin, PropsWidgetType, TemplateSchema, valueType, DragPutType } from '@king-one/form-design/src/types';
|
|
2
2
|
import { Ref, VNode } from 'vue';
|
|
3
3
|
import { Field } from './Field';
|
|
4
|
-
import { SyncBailHook, UnsetAdditionalOptions } from '@king-one/tapable';
|
|
4
|
+
import { SyncBailHook, UnsetAdditionalOptions, SyncHook } from '@king-one/tapable';
|
|
5
5
|
export declare class FormDesign {
|
|
6
6
|
schema: DesignSchema[];
|
|
7
|
+
tempSchema: TemplateSchema[];
|
|
7
8
|
private heart;
|
|
8
9
|
private plugin;
|
|
9
10
|
private FormSchema;
|
|
@@ -12,21 +13,27 @@ export declare class FormDesign {
|
|
|
12
13
|
title?: string | undefined;
|
|
13
14
|
key?: string | undefined;
|
|
14
15
|
type?: "string" | "number" | "boolean" | "object" | "array" | "void" | undefined;
|
|
15
|
-
'
|
|
16
|
+
'x-component'?: string | undefined;
|
|
16
17
|
enum?: any[] | undefined;
|
|
18
|
+
format?: string | undefined;
|
|
17
19
|
items?: {
|
|
18
20
|
title: string;
|
|
19
21
|
key: string;
|
|
20
22
|
type: valueType;
|
|
21
|
-
'
|
|
23
|
+
'x-component'?: string | undefined;
|
|
22
24
|
enum?: any[] | undefined;
|
|
23
|
-
|
|
25
|
+
format?: string | undefined;
|
|
26
|
+
items?: any[] | {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
type?: valueType | undefined;
|
|
29
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
30
|
+
} | undefined;
|
|
24
31
|
children?: any[] | undefined;
|
|
25
32
|
required?: boolean | undefined;
|
|
26
33
|
id?: string | undefined;
|
|
27
34
|
name?: string | undefined;
|
|
28
35
|
icon?: (string | VNode) | undefined;
|
|
29
|
-
'
|
|
36
|
+
'x-design-props'?: {
|
|
30
37
|
[x: string]: any;
|
|
31
38
|
unDragTo?: string[] | undefined;
|
|
32
39
|
validate?: {
|
|
@@ -34,24 +41,34 @@ export declare class FormDesign {
|
|
|
34
41
|
message: string;
|
|
35
42
|
} | undefined;
|
|
36
43
|
} | undefined;
|
|
37
|
-
'
|
|
38
|
-
'
|
|
44
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
45
|
+
'x-decorator'?: string | undefined;
|
|
46
|
+
'x-decorator-props'?: {
|
|
39
47
|
[x: string]: any;
|
|
40
48
|
} | undefined;
|
|
41
|
-
}[] |
|
|
49
|
+
}[] | {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
type?: valueType | undefined;
|
|
52
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
53
|
+
} | undefined;
|
|
42
54
|
children?: {
|
|
43
55
|
title: string;
|
|
44
56
|
key: string;
|
|
45
57
|
type: valueType;
|
|
46
|
-
'
|
|
58
|
+
'x-component'?: string | undefined;
|
|
47
59
|
enum?: any[] | undefined;
|
|
48
|
-
|
|
60
|
+
format?: string | undefined;
|
|
61
|
+
items?: any[] | {
|
|
62
|
+
[x: string]: any;
|
|
63
|
+
type?: valueType | undefined;
|
|
64
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
65
|
+
} | undefined;
|
|
49
66
|
children?: any[] | undefined;
|
|
50
67
|
required?: boolean | undefined;
|
|
51
68
|
id?: string | undefined;
|
|
52
69
|
name?: string | undefined;
|
|
53
70
|
icon?: (string | VNode) | undefined;
|
|
54
|
-
'
|
|
71
|
+
'x-design-props'?: {
|
|
55
72
|
[x: string]: any;
|
|
56
73
|
unDragTo?: string[] | undefined;
|
|
57
74
|
validate?: {
|
|
@@ -59,8 +76,9 @@ export declare class FormDesign {
|
|
|
59
76
|
message: string;
|
|
60
77
|
} | undefined;
|
|
61
78
|
} | undefined;
|
|
62
|
-
'
|
|
63
|
-
'
|
|
79
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
80
|
+
'x-decorator'?: string | undefined;
|
|
81
|
+
'x-decorator-props'?: {
|
|
64
82
|
[x: string]: any;
|
|
65
83
|
} | undefined;
|
|
66
84
|
}[] | undefined;
|
|
@@ -68,7 +86,7 @@ export declare class FormDesign {
|
|
|
68
86
|
id?: string | undefined;
|
|
69
87
|
name?: string | undefined;
|
|
70
88
|
icon?: (string | VNode) | undefined;
|
|
71
|
-
'
|
|
89
|
+
'x-design-props'?: {
|
|
72
90
|
[x: string]: any;
|
|
73
91
|
unDragTo?: string[] | undefined;
|
|
74
92
|
validate?: {
|
|
@@ -76,29 +94,36 @@ export declare class FormDesign {
|
|
|
76
94
|
message: string;
|
|
77
95
|
} | undefined;
|
|
78
96
|
} | undefined;
|
|
79
|
-
'
|
|
80
|
-
'
|
|
97
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
98
|
+
'x-decorator'?: string | undefined;
|
|
99
|
+
'x-decorator-props'?: {
|
|
81
100
|
[x: string]: any;
|
|
82
101
|
} | undefined;
|
|
83
102
|
}, Partial<FieldSchema> | {
|
|
84
103
|
title?: string | undefined;
|
|
85
104
|
key?: string | undefined;
|
|
86
105
|
type?: "string" | "number" | "boolean" | "object" | "array" | "void" | undefined;
|
|
87
|
-
'
|
|
106
|
+
'x-component'?: string | undefined;
|
|
88
107
|
enum?: any[] | undefined;
|
|
108
|
+
format?: string | undefined;
|
|
89
109
|
items?: {
|
|
90
110
|
title: string;
|
|
91
111
|
key: string;
|
|
92
112
|
type: valueType;
|
|
93
|
-
'
|
|
113
|
+
'x-component'?: string | undefined;
|
|
94
114
|
enum?: any[] | undefined;
|
|
95
|
-
|
|
115
|
+
format?: string | undefined;
|
|
116
|
+
items?: any[] | {
|
|
117
|
+
[x: string]: any;
|
|
118
|
+
type?: valueType | undefined;
|
|
119
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
120
|
+
} | undefined;
|
|
96
121
|
children?: any[] | undefined;
|
|
97
122
|
required?: boolean | undefined;
|
|
98
123
|
id?: string | undefined;
|
|
99
124
|
name?: string | undefined;
|
|
100
125
|
icon?: (string | VNode) | undefined;
|
|
101
|
-
'
|
|
126
|
+
'x-design-props'?: {
|
|
102
127
|
[x: string]: any;
|
|
103
128
|
unDragTo?: string[] | undefined;
|
|
104
129
|
validate?: {
|
|
@@ -106,24 +131,34 @@ export declare class FormDesign {
|
|
|
106
131
|
message: string;
|
|
107
132
|
} | undefined;
|
|
108
133
|
} | undefined;
|
|
109
|
-
'
|
|
110
|
-
'
|
|
134
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
135
|
+
'x-decorator'?: string | undefined;
|
|
136
|
+
'x-decorator-props'?: {
|
|
111
137
|
[x: string]: any;
|
|
112
138
|
} | undefined;
|
|
113
|
-
}[] |
|
|
139
|
+
}[] | {
|
|
140
|
+
[x: string]: any;
|
|
141
|
+
type?: valueType | undefined;
|
|
142
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
143
|
+
} | undefined;
|
|
114
144
|
children?: {
|
|
115
145
|
title: string;
|
|
116
146
|
key: string;
|
|
117
147
|
type: valueType;
|
|
118
|
-
'
|
|
148
|
+
'x-component'?: string | undefined;
|
|
119
149
|
enum?: any[] | undefined;
|
|
120
|
-
|
|
150
|
+
format?: string | undefined;
|
|
151
|
+
items?: any[] | {
|
|
152
|
+
[x: string]: any;
|
|
153
|
+
type?: valueType | undefined;
|
|
154
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
155
|
+
} | undefined;
|
|
121
156
|
children?: any[] | undefined;
|
|
122
157
|
required?: boolean | undefined;
|
|
123
158
|
id?: string | undefined;
|
|
124
159
|
name?: string | undefined;
|
|
125
160
|
icon?: (string | VNode) | undefined;
|
|
126
|
-
'
|
|
161
|
+
'x-design-props'?: {
|
|
127
162
|
[x: string]: any;
|
|
128
163
|
unDragTo?: string[] | undefined;
|
|
129
164
|
validate?: {
|
|
@@ -131,8 +166,9 @@ export declare class FormDesign {
|
|
|
131
166
|
message: string;
|
|
132
167
|
} | undefined;
|
|
133
168
|
} | undefined;
|
|
134
|
-
'
|
|
135
|
-
'
|
|
169
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
170
|
+
'x-decorator'?: string | undefined;
|
|
171
|
+
'x-decorator-props'?: {
|
|
136
172
|
[x: string]: any;
|
|
137
173
|
} | undefined;
|
|
138
174
|
}[] | undefined;
|
|
@@ -140,7 +176,7 @@ export declare class FormDesign {
|
|
|
140
176
|
id?: string | undefined;
|
|
141
177
|
name?: string | undefined;
|
|
142
178
|
icon?: (string | VNode) | undefined;
|
|
143
|
-
'
|
|
179
|
+
'x-design-props'?: {
|
|
144
180
|
[x: string]: any;
|
|
145
181
|
unDragTo?: string[] | undefined;
|
|
146
182
|
validate?: {
|
|
@@ -148,14 +184,16 @@ export declare class FormDesign {
|
|
|
148
184
|
message: string;
|
|
149
185
|
} | undefined;
|
|
150
186
|
} | undefined;
|
|
151
|
-
'
|
|
152
|
-
'
|
|
187
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
188
|
+
'x-decorator'?: string | undefined;
|
|
189
|
+
'x-decorator-props'?: {
|
|
153
190
|
[x: string]: any;
|
|
154
191
|
} | undefined;
|
|
155
192
|
}>;
|
|
156
193
|
shared: {
|
|
157
194
|
draggedContext: {
|
|
158
195
|
key: string;
|
|
196
|
+
field: any;
|
|
159
197
|
};
|
|
160
198
|
panelWidgets: Record<string, ComponentWidgetType>;
|
|
161
199
|
propsWidgets: Record<string, PropsWidgetType>;
|
|
@@ -171,23 +209,31 @@ export declare class FormDesign {
|
|
|
171
209
|
};
|
|
172
210
|
};
|
|
173
211
|
getFieldList(): Field[];
|
|
212
|
+
setCheckedField(field: FieldSchema): void;
|
|
174
213
|
private get lifecycles();
|
|
175
214
|
get hooks(): {
|
|
176
215
|
beforeDelete: SyncBailHook<FieldSchema, boolean, UnsetAdditionalOptions>;
|
|
216
|
+
syncDragAdd: SyncHook<DragPutType, void, UnsetAdditionalOptions>;
|
|
177
217
|
};
|
|
218
|
+
get dragAddResult(): any[];
|
|
178
219
|
get fields(): Ref<{
|
|
179
220
|
title: string;
|
|
180
221
|
key: string;
|
|
181
222
|
type: valueType;
|
|
182
|
-
'
|
|
223
|
+
'x-component'?: string | undefined;
|
|
183
224
|
enum?: any[] | undefined;
|
|
184
|
-
|
|
225
|
+
format?: string | undefined;
|
|
226
|
+
items?: any[] | {
|
|
227
|
+
[x: string]: any;
|
|
228
|
+
type?: valueType | undefined;
|
|
229
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
230
|
+
} | undefined;
|
|
185
231
|
children?: any[] | undefined;
|
|
186
232
|
required?: boolean | undefined;
|
|
187
233
|
id?: string | undefined;
|
|
188
234
|
name?: string | undefined;
|
|
189
235
|
icon?: (string | VNode) | undefined;
|
|
190
|
-
'
|
|
236
|
+
'x-design-props'?: {
|
|
191
237
|
[x: string]: any;
|
|
192
238
|
unDragTo?: string[] | undefined;
|
|
193
239
|
validate?: {
|
|
@@ -195,23 +241,29 @@ export declare class FormDesign {
|
|
|
195
241
|
message: string;
|
|
196
242
|
} | undefined;
|
|
197
243
|
} | undefined;
|
|
198
|
-
'
|
|
199
|
-
'
|
|
244
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
245
|
+
'x-decorator'?: string | undefined;
|
|
246
|
+
'x-decorator-props'?: {
|
|
200
247
|
[x: string]: any;
|
|
201
248
|
} | undefined;
|
|
202
249
|
}[], FieldSchema[] | {
|
|
203
250
|
title: string;
|
|
204
251
|
key: string;
|
|
205
252
|
type: valueType;
|
|
206
|
-
'
|
|
253
|
+
'x-component'?: string | undefined;
|
|
207
254
|
enum?: any[] | undefined;
|
|
208
|
-
|
|
255
|
+
format?: string | undefined;
|
|
256
|
+
items?: any[] | {
|
|
257
|
+
[x: string]: any;
|
|
258
|
+
type?: valueType | undefined;
|
|
259
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
260
|
+
} | undefined;
|
|
209
261
|
children?: any[] | undefined;
|
|
210
262
|
required?: boolean | undefined;
|
|
211
263
|
id?: string | undefined;
|
|
212
264
|
name?: string | undefined;
|
|
213
265
|
icon?: (string | VNode) | undefined;
|
|
214
|
-
'
|
|
266
|
+
'x-design-props'?: {
|
|
215
267
|
[x: string]: any;
|
|
216
268
|
unDragTo?: string[] | undefined;
|
|
217
269
|
validate?: {
|
|
@@ -219,8 +271,9 @@ export declare class FormDesign {
|
|
|
219
271
|
message: string;
|
|
220
272
|
} | undefined;
|
|
221
273
|
} | undefined;
|
|
222
|
-
'
|
|
223
|
-
'
|
|
274
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
275
|
+
'x-decorator'?: string | undefined;
|
|
276
|
+
'x-decorator-props'?: {
|
|
224
277
|
[x: string]: any;
|
|
225
278
|
} | undefined;
|
|
226
279
|
}[]>;
|
|
@@ -7,15 +7,20 @@ export declare class FormSchema {
|
|
|
7
7
|
title: string;
|
|
8
8
|
key: string;
|
|
9
9
|
type: valueType;
|
|
10
|
-
'
|
|
10
|
+
'x-component'?: string | undefined;
|
|
11
11
|
enum?: any[] | undefined;
|
|
12
|
-
|
|
12
|
+
format?: string | undefined;
|
|
13
|
+
items?: any[] | {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
type?: valueType | undefined;
|
|
16
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
17
|
+
} | undefined;
|
|
13
18
|
children?: any[] | undefined;
|
|
14
19
|
required?: boolean | undefined;
|
|
15
20
|
id?: string | undefined;
|
|
16
21
|
name?: string | undefined;
|
|
17
22
|
icon?: (string | VNode) | undefined;
|
|
18
|
-
'
|
|
23
|
+
'x-design-props'?: {
|
|
19
24
|
[x: string]: any;
|
|
20
25
|
unDragTo?: string[] | undefined;
|
|
21
26
|
validate?: {
|
|
@@ -23,23 +28,29 @@ export declare class FormSchema {
|
|
|
23
28
|
message: string;
|
|
24
29
|
} | undefined;
|
|
25
30
|
} | undefined;
|
|
26
|
-
'
|
|
27
|
-
'
|
|
31
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
32
|
+
'x-decorator'?: string | undefined;
|
|
33
|
+
'x-decorator-props'?: {
|
|
28
34
|
[x: string]: any;
|
|
29
35
|
} | undefined;
|
|
30
36
|
}[], FieldSchema[] | {
|
|
31
37
|
title: string;
|
|
32
38
|
key: string;
|
|
33
39
|
type: valueType;
|
|
34
|
-
'
|
|
40
|
+
'x-component'?: string | undefined;
|
|
35
41
|
enum?: any[] | undefined;
|
|
36
|
-
|
|
42
|
+
format?: string | undefined;
|
|
43
|
+
items?: any[] | {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
type?: valueType | undefined;
|
|
46
|
+
properties?: Record<string, FieldSchema> | undefined;
|
|
47
|
+
} | undefined;
|
|
37
48
|
children?: any[] | undefined;
|
|
38
49
|
required?: boolean | undefined;
|
|
39
50
|
id?: string | undefined;
|
|
40
51
|
name?: string | undefined;
|
|
41
52
|
icon?: (string | VNode) | undefined;
|
|
42
|
-
'
|
|
53
|
+
'x-design-props'?: {
|
|
43
54
|
[x: string]: any;
|
|
44
55
|
unDragTo?: string[] | undefined;
|
|
45
56
|
validate?: {
|
|
@@ -47,8 +58,9 @@ export declare class FormSchema {
|
|
|
47
58
|
message: string;
|
|
48
59
|
} | undefined;
|
|
49
60
|
} | undefined;
|
|
50
|
-
'
|
|
51
|
-
'
|
|
61
|
+
'x-component-props'?: Record<string, any> | undefined;
|
|
62
|
+
'x-decorator'?: string | undefined;
|
|
63
|
+
'x-decorator-props'?: {
|
|
52
64
|
[x: string]: any;
|
|
53
65
|
} | undefined;
|
|
54
66
|
}[]>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as Carousel } from './components/base/Carousel.vue';
|
|
1
2
|
export { default as FormPanelItem } from './components/panel/panel-item.vue';
|
|
2
3
|
export { useInjectDesignContext } from './context/design';
|
|
3
4
|
export { default as FormDesign } from './components/form-desgin';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { SyncBailHook, UnsetAdditionalOptions } from '@king-one/tapable';
|
|
2
|
-
import { FieldSchema, FormDesignPlugin } from '../types';
|
|
1
|
+
import { SyncBailHook, SyncHook, UnsetAdditionalOptions } from '@king-one/tapable';
|
|
2
|
+
import { DragPutType, FieldSchema, FormDesignPlugin } from '../types';
|
|
3
3
|
export declare class Plugin {
|
|
4
4
|
readonly hooks: {
|
|
5
5
|
beforeDelete: SyncBailHook<FieldSchema, boolean, UnsetAdditionalOptions>;
|
|
6
|
+
syncDragAdd: SyncHook<DragPutType, void, UnsetAdditionalOptions>;
|
|
6
7
|
};
|
|
8
|
+
dragAddResult: any[];
|
|
9
|
+
constructor();
|
|
7
10
|
use(plugIn: FormDesignPlugin): void;
|
|
8
11
|
}
|
|
@@ -22,15 +22,20 @@ export interface FieldSchema {
|
|
|
22
22
|
'title': string;
|
|
23
23
|
'key': string;
|
|
24
24
|
'type': valueType;
|
|
25
|
-
'
|
|
25
|
+
'x-component'?: string;
|
|
26
26
|
'enum'?: any[];
|
|
27
|
-
'
|
|
27
|
+
'format'?: string;
|
|
28
|
+
'items'?: FieldSchema[] | {
|
|
29
|
+
type?: valueType;
|
|
30
|
+
properties?: Record<string, FieldSchema>;
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
};
|
|
28
33
|
'children'?: FieldSchema[];
|
|
29
34
|
'required'?: boolean;
|
|
30
35
|
'id'?: string;
|
|
31
36
|
'name'?: string;
|
|
32
37
|
'icon'?: string | VNode;
|
|
33
|
-
'
|
|
38
|
+
'x-design-props'?: {
|
|
34
39
|
unDragTo?: string[];
|
|
35
40
|
validate?: {
|
|
36
41
|
status: 'success' | 'error' | 'warning' | '';
|
|
@@ -38,11 +43,18 @@ export interface FieldSchema {
|
|
|
38
43
|
};
|
|
39
44
|
[x: string]: any;
|
|
40
45
|
};
|
|
41
|
-
'
|
|
42
|
-
'
|
|
46
|
+
'x-component-props'?: Record<string, any>;
|
|
47
|
+
'x-decorator'?: string;
|
|
48
|
+
'x-decorator-props'?: {
|
|
43
49
|
[x: string]: any;
|
|
44
50
|
};
|
|
45
51
|
}
|
|
52
|
+
export interface TemplateSchema {
|
|
53
|
+
name: string;
|
|
54
|
+
key: string;
|
|
55
|
+
icon?: string | VNode;
|
|
56
|
+
schema: FieldSchema;
|
|
57
|
+
}
|
|
46
58
|
export interface DesignSchema {
|
|
47
59
|
name: string;
|
|
48
60
|
key: string;
|
|
@@ -50,13 +62,19 @@ export interface DesignSchema {
|
|
|
50
62
|
}
|
|
51
63
|
type PromiseFn<T> = () => Promise<T>;
|
|
52
64
|
export type ComponentWidgetType = PromiseFn<Component> | Component;
|
|
65
|
+
export interface PropsWidgetComponent {
|
|
66
|
+
header: string;
|
|
67
|
+
widget: Component;
|
|
68
|
+
}
|
|
53
69
|
export interface PropsWidgetType {
|
|
54
|
-
component:
|
|
70
|
+
component: PropsWidgetComponent[];
|
|
55
71
|
defaultValues?: Record<string, any>;
|
|
72
|
+
activeKey?: string;
|
|
56
73
|
rules?: any;
|
|
57
74
|
}
|
|
58
75
|
export interface DesignParams {
|
|
59
76
|
schema: DesignSchema[];
|
|
77
|
+
tempSchema?: TemplateSchema[];
|
|
60
78
|
extendFormProps?: {
|
|
61
79
|
title: string;
|
|
62
80
|
key: string;
|
|
@@ -78,3 +96,8 @@ export interface FormDesignPlugin {
|
|
|
78
96
|
install: (app: PluginInterface, ...options: any[]) => void;
|
|
79
97
|
}
|
|
80
98
|
export type widgetPropsType = Record<string, PropsWidgetType>;
|
|
99
|
+
export interface DragPutType {
|
|
100
|
+
source: FieldSchema;
|
|
101
|
+
traget: FieldSchema[];
|
|
102
|
+
region: 'form-panel' | 'k-array-card' | 'k-object' | 'k-table';
|
|
103
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 防抖函数
|
|
3
|
+
* @param fn 需要防抖的函数
|
|
4
|
+
* @param delay 延迟时间(毫秒)
|
|
5
|
+
* @param immediate 是否立即执行(默认 false)
|
|
6
|
+
* @returns 防抖后的函数,包含 cancel 方法用于取消
|
|
7
|
+
*/
|
|
8
|
+
export declare function debounce<T extends (...args: any[]) => any>(fn: T, delay: number, immediate?: boolean): T & {
|
|
9
|
+
cancel: () => void;
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-one/form-design",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.19",
|
|
5
5
|
"description": "@king-one 表单设计器",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "ISC",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@king-one/tapable": "^3.0.0",
|
|
48
48
|
"@king-one/theme": "^1.0.1",
|
|
49
|
-
"@king-one/utils": "^1.0.
|
|
49
|
+
"@king-one/utils": "^1.0.14",
|
|
50
50
|
"highlight.js": "^11.11.1",
|
|
51
51
|
"monaco-editor": "^0.54.0",
|
|
52
52
|
"vuedraggable": "^4.1.0"
|