@logicflow/core 1.1.13 → 1.1.16
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 +9 -0
- package/types/tool/TextEditTool.d.ts +1 -0
- package/types/util/stateUtil.d.ts +4 -0
- package/types/view/Anchor.d.ts +1 -1
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;
|
|
@@ -25,6 +25,7 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
25
25
|
isHitable: boolean;
|
|
26
26
|
draggable: boolean;
|
|
27
27
|
visible: boolean;
|
|
28
|
+
isAnimation: boolean;
|
|
28
29
|
graphModel: GraphModel;
|
|
29
30
|
zIndex: number;
|
|
30
31
|
readonly BaseType = ElementType.EDGE;
|
|
@@ -73,6 +74,12 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
73
74
|
* @returns 自定义边动画样式
|
|
74
75
|
*/
|
|
75
76
|
getAnimation(): import("../../constant/DefaultAnimation").Animation;
|
|
77
|
+
/**
|
|
78
|
+
* @overridable 支持重写
|
|
79
|
+
* 获取当前边的动画样式
|
|
80
|
+
* @returns 自定义边动画样式
|
|
81
|
+
*/
|
|
82
|
+
getEdgeAnimationStyle(): import("../../constant/DefaultTheme").EdgeAnimation;
|
|
76
83
|
/**
|
|
77
84
|
* @overridable 支持重写
|
|
78
85
|
* 获取outline样式,重写可以定义此类型边outline样式, 默认使用主题样式
|
|
@@ -138,6 +145,8 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
138
145
|
setSelected(flag?: boolean): void;
|
|
139
146
|
setHovered(flag?: boolean): void;
|
|
140
147
|
setHitable(flag?: boolean): void;
|
|
148
|
+
openEdgeAnimation(): void;
|
|
149
|
+
closeEdgeAnimation(): void;
|
|
141
150
|
setElementState(state: number, additionStateData?: AdditionData): void;
|
|
142
151
|
updateStartPoint(anchor: any): void;
|
|
143
152
|
moveStartPoint(deltaX: any, deltaY: any): void;
|
|
@@ -28,6 +28,7 @@ export default class TextEdit extends Component<IProps, IState> {
|
|
|
28
28
|
componentDidUpdate(): void;
|
|
29
29
|
keyupHandler: (ev: any) => void;
|
|
30
30
|
inputHandler: (ev: any) => void;
|
|
31
|
+
keydownHandler: (ev: any) => void;
|
|
31
32
|
placeCaretAtEnd(el: any): void;
|
|
32
33
|
render(): h.JSX.Element;
|
|
33
34
|
}
|
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;
|