@logicflow/extension 1.0.7-alpha.0 → 1.1.0-alpha.1

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.
Files changed (88) hide show
  1. package/cjs/NodeResize/Control/Control.js +2 -1
  2. package/cjs/NodeResize/Control/Util.js +1 -0
  3. package/cjs/NodeResize/Node/EllipseResize.js +1 -17
  4. package/cjs/NodeResize/Node/HtmlResize.js +72 -0
  5. package/cjs/NodeResize/index.js +7 -1
  6. package/cjs/bpmn/index.js +1 -1
  7. package/cjs/bpmn-adapter/index.js +3 -4
  8. package/cjs/bpmn-adapter/json2xml.js +3 -2
  9. package/cjs/bpmn-adapter/xml2json.js +5 -1
  10. package/cjs/components/context-menu/index.js +34 -22
  11. package/cjs/components/control/index.js +0 -14
  12. package/cjs/components/dnd-panel/index.js +9 -6
  13. package/cjs/components/menu/index.js +10 -10
  14. package/cjs/components/mini-map/index.js +159 -156
  15. package/cjs/components/selection-select/index.js +27 -14
  16. package/cjs/index.js +2 -0
  17. package/cjs/insert-node-in-polyline/index.js +1 -1
  18. package/cjs/materials/curved-edge/index.js +1 -1
  19. package/cjs/tools/flow-path/index.js +1 -1
  20. package/cjs/turbo-adapter/index.js +1 -1
  21. package/es/NodeResize/Control/Control.js +2 -1
  22. package/es/NodeResize/Control/Util.d.ts +1 -0
  23. package/es/NodeResize/Control/Util.js +1 -0
  24. package/es/NodeResize/Node/EllipseResize.js +1 -17
  25. package/es/NodeResize/Node/HtmlResize.d.ts +20 -0
  26. package/es/NodeResize/Node/HtmlResize.js +70 -0
  27. package/es/NodeResize/index.js +7 -1
  28. package/es/bpmn/index.js +1 -1
  29. package/es/bpmn-adapter/index.js +5 -6
  30. package/es/bpmn-adapter/json2xml.d.ts +2 -1
  31. package/es/bpmn-adapter/json2xml.js +2 -1
  32. package/es/bpmn-adapter/xml2json.d.ts +2 -2
  33. package/es/bpmn-adapter/xml2json.js +4 -1
  34. package/es/components/context-menu/index.d.ts +10 -1
  35. package/es/components/context-menu/index.js +34 -22
  36. package/es/components/control/index.d.ts +4 -5
  37. package/es/components/control/index.js +0 -14
  38. package/es/components/dnd-panel/index.d.ts +1 -0
  39. package/es/components/dnd-panel/index.js +9 -6
  40. package/es/components/menu/index.d.ts +2 -2
  41. package/es/components/menu/index.js +10 -10
  42. package/es/components/mini-map/index.d.ts +73 -2
  43. package/es/components/mini-map/index.js +159 -156
  44. package/es/components/selection-select/index.d.ts +8 -0
  45. package/es/components/selection-select/index.js +27 -14
  46. package/es/index.d.ts +2 -0
  47. package/es/index.js +2 -0
  48. package/es/insert-node-in-polyline/index.js +1 -1
  49. package/es/materials/curved-edge/index.js +1 -1
  50. package/es/tools/flow-path/index.js +1 -1
  51. package/es/turbo-adapter/index.js +1 -1
  52. package/lib/AutoLayout.js +1 -1
  53. package/lib/BpmnAdapter.js +1 -1
  54. package/lib/BpmnElement.js +1 -1
  55. package/lib/ContextMenu.js +1 -1
  56. package/lib/Control.js +1 -1
  57. package/lib/CurvedEdge.js +1 -1
  58. package/lib/DndPanel.js +1 -1
  59. package/lib/FlowPath.js +1 -1
  60. package/lib/Group.js +1 -1
  61. package/lib/InsertNodeInPolyline.js +1 -1
  62. package/lib/Menu.js +1 -1
  63. package/lib/MiniMap.js +1 -1
  64. package/lib/NodeResize.js +1 -1
  65. package/lib/RectLabelNode.js +1 -1
  66. package/lib/SelectionSelect.js +1 -1
  67. package/lib/Snapshot.js +1 -1
  68. package/lib/TurboAdapter.js +1 -1
  69. package/lib/lfJson2Xml.js +1 -0
  70. package/lib/lfXml2Json.js +1 -0
  71. package/package.json +2 -2
  72. package/types/NodeResize/Control/Util.d.ts +1 -0
  73. package/types/NodeResize/Node/HtmlResize.d.ts +20 -0
  74. package/types/bpmn-adapter/json2xml.d.ts +2 -1
  75. package/types/bpmn-adapter/xml2json.d.ts +2 -2
  76. package/types/components/context-menu/index.d.ts +10 -1
  77. package/types/components/control/index.d.ts +4 -5
  78. package/types/components/dnd-panel/index.d.ts +1 -0
  79. package/types/components/menu/index.d.ts +2 -2
  80. package/types/components/mini-map/index.d.ts +73 -2
  81. package/types/components/selection-select/index.d.ts +8 -0
  82. package/types/index.d.ts +2 -0
  83. package/cjs/NodeResize/BasicShape/Ellipse.js +0 -21
  84. package/cjs/curved.js +0 -0
  85. package/es/NodeResize/BasicShape/Ellipse.d.ts +0 -2
  86. package/es/NodeResize/BasicShape/Ellipse.js +0 -18
  87. package/es/curved.d.ts +0 -0
  88. package/es/curved.js +0 -0
