@tmagic/editor 1.3.0-alpha.8 → 1.3.0-beta.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/dist/style.css +82 -218
- package/dist/tmagic-editor.js +4985 -3999
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +5013 -4012
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +15 -15
- package/src/Editor.vue +4 -5
- package/src/components/CodeBlockEditor.vue +257 -0
- package/src/components/CodeParams.vue +60 -0
- package/src/components/ContentMenu.vue +11 -3
- package/src/editorProps.ts +30 -5
- package/src/fields/Code.vue +23 -19
- package/src/fields/CodeLink.vue +6 -7
- package/src/fields/CodeSelect.vue +12 -9
- package/src/fields/CodeSelectCol.vue +70 -81
- package/src/fields/DataSourceFieldSelect.vue +47 -0
- package/src/fields/DataSourceFields.vue +28 -22
- package/src/fields/DataSourceInput.vue +21 -58
- package/src/fields/DataSourceMethodSelect.vue +136 -0
- package/src/fields/DataSourceMethods.vue +103 -0
- package/src/fields/DataSourceSelect.vue +68 -0
- package/src/fields/EventSelect.vue +53 -19
- package/src/fields/KeyValue.vue +9 -11
- package/src/fields/UISelect.vue +54 -14
- package/src/hooks/index.ts +21 -0
- package/src/hooks/use-code-block-edit.ts +84 -0
- package/src/hooks/use-data-source-method.ts +100 -0
- package/src/{utils/stage.ts → hooks/use-stage.ts} +4 -7
- package/src/icons/CenterIcon.vue +13 -0
- package/src/icons/CodeIcon.vue +0 -2
- package/src/icons/FolderMinusIcon.vue +22 -0
- package/src/index.ts +15 -0
- package/src/initService.ts +73 -16
- package/src/layouts/CodeEditor.vue +62 -10
- package/src/layouts/Framework.vue +7 -3
- package/src/layouts/PropsPanel.vue +8 -3
- package/src/layouts/sidebar/ComponentListPanel.vue +6 -9
- package/src/layouts/sidebar/LayerMenu.vue +20 -21
- package/src/layouts/sidebar/LayerNode.vue +40 -0
- package/src/layouts/sidebar/LayerPanel.vue +14 -5
- package/src/layouts/sidebar/Sidebar.vue +22 -36
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +81 -119
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +64 -0
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +27 -47
- package/src/layouts/sidebar/data-source/DataSourceList.vue +145 -0
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +58 -69
- package/src/layouts/workspace/Stage.vue +13 -5
- package/src/layouts/workspace/ViewerMenu.vue +10 -35
- package/src/services/codeBlock.ts +18 -71
- package/src/services/dataSource.ts +16 -1
- package/src/services/dep.ts +23 -20
- package/src/services/editor.ts +46 -18
- package/src/services/props.ts +2 -2
- package/src/theme/code-block.scss +5 -117
- package/src/theme/code-editor.scss +27 -2
- package/src/theme/content-menu.scss +1 -1
- package/src/theme/data-source-methods.scss +13 -0
- package/src/theme/data-source.scss +11 -0
- package/src/theme/event.scss +15 -12
- package/src/theme/framework.scss +0 -3
- package/src/theme/layer-panel.scss +6 -0
- package/src/theme/layout.scss +4 -0
- package/src/theme/sidebar.scss +18 -60
- package/src/theme/theme.scss +1 -0
- package/src/type.ts +47 -7
- package/src/utils/content-menu.ts +92 -0
- package/src/utils/data-source/formConfigs/base.ts +28 -30
- package/src/utils/data-source/index.ts +65 -2
- package/src/utils/dep.ts +39 -7
- package/src/utils/index.ts +1 -1
- package/src/utils/props.ts +298 -189
- package/src/utils/undo-redo.ts +1 -1
- package/types/Editor.vue.d.ts +30 -6
- package/types/components/CodeBlockEditor.vue.d.ts +23 -0
- package/types/components/CodeParams.vue.d.ts +26 -0
- package/types/components/ContentMenu.vue.d.ts +2 -2
- package/types/components/ToolButton.vue.d.ts +3 -3
- package/types/editorProps.d.ts +19 -5
- package/types/fields/Code.vue.d.ts +24 -19
- package/types/fields/CodeLink.vue.d.ts +12 -21
- package/types/fields/CodeSelect.vue.d.ts +6 -17
- package/types/fields/CodeSelectCol.vue.d.ts +10 -14
- package/types/fields/DataSourceFieldSelect.vue.d.ts +29 -0
- package/types/fields/DataSourceFields.vue.d.ts +7 -18
- package/types/fields/DataSourceInput.vue.d.ts +10 -30
- package/types/fields/DataSourceMethodSelect.vue.d.ts +29 -0
- package/types/fields/DataSourceMethods.vue.d.ts +32 -0
- package/types/fields/DataSourceSelect.vue.d.ts +40 -0
- package/types/fields/EventSelect.vue.d.ts +2 -13
- package/types/fields/KeyValue.vue.d.ts +9 -24
- package/types/fields/UISelect.vue.d.ts +2 -11
- package/types/hooks/index.d.ts +3 -0
- package/types/{components/FunctionEditor.vue.d.ts → hooks/use-code-block-edit.d.ts} +31 -119
- package/types/hooks/use-data-source-method.d.ts +123 -0
- package/types/icons/CenterIcon.vue.d.ts +2 -0
- package/types/icons/FolderMinusIcon.vue.d.ts +2 -0
- package/types/index.d.ts +7 -0
- package/types/initService.d.ts +2 -2
- package/types/layouts/CodeEditor.vue.d.ts +10 -4
- package/types/layouts/PropsPanel.vue.d.ts +274 -2
- package/types/layouts/sidebar/LayerNode.vue.d.ts +16 -0
- package/types/layouts/sidebar/Sidebar.vue.d.ts +0 -3
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +4 -9
- package/types/layouts/sidebar/code-block/{CodeBlockEditor.vue.d.ts → CodeBlockListPanel.vue.d.ts} +9 -5
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +3 -1
- package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +14 -0
- package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +1 -11
- package/types/services/codeBlock.d.ts +6 -37
- package/types/services/dataSource.d.ts +7 -1
- package/types/services/dep.d.ts +12 -21
- package/types/services/editor.d.ts +1 -1
- package/types/services/props.d.ts +10 -115
- package/types/type.d.ts +42 -7
- package/types/utils/content-menu.d.ts +7 -0
- package/types/utils/data-source/formConfigs/base.d.ts +1 -2
- package/types/utils/data-source/index.d.ts +5 -0
- package/types/utils/dep.d.ts +4 -2
- package/types/utils/index.d.ts +1 -1
- package/types/utils/props.d.ts +13 -102
- package/src/components/CodeDraftEditor.vue +0 -148
- package/src/components/FunctionEditor.vue +0 -197
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +0 -100
- package/types/components/CodeDraftEditor.vue.d.ts +0 -61
- /package/types/{utils/stage.d.ts → hooks/use-stage.d.ts} +0 -0
package/src/utils/props.ts
CHANGED
|
@@ -16,7 +16,300 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { FormConfig, FormState } from '@tmagic/form';
|
|
19
|
+
import type { FormConfig, FormState, TabPaneConfig } from '@tmagic/form';
|
|
20
|
+
|
|
21
|
+
import dataSourceService from '@editor/services/dataSource';
|
|
22
|
+
|
|
23
|
+
const arrayOptions = [
|
|
24
|
+
{ text: '包含', value: 'include' },
|
|
25
|
+
{ text: '不包含', value: 'not_include' },
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const eqOptions = [
|
|
29
|
+
{ text: '等于', value: '=' },
|
|
30
|
+
{ text: '不等于', value: '!=' },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const numberOptions = [
|
|
34
|
+
{ text: '大于', value: '>' },
|
|
35
|
+
{ text: '大于等于', value: '>=' },
|
|
36
|
+
{ text: '小于', value: '<' },
|
|
37
|
+
{ text: '小于等于', value: '<=' },
|
|
38
|
+
{ text: '在范围内', value: 'between' },
|
|
39
|
+
{ text: '不在范围内', value: 'not_between' },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export const styleTabConfig: TabPaneConfig = {
|
|
43
|
+
title: '样式',
|
|
44
|
+
labelWidth: '80px',
|
|
45
|
+
items: [
|
|
46
|
+
{
|
|
47
|
+
name: 'style',
|
|
48
|
+
items: [
|
|
49
|
+
{
|
|
50
|
+
type: 'fieldset',
|
|
51
|
+
legend: '位置',
|
|
52
|
+
items: [
|
|
53
|
+
{
|
|
54
|
+
name: 'position',
|
|
55
|
+
type: 'checkbox',
|
|
56
|
+
activeValue: 'fixed',
|
|
57
|
+
inactiveValue: 'absolute',
|
|
58
|
+
defaultValue: 'absolute',
|
|
59
|
+
text: '固定定位',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'left',
|
|
63
|
+
text: 'left',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'top',
|
|
67
|
+
text: 'top',
|
|
68
|
+
disabled: (vm: FormState, { model }: any) =>
|
|
69
|
+
model.position === 'fixed' && model._magic_position === 'fixedBottom',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'right',
|
|
73
|
+
text: 'right',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'bottom',
|
|
77
|
+
text: 'bottom',
|
|
78
|
+
disabled: (vm: FormState, { model }: any) =>
|
|
79
|
+
model.position === 'fixed' && model._magic_position === 'fixedTop',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: 'fieldset',
|
|
85
|
+
legend: '盒子',
|
|
86
|
+
items: [
|
|
87
|
+
{
|
|
88
|
+
name: 'width',
|
|
89
|
+
text: '宽度',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'height',
|
|
93
|
+
text: '高度',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: 'fieldset',
|
|
99
|
+
legend: '边框',
|
|
100
|
+
items: [
|
|
101
|
+
{
|
|
102
|
+
name: 'borderWidth',
|
|
103
|
+
text: '宽度',
|
|
104
|
+
defaultValue: '0',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'borderColor',
|
|
108
|
+
text: '颜色',
|
|
109
|
+
type: 'colorPicker',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'borderStyle',
|
|
113
|
+
text: '样式',
|
|
114
|
+
type: 'select',
|
|
115
|
+
defaultValue: 'none',
|
|
116
|
+
options: [
|
|
117
|
+
{ text: 'none', value: 'none' },
|
|
118
|
+
{ text: 'hidden', value: 'hidden' },
|
|
119
|
+
{ text: 'dotted', value: 'dotted' },
|
|
120
|
+
{ text: 'dashed', value: 'dashed' },
|
|
121
|
+
{ text: 'solid', value: 'solid' },
|
|
122
|
+
{ text: 'double', value: 'double' },
|
|
123
|
+
{ text: 'groove', value: 'groove' },
|
|
124
|
+
{ text: 'ridge', value: 'ridge' },
|
|
125
|
+
{ text: 'inset', value: 'inset' },
|
|
126
|
+
{ text: 'outset', value: 'outset' },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
type: 'fieldset',
|
|
133
|
+
legend: '背景',
|
|
134
|
+
items: [
|
|
135
|
+
{
|
|
136
|
+
name: 'backgroundImage',
|
|
137
|
+
text: '背景图',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'backgroundColor',
|
|
141
|
+
text: '背景颜色',
|
|
142
|
+
type: 'colorPicker',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'backgroundRepeat',
|
|
146
|
+
text: '背景图重复',
|
|
147
|
+
type: 'select',
|
|
148
|
+
defaultValue: 'no-repeat',
|
|
149
|
+
options: [
|
|
150
|
+
{ text: 'repeat', value: 'repeat' },
|
|
151
|
+
{ text: 'repeat-x', value: 'repeat-x' },
|
|
152
|
+
{ text: 'repeat-y', value: 'repeat-y' },
|
|
153
|
+
{ text: 'no-repeat', value: 'no-repeat' },
|
|
154
|
+
{ text: 'inherit', value: 'inherit' },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'backgroundSize',
|
|
159
|
+
text: '背景图大小',
|
|
160
|
+
defaultValue: '100% 100%',
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'fieldset',
|
|
166
|
+
legend: '字体',
|
|
167
|
+
items: [
|
|
168
|
+
{
|
|
169
|
+
name: 'color',
|
|
170
|
+
text: '颜色',
|
|
171
|
+
type: 'colorPicker',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'fontSize',
|
|
175
|
+
text: '大小',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'fontWeight',
|
|
179
|
+
text: '粗细',
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: 'fieldset',
|
|
185
|
+
legend: '变形',
|
|
186
|
+
name: 'transform',
|
|
187
|
+
items: [
|
|
188
|
+
{
|
|
189
|
+
name: 'rotate',
|
|
190
|
+
text: '旋转角度',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'scale',
|
|
194
|
+
text: '缩放',
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const eventTabConfig: TabPaneConfig = {
|
|
204
|
+
title: '事件',
|
|
205
|
+
items: [
|
|
206
|
+
{
|
|
207
|
+
name: 'events',
|
|
208
|
+
type: 'event-select',
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const advancedTabConfig: TabPaneConfig = {
|
|
214
|
+
title: '高级',
|
|
215
|
+
lazy: true,
|
|
216
|
+
items: [
|
|
217
|
+
{
|
|
218
|
+
name: 'created',
|
|
219
|
+
text: 'created',
|
|
220
|
+
labelWidth: '100px',
|
|
221
|
+
type: 'code-select',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'mounted',
|
|
225
|
+
text: 'mounted',
|
|
226
|
+
labelWidth: '100px',
|
|
227
|
+
type: 'code-select',
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export const displayTabConfig: TabPaneConfig = {
|
|
233
|
+
title: '显示条件',
|
|
234
|
+
display: (vm: FormState, { model }: any) => model.type !== 'page',
|
|
235
|
+
items: [
|
|
236
|
+
{
|
|
237
|
+
type: 'groupList',
|
|
238
|
+
name: 'displayConds',
|
|
239
|
+
items: [
|
|
240
|
+
{
|
|
241
|
+
type: 'table',
|
|
242
|
+
name: 'cond',
|
|
243
|
+
items: [
|
|
244
|
+
{
|
|
245
|
+
type: 'data-source-field-select',
|
|
246
|
+
name: 'field',
|
|
247
|
+
label: '字段',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
type: 'select',
|
|
251
|
+
options: (mForm: FormState | undefined, { model }: any) => {
|
|
252
|
+
const [id, field] = model.field;
|
|
253
|
+
|
|
254
|
+
const ds = dataSourceService.getDataSourceById(id);
|
|
255
|
+
|
|
256
|
+
const type = ds?.fields.find((f) => f.name === field)?.type;
|
|
257
|
+
|
|
258
|
+
if (type === 'array') {
|
|
259
|
+
return arrayOptions;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (type === 'boolean') {
|
|
263
|
+
return [
|
|
264
|
+
{ text: '是', value: 'is' },
|
|
265
|
+
{ text: '不是', value: 'not' },
|
|
266
|
+
];
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (type === 'number') {
|
|
270
|
+
return [...eqOptions, ...numberOptions];
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (type === 'string') {
|
|
274
|
+
return [...arrayOptions, ...eqOptions];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return [...arrayOptions, ...eqOptions, ...numberOptions];
|
|
278
|
+
},
|
|
279
|
+
label: '条件',
|
|
280
|
+
name: 'op',
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
label: '值',
|
|
284
|
+
items: [
|
|
285
|
+
{
|
|
286
|
+
name: 'value',
|
|
287
|
+
display: (vm: FormState, { model }: any) =>
|
|
288
|
+
!['between', 'not_between', 'is', 'not'].includes(model.op),
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: 'value',
|
|
292
|
+
type: 'select',
|
|
293
|
+
options: [
|
|
294
|
+
{ text: 'true', value: true },
|
|
295
|
+
{ text: 'false', value: false },
|
|
296
|
+
],
|
|
297
|
+
display: (vm: FormState, { model }: any) => ['is', 'not'].includes(model.op),
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'range',
|
|
301
|
+
type: 'number-range',
|
|
302
|
+
display: (vm: FormState, { model }: any) =>
|
|
303
|
+
['between', 'not_between'].includes(model.op) && !['is', 'not'].includes(model.op),
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
};
|
|
20
313
|
|
|
21
314
|
/**
|
|
22
315
|
* 统一为组件属性表单加上事件、高级、样式配置
|
|
@@ -50,194 +343,10 @@ export const fillConfig = (config: FormConfig = []) => [
|
|
|
50
343
|
...config,
|
|
51
344
|
],
|
|
52
345
|
},
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
name: 'style',
|
|
59
|
-
items: [
|
|
60
|
-
{
|
|
61
|
-
type: 'fieldset',
|
|
62
|
-
legend: '位置',
|
|
63
|
-
items: [
|
|
64
|
-
{
|
|
65
|
-
name: 'position',
|
|
66
|
-
type: 'checkbox',
|
|
67
|
-
activeValue: 'fixed',
|
|
68
|
-
inactiveValue: 'absolute',
|
|
69
|
-
defaultValue: 'absolute',
|
|
70
|
-
text: '固定定位',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'left',
|
|
74
|
-
text: 'left',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'top',
|
|
78
|
-
text: 'top',
|
|
79
|
-
disabled: (vm: FormState, { model }: any) =>
|
|
80
|
-
model.position === 'fixed' && model._magic_position === 'fixedBottom',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'right',
|
|
84
|
-
text: 'right',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: 'bottom',
|
|
88
|
-
text: 'bottom',
|
|
89
|
-
disabled: (vm: FormState, { model }: any) =>
|
|
90
|
-
model.position === 'fixed' && model._magic_position === 'fixedTop',
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
type: 'fieldset',
|
|
96
|
-
legend: '盒子',
|
|
97
|
-
items: [
|
|
98
|
-
{
|
|
99
|
-
name: 'width',
|
|
100
|
-
text: '宽度',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'height',
|
|
104
|
-
text: '高度',
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
type: 'fieldset',
|
|
110
|
-
legend: '边框',
|
|
111
|
-
items: [
|
|
112
|
-
{
|
|
113
|
-
name: 'borderWidth',
|
|
114
|
-
text: '宽度',
|
|
115
|
-
defaultValue: '0',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: 'borderColor',
|
|
119
|
-
text: '颜色',
|
|
120
|
-
type: 'colorPicker',
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
name: 'borderStyle',
|
|
124
|
-
text: '样式',
|
|
125
|
-
type: 'select',
|
|
126
|
-
defaultValue: 'none',
|
|
127
|
-
options: [
|
|
128
|
-
{ text: 'none', value: 'none' },
|
|
129
|
-
{ text: 'hidden', value: 'hidden' },
|
|
130
|
-
{ text: 'dotted', value: 'dotted' },
|
|
131
|
-
{ text: 'dashed', value: 'dashed' },
|
|
132
|
-
{ text: 'solid', value: 'solid' },
|
|
133
|
-
{ text: 'double', value: 'double' },
|
|
134
|
-
{ text: 'groove', value: 'groove' },
|
|
135
|
-
{ text: 'ridge', value: 'ridge' },
|
|
136
|
-
{ text: 'inset', value: 'inset' },
|
|
137
|
-
{ text: 'outset', value: 'outset' },
|
|
138
|
-
],
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
type: 'fieldset',
|
|
144
|
-
legend: '背景',
|
|
145
|
-
items: [
|
|
146
|
-
{
|
|
147
|
-
name: 'backgroundImage',
|
|
148
|
-
text: '背景图',
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: 'backgroundColor',
|
|
152
|
-
text: '背景颜色',
|
|
153
|
-
type: 'colorPicker',
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
name: 'backgroundRepeat',
|
|
157
|
-
text: '背景图重复',
|
|
158
|
-
type: 'select',
|
|
159
|
-
defaultValue: 'no-repeat',
|
|
160
|
-
options: [
|
|
161
|
-
{ text: 'repeat', value: 'repeat' },
|
|
162
|
-
{ text: 'repeat-x', value: 'repeat-x' },
|
|
163
|
-
{ text: 'repeat-y', value: 'repeat-y' },
|
|
164
|
-
{ text: 'no-repeat', value: 'no-repeat' },
|
|
165
|
-
{ text: 'inherit', value: 'inherit' },
|
|
166
|
-
],
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: 'backgroundSize',
|
|
170
|
-
text: '背景图大小',
|
|
171
|
-
defaultValue: '100% 100%',
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
type: 'fieldset',
|
|
177
|
-
legend: '字体',
|
|
178
|
-
items: [
|
|
179
|
-
{
|
|
180
|
-
name: 'color',
|
|
181
|
-
text: '颜色',
|
|
182
|
-
type: 'colorPicker',
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
name: 'fontSize',
|
|
186
|
-
text: '大小',
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
name: 'fontWeight',
|
|
190
|
-
text: '粗细',
|
|
191
|
-
},
|
|
192
|
-
],
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
type: 'fieldset',
|
|
196
|
-
legend: '变形',
|
|
197
|
-
name: 'transform',
|
|
198
|
-
items: [
|
|
199
|
-
{
|
|
200
|
-
name: 'rotate',
|
|
201
|
-
text: '旋转角度',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
name: 'scale',
|
|
205
|
-
text: '缩放',
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
title: '事件',
|
|
215
|
-
items: [
|
|
216
|
-
{
|
|
217
|
-
name: 'events',
|
|
218
|
-
type: 'event-select',
|
|
219
|
-
labelWidth: 0,
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
title: '高级',
|
|
225
|
-
lazy: true,
|
|
226
|
-
items: [
|
|
227
|
-
{
|
|
228
|
-
name: 'created',
|
|
229
|
-
text: 'created',
|
|
230
|
-
labelWidth: '100px',
|
|
231
|
-
type: 'code-select',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
name: 'mounted',
|
|
235
|
-
text: 'mounted',
|
|
236
|
-
labelWidth: '100px',
|
|
237
|
-
type: 'code-select',
|
|
238
|
-
},
|
|
239
|
-
],
|
|
240
|
-
},
|
|
346
|
+
{ ...styleTabConfig },
|
|
347
|
+
{ ...eventTabConfig },
|
|
348
|
+
{ ...advancedTabConfig },
|
|
349
|
+
{ ...displayTabConfig },
|
|
241
350
|
],
|
|
242
351
|
},
|
|
243
352
|
];
|
package/src/utils/undo-redo.ts
CHANGED
package/types/Editor.vue.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
type: import("vue").PropType<import("./type").ComponentGroup[]>;
|
|
10
10
|
default: () => never[];
|
|
11
11
|
};
|
|
12
|
+
datasourceList: {
|
|
13
|
+
type: import("vue").PropType<import("./type").DatasourceTypeOption[]>;
|
|
14
|
+
default: () => never[];
|
|
15
|
+
};
|
|
12
16
|
sidebar: {
|
|
13
17
|
type: import("vue").PropType<import("./type").SideBarData>;
|
|
14
18
|
};
|
|
@@ -37,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
41
|
default: () => {};
|
|
38
42
|
};
|
|
39
43
|
propsValues: {
|
|
40
|
-
type: import("vue").PropType<Record<string, import("@tmagic/schema").MNode
|
|
44
|
+
type: import("vue").PropType<Record<string, Partial<import("@tmagic/schema").MNode>>>;
|
|
41
45
|
default: () => {};
|
|
42
46
|
};
|
|
43
47
|
eventMethodList: {
|
|
@@ -47,7 +51,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
51
|
}>>;
|
|
48
52
|
default: () => {};
|
|
49
53
|
};
|
|
50
|
-
|
|
54
|
+
datasourceValues: {
|
|
55
|
+
type: import("vue").PropType<Record<string, Partial<import("@tmagic/schema").DataSourceSchema>>>;
|
|
56
|
+
default: () => {};
|
|
57
|
+
};
|
|
58
|
+
datasourceConfigs: {
|
|
51
59
|
type: import("vue").PropType<Record<string, import("@tmagic/form").FormConfig>>;
|
|
52
60
|
default: () => {};
|
|
53
61
|
};
|
|
@@ -90,6 +98,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
90
98
|
disabledDragStart: {
|
|
91
99
|
type: BooleanConstructor;
|
|
92
100
|
};
|
|
101
|
+
extendFormState: {
|
|
102
|
+
type: import("vue").PropType<(state: import("@tmagic/form").FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
103
|
+
};
|
|
93
104
|
}, Services, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "props-panel-mounted")[], "update:modelValue" | "props-panel-mounted", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
94
105
|
modelValue: {
|
|
95
106
|
type: import("vue").PropType<import("@tmagic/schema").MApp>;
|
|
@@ -100,6 +111,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
111
|
type: import("vue").PropType<import("./type").ComponentGroup[]>;
|
|
101
112
|
default: () => never[];
|
|
102
113
|
};
|
|
114
|
+
datasourceList: {
|
|
115
|
+
type: import("vue").PropType<import("./type").DatasourceTypeOption[]>;
|
|
116
|
+
default: () => never[];
|
|
117
|
+
};
|
|
103
118
|
sidebar: {
|
|
104
119
|
type: import("vue").PropType<import("./type").SideBarData>;
|
|
105
120
|
};
|
|
@@ -128,7 +143,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
128
143
|
default: () => {};
|
|
129
144
|
};
|
|
130
145
|
propsValues: {
|
|
131
|
-
type: import("vue").PropType<Record<string, import("@tmagic/schema").MNode
|
|
146
|
+
type: import("vue").PropType<Record<string, Partial<import("@tmagic/schema").MNode>>>;
|
|
132
147
|
default: () => {};
|
|
133
148
|
};
|
|
134
149
|
eventMethodList: {
|
|
@@ -138,7 +153,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
138
153
|
}>>;
|
|
139
154
|
default: () => {};
|
|
140
155
|
};
|
|
141
|
-
|
|
156
|
+
datasourceValues: {
|
|
157
|
+
type: import("vue").PropType<Record<string, Partial<import("@tmagic/schema").DataSourceSchema>>>;
|
|
158
|
+
default: () => {};
|
|
159
|
+
};
|
|
160
|
+
datasourceConfigs: {
|
|
142
161
|
type: import("vue").PropType<Record<string, import("@tmagic/form").FormConfig>>;
|
|
143
162
|
default: () => {};
|
|
144
163
|
};
|
|
@@ -181,6 +200,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
181
200
|
disabledDragStart: {
|
|
182
201
|
type: BooleanConstructor;
|
|
183
202
|
};
|
|
203
|
+
extendFormState: {
|
|
204
|
+
type: import("vue").PropType<(state: import("@tmagic/form").FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
205
|
+
};
|
|
184
206
|
}>> & {
|
|
185
207
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
186
208
|
"onProps-panel-mounted"?: ((...args: any[]) => any) | undefined;
|
|
@@ -192,13 +214,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
192
214
|
layerContentMenu: (import("./type").MenuButton | import("./type").MenuComponent)[];
|
|
193
215
|
stageContentMenu: (import("./type").MenuButton | import("./type").MenuComponent)[];
|
|
194
216
|
componentGroupList: import("./type").ComponentGroup[];
|
|
217
|
+
datasourceList: import("./type").DatasourceTypeOption[];
|
|
195
218
|
propsConfigs: Record<string, import("@tmagic/form").FormConfig>;
|
|
196
|
-
propsValues: Record<string, import("@tmagic/schema").MNode
|
|
219
|
+
propsValues: Record<string, Partial<import("@tmagic/schema").MNode>>;
|
|
197
220
|
eventMethodList: Record<string, {
|
|
198
221
|
events: import("@tmagic/core").EventOption[];
|
|
199
222
|
methods: import("@tmagic/core").EventOption[];
|
|
200
223
|
}>;
|
|
201
|
-
|
|
224
|
+
datasourceValues: Record<string, Partial<import("@tmagic/schema").DataSourceSchema>>;
|
|
225
|
+
datasourceConfigs: Record<string, import("@tmagic/form").FormConfig>;
|
|
202
226
|
canSelect: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
203
227
|
isContainer: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
204
228
|
containerHighlightClassName: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CodeBlockContent } from '@tmagic/schema';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
content: CodeBlockContent;
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
isDataSource?: boolean | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
show(): void;
|
|
8
|
+
hide(): void;
|
|
9
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
10
|
+
content: CodeBlockContent;
|
|
11
|
+
disabled?: boolean | undefined;
|
|
12
|
+
isDataSource?: boolean | undefined;
|
|
13
|
+
}>>>, {}, {}>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
+
} : {
|
|
20
|
+
type: import('vue').PropType<T[K]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CodeParamStatement } from '../type';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
model: any;
|
|
4
|
+
size?: "default" | "small" | "large" | undefined;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
name: string;
|
|
7
|
+
paramsConfig: CodeParamStatement[];
|
|
8
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
9
|
+
model: any;
|
|
10
|
+
size?: "default" | "small" | "large" | undefined;
|
|
11
|
+
disabled?: boolean | undefined;
|
|
12
|
+
name: string;
|
|
13
|
+
paramsConfig: CodeParamStatement[];
|
|
14
|
+
}>>> & {
|
|
15
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
}, {}, {}>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -10,15 +10,15 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
10
10
|
hide: () => void;
|
|
11
11
|
show: (e: MouseEvent) => void;
|
|
12
12
|
contains: (el: HTMLElement) => any;
|
|
13
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
13
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("show" | "hide")[], "show" | "hide", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
14
14
|
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
15
15
|
isSubMenu?: boolean | undefined;
|
|
16
16
|
}>, {
|
|
17
17
|
menuData: () => never[];
|
|
18
18
|
isSubMenu: boolean;
|
|
19
19
|
}>>> & {
|
|
20
|
-
onHide?: ((...args: any[]) => any) | undefined;
|
|
21
20
|
onShow?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
onHide?: ((...args: any[]) => any) | undefined;
|
|
22
22
|
}, {
|
|
23
23
|
menuData: (MenuButton | MenuComponent)[];
|
|
24
24
|
isSubMenu: boolean;
|