@tmagic/editor 1.3.0-alpha.2 → 1.3.0-alpha.21
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 +91 -120
- package/dist/tmagic-editor.js +4609 -3257
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +5708 -4337
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +21 -22
- package/src/Editor.vue +29 -7
- package/src/components/CodeBlockEditor.vue +170 -0
- package/src/components/CodeParams.vue +60 -0
- package/src/components/ContentMenu.vue +30 -11
- package/src/components/Icon.vue +5 -1
- package/src/components/Resizer.vue +45 -0
- package/src/components/ScrollBar.vue +5 -1
- package/src/components/ScrollViewer.vue +5 -1
- package/src/components/SearchInput.vue +4 -0
- package/src/components/{Layout.vue → SplitView.vue} +8 -4
- package/src/components/ToolButton.vue +5 -1
- package/src/editorProps.ts +35 -4
- package/src/fields/Code.vue +28 -20
- package/src/fields/CodeLink.vue +15 -10
- package/src/fields/CodeSelect.vue +19 -10
- package/src/fields/CodeSelectCol.vue +67 -83
- package/src/fields/DataSourceFieldSelect.vue +47 -0
- package/src/fields/DataSourceFields.vue +24 -21
- package/src/fields/DataSourceInput.vue +318 -0
- 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 +62 -22
- package/src/fields/KeyValue.vue +13 -11
- package/src/fields/UISelect.vue +59 -15
- 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/AppManageIcon.vue +5 -1
- package/src/icons/CenterIcon.vue +13 -0
- package/src/icons/CodeIcon.vue +5 -3
- package/src/index.ts +24 -3
- package/src/initService.ts +75 -16
- package/src/layouts/AddPageBox.vue +5 -1
- package/src/layouts/CodeEditor.vue +66 -11
- package/src/layouts/Framework.vue +32 -28
- package/src/layouts/NavMenu.vue +5 -1
- package/src/layouts/PropsPanel.vue +14 -4
- package/src/layouts/sidebar/ComponentListPanel.vue +11 -10
- package/src/layouts/sidebar/LayerMenu.vue +13 -25
- package/src/layouts/sidebar/LayerNode.vue +40 -0
- package/src/layouts/sidebar/LayerPanel.vue +71 -28
- package/src/layouts/sidebar/Sidebar.vue +13 -17
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +84 -118
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +63 -0
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +39 -34
- package/src/layouts/sidebar/data-source/DataSourceList.vue +145 -0
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +17 -65
- package/src/layouts/workspace/Breadcrumb.vue +5 -1
- package/src/layouts/workspace/PageBar.vue +5 -1
- package/src/layouts/workspace/PageBarScrollContainer.vue +5 -1
- package/src/layouts/workspace/Stage.vue +30 -8
- package/src/layouts/workspace/ViewerMenu.vue +15 -36
- package/src/layouts/workspace/Workspace.vue +9 -134
- package/src/services/codeBlock.ts +20 -72
- package/src/services/dataSource.ts +17 -2
- package/src/services/dep.ts +23 -20
- package/src/services/editor.ts +3 -3
- package/src/services/keybinding.ts +185 -0
- package/src/services/props.ts +2 -2
- package/src/services/storage.ts +3 -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-input.scss +18 -0
- package/src/theme/data-source-methods.scss +13 -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/resizer.scss +25 -10
- package/src/theme/stage.scss +4 -0
- package/src/theme/theme.scss +2 -0
- package/src/type.ts +105 -7
- package/src/utils/config.ts +1 -1
- package/src/utils/content-menu.ts +92 -0
- package/src/utils/data-source/formConfigs/base.ts +35 -30
- package/src/utils/data-source/index.ts +75 -6
- package/src/utils/dep.ts +39 -7
- package/src/utils/index.ts +1 -1
- package/src/utils/keybinding-config.ts +120 -0
- package/src/utils/props.ts +298 -155
- package/src/utils/undo-redo.ts +1 -1
- package/types/Editor.vue.d.ts +37 -4
- 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 +8 -3
- package/types/components/Icon.vue.d.ts +2 -2
- package/types/{layouts → components}/Resizer.vue.d.ts +2 -2
- package/types/components/ScrollBar.vue.d.ts +1 -1
- package/types/components/ScrollViewer.vue.d.ts +8 -5
- package/types/components/SearchInput.vue.d.ts +1 -1
- package/types/components/{Layout.vue.d.ts → SplitView.vue.d.ts} +9 -6
- package/types/components/ToolButton.vue.d.ts +10 -7
- package/types/editorProps.d.ts +23 -4
- package/types/fields/Code.vue.d.ts +23 -18
- package/types/fields/CodeLink.vue.d.ts +13 -22
- package/types/fields/CodeSelect.vue.d.ts +12 -20
- package/types/fields/CodeSelectCol.vue.d.ts +14 -15
- package/types/fields/DataSourceFieldSelect.vue.d.ts +29 -0
- package/types/fields/DataSourceFields.vue.d.ts +13 -21
- package/types/fields/DataSourceInput.vue.d.ts +34 -0
- 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 +3 -14
- package/types/fields/KeyValue.vue.d.ts +15 -27
- package/types/fields/UISelect.vue.d.ts +3 -12
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/use-code-block-edit.d.ts +125 -0
- package/types/hooks/use-data-source-method.d.ts +123 -0
- package/types/icons/AppManageIcon.vue.d.ts +1 -1
- package/types/icons/CenterIcon.vue.d.ts +2 -0
- package/types/icons/CodeIcon.vue.d.ts +1 -1
- package/types/index.d.ts +12 -2
- package/types/initService.d.ts +2 -2
- package/types/layouts/AddPageBox.vue.d.ts +1 -1
- package/types/layouts/CodeEditor.vue.d.ts +18 -10
- package/types/layouts/Framework.vue.d.ts +11 -32
- package/types/layouts/NavMenu.vue.d.ts +7 -4
- package/types/layouts/PropsPanel.vue.d.ts +276 -4
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +4 -4
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +2 -2
- package/types/layouts/sidebar/LayerNode.vue.d.ts +16 -0
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +5 -5
- package/types/layouts/sidebar/Sidebar.vue.d.ts +16 -16
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +7 -12
- package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +28 -0
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +4 -2
- 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/layouts/workspace/Breadcrumb.vue.d.ts +1 -1
- package/types/layouts/workspace/PageBar.vue.d.ts +5 -5
- package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +2 -2
- package/types/layouts/workspace/Stage.vue.d.ts +2 -2
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +7 -4
- package/types/layouts/workspace/Workspace.vue.d.ts +9 -9
- 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/keybinding.d.ts +20 -0
- package/types/services/props.d.ts +10 -115
- package/types/type.d.ts +97 -7
- package/types/utils/config.d.ts +1 -1
- package/types/utils/content-menu.d.ts +7 -0
- package/types/utils/data-source/formConfigs/base.d.ts +2 -2
- package/types/utils/data-source/index.d.ts +7 -1
- package/types/utils/dep.d.ts +4 -2
- package/types/utils/index.d.ts +1 -1
- package/types/utils/keybinding-config.d.ts +3 -0
- package/types/utils/props.d.ts +13 -102
- package/src/components/CodeDraftEditor.vue +0 -144
- package/src/components/FunctionEditor.vue +0 -190
- package/src/layouts/Resizer.vue +0 -32
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +0 -96
- package/types/components/CodeDraftEditor.vue.d.ts +0 -58
- package/types/components/FunctionEditor.vue.d.ts +0 -192
- package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +0 -25
- /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,160 +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: 'backgroundImage',
|
|
114
|
-
text: '背景图',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'backgroundColor',
|
|
118
|
-
text: '背景颜色',
|
|
119
|
-
type: 'colorPicker',
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: 'backgroundRepeat',
|
|
123
|
-
text: '背景图重复',
|
|
124
|
-
type: 'select',
|
|
125
|
-
defaultValue: 'no-repeat',
|
|
126
|
-
options: [
|
|
127
|
-
{ text: 'repeat', value: 'repeat' },
|
|
128
|
-
{ text: 'repeat-x', value: 'repeat-x' },
|
|
129
|
-
{ text: 'repeat-y', value: 'repeat-y' },
|
|
130
|
-
{ text: 'no-repeat', value: 'no-repeat' },
|
|
131
|
-
{ text: 'inherit', value: 'inherit' },
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: 'backgroundSize',
|
|
136
|
-
text: '背景图大小',
|
|
137
|
-
defaultValue: '100% 100%',
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
type: 'fieldset',
|
|
143
|
-
legend: '字体',
|
|
144
|
-
items: [
|
|
145
|
-
{
|
|
146
|
-
name: 'color',
|
|
147
|
-
text: '颜色',
|
|
148
|
-
type: 'colorPicker',
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: 'fontSize',
|
|
152
|
-
text: '大小',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: 'fontWeight',
|
|
156
|
-
text: '粗细',
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
type: 'fieldset',
|
|
162
|
-
legend: '变形',
|
|
163
|
-
name: 'transform',
|
|
164
|
-
items: [
|
|
165
|
-
{
|
|
166
|
-
name: 'rotate',
|
|
167
|
-
text: '旋转角度',
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
name: 'scale',
|
|
171
|
-
text: '缩放',
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
},
|
|
175
|
-
],
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
title: '事件',
|
|
181
|
-
items: [
|
|
182
|
-
{
|
|
183
|
-
name: 'events',
|
|
184
|
-
type: 'event-select',
|
|
185
|
-
labelWidth: 0,
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
title: '高级',
|
|
191
|
-
lazy: true,
|
|
192
|
-
items: [
|
|
193
|
-
{
|
|
194
|
-
name: 'created',
|
|
195
|
-
text: 'created',
|
|
196
|
-
labelWidth: '100px',
|
|
197
|
-
type: 'code-select',
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: 'mounted',
|
|
201
|
-
text: 'mounted',
|
|
202
|
-
labelWidth: '100px',
|
|
203
|
-
type: 'code-select',
|
|
204
|
-
},
|
|
205
|
-
],
|
|
206
|
-
},
|
|
346
|
+
{ ...styleTabConfig },
|
|
347
|
+
{ ...eventTabConfig },
|
|
348
|
+
{ ...advancedTabConfig },
|
|
349
|
+
{ ...displayTabConfig },
|
|
207
350
|
],
|
|
208
351
|
},
|
|
209
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,6 +51,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
51
|
}>>;
|
|
48
52
|
default: () => {};
|
|
49
53
|
};
|
|
54
|
+
datasourceConfigs: {
|
|
55
|
+
type: import("vue").PropType<Record<string, import("@tmagic/form").FormConfig>>;
|
|
56
|
+
default: () => {};
|
|
57
|
+
};
|
|
58
|
+
datasourceValues: {
|
|
59
|
+
type: import("vue").PropType<Record<string, Partial<import("@tmagic/schema").DataSourceSchema>>>;
|
|
60
|
+
default: () => {};
|
|
61
|
+
};
|
|
50
62
|
dataScourceConfigs: {
|
|
51
63
|
type: import("vue").PropType<Record<string, import("@tmagic/form").FormConfig>>;
|
|
52
64
|
default: () => {};
|
|
@@ -90,6 +102,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
90
102
|
disabledDragStart: {
|
|
91
103
|
type: BooleanConstructor;
|
|
92
104
|
};
|
|
105
|
+
extendFormState: {
|
|
106
|
+
type: import("vue").PropType<(state: import("@tmagic/form").FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
107
|
+
};
|
|
93
108
|
}, 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
109
|
modelValue: {
|
|
95
110
|
type: import("vue").PropType<import("@tmagic/schema").MApp>;
|
|
@@ -100,6 +115,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
115
|
type: import("vue").PropType<import("./type").ComponentGroup[]>;
|
|
101
116
|
default: () => never[];
|
|
102
117
|
};
|
|
118
|
+
datasourceList: {
|
|
119
|
+
type: import("vue").PropType<import("./type").DatasourceTypeOption[]>;
|
|
120
|
+
default: () => never[];
|
|
121
|
+
};
|
|
103
122
|
sidebar: {
|
|
104
123
|
type: import("vue").PropType<import("./type").SideBarData>;
|
|
105
124
|
};
|
|
@@ -128,7 +147,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
128
147
|
default: () => {};
|
|
129
148
|
};
|
|
130
149
|
propsValues: {
|
|
131
|
-
type: import("vue").PropType<Record<string, import("@tmagic/schema").MNode
|
|
150
|
+
type: import("vue").PropType<Record<string, Partial<import("@tmagic/schema").MNode>>>;
|
|
132
151
|
default: () => {};
|
|
133
152
|
};
|
|
134
153
|
eventMethodList: {
|
|
@@ -138,6 +157,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
138
157
|
}>>;
|
|
139
158
|
default: () => {};
|
|
140
159
|
};
|
|
160
|
+
datasourceConfigs: {
|
|
161
|
+
type: import("vue").PropType<Record<string, import("@tmagic/form").FormConfig>>;
|
|
162
|
+
default: () => {};
|
|
163
|
+
};
|
|
164
|
+
datasourceValues: {
|
|
165
|
+
type: import("vue").PropType<Record<string, Partial<import("@tmagic/schema").DataSourceSchema>>>;
|
|
166
|
+
default: () => {};
|
|
167
|
+
};
|
|
141
168
|
dataScourceConfigs: {
|
|
142
169
|
type: import("vue").PropType<Record<string, import("@tmagic/form").FormConfig>>;
|
|
143
170
|
default: () => {};
|
|
@@ -181,6 +208,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
181
208
|
disabledDragStart: {
|
|
182
209
|
type: BooleanConstructor;
|
|
183
210
|
};
|
|
211
|
+
extendFormState: {
|
|
212
|
+
type: import("vue").PropType<(state: import("@tmagic/form").FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
213
|
+
};
|
|
184
214
|
}>> & {
|
|
185
215
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
186
216
|
"onProps-panel-mounted"?: ((...args: any[]) => any) | undefined;
|
|
@@ -192,12 +222,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
192
222
|
layerContentMenu: (import("./type").MenuButton | import("./type").MenuComponent)[];
|
|
193
223
|
stageContentMenu: (import("./type").MenuButton | import("./type").MenuComponent)[];
|
|
194
224
|
componentGroupList: import("./type").ComponentGroup[];
|
|
225
|
+
datasourceList: import("./type").DatasourceTypeOption[];
|
|
195
226
|
propsConfigs: Record<string, import("@tmagic/form").FormConfig>;
|
|
196
|
-
propsValues: Record<string, import("@tmagic/schema").MNode
|
|
227
|
+
propsValues: Record<string, Partial<import("@tmagic/schema").MNode>>;
|
|
197
228
|
eventMethodList: Record<string, {
|
|
198
229
|
events: import("@tmagic/core").EventOption[];
|
|
199
230
|
methods: import("@tmagic/core").EventOption[];
|
|
200
231
|
}>;
|
|
232
|
+
datasourceConfigs: Record<string, import("@tmagic/form").FormConfig>;
|
|
233
|
+
datasourceValues: Record<string, Partial<import("@tmagic/schema").DataSourceSchema>>;
|
|
201
234
|
dataScourceConfigs: Record<string, import("@tmagic/form").FormConfig>;
|
|
202
235
|
canSelect: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
203
236
|
isContainer: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
@@ -205,5 +238,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
205
238
|
containerHighlightDuration: number;
|
|
206
239
|
containerHighlightType: import("@tmagic/stage").ContainerHighlightType;
|
|
207
240
|
disabledDragStart: boolean;
|
|
208
|
-
}>;
|
|
241
|
+
}, {}>;
|
|
209
242
|
export default _default;
|
|
@@ -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
|
+
};
|
|
@@ -6,8 +6,10 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
6
6
|
menuData: () => never[];
|
|
7
7
|
isSubMenu: boolean;
|
|
8
8
|
}>, {
|
|
9
|
+
menu: import("vue").Ref<HTMLDivElement | undefined>;
|
|
9
10
|
hide: () => void;
|
|
10
11
|
show: (e: MouseEvent) => void;
|
|
12
|
+
contains: (el: HTMLElement) => any;
|
|
11
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<{
|
|
12
14
|
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
13
15
|
isSubMenu?: boolean | undefined;
|
|
@@ -20,7 +22,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
20
22
|
}, {
|
|
21
23
|
menuData: (MenuButton | MenuComponent)[];
|
|
22
24
|
isSubMenu: boolean;
|
|
23
|
-
}>;
|
|
25
|
+
}, {}>;
|
|
24
26
|
export default _default;
|
|
25
27
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
28
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -32,7 +34,10 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
type __VLS_WithDefaults<P, D> = {
|
|
35
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
37
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
38
|
default: D[K];
|
|
37
|
-
} : P[K];
|
|
39
|
+
}> : P[K];
|
|
38
40
|
};
|
|
41
|
+
type __VLS_Prettify<T> = {
|
|
42
|
+
[K in keyof T]: T[K];
|
|
43
|
+
} & {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
2
2
|
icon?: any;
|
|
3
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
3
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
icon?: any;
|
|
5
|
-
}>>>, {}>;
|
|
5
|
+
}>>>, {}, {}>;
|
|
6
6
|
export default _default;
|
|
7
7
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
8
8
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
2
2
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
3
|
-
}, {}>, {
|
|
4
|
-
default
|
|
3
|
+
}, {}, {}>, {
|
|
4
|
+
default?(_: {}): any;
|
|
5
5
|
}>;
|
|
6
6
|
export default _default;
|
|
7
7
|
type __VLS_WithTemplateSlots<T, S> = T & {
|