@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.
Files changed (116) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/es/index.mjs +16 -13
  3. package/dist/es/src/components/base/Carousel.vue.mjs +92 -0
  4. package/dist/es/src/components/base/Carousel.vue2.mjs +4 -0
  5. package/dist/es/src/components/base/json-preview.vue.mjs +215 -151
  6. package/dist/es/src/components/form-material.vue.mjs +168 -94
  7. package/dist/es/src/components/form-panel.vue.mjs +65 -60
  8. package/dist/es/src/components/panel/index.mjs +26 -13
  9. package/dist/es/src/components/panel/panel-item.vue.mjs +39 -39
  10. package/dist/es/src/components/panel/panel-wrapper.mjs +25 -15
  11. package/dist/es/src/components/panel/widget/array-card.vue2.mjs +39 -26
  12. package/dist/es/src/components/panel/widget/array-table.vue.mjs +4 -0
  13. package/dist/es/src/components/panel/widget/array-table.vue2.mjs +105 -0
  14. package/dist/es/src/components/panel/widget/date-range.vue.mjs +4 -0
  15. package/dist/es/src/components/panel/widget/date-range.vue2.mjs +28 -0
  16. package/dist/es/src/components/panel/widget/date-single.vue.mjs +4 -0
  17. package/dist/es/src/components/panel/widget/date-single.vue2.mjs +28 -0
  18. package/dist/es/src/components/panel/widget/kit.vue.mjs +4 -0
  19. package/dist/es/src/components/panel/widget/kit.vue2.mjs +48 -0
  20. package/dist/es/src/components/panel/widget/object.vue2.mjs +41 -30
  21. package/dist/es/src/components/panel/widget/select.vue2.mjs +3 -3
  22. package/dist/es/src/components/props/form-config.vue.mjs +1 -1
  23. package/dist/es/src/components/props/widget/BaseProps.vue2.mjs +31 -46
  24. package/dist/es/src/components/props/widget/InputNumberProps.vue2.mjs +94 -109
  25. package/dist/es/src/components/props/widget/InputProps.vue2.mjs +49 -64
  26. package/dist/es/src/components/props/widget/OvertimeProps.vue.mjs +4 -0
  27. package/dist/es/src/components/props/widget/OvertimeProps.vue2.mjs +17 -0
  28. package/dist/es/src/components/props/widget/PropsDecorator.mjs +34 -0
  29. package/dist/es/src/components/props/widget/SelectProps.vue.mjs +4 -0
  30. package/dist/es/src/components/props/widget/SelectProps.vue2.mjs +88 -0
  31. package/dist/es/src/components/props/widget/TextareaProps.vue2.mjs +48 -63
  32. package/dist/es/src/components/props/widget/index.mjs +44 -36
  33. package/dist/es/src/config/index.mjs +235 -16
  34. package/dist/es/src/core/Design.mjs +24 -16
  35. package/dist/es/src/core/Field.mjs +1 -1
  36. package/dist/es/src/core/FormSchema.mjs +29 -27
  37. package/dist/es/src/index.mjs +15 -13
  38. package/dist/es/src/internal.mjs +5 -4
  39. package/dist/es/src/plugins/index.mjs +23 -8
  40. package/dist/es/src/plugins/modules/drag-add.mjs +23 -0
  41. package/dist/es/src/utils/debounce.mjs +16 -0
  42. package/dist/es/src/utils/index.mjs +15 -13
  43. package/dist/lib/index.js +1 -1
  44. package/dist/lib/src/components/base/Carousel.vue.js +1 -0
  45. package/dist/lib/src/components/base/Carousel.vue2.js +1 -0
  46. package/dist/lib/src/components/base/json-preview.vue.js +6 -6
  47. package/dist/lib/src/components/form-material.vue.js +10 -1
  48. package/dist/lib/src/components/form-panel.vue.js +2 -2
  49. package/dist/lib/src/components/panel/index.js +1 -1
  50. package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
  51. package/dist/lib/src/components/panel/panel-wrapper.js +1 -1
  52. package/dist/lib/src/components/panel/widget/array-card.vue2.js +1 -1
  53. package/dist/lib/src/components/panel/widget/array-table.vue.js +1 -0
  54. package/dist/lib/src/components/panel/widget/array-table.vue2.js +1 -0
  55. package/dist/lib/src/components/panel/widget/date-range.vue.js +1 -0
  56. package/dist/lib/src/components/panel/widget/date-range.vue2.js +1 -0
  57. package/dist/lib/src/components/panel/widget/date-single.vue.js +1 -0
  58. package/dist/lib/src/components/panel/widget/date-single.vue2.js +1 -0
  59. package/dist/lib/src/components/panel/widget/kit.vue.js +1 -0
  60. package/dist/lib/src/components/panel/widget/kit.vue2.js +1 -0
  61. package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
  62. package/dist/lib/src/components/panel/widget/select.vue2.js +1 -1
  63. package/dist/lib/src/components/props/form-config.vue.js +1 -1
  64. package/dist/lib/src/components/props/widget/BaseProps.vue2.js +1 -1
  65. package/dist/lib/src/components/props/widget/InputNumberProps.vue2.js +1 -1
  66. package/dist/lib/src/components/props/widget/InputProps.vue2.js +1 -1
  67. package/dist/lib/src/components/props/widget/OvertimeProps.vue.js +1 -0
  68. package/dist/lib/src/components/props/widget/OvertimeProps.vue2.js +1 -0
  69. package/dist/lib/src/components/props/widget/PropsDecorator.js +1 -0
  70. package/dist/lib/src/components/props/widget/SelectProps.vue.js +1 -0
  71. package/dist/lib/src/components/props/widget/SelectProps.vue2.js +1 -0
  72. package/dist/lib/src/components/props/widget/TextareaProps.vue2.js +1 -1
  73. package/dist/lib/src/components/props/widget/index.js +1 -1
  74. package/dist/lib/src/config/index.js +1 -1
  75. package/dist/lib/src/core/Design.js +1 -1
  76. package/dist/lib/src/core/Field.js +1 -1
  77. package/dist/lib/src/core/FormSchema.js +1 -1
  78. package/dist/lib/src/index.js +1 -1
  79. package/dist/lib/src/internal.js +1 -1
  80. package/dist/lib/src/plugins/index.js +1 -1
  81. package/dist/lib/src/plugins/modules/drag-add.js +1 -0
  82. package/dist/lib/src/utils/debounce.js +1 -0
  83. package/dist/lib/src/utils/index.js +1 -1
  84. package/dist/theme-chalk/array-table.css +1 -0
  85. package/dist/theme-chalk/carousel.css +1 -0
  86. package/dist/theme-chalk/icon.css +1 -1
  87. package/dist/theme-chalk/index.css +1 -1
  88. package/dist/theme-chalk/json-preview.css +1 -1
  89. package/dist/theme-chalk/kit-panel.css +1 -0
  90. package/dist/theme-chalk/material.css +1 -1
  91. package/dist/theme-chalk/panel-item.css +1 -1
  92. package/dist/theme-chalk/panel.css +1 -1
  93. package/dist/types/src/components/base/Carousel.vue.d.ts +65 -0
  94. package/dist/types/src/components/panel/panel-item.vue.d.ts +2 -0
  95. package/dist/types/src/components/panel/panel-wrapper.d.ts +11 -1
  96. package/dist/types/src/components/panel/widget/array-table.vue.d.ts +20 -0
  97. package/dist/types/src/components/panel/widget/date-range.vue.d.ts +8 -0
  98. package/dist/types/src/components/panel/widget/date-single.vue.d.ts +8 -0
  99. package/dist/types/src/components/panel/widget/kit.vue.d.ts +8 -0
  100. package/dist/types/src/components/props/widget/OvertimeProps.vue.d.ts +3 -0
  101. package/dist/types/src/components/props/widget/PropsDecorator.d.ts +3 -0
  102. package/dist/types/src/components/props/widget/SelectProps.vue.d.ts +3 -0
  103. package/dist/types/src/components/props/widget/index.d.ts +1 -9
  104. package/dist/types/src/components/types.d.ts +4 -3
  105. package/dist/types/src/config/index.d.ts +2 -1
  106. package/dist/types/src/core/Design.d.ts +95 -42
  107. package/dist/types/src/core/FormSchema.d.ts +22 -10
  108. package/dist/types/src/hooks/usePolling.d.ts +5 -0
  109. package/dist/types/src/index.d.ts +1 -0
  110. package/dist/types/src/internal.d.ts +1 -0
  111. package/dist/types/src/plugins/index.d.ts +5 -2
  112. package/dist/types/src/plugins/modules/drag-add.d.ts +6 -0
  113. package/dist/types/src/types.d.ts +29 -6
  114. package/dist/types/src/utils/debounce.d.ts +10 -0
  115. package/dist/types/src/utils/index.d.ts +1 -0
  116. 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
