@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
@@ -270,7 +270,8 @@ var Control = /** @class */ (function (_super) {
270
270
  _this.onDraging = function (_a) {
271
271
  var deltaX = _a.deltaX, deltaY = _a.deltaY;
272
272
  var modelType = _this.nodeModel.modelType;
273
- if (modelType === Util_1.ModelType.RECT_NODE) {
273
+ // html和矩形的计算方式是一样的,共用一个方法
274
+ if (modelType === Util_1.ModelType.RECT_NODE || modelType === Util_1.ModelType.HTML_NODE) {
274
275
  _this.updateRect({ deltaX: deltaX, deltaY: deltaY });
275
276
  }
276
277
  else if (modelType === Util_1.ModelType.ELLIPSE_NODE) {
@@ -7,6 +7,7 @@ var ModelType;
7
7
  ModelType["CIRCLE_NODE"] = "circle-node";
8
8
  ModelType["POLYGON_NODE"] = "polygon-node";
9
9
  ModelType["RECT_NODE"] = "rect-node";
10
+ ModelType["HTML_NODE"] = "html-node";
10
11
  ModelType["TEXT_NODE"] = "text-node";
11
12
  ModelType["ELLIPSE_NODE"] = "ellipse-node";
12
13
  ModelType["DIAMOND_NODE"] = "diamond-node";
@@ -12,21 +12,9 @@ var __extends = (this && this.__extends) || (function () {
12
12
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
13
  };
14
14
  })();
15
- var __assign = (this && this.__assign) || function () {
16
- __assign = Object.assign || function(t) {
17
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18
- s = arguments[i];
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
- t[p] = s[p];
21
- }
22
- return t;
23
- };
24
- return __assign.apply(this, arguments);
25
- };
26
15
  Object.defineProperty(exports, "__esModule", { value: true });
27
16
  var core_1 = require("@logicflow/core");
28
17
  var ControlGroup_1 = require("../Control/ControlGroup");
29
- var Ellipse_1 = require("../BasicShape/Ellipse");
30
18
  var EllipseResizeModel = /** @class */ (function (_super) {
31
19
  __extends(EllipseResizeModel, _super);
32
20
  function EllipseResizeModel(data, graphModel) {
@@ -68,11 +56,7 @@ var EllipseResizeView = /** @class */ (function (_super) {
68
56
  };
69
57
  // getResizeShape绘制图形,功能等同于基础椭圆的getShape功能,可以通过复写此方法,进行节点自定义
70
58
  EllipseResizeView.prototype.getResizeShape = function () {
71
- var model = this.props.model;
72
- var rx = model.rx, ry = model.ry, x = model.x, y = model.y;
73
- var style = model.getNodeStyle();
74
- return (core_1.h("g", null,
75
- core_1.h(Ellipse_1.default, __assign({}, style, { rx: rx, ry: ry, x: x, y: y }))));
59
+ return _super.prototype.getShape.call(this);
76
60
  };
77
61
  EllipseResizeView.prototype.getShape = function () {
78
62
  var model = this.props.model;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var core_1 = require("@logicflow/core");
17
+ var ControlGroup_1 = require("../Control/ControlGroup");
18
+ var HtmlResizeModel = /** @class */ (function (_super) {
19
+ __extends(HtmlResizeModel, _super);
20
+ function HtmlResizeModel() {
21
+ var _this = _super !== null && _super.apply(this, arguments) || this;
22
+ _this.minWidth = 30;
23
+ _this.minHeight = 30;
24
+ _this.maxWidth = 2000;
25
+ _this.maxHeight = 2000;
26
+ return _this;
27
+ }
28
+ HtmlResizeModel.prototype.getOutlineStyle = function () {
29
+ var style = _super.prototype.getOutlineStyle.call(this);
30
+ style.stroke = 'none';
31
+ if (style.hover) {
32
+ style.hover.stroke = 'none';
33
+ }
34
+ return style;
35
+ };
36
+ HtmlResizeModel.prototype.setAttributes = function () {
37
+ // @ts-ignore
38
+ var nodeSize = this.properties.nodeSize;
39
+ if (nodeSize) {
40
+ this.width = nodeSize.width;
41
+ this.height = nodeSize.height;
42
+ }
43
+ };
44
+ return HtmlResizeModel;
45
+ }(core_1.HtmlNodeModel));
46
+ var HtmlResizeView = /** @class */ (function (_super) {
47
+ __extends(HtmlResizeView, _super);
48
+ function HtmlResizeView() {
49
+ return _super !== null && _super.apply(this, arguments) || this;
50
+ }
51
+ HtmlResizeView.prototype.getControlGroup = function () {
52
+ var _a = this.props, model = _a.model, graphModel = _a.graphModel;
53
+ return (core_1.h(ControlGroup_1.default, { model: model, graphModel: graphModel }));
54
+ };
55
+ // getResizeShape绘制图形,功能等同于基础矩形的getShape功能,可以通过复写此方法,进行节点自定义
56
+ HtmlResizeView.prototype.getResizeShape = function () {
57
+ return _super.prototype.getShape.call(this);
58
+ };
59
+ HtmlResizeView.prototype.getShape = function () {
60
+ var isSelected = this.props.model.isSelected;
61
+ return (core_1.h("g", null,
62
+ this.getResizeShape(),
63
+ isSelected ? this.getControlGroup() : ''));
64
+ };
65
+ return HtmlResizeView;
66
+ }(core_1.HtmlNode));
67
+ var HtmlResize = {
68
+ type: 'html',
69
+ view: HtmlResizeView,
70
+ model: HtmlResizeModel,
71
+ };
72
+ exports.default = HtmlResize;
@@ -7,8 +7,9 @@ var EllipseResize_1 = require("./Node/EllipseResize");
7
7
  exports.EllipseResize = EllipseResize_1.default;
8
8
  var DiamondResize_1 = require("./Node/DiamondResize");
9
9
  exports.DiamondResize = DiamondResize_1.default;
10
+ var HtmlResize_1 = require("./Node/HtmlResize");
10
11
  var NodeResize = {
11
- pluginName: 'node-resize',
12
+ pluginName: 'nodeResize',
12
13
  // 拖动step
13
14
  step: 0,
14
15
  // 边框和contol拖动点样式的设置
@@ -62,6 +63,11 @@ var NodeResize = {
62
63
  view: DiamondResize_1.default.view,
63
64
  model: DiamondResize_1.default.model,
64
65
  });
66
+ lf.register({
67
+ type: HtmlResize_1.default.type,
68
+ view: HtmlResize_1.default.view,
69
+ model: HtmlResize_1.default.model,
70
+ });
65
71
  },
66
72
  };
67
73
  exports.NodeResize = NodeResize;
package/cjs/bpmn/index.js CHANGED
@@ -37,7 +37,7 @@ var BpmnElement = /** @class */ (function () {
37
37
  lf.setDefaultEdgeType('bpmn:sequenceFlow');
38
38
  }
39
39
  }
40
- BpmnElement.pluginName = 'BpmnElement';
40
+ BpmnElement.pluginName = 'bpmnElement';
41
41
  return BpmnElement;
42
42
  }());
43
43
  exports.BpmnElement = BpmnElement;
@@ -471,19 +471,18 @@ BpmnAdapter.shapeConfigMap.set(BpmnElements.USER, {
471
471
  height: constant_1.UserTaskConfig.height,
472
472
  });
473
473
  var BpmnXmlAdapter = {
474
- pluginName: 'bpmn-xml-adapter',
474
+ pluginName: 'bpmnXmlAdapter',
475
475
  install: function (lf) {
476
476
  lf.adapterIn = this.adapterXmlIn;
477
477
  lf.adapterOut = this.adapterXmlOut;
478
478
  },
479
479
  adapterXmlIn: function (bpmnData) {
480
- // @ts-ignore
481
- var json = new xml2json_1.default.ObjTree().parseXML(bpmnData);
480
+ var json = xml2json_1.lfXml2Json(bpmnData);
482
481
  return BpmnAdapter.adapterIn(json);
483
482
  },
484
483
  adapterXmlOut: function (data) {
485
484
  var outData = BpmnAdapter.adapterOut(data);
486
- return json2xml_1.default(outData);
485
+ return json2xml_1.lfJson2Xml(outData);
487
486
  },
488
487
  };
489
488
  exports.BpmnXmlAdapter = BpmnXmlAdapter;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lfJson2Xml = void 0;
3
4
  /**
4
5
  * This work is licensed under Creative Commons GNU LGPL License.
5
6
  * License:
@@ -51,11 +52,11 @@ function toXml(v, name, ind, deep) {
51
52
  return xml;
52
53
  }
53
54
  ;
54
- function json2xml(o) {
55
+ function lfJson2Xml(o) {
55
56
  var xmlStr = "";
56
57
  for (var m in o) {
57
58
  xmlStr += toXml(o[m], m, "\t\n", 0);
58
59
  }
59
60
  return xmlStr;
60
61
  }
61
- exports.default = json2xml;
62
+ exports.lfJson2Xml = lfJson2Xml;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  // @ts-nocheck
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.lfXml2Json = void 0;
4
5
  // ========================================================================
5
6
  // XML.ObjTree -- XML source code from/to JavaScript object like E4X
6
7
  // ========================================================================
@@ -522,4 +523,7 @@ which I will do instead of keeping this documentation like it is.
522
523
  =cut
523
524
  // ========================================================================
524
525
  */
525
- exports.default = XML;
526
+ var lfXml2Json = function (xmlData) {
527
+ return new XML.ObjTree().parseXML(xmlData);
528
+ };
529
+ exports.lfXml2Json = lfXml2Json;
@@ -26,29 +26,23 @@ var ContextMenu = /** @class */ (function () {
26
26
  var lf = _a.lf;
27
27
  this.menuTypeMap = new Map();
28
28
  this.listenDelete = function () {
29
- _this.hideMenu();
29
+ _this.hideContextMenu();
30
30
  };
31
31
  this.lf = lf;
32
32
  this.__menuDOM = document.createElement('div');
33
33
  this.__menuDOM.className = 'lf-inner-context';
34
- // const commonMenu = [];
35
34
  this.menuTypeMap.set(COMMON_TYPE_KEY, []);
36
35
  this.lf.setContextMenuByType = function (type, menus) {
37
36
  _this.menuTypeMap.set(type, menus);
38
37
  };
39
38
  this.lf.setContextMenuItems = function (menus) {
40
- _this.menuTypeMap.set(COMMON_TYPE_KEY, menus);
39
+ _this.setContextMenuItems(menus);
41
40
  };
42
41
  this.lf.showContextMenu = function (data) {
43
- if (!data || !data.id) {
44
- console.warn('请检查传入的参数');
45
- return;
46
- }
47
- _this._activeData = data;
48
- _this.createContextMenu();
42
+ _this.showContextMenu(data);
49
43
  };
50
44
  this.lf.hideContextMenu = function () {
51
- _this.hideMenu();
45
+ _this.hideContextMenu();
52
46
  };
53
47
  }
54
48
  ContextMenu.prototype.render = function (lf, container) {
@@ -66,9 +60,36 @@ var ContextMenu = /** @class */ (function () {
66
60
  _this.createContextMenu();
67
61
  });
68
62
  lf.on('blank:click', function () {
69
- _this.hideMenu();
63
+ _this.hideContextMenu();
70
64
  });
71
65
  };
66
+ /**
67
+ * 隐藏菜单
68
+ */
69
+ ContextMenu.prototype.hideContextMenu = function () {
70
+ this.__menuDOM.innerHTML = '';
71
+ this.__menuDOM.style.display = 'none';
72
+ if (this.isShow) {
73
+ this.container.removeChild(this.__menuDOM);
74
+ }
75
+ this.lf.off('node:delete,edge:delete,node:drag,graph:transform', this.listenDelete);
76
+ this.isShow = false;
77
+ };
78
+ /**
79
+ * 显示指定元素菜单
80
+ * @param data 节点id、节点类型、菜单位置
81
+ */
82
+ ContextMenu.prototype.showContextMenu = function (data) {
83
+ if (!data || !data.id) {
84
+ console.warn('请检查传入的参数');
85
+ return;
86
+ }
87
+ this._activeData = data;
88
+ this.createContextMenu();
89
+ };
90
+ ContextMenu.prototype.setContextMenuItems = function (menus) {
91
+ this.menuTypeMap.set(COMMON_TYPE_KEY, menus);
92
+ };
72
93
  /**
73
94
  * 获取新菜单位置
74
95
  */
@@ -122,7 +143,7 @@ var ContextMenu = /** @class */ (function () {
122
143
  menuItem.className = menuItem.className + " " + item.className;
123
144
  }
124
145
  img.addEventListener('click', function () {
125
- _this.hideMenu();
146
+ _this.hideContextMenu();
126
147
  if (item.callback) {
127
148
  item.callback(_this._activeData);
128
149
  }
@@ -194,16 +215,7 @@ var ContextMenu = /** @class */ (function () {
194
215
  !this.isShow && this.lf.on('node:delete,edge:delete,node:drag,graph:transform', this.listenDelete);
195
216
  this.isShow = true;
196
217
  };
197
- ContextMenu.prototype.hideMenu = function () {
198
- this.__menuDOM.innerHTML = '';
199
- this.__menuDOM.style.display = 'none';
200
- if (this.isShow) {
201
- this.container.removeChild(this.__menuDOM);
202
- }
203
- this.lf.off('node:delete,edge:delete,node:drag,graph:transform', this.listenDelete);
204
- this.isShow = false;
205
- };
206
- ContextMenu.pluginName = 'ContextMenu';
218
+ ContextMenu.pluginName = 'contextMenu';
207
219
  return ContextMenu;
208
220
  }());
209
221
  exports.ContextMenu = ContextMenu;
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __read = (this && this.__read) || function (o, n) {
14
3
  var m = typeof Symbol === "function" && o[Symbol.iterator];
15
4
  if (!m) return o;
@@ -34,10 +23,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
34
23
  exports.Control = void 0;
35
24
  var Control = /** @class */ (function () {
36
25
  function Control(_a) {
37
- var _b;
38
26
  var _this = this;
39
27
  var lf = _a.lf;
40
- var _c;
41
28
  this.controlItems = [
42
29
  {
43
30
  key: 'zoom-out',
@@ -86,7 +73,6 @@ var Control = /** @class */ (function () {
86
73
  },
87
74
  ];
88
75
  this.lf = lf;
89
- this.lf.extension = __assign(__assign({}, ((_c = this.lf.extension) !== null && _c !== void 0 ? _c : {})), (_b = {}, _b[Control.pluginName] = this, _b));
90
76
  }
91
77
  Control.prototype.render = function (lf, domContainer) {
92
78
  this.destroy();
@@ -7,11 +7,7 @@ var DndPanel = /** @class */ (function () {
7
7
  var lf = _a.lf;
8
8
  this.lf = lf;
9
9
  this.lf.setPatternItems = function (shapeList) {
10
- _this.shapeList = shapeList;
11
- // 支持渲染后重新设置拖拽面板
12
- if (_this.domContainer) {
13
- _this.render(_this.lf, _this.domContainer);
14
- }
10
+ _this.setPatternItems(shapeList);
15
11
  };
16
12
  }
17
13
  DndPanel.prototype.render = function (lf, domContainer) {
@@ -35,6 +31,13 @@ var DndPanel = /** @class */ (function () {
35
31
  this.domContainer.removeChild(this.panelEl);
36
32
  }
37
33
  };
34
+ DndPanel.prototype.setPatternItems = function (shapeList) {
35
+ this.shapeList = shapeList;
36
+ // 支持渲染后重新设置拖拽面板
37
+ if (this.domContainer) {
38
+ this.render(this.lf, this.domContainer);
39
+ }
40
+ };
38
41
  DndPanel.prototype.createDndItem = function (shapeItem) {
39
42
  var _this = this;
40
43
  var el = document.createElement('div');
@@ -65,7 +68,7 @@ var DndPanel = /** @class */ (function () {
65
68
  };
66
69
  return el;
67
70
  };
68
- DndPanel.pluginName = 'DndPanel';
71
+ DndPanel.pluginName = 'dndPanel';
69
72
  return DndPanel;
70
73
  }());
71
74
  exports.DndPanel = DndPanel;
@@ -33,13 +33,13 @@ var Menu = /** @class */ (function () {
33
33
  this.lf = lf;
34
34
  this.menuTypeMap = new Map();
35
35
  this.init();
36
- this.lf.setMenuConfig = function (config) {
37
- _this.resetMenuItem(config);
36
+ this.lf.extension.menu.setMenuConfig = function (config) {
37
+ _this.setMenuConfig(config);
38
38
  };
39
- this.lf.addMenuConfig = function (config) {
40
- _this.addMenuItem(config);
39
+ this.lf.extension.menu.addMenuConfig = function (config) {
40
+ _this.addMenuConfig(config);
41
41
  };
42
- this.lf.setMenuByType = function (config) {
42
+ this.lf.extension.menu.setMenuByType = function (config) {
43
43
  _this.setMenuByType(config);
44
44
  };
45
45
  }
@@ -250,7 +250,7 @@ var Menu = /** @class */ (function () {
250
250
  return menuList;
251
251
  };
252
252
  // 复写菜单
253
- Menu.prototype.resetMenuItem = function (config) {
253
+ Menu.prototype.setMenuConfig = function (config) {
254
254
  if (!config) {
255
255
  return;
256
256
  }
@@ -265,7 +265,7 @@ var Menu = /** @class */ (function () {
265
265
  && this.menuTypeMap.set(DefalutGraphMenuKey, config.graphMenu ? config.graphMenu : []);
266
266
  };
267
267
  // 在默认菜单后面追加菜单项
268
- Menu.prototype.addMenuItem = function (config) {
268
+ Menu.prototype.addMenuConfig = function (config) {
269
269
  if (!config) {
270
270
  return;
271
271
  }
@@ -289,14 +289,14 @@ var Menu = /** @class */ (function () {
289
289
  */
290
290
  Menu.prototype.changeMenuItem = function (type, config) {
291
291
  if (type === 'add')
292
- this.addMenuItem(config);
292
+ this.addMenuConfig(config);
293
293
  else if (type === 'reset')
294
- this.resetMenuItem(config);
294
+ this.setMenuConfig(config);
295
295
  else {
296
296
  throw new Error('The first parameter of changeMenuConfig should be \'add\' or \'reset\'');
297
297
  }
298
298
  };
299
- Menu.pluginName = 'Menu';
299
+ Menu.pluginName = 'menu';
300
300
  return Menu;
301
301
  }());
302
302
  exports.Menu = Menu;