@@ -0,0 +1,70 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ import { h, HtmlNode, HtmlNodeModel } from '@logicflow/core';
15
+ import ControlGroup from '../Control/ControlGroup';
16
+ var HtmlResizeModel = /** @class */ (function (_super) {
17
+ __extends(HtmlResizeModel, _super);
18
+ function HtmlResizeModel() {
19
+ var _this = _super !== null && _super.apply(this, arguments) || this;
20
+ _this.minWidth = 30;
21
+ _this.minHeight = 30;
22
+ _this.maxWidth = 2000;
23
+ _this.maxHeight = 2000;
24
+ return _this;
25
+ }
26
+ HtmlResizeModel.prototype.getOutlineStyle = function () {
27
+ var style = _super.prototype.getOutlineStyle.call(this);
28
+ style.stroke = 'none';
29
+ if (style.hover) {
30
+ style.hover.stroke = 'none';
31
+ }
32
+ return style;
33
+ };
34
+ HtmlResizeModel.prototype.setAttributes = function () {
35
+ // @ts-ignore
36
+ var nodeSize = this.properties.nodeSize;
37
+ if (nodeSize) {
38
+ this.width = nodeSize.width;
39
+ this.height = nodeSize.height;
40
+ }
41
+ };
42
+ return HtmlResizeModel;
43
+ }(HtmlNodeModel));
44
+ var HtmlResizeView = /** @class */ (function (_super) {
45
+ __extends(HtmlResizeView, _super);
46
+ function HtmlResizeView() {
47
+ return _super !== null && _super.apply(this, arguments) || this;
48
+ }
49
+ HtmlResizeView.prototype.getControlGroup = function () {
50
+ var _a = this.props, model = _a.model, graphModel = _a.graphModel;
51
+ return (h(ControlGroup, { model: model, graphModel: graphModel }));
52
+ };
53
+ // getResizeShape绘制图形,功能等同于基础矩形的getShape功能,可以通过复写此方法,进行节点自定义
54
+ HtmlResizeView.prototype.getResizeShape = function () {
55
+ return _super.prototype.getShape.call(this);
56
+ };
57
+ HtmlResizeView.prototype.getShape = function () {
58
+ var isSelected = this.props.model.isSelected;
59
+ return (h("g", null,
60
+ this.getResizeShape(),
61
+ isSelected ? this.getControlGroup() : ''));
62
+ };
63
+ return HtmlResizeView;
64
+ }(HtmlNode));
65
+ var HtmlResize = {
66
+ type: 'html',
67
+ view: HtmlResizeView,
68
+ model: HtmlResizeModel,
69
+ };
70
+ export default HtmlResize;
@@ -1,8 +1,9 @@
1
1
  import RectResize from './Node/RectResize';