- 'k-component'?: string | undefined;
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
- 'k-component'?: string | undefined;
23
+ 'x-component'?: string | undefined;
22
24
  enum?: any[] | undefined;
23
- items?: any[] | undefined;
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
38
- 'k-decorator-props'?: {
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
- }[] | undefined;
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
- 'k-component'?: string | undefined;
58
+ 'x-component'?: string | undefined;
47
59
  enum?: any[] | undefined;
48
- items?: any[] | undefined;
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
63
- 'k-decorator-props'?: {
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
80
- 'k-decorator-props'?: {
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
- 'k-component'?: string | undefined;
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
- 'k-component'?: string | undefined;
113
+ 'x-component'?: string | undefined;
94
114
  enum?: any[] | undefined;
95
- items?: any[] | undefined;
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
110
- 'k-decorator-props'?: {
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
- }[] | undefined;
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
- 'k-component'?: string | undefined;
148
+ 'x-component'?: string | undefined;
119
149
  enum?: any[] | undefined;
120
- items?: any[] | undefined;
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
135
- 'k-decorator-props'?: {
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
152
- 'k-decorator-props'?: {
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
- 'k-component'?: string | undefined;
223
+ 'x-component'?: string | undefined;
183
224
  enum?: any[] | undefined;
184
- items?: any[] | undefined;
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
199
- 'k-decorator-props'?: {
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
- 'k-component'?: string | undefined;
253
+ 'x-component'?: string | undefined;
207
254
  enum?: any[] | undefined;
208
- items?: any[] | undefined;
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
223
- 'k-decorator-props'?: {
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
- 'k-component'?: string | undefined;
10
+ 'x-component'?: string | undefined;
11
11
  enum?: any[] | undefined;
12
- items?: any[] | undefined;
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
27
- 'k-decorator-props'?: {
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
- 'k-component'?: string | undefined;
40
+ 'x-component'?: string | undefined;
35
41
  enum?: any[] | undefined;
36
- items?: any[] | undefined;
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any> | undefined;
51
- 'k-decorator-props'?: {
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
  }[]>;
@@ -0,0 +1,5 @@
1
+ import { Ref } from 'vue';
2
+ export declare function usePolling(callback: () => Promise<boolean>, delay: number, count?: number): {
3
+ loading: Ref<boolean, boolean>;
4
+ stop: () => void;
5
+ };
@@ -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,2 +1,3 @@
1
1
  export * from './hooks';
2
2
  export * from './context/design';
3
+ export * from './utils';
@@ -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
  }
@@ -0,0 +1,6 @@
1
+ import { FormDesignPlugin, PluginInterface } from '../../types';
2
+ export declare const exclusion: string[];
3
+ export declare class BaseDragAdd implements FormDesignPlugin {
4
+ name: string;
5
+ install(app: PluginInterface): void;
6
+ }
@@ -22,15 +22,20 @@ export interface FieldSchema {
22
22
  'title': string;
23
23
  'key': string;
24
24
  'type': valueType;
25
- 'k-component'?: string;
25
+ 'x-component'?: string;
26
26
  'enum'?: any[];
27
- 'items'?: FieldSchema[];
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
- 'k-design-props'?: {
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
- 'k-component-props'?: Record<string, any>;
42
- 'k-decorator-props'?: {
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: 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
+ };
@@ -1 +1,2 @@
1
1
  export * from './checkers';
2
+ export * from './debounce';
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.17",
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.13",
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"