@logicflow/core 1.2.15 → 1.2.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 +3 -3
- package/dist/logic-flow.min.js +3 -3
- package/package.json +1 -1
- package/types/LogicFlow.d.ts +1 -7
- package/types/constant/constant.d.ts +1 -0
- package/types/model/GraphModel.d.ts +4 -0
- package/types/model/node/BaseNodeModel.d.ts +4 -2
- package/types/options.d.ts +9 -1
- package/types/type/index.d.ts +1 -0
- package/types/view/Anchor.d.ts +3 -1
package/package.json
CHANGED
package/types/LogicFlow.d.ts
CHANGED
|
@@ -340,7 +340,7 @@ export default class LogicFlow {
|
|
|
340
340
|
/**
|
|
341
341
|
* 添加多个元素, 包括边和节点。
|
|
342
342
|
*/
|
|
343
|
-
addElements({ nodes, edges }: GraphConfigData): GraphConfigModel;
|
|
343
|
+
addElements({ nodes, edges }: GraphConfigData, distance?: number): GraphConfigModel;
|
|
344
344
|
/**
|
|
345
345
|
* 获取指定区域内的所有元素,此区域必须是DOM层。
|
|
346
346
|
* 例如鼠标绘制选区后,获取选区内的所有元素。
|
|
@@ -397,12 +397,6 @@ export default class LogicFlow {
|
|
|
397
397
|
*/
|
|
398
398
|
getPointByClient(x: number, y: number): {
|
|
399
399
|
domOverlayPosition: {
|
|
400
|
-
/**
|
|
401
|
-
* 将图形选中
|
|
402
|
-
* @param id 选择元素ID
|
|
403
|
-
* @param multiple 是否允许多选,如果为true,不会将上一个选中的元素重置
|
|
404
|
-
* @param toFront 是否将选中的元素置顶,默认为true
|
|
405
|
-
*/
|
|
406
400
|
x: number;
|
|
407
401
|
y: number;
|
|
408
402
|
};
|
|
@@ -36,6 +36,7 @@ export declare enum EventType {
|
|
|
36
36
|
NODE_DBCLICK = "node:dbclick",
|
|
37
37
|
NODE_DELETE = "node:delete",
|
|
38
38
|
NODE_ADD = "node:add",
|
|
39
|
+
NODE_GROUP_COPY = "node:group-copy-add",
|
|
39
40
|
NODE_DND_ADD = "node:dnd-add",
|
|
40
41
|
NODE_DND_DRAG = "node:dnd-drag",
|
|
41
42
|
NODE_MOUSEDOWN = "node:mousedown",
|
|
@@ -53,8 +53,10 @@ export default class BaseNodeModel implements IBaseNodeModel {
|
|
|
53
53
|
state: number;
|
|
54
54
|
autoToFront: boolean;
|
|
55
55
|
style: ShapeStyleAttribute;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
transform: string;
|
|
57
|
+
private _rotate;
|
|
58
|
+
set rotate(value: number);
|
|
59
|
+
get rotate(): number;
|
|
58
60
|
readonly BaseType = ElementType.NODE;
|
|
59
61
|
modelType: ModelType;
|
|
60
62
|
additionStateData: AdditionData;
|
package/types/options.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { VNode } from 'preact';
|
|
1
2
|
import { GridOptions } from './view/overlay/Grid';
|
|
2
3
|
import { BackgroundConfig } from './view/overlay/BackgroundOverlay';
|
|
3
|
-
import { NodeData, EdgeData, Extension, GraphConfigData } from './type';
|
|
4
|
+
import { NodeData, EdgeData, Extension, GraphConfigData, Point } from './type';
|
|
4
5
|
import { KeyboardDef } from './keyboard';
|
|
5
6
|
import { EditConfigInterface } from './model/EditConfigModel';
|
|
6
7
|
import { Theme } from './constant/DefaultTheme';
|
|
@@ -112,8 +113,14 @@ export declare type Definition = {
|
|
|
112
113
|
* any: 自定义边及其他数据
|
|
113
114
|
*/
|
|
114
115
|
edgeGenerator?: (sourceNode: any, targetNode: any, currentEdge?: any) => string | any | undefined;
|
|
116
|
+
customTrajectory?: (props: CustomAnchorLineProps) => VNode;
|
|
115
117
|
[key: string]: any;
|
|
116
118
|
} & EditConfigInterface;
|
|
119
|
+
export interface CustomAnchorLineProps {
|
|
120
|
+
sourcePoint: Point;
|
|
121
|
+
targetPoint: Point;
|
|
122
|
+
[key: string]: any;
|
|
123
|
+
}
|
|
117
124
|
export interface GuardsTypes {
|
|
118
125
|
beforeClone?: (data: NodeData | GraphConfigData) => boolean;
|
|
119
126
|
beforeDelete?: (data: NodeData | EdgeData) => boolean;
|
|
@@ -222,6 +229,7 @@ export declare function get(options: Definition): {
|
|
|
222
229
|
* any: 自定义边及其他数据
|
|
223
230
|
*/
|
|
224
231
|
edgeGenerator?: (sourceNode: any, targetNode: any, currentEdge?: any) => any;
|
|
232
|
+
customTrajectory?: (props: CustomAnchorLineProps) => VNode<{}>;
|
|
225
233
|
} & EditConfigInterface;
|
|
226
234
|
export declare const defaults: {
|
|
227
235
|
background: boolean;
|
package/types/type/index.d.ts
CHANGED
package/types/view/Anchor.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import BaseNodeModel, { ConnectRuleResult } from '../model/node/BaseNodeModel';
|
|
|
4
4
|
import GraphModel from '../model/GraphModel';
|
|
5
5
|
import { AnchorConfig } from '../type';
|
|
6
6
|
import { BaseNode } from './node';
|
|
7
|
+
import { BaseEdgeModel } from '../model';
|
|
7
8
|
declare type TargetNodeId = string;
|
|
8
9
|
interface IProps {
|
|
9
10
|
anchorData: AnchorConfig;
|
|
@@ -40,7 +41,8 @@ declare class Anchor extends Component<IProps, IState> {
|
|
|
40
41
|
onDragEnd: ({ event }: {
|
|
41
42
|
event: any;
|
|
42
43
|
}) => void;
|
|
43
|
-
|
|
44
|
+
get customTrajectory(): (props: import("..").CustomAnchorLineProps) => import("preact").VNode<{}>;
|
|
45
|
+
checkEnd: (event: MouseEvent) => BaseEdgeModel | null;
|
|
44
46
|
moveAnchorEnd(endX: number, endY: number): void;
|
|
45
47
|
isShowLine(): boolean;
|
|
46
48
|
render(): h.JSX.Element;
|