@tmagic/editor 1.4.4 → 1.4.5
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 +2 -2
- package/dist/tmagic-editor.js +81 -54
- package/dist/tmagic-editor.umd.cjs +80 -52
- package/package.json +19 -24
- package/src/fields/DataSourceFieldSelect.vue +3 -41
- package/src/fields/EventSelect.vue +30 -9
- package/src/layouts/workspace/viewer/Stage.vue +7 -6
- package/src/services/editor.ts +2 -2
- package/src/utils/content-menu.ts +7 -3
- package/src/utils/data-source/index.ts +39 -3
- package/src/utils/editor.ts +14 -7
- package/types/components/CodeBlockEditor.vue.d.ts +21 -34
- package/types/components/CodeParams.vue.d.ts +2 -2
- package/types/components/ContentMenu.vue.d.ts +1 -1
- package/types/components/FloatingBox.vue.d.ts +41 -38
- package/types/components/ScrollViewer.vue.d.ts +1 -1
- package/types/components/ToolButton.vue.d.ts +4 -4
- package/types/components/Tree.vue.d.ts +2 -2
- package/types/fields/CodeLink.vue.d.ts +2 -2
- package/types/fields/DataSourceFields.vue.d.ts +32 -78
- package/types/fields/DataSourceInput.vue.d.ts +2 -2
- package/types/fields/DataSourceMethods.vue.d.ts +2 -2
- package/types/fields/DataSourceMocks.vue.d.ts +31 -76
- package/types/fields/KeyValue.vue.d.ts +2 -2
- package/types/fields/UISelect.vue.d.ts +2 -2
- package/types/hooks/use-code-block-edit.d.ts +18 -6
- package/types/hooks/use-data-source-edit.d.ts +18 -6
- package/types/hooks/use-data-source-method.d.ts +18 -6
- package/types/layouts/CodeEditor.vue.d.ts +1 -1
- package/types/layouts/PropsPanel.vue.d.ts +38 -38
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +1 -1
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +20 -30
- package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +1 -1
- package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +6 -6
- package/types/layouts/workspace/viewer/Stage.vue.d.ts +4 -4
- package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +6 -6
- package/types/services/dataSource.d.ts +1 -0
- package/types/services/ui.d.ts +1 -1
- package/types/utils/data-source/index.d.ts +3 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="m-fields-data-source-field-select">
|
|
3
3
|
<component
|
|
4
|
-
style="width: 100%"
|
|
5
4
|
:is="tagName"
|
|
6
5
|
:config="showDataSourceFieldSelect || !config.fieldConfig ? cascaderConfig : config.fieldConfig"
|
|
7
6
|
:model="model"
|
|
@@ -39,14 +38,14 @@ import { computed, inject, ref, resolveComponent, watch } from 'vue';
|
|
|
39
38
|
import { Coin, Edit, View } from '@element-plus/icons-vue';
|
|
40
39
|
|
|
41
40
|
import { TMagicButton } from '@tmagic/design';
|
|
42
|
-
import type { CascaderConfig,
|
|
41
|
+
import type { CascaderConfig, FieldProps, FormState } from '@tmagic/form';
|
|
43
42
|
import { filterFunction, MCascader } from '@tmagic/form';
|
|
44
|
-
import type { DataSchema, DataSourceFieldType } from '@tmagic/schema';
|
|
45
43
|
import { DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX } from '@tmagic/utils';
|
|
46
44
|
|
|
47
45
|
import MIcon from '@editor/components/Icon.vue';
|
|
48
46
|
import type { DataSourceFieldSelectConfig, EventBus, Services } from '@editor/type';
|
|
49
47
|
import { SideItemKey } from '@editor/type';
|
|
48
|
+
import { getCascaderOptionsFromFields } from '@editor/utils';
|
|
50
49
|
|
|
51
50
|
defineOptions({
|
|
52
51
|
name: 'MFieldsDataSourceFieldSelect',
|
|
@@ -77,43 +76,6 @@ const selectedDataSourceId = computed(() => {
|
|
|
77
76
|
|
|
78
77
|
const dataSources = computed(() => services?.dataSourceService.get('dataSources'));
|
|
79
78
|
|
|
80
|
-
const getOptionChildren = (
|
|
81
|
-
fields: DataSchema[] = [],
|
|
82
|
-
dataSourceFieldType: DataSourceFieldType[] = ['any'],
|
|
83
|
-
): CascaderOption[] => {
|
|
84
|
-
const child: CascaderOption[] = [];
|
|
85
|
-
fields.forEach((field) => {
|
|
86
|
-
if (!dataSourceFieldType.length) {
|
|
87
|
-
dataSourceFieldType.push('any');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const children = getOptionChildren(field.fields, dataSourceFieldType);
|
|
91
|
-
|
|
92
|
-
const item = {
|
|
93
|
-
label: field.title || field.name,
|
|
94
|
-
value: field.name,
|
|
95
|
-
children,
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const fieldType = field.type || 'any';
|
|
99
|
-
if (dataSourceFieldType.includes('any') || dataSourceFieldType.includes(fieldType)) {
|
|
100
|
-
child.push(item);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (!dataSourceFieldType.includes(fieldType) && !['array', 'object', 'any'].includes(fieldType)) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (!children.length && ['object', 'array', 'any'].includes(field.type || '')) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
child.push(item);
|
|
113
|
-
});
|
|
114
|
-
return child;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
79
|
const cascaderConfig = computed<CascaderConfig>(() => {
|
|
118
80
|
const valueIsKey = props.config.value === 'key';
|
|
119
81
|
|
|
@@ -126,7 +88,7 @@ const cascaderConfig = computed<CascaderConfig>(() => {
|
|
|
126
88
|
dataSources.value?.map((ds) => ({
|
|
127
89
|
label: ds.title || ds.id,
|
|
128
90
|
value: valueIsKey ? ds.id : `${DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX}${ds.id}`,
|
|
129
|
-
children:
|
|
91
|
+
children: getCascaderOptionsFromFields(ds.fields, props.config.dataSourceFieldType),
|
|
130
92
|
})) || [];
|
|
131
93
|
return options.filter((option) => option.children.length);
|
|
132
94
|
},
|
|
@@ -55,11 +55,13 @@ import { has } from 'lodash-es';
|
|
|
55
55
|
|
|
56
56
|
import type { EventOption } from '@tmagic/core';
|
|
57
57
|
import { TMagicButton } from '@tmagic/design';
|
|
58
|
-
import type { FieldProps, FormState, PanelConfig } from '@tmagic/form';
|
|
58
|
+
import type { CascaderOption, FieldProps, FormState, PanelConfig } from '@tmagic/form';
|
|
59
59
|
import { MContainer, MPanel } from '@tmagic/form';
|
|
60
60
|
import { ActionType } from '@tmagic/schema';
|
|
61
|
+
import { DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX } from '@tmagic/utils';
|
|
61
62
|
|
|
62
63
|
import type { CodeSelectColConfig, DataSourceMethodSelectConfig, EventSelectConfig, Services } from '@editor/type';
|
|
64
|
+
import { getCascaderOptionsFromFields } from '@editor/utils';
|
|
63
65
|
|
|
64
66
|
defineOptions({
|
|
65
67
|
name: 'MFieldsEventSelect',
|
|
@@ -78,26 +80,45 @@ const codeBlockService = services?.codeBlockService;
|
|
|
78
80
|
|
|
79
81
|
// 事件名称下拉框表单配置
|
|
80
82
|
const eventNameConfig = computed(() => {
|
|
83
|
+
const fieldType = props.config.src === 'component' ? 'select' : 'cascader';
|
|
81
84
|
const defaultEventNameConfig = {
|
|
82
85
|
name: 'name',
|
|
83
86
|
text: '事件',
|
|
84
|
-
type:
|
|
87
|
+
type: fieldType,
|
|
85
88
|
labelWidth: '40px',
|
|
89
|
+
checkStrictly: true,
|
|
90
|
+
valueSeparator: '.',
|
|
86
91
|
options: (mForm: FormState, { formValue }: any) => {
|
|
87
|
-
let events: EventOption[] = [];
|
|
92
|
+
let events: EventOption[] | CascaderOption[] = [];
|
|
88
93
|
|
|
89
94
|
if (!eventsService || !dataSourceService) return events;
|
|
90
95
|
|
|
91
96
|
if (props.config.src === 'component') {
|
|
92
97
|
events = eventsService.getEvent(formValue.type);
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
return events.map((option) => ({
|
|
99
|
+
text: option.label,
|
|
100
|
+
value: option.value,
|
|
101
|
+
}));
|
|
95
102
|
}
|
|
103
|
+
if (props.config.src === 'datasource') {
|
|
104
|
+
// 从数据源类型中获取到相关事件
|
|
105
|
+
events = dataSourceService.getFormEvent(formValue.type);
|
|
106
|
+
// 从数据源类型和实例中分别获取数据以追加数据变化的事件
|
|
107
|
+
const dataSource = dataSourceService.getDataSourceById(formValue.id);
|
|
108
|
+
const fields = dataSource?.fields || [];
|
|
109
|
+
if (fields.length > 0) {
|
|
110
|
+
return [
|
|
111
|
+
...events,
|
|
112
|
+
{
|
|
113
|
+
label: '数据变化',
|
|
114
|
+
value: DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX,
|
|
115
|
+
children: getCascaderOptionsFromFields(fields),
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
}
|
|
96
119
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
value: option.value,
|
|
100
|
-
}));
|
|
120
|
+
return events;
|
|
121
|
+
}
|
|
101
122
|
},
|
|
102
123
|
};
|
|
103
124
|
return { ...defaultEventNameConfig, ...props.config.eventNameConfig };
|
|
@@ -45,7 +45,8 @@ import { computed, inject, markRaw, nextTick, onBeforeUnmount, onMounted, ref, t
|
|
|
45
45
|
import { cloneDeep } from 'lodash-es';
|
|
46
46
|
|
|
47
47
|
import type { MApp, MContainer } from '@tmagic/schema';
|
|
48
|
-
import StageCore, {
|
|
48
|
+
import StageCore, { getOffset, Runtime } from '@tmagic/stage';
|
|
49
|
+
import { calcValueByFontsize } from '@tmagic/utils';
|
|
49
50
|
|
|
50
51
|
import ScrollViewer from '@editor/components/ScrollViewer.vue';
|
|
51
52
|
import { useStage } from '@editor/hooks/use-stage';
|
|
@@ -223,18 +224,18 @@ const dropHandler = async (e: DragEvent) => {
|
|
|
223
224
|
top = e.clientY - containerRect.top + scrollTop;
|
|
224
225
|
left = e.clientX - containerRect.left + scrollLeft;
|
|
225
226
|
|
|
226
|
-
if (parentEl
|
|
227
|
+
if (parentEl) {
|
|
227
228
|
const { left: parentLeft, top: parentTop } = getOffset(parentEl);
|
|
228
|
-
left = left -
|
|
229
|
-
top = top -
|
|
229
|
+
left = left - parentLeft * zoom.value;
|
|
230
|
+
top = top - parentTop * zoom.value;
|
|
230
231
|
}
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
config.data.style = {
|
|
234
235
|
...style,
|
|
235
236
|
position,
|
|
236
|
-
top: top / zoom.value,
|
|
237
|
-
left: left / zoom.value,
|
|
237
|
+
top: calcValueByFontsize(doc, top / zoom.value),
|
|
238
|
+
left: calcValueByFontsize(doc, left / zoom.value),
|
|
238
239
|
};
|
|
239
240
|
|
|
240
241
|
config.data.inputEvent = e;
|
package/src/services/editor.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { Writable } from 'type-fest';
|
|
|
23
23
|
import { DepTargetType } from '@tmagic/dep';
|
|
24
24
|
import type { Id, MApp, MComponent, MContainer, MNode, MPage, MPageFragment } from '@tmagic/schema';
|
|
25
25
|
import { NodeType } from '@tmagic/schema';
|
|
26
|
-
import { getNodePath, isNumber, isPage, isPageFragment, isPop } from '@tmagic/utils';
|
|
26
|
+
import { calcValueByFontsize, getNodePath, isNumber, isPage, isPageFragment, isPop } from '@tmagic/utils';
|
|
27
27
|
|
|
28
28
|
import BaseService from '@editor/services//BaseService';
|
|
29
29
|
import propsService from '@editor/services//props';
|
|
@@ -741,7 +741,7 @@ class Editor extends BaseService {
|
|
|
741
741
|
const el = doc.getElementById(`${node.id}`);
|
|
742
742
|
const parentEl = layout === Layout.FIXED ? doc.body : el?.offsetParent;
|
|
743
743
|
if (parentEl && el) {
|
|
744
|
-
node.style.left = (parentEl.clientWidth - el.clientWidth) / 2;
|
|
744
|
+
node.style.left = calcValueByFontsize(doc, (parentEl.clientWidth - el.clientWidth) / 2);
|
|
745
745
|
node.style.right = '';
|
|
746
746
|
}
|
|
747
747
|
} else if (parent.style && isNumber(parent.style?.width) && isNumber(node.style?.width)) {
|
|
@@ -2,7 +2,7 @@ import { computed, markRaw, Ref } from 'vue';
|
|
|
2
2
|
import { CopyDocument, Delete, DocumentCopy } from '@element-plus/icons-vue';
|
|
3
3
|
|
|
4
4
|
import { Id, MContainer, NodeType } from '@tmagic/schema';
|
|
5
|
-
import { isPage, isPageFragment } from '@tmagic/utils';
|
|
5
|
+
import { calcValueByFontsize, isPage, isPageFragment } from '@tmagic/utils';
|
|
6
6
|
|
|
7
7
|
import ContentMenu from '@editor/components/ContentMenu.vue';
|
|
8
8
|
import type { MenuButton, Services } from '@editor/type';
|
|
@@ -46,8 +46,12 @@ export const usePasteMenu = (menu?: Ref<InstanceType<typeof ContentMenu> | undef
|
|
|
46
46
|
const stage = services?.editorService?.get('stage');
|
|
47
47
|
const rect = menu.value.$el.getBoundingClientRect();
|
|
48
48
|
const parentRect = stage?.container?.getBoundingClientRect();
|
|
49
|
-
const initialLeft =
|
|
50
|
-
|
|
49
|
+
const initialLeft =
|
|
50
|
+
calcValueByFontsize(stage?.renderer.getDocument(), (rect.left || 0) - (parentRect?.left || 0)) /
|
|
51
|
+
services.uiService.get('zoom');
|
|
52
|
+
const initialTop =
|
|
53
|
+
calcValueByFontsize(stage?.renderer.getDocument(), (rect.top || 0) - (parentRect?.top || 0)) /
|
|
54
|
+
services.uiService.get('zoom');
|
|
51
55
|
services?.editorService?.paste({ left: initialLeft, top: initialTop });
|
|
52
56
|
} else {
|
|
53
57
|
services?.editorService?.paste();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormConfig, FormState } from '@tmagic/form';
|
|
2
|
-
import { DataSchema, DataSourceSchema } from '@tmagic/schema';
|
|
1
|
+
import { CascaderOption, FormConfig, FormState } from '@tmagic/form';
|
|
2
|
+
import { DataSchema, DataSourceFieldType, DataSourceSchema } from '@tmagic/schema';
|
|
3
3
|
|
|
4
4
|
import BaseFormConfig from './formConfigs/base';
|
|
5
5
|
import HttpFormConfig from './formConfigs/http';
|
|
@@ -32,7 +32,6 @@ const fillConfig = (config: FormConfig): FormConfig => [
|
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
title: '事件配置',
|
|
35
|
-
display: false,
|
|
36
35
|
items: [
|
|
37
36
|
{
|
|
38
37
|
name: 'events',
|
|
@@ -198,3 +197,40 @@ export const getDisplayField = (dataSources: DataSourceSchema[], key: string) =>
|
|
|
198
197
|
|
|
199
198
|
return displayState;
|
|
200
199
|
};
|
|
200
|
+
|
|
201
|
+
export const getCascaderOptionsFromFields = (
|
|
202
|
+
fields: DataSchema[] = [],
|
|
203
|
+
dataSourceFieldType: DataSourceFieldType[] = ['any'],
|
|
204
|
+
): CascaderOption[] => {
|
|
205
|
+
const child: CascaderOption[] = [];
|
|
206
|
+
fields.forEach((field) => {
|
|
207
|
+
if (!dataSourceFieldType.length) {
|
|
208
|
+
dataSourceFieldType.push('any');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const children = getCascaderOptionsFromFields(field.fields, dataSourceFieldType);
|
|
212
|
+
|
|
213
|
+
const item = {
|
|
214
|
+
label: field.title || field.name,
|
|
215
|
+
value: field.name,
|
|
216
|
+
children,
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const fieldType = field.type || 'any';
|
|
220
|
+
if (dataSourceFieldType.includes('any') || dataSourceFieldType.includes(fieldType)) {
|
|
221
|
+
child.push(item);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (!dataSourceFieldType.includes(fieldType) && !['array', 'object', 'any'].includes(fieldType)) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (!children.length && ['object', 'array', 'any'].includes(field.type || '')) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
child.push(item);
|
|
234
|
+
});
|
|
235
|
+
return child;
|
|
236
|
+
};
|
package/src/utils/editor.ts
CHANGED
|
@@ -21,7 +21,7 @@ import serialize from 'serialize-javascript';
|
|
|
21
21
|
import type { Id, MApp, MContainer, MNode, MPage, MPageFragment } from '@tmagic/schema';
|
|
22
22
|
import { NodeType } from '@tmagic/schema';
|
|
23
23
|
import type StageCore from '@tmagic/stage';
|
|
24
|
-
import { getNodePath, isNumber, isPage, isPageFragment, isPop } from '@tmagic/utils';
|
|
24
|
+
import { calcValueByFontsize, getNodePath, isNumber, isPage, isPageFragment, isPop } from '@tmagic/utils';
|
|
25
25
|
|
|
26
26
|
import { Layout } from '@editor/type';
|
|
27
27
|
export const COPY_STORAGE_KEY = '$MagicEditorCopyData';
|
|
@@ -106,13 +106,16 @@ const getMiddleTop = (node: MNode, parentNode: MNode, stage: StageCore | null) =
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const { height: parentHeight } = parentNode.style;
|
|
109
|
-
|
|
109
|
+
// wrapperHeight 是未 calcValue的高度, 所以要将其calcValueByFontsize一下, 否则在pad or pc端计算的结果有误
|
|
110
|
+
const { scrollTop = 0, wrapperHeight } = stage.mask;
|
|
111
|
+
const wrapperHeightDeal = calcValueByFontsize(stage.renderer.getDocument()!, wrapperHeight);
|
|
112
|
+
const scrollTopDeal = calcValueByFontsize(stage.renderer.getDocument()!, scrollTop);
|
|
110
113
|
if (isPage(parentNode)) {
|
|
111
|
-
|
|
112
|
-
return (wrapperHeight - height) / 2 + scrollTop;
|
|
114
|
+
return (wrapperHeightDeal - height) / 2 + scrollTopDeal;
|
|
113
115
|
}
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
// 如果容器的元素高度大于当前视口高度的2倍, 添加的元素居中位置也会看不见, 所以要取最小值计算
|
|
118
|
+
return (Math.min(parentHeight, wrapperHeightDeal) - height) / 2;
|
|
116
119
|
};
|
|
117
120
|
|
|
118
121
|
export const getInitPositionStyle = (style: Record<string, any> = {}, layout: Layout) => {
|
|
@@ -238,8 +241,12 @@ export const fixNodeLeft = (config: MNode, parent: MContainer, doc?: Document) =
|
|
|
238
241
|
const parentEl = doc.getElementById(`${parent.id}`);
|
|
239
242
|
|
|
240
243
|
const left = Number(config.style?.left) || 0;
|
|
241
|
-
if (el && parentEl
|
|
242
|
-
|
|
244
|
+
if (el && parentEl) {
|
|
245
|
+
const calcParentOffsetWidth = calcValueByFontsize(doc, parentEl.offsetWidth);
|
|
246
|
+
const calcElOffsetWidth = calcValueByFontsize(doc, el.offsetWidth);
|
|
247
|
+
if (calcElOffsetWidth + left > calcParentOffsetWidth) {
|
|
248
|
+
return calcParentOffsetWidth - calcElOffsetWidth;
|
|
249
|
+
}
|
|
243
250
|
}
|
|
244
251
|
|
|
245
252
|
return config.style.left;
|
|
@@ -1,46 +1,33 @@
|
|
|
1
1
|
import type { CodeBlockContent } from '@tmagic/schema';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: import("vue").PropType<boolean>;
|
|
14
|
-
};
|
|
15
|
-
dataSourceType: {
|
|
16
|
-
type: import("vue").PropType<string>;
|
|
17
|
-
};
|
|
18
|
-
}, {
|
|
2
|
+
declare let __VLS_typeProps: {
|
|
3
|
+
content: CodeBlockContent;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
isDataSource?: boolean;
|
|
6
|
+
dataSourceType?: string;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_PublicProps = {
|
|
9
|
+
'width'?: number;
|
|
10
|
+
'visible'?: boolean;
|
|
11
|
+
} & typeof __VLS_typeProps;
|
|
12
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
19
13
|
show(): Promise<void>;
|
|
20
14
|
hide(): Promise<void>;
|
|
21
15
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
16
|
"update:width": (width: number) => void;
|
|
23
17
|
"update:visible": (visible: boolean) => void;
|
|
24
18
|
submit: (values: CodeBlockContent) => void;
|
|
25
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
|
-
width: import("vue").PropType<number>;
|
|
27
|
-
visible: import("vue").PropType<boolean>;
|
|
28
|
-
content: {
|
|
29
|
-
type: import("vue").PropType<CodeBlockContent>;
|
|
30
|
-
required: true;
|
|
31
|
-
};
|
|
32
|
-
disabled: {
|
|
33
|
-
type: import("vue").PropType<boolean>;
|
|
34
|
-
};
|
|
35
|
-
isDataSource: {
|
|
36
|
-
type: import("vue").PropType<boolean>;
|
|
37
|
-
};
|
|
38
|
-
dataSourceType: {
|
|
39
|
-
type: import("vue").PropType<string>;
|
|
40
|
-
};
|
|
41
|
-
}>> & {
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
|
|
42
20
|
onSubmit?: ((values: CodeBlockContent) => any) | undefined;
|
|
43
21
|
"onUpdate:width"?: ((width: number) => any) | undefined;
|
|
44
22
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
45
23
|
}, {}, {}>;
|
|
46
24
|
export default _default;
|
|
25
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
+
type __VLS_TypePropsToOption<T> = {
|
|
27
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
+
} : {
|
|
30
|
+
type: import('vue').PropType<T[K]>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CodeParamStatement } from '../type';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
3
|
model: any;
|
|
4
|
-
size?: "
|
|
4
|
+
size?: "default" | "small" | "large" | undefined;
|
|
5
5
|
disabled?: boolean | undefined;
|
|
6
6
|
name: string;
|
|
7
7
|
paramsConfig: CodeParamStatement[];
|
|
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
|
9
9
|
change: (...args: any[]) => void;
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
11
11
|
model: any;
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "default" | "small" | "large" | undefined;
|
|
13
13
|
disabled?: boolean | undefined;
|
|
14
14
|
name: string;
|
|
15
15
|
paramsConfig: CodeParamStatement[];
|
|
@@ -25,9 +25,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
25
25
|
clientX: number;
|
|
26
26
|
}) => void;
|
|
27
27
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
mouseenter: () => void;
|
|
28
29
|
show: () => void;
|
|
29
30
|
hide: () => void;
|
|
30
|
-
mouseenter: () => void;
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
32
32
|
menuData?: (MenuComponent | MenuButton)[] | undefined;
|
|
33
33
|
isSubMenu?: boolean | undefined;
|
|
@@ -2,54 +2,40 @@ interface Position {
|
|
|
2
2
|
left: number;
|
|
3
3
|
top: number;
|
|
4
4
|
}
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
beforeClose: {
|
|
21
|
-
type: import("vue").PropType<(done: (cancel?: boolean | undefined) => void) => void>;
|
|
5
|
+
declare let __VLS_typeProps: {
|
|
6
|
+
position?: Position;
|
|
7
|
+
title?: string;
|
|
8
|
+
beforeClose?: (done: (cancel?: boolean) => void) => void;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = {
|
|
11
|
+
'width'?: number;
|
|
12
|
+
'height'?: number;
|
|
13
|
+
'visible'?: boolean;
|
|
14
|
+
} & typeof __VLS_typeProps;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
16
|
+
title: string;
|
|
17
|
+
position: () => {
|
|
18
|
+
left: number;
|
|
19
|
+
top: number;
|
|
22
20
|
};
|
|
23
|
-
}
|
|
21
|
+
}>, {
|
|
24
22
|
bodyHeight: import("vue").ComputedRef<number | "auto">;
|
|
25
23
|
target: import("vue").Ref<HTMLDivElement | undefined>;
|
|
26
24
|
titleEl: import("vue").Ref<HTMLDivElement | undefined>;
|
|
27
25
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
26
|
"update:width": (width: number) => void;
|
|
29
|
-
"update:visible": (visible: boolean) => void;
|
|
30
27
|
"update:height": (height: number) => void;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
default: string;
|
|
38
|
-
};
|
|
39
|
-
position: {
|
|
40
|
-
type: import("vue").PropType<Position>;
|
|
41
|
-
default: () => {
|
|
42
|
-
left: number;
|
|
43
|
-
top: number;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
beforeClose: {
|
|
47
|
-
type: import("vue").PropType<(done: (cancel?: boolean | undefined) => void) => void>;
|
|
28
|
+
"update:visible": (visible: boolean) => void;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
30
|
+
title: string;
|
|
31
|
+
position: () => {
|
|
32
|
+
left: number;
|
|
33
|
+
top: number;
|
|
48
34
|
};
|
|
49
|
-
}
|
|
35
|
+
}>>> & {
|
|
50
36
|
"onUpdate:width"?: ((width: number) => any) | undefined;
|
|
51
|
-
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
52
37
|
"onUpdate:height"?: ((height: number) => any) | undefined;
|
|
38
|
+
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
53
39
|
}, {
|
|
54
40
|
title: string;
|
|
55
41
|
position: Position;
|
|
@@ -58,8 +44,25 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
58
44
|
body?(_: {}): any;
|
|
59
45
|
}>;
|
|
60
46
|
export default _default;
|
|
47
|
+
type __VLS_WithDefaults<P, D> = {
|
|
48
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
49
|
+
default: D[K];
|
|
50
|
+
}> : P[K];
|
|
51
|
+
};
|
|
52
|
+
type __VLS_Prettify<T> = {
|
|
53
|
+
[K in keyof T]: T[K];
|
|
54
|
+
} & {};
|
|
61
55
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
62
56
|
new (): {
|
|
63
57
|
$slots: S;
|
|
64
58
|
};
|
|
65
59
|
};
|
|
60
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
61
|
+
type __VLS_TypePropsToOption<T> = {
|
|
62
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
63
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
64
|
+
} : {
|
|
65
|
+
type: import('vue').PropType<T[K]>;
|
|
66
|
+
required: true;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -41,8 +41,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
41
41
|
height: number;
|
|
42
42
|
};
|
|
43
43
|
}>>>, {
|
|
44
|
-
height: string | number;
|
|
45
44
|
width: string | number;
|
|
45
|
+
height: string | number;
|
|
46
46
|
zoom: number;
|
|
47
47
|
wrapWidth: number;
|
|
48
48
|
wrapHeight: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MenuButton, MenuComponent } from '../type';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
3
3
|
data?: MenuComponent | MenuButton | undefined;
|
|
4
|
-
eventType?: "mousedown" | "
|
|
4
|
+
eventType?: "mousedown" | "mouseup" | "click" | undefined;
|
|
5
5
|
}>, {
|
|
6
6
|
data: () => {
|
|
7
7
|
type: string;
|
|
@@ -10,7 +10,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
10
10
|
eventType: string;
|
|
11
11
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
12
12
|
data?: MenuComponent | MenuButton | undefined;
|
|
13
|
-
eventType?: "mousedown" | "
|
|
13
|
+
eventType?: "mousedown" | "mouseup" | "click" | undefined;
|
|
14
14
|
}>, {
|
|
15
15
|
data: () => {
|
|
16
16
|
type: string;
|
|
@@ -18,8 +18,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
18
18
|
};
|
|
19
19
|
eventType: string;
|
|
20
20
|
}>>>, {
|
|
21
|
-
data:
|
|
22
|
-
eventType:
|
|
21
|
+
data: MenuComponent | MenuButton;
|
|
22
|
+
eventType: "mousedown" | "mouseup" | "click";
|
|
23
23
|
}, {}>;
|
|
24
24
|
export default _default;
|
|
25
25
|
type __VLS_WithDefaults<P, D> = {
|
|
@@ -9,13 +9,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
9
9
|
indent: number;
|
|
10
10
|
emptyText: string;
|
|
11
11
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
-
"node-dragover": (event: DragEvent) => void;
|
|
13
12
|
"node-dragstart": (event: DragEvent, data: TreeNodeData) => void;
|
|
14
13
|
"node-dragleave": (event: DragEvent, data: TreeNodeData) => void;
|
|
15
14
|
"node-dragend": (event: DragEvent, data: TreeNodeData) => void;
|
|
16
15
|
"node-contextmenu": (event: MouseEvent, data: TreeNodeData) => void;
|
|
17
16
|
"node-mouseenter": (event: MouseEvent, data: TreeNodeData) => void;
|
|
18
17
|
"node-click": (event: MouseEvent, data: TreeNodeData) => void;
|
|
18
|
+
"node-dragover": (event: DragEvent) => void;
|
|
19
19
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
20
20
|
data: TreeNodeData[];
|
|
21
21
|
nodeStatusMap: Map<Id, LayerNodeStatus>;
|
|
@@ -25,13 +25,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
25
25
|
indent: number;
|
|
26
26
|
emptyText: string;
|
|
27
27
|
}>>> & {
|
|
28
|
-
"onNode-dragover"?: ((event: DragEvent) => any) | undefined;
|
|
29
28
|
"onNode-dragstart"?: ((event: DragEvent, data: TreeNodeData) => any) | undefined;
|
|
30
29
|
"onNode-dragleave"?: ((event: DragEvent, data: TreeNodeData) => any) | undefined;
|
|
31
30
|
"onNode-dragend"?: ((event: DragEvent, data: TreeNodeData) => any) | undefined;
|
|
32
31
|
"onNode-contextmenu"?: ((event: MouseEvent, data: TreeNodeData) => any) | undefined;
|
|
33
32
|
"onNode-mouseenter"?: ((event: MouseEvent, data: TreeNodeData) => any) | undefined;
|
|
34
33
|
"onNode-click"?: ((event: MouseEvent, data: TreeNodeData) => any) | undefined;
|
|
34
|
+
"onNode-dragover"?: ((event: DragEvent) => any) | undefined;
|
|
35
35
|
}, {
|
|
36
36
|
indent: number;
|
|
37
37
|
emptyText: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { FieldProps, FormItem } from '@tmagic/form';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<FieldProps<{
|
|
3
|
-
type:
|
|
3
|
+
type: "code-link";
|
|
4
4
|
formTitle?: string | undefined;
|
|
5
5
|
codeOptions?: Object | undefined;
|
|
6
6
|
} & FormItem>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
7
|
change: (...args: any[]) => void;
|
|
8
8
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<FieldProps<{
|
|
9
|
-
type:
|
|
9
|
+
type: "code-link";
|
|
10
10
|
formTitle?: string | undefined;
|
|
11
11
|
codeOptions?: Object | undefined;
|
|
12
12
|
} & FormItem>>>> & {
|