2
2
  import EllipseResize from './Node/EllipseResize';
3
3
  import DiamondResize from './Node/DiamondResize';
4
+ import HtmlResize from './Node/HtmlResize';
4
5
  var NodeResize = {
5
- pluginName: 'node-resize',
6
+ pluginName: 'nodeResize',
6
7
  // 拖动step
7
8
  step: 0,
8
9
  // 边框和contol拖动点样式的设置
@@ -56,6 +57,11 @@ var NodeResize = {
56
57
  view: DiamondResize.view,
57
58
  model: DiamondResize.model,
58
59
  });
60
+ lf.register({
61
+ type: HtmlResize.type,
62
+ view: HtmlResize.view,
63
+ model: HtmlResize.model,
64
+ });
59
65
  },
60
66
  };
61
67
  export default NodeResize;
package/es/bpmn/index.js CHANGED
@@ -22,7 +22,7 @@ var BpmnElement = /** @class */ (function () {
22
22
  lf.setDefaultEdgeType('bpmn:sequenceFlow');
23
23
  }
24
24
  }
25
- BpmnElement.pluginName = 'BpmnElement';
25
+ BpmnElement.pluginName = 'bpmnElement';
26
26
  return BpmnElement;
27
27
  }());
28
28
  export { BpmnElement, StartEventModel, StartEventView, EndEventView, EndEventModel, ExclusiveGatewayView, ExclusiveGatewayModel, UserTaskView, UserTaskModel, ServiceTaskView, ServiceTaskModel, SequenceFlowView, SequenceFlowModel, };
@@ -15,8 +15,8 @@ var __read = (this && this.__read) || function (o, n) {
15
15
  return ar;
16
16
  };
17
17
  import { getBpmnId } from './bpmnIds';
18
- import json2xml from './json2xml';
19
- import XML from './xml2json';
18
+ import { lfJson2Xml } from './json2xml';
19
+ import { lfXml2Json } from './xml2json';
20
20
  import { ExclusiveGatewayConfig, StartEventConfig, EndEventConfig, ServiceTaskConfig, UserTaskConfig, } from '../bpmn/constant';
21
21
  var BpmnElements;
22
22
  (function (BpmnElements) {
@@ -467,19 +467,18 @@ BpmnAdapter.shapeConfigMap.set(BpmnElements.USER, {
467
467
  height: UserTaskConfig.height,
468
468
  });
469
469
  var BpmnXmlAdapter = {
470
- pluginName: 'bpmn-xml-adapter',
470
+ pluginName: 'bpmnXmlAdapter',
471
471
  install: function (lf) {
472
472
  lf.adapterIn = this.adapterXmlIn;
473
473
  lf.adapterOut = this.adapterXmlOut;
474
474
  },
475
475
  adapterXmlIn: function (bpmnData) {
476
- // @ts-ignore
477
- var json = new XML.ObjTree().parseXML(bpmnData);
476
+ var json = lfXml2Json(bpmnData);
478
477
  return BpmnAdapter.adapterIn(json);
479
478
  },
480
479
  adapterXmlOut: function (data) {
481
480
  var outData = BpmnAdapter.adapterOut(data);
482
- return json2xml(outData);
481
+ return lfJson2Xml(outData);
483
482
  },
484
483
  };
485
484
  export { BpmnAdapter, BpmnXmlAdapter, };
@@ -1 +1,2 @@
1
- export default function json2xml(o: any): string;
1
+ declare function lfJson2Xml(o: any): string;
2
+ export { lfJson2Xml };
@@ -49,10 +49,11 @@ function toXml(v, name, ind, deep) {
49
49
  return xml;
50
50
  }
51
51
  ;
52
- export default function json2xml(o) {
52
+ function lfJson2Xml(o) {
53
53
  var xmlStr = "";
54
54
  for (var m in o) {
55
55
  xmlStr += toXml(o[m], m, "\t\n", 0);
56
56
  }
57
57
  return xmlStr;
58
58
  }
59
+ export { lfJson2Xml };
@@ -1,2 +1,2 @@
1
- declare let XML: () => void;
2
- export default XML;
1
+ declare const lfXml2Json: (xmlData: any) => any;
2
+ export { lfXml2Json, };
@@ -520,4 +520,7 @@ which I will do instead of keeping this documentation like it is.
520
520
  =cut
521
521
  // ========================================================================
522
522
  */
523
- export default XML;
523
+ var lfXml2Json = function (xmlData) {
524
+ return new XML.ObjTree().parseXML(xmlData);
525
+ };
526
+ export { lfXml2Json, };
@@ -10,6 +10,16 @@ declare class ContextMenu {
10
10
  lf: any;
11
11
  });
12
12
  render(lf: any, container: any): void;
13
+ /**
14
+ * 隐藏菜单
15
+ */
16
+ hideContextMenu(): void;
17
+ /**
18
+ * 显示指定元素菜单
19
+ * @param data 节点id、节点类型、菜单位置
20
+ */
21
+ showContextMenu(data: any): void;
22
+ setContextMenuItems(menus: any): void;
13
23
  /**
14
24
  * 获取新菜单位置
15
25
  */
@@ -18,7 +28,6 @@ declare class ContextMenu {
18
28
  private addNode;
19
29
  private showMenu;
20
30
  listenDelete: () => void;
21
- private hideMenu;
22
31
  }
23
32
  export default ContextMenu;
24
33
  export { ContextMenu, };
@@ -23,29 +23,23 @@ var ContextMenu = /** @class */ (function () {
23
23
  var lf = _a.lf;
24
24
  this.menuTypeMap = new Map();
25
25
  this.listenDelete = function () {
26
- _this.hideMenu();
26
+ _this.hideContextMenu();
27
27
  };
28
28
  this.lf = lf;
29
29
  this.__menuDOM = document.createElement('div');
30
30
  this.__menuDOM.className = 'lf-inner-context';
31
- // const commonMenu = [];
32
31
  this.menuTypeMap.set(COMMON_TYPE_KEY, []);
33
32
  this.lf.setContextMenuByType = function (type, menus) {
34
33
  _this.menuTypeMap.set(type, menus);
35
34
  };
36
35
  this.lf.setContextMenuItems = function (menus) {
37
- _this.menuTypeMap.set(COMMON_TYPE_KEY, menus);
36
+ _this.setContextMenuItems(menus);
38
37
  };
39
38
  this.lf.showContextMenu = function (data) {
40
- if (!data || !data.id) {
41
- console.warn('请检查传入的参数');
42
- return;
43
- }
44
- _this._activeData = data;
45
- _this.createContextMenu();
39
+ _this.showContextMenu(data);
46
40
  };
47
41
  this.lf.hideContextMenu = function () {
48
- _this.hideMenu();
42
+ _this.hideContextMenu();
49
43
  };
50
44
  }
51
45
  ContextMenu.prototype.render = function (lf, container) {
@@ -63,9 +57,36 @@ var ContextMenu = /** @class */ (function () {
63
57
  _this.createContextMenu();
64
58
  });
65
59
  lf.on('blank:click', function () {
66
- _this.hideMenu();
60
+ _this.hideContextMenu();
67
61
  });
68
62
  };
63
+ /**
64
+ * 隐藏菜单
65
+ */
66
+ ContextMenu.prototype.hideContextMenu = function () {
67
+ this.__menuDOM.innerHTML = '';
68
+ this.__menuDOM.style.display = 'none';
69
+ if (this.isShow) {
70
+ this.container.removeChild(this.__menuDOM);
71
+ }
72
+ this.lf.off('node:delete,edge:delete,node:drag,graph:transform', this.listenDelete);
73
+ this.isShow = false;
74
+ };
75
+ /**
76
+ * 显示指定元素菜单
77
+ * @param data 节点id、节点类型、菜单位置
78
+ */
79
+ ContextMenu.prototype.showContextMenu = function (data) {
80
+ if (!data || !data.id) {
81
+ console.warn('请检查传入的参数');
82
+ return;
83
+ }
84
+ this._activeData = data;
85
+ this.createContextMenu();
86
+ };
87
+ ContextMenu.prototype.setContextMenuItems = function (menus) {
88
+ this.menuTypeMap.set(COMMON_TYPE_KEY, menus);
89
+ };
69
90
  /**
70
91
  * 获取新菜单位置
71
92
  */
@@ -119,7 +140,7 @@ var ContextMenu = /** @class */ (function () {
119
140
  menuItem.className = menuItem.className + " " + item.className;
120
141
  }
121
142
  img.addEventListener('click', function () {
122
- _this.hideMenu();
143
+ _this.hideContextMenu();
123
144
  if (item.callback) {
124
145
  item.callback(_this._activeData);
125
146
  }
@@ -191,16 +212,7 @@ var ContextMenu = /** @class */ (function () {
191
212
  !this.isShow && this.lf.on('node:delete,edge:delete,node:drag,graph:transform', this.listenDelete);
192
213
  this.isShow = true;
193
214
  };
194
- ContextMenu.prototype.hideMenu = function () {
195
- this.__menuDOM.innerHTML = '';
196
- this.__menuDOM.style.display = 'none';
197
- if (this.isShow) {
198
- this.container.removeChild(this.__menuDOM);
199
- }
200
- this.lf.off('node:delete,edge:delete,node:drag,graph:transform', this.listenDelete);
201
- this.isShow = false;
202
- };
203
- ContextMenu.pluginName = 'ContextMenu';
215
+ ContextMenu.pluginName = 'contextMenu';
204
216
  return ContextMenu;
205
217
  }());
206
218
  export default ContextMenu;
@@ -1,4 +1,3 @@
1
- import LogicFlow from '@logicflow/core';
2
1
  declare type ControlItem = {
3
2
  key: string;
4
3
  iconClass: string;
@@ -9,11 +8,11 @@ declare type ControlItem = {
9
8
  onMouseLeave?: Function;
10
9
  };
11
10
  declare class Control {
12
- lf: LogicFlow;
11
+ private lf;
13
12
  static pluginName: string;
14
- controlItems: ControlItem[];
15
- domContainer: HTMLElement;
16
- toolEl: HTMLElement;
13
+ private controlItems;
14
+ private domContainer;
15
+ private toolEl;
17
16
  constructor({ lf }: {
18
17
  lf: any;
19
18
  });
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __read = (this && this.__read) || function (o, n) {
13
2
  var m = typeof Symbol === "function" && o[Symbol.iterator];
14
3
  if (!m) return o;
@@ -31,10 +20,8 @@ var __spread = (this && this.__spread) || function () {
31
20
  };
32
21
  var Control = /** @class */ (function () {
33
22
  function Control(_a) {
34
- var _b;
35
23
  var _this = this;
36
24
  var lf = _a.lf;
37
- var _c;
38
25
  this.controlItems = [
39
26
  {
40
27
  key: 'zoom-out',
@@ -83,7 +70,6 @@ var Control = /** @class */ (function () {
83
70
  },
84
71
  ];
85
72
  this.lf = lf;
86
- this.lf.extension = __assign(__assign({}, ((_c = this.lf.extension) !== null && _c !== void 0 ? _c : {})), (_b = {}, _b[Control.pluginName] = this, _b));
87
73
  }
88
74
  Control.prototype.render = function (lf, domContainer) {
89
75
  this.destroy();
@@ -19,6 +19,7 @@ declare class DndPanel {
19
19
  });
20
20
  render(lf: any, domContainer: any): void;
21
21
  destroy(): void;
22
+ setPatternItems(shapeList: any): void;
22
23
  private createDndItem;
23
24
  }
24
25
  export { DndPanel, };
@@ -4,11 +4,7 @@ var DndPanel = /** @class */ (function () {
4
4
  var lf = _a.lf;
5
5
  this.lf = lf;
6
6
  this.lf.setPatternItems = function (shapeList) {
7
- _this.shapeList = shapeList;
8
- // 支持渲染后重新设置拖拽面板
9
- if (_this.domContainer) {
10
- _this.render(_this.lf, _this.domContainer);
11
- }
7
+ _this.setPatternItems(shapeList);
12
8
  };
13
9
  }
14
10
  DndPanel.prototype.render = function (lf, domContainer) {
@@ -32,6 +28,13 @@ var DndPanel = /** @class */ (function () {
32
28
  this.domContainer.removeChild(this.panelEl);
33
29
  }
34
30
  };
31
+ DndPanel.prototype.setPatternItems = function (shapeList) {
32
+ this.shapeList = shapeList;
33
+ // 支持渲染后重新设置拖拽面板
34
+ if (this.domContainer) {
35
+ this.render(this.lf, this.domContainer);
36
+ }
37
+ };
35
38
  DndPanel.prototype.createDndItem = function (shapeItem) {
36
39
  var _this = this;
37
40
  var el = document.createElement('div');
@@ -62,7 +65,7 @@ var DndPanel = /** @class */ (function () {
62
65
  };
63
66
  return el;
64
67
  };
65
- DndPanel.pluginName = 'DndPanel';
68
+ DndPanel.pluginName = 'dndPanel';
66
69
  return DndPanel;
67
70
  }());
68
71
  export { DndPanel, };
@@ -38,8 +38,8 @@ declare class Menu {
38
38
  * @return 菜单项 DOM
39
39
  */
40
40
  private __getMenuDom;
41
- private resetMenuItem;
42
- private addMenuItem;
41
+ setMenuConfig(config: MenuConfig): void;
42
+ addMenuConfig(config: MenuConfig): void;
43
43
  /**
44
44
  * @deprecated
45
45
  * 复写添加
@@ -30,13 +30,13 @@ var Menu = /** @class */ (function () {
30
30
  this.lf = lf;
31
31
  this.menuTypeMap = new Map();
32
32
  this.init();
33
- this.lf.setMenuConfig = function (config) {
34
- _this.resetMenuItem(config);
33
+ this.lf.extension.menu.setMenuConfig = function (config) {
34
+ _this.setMenuConfig(config);
35
35
  };
36
- this.lf.addMenuConfig = function (config) {
37
- _this.addMenuItem(config);
36
+ this.lf.extension.menu.addMenuConfig = function (config) {
37
+ _this.addMenuConfig(config);
38
38
  };
39
- this.lf.setMenuByType = function (config) {
39
+ this.lf.extension.menu.setMenuByType = function (config) {
40
40
  _this.setMenuByType(config);
41
41
  };
42
42
  }
@@ -247,7 +247,7 @@ var Menu = /** @class */ (function () {
247
247
  return menuList;
248
248
  };
249
249
  // 复写菜单
250
- Menu.prototype.resetMenuItem = function (config) {
250
+ Menu.prototype.setMenuConfig = function (config) {
251
251
  if (!config) {
252
252
  return;
253
253
  }
@@ -262,7 +262,7 @@ var Menu = /** @class */ (function () {
262
262
  && this.menuTypeMap.set(DefalutGraphMenuKey, config.graphMenu ? config.graphMenu : []);
263
263
  };
264
264
  // 在默认菜单后面追加菜单项
265
- Menu.prototype.addMenuItem = function (config) {
265
+ Menu.prototype.addMenuConfig = function (config) {
266
266
  if (!config) {
267
267
  return;
268
268
  }
@@ -286,14 +286,14 @@ var Menu = /** @class */ (function () {
286
286
  */
287
287
  Menu.prototype.changeMenuItem = function (type, config) {
288
288
  if (type === 'add')
289
- this.addMenuItem(config);
289
+ this.addMenuConfig(config);
290
290
  else if (type === 'reset')
291
- this.resetMenuItem(config);
291
+ this.setMenuConfig(config);
292
292
  else {
293
293
  throw new Error('The first parameter of changeMenuConfig should be \'add\' or \'reset\'');
294
294
  }
295
295
  };
296
- Menu.pluginName = 'Menu';
296
+ Menu.pluginName = 'menu';
297
297
  return Menu;
298
298
  }());
299
299
  export default Menu;
@@ -1,4 +1,75 @@
1
- import { Extension } from '@logicflow/core';
2
- declare const MiniMap: Extension;
1
+ declare class MiniMap {
2
+ static pluginName: string;
3
+ __lf: any;
4
+ __container: any;
5
+ __miniMapWrap: any;
6
+ __miniMapContainer: any;
7
+ __lfMap: any;
8
+ __viewport: any;
9
+ __width: number;
10
+ __height: number;
11
+ __miniMapWidth: number;
12
+ __miniMapHeight: number;
13
+ __viewPortTop: number;
14
+ __viewPortLeft: number;
15
+ __startPosition: any;
16
+ __viewPortScale: number;
17
+ __viewPortWidth: number;
18
+ __viewPortHeight: number;
19
+ __resetDataX: number;
20
+ __resetDataY: number;
21
+ __LogicFlow: any;
22
+ __isShow: boolean;
23
+ __disabledPlugins: string[];
24
+ constructor({ lf, LogicFlow }: {
25
+ lf: any;
26
+ LogicFlow: any;
27
+ });
28
+ render(lf: any, container: any): void;
29
+ init(option: any): void;
30
+ /**
31
+ * 显示mini map
32
+ */
33
+ show: (leftPosition: any, topPosition: any) => void;
34
+ /**
35
+ * 隐藏mini map
36
+ */
37
+ hide: () => void;
38
+ __init(): void;
39
+ __createMiniMap(left: any, top: any): void;
40
+ __removeMiniMap(): void;
41
+ /**
42
+ * 计算所有图形一起,占领的区域范围。
43
+ * @param data
44
+ */
45
+ __getBounds(data: any): {
46
+ left: number;
47
+ top: number;
48
+ bottom: number;
49
+ right: number;
50
+ };
51
+ /**
52
+ * 将负值的平移转换为正值。
53
+ * 保证渲染的时候,minimap能完全展示。
54
+ * 获取将画布所有元素平移到0,0开始时,所有节点数据
55
+ */
56
+ __resetData(data: any): any;
57
+ /**
58
+ * 显示导航
59
+ * 显示视口范围
60
+ * 1. 基于画布的范围比例,设置视口范围比例。宽度默认为导航宽度。
61
+ */
62
+ __setView(): void;
63
+ __setViewPort(scale: any, { left, right, top, bottom }: {
64
+ left: any;
65
+ right: any;
66
+ top: any;
67
+ bottom: any;
68
+ }): void;
69
+ __createViewPort(): void;
70
+ __startDrag: (e: any) => void;
71
+ __drag: (e: any) => void;
72
+ __drop: () => void;
73
+ }
3
74
  export default MiniMap;
4
75
  export { MiniMap };