@logicflow/core 1.2.0-alpha.5 → 1.2.0-alpha.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/logic-flow.js +1 -1
- package/package.json +1 -1
- package/types/LogicFlow.d.ts +18 -2
- package/types/constant/DefaultTheme.d.ts +21 -0
- package/types/model/GraphModel.d.ts +13 -2
- package/types/model/edge/BaseEdgeModel.d.ts +26 -3
- package/types/model/node/BaseNodeModel.d.ts +6 -1
- package/types/type/index.d.ts +21 -0
- package/types/view/Anchor.d.ts +1 -1
- package/types/view/edge/BaseEdge.d.ts +2 -0
package/package.json
CHANGED
package/types/LogicFlow.d.ts
CHANGED
|
@@ -106,6 +106,11 @@ export default class LogicFlow {
|
|
|
106
106
|
*/
|
|
107
107
|
register(type: string | RegisterConfig, fn?: RegisterElementFn, isObserverView?: boolean): void;
|
|
108
108
|
private registerElement;
|
|
109
|
+
/**
|
|
110
|
+
* 批量注册
|
|
111
|
+
* @param elements 注册的元素
|
|
112
|
+
*/
|
|
113
|
+
batchRegister(elements?: any[]): void;
|
|
109
114
|
private defaultRegister;
|
|
110
115
|
/**
|
|
111
116
|
* 将图形选中
|
|
@@ -445,9 +450,20 @@ export default class LogicFlow {
|
|
|
445
450
|
translateCenter(): void;
|
|
446
451
|
/**
|
|
447
452
|
* 图形适应屏幕大小
|
|
448
|
-
* @param
|
|
453
|
+
* @param verticalOffset number 距离盒子上下的距离, 默认为20
|
|
454
|
+
* @param horizontalOffset number 距离盒子左右的距离, 默认为20
|
|
455
|
+
*/
|
|
456
|
+
fitView(verticalOffset?: number, horizontalOffset?: number): void;
|
|
457
|
+
/**
|
|
458
|
+
* 开启边的动画
|
|
459
|
+
* @param edgeId any
|
|
460
|
+
*/
|
|
461
|
+
openEdgeAnimation(edgeId: any): void;
|
|
462
|
+
/**
|
|
463
|
+
* 关闭边的动画
|
|
464
|
+
* @param edgeId any
|
|
449
465
|
*/
|
|
450
|
-
|
|
466
|
+
closeEdgeAnimation(edgeId: any): void;
|
|
451
467
|
/**
|
|
452
468
|
* 监听事件
|
|
453
469
|
* 事件详情见 @see todo
|
|
@@ -139,6 +139,10 @@ export declare type EdgeTextTheme = {
|
|
|
139
139
|
* 文本背景样式
|
|
140
140
|
*/
|
|
141
141
|
background?: {
|
|
142
|
+
/**
|
|
143
|
+
* 背景区域padding
|
|
144
|
+
* wrapPadding: '5px,10px'
|
|
145
|
+
*/
|
|
142
146
|
wrapPadding?: string;
|
|
143
147
|
} & RectTheme;
|
|
144
148
|
/**
|
|
@@ -179,6 +183,19 @@ export declare type OutlineTheme = {
|
|
|
179
183
|
*/
|
|
180
184
|
hover?: CommonTheme;
|
|
181
185
|
} & CommonTheme;
|
|
186
|
+
/**
|
|
187
|
+
* 边动画主题
|
|
188
|
+
*/
|
|
189
|
+
export declare type EdgeAnimation = {
|
|
190
|
+
stroke?: string;
|
|
191
|
+
strokeDasharray?: string;
|
|
192
|
+
strokeDashoffset?: string;
|
|
193
|
+
animationName?: string;
|
|
194
|
+
animationDuration?: string;
|
|
195
|
+
animationIterationCount?: string;
|
|
196
|
+
animationTimingFunction?: string;
|
|
197
|
+
animationDirection?: string;
|
|
198
|
+
};
|
|
182
199
|
export declare type Theme = {
|
|
183
200
|
/**
|
|
184
201
|
* 所有节点的通用主题设置
|
|
@@ -258,5 +275,9 @@ export declare type Theme = {
|
|
|
258
275
|
* 节点选择状态下外侧的选框样式
|
|
259
276
|
*/
|
|
260
277
|
outline?: OutlineTheme;
|
|
278
|
+
/**
|
|
279
|
+
* 边动画样式
|
|
280
|
+
*/
|
|
281
|
+
edgeAnimation?: EdgeAnimation;
|
|
261
282
|
};
|
|
262
283
|
export declare const defaultTheme: Theme;
|
|
@@ -433,9 +433,20 @@ declare class GraphModel {
|
|
|
433
433
|
translateCenter(): void;
|
|
434
434
|
/**
|
|
435
435
|
* 画布图形适应屏幕大小
|
|
436
|
-
* @param
|
|
436
|
+
* @param verticalOffset number 距离盒子上下的距离, 默认为20
|
|
437
|
+
* @param horizontalOffset number 距离盒子左右的距离, 默认为20
|
|
437
438
|
*/
|
|
438
|
-
fitView(
|
|
439
|
+
fitView(verticalOffset?: number, horizontalOffset?: number): void;
|
|
440
|
+
/**
|
|
441
|
+
* 开启边的动画
|
|
442
|
+
* @param edgeId any
|
|
443
|
+
*/
|
|
444
|
+
openEdgeAnimation(edgeId: any): void;
|
|
445
|
+
/**
|
|
446
|
+
* 关闭边的动画
|
|
447
|
+
* @param edgeId any
|
|
448
|
+
*/
|
|
449
|
+
closeEdgeAnimation(edgeId: any): void;
|
|
439
450
|
}
|
|
440
451
|
export { GraphModel };
|
|
441
452
|
export default GraphModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IBaseModel } from '../BaseModel';
|
|
2
2
|
import GraphModel from '../GraphModel';
|
|
3
|
-
import { Point, AdditionData, EdgeData, MenuConfig, EdgeConfig } from '../../type/index';
|
|
3
|
+
import { Point, AdditionData, EdgeData, MenuConfig, EdgeConfig, ShapeStyleAttribute } from '../../type/index';
|
|
4
4
|
import { ModelType, ElementType } from '../../constant/constant';
|
|
5
5
|
import { OutlineTheme } from '../../constant/DefaultTheme';
|
|
6
6
|
declare class BaseEdgeModel implements IBaseModel {
|
|
@@ -25,6 +25,8 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
25
25
|
isHitable: boolean;
|
|
26
26
|
draggable: boolean;
|
|
27
27
|
visible: boolean;
|
|
28
|
+
virtual: boolean;
|
|
29
|
+
isAnimation: boolean;
|
|
28
30
|
graphModel: GraphModel;
|
|
29
31
|
zIndex: number;
|
|
30
32
|
readonly BaseType = ElementType.EDGE;
|
|
@@ -36,6 +38,11 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
36
38
|
menu?: MenuConfig[];
|
|
37
39
|
customTextPosition: boolean;
|
|
38
40
|
animationData: import("../../constant/DefaultAnimation").Animation;
|
|
41
|
+
style: ShapeStyleAttribute;
|
|
42
|
+
arrowConfig: {
|
|
43
|
+
markerEnd: string;
|
|
44
|
+
markerStart: string;
|
|
45
|
+
};
|
|
39
46
|
[propName: string]: any;
|
|
40
47
|
constructor(data: EdgeConfig, graphModel: GraphModel);
|
|
41
48
|
init(): void;
|
|
@@ -62,7 +69,12 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
62
69
|
* 获取当前节点样式
|
|
63
70
|
* @returns 自定义边样式
|
|
64
71
|
*/
|
|
65
|
-
getEdgeStyle():
|
|
72
|
+
getEdgeStyle(): {
|
|
73
|
+
[x: string]: any;
|
|
74
|
+
fill?: string;
|
|
75
|
+
stroke?: string;
|
|
76
|
+
strokeWidth?: number;
|
|
77
|
+
};
|
|
66
78
|
/**
|
|
67
79
|
* @override 支持重写
|
|
68
80
|
* 获取当前节点文本样式
|
|
@@ -75,7 +87,13 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
75
87
|
*/
|
|
76
88
|
getAnimation(): import("../../constant/DefaultAnimation").Animation;
|
|
77
89
|
/**
|
|
78
|
-
* @
|
|
90
|
+
* @overridable 支持重写
|
|
91
|
+
* 获取当前边的动画样式
|
|
92
|
+
* @returns 自定义边动画样式
|
|
93
|
+
*/
|
|
94
|
+
getEdgeAnimationStyle(): import("../../constant/DefaultTheme").EdgeAnimation;
|
|
95
|
+
/**
|
|
96
|
+
* @overridable 支持重写
|
|
79
97
|
* 获取outline样式,重写可以定义此类型边outline样式, 默认使用主题样式
|
|
80
98
|
* @returns 自定义outline样式
|
|
81
99
|
*/
|
|
@@ -112,6 +130,9 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
112
130
|
getHistoryData(): EdgeData;
|
|
113
131
|
setProperty(key: any, val: any): void;
|
|
114
132
|
setProperties(properties: any): void;
|
|
133
|
+
setStyle(key: any, val: any): void;
|
|
134
|
+
setStyles(styles: any): void;
|
|
135
|
+
updateStyles(styles: any): void;
|
|
115
136
|
/**
|
|
116
137
|
* 内部方法,处理初始化文本格式
|
|
117
138
|
*/
|
|
@@ -139,6 +160,8 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
139
160
|
setSelected(flag?: boolean): void;
|
|
140
161
|
setHovered(flag?: boolean): void;
|
|
141
162
|
setHitable(flag?: boolean): void;
|
|
163
|
+
openEdgeAnimation(): void;
|
|
164
|
+
closeEdgeAnimation(): void;
|
|
142
165
|
setElementState(state: number, additionStateData?: AdditionData): void;
|
|
143
166
|
updateStartPoint(anchor: any): void;
|
|
144
167
|
moveStartPoint(deltaX: any, deltaY: any): void;
|
|
@@ -45,10 +45,12 @@ 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;
|
|
51
52
|
autoToFront: boolean;
|
|
53
|
+
style: ShapeStyleAttribute;
|
|
52
54
|
readonly BaseType = ElementType.NODE;
|
|
53
55
|
modelType: ModelType;
|
|
54
56
|
additionStateData: AdditionData;
|
|
@@ -194,7 +196,10 @@ export default class BaseNodeModel implements IBaseNodeModel {
|
|
|
194
196
|
setElementState(state: number, additionStateData?: AdditionData): void;
|
|
195
197
|
setProperty(key: any, val: any): void;
|
|
196
198
|
setProperties(properties: any): void;
|
|
197
|
-
|
|
199
|
+
setStyle(key: any, val: any): void;
|
|
200
|
+
setStyles(styles: any): void;
|
|
201
|
+
updateStyles(styles: any): void;
|
|
202
|
+
setZIndex(zindex?: number): void;
|
|
198
203
|
/**
|
|
199
204
|
* 设置节点属性;
|
|
200
205
|
* 支持属性请参考节点属性文档
|
package/types/type/index.d.ts
CHANGED
|
@@ -382,4 +382,25 @@ export declare type VirtualRectSize = {
|
|
|
382
382
|
virtualRectCenterPositionX: number;
|
|
383
383
|
virtualRectCenterPositionY: number;
|
|
384
384
|
};
|
|
385
|
+
export declare type ArrowPath = {
|
|
386
|
+
d: string;
|
|
387
|
+
stroke?: string;
|
|
388
|
+
fill?: string;
|
|
389
|
+
transform?: string;
|
|
390
|
+
[key: string]: any;
|
|
391
|
+
};
|
|
392
|
+
export declare type ArrowMarker = {
|
|
393
|
+
id: string;
|
|
394
|
+
refX?: string | number;
|
|
395
|
+
refY?: string | number;
|
|
396
|
+
overflow?: string;
|
|
397
|
+
orient?: string;
|
|
398
|
+
markerUnits?: string;
|
|
399
|
+
viewBox?: string;
|
|
400
|
+
markerWidth?: number;
|
|
401
|
+
markerHeight?: number;
|
|
402
|
+
path: ArrowPath;
|
|
403
|
+
[key: string]: any;
|
|
404
|
+
};
|
|
405
|
+
export declare type ArrowMarkerList = ArrowMarker[];
|
|
385
406
|
export {};
|
package/types/view/Anchor.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ declare class Anchor extends Component<IProps, IState> {
|
|
|
38
38
|
event: any;
|
|
39
39
|
}) => void;
|
|
40
40
|
onDragEnd: (event: any) => void;
|
|
41
|
-
checkEnd: () => void;
|
|
41
|
+
checkEnd: (event: any) => void;
|
|
42
42
|
moveAnchorEnd(endX: number, endY: number): void;
|
|
43
43
|
isShowLine(): boolean;
|
|
44
44
|
render(): h.JSX.Element;
|
|
@@ -17,6 +17,8 @@ export default class BaseEdge extends Component<IProps> {
|
|
|
17
17
|
getArrowInfo(): ArrowInfo;
|
|
18
18
|
getArrowStyle(): ArrowStyle;
|
|
19
19
|
getArrow(): h.JSX.Element;
|
|
20
|
+
getStartArrow(): h.JSX.Element;
|
|
21
|
+
getEndArrow(): h.JSX.Element;
|
|
20
22
|
getAdjustPoints(): h.JSX.Element;
|
|
21
23
|
getAnimation(): void;
|
|
22
24
|
getAppendWidth(): h.JSX.Element;
|