@logicflow/core 1.0.0-alpha.3 → 1.0.0-alpha.4
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/README.md +1 -1
- package/dist/logic-flow.js +2 -2
- package/dist/style/index.css +1 -1
- package/package.json +2 -4
- package/types/LogicFlow.d.ts +341 -137
- package/types/constant/DefaultTheme.d.ts +271 -171
- package/types/keyboard/index.d.ts +1 -5
- package/types/model/BaseModel.d.ts +7 -7
- package/types/model/EditConfigModel.d.ts +6 -16
- package/types/model/GraphModel.d.ts +262 -53
- package/types/model/SnaplineModel.d.ts +6 -2
- package/types/model/TransformModel.d.ts +8 -2
- package/types/model/edge/BaseEdgeModel.d.ts +16 -9
- package/types/model/edge/BezierEdgeModel.d.ts +9 -0
- package/types/model/edge/LineEdgeModel.d.ts +6 -0
- package/types/model/edge/PolylineEdgeModel.d.ts +7 -0
- package/types/model/node/BaseNodeModel.d.ts +40 -19
- package/types/model/node/CircleNodeModel.d.ts +7 -2
- package/types/model/node/DiamondNodeModel.d.ts +7 -4
- package/types/model/node/EllipseNodeModel.d.ts +6 -2
- package/types/model/node/HtmlNodeModel.d.ts +0 -2
- package/types/model/node/PolygonNodeModel.d.ts +6 -2
- package/types/model/node/RectNodeModel.d.ts +9 -2
- package/types/model/node/TextNodeModel.d.ts +8 -4
- package/types/options.d.ts +84 -10
- package/types/type/index.d.ts +29 -37
- package/types/util/edge.d.ts +3 -3
- package/types/util/graph.d.ts +1 -1
- package/types/util/node.d.ts +1 -1
- package/types/util/theme.d.ts +2 -173
- package/types/view/Anchor.d.ts +0 -2
- package/types/view/Graph.d.ts +1 -3
- package/types/view/basic-shape/Path.d.ts +1 -9
- package/types/view/basic-shape/Rect.d.ts +1 -5
- package/types/view/behavior/DnD.d.ts +0 -4
- package/types/view/edge/AdjustPoint.d.ts +1 -3
- package/types/view/edge/Arrow.d.ts +3 -3
- package/types/view/edge/BaseEdge.d.ts +2 -20
- package/types/view/edge/BezierEdge.d.ts +0 -12
- package/types/view/edge/LineEdge.d.ts +0 -13
- package/types/view/edge/PolylineEdge.d.ts +0 -12
- package/types/view/node/BaseNode.d.ts +0 -36
- package/types/view/node/CircleNode.d.ts +0 -37
- package/types/view/node/DiamondNode.d.ts +0 -37
- package/types/view/node/EllipseNode.d.ts +0 -26
- package/types/view/node/HtmlNode.d.ts +20 -0
- package/types/view/node/PolygonNode.d.ts +1 -19
- package/types/view/node/RectNode.d.ts +0 -37
- package/types/view/node/TextNode.d.ts +1 -0
- package/types/view/overlay/BackgroundOverlay.d.ts +18 -29
- package/types/view/overlay/CanvasOverlay.d.ts +0 -2
- package/types/view/overlay/OutlineOverlay.d.ts +1 -1
- package/dist/logic-flow.es.js +0 -72
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Point, PointTuple } from '../../type';
|
|
2
2
|
import BaseNodeModel from './BaseNodeModel';
|
|
3
3
|
import { ModelType } from '../../constant/constant';
|
|
4
|
-
import GraphModel from '../GraphModel';
|
|
5
4
|
declare class DiamondNodeModel extends BaseNodeModel {
|
|
6
5
|
modelType: ModelType;
|
|
7
6
|
rx: number;
|
|
8
7
|
ry: number;
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
getNodeStyle(): {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
fill?: string;
|
|
11
|
+
stroke?: string;
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
};
|
|
11
14
|
get points(): PointTuple[];
|
|
12
15
|
get pointsPosition(): Point[];
|
|
13
16
|
get width(): number;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Point } from '../../type';
|
|
2
2
|
import BaseNodeModel from './BaseNodeModel';
|
|
3
3
|
import { ModelType } from '../../constant/constant';
|
|
4
|
-
import GraphModel from '../GraphModel';
|
|
5
4
|
declare class EllipseNodeModel extends BaseNodeModel {
|
|
6
5
|
modelType: ModelType;
|
|
7
6
|
rx: number;
|
|
8
7
|
ry: number;
|
|
9
|
-
|
|
8
|
+
getNodeStyle(): {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
fill?: string;
|
|
11
|
+
stroke?: string;
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
};
|
|
10
14
|
get width(): number;
|
|
11
15
|
get height(): number;
|
|
12
16
|
get anchors(): Point[];
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Point } from '../../type';
|
|
2
2
|
import BaseNodeModel from './BaseNodeModel';
|
|
3
3
|
import { ModelType } from '../../constant/constant';
|
|
4
|
-
import GraphModel from '../GraphModel';
|
|
5
4
|
declare class HtmlNodeModel extends BaseNodeModel {
|
|
6
5
|
modelType: ModelType;
|
|
7
|
-
constructor(data: any, graphModel: GraphModel);
|
|
8
6
|
get anchors(): Point[];
|
|
9
7
|
}
|
|
10
8
|
export { HtmlNodeModel };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Point, PointTuple } from '../../type';
|
|
2
2
|
import BaseNodeModel from './BaseNodeModel';
|
|
3
3
|
import { ModelType } from '../../constant/constant';
|
|
4
|
-
import GraphModel from '../GraphModel';
|
|
5
4
|
declare class PolygonNodeModel extends BaseNodeModel {
|
|
6
5
|
modelType: ModelType;
|
|
7
6
|
points: PointTuple[];
|
|
8
|
-
|
|
7
|
+
getNodeStyle(): {
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
fill?: string;
|
|
10
|
+
stroke?: string;
|
|
11
|
+
strokeWidth?: number;
|
|
12
|
+
};
|
|
9
13
|
/**
|
|
10
14
|
* 由于大多数情况下,我们初始化拿到的多边形坐标都是基于原点的(例如绘图工具到处的svg)。
|
|
11
15
|
* 在logicflow中对多边形进行移动,我们不需要去更新points,
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { Point } from '../../type';
|
|
2
2
|
import BaseNodeModel from './BaseNodeModel';
|
|
3
3
|
import { ModelType } from '../../constant/constant';
|
|
4
|
-
import GraphModel from '../GraphModel';
|
|
5
4
|
declare class RectNodeModel extends BaseNodeModel {
|
|
6
5
|
modelType: ModelType;
|
|
7
6
|
radius: number;
|
|
8
|
-
constructor(data: any, graphModel: GraphModel);
|
|
9
7
|
get anchors(): Point[];
|
|
8
|
+
getNodeStyle(): {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
radius?: number;
|
|
13
|
+
fill?: string;
|
|
14
|
+
stroke?: string;
|
|
15
|
+
strokeWidth?: number;
|
|
16
|
+
};
|
|
10
17
|
}
|
|
11
18
|
export { RectNodeModel };
|
|
12
19
|
export default RectNodeModel;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import BaseNodeModel from './BaseNodeModel';
|
|
2
2
|
import { ModelType } from '../../constant/constant';
|
|
3
|
-
import GraphModel from '../GraphModel';
|
|
4
3
|
declare class TextNodeModel extends BaseNodeModel {
|
|
5
4
|
modelType: ModelType;
|
|
6
5
|
fontSize: number;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
getNodeStyle(): {
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
color?: string;
|
|
9
|
+
fontSize?: number;
|
|
10
|
+
fill?: string;
|
|
11
|
+
stroke?: string;
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
};
|
|
10
14
|
get width(): number;
|
|
11
15
|
get height(): number;
|
|
12
16
|
}
|
package/types/options.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { DndOptions } from './view/behavior/DnD';
|
|
2
1
|
import { GridOptions } from './view/overlay/Grid';
|
|
3
2
|
import { BackgroundConfig } from './view/overlay/BackgroundOverlay';
|
|
4
|
-
import {
|
|
3
|
+
import { NodeData, EdgeData, GraphConfigData } from './type';
|
|
5
4
|
import { KeyboardDef } from './keyboard';
|
|
6
|
-
import { EditConfigInterface } from './model/
|
|
5
|
+
import { EditConfigInterface } from './model/editConfigModel';
|
|
6
|
+
import { Theme } from './constant/DefaultTheme';
|
|
7
7
|
export declare type EdgeType = 'line' | 'polyline' | 'bezier' | any;
|
|
8
8
|
declare type DefaultOverlapMode = 0;
|
|
9
9
|
declare type IncreaseOverlapMode = 1;
|
|
10
10
|
/**
|
|
11
11
|
* 元素重叠处理方式
|
|
12
|
-
* 0
|
|
12
|
+
* 0:表示节点在上,边在下,点击元素时选择元素显示在最顶部。
|
|
13
13
|
* 1:表示安装元素创建顺序排序,点击元素也不会将其置顶。要置顶需要调用置顶API。
|
|
14
14
|
*/
|
|
15
15
|
export declare type OverlapMode = DefaultOverlapMode | IncreaseOverlapMode;
|
|
16
16
|
export declare type Definition = {
|
|
17
17
|
/**
|
|
18
18
|
* 画布初始化容器
|
|
19
|
+
* 注意,在不传入width和height的情况下,container元素本身应该存在高度和高度。
|
|
19
20
|
*/
|
|
20
21
|
container: HTMLElement;
|
|
21
22
|
/**
|
|
@@ -34,18 +35,53 @@ export declare type Definition = {
|
|
|
34
35
|
* 网格
|
|
35
36
|
*/
|
|
36
37
|
grid?: boolean | GridOptions;
|
|
38
|
+
/**
|
|
39
|
+
* 键盘快捷操作
|
|
40
|
+
*/
|
|
37
41
|
keyboard?: KeyboardDef;
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
/**
|
|
43
|
+
* 主题配置
|
|
44
|
+
*/
|
|
45
|
+
style?: Theme;
|
|
46
|
+
/**
|
|
47
|
+
* 禁止初始化的插件名称
|
|
48
|
+
*/
|
|
40
49
|
disabledPlugins?: string[];
|
|
50
|
+
/**
|
|
51
|
+
* 默认边类型
|
|
52
|
+
*/
|
|
41
53
|
edgeType?: EdgeType;
|
|
54
|
+
/**
|
|
55
|
+
* 是否开启对齐线,默认开启
|
|
56
|
+
*/
|
|
42
57
|
snapline?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 是否开启历史记录功能,默认开启
|
|
60
|
+
*/
|
|
43
61
|
history?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* 是否开启局部渲染,默认不开启
|
|
64
|
+
*/
|
|
44
65
|
partial?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 删除和克隆之前的判断函数
|
|
68
|
+
* todo: 目前不完善,仅支持同步
|
|
69
|
+
*/
|
|
45
70
|
guards?: GuardsTypes;
|
|
71
|
+
/**
|
|
72
|
+
* 是否不启用outline显示选中和hover效果
|
|
73
|
+
*/
|
|
46
74
|
hideOutline?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* 表示节点在上,边在下,点击元素时选择元素显示在最顶部。
|
|
77
|
+
* 表示安装元素创建顺序排序,点击元素也不会将其置顶。要置顶需要调用置顶API。
|
|
78
|
+
*/
|
|
47
79
|
overlapMode?: OverlapMode;
|
|
48
|
-
|
|
80
|
+
/**
|
|
81
|
+
* 自定义创建节点、连线时生成id规则。
|
|
82
|
+
* @param type 节点、连线类型
|
|
83
|
+
*/
|
|
84
|
+
idGenerator?: (type?: string) => string;
|
|
49
85
|
/**
|
|
50
86
|
* 禁止启用的内置工具
|
|
51
87
|
* 有些场景下,需要自定义多选效果或者文本编辑效果,则需要禁用这些内置的工具
|
|
@@ -53,6 +89,7 @@ export declare type Definition = {
|
|
|
53
89
|
* todo: 将multipleSelect放到插件中
|
|
54
90
|
*/
|
|
55
91
|
disabledTools?: string[];
|
|
92
|
+
[key: string]: any;
|
|
56
93
|
} & EditConfigInterface;
|
|
57
94
|
export interface GuardsTypes {
|
|
58
95
|
beforeClone?: (data: NodeData | GraphConfigData) => boolean;
|
|
@@ -64,8 +101,10 @@ export declare function get(options: Definition): {
|
|
|
64
101
|
textEdit: boolean;
|
|
65
102
|
disabledTools: any[];
|
|
66
103
|
} & {
|
|
104
|
+
[key: string]: any;
|
|
67
105
|
/**
|
|
68
106
|
* 画布初始化容器
|
|
107
|
+
* 注意,在不传入width和height的情况下,container元素本身应该存在高度和高度。
|
|
69
108
|
*/
|
|
70
109
|
container: HTMLElement;
|
|
71
110
|
/**
|
|
@@ -84,18 +123,53 @@ export declare function get(options: Definition): {
|
|
|
84
123
|
* 网格
|
|
85
124
|
*/
|
|
86
125
|
grid?: boolean | GridOptions;
|
|
126
|
+
/**
|
|
127
|
+
* 键盘快捷操作
|
|
128
|
+
*/
|
|
87
129
|
keyboard?: KeyboardDef;
|
|
88
|
-
|
|
89
|
-
|
|
130
|
+
/**
|
|
131
|
+
* 主题配置
|
|
132
|
+
*/
|
|
133
|
+
style?: Theme;
|
|
134
|
+
/**
|
|
135
|
+
* 禁止初始化的插件名称
|
|
136
|
+
*/
|
|
90
137
|
disabledPlugins?: string[];
|
|
138
|
+
/**
|
|
139
|
+
* 默认边类型
|
|
140
|
+
*/
|
|
91
141
|
edgeType?: any;
|
|
142
|
+
/**
|
|
143
|
+
* 是否开启对齐线,默认开启
|
|
144
|
+
*/
|
|
92
145
|
snapline?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* 是否开启历史记录功能,默认开启
|
|
148
|
+
*/
|
|
93
149
|
history?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* 是否开启局部渲染,默认不开启
|
|
152
|
+
*/
|
|
94
153
|
partial?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* 删除和克隆之前的判断函数
|
|
156
|
+
* todo: 目前不完善,仅支持同步
|
|
157
|
+
*/
|
|
95
158
|
guards?: GuardsTypes;
|
|
159
|
+
/**
|
|
160
|
+
* 是否不启用outline显示选中和hover效果
|
|
161
|
+
*/
|
|
96
162
|
hideOutline?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* 表示节点在上,边在下,点击元素时选择元素显示在最顶部。
|
|
165
|
+
* 表示安装元素创建顺序排序,点击元素也不会将其置顶。要置顶需要调用置顶API。
|
|
166
|
+
*/
|
|
97
167
|
overlapMode?: OverlapMode;
|
|
98
|
-
|
|
168
|
+
/**
|
|
169
|
+
* 自定义创建节点、连线时生成id规则。
|
|
170
|
+
* @param type 节点、连线类型
|
|
171
|
+
*/
|
|
172
|
+
idGenerator?: (type?: string) => string;
|
|
99
173
|
/**
|
|
100
174
|
* 禁止启用的内置工具
|
|
101
175
|
* 有些场景下,需要自定义多选效果或者文本编辑效果,则需要禁用这些内置的工具
|
package/types/type/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import EllipseNodeModel from '../model/node/EllipseNodeModel';
|
|
|
23
23
|
import HtmlNode from '../view/node/HtmlNode';
|
|
24
24
|
import HtmlNodeModel from '../model/node/HtmlNodeModel';
|
|
25
25
|
import * as Options from '../options';
|
|
26
|
+
import { CommonTheme, EdgeTextTheme } from '../constant/DefaultTheme';
|
|
26
27
|
export declare type PointTuple = [number, number];
|
|
27
28
|
export declare type Point = {
|
|
28
29
|
x: number;
|
|
@@ -124,7 +125,11 @@ export declare type EdgeFilter = {
|
|
|
124
125
|
};
|
|
125
126
|
export declare type EdgeConfig = {
|
|
126
127
|
id?: string;
|
|
127
|
-
|
|
128
|
+
/**
|
|
129
|
+
* 边的类型,不传默认为lf.setDefaultEdgeType(type)传入的类型。
|
|
130
|
+
* LogicFlow内部默认为polyline
|
|
131
|
+
*/
|
|
132
|
+
type?: string;
|
|
128
133
|
sourceNodeId: string;
|
|
129
134
|
sourceAnchorId?: string;
|
|
130
135
|
targetNodeId: string;
|
|
@@ -164,9 +169,7 @@ export declare type CommonStyle = {
|
|
|
164
169
|
strokeOpacity?: number;
|
|
165
170
|
opacity?: number;
|
|
166
171
|
outlineColor?: string;
|
|
167
|
-
hoverOutlineColor?: string;
|
|
168
172
|
outlineStrokeDashArray?: string;
|
|
169
|
-
hoverOutlineStrokeDashArray?: string;
|
|
170
173
|
};
|
|
171
174
|
export declare type RectStyle = CommonStyle & {
|
|
172
175
|
width?: number;
|
|
@@ -226,25 +229,10 @@ export declare type TextStyle = {
|
|
|
226
229
|
fontFamily?: string;
|
|
227
230
|
};
|
|
228
231
|
export declare type NodeTextStyle = TextStyle & {
|
|
229
|
-
autoWrap?: boolean;
|
|
230
|
-
lineHeight?: number;
|
|
231
|
-
wrapPadding?: string;
|
|
232
|
-
};
|
|
233
|
-
export declare type EdgeTextStyle = TextStyle & {
|
|
234
|
-
background?: {
|
|
235
|
-
fill?: string;
|
|
236
|
-
stroke?: string;
|
|
237
|
-
radius?: number;
|
|
238
|
-
};
|
|
239
|
-
hoverBackground?: {
|
|
240
|
-
fill?: string;
|
|
241
|
-
stroke?: string;
|
|
242
|
-
radius?: number;
|
|
243
|
-
};
|
|
244
|
-
autoWrap?: boolean;
|
|
245
232
|
lineHeight?: number;
|
|
246
233
|
wrapPadding?: string;
|
|
247
234
|
};
|
|
235
|
+
export declare type EdgeTextStyle = TextStyle & EdgeTextTheme;
|
|
248
236
|
export declare type ArrowStyle = {
|
|
249
237
|
offset?: number;
|
|
250
238
|
verticalLength?: number;
|
|
@@ -254,24 +242,6 @@ export declare type EdgeAdjustStyle = {
|
|
|
254
242
|
fill?: string;
|
|
255
243
|
stroke?: string;
|
|
256
244
|
};
|
|
257
|
-
export declare type Style = {
|
|
258
|
-
rect?: RectStyle;
|
|
259
|
-
circle?: CircleStyle;
|
|
260
|
-
ellipse?: EllipseStyle;
|
|
261
|
-
diamond?: DiamondStyle;
|
|
262
|
-
polygon?: PolygonStyle;
|
|
263
|
-
anchor?: AnchorStyle;
|
|
264
|
-
text?: TextStyle;
|
|
265
|
-
nodeText?: NodeTextStyle;
|
|
266
|
-
edgeText?: EdgeTextStyle;
|
|
267
|
-
line?: LineStyle;
|
|
268
|
-
polyline?: PolylineStyle;
|
|
269
|
-
bezier?: BezierStyle;
|
|
270
|
-
arrow?: ArrowStyle;
|
|
271
|
-
anchorLine?: AnchorLineStyle;
|
|
272
|
-
anchorHover?: AnchorHoverStyle;
|
|
273
|
-
EdgeAdjustStyle?: EdgeAdjustStyle;
|
|
274
|
-
};
|
|
275
245
|
export declare type GraphTransform = {
|
|
276
246
|
transform: string;
|
|
277
247
|
transformOrigin: string;
|
|
@@ -374,4 +344,26 @@ export declare type AnchorConfig = {
|
|
|
374
344
|
*/
|
|
375
345
|
export declare type NodeMoveRule = (model: BaseNodeModel, deltaX: number, deltaY: number) => Boolean;
|
|
376
346
|
export declare type ZoomParam = boolean | number;
|
|
347
|
+
export declare type NodeAttributes = {
|
|
348
|
+
id: string;
|
|
349
|
+
properties: Record<string, any>;
|
|
350
|
+
type: string;
|
|
351
|
+
x: number;
|
|
352
|
+
y: number;
|
|
353
|
+
isSelected: boolean;
|
|
354
|
+
isHovered: boolean;
|
|
355
|
+
width: number;
|
|
356
|
+
height: number;
|
|
357
|
+
text: {
|
|
358
|
+
x: number;
|
|
359
|
+
y: number;
|
|
360
|
+
value: string;
|
|
361
|
+
[key: string]: any;
|
|
362
|
+
};
|
|
363
|
+
[key: string]: any;
|
|
364
|
+
};
|
|
365
|
+
export declare type DiamondAttributes = {
|
|
366
|
+
points: PointTuple[];
|
|
367
|
+
} & NodeAttributes;
|
|
368
|
+
export declare type ShapeStyleAttribute = CommonTheme;
|
|
377
369
|
export {};
|
package/types/util/edge.d.ts
CHANGED
|
@@ -88,9 +88,9 @@ export declare type IBezierPoints = {
|
|
|
88
88
|
export declare const getBezierPoints: (path: string) => Point[];
|
|
89
89
|
export declare const getEndTangent: (path: string) => Point[];
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
92
|
-
* @param point
|
|
93
|
-
* @param points
|
|
91
|
+
* 获取移动边后,文本位置距离边上的最近的一点
|
|
92
|
+
* @param point 边上文本的位置
|
|
93
|
+
* @param points 边的各个拐点
|
|
94
94
|
*/
|
|
95
95
|
export declare const getClosestPointOfPolyline: (point: Point, points: string) => Point;
|
|
96
96
|
export declare const pickEdgeConfig: (data: any) => EdgeConfig;
|
package/types/util/graph.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export declare const isPointInArea: ([x, y]: [any, any], [leftTopX, leftTopY]: [
|
|
|
9
9
|
/**
|
|
10
10
|
* 判断鼠标点击选中元素的时候,是否为多选
|
|
11
11
|
*/
|
|
12
|
-
export declare const isMultipleSelect: (e: MouseEvent,
|
|
12
|
+
export declare const isMultipleSelect: (e: MouseEvent, editConfigModel: any) => boolean;
|
package/types/util/node.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare const getSvgTextWidthHeight: ({ rows, rowsLength, fontSize }: {
|
|
|
58
58
|
height: number;
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
61
|
-
* @description
|
|
61
|
+
* @description 格式化边校验信息
|
|
62
62
|
*/
|
|
63
63
|
export declare const formateAnchorConnectValidateData: (data: any) => any;
|
|
64
64
|
export {};
|
package/types/util/theme.d.ts
CHANGED
|
@@ -1,173 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
radius: number;
|
|
6
|
-
fill: string;
|
|
7
|
-
stroke: string;
|
|
8
|
-
strokeWidth: number;
|
|
9
|
-
fillOpacity: number;
|
|
10
|
-
strokeOpacity: number;
|
|
11
|
-
opacity: number;
|
|
12
|
-
outlineColor: string;
|
|
13
|
-
outlineStrokeDashArray: string;
|
|
14
|
-
hoverOutlineColor: string;
|
|
15
|
-
hoverOutlineStrokeDashArray: string;
|
|
16
|
-
};
|
|
17
|
-
circle: {
|
|
18
|
-
r: number;
|
|
19
|
-
fill: string;
|
|
20
|
-
stroke: string;
|
|
21
|
-
strokeWidth: number;
|
|
22
|
-
fillOpacity: number;
|
|
23
|
-
strokeOpacity: number;
|
|
24
|
-
opacity: number;
|
|
25
|
-
outlineColor: string;
|
|
26
|
-
outlineStrokeDashArray: string;
|
|
27
|
-
hoverOutlineColor: string;
|
|
28
|
-
hoverOutlineStrokeDashArray: string;
|
|
29
|
-
};
|
|
30
|
-
diamond: {
|
|
31
|
-
rx: number;
|
|
32
|
-
ry: number;
|
|
33
|
-
fill: string;
|
|
34
|
-
stroke: string;
|
|
35
|
-
strokeWidth: number;
|
|
36
|
-
fillOpacity: number;
|
|
37
|
-
strokeOpacity: number;
|
|
38
|
-
opacity: number;
|
|
39
|
-
outlineColor: string;
|
|
40
|
-
outlineStrokeDashArray: string;
|
|
41
|
-
hoverOutlineColor: string;
|
|
42
|
-
hoverOutlineStrokeDashArray: string;
|
|
43
|
-
};
|
|
44
|
-
ellipse: {
|
|
45
|
-
rx: number;
|
|
46
|
-
ry: number;
|
|
47
|
-
fill: string;
|
|
48
|
-
stroke: string;
|
|
49
|
-
strokeWidth: number;
|
|
50
|
-
fillOpacity: number;
|
|
51
|
-
strokeOpacity: number;
|
|
52
|
-
opacity: number;
|
|
53
|
-
outlineColor: string;
|
|
54
|
-
outlineStrokeDashArray: string;
|
|
55
|
-
hoverOutlineColor: string;
|
|
56
|
-
hoverOutlineStrokeDashArray: string;
|
|
57
|
-
};
|
|
58
|
-
polygon: {
|
|
59
|
-
fill: string;
|
|
60
|
-
stroke: string;
|
|
61
|
-
strokeWidth: number;
|
|
62
|
-
fillOpacity: number;
|
|
63
|
-
strokeOpacity: number;
|
|
64
|
-
opacity: number;
|
|
65
|
-
outlineColor: string;
|
|
66
|
-
outlineStrokeDashArray: string;
|
|
67
|
-
hoverOutlineColor: string;
|
|
68
|
-
hoverOutlineStrokeDashArray: string;
|
|
69
|
-
};
|
|
70
|
-
anchor: {
|
|
71
|
-
stroke: string;
|
|
72
|
-
strokeWidth: number;
|
|
73
|
-
r: number;
|
|
74
|
-
fill: string;
|
|
75
|
-
fillOpacity: number;
|
|
76
|
-
strokeOpacity: number;
|
|
77
|
-
opacity: number;
|
|
78
|
-
outlineColor: string;
|
|
79
|
-
outlineStrokeDashArray: string;
|
|
80
|
-
hoverOutlineColor: string;
|
|
81
|
-
hoverOutlineStrokeDashArray: string;
|
|
82
|
-
};
|
|
83
|
-
text: {
|
|
84
|
-
color: string;
|
|
85
|
-
fontSize: number;
|
|
86
|
-
fontWeight: string;
|
|
87
|
-
fontFamily: string;
|
|
88
|
-
};
|
|
89
|
-
nodeText: {
|
|
90
|
-
autoWrap: boolean;
|
|
91
|
-
lineHeight: number;
|
|
92
|
-
wrapPadding: string;
|
|
93
|
-
color: string;
|
|
94
|
-
fontSize: number;
|
|
95
|
-
fontWeight: string;
|
|
96
|
-
fontFamily: string;
|
|
97
|
-
};
|
|
98
|
-
edgeText: {
|
|
99
|
-
color: string;
|
|
100
|
-
fontSize: number;
|
|
101
|
-
fontWeight: string;
|
|
102
|
-
fontFamily: string;
|
|
103
|
-
background: {
|
|
104
|
-
fill: string;
|
|
105
|
-
height: number;
|
|
106
|
-
stroke: string;
|
|
107
|
-
radius: number;
|
|
108
|
-
};
|
|
109
|
-
hoverBackground: any;
|
|
110
|
-
autoWrap: boolean;
|
|
111
|
-
lineHeight: number;
|
|
112
|
-
wrapPadding: string;
|
|
113
|
-
};
|
|
114
|
-
line: {
|
|
115
|
-
stroke: string;
|
|
116
|
-
strokeWidth: number;
|
|
117
|
-
hoverStroke: string;
|
|
118
|
-
selectedStroke: string;
|
|
119
|
-
strokeDashArray: string;
|
|
120
|
-
outlineColor: string;
|
|
121
|
-
outlineStrokeDashArray: string;
|
|
122
|
-
};
|
|
123
|
-
polyline: {
|
|
124
|
-
offset: number;
|
|
125
|
-
stroke: string;
|
|
126
|
-
strokeWidth: number;
|
|
127
|
-
hoverStroke: string;
|
|
128
|
-
selectedStroke: string;
|
|
129
|
-
strokeDashArray: string;
|
|
130
|
-
outlineColor: string;
|
|
131
|
-
outlineStrokeDashArray: string;
|
|
132
|
-
};
|
|
133
|
-
bezier: {
|
|
134
|
-
offset: number;
|
|
135
|
-
adjustLineColor: string;
|
|
136
|
-
adjustAnchorStroke: string;
|
|
137
|
-
adjustAnchorFill: string;
|
|
138
|
-
adjustAnchorFillOpacity: number;
|
|
139
|
-
stroke: string;
|
|
140
|
-
strokeWidth: number;
|
|
141
|
-
hoverStroke: string;
|
|
142
|
-
selectedStroke: string;
|
|
143
|
-
strokeDashArray: string;
|
|
144
|
-
outlineColor: string;
|
|
145
|
-
outlineStrokeDashArray: string;
|
|
146
|
-
};
|
|
147
|
-
arrow: {
|
|
148
|
-
offset: number;
|
|
149
|
-
verticalLength: number;
|
|
150
|
-
};
|
|
151
|
-
anchorLine: {
|
|
152
|
-
stroke: string;
|
|
153
|
-
strokeWidth: number;
|
|
154
|
-
strokeDasharray: string;
|
|
155
|
-
};
|
|
156
|
-
anchorHover: {
|
|
157
|
-
fill: string;
|
|
158
|
-
fillOpacity: number;
|
|
159
|
-
stroke: string;
|
|
160
|
-
strokeWidth: number;
|
|
161
|
-
r: number;
|
|
162
|
-
};
|
|
163
|
-
snapline: {
|
|
164
|
-
stroke: string;
|
|
165
|
-
strokeWidth: number;
|
|
166
|
-
};
|
|
167
|
-
edgeAdjust: {
|
|
168
|
-
r: number;
|
|
169
|
-
fill: string;
|
|
170
|
-
stroke: string;
|
|
171
|
-
strokeWidth: string;
|
|
172
|
-
};
|
|
173
|
-
};
|
|
1
|
+
import { Theme } from '../constant/DefaultTheme';
|
|
2
|
+
export declare const updateTheme: (style: Theme) => Theme;
|
package/types/view/Anchor.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { h, Component } from 'preact';
|
|
2
2
|
import BaseNodeModel, { ConnectRuleResult } from '../model/node/BaseNodeModel';
|
|
3
3
|
import GraphModel from '../model/GraphModel';
|
|
4
|
-
import EventEmitter from '../event/eventEmitter';
|
|
5
4
|
import { AnchorConfig } from '../type';
|
|
6
5
|
declare type TargetNodeId = string;
|
|
7
6
|
interface IProps {
|
|
@@ -13,7 +12,6 @@ interface IProps {
|
|
|
13
12
|
hoverStyle?: Record<string, any>;
|
|
14
13
|
edgeStyle?: Record<string, any>;
|
|
15
14
|
anchorIndex: number;
|
|
16
|
-
eventCenter: EventEmitter;
|
|
17
15
|
graphModel: GraphModel;
|
|
18
16
|
nodeModel: BaseNodeModel;
|
|
19
17
|
nodeDraging: boolean;
|
package/types/view/Graph.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Component, h } from 'preact';
|
|
|
2
2
|
import GraphModel from '../model/GraphModel';
|
|
3
3
|
import Tool from '../tool';
|
|
4
4
|
import * as Options from '../options';
|
|
5
|
-
import EventEmitter from '../event/eventEmitter';
|
|
6
5
|
import DnD from './behavior/DnD';
|
|
7
6
|
import BaseEdgeModel from '../model/edge/BaseEdgeModel';
|
|
8
7
|
import BaseNodeModel from '../model/node/BaseNodeModel';
|
|
@@ -11,13 +10,12 @@ declare type IProps = {
|
|
|
11
10
|
getView: (type: string) => typeof Component;
|
|
12
11
|
tool: Tool;
|
|
13
12
|
options: Options.Definition;
|
|
14
|
-
eventCenter: EventEmitter;
|
|
15
13
|
dnd: DnD;
|
|
16
14
|
snaplineModel: SnaplineModel;
|
|
17
15
|
graphModel: GraphModel;
|
|
18
16
|
};
|
|
19
17
|
declare class Graph extends Component<IProps> {
|
|
20
|
-
getComponent(model: BaseEdgeModel | BaseNodeModel, graphModel: GraphModel,
|
|
18
|
+
getComponent(model: BaseEdgeModel | BaseNodeModel, graphModel: GraphModel, overlay?: string): h.JSX.Element;
|
|
21
19
|
render(): h.JSX.Element;
|
|
22
20
|
}
|
|
23
21
|
export default Graph;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
declare type IProps = {
|
|
3
3
|
d: string;
|
|
4
|
-
|
|
5
|
-
stroke: string;
|
|
6
|
-
fill: string;
|
|
7
|
-
strokeDasharray?: string;
|
|
4
|
+
[key: string]: any;
|
|
8
5
|
};
|
|
9
6
|
declare function Path(props: IProps): h.JSX.Element;
|
|
10
|
-
declare namespace Path {
|
|
11
|
-
var defaultProps: {
|
|
12
|
-
strokeDasharray: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
7
|
export default Path;
|
|
@@ -3,16 +3,12 @@ import * as type from '../../type';
|
|
|
3
3
|
declare type IProps = {
|
|
4
4
|
className?: string;
|
|
5
5
|
radius?: number;
|
|
6
|
-
stroke?: string;
|
|
7
|
-
strokeDasharray?: string;
|
|
8
6
|
} & type.Point & type.Size;
|
|
9
7
|
declare function Rect(props: IProps): h.JSX.Element;
|
|
10
8
|
declare namespace Rect {
|
|
11
9
|
var defaultProps: {
|
|
12
|
-
radius: number;
|
|
13
|
-
stroke: string;
|
|
14
|
-
strokeDasharray: string;
|
|
15
10
|
className: string;
|
|
11
|
+
radius: string;
|
|
16
12
|
};
|
|
17
13
|
}
|
|
18
14
|
export default Rect;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import LogicFlow from '../../LogicFlow';
|
|
2
2
|
import { BaseNodeModel } from '../../model';
|
|
3
3
|
import { TextConfig } from '../../type';
|
|
4
|
-
export declare type DndOptions = {
|
|
5
|
-
validate: () => boolean;
|
|
6
|
-
};
|
|
7
4
|
export declare type NewNodeConfig = {
|
|
8
5
|
type: string;
|
|
9
6
|
text?: TextConfig | string;
|
|
@@ -12,7 +9,6 @@ export declare type NewNodeConfig = {
|
|
|
12
9
|
export default class Dnd {
|
|
13
10
|
nodeConfig: NewNodeConfig;
|
|
14
11
|
lf: LogicFlow;
|
|
15
|
-
options: DndOptions;
|
|
16
12
|
fakerNode: BaseNodeModel;
|
|
17
13
|
constructor(params: any);
|
|
18
14
|
clientToLocalPoint({ x, y }: {
|