@tmagic/editor 1.3.0-alpha.16 → 1.3.0-alpha.18
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 +1 -1
- package/dist/tmagic-editor.js +933 -673
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +944 -678
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +12 -12
- package/src/components/CodeBlockEditor.vue +1 -0
- package/src/fields/Code.vue +6 -10
- package/src/fields/CodeLink.vue +6 -7
- package/src/fields/CodeSelect.vue +5 -8
- package/src/fields/CodeSelectCol.vue +4 -15
- package/src/fields/DataSourceFieldSelect.vue +47 -0
- package/src/fields/DataSourceFields.vue +5 -10
- package/src/fields/DataSourceInput.vue +9 -12
- package/src/fields/DataSourceMethodSelect.vue +5 -16
- package/src/fields/DataSourceMethods.vue +6 -11
- package/src/fields/DataSourceSelect.vue +5 -12
- package/src/fields/EventSelect.vue +20 -12
- package/src/fields/KeyValue.vue +9 -11
- package/src/fields/UISelect.vue +19 -10
- package/src/index.ts +3 -0
- package/src/initService.ts +36 -16
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +2 -2
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +1 -0
- package/src/layouts/sidebar/data-source/DataSourceList.vue +51 -17
- package/src/services/dep.ts +19 -19
- package/src/theme/code-editor.scss +1 -1
- package/src/type.ts +20 -0
- package/src/utils/dep.ts +33 -7
- package/src/utils/props.ts +298 -189
- package/src/utils/stage.ts +3 -5
- package/types/fields/Code.vue.d.ts +11 -26
- package/types/fields/CodeLink.vue.d.ts +12 -21
- package/types/fields/CodeSelect.vue.d.ts +6 -17
- package/types/fields/CodeSelectCol.vue.d.ts +3 -18
- package/types/fields/DataSourceFieldSelect.vue.d.ts +29 -0
- package/types/fields/DataSourceFields.vue.d.ts +7 -20
- package/types/fields/DataSourceInput.vue.d.ts +10 -30
- package/types/fields/DataSourceMethodSelect.vue.d.ts +3 -18
- package/types/fields/DataSourceMethods.vue.d.ts +7 -20
- package/types/fields/DataSourceSelect.vue.d.ts +13 -29
- package/types/fields/EventSelect.vue.d.ts +2 -13
- package/types/fields/KeyValue.vue.d.ts +9 -24
- package/types/fields/UISelect.vue.d.ts +2 -11
- package/types/index.d.ts +1 -0
- package/types/initService.d.ts +1 -1
- package/types/services/dep.d.ts +12 -21
- package/types/services/props.d.ts +8 -113
- package/types/type.d.ts +18 -0
- package/types/utils/dep.d.ts +4 -2
- package/types/utils/props.d.ts +13 -102
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
model: any;
|
|
6
|
-
prop: string;
|
|
7
|
-
lastValues?: any;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
name: string;
|
|
10
|
-
}>, {
|
|
11
|
-
disabled: boolean;
|
|
12
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
-
config: {
|
|
14
|
-
type: "data-source-fields";
|
|
15
|
-
};
|
|
16
|
-
model: any;
|
|
17
|
-
prop: string;
|
|
18
|
-
lastValues?: any;
|
|
1
|
+
import { FieldProps } from '@tmagic/form';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
3
|
+
type: "data-source-fields";
|
|
4
|
+
}>>, {
|
|
19
5
|
disabled: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
7
|
+
type: "data-source-fields";
|
|
8
|
+
}>>, {
|
|
22
9
|
disabled: boolean;
|
|
23
10
|
}>>> & {
|
|
24
11
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,37 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
-
|
|
4
|
-
type: "data-source-input";
|
|
5
|
-
name: string;
|
|
6
|
-
text: string;
|
|
7
|
-
};
|
|
8
|
-
model: Record<string, any>;
|
|
1
|
+
import type { FieldProps } from '@tmagic/form';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
3
|
+
type: "data-source-input";
|
|
9
4
|
name: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
lastValues?: Record<string, any> | undefined;
|
|
13
|
-
size?: FieldSize | undefined;
|
|
14
|
-
}>, {
|
|
5
|
+
text: string;
|
|
6
|
+
}>>, {
|
|
15
7
|
disabled: boolean;
|
|
16
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
-
|
|
18
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
19
|
-
config: {
|
|
20
|
-
type: "data-source-input";
|
|
21
|
-
name: string;
|
|
22
|
-
text: string;
|
|
23
|
-
};
|
|
24
|
-
model: Record<string, any>;
|
|
8
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
9
|
+
type: "data-source-input";
|
|
25
10
|
name: string;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
lastValues?: Record<string, any> | undefined;
|
|
29
|
-
size?: FieldSize | undefined;
|
|
30
|
-
}>, {
|
|
11
|
+
text: string;
|
|
12
|
+
}>>, {
|
|
31
13
|
disabled: boolean;
|
|
32
|
-
}
|
|
33
|
-
onChange?: ((value: string) => any) | undefined;
|
|
34
|
-
}, {
|
|
14
|
+
}>>>, {
|
|
35
15
|
disabled: boolean;
|
|
36
16
|
}, {}>;
|
|
37
17
|
export default _default;
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
+
import { FieldProps } from '@tmagic/form';
|
|
1
2
|
import type { DataSourceMethodSelectConfig } from '../type';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
-
config: DataSourceMethodSelectConfig;
|
|
4
|
-
model: any;
|
|
5
|
-
lastValues?: any;
|
|
6
|
-
prop: string;
|
|
7
|
-
name: string;
|
|
8
|
-
disabled?: boolean | undefined;
|
|
9
|
-
size: "default" | "small" | "large";
|
|
10
|
-
}>, {
|
|
3
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<DataSourceMethodSelectConfig>>, {
|
|
11
4
|
disabled: boolean;
|
|
12
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
-
config: DataSourceMethodSelectConfig;
|
|
14
|
-
model: any;
|
|
15
|
-
lastValues?: any;
|
|
16
|
-
prop: string;
|
|
17
|
-
name: string;
|
|
18
|
-
disabled?: boolean | undefined;
|
|
19
|
-
size: "default" | "small" | "large";
|
|
20
|
-
}>, {
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<DataSourceMethodSelectConfig>>, {
|
|
21
6
|
disabled: boolean;
|
|
22
7
|
}>>> & {
|
|
23
8
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
model: any;
|
|
6
|
-
prop: string;
|
|
7
|
-
lastValues?: any;
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
name: string;
|
|
10
|
-
}>, {
|
|
11
|
-
disabled: boolean;
|
|
12
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
-
config: {
|
|
14
|
-
type: "data-source-methods";
|
|
15
|
-
};
|
|
16
|
-
model: any;
|
|
17
|
-
prop: string;
|
|
18
|
-
lastValues?: any;
|
|
1
|
+
import type { FieldProps } from '@tmagic/form';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
3
|
+
type: "data-source-methods";
|
|
4
|
+
}>>, {
|
|
19
5
|
disabled: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
7
|
+
type: "data-source-methods";
|
|
8
|
+
}>>, {
|
|
22
9
|
disabled: boolean;
|
|
23
10
|
}>>> & {
|
|
24
11
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
-
|
|
4
|
-
type: "data-source-select";
|
|
5
|
-
name: string;
|
|
6
|
-
text: string;
|
|
7
|
-
placeholder: string;
|
|
8
|
-
dataSourceType?: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
model: Record<string, any>;
|
|
1
|
+
import { FieldProps } from '@tmagic/form';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
3
|
+
type: "data-source-select";
|
|
11
4
|
name: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}>, {
|
|
5
|
+
text: string;
|
|
6
|
+
placeholder: string;
|
|
7
|
+
dataSourceType?: string | undefined;
|
|
8
|
+
}>>, {
|
|
17
9
|
disabled: boolean;
|
|
18
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
19
|
-
|
|
20
|
-
type: "data-source-select";
|
|
21
|
-
name: string;
|
|
22
|
-
text: string;
|
|
23
|
-
placeholder: string;
|
|
24
|
-
dataSourceType?: string | undefined;
|
|
25
|
-
};
|
|
26
|
-
model: Record<string, any>;
|
|
10
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
11
|
+
type: "data-source-select";
|
|
27
12
|
name: string;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}>, {
|
|
13
|
+
text: string;
|
|
14
|
+
placeholder: string;
|
|
15
|
+
dataSourceType?: string | undefined;
|
|
16
|
+
}>>, {
|
|
33
17
|
disabled: boolean;
|
|
34
18
|
}>>> & {
|
|
35
19
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
+
import type { FieldProps } from '@tmagic/form';
|
|
1
2
|
import type { EventSelectConfig } from '../type';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
-
config: EventSelectConfig;
|
|
4
|
-
model: any;
|
|
5
|
-
prop: string;
|
|
6
|
-
name: string;
|
|
7
|
-
size: "default" | "small" | "large";
|
|
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
|
-
config: EventSelectConfig;
|
|
10
|
-
model: any;
|
|
11
|
-
prop: string;
|
|
12
|
-
name: string;
|
|
13
|
-
size: "default" | "small" | "large";
|
|
14
|
-
}>>> & {
|
|
3
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<FieldProps<EventSelectConfig>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FieldProps<EventSelectConfig>>>> & {
|
|
15
4
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
16
5
|
}, {}, {}>;
|
|
17
6
|
export default _default;
|
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
5
|
-
text: string;
|
|
6
|
-
};
|
|
7
|
-
model: Record<string, any>;
|
|
1
|
+
import type { FieldProps } from '@tmagic/form';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
3
|
+
type: "key-value";
|
|
8
4
|
name: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
lastValues?: Record<string, any> | undefined;
|
|
12
|
-
size?: "default" | "small" | "large" | undefined;
|
|
13
|
-
}>, {
|
|
5
|
+
text: string;
|
|
6
|
+
}>>, {
|
|
14
7
|
disabled: boolean;
|
|
15
8
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
9
|
change: (value: Record<string, any>) => void;
|
|
17
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
18
|
-
|
|
19
|
-
type: "key-value";
|
|
20
|
-
name: string;
|
|
21
|
-
text: string;
|
|
22
|
-
};
|
|
23
|
-
model: Record<string, any>;
|
|
10
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<{
|
|
11
|
+
type: "key-value";
|
|
24
12
|
name: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
lastValues?: Record<string, any> | undefined;
|
|
28
|
-
size?: "default" | "small" | "large" | undefined;
|
|
29
|
-
}>, {
|
|
13
|
+
text: string;
|
|
14
|
+
}>>, {
|
|
30
15
|
disabled: boolean;
|
|
31
16
|
}>>> & {
|
|
32
17
|
onChange?: ((value: Record<string, any>) => any) | undefined;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
model: any;
|
|
4
|
-
prop: string;
|
|
5
|
-
name: string;
|
|
6
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
-
config: any;
|
|
8
|
-
model: any;
|
|
9
|
-
prop: string;
|
|
10
|
-
name: string;
|
|
11
|
-
}>>> & {
|
|
1
|
+
import type { FieldProps } from '@tmagic/form';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<FieldProps<any>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FieldProps<any>>>> & {
|
|
12
3
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
13
4
|
}, {}, {}>;
|
|
14
5
|
export default _default;
|
package/types/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { default as DataSourceMethods } from './fields/DataSourceMethods.vue';
|
|
|
24
24
|
export { default as DataSourceInput } from './fields/DataSourceInput.vue';
|
|
25
25
|
export { default as DataSourceSelect } from './fields/DataSourceSelect.vue';
|
|
26
26
|
export { default as DataSourceMethodSelect } from './fields/DataSourceMethodSelect.vue';
|
|
27
|
+
export { default as DataSourceFieldSelect } from './fields/DataSourceFieldSelect.vue';
|
|
27
28
|
export { default as EventSelect } from './fields/EventSelect.vue';
|
|
28
29
|
export { default as KeyValue } from './fields/KeyValue.vue';
|
|
29
30
|
export { default as CodeBlockList } from './layouts/sidebar/code-block/CodeBlockList.vue';
|
package/types/initService.d.ts
CHANGED
package/types/services/dep.d.ts
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { MNode } from '@tmagic/schema';
|
|
3
|
+
import type { Dep, MNode } from '@tmagic/schema';
|
|
4
|
+
import { DepTargetType } from '../type';
|
|
4
5
|
type IsTarget = (key: string | number, value: any) => boolean;
|
|
5
6
|
interface TargetOptions {
|
|
6
7
|
isTarget: IsTarget;
|
|
7
8
|
id: string | number;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interface Dep {
|
|
12
|
-
[key: string | number]: {
|
|
13
|
-
name: string;
|
|
14
|
-
keys: (string | number)[];
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
interface TargetList {
|
|
18
|
-
[key: string]: {
|
|
19
|
-
[key: string | number]: Target;
|
|
20
|
-
};
|
|
9
|
+
/** 类型,数据源、代码块或其他 */
|
|
10
|
+
type?: DepTargetType | string;
|
|
11
|
+
name?: string;
|
|
21
12
|
}
|
|
22
13
|
/**
|
|
23
14
|
* 需要收集依赖的目标
|
|
@@ -36,11 +27,11 @@ export declare class Target extends EventEmitter {
|
|
|
36
27
|
/**
|
|
37
28
|
* 目标名称,用于显示在依赖列表中
|
|
38
29
|
*/
|
|
39
|
-
name
|
|
30
|
+
name?: string;
|
|
40
31
|
/**
|
|
41
32
|
* 不同的目标可以进行分类,例如代码块,数据源可以为两个不同的type
|
|
42
33
|
*/
|
|
43
|
-
type: string;
|
|
34
|
+
type: DepTargetType | string;
|
|
44
35
|
/**
|
|
45
36
|
* 依赖详情
|
|
46
37
|
* 实例:{ 'node_id': { name: 'node_name', keys: [ created, mounted ] } }
|
|
@@ -70,15 +61,15 @@ export declare class Target extends EventEmitter {
|
|
|
70
61
|
destroy(): void;
|
|
71
62
|
}
|
|
72
63
|
export declare class Watcher extends EventEmitter {
|
|
73
|
-
targets
|
|
64
|
+
private targets;
|
|
74
65
|
/**
|
|
75
66
|
* 获取指定类型中的所有target
|
|
76
67
|
* @param type 分类
|
|
77
68
|
* @returns Target[]
|
|
78
69
|
*/
|
|
79
|
-
getTargets(type?: string): {
|
|
80
|
-
[
|
|
81
|
-
[
|
|
70
|
+
getTargets(type?: DepTargetType | string): {
|
|
71
|
+
[targetId: string]: Target;
|
|
72
|
+
[targetId: number]: Target;
|
|
82
73
|
};
|
|
83
74
|
/**
|
|
84
75
|
* 添加新的目标
|
|
@@ -107,7 +98,7 @@ export declare class Watcher extends EventEmitter {
|
|
|
107
98
|
* @param type 分类
|
|
108
99
|
* @returns void
|
|
109
100
|
*/
|
|
110
|
-
removeTargets(type?: string): void;
|
|
101
|
+
removeTargets(type?: DepTargetType | string): void;
|
|
111
102
|
/**
|
|
112
103
|
* 删除所有target
|
|
113
104
|
*/
|
|
@@ -7,120 +7,15 @@ declare class Props extends BaseService {
|
|
|
7
7
|
setPropsConfigs(configs: Record<string, FormConfig>): void;
|
|
8
8
|
fillConfig(config: FormConfig): Promise<{
|
|
9
9
|
type: string;
|
|
10
|
-
items:
|
|
10
|
+
items: {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
status?: string | undefined;
|
|
11
13
|
title: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
labelWidth: string;
|
|
18
|
-
items: {
|
|
19
|
-
name: string;
|
|
20
|
-
items: ({
|
|
21
|
-
type: string;
|
|
22
|
-
legend: string;
|
|
23
|
-
items: ({
|
|
24
|
-
name: string;
|
|
25
|
-
type: string;
|
|
26
|
-
activeValue: string; /**
|
|
27
|
-
* 为指定类型组件设置组件属性表单配置
|
|
28
|
-
* @param type 组件类型
|
|
29
|
-
* @param config 组件属性表单配置
|
|
30
|
-
*/
|
|
31
|
-
inactiveValue: string;
|
|
32
|
-
defaultValue: string;
|
|
33
|
-
text: string;
|
|
34
|
-
disabled?: undefined;
|
|
35
|
-
} | {
|
|
36
|
-
name: string;
|
|
37
|
-
text: string;
|
|
38
|
-
type?: undefined;
|
|
39
|
-
activeValue?: undefined; /**
|
|
40
|
-
* 为指定类型组件设置组件属性表单配置
|
|
41
|
-
* @param type 组件类型
|
|
42
|
-
* @param config 组件属性表单配置
|
|
43
|
-
*/
|
|
44
|
-
inactiveValue?: undefined;
|
|
45
|
-
defaultValue?: undefined;
|
|
46
|
-
disabled?: undefined;
|
|
47
|
-
} | {
|
|
48
|
-
name: string;
|
|
49
|
-
text: string;
|
|
50
|
-
disabled: (vm: import("@tmagic/form").FormState, { model }: any) => boolean;
|
|
51
|
-
type?: undefined;
|
|
52
|
-
activeValue?: undefined; /**
|
|
53
|
-
* 为指定类型组件设置组件属性表单配置
|
|
54
|
-
* @param type 组件类型
|
|
55
|
-
* @param config 组件属性表单配置
|
|
56
|
-
*/
|
|
57
|
-
inactiveValue?: undefined;
|
|
58
|
-
defaultValue?: undefined;
|
|
59
|
-
})[];
|
|
60
|
-
name?: undefined;
|
|
61
|
-
} | {
|
|
62
|
-
type: string;
|
|
63
|
-
legend: string;
|
|
64
|
-
items: ({
|
|
65
|
-
name: string;
|
|
66
|
-
text: string;
|
|
67
|
-
type?: undefined;
|
|
68
|
-
defaultValue?: undefined;
|
|
69
|
-
options?: undefined;
|
|
70
|
-
} | {
|
|
71
|
-
name: string;
|
|
72
|
-
text: string;
|
|
73
|
-
type: string;
|
|
74
|
-
defaultValue?: undefined;
|
|
75
|
-
options?: undefined;
|
|
76
|
-
} | {
|
|
77
|
-
name: string;
|
|
78
|
-
text: string;
|
|
79
|
-
type: string;
|
|
80
|
-
defaultValue: string;
|
|
81
|
-
options: {
|
|
82
|
-
text: string;
|
|
83
|
-
value: string;
|
|
84
|
-
}[];
|
|
85
|
-
} | {
|
|
86
|
-
name: string;
|
|
87
|
-
text: string;
|
|
88
|
-
defaultValue: string;
|
|
89
|
-
type?: undefined;
|
|
90
|
-
options?: undefined;
|
|
91
|
-
})[];
|
|
92
|
-
name?: undefined;
|
|
93
|
-
} | {
|
|
94
|
-
type: string;
|
|
95
|
-
legend: string;
|
|
96
|
-
name: string;
|
|
97
|
-
items: {
|
|
98
|
-
name: string;
|
|
99
|
-
text: string;
|
|
100
|
-
}[];
|
|
101
|
-
})[];
|
|
102
|
-
}[];
|
|
103
|
-
lazy?: undefined;
|
|
104
|
-
} | {
|
|
105
|
-
title: string;
|
|
106
|
-
items: {
|
|
107
|
-
name: string;
|
|
108
|
-
type: string;
|
|
109
|
-
labelWidth: number;
|
|
110
|
-
}[];
|
|
111
|
-
labelWidth?: undefined;
|
|
112
|
-
lazy?: undefined;
|
|
113
|
-
} | {
|
|
114
|
-
title: string;
|
|
115
|
-
lazy: boolean;
|
|
116
|
-
items: {
|
|
117
|
-
name: string;
|
|
118
|
-
text: string;
|
|
119
|
-
labelWidth: string;
|
|
120
|
-
type: string;
|
|
121
|
-
}[];
|
|
122
|
-
labelWidth?: undefined;
|
|
123
|
-
})[];
|
|
14
|
+
lazy?: boolean | undefined;
|
|
15
|
+
labelWidth?: string | undefined;
|
|
16
|
+
items: FormConfig;
|
|
17
|
+
onTabClick?: ((mForm: import("@tmagic/form").FormState | undefined, tab: any, data: any) => void) | undefined;
|
|
18
|
+
}[];
|
|
124
19
|
}[]>;
|
|
125
20
|
/**
|
|
126
21
|
* 为指定类型组件设置组件属性表单配置
|
package/types/type.d.ts
CHANGED
|
@@ -412,3 +412,21 @@ export interface DataSourceMethodSelectConfig {
|
|
|
412
412
|
disabled?: boolean | FilterFunction;
|
|
413
413
|
display?: boolean | FilterFunction;
|
|
414
414
|
}
|
|
415
|
+
export interface DataSourceFieldSelectConfig {
|
|
416
|
+
type: 'data-source-field-select';
|
|
417
|
+
name: string;
|
|
418
|
+
labelWidth?: number | string;
|
|
419
|
+
disabled?: boolean | FilterFunction;
|
|
420
|
+
display?: boolean | FilterFunction;
|
|
421
|
+
}
|
|
422
|
+
export declare enum DepTargetType {
|
|
423
|
+
DEFAULT = "default",
|
|
424
|
+
/** 代码块 */
|
|
425
|
+
CODE_BLOCK = "code-block",
|
|
426
|
+
/** 数据源 */
|
|
427
|
+
DATA_SOURCE = "data-source",
|
|
428
|
+
/** 数据源方法 */
|
|
429
|
+
DATA_SOURCE_METHOD = "data-source-method",
|
|
430
|
+
/** 数据源条件 */
|
|
431
|
+
DATA_SOURCE_COND = "data-source-cond"
|
|
432
|
+
}
|
package/types/utils/dep.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { CodeBlockContent,
|
|
1
|
+
import { CodeBlockContent, Id } from '@tmagic/schema';
|
|
2
2
|
import { Target } from '../services/dep';
|
|
3
3
|
export declare const createCodeBlockTarget: (id: Id, codeBlock: CodeBlockContent) => Target;
|
|
4
|
-
export declare const createDataSourceTarget: (id: Id
|
|
4
|
+
export declare const createDataSourceTarget: (id: Id) => Target;
|
|
5
|
+
export declare const createDataSourceCondTarget: (id: string) => Target;
|
|
6
|
+
export declare const createDataSourceMethodTarget: (id: string) => Target;
|
package/types/utils/props.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { FormConfig, FormState } from '@tmagic/form';
|
|
1
|
+
import type { FormConfig, FormState, TabPaneConfig } from '@tmagic/form';
|
|
2
|
+
export declare const styleTabConfig: TabPaneConfig;
|
|
3
|
+
export declare const eventTabConfig: TabPaneConfig;
|
|
4
|
+
export declare const advancedTabConfig: TabPaneConfig;
|
|
5
|
+
export declare const displayTabConfig: TabPaneConfig;
|
|
2
6
|
/**
|
|
3
7
|
* 统一为组件属性表单加上事件、高级、样式配置
|
|
4
8
|
* @param config 组件属性配置
|
|
@@ -6,106 +10,13 @@ import { FormConfig, FormState } from '@tmagic/form';
|
|
|
6
10
|
*/
|
|
7
11
|
export declare const fillConfig: (config?: FormConfig) => {
|
|
8
12
|
type: string;
|
|
9
|
-
items:
|
|
13
|
+
items: {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
status?: string | undefined;
|
|
10
16
|
title: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
labelWidth: string;
|
|
17
|
-
items: {
|
|
18
|
-
name: string;
|
|
19
|
-
items: ({
|
|
20
|
-
type: string;
|
|
21
|
-
legend: string;
|
|
22
|
-
items: ({
|
|
23
|
-
name: string;
|
|
24
|
-
type: string;
|
|
25
|
-
activeValue: string;
|
|
26
|
-
inactiveValue: string;
|
|
27
|
-
defaultValue: string;
|
|
28
|
-
text: string;
|
|
29
|
-
disabled?: undefined;
|
|
30
|
-
} | {
|
|
31
|
-
name: string;
|
|
32
|
-
text: string;
|
|
33
|
-
type?: undefined;
|
|
34
|
-
activeValue?: undefined;
|
|
35
|
-
inactiveValue?: undefined;
|
|
36
|
-
defaultValue?: undefined;
|
|
37
|
-
disabled?: undefined;
|
|
38
|
-
} | {
|
|
39
|
-
name: string;
|
|
40
|
-
text: string;
|
|
41
|
-
disabled: (vm: FormState, { model }: any) => boolean;
|
|
42
|
-
type?: undefined;
|
|
43
|
-
activeValue?: undefined;
|
|
44
|
-
inactiveValue?: undefined;
|
|
45
|
-
defaultValue?: undefined;
|
|
46
|
-
})[];
|
|
47
|
-
name?: undefined;
|
|
48
|
-
} | {
|
|
49
|
-
type: string;
|
|
50
|
-
legend: string;
|
|
51
|
-
items: ({
|
|
52
|
-
name: string;
|
|
53
|
-
text: string;
|
|
54
|
-
type?: undefined;
|
|
55
|
-
defaultValue?: undefined;
|
|
56
|
-
options?: undefined;
|
|
57
|
-
} | {
|
|
58
|
-
name: string;
|
|
59
|
-
text: string;
|
|
60
|
-
type: string;
|
|
61
|
-
defaultValue?: undefined;
|
|
62
|
-
options?: undefined;
|
|
63
|
-
} | {
|
|
64
|
-
name: string;
|
|
65
|
-
text: string;
|
|
66
|
-
type: string;
|
|
67
|
-
defaultValue: string;
|
|
68
|
-
options: {
|
|
69
|
-
text: string;
|
|
70
|
-
value: string;
|
|
71
|
-
}[];
|
|
72
|
-
} | {
|
|
73
|
-
name: string;
|
|
74
|
-
text: string;
|
|
75
|
-
defaultValue: string;
|
|
76
|
-
type?: undefined;
|
|
77
|
-
options?: undefined;
|
|
78
|
-
})[];
|
|
79
|
-
name?: undefined;
|
|
80
|
-
} | {
|
|
81
|
-
type: string;
|
|
82
|
-
legend: string;
|
|
83
|
-
name: string;
|
|
84
|
-
items: {
|
|
85
|
-
name: string;
|
|
86
|
-
text: string;
|
|
87
|
-
}[];
|
|
88
|
-
})[];
|
|
89
|
-
}[];
|
|
90
|
-
lazy?: undefined;
|
|
91
|
-
} | {
|
|
92
|
-
title: string;
|
|
93
|
-
items: {
|
|
94
|
-
name: string;
|
|
95
|
-
type: string;
|
|
96
|
-
labelWidth: number;
|
|
97
|
-
}[];
|
|
98
|
-
labelWidth?: undefined;
|
|
99
|
-
lazy?: undefined;
|
|
100
|
-
} | {
|
|
101
|
-
title: string;
|
|
102
|
-
lazy: boolean;
|
|
103
|
-
items: {
|
|
104
|
-
name: string;
|
|
105
|
-
text: string;
|
|
106
|
-
labelWidth: string;
|
|
107
|
-
type: string;
|
|
108
|
-
}[];
|
|
109
|
-
labelWidth?: undefined;
|
|
110
|
-
})[];
|
|
17
|
+
lazy?: boolean | undefined;
|
|
18
|
+
labelWidth?: string | undefined;
|
|
19
|
+
items: FormConfig;
|
|
20
|
+
onTabClick?: ((mForm: FormState | undefined, tab: any, data: any) => void) | undefined;
|
|
21
|
+
}[];
|
|
111
22
|
}[];
|