@logicflow/core 1.1.23 → 1.1.26
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/logic-flow.js +194 -101
- package/dist/logic-flow.min.js +1 -1
- package/package.json +1 -1
- package/types/LogicFlow.d.ts +1 -1
- package/types/model/BaseModel.d.ts +7 -0
- package/types/model/GraphModel.d.ts +6 -1
- package/types/model/edge/BaseEdgeModel.d.ts +1 -0
- package/types/model/node/BaseNodeModel.d.ts +4 -2
- package/types/options.d.ts +22 -0
- package/types/util/edge.d.ts +6 -0
package/package.json
CHANGED
package/types/LogicFlow.d.ts
CHANGED
|
@@ -338,7 +338,7 @@ export default class LogicFlow {
|
|
|
338
338
|
* @param leftTopPoint 区域左上角坐标, dom层坐标
|
|
339
339
|
* @param rightBottomPoint 区域右下角坐标,dom层坐标
|
|
340
340
|
*/
|
|
341
|
-
getAreaElement(leftTopPoint: PointTuple, rightBottomPoint: PointTuple, wholeEdge?: boolean, wholeNode?: boolean): any[];
|
|
341
|
+
getAreaElement(leftTopPoint: PointTuple, rightBottomPoint: PointTuple, wholeEdge?: boolean, wholeNode?: boolean, ignoreHideElement?: boolean): any[];
|
|
342
342
|
/**
|
|
343
343
|
* 获取选中的元素数据
|
|
344
344
|
* @param isIgnoreCheck 是否包括sourceNode和targetNode没有被选中的边,默认包括。
|
|
@@ -53,6 +53,10 @@ declare class GraphModel {
|
|
|
53
53
|
* @see todo docs link
|
|
54
54
|
*/
|
|
55
55
|
idGenerator: (type?: string) => string;
|
|
56
|
+
/**
|
|
57
|
+
* 节点间连线、连线变更时的边的生成规则
|
|
58
|
+
*/
|
|
59
|
+
edgeGenerator: Definition['edgeGenerator'];
|
|
56
60
|
/**
|
|
57
61
|
* 节点移动规则判断
|
|
58
62
|
* 在节点移动的时候,会出发此数组中的所有规则判断
|
|
@@ -142,8 +146,9 @@ declare class GraphModel {
|
|
|
142
146
|
* @param rightBottomPoint 表示区域右下角的点
|
|
143
147
|
* @param wholeEdge 是否要整个边都在区域内部
|
|
144
148
|
* @param wholeNode 是否要整个节点都在区域内部
|
|
149
|
+
* @param ignoreHideElement 是否忽略隐藏的节点
|
|
145
150
|
*/
|
|
146
|
-
getAreaElement(leftTopPoint: PointTuple, rightBottomPoint: PointTuple, wholeEdge?: boolean, wholeNode?: boolean): any[];
|
|
151
|
+
getAreaElement(leftTopPoint: PointTuple, rightBottomPoint: PointTuple, wholeEdge?: boolean, wholeNode?: boolean, ignoreHideElement?: boolean): any[];
|
|
147
152
|
/**
|
|
148
153
|
* 获取指定类型元素对应的Model
|
|
149
154
|
*/
|
|
@@ -45,6 +45,7 @@ export default class BaseNodeModel implements IBaseNodeModel {
|
|
|
45
45
|
isHitable: boolean;
|
|
46
46
|
draggable: boolean;
|
|
47
47
|
visible: boolean;
|
|
48
|
+
virtual: boolean;
|
|
48
49
|
graphModel: GraphModel;
|
|
49
50
|
zIndex: number;
|
|
50
51
|
state: number;
|
|
@@ -183,8 +184,9 @@ export default class BaseNodeModel implements IBaseNodeModel {
|
|
|
183
184
|
get anchors(): PointAnchor[];
|
|
184
185
|
getAnchorInfo(anchorId: string): PointAnchor;
|
|
185
186
|
addNodeMoveRules(fn: NodeMoveRule): void;
|
|
186
|
-
move(deltaX: any, deltaY: any,
|
|
187
|
-
|
|
187
|
+
move(deltaX: any, deltaY: any, isIgnoreRule?: boolean): boolean;
|
|
188
|
+
getMoveDistance(deltaX: number, deltaY: number, isIgnoreRule?: boolean): [number, number];
|
|
189
|
+
moveTo(x: any, y: any, isIgnoreRule?: boolean): boolean;
|
|
188
190
|
moveText(deltaX: any, deltaY: any): void;
|
|
189
191
|
updateText(value: string): void;
|
|
190
192
|
setSelected(flag?: boolean): void;
|
package/types/options.d.ts
CHANGED
|
@@ -97,6 +97,17 @@ export declare type Definition = {
|
|
|
97
97
|
* AnimationConfig: 配置部分动画开启
|
|
98
98
|
*/
|
|
99
99
|
animation?: boolean | Partial<AnimationConfig>;
|
|
100
|
+
/**
|
|
101
|
+
* 节点间连线、连线变更时的边的生成规则
|
|
102
|
+
* @param sourceNode 起始节点数据
|
|
103
|
+
* @param targetNode 终止节点数据
|
|
104
|
+
* @param currentEdge 当前边的数据, 仅移动已有边的时候有值
|
|
105
|
+
*
|
|
106
|
+
* @return undefined: 使用默认边
|
|
107
|
+
* string: 自定义边类型
|
|
108
|
+
* any: 自定义边及其他数据
|
|
109
|
+
*/
|
|
110
|
+
edgeGenerator?: (sourceNode: any, targetNode: any, currentEdge?: any) => string | any | undefined;
|
|
100
111
|
[key: string]: any;
|
|
101
112
|
} & EditConfigInterface;
|
|
102
113
|
export interface GuardsTypes {
|
|
@@ -192,6 +203,17 @@ export declare function get(options: Definition): {
|
|
|
192
203
|
* AnimationConfig: 配置部分动画开启
|
|
193
204
|
*/
|
|
194
205
|
animation?: boolean | Partial<AnimationConfig>;
|
|
206
|
+
/**
|
|
207
|
+
* 节点间连线、连线变更时的边的生成规则
|
|
208
|
+
* @param sourceNode 起始节点数据
|
|
209
|
+
* @param targetNode 终止节点数据
|
|
210
|
+
* @param currentEdge 当前边的数据, 仅移动已有边的时候有值
|
|
211
|
+
*
|
|
212
|
+
* @return undefined: 使用默认边
|
|
213
|
+
* string: 自定义边类型
|
|
214
|
+
* any: 自定义边及其他数据
|
|
215
|
+
*/
|
|
216
|
+
edgeGenerator?: (sourceNode: any, targetNode: any, currentEdge?: any) => any;
|
|
195
217
|
} & EditConfigInterface;
|
|
196
218
|
export declare const defaults: {
|
|
197
219
|
background: boolean;
|
package/types/util/edge.d.ts
CHANGED
|
@@ -99,4 +99,10 @@ declare type Position = {
|
|
|
99
99
|
y: number;
|
|
100
100
|
};
|
|
101
101
|
export declare const twoPointDistance: (source: Position, target: Position) => number;
|
|
102
|
+
/**
|
|
103
|
+
* 包装边生成函数
|
|
104
|
+
* @param graphModel graph model
|
|
105
|
+
* @param generator 用户自定义的边生成函数
|
|
106
|
+
*/
|
|
107
|
+
export declare function createEdgeGenerator(graphModel: any, generator?: Function): (sourceNode: any, targetNode: any, currentEdge?: any) => any;
|
|
102
108
|
export {};
|