@tmagic/editor 1.4.4 → 1.4.6
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 +2393 -2242
- package/dist/tmagic-editor.umd.cjs +2403 -2248
- package/package.json +27 -27
- package/src/editorProps.ts +5 -1
- package/src/fields/DataSourceFieldSelect.vue +3 -41
- package/src/fields/EventSelect.vue +30 -9
- package/src/hooks/use-code-block-edit.ts +0 -2
- package/src/hooks/use-stage.ts +1 -1
- package/src/index.ts +1 -0
- package/src/initService.ts +12 -2
- package/src/layouts/workspace/viewer/Stage.vue +7 -6
- package/src/services/codeBlock.ts +77 -9
- package/src/services/dataSource.ts +53 -4
- package/src/services/editor.ts +2 -2
- package/src/services/props.ts +10 -5
- package/src/services/stageOverlay.ts +1 -0
- package/src/type.ts +1 -0
- package/src/utils/content-menu.ts +7 -3
- package/src/utils/data-source/index.ts +39 -3
- package/src/utils/editor.ts +16 -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/editorProps.d.ts +5 -1
- 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/index.d.ts +1 -0
- package/types/layouts/CodeEditor.vue.d.ts +1 -1
- package/types/layouts/PropsPanel.vue.d.ts +14 -14
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +20 -30
- 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/codeBlock.d.ts +22 -2
- package/types/services/dataSource.d.ts +13 -1
- package/types/services/ui.d.ts +1 -1
- package/types/type.d.ts +1 -0
- package/types/utils/data-source/index.d.ts +3 -2
- package/types/utils/editor.d.ts +2 -0
|
@@ -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,10 +21,12 @@ 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';
|
|
28
|
+
export const COPY_CODE_STORAGE_KEY = '$MagicEditorCopyCode';
|
|
29
|
+
export const COPY_DS_STORAGE_KEY = '$MagicEditorCopyDataSource';
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* 获取所有页面配置
|
|
@@ -106,13 +108,16 @@ const getMiddleTop = (node: MNode, parentNode: MNode, stage: StageCore | null) =
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
const { height: parentHeight } = parentNode.style;
|
|
109
|
-
|
|
111
|
+
// wrapperHeight 是未 calcValue的高度, 所以要将其calcValueByFontsize一下, 否则在pad or pc端计算的结果有误
|
|
112
|
+
const { scrollTop = 0, wrapperHeight } = stage.mask;
|
|
113
|
+
const wrapperHeightDeal = calcValueByFontsize(stage.renderer.getDocument()!, wrapperHeight);
|
|
114
|
+
const scrollTopDeal = calcValueByFontsize(stage.renderer.getDocument()!, scrollTop);
|
|
110
115
|
if (isPage(parentNode)) {
|
|
111
|
-
|
|
112
|
-
return (wrapperHeight - height) / 2 + scrollTop;
|
|
116
|
+
return (wrapperHeightDeal - height) / 2 + scrollTopDeal;
|
|
113
117
|
}
|
|
114
118
|
|
|
115
|
-
|
|
119
|
+
// 如果容器的元素高度大于当前视口高度的2倍, 添加的元素居中位置也会看不见, 所以要取最小值计算
|
|
120
|
+
return (Math.min(parentHeight, wrapperHeightDeal) - height) / 2;
|
|
116
121
|
};
|
|
117
122
|
|
|
118
123
|
export const getInitPositionStyle = (style: Record<string, any> = {}, layout: Layout) => {
|
|
@@ -238,8 +243,12 @@ export const fixNodeLeft = (config: MNode, parent: MContainer, doc?: Document) =
|
|
|
238
243
|
const parentEl = doc.getElementById(`${parent.id}`);
|
|
239
244
|
|
|
240
245
|
const left = Number(config.style?.left) || 0;
|
|
241
|
-
if (el && parentEl
|
|
242
|
-
|
|
246
|
+
if (el && parentEl) {
|
|
247
|
+
const calcParentOffsetWidth = calcValueByFontsize(doc, parentEl.offsetWidth);
|
|
248
|
+
const calcElOffsetWidth = calcValueByFontsize(doc, el.offsetWidth);
|
|
249
|
+
if (calcElOffsetWidth + left > calcParentOffsetWidth) {
|
|
250
|
+
return calcParentOffsetWidth - calcElOffsetWidth;
|
|
251
|
+
}
|
|
243
252
|
}
|
|
244
253
|
|
|
245
254
|
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;
|
package/types/editorProps.d.ts
CHANGED
|
@@ -60,8 +60,12 @@ export interface EditorProps {
|
|
|
60
60
|
};
|
|
61
61
|
/** 禁用鼠标左键按下时就开始拖拽,需要先选中再可以拖拽 */
|
|
62
62
|
disabledDragStart?: boolean;
|
|
63
|
-
/**
|
|
63
|
+
/** 自定义依赖收集器,复制组件时会将关联组件一并复制 */
|
|
64
64
|
collectorOptions?: CustomTargetOptions;
|
|
65
|
+
/** 自定义依赖收集器,复制组件时会将关联代码块一并复制 */
|
|
66
|
+
collectorOptionsForCode?: CustomTargetOptions;
|
|
67
|
+
/** 自定义依赖收集器,复制组件时会将关联数据源一并复制 */
|
|
68
|
+
collectorOptionsForDataSource?: CustomTargetOptions;
|
|
65
69
|
/** 标尺配置 */
|
|
66
70
|
guidesOptions?: Partial<GuidesOptions>;
|
|
67
71
|
/** 禁止多选 */
|
|
@@ -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>>>> & {
|
|
@@ -1,85 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: import("vue").PropType<"small" | "large" | "default">;
|
|
14
|
-
};
|
|
15
|
-
model: {
|
|
16
|
-
type: import("vue").PropType<any>;
|
|
17
|
-
required: true;
|
|
18
|
-
};
|
|
19
|
-
disabled: {
|
|
20
|
-
type: import("vue").PropType<boolean>;
|
|
21
|
-
default: boolean;
|
|
22
|
-
};
|
|
23
|
-
config: {
|
|
24
|
-
type: import("vue").PropType<{
|
|
25
|
-
type: 'data-source-fields';
|
|
26
|
-
}>;
|
|
27
|
-
required: true;
|
|
28
|
-
};
|
|
29
|
-
initValues: {
|
|
30
|
-
type: import("vue").PropType<any>;
|
|
31
|
-
};
|
|
32
|
-
lastValues: {
|
|
33
|
-
type: import("vue").PropType<Record<string, any>>;
|
|
34
|
-
};
|
|
35
|
-
prop: {
|
|
36
|
-
type: import("vue").PropType<string>;
|
|
37
|
-
required: true;
|
|
38
|
-
};
|
|
39
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1
|
+
import { type FieldProps } from '@tmagic/form';
|
|
2
|
+
declare let __VLS_typeProps: FieldProps<{
|
|
3
|
+
type: 'data-source-fields';
|
|
4
|
+
}>;
|
|
5
|
+
type __VLS_PublicProps = {
|
|
6
|
+
'width'?: number;
|
|
7
|
+
'visible'?: boolean;
|
|
8
|
+
'visible1'?: boolean;
|
|
9
|
+
} & typeof __VLS_typeProps;
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
40
13
|
"update:width": (width: number) => void;
|
|
41
14
|
"update:visible": (visible: boolean) => void;
|
|
42
15
|
"update:visible1": (visible1: boolean) => void;
|
|
43
16
|
change: (...args: any[]) => void;
|
|
44
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
visible1: import("vue").PropType<boolean>;
|
|
48
|
-
name: {
|
|
49
|
-
type: import("vue").PropType<string>;
|
|
50
|
-
required: true;
|
|
51
|
-
};
|
|
52
|
-
values: {
|
|
53
|
-
type: import("vue").PropType<any>;
|
|
54
|
-
};
|
|
55
|
-
size: {
|
|
56
|
-
type: import("vue").PropType<"small" | "large" | "default">;
|
|
57
|
-
};
|
|
58
|
-
model: {
|
|
59
|
-
type: import("vue").PropType<any>;
|
|
60
|
-
required: true;
|
|
61
|
-
};
|
|
62
|
-
disabled: {
|
|
63
|
-
type: import("vue").PropType<boolean>;
|
|
64
|
-
default: boolean;
|
|
65
|
-
};
|
|
66
|
-
config: {
|
|
67
|
-
type: import("vue").PropType<{
|
|
68
|
-
type: 'data-source-fields';
|
|
69
|
-
}>;
|
|
70
|
-
required: true;
|
|
71
|
-
};
|
|
72
|
-
initValues: {
|
|
73
|
-
type: import("vue").PropType<any>;
|
|
74
|
-
};
|
|
75
|
-
lastValues: {
|
|
76
|
-
type: import("vue").PropType<Record<string, any>>;
|
|
77
|
-
};
|
|
78
|
-
prop: {
|
|
79
|
-
type: import("vue").PropType<string>;
|
|
80
|
-
required: true;
|
|
81
|
-
};
|
|
82
|
-
}>> & {
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
}>>> & {
|
|
83
20
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
84
21
|
"onUpdate:width"?: ((width: number) => any) | undefined;
|
|
85
22
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
@@ -88,3 +25,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
88
25
|
disabled: boolean;
|
|
89
26
|
}, {}>;
|
|
90
27
|
export default _default;
|
|
28
|
+
type __VLS_WithDefaults<P, D> = {
|
|
29
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
30
|
+
default: D[K];
|
|
31
|
+
}> : P[K];
|
|
32
|
+
};
|
|
33
|
+
type __VLS_Prettify<T> = {
|
|
34
|
+
[K in keyof T]: T[K];
|
|
35
|
+
} & {};
|
|
36
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
37
|
+
type __VLS_TypePropsToOption<T> = {
|
|
38
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
39
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
40
|
+
} : {
|
|
41
|
+
type: import('vue').PropType<T[K]>;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { FieldProps, FormItem } from '@tmagic/form';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<FieldProps<{
|
|
3
|
-
type:
|
|
3
|
+
type: "data-source-input";
|
|
4
4
|
} & FormItem>>, {
|
|
5
5
|
disabled: boolean;
|
|
6
6
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
7
|
change: (value: string) => void;
|
|
8
8
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<FieldProps<{
|
|
9
|
-
type:
|
|
9
|
+
type: "data-source-input";
|
|
10
10
|
} & FormItem>>, {
|
|
11
11
|
disabled: boolean;
|
|
12
12
|
}>>> & {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { FieldProps } from '@tmagic/form';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<FieldProps<{
|
|
3
|
-
type:
|
|
3
|
+
type: "data-source-methods";
|
|
4
4
|
}>>, {
|
|
5
5
|
disabled: boolean;
|
|
6
6
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
7
|
change: (...args: any[]) => void;
|
|
8
8
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<FieldProps<{
|
|
9
|
-
type:
|
|
9
|
+
type: "data-source-methods";
|
|
10
10
|
}>>, {
|
|
11
11
|
disabled: boolean;
|
|
12
12
|
}>>> & {
|