@logicflow/extension 1.2.26 → 1.2.28
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/cjs/NodeResize/Control/Control.js +40 -15
- package/cjs/components/selection-select/index.js +0 -13
- package/es/NodeResize/Control/Control.d.ts +3 -1
- package/es/NodeResize/Control/Control.js +40 -15
- package/es/components/selection-select/index.d.ts +0 -1
- package/es/components/selection-select/index.js +0 -13
- package/lib/Group.js +1 -1
- package/lib/NodeResize.js +1 -1
- package/lib/SelectionSelect.js +1 -1
- package/package.json +2 -2
- package/types/NodeResize/BasicShape/Polygon.d.ts +10 -0
- package/types/NodeResize/BasicShape/Rect.d.ts +17 -0
- package/types/NodeResize/Control/Control.d.ts +66 -0
- package/types/NodeResize/Control/ControlGroup.d.ts +13 -0
- package/types/NodeResize/Control/Util.d.ts +33 -0
- package/types/NodeResize/Node/DiamondResize.d.ts +30 -0
- package/types/NodeResize/Node/EllipseResize.d.ts +30 -0
- package/types/NodeResize/Node/HtmlResize.d.ts +30 -0
- package/types/NodeResize/Node/RectResize.d.ts +32 -0
- package/types/NodeResize/index.d.ts +11 -0
- package/types/bpmn/constant.d.ts +46 -0
- package/types/bpmn/events/EndEvent.d.ts +21 -0
- package/types/bpmn/events/StartEvent.d.ts +17 -0
- package/types/bpmn/flow/SequenceFlow.d.ts +15 -0
- package/types/bpmn/gateways/ExclusiveGateway.d.ts +16 -0
- package/types/bpmn/getBpmnId.d.ts +1 -0
- package/types/bpmn/index.d.ts +13 -0
- package/types/bpmn/tasks/ServiceTask.d.ts +17 -0
- package/types/bpmn/tasks/UserTask.d.ts +17 -0
- package/types/bpmn-adapter/bpmnIds.d.ts +1 -0
- package/types/bpmn-adapter/index.d.ts +63 -0
- package/types/bpmn-adapter/json2xml.d.ts +3 -0
- package/types/bpmn-adapter/xml2json.d.ts +2 -0
- package/types/bpmn-elements/index.d.ts +17 -0
- package/types/bpmn-elements/presets/Event/EndEventFactory.d.ts +5 -0
- package/types/bpmn-elements/presets/Event/IntermediateCatchEvent.d.ts +5 -0
- package/types/bpmn-elements/presets/Event/IntermediateThrowEvent.d.ts +5 -0
- package/types/bpmn-elements/presets/Event/StartEventFactory.d.ts +5 -0
- package/types/bpmn-elements/presets/Event/boundaryEventFactory.d.ts +5 -0
- package/types/bpmn-elements/presets/Event/index.d.ts +2 -0
- package/types/bpmn-elements/presets/Flow/index.d.ts +7 -0
- package/types/bpmn-elements/presets/Flow/sequenceFlow.d.ts +5 -0
- package/types/bpmn-elements/presets/Gateway/gateway.d.ts +17 -0
- package/types/bpmn-elements/presets/Gateway/index.d.ts +2 -0
- package/types/bpmn-elements/presets/Task/index.d.ts +2 -0
- package/types/bpmn-elements/presets/Task/subProcess.d.ts +5 -0
- package/types/bpmn-elements/presets/Task/task.d.ts +12 -0
- package/types/bpmn-elements/presets/icons.d.ts +25 -0
- package/types/bpmn-elements/utils.d.ts +2 -0
- package/types/bpmn-elements-adapter/constant.d.ts +66 -0
- package/types/bpmn-elements-adapter/index.d.ts +103 -0
- package/types/bpmn-elements-adapter/json2xml.d.ts +3 -0
- package/types/bpmn-elements-adapter/xml2json.d.ts +2 -0
- package/types/components/context-menu/index.d.ts +34 -0
- package/types/components/control/index.d.ts +26 -0
- package/types/components/dnd-panel/index.d.ts +25 -0
- package/types/components/highlight/index.d.ts +21 -0
- package/types/components/menu/index.d.ts +50 -0
- package/types/components/mini-map/index.d.ts +88 -0
- package/types/components/selection-select/index.d.ts +42 -0
- package/types/index.d.ts +21 -0
- package/types/insert-node-in-polyline/edge.d.ts +31 -0
- package/types/insert-node-in-polyline/index.d.ts +28 -0
- package/types/materials/curved-edge/index.d.ts +14 -0
- package/types/materials/group/GroupNode.d.ts +125 -0
- package/types/materials/group/index.d.ts +65 -0
- package/types/tools/auto-layout/index.d.ts +40 -0
- package/types/tools/flow-path/index.d.ts +47 -0
- package/types/tools/snapshot/index.d.ts +26 -0
- package/types/turbo-adapter/index.d.ts +21 -0
- package/types/type/index.d.ts +6 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const StartEventConfig: {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const EndEventConfig: {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const BoundaryEventConfig: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const IntermediateEventConfig: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const ParallelGatewayConfig: {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const InclusiveGatewayConfig: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const ExclusiveGatewayConfig: {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
};
|
|
29
|
+
export declare const ServiceTaskConfig: {
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
export declare const UserTaskConfig: {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
};
|
|
37
|
+
export declare const SubProcessConfig: {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
};
|
|
41
|
+
export declare const theme: {
|
|
42
|
+
rect: {
|
|
43
|
+
radius: number;
|
|
44
|
+
stroke: string;
|
|
45
|
+
};
|
|
46
|
+
circle: {
|
|
47
|
+
r: number;
|
|
48
|
+
stroke: string;
|
|
49
|
+
};
|
|
50
|
+
polygon: {
|
|
51
|
+
stroke: string;
|
|
52
|
+
};
|
|
53
|
+
polyline: {
|
|
54
|
+
stroke: string;
|
|
55
|
+
hoverStroke: string;
|
|
56
|
+
selectedStroke: string;
|
|
57
|
+
};
|
|
58
|
+
edgeText: {
|
|
59
|
+
background: {
|
|
60
|
+
fill: string;
|
|
61
|
+
height: number;
|
|
62
|
+
stroke: string;
|
|
63
|
+
radius: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
declare type TransformerType = {
|
|
2
|
+
[key: string]: {
|
|
3
|
+
in?: (key: string, data: any) => any;
|
|
4
|
+
out?: (data: any) => any;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
declare type MappingType = {
|
|
8
|
+
in?: {
|
|
9
|
+
[key: string]: string;
|
|
10
|
+
};
|
|
11
|
+
out?: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
declare type excludeFieldsType = {
|
|
16
|
+
in?: Set<string>;
|
|
17
|
+
out?: Set<string>;
|
|
18
|
+
};
|
|
19
|
+
declare type ExtraPropsType = {
|
|
20
|
+
retainedAttrsFields?: string[];
|
|
21
|
+
excludeFields?: excludeFieldsType;
|
|
22
|
+
transformer?: TransformerType;
|
|
23
|
+
mapping?: MappingType;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* 将普通json转换为xmlJson
|
|
27
|
+
* xmlJson中property会以“-”开头
|
|
28
|
+
* 如果没有“-”表示为子节点
|
|
29
|
+
* fix issue https://github.com/didi/LogicFlow/issues/718, contain the process of #text/#cdata and array
|
|
30
|
+
* @reference node type reference https://www.w3schools.com/xml/dom_nodetype.asp
|
|
31
|
+
* @param retainedAttrsFields retainedAttrsFields会和默认的defaultRetainedProperties:
|
|
32
|
+
* ["properties", "startPoint", "endPoint", "pointsList"]合并
|
|
33
|
+
* 这意味着出现在这个数组里的字段当它的值是数组或是对象时不会被视为一个节点而是一个属性
|
|
34
|
+
* @param excludeFields excludeFields会和默认的defaultExcludeFields合并,出现在这个数组中的字段在转换时会被忽略
|
|
35
|
+
* @param transformer 对应节点或者边的子内容转换规则
|
|
36
|
+
*/
|
|
37
|
+
declare function convertNormalToXml(other?: ExtraPropsType): (object: {
|
|
38
|
+
nodes: any;
|
|
39
|
+
edges: any;
|
|
40
|
+
}) => any;
|
|
41
|
+
/**
|
|
42
|
+
* 将xmlJson转换为普通的json,在内部使用。
|
|
43
|
+
*/
|
|
44
|
+
declare function convertXmlToNormal(xmlJson: any): any;
|
|
45
|
+
declare class BPMNBaseAdapter {
|
|
46
|
+
static pluginName: string;
|
|
47
|
+
static shapeConfigMap: Map<any, any>;
|
|
48
|
+
processAttributes: {
|
|
49
|
+
['-isExecutable']: string;
|
|
50
|
+
['-id']: string;
|
|
51
|
+
};
|
|
52
|
+
definitionAttributes: {
|
|
53
|
+
['-id']: string;
|
|
54
|
+
['-xmlns:xsi']: string;
|
|
55
|
+
['-xmlns:bpmn']: string;
|
|
56
|
+
['-xmlns:bpmndi']: string;
|
|
57
|
+
['-xmlns:dc']: string;
|
|
58
|
+
['-xmlns:di']: string;
|
|
59
|
+
['-targetNamespace']: string;
|
|
60
|
+
['-exporter']: string;
|
|
61
|
+
['-exporterVersion']: string;
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
};
|
|
64
|
+
constructor({ lf }: any);
|
|
65
|
+
setCustomShape(key: string, val: any): void;
|
|
66
|
+
/**
|
|
67
|
+
* @param retainedAttrsFields?: string[] (可选)属性保留字段,retainedField会和默认的defaultRetainedFields:
|
|
68
|
+
* ["properties", "startPoint", "endPoint", "pointsList"]合并,
|
|
69
|
+
* 这意味着出现在这个数组里的字段当它的值是数组或是对象时不会被视为一个节点而是一个属性。
|
|
70
|
+
* @param excludeFields excludeFields会和默认的defaultExcludeFields合并,出现在这个数组中的字段在转换时会被忽略
|
|
71
|
+
* @param transformer 对应节点或者边的内容转换规则
|
|
72
|
+
*/
|
|
73
|
+
adapterOut: (data: any, other?: ExtraPropsType) => {
|
|
74
|
+
'bpmn:definitions': {
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
"-id": string;
|
|
77
|
+
"-xmlns:xsi": string;
|
|
78
|
+
"-xmlns:bpmn": string;
|
|
79
|
+
"-xmlns:bpmndi": string;
|
|
80
|
+
"-xmlns:dc": string;
|
|
81
|
+
"-xmlns:di": string;
|
|
82
|
+
"-targetNamespace": string;
|
|
83
|
+
"-exporter": string;
|
|
84
|
+
"-exporterVersion": string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
adapterIn: (bpmnData: any, other?: ExtraPropsType) => {
|
|
88
|
+
nodes: any[];
|
|
89
|
+
edges: any[];
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
declare class BPMNAdapter extends BPMNBaseAdapter {
|
|
93
|
+
static pluginName: string;
|
|
94
|
+
private props;
|
|
95
|
+
constructor(data: any);
|
|
96
|
+
adapterXmlIn: (bpmnData: any) => {
|
|
97
|
+
nodes: any[];
|
|
98
|
+
edges: any[];
|
|
99
|
+
};
|
|
100
|
+
adapterXmlOut: (data: any) => string;
|
|
101
|
+
}
|
|
102
|
+
export { BPMNBaseAdapter, BPMNAdapter, convertNormalToXml, convertXmlToNormal };
|
|
103
|
+
export default BPMNAdapter;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare class ContextMenu {
|
|
2
|
+
static pluginName: string;
|
|
3
|
+
private __menuDOM;
|
|
4
|
+
private lf;
|
|
5
|
+
private _activeData;
|
|
6
|
+
private menuTypeMap;
|
|
7
|
+
container: any;
|
|
8
|
+
isShow: boolean;
|
|
9
|
+
constructor({ lf }: {
|
|
10
|
+
lf: any;
|
|
11
|
+
});
|
|
12
|
+
render(lf: any, container: any): void;
|
|
13
|
+
setContextMenuByType(type: any, menus: any): void;
|
|
14
|
+
/**
|
|
15
|
+
* 隐藏菜单
|
|
16
|
+
*/
|
|
17
|
+
hideContextMenu(): void;
|
|
18
|
+
/**
|
|
19
|
+
* 显示指定元素菜单
|
|
20
|
+
* @param data 节点id、节点类型、菜单位置
|
|
21
|
+
*/
|
|
22
|
+
showContextMenu(data: any): void;
|
|
23
|
+
setContextMenuItems(menus: any): void;
|
|
24
|
+
/**
|
|
25
|
+
* 获取新菜单位置
|
|
26
|
+
*/
|
|
27
|
+
private getContextMenuPosition;
|
|
28
|
+
private createContextMenu;
|
|
29
|
+
private addNode;
|
|
30
|
+
private showMenu;
|
|
31
|
+
listenDelete: () => void;
|
|
32
|
+
}
|
|
33
|
+
export default ContextMenu;
|
|
34
|
+
export { ContextMenu, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare type ControlItem = {
|
|
2
|
+
key: string;
|
|
3
|
+
iconClass: string;
|
|
4
|
+
title: string;
|
|
5
|
+
text: string;
|
|
6
|
+
onClick?: Function;
|
|
7
|
+
onMouseEnter?: Function;
|
|
8
|
+
onMouseLeave?: Function;
|
|
9
|
+
};
|
|
10
|
+
declare class Control {
|
|
11
|
+
private lf;
|
|
12
|
+
static pluginName: string;
|
|
13
|
+
private controlItems;
|
|
14
|
+
private domContainer;
|
|
15
|
+
private toolEl;
|
|
16
|
+
constructor({ lf }: {
|
|
17
|
+
lf: any;
|
|
18
|
+
});
|
|
19
|
+
render(lf: any, domContainer: any): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
addItem(item: any): void;
|
|
22
|
+
removeItem(key: any): ControlItem;
|
|
23
|
+
private getControlTool;
|
|
24
|
+
}
|
|
25
|
+
export default Control;
|
|
26
|
+
export { Control };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import LogicFlow from '@logicflow/core';
|
|
2
|
+
declare type ShapeItem = {
|
|
3
|
+
type?: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
properties?: Record<string, any>;
|
|
9
|
+
callback?: (lf: LogicFlow, container: HTMLElement) => void;
|
|
10
|
+
};
|
|
11
|
+
declare class DndPanel {
|
|
12
|
+
lf: LogicFlow;
|
|
13
|
+
shapeList: ShapeItem[];
|
|
14
|
+
panelEl: HTMLDivElement;
|
|
15
|
+
static pluginName: string;
|
|
16
|
+
domContainer: HTMLElement;
|
|
17
|
+
constructor({ lf }: {
|
|
18
|
+
lf: any;
|
|
19
|
+
});
|
|
20
|
+
render(lf: any, domContainer: any): void;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
setPatternItems(shapeList: any): void;
|
|
23
|
+
private createDndItem;
|
|
24
|
+
}
|
|
25
|
+
export { DndPanel, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import LogicFlow from '@logicflow/core';
|
|
2
|
+
declare type IMode = 'single' | 'path';
|
|
3
|
+
declare class Highlight {
|
|
4
|
+
lf: LogicFlow;
|
|
5
|
+
static pluginName: string;
|
|
6
|
+
mode: IMode;
|
|
7
|
+
manual: boolean;
|
|
8
|
+
tempStyles: {};
|
|
9
|
+
constructor({ lf }: {
|
|
10
|
+
lf: any;
|
|
11
|
+
});
|
|
12
|
+
setMode(mode: IMode): void;
|
|
13
|
+
setManual(manual: boolean): void;
|
|
14
|
+
private highlightSingle;
|
|
15
|
+
private highlightPath;
|
|
16
|
+
highlight(id: string, mode?: IMode): void;
|
|
17
|
+
restoreHighlight(): void;
|
|
18
|
+
render(lf: any, domContainer: any): void;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
}
|
|
21
|
+
export { Highlight };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import LogicFlow from '@logicflow/core';
|
|
2
|
+
declare type SetType = 'add' | 'reset';
|
|
3
|
+
export declare type MenuItem = {
|
|
4
|
+
text?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
icon?: boolean;
|
|
7
|
+
callback: (element: any) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare type MenuConfig = {
|
|
10
|
+
nodeMenu?: MenuItem[] | false;
|
|
11
|
+
edgeMenu?: MenuItem[] | false;
|
|
12
|
+
graphMenu?: MenuItem[] | false;
|
|
13
|
+
};
|
|
14
|
+
declare class Menu {
|
|
15
|
+
lf: LogicFlow;
|
|
16
|
+
private __container;
|
|
17
|
+
private __menuDOM;
|
|
18
|
+
private menuTypeMap;
|
|
19
|
+
private __currentData;
|
|
20
|
+
static pluginName: string;
|
|
21
|
+
constructor({ lf }: {
|
|
22
|
+
lf: any;
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* 初始化设置默认内置菜单栏
|
|
26
|
+
*/
|
|
27
|
+
private init;
|
|
28
|
+
render(lf: any, container: any): void;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
private showMenu;
|
|
31
|
+
/**
|
|
32
|
+
* 设置指定类型元素的菜单
|
|
33
|
+
*/
|
|
34
|
+
private setMenuByType;
|
|
35
|
+
/**
|
|
36
|
+
* 获取 Menu DOM
|
|
37
|
+
* @param list 菜单项
|
|
38
|
+
* @return 菜单项 DOM
|
|
39
|
+
*/
|
|
40
|
+
private __getMenuDom;
|
|
41
|
+
setMenuConfig(config: MenuConfig): void;
|
|
42
|
+
addMenuConfig(config: MenuConfig): void;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated
|
|
45
|
+
* 复写添加
|
|
46
|
+
*/
|
|
47
|
+
changeMenuItem(type: SetType, config: MenuConfig): void;
|
|
48
|
+
}
|
|
49
|
+
export default Menu;
|
|
50
|
+
export { Menu, };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
declare class MiniMap {
|
|
2
|
+
static pluginName: string;
|
|
3
|
+
static width: number;
|
|
4
|
+
static height: number;
|
|
5
|
+
static viewPortWidth: number;
|
|
6
|
+
static viewPortHeight: number;
|
|
7
|
+
static isShowHeader: boolean;
|
|
8
|
+
static isShowCloseIcon: boolean;
|
|
9
|
+
static leftPosition: number;
|
|
10
|
+
static topPosition: number;
|
|
11
|
+
static rightPosition: any;
|
|
12
|
+
static bottomPosition: any;
|
|
13
|
+
static headerTitle: string;
|
|
14
|
+
private lf;
|
|
15
|
+
private container;
|
|
16
|
+
private miniMapWrap;
|
|
17
|
+
private miniMapContainer;
|
|
18
|
+
private lfMap;
|
|
19
|
+
private viewport;
|
|
20
|
+
private width;
|
|
21
|
+
private height;
|
|
22
|
+
private leftPosition;
|
|
23
|
+
private topPosition;
|
|
24
|
+
private rightPosition;
|
|
25
|
+
private bottomPosition;
|
|
26
|
+
private miniMapWidth;
|
|
27
|
+
private miniMapHeight;
|
|
28
|
+
private viewPortTop;
|
|
29
|
+
private viewPortLeft;
|
|
30
|
+
private startPosition;
|
|
31
|
+
private viewPortScale;
|
|
32
|
+
private viewPortWidth;
|
|
33
|
+
private viewPortHeight;
|
|
34
|
+
private resetDataX;
|
|
35
|
+
private resetDataY;
|
|
36
|
+
private LogicFlow;
|
|
37
|
+
private isShow;
|
|
38
|
+
private isShowHeader;
|
|
39
|
+
private isShowCloseIcon;
|
|
40
|
+
private dragging;
|
|
41
|
+
private disabledPlugins;
|
|
42
|
+
constructor({ lf, LogicFlow, options }: {
|
|
43
|
+
lf: any;
|
|
44
|
+
LogicFlow: any;
|
|
45
|
+
options: any;
|
|
46
|
+
});
|
|
47
|
+
render(lf: any, container: any): void;
|
|
48
|
+
init(option: any): void;
|
|
49
|
+
/**
|
|
50
|
+
* 显示mini map
|
|
51
|
+
*/
|
|
52
|
+
show: (leftPosition?: number, topPosition?: number) => void;
|
|
53
|
+
/**
|
|
54
|
+
* 隐藏mini map
|
|
55
|
+
*/
|
|
56
|
+
hide: () => void;
|
|
57
|
+
reset: () => void;
|
|
58
|
+
private setOption;
|
|
59
|
+
private initMiniMap;
|
|
60
|
+
private createMiniMap;
|
|
61
|
+
private removeMiniMap;
|
|
62
|
+
/**
|
|
63
|
+
* 计算所有图形一起,占领的区域范围。
|
|
64
|
+
* @param data
|
|
65
|
+
*/
|
|
66
|
+
private getBounds;
|
|
67
|
+
/**
|
|
68
|
+
* 将负值的平移转换为正值。
|
|
69
|
+
* 保证渲染的时候,minimap能完全展示。
|
|
70
|
+
* 获取将画布所有元素平移到0,0开始时,所有节点数据
|
|
71
|
+
*/
|
|
72
|
+
private resetData;
|
|
73
|
+
/**
|
|
74
|
+
* 显示导航
|
|
75
|
+
* 显示视口范围
|
|
76
|
+
* 1. 基于画布的范围比例,设置视口范围比例。宽度默认为导航宽度。
|
|
77
|
+
*/
|
|
78
|
+
private setView;
|
|
79
|
+
private setViewPort;
|
|
80
|
+
private createViewPort;
|
|
81
|
+
private startDrag;
|
|
82
|
+
private moveViewport;
|
|
83
|
+
private drag;
|
|
84
|
+
private drop;
|
|
85
|
+
private mapClick;
|
|
86
|
+
}
|
|
87
|
+
export default MiniMap;
|
|
88
|
+
export { MiniMap };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import LogicFlow from '@logicflow/core';
|
|
2
|
+
declare class SelectionSelect {
|
|
3
|
+
__domContainer: HTMLElement;
|
|
4
|
+
wrapper: HTMLElement;
|
|
5
|
+
lf: LogicFlow;
|
|
6
|
+
startPoint: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
endPoint: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
__disabled: boolean;
|
|
15
|
+
isDefaultStopMoveGraph: boolean;
|
|
16
|
+
isWholeNode: boolean;
|
|
17
|
+
isWholeEdge: boolean;
|
|
18
|
+
static pluginName: string;
|
|
19
|
+
constructor({ lf }: {
|
|
20
|
+
lf: any;
|
|
21
|
+
});
|
|
22
|
+
render(lf: any, domContainer: any): void;
|
|
23
|
+
/**
|
|
24
|
+
* 设置选中的灵敏度
|
|
25
|
+
* @param isWholeEdge 是否要边的起点终点都在选区范围才算选中。默认true
|
|
26
|
+
* @param isWholeNode 是否要节点的全部点都在选区范围才算选中。默认true
|
|
27
|
+
*/
|
|
28
|
+
setSelectionSense(isWholeEdge?: boolean, isWholeNode?: boolean): void;
|
|
29
|
+
/**
|
|
30
|
+
* 开启选区
|
|
31
|
+
*/
|
|
32
|
+
openSelectionSelect(): void;
|
|
33
|
+
/**
|
|
34
|
+
* 关闭选区
|
|
35
|
+
*/
|
|
36
|
+
closeSelectionSelect(): void;
|
|
37
|
+
__draw: (ev: any) => void;
|
|
38
|
+
__drawOff: () => void;
|
|
39
|
+
open(): void;
|
|
40
|
+
close(): void;
|
|
41
|
+
}
|
|
42
|
+
export { SelectionSelect };
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './bpmn';
|
|
2
|
+
export * from './bpmn-adapter';
|
|
3
|
+
export * from './bpmn-elements';
|
|
4
|
+
export * from './bpmn-elements-adapter';
|
|
5
|
+
export * from './tools/snapshot';
|
|
6
|
+
export * from './turbo-adapter';
|
|
7
|
+
export * from './insert-node-in-polyline';
|
|
8
|
+
export * from './components/control';
|
|
9
|
+
export * from './components/menu';
|
|
10
|
+
export * from './components/context-menu';
|
|
11
|
+
export * from './components/dnd-panel';
|
|
12
|
+
export * from './components/selection-select';
|
|
13
|
+
export * from './components/mini-map';
|
|
14
|
+
export * from './materials/curved-edge';
|
|
15
|
+
export * from './materials/group';
|
|
16
|
+
export * from './NodeResize';
|
|
17
|
+
export * from './tools/flow-path';
|
|
18
|
+
export * from './tools/auto-layout';
|
|
19
|
+
export * from './bpmn-adapter/xml2json';
|
|
20
|
+
export * from './bpmn-adapter/json2xml';
|
|
21
|
+
export * from './components/highlight';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Point, PolylineEdgeModel, BaseNodeModel } from '@logicflow/core';
|
|
2
|
+
/**
|
|
3
|
+
* 判断一个点是否在线段中
|
|
4
|
+
* @param point 判断的点
|
|
5
|
+
* @param start 线段的起点
|
|
6
|
+
* @param end 线段的终点
|
|
7
|
+
* @param deviation 误差范围
|
|
8
|
+
* @returns boolean
|
|
9
|
+
*/
|
|
10
|
+
export declare const isInSegment: (point: any, start: any, end: any, deviation?: number) => boolean;
|
|
11
|
+
export declare const distToSegmentSquared: (p: any, v: any, w: any) => number;
|
|
12
|
+
export declare const distToSegment: (point: Point, start: Point, end: Point) => number;
|
|
13
|
+
export declare const crossPointInSegment: (node: BaseNodeModel, start: Point, end: Point) => {
|
|
14
|
+
startCrossPoint: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
endCrossPoint: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
interface SegmentCross {
|
|
24
|
+
crossIndex: number;
|
|
25
|
+
crossPoints: {
|
|
26
|
+
startCrossPoint: Point;
|
|
27
|
+
endCrossPoint: Point;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare const isNodeInSegment: (node: BaseNodeModel, polyline: PolylineEdgeModel, deviation?: number) => SegmentCross;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import LogicFlow from '@logicflow/core';
|
|
2
|
+
declare class InsertNodeInPolyline {
|
|
3
|
+
static pluginName: string;
|
|
4
|
+
_lf: LogicFlow;
|
|
5
|
+
dndAdd: boolean;
|
|
6
|
+
dropAdd: boolean;
|
|
7
|
+
deviation: number;
|
|
8
|
+
constructor({ lf }: {
|
|
9
|
+
lf: any;
|
|
10
|
+
});
|
|
11
|
+
eventHandler(): void;
|
|
12
|
+
/**
|
|
13
|
+
* 插入节点前校验规则
|
|
14
|
+
* @param sourceNodeId
|
|
15
|
+
* @param targetNodeId
|
|
16
|
+
* @param sourceAnchorId
|
|
17
|
+
* @param targetAnchorId
|
|
18
|
+
* @param nodeData
|
|
19
|
+
*/
|
|
20
|
+
checkRuleBeforeInsetNode(sourceNodeId: any, targetNodeId: any, sourceAnchorId: any, targetAnchorId: any, nodeData: any): {
|
|
21
|
+
isPass: any;
|
|
22
|
+
sourceMsg: any;
|
|
23
|
+
targetMsg: any;
|
|
24
|
+
};
|
|
25
|
+
insetNode(nodeData: any): void;
|
|
26
|
+
}
|
|
27
|
+
export { InsertNodeInPolyline };
|
|
28
|
+
export default InsertNodeInPolyline;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PolylineEdge, PolylineEdgeModel } from '@logicflow/core';
|
|
2
|
+
declare function getCurvedEdgePath(points: number[][], radius: number): string;
|
|
3
|
+
declare class CurvedEdge extends PolylineEdge {
|
|
4
|
+
getEdge(): import("preact").VNode<any>;
|
|
5
|
+
}
|
|
6
|
+
declare class CurvedEdgeModel extends PolylineEdgeModel {
|
|
7
|
+
}
|
|
8
|
+
declare const defaultCurvedEdge: {
|
|
9
|
+
type: string;
|
|
10
|
+
view: typeof CurvedEdge;
|
|
11
|
+
model: typeof CurvedEdgeModel;
|
|
12
|
+
};
|
|
13
|
+
export default defaultCurvedEdge;
|
|
14
|
+
export { CurvedEdge, CurvedEdgeModel, getCurvedEdgePath };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { h } from '@logicflow/core';
|
|
2
|
+
import { RectResize } from '../../NodeResize';
|
|
3
|
+
declare class GroupNodeModel extends RectResize.model {
|
|
4
|
+
readonly isGroup = true;
|
|
5
|
+
/**
|
|
6
|
+
* 此分组的子节点Id
|
|
7
|
+
*/
|
|
8
|
+
children: Set<string>;
|
|
9
|
+
/**
|
|
10
|
+
* 其子节点是否被禁止通过拖拽移出分组。 默认false,允许拖拽移除分组。
|
|
11
|
+
*/
|
|
12
|
+
isRestrict: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 分组节点是否允许调整大小。
|
|
15
|
+
*/
|
|
16
|
+
resizable: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 分组节点是否允许折叠
|
|
19
|
+
*/
|
|
20
|
+
foldable: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 折叠后的宽度
|
|
23
|
+
*/
|
|
24
|
+
foldedWidth: number;
|
|
25
|
+
/**
|
|
26
|
+
* 折叠后的高度
|
|
27
|
+
*/
|
|
28
|
+
foldedHeight: number;
|
|
29
|
+
/**
|
|
30
|
+
* 分组折叠状态
|
|
31
|
+
*/
|
|
32
|
+
isFolded: boolean;
|
|
33
|
+
unfoldedWidth: number;
|
|
34
|
+
unfoldedHight: number;
|
|
35
|
+
/**
|
|
36
|
+
* children元素上一次折叠的状态缓存
|
|
37
|
+
*/
|
|
38
|
+
childrenLastFoldStatus: Record<string, boolean>;
|
|
39
|
+
initNodeData(data: any): void;
|
|
40
|
+
getResizeOutlineStyle(): {
|
|
41
|
+
fill: string;
|
|
42
|
+
stroke: string;
|
|
43
|
+
strokeWidth: number;
|
|
44
|
+
strokeDasharray: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* 折叠分组
|
|
48
|
+
* 1. 折叠分组的宽高
|
|
49
|
+
* 2. 处理分组子节点
|
|
50
|
+
* 3. 处理连线
|
|
51
|
+
*/
|
|
52
|
+
foldGroup(isFolded: any): void;
|
|
53
|
+
getAnchorStyle(anchorInfo: any): Record<string, any>;
|
|
54
|
+
/**
|
|
55
|
+
* 折叠分组的时候,处理分组自身的连线和分组内部子节点上的连线
|
|
56
|
+
* 边的分类:
|
|
57
|
+
* - 虚拟边:分组被收起时,表示分组本身与外部节点关系的边。
|
|
58
|
+
* - 真实边:分组本身或者分组内部节点与外部节点节点(非收起分组)关系的边。
|
|
59
|
+
* 如果一个分组,本身与外部节点有M条连线,且内部N个子节点与外部节点有连线,那么这个分组收起时会生成M+N条连线。
|
|
60
|
+
* 折叠分组时:
|
|
61
|
+
* - 原有的虚拟边删除;
|
|
62
|
+
* - 创建一个虚拟边;
|
|
63
|
+
* - 真实边则隐藏;
|
|
64
|
+
* 展开分组是:
|
|
65
|
+
* - 原有的虚拟边删除;
|
|
66
|
+
* - 如果目外部点是收起的分组,则创建虚拟边;
|
|
67
|
+
* - 如果外部节点是普通节点,则显示真实边;
|
|
68
|
+
*/
|
|
69
|
+
private foldEdge;
|
|
70
|
+
createVirtualEdge(edgeData: any): void;
|
|
71
|
+
isInRange({ x1, y1, x2, y2 }: {
|
|
72
|
+
x1: any;
|
|
73
|
+
y1: any;
|
|
74
|
+
x2: any;
|
|
75
|
+
y2: any;
|
|
76
|
+
}): boolean;
|
|
77
|
+
isAllowMoveTo({ x1, y1, x2, y2 }: {
|
|
78
|
+
x1: any;
|
|
79
|
+
y1: any;
|
|
80
|
+
x2: any;
|
|
81
|
+
y2: any;
|
|
82
|
+
}): {
|
|
83
|
+
x: boolean;
|
|
84
|
+
y: boolean;
|
|
85
|
+
};
|
|
86
|
+
setAllowAppendChild(isAllow: any): void;
|
|
87
|
+
/**
|
|
88
|
+
* 添加分组子节点
|
|
89
|
+
* @param id 节点id
|
|
90
|
+
*/
|
|
91
|
+
addChild(id: any): void;
|
|
92
|
+
/**
|
|
93
|
+
* 删除分组子节点
|
|
94
|
+
* @param id 节点id
|
|
95
|
+
*/
|
|
96
|
+
removeChild(id: any): void;
|
|
97
|
+
getAddableOutlineStyle(): {
|
|
98
|
+
stroke: string;
|
|
99
|
+
strokeWidth: number;
|
|
100
|
+
strokeDasharray: string;
|
|
101
|
+
fill: string;
|
|
102
|
+
};
|
|
103
|
+
getData(): import("@logicflow/core").NodeData;
|
|
104
|
+
getHistoryData(): import("@logicflow/core").NodeData;
|
|
105
|
+
/**
|
|
106
|
+
* 是否允许此节点添加到此分组中
|
|
107
|
+
*/
|
|
108
|
+
isAllowAppendIn(nodeData: any): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* 当groupA被添加到groupB中时,将groupB及groupB所属的group的zIndex减1
|
|
111
|
+
*/
|
|
112
|
+
toBack(): void;
|
|
113
|
+
}
|
|
114
|
+
declare class GroupNode extends RectResize.view {
|
|
115
|
+
getControlGroup(): h.JSX.Element;
|
|
116
|
+
getAddableShape(): import("preact").VNode<any>;
|
|
117
|
+
getFoldIcon(): import("preact").VNode<any>;
|
|
118
|
+
getResizeShape(): import("preact").VNode<any>;
|
|
119
|
+
}
|
|
120
|
+
declare const _default: {
|
|
121
|
+
type: string;
|
|
122
|
+
view: typeof GroupNode;
|
|
123
|
+
model: typeof GroupNodeModel;
|
|
124
|
+
};
|
|
125
|
+
export default _default;
|