@tmagic/editor 1.5.20 → 1.5.22
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 +14 -2
- package/dist/tmagic-editor.js +1746 -2415
- package/dist/tmagic-editor.umd.cjs +1744 -2413
- package/package.json +12 -12
- package/src/Editor.vue +17 -1
- package/src/components/CodeBlockEditor.vue +3 -3
- package/src/editorProps.ts +6 -0
- package/src/fields/DataSourceFieldSelect/Index.vue +8 -3
- package/src/fields/DataSourceInput.vue +12 -3
- package/src/fields/EventSelect.vue +37 -22
- package/src/fields/StyleSetter/pro/Position.vue +10 -2
- package/src/index.ts +3 -0
- package/src/initService.ts +16 -0
- package/src/layouts/CodeEditor.vue +36 -10
- package/src/layouts/sidebar/Sidebar.vue +14 -2
- package/src/layouts/workspace/viewer/Stage.vue +17 -3
- package/src/services/events.ts +2 -2
- package/src/services/props.ts +25 -1
- package/src/theme/code-editor.scss +7 -2
- package/src/theme/props-panel.scss +10 -0
- package/src/type.ts +16 -0
- package/src/utils/props.ts +39 -18
- package/types/index.d.ts +367 -349
package/src/utils/props.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
import { NODE_CONDS_KEY } from '@tmagic/core';
|
|
21
21
|
import { tMagicMessage } from '@tmagic/design';
|
|
22
|
-
import type { FormConfig, FormState, TabPaneConfig } from '@tmagic/form';
|
|
22
|
+
import type { FormConfig, FormState, TabConfig, TabPaneConfig } from '@tmagic/form';
|
|
23
23
|
|
|
24
24
|
export const arrayOptions = [
|
|
25
25
|
{ text: '包含', value: 'include' },
|
|
@@ -165,7 +165,14 @@ export const displayTabConfig: TabPaneConfig = {
|
|
|
165
165
|
* @param config 组件属性配置
|
|
166
166
|
* @returns Object
|
|
167
167
|
*/
|
|
168
|
-
export const fillConfig = (
|
|
168
|
+
export const fillConfig = (
|
|
169
|
+
config: FormConfig = [],
|
|
170
|
+
{
|
|
171
|
+
labelWidth = '80px',
|
|
172
|
+
disabledDataSource = false,
|
|
173
|
+
disabledCodeBlock = false,
|
|
174
|
+
}: { labelWidth?: string; disabledDataSource?: boolean; disabledCodeBlock?: boolean } = {},
|
|
175
|
+
): FormConfig => {
|
|
169
176
|
const propsConfig: FormConfig = [];
|
|
170
177
|
|
|
171
178
|
// 组件类型,必须要有
|
|
@@ -208,20 +215,34 @@ export const fillConfig = (config: FormConfig = [], labelWidth = '80px'): FormCo
|
|
|
208
215
|
});
|
|
209
216
|
}
|
|
210
217
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
218
|
+
const noCodeAdvancedTabItems = advancedTabConfig.items.filter((item) => item.type !== 'code-select');
|
|
219
|
+
|
|
220
|
+
if (noCodeAdvancedTabItems.length > 0 && disabledCodeBlock) {
|
|
221
|
+
advancedTabConfig.items = noCodeAdvancedTabItems;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const tabConfig: TabConfig = {
|
|
225
|
+
type: 'tab',
|
|
226
|
+
labelWidth,
|
|
227
|
+
items: [
|
|
228
|
+
{
|
|
229
|
+
title: '属性',
|
|
230
|
+
items: [...propsConfig, ...config],
|
|
231
|
+
},
|
|
232
|
+
{ ...styleTabConfig },
|
|
233
|
+
{ ...eventTabConfig },
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
if (!disabledCodeBlock) {
|
|
238
|
+
tabConfig.items.push({ ...advancedTabConfig });
|
|
239
|
+
} else if (noCodeAdvancedTabItems.length > 0) {
|
|
240
|
+
tabConfig.items.push({ ...advancedTabConfig });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (!disabledDataSource) {
|
|
244
|
+
tabConfig.items.push({ ...displayTabConfig });
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return [tabConfig];
|
|
227
248
|
};
|