@logicflow/extension 1.2.0-next.1 → 1.2.0-next.2

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 (104) hide show
  1. package/cjs/NodeResize/Control/Control.js +71 -16
  2. package/cjs/NodeResize/Node/DiamondResize.js +24 -10
  3. package/cjs/NodeResize/Node/EllipseResize.js +24 -10
  4. package/cjs/NodeResize/Node/HtmlResize.js +24 -10
  5. package/cjs/NodeResize/Node/RectResize.js +24 -10
  6. package/cjs/bpmn-adapter/index.js +74 -122
  7. package/cjs/bpmn-adapter/json2xml.js +2 -4
  8. package/cjs/bpmn-adapter/xml2json.js +247 -2
  9. package/cjs/components/control/index.js +16 -16
  10. package/cjs/components/dnd-panel/index.js +21 -0
  11. package/cjs/components/highlight/index.js +0 -1
  12. package/cjs/components/menu/index.js +9 -9
  13. package/cjs/components/mini-map/index.js +223 -138
  14. package/cjs/components/selection-select/index.js +6 -19
  15. package/cjs/index.js +0 -1
  16. package/cjs/materials/curved-edge/index.js +19 -5
  17. package/cjs/materials/curved-edge/searchMiddleIndex.js +17 -0
  18. package/cjs/materials/group/GroupNode.js +34 -64
  19. package/cjs/materials/group/index.js +80 -70
  20. package/cjs/style/index.css +10 -0
  21. package/cjs/tools/auto-layout/index.js +1 -1
  22. package/es/NodeResize/Control/Control.d.ts +4 -1
  23. package/es/NodeResize/Control/Control.js +71 -16
  24. package/es/NodeResize/Node/DiamondResize.d.ts +3 -1
  25. package/es/NodeResize/Node/DiamondResize.js +24 -10
  26. package/es/NodeResize/Node/EllipseResize.d.ts +3 -1
  27. package/es/NodeResize/Node/EllipseResize.js +24 -10
  28. package/es/NodeResize/Node/HtmlResize.d.ts +3 -1
  29. package/es/NodeResize/Node/HtmlResize.js +24 -10
  30. package/es/NodeResize/Node/RectResize.d.ts +3 -1
  31. package/es/NodeResize/Node/RectResize.js +24 -10
  32. package/es/bpmn-adapter/index.d.ts +33 -41
  33. package/es/bpmn-adapter/index.js +74 -122
  34. package/es/bpmn-adapter/json2xml.js +2 -4
  35. package/es/bpmn-adapter/xml2json.js +247 -2
  36. package/es/components/control/index.d.ts +3 -2
  37. package/es/components/control/index.js +16 -16
  38. package/es/components/dnd-panel/index.js +21 -0
  39. package/es/components/highlight/index.js +0 -1
  40. package/es/components/menu/index.d.ts +3 -2
  41. package/es/components/menu/index.js +9 -9
  42. package/es/components/mini-map/index.d.ts +57 -45
  43. package/es/components/mini-map/index.js +223 -138
  44. package/es/components/selection-select/index.d.ts +0 -1
  45. package/es/components/selection-select/index.js +6 -19
  46. package/es/index.d.ts +0 -1
  47. package/es/index.js +0 -1
  48. package/es/materials/curved-edge/index.js +19 -5
  49. package/es/materials/curved-edge/searchMiddleIndex.d.ts +1 -0
  50. package/es/materials/curved-edge/searchMiddleIndex.js +14 -0
  51. package/es/materials/group/GroupNode.d.ts +5 -7
  52. package/es/materials/group/GroupNode.js +34 -64
  53. package/es/materials/group/index.d.ts +19 -1
  54. package/es/materials/group/index.js +80 -70
  55. package/es/style/index.css +10 -0
  56. package/es/tools/auto-layout/index.d.ts +1 -1
  57. package/es/tools/auto-layout/index.js +1 -1
  58. package/lib/AutoLayout.js +1 -1
  59. package/lib/BpmnAdapter.js +1 -1
  60. package/lib/BpmnElement.js +1 -1
  61. package/lib/ContextMenu.js +1 -1
  62. package/lib/Control.js +1 -1
  63. package/lib/CurvedEdge.js +1 -1
  64. package/lib/DndPanel.js +1 -1
  65. package/lib/FlowPath.js +1 -1
  66. package/lib/Group.js +1 -1
  67. package/lib/Highlight.js +1 -1
  68. package/lib/InsertNodeInPolyline.js +1 -1
  69. package/lib/Menu.js +1 -1
  70. package/lib/MiniMap.js +1 -1
  71. package/lib/NodeResize.js +1 -1
  72. package/lib/RectLabelNode.js +1 -1
  73. package/lib/SelectionSelect.js +1 -1
  74. package/lib/Snapshot.js +1 -1
  75. package/lib/TurboAdapter.js +1 -1
  76. package/lib/lfJson2Xml.js +1 -1
  77. package/lib/lfXml2Json.js +1 -1
  78. package/lib/style/index.css +10 -0
  79. package/package.json +3 -2
  80. package/types/NodeResize/Control/Control.d.ts +4 -1
  81. package/types/NodeResize/Node/DiamondResize.d.ts +3 -1
  82. package/types/NodeResize/Node/EllipseResize.d.ts +3 -1
  83. package/types/NodeResize/Node/HtmlResize.d.ts +3 -1
  84. package/types/NodeResize/Node/RectResize.d.ts +3 -1
  85. package/types/bpmn-adapter/index.d.ts +33 -41
  86. package/types/components/control/index.d.ts +3 -2
  87. package/types/components/menu/index.d.ts +3 -2
  88. package/types/components/mini-map/index.d.ts +57 -45
  89. package/types/components/selection-select/index.d.ts +0 -1
  90. package/types/index.d.ts +0 -1
  91. package/types/materials/curved-edge/searchMiddleIndex.d.ts +1 -0
  92. package/types/materials/group/GroupNode.d.ts +5 -7
  93. package/types/materials/group/index.d.ts +19 -1
  94. package/types/tools/auto-layout/index.d.ts +1 -1
  95. package/cjs/locale/en-locale/en.js +0 -22
  96. package/cjs/locale/en-locale/index.js +0 -29
  97. package/cjs/locale/locale.js +0 -19
  98. package/es/locale/en-locale/en.d.ts +0 -19
  99. package/es/locale/en-locale/en.js +0 -19
  100. package/es/locale/en-locale/index.d.ts +0 -9
  101. package/es/locale/en-locale/index.js +0 -26
  102. package/es/locale/locale.d.ts +0 -6
  103. package/es/locale/locale.js +0 -16
  104. package/lib/EnLocale.js +0 -1
@@ -65,7 +65,7 @@ XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
65
65
  };
66
66
  }
67
67
  else {
68
- myOpt.asynchronous = false;
68
+ myOpt.asynchronous = false; // sync-mode
69
69
  }
70
70
  var trans;
71
71
  if (typeof (HTTP) != "undefined" && HTTP.Request) {
@@ -85,7 +85,6 @@ XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
85
85
  return this.parseDOM(trans.responseXML.documentElement);
86
86
  }
87
87
  };
88
- // method: parseDOM( document root )
89
88
  XML.ObjTree.prototype.parseDOM = function (root) {
90
89
  if (!root)
91
90
  return;
@@ -274,6 +273,252 @@ XML.ObjTree.prototype.scalar_to_xml = function (name, text) {
274
273
  XML.ObjTree.prototype.xml_escape = function (text) {
275
274
  return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
276
275
  };
276
+ /*
277
+ // ========================================================================
278
+
279
+ =head1 NAME
280
+
281
+ XML.ObjTree -- XML source code from/to JavaScript object like E4X
282
+
283
+ =head1 SYNOPSIS
284
+
285
+ var xotree = new XML.ObjTree();
286
+ var tree1 = {
287
+ root: {
288
+ node: "Hello, World!"
289
+ }
290
+ };
291
+ var xml1 = xotree.writeXML( tree1 ); // object tree to XML source
292
+ alert( "xml1: "+xml1 );
293
+
294
+ var xml2 = '<?xml version="1.0"?><response><error>0</error></response>';
295
+ var tree2 = xotree.parseXML( xml2 ); // XML source to object tree
296
+ alert( "error: "+tree2.response.error );
297
+
298
+ =head1 DESCRIPTION
299
+
300
+ XML.ObjTree class is a parser/generator between XML source code
301
+ and JavaScript object like E4X, ECMAScript for XML.
302
+ This is a JavaScript version of the XML::TreePP module for Perl.
303
+ This also works as a wrapper for XMLHTTPRequest and successor to JKL.ParseXML class
304
+ when this is used with prototype.js or JSAN's HTTP.Request class.
305
+
306
+ =head2 JavaScript object tree format
307
+
308
+ A sample XML source:
309
+
310
+ <?xml version="1.0" encoding="UTF-8"?>
311
+ <family name="Kawasaki">
312
+ <father>Yasuhisa</father>
313
+ <mother>Chizuko</mother>
314
+ <children>
315
+ <girl>Shiori</girl>
316
+ <boy>Yusuke</boy>
317
+ <boy>Kairi</boy>
318
+ </children>
319
+ </family>
320
+
321
+ Its JavaScript object tree like JSON/E4X:
322
+
323
+ {
324
+ 'family': {
325
+ '-name': 'Kawasaki',
326
+ 'father': 'Yasuhisa',
327
+ 'mother': 'Chizuko',
328
+ 'children': {
329
+ 'girl': 'Shiori'
330
+ 'boy': [
331
+ 'Yusuke',
332
+ 'Kairi'
333
+ ]
334
+ }
335
+ }
336
+ };
337
+
338
+ Each elements are parsed into objects:
339
+
340
+ tree.family.father; # the father's given name.
341
+
342
+ Prefix '-' is inserted before every attributes' name.
343
+
344
+ tree.family["-name"]; # this family's family name
345
+
346
+ A array is used because this family has two boys.
347
+
348
+ tree.family.children.boy[0]; # first boy's name
349
+ tree.family.children.boy[1]; # second boy's name
350
+ tree.family.children.girl; # (girl has no other sisters)
351
+
352
+ =head1 METHODS
353
+
354
+ =head2 xotree = new XML.ObjTree()
355
+
356
+ This constructor method returns a new XML.ObjTree object.
357
+
358
+ =head2 xotree.force_array = [ "rdf:li", "item", "-xmlns" ];
359
+
360
+ This property allows you to specify a list of element names
361
+ which should always be forced into an array representation.
362
+ The default value is null, it means that context of the elements
363
+ will determine to make array or to keep it scalar.
364
+
365
+ =head2 xotree.attr_prefix = '@';
366
+
367
+ This property allows you to specify a prefix character which is
368
+ inserted before each attribute names.
369
+ Instead of default prefix '-', E4X-style prefix '@' is also available.
370
+ The default character is '-'.
371
+ Or set '@' to access attribute values like E4X, ECMAScript for XML.
372
+ The length of attr_prefix must be just one character and not be empty.
373
+
374
+ =head2 tree = xotree.parseXML( xmlSrc );
375
+
376
+ This method loads an XML document using the supplied string
377
+ and returns its JavaScript object converted.
378
+
379
+ =head2 tree = xotree.parseDOM( domNode );
380
+
381
+ This method parses a DOM tree (ex. responseXML.documentElement)
382
+ and returns its JavaScript object converted.
383
+
384
+ =head2 tree = xotree.parseHTTP( url, options );
385
+
386
+ This method loads a XML file from remote web server
387
+ and returns its JavaScript object converted.
388
+ XMLHTTPRequest's synchronous mode is always used.
389
+ This mode blocks the process until the response is completed.
390
+
391
+ First argument is a XML file's URL
392
+ which must exist in the same domain as parent HTML file's.
393
+ Cross-domain loading is not available for security reasons.
394
+
395
+ Second argument is options' object which can contains some parameters:
396
+ method, postBody, parameters, onLoading, etc.
397
+
398
+ This method requires JSAN's L<HTTP.Request> class or prototype.js's Ajax.Request class.
399
+
400
+ =head2 xotree.parseHTTP( url, options, callback );
401
+
402
+ If a callback function is set as third argument,
403
+ XMLHTTPRequest's asynchronous mode is used.
404
+
405
+ This mode calls a callback function with XML file's JavaScript object converted
406
+ after the response is completed.
407
+
408
+ =head2 xmlSrc = xotree.writeXML( tree );
409
+
410
+ This method parses a JavaScript object tree
411
+ and returns its XML source generated.
412
+
413
+ =head1 EXAMPLES
414
+
415
+ =head2 Text node and attributes
416
+
417
+ If a element has both of a text node and attributes
418
+ or both of a text node and other child nodes,
419
+ text node's value is moved to a special node named "#text".
420
+
421
+ var xotree = new XML.ObjTree();
422
+ var xmlSrc = '<span class="author">Kawasaki Yusuke</span>';
423
+ var tree = xotree.parseXML( xmlSrc );
424
+ var class = tree.span["-class"]; # attribute
425
+ var name = tree.span["#text"]; # text node
426
+
427
+ =head2 parseHTTP() method with HTTP-GET and sync-mode
428
+
429
+ HTTP/Request.js or prototype.js must be loaded before calling this method.
430
+
431
+ var xotree = new XML.ObjTree();
432
+ var url = "http://example.com/index.html";
433
+ var tree = xotree.parseHTTP( url );
434
+ xotree.attr_prefix = '@'; // E4X-style
435
+ alert( tree.html["@lang"] );
436
+
437
+ This code shows C<lang=""> attribute from a X-HTML source code.
438
+
439
+ =head2 parseHTTP() method with HTTP-POST and async-mode
440
+
441
+ Third argument is a callback function which is called on onComplete.
442
+
443
+ var xotree = new XML.ObjTree();
444
+ var url = "http://example.com/mt-tb.cgi";
445
+ var opts = {
446
+ postBody: "title=...&excerpt=...&url=...&blog_name=..."
447
+ };
448
+ var func = function ( tree ) {
449
+ alert( tree.response.error );
450
+ };
451
+ xotree.parseHTTP( url, opts, func );
452
+
453
+ This code send a track back ping and shows its response code.
454
+
455
+ =head2 Simple RSS reader
456
+
457
+ This is a RSS reader which loads RDF file and displays all items.
458
+
459
+ var xotree = new XML.ObjTree();
460
+ xotree.force_array = [ "rdf:li", "item" ];
461
+ var url = "http://example.com/news-rdf.xml";
462
+ var func = function( tree ) {
463
+ var elem = document.getElementById("rss_here");
464
+ for( var i=0; i<tree["rdf:RDF"].item.length; i++ ) {
465
+ var divTag = document.createElement( "div" );
466
+ var aTag = document.createElement( "a" );
467
+ aTag.href = tree["rdf:RDF"].item[i].link;
468
+ var title = tree["rdf:RDF"].item[i].title;
469
+ var tNode = document.createTextNode( title );
470
+ aTag.appendChild( tNode );
471
+ divTag.appendChild( aTag );
472
+ elem.appendChild( divTag );
473
+ }
474
+ };
475
+ xotree.parseHTTP( url, {}, func );
476
+
477
+ =head2 XML-RPC using writeXML, prototype.js and parseDOM
478
+
479
+ If you wish to use prototype.js's Ajax.Request class by yourself:
480
+
481
+ var xotree = new XML.ObjTree();
482
+ var reqTree = {
483
+ methodCall: {
484
+ methodName: "weblogUpdates.ping",
485
+ params: {
486
+ param: [
487
+ { value: "Kawa.net xp top page" }, // 1st param
488
+ { value: "http://www.kawa.net/" } // 2nd param
489
+ ]
490
+ }
491
+ }
492
+ };
493
+ var reqxml = xotree.writeXML( reqTree ); // JS-Object to XML code
494
+ var url = "http://example.com/xmlrpc";
495
+ var func = function( req ) {
496
+ var resDom = req.responseXML.documentElement;
497
+ xotree.force_array = [ "member" ];
498
+ var resTree = xotree.parseDOM( resDom ); // XML-DOM to JS-Object
499
+ alert( resTree.methodResponse.params.param.value.struct.member[0].value.string );
500
+ };
501
+ var opt = {
502
+ method: "post",
503
+ postBody: reqxml,
504
+ asynchronous: true,
505
+ onComplete: func
506
+ };
507
+ new Ajax.Request( url, opt );
508
+
509
+ =head1 AUTHOR
510
+
511
+ Yusuke Kawasaki http://www.kawa.net/
512
+ =head1 COPYRIGHT AND LICENSE
513
+
514
+ Copyright (c) 2005-2006 Yusuke Kawasaki. All rights reserved.
515
+ This program is free software; you can redistribute it and/or
516
+ modify it under the Artistic license. Or whatever license I choose,
517
+ which I will do instead of keeping this documentation like it is.
518
+
519
+ =cut
520
+ // ========================================================================
521
+ */
277
522
  var lfXml2Json = function (xmlData) {
278
523
  return new XML.ObjTree().parseXML(xmlData);
279
524
  };
@@ -9,12 +9,13 @@ declare type ControlItem = {
9
9
  };
10
10
  declare class Control {
11
11
  private lf;
12
- private LogicFlow;
13
12
  static pluginName: string;
14
13
  private controlItems;
15
14
  private domContainer;
16
15
  private toolEl;
17
- constructor(args: any);
16
+ constructor({ lf }: {
17
+ lf: any;
18
+ });
18
19
  render(lf: any, domContainer: any): void;
19
20
  destroy(): void;
20
21
  addItem(item: any): void;
@@ -19,16 +19,15 @@ var __spread = (this && this.__spread) || function () {
19
19
  return ar;
20
20
  };
21
21
  var Control = /** @class */ (function () {
22
- function Control(args) {
22
+ function Control(_a) {
23
23
  var _this = this;
24
- this.lf = args.lf;
25
- this.LogicFlow = args.LogicFlow;
24
+ var lf = _a.lf;
26
25
  this.controlItems = [
27
26
  {
28
27
  key: 'zoom-out',
29
28
  iconClass: 'lf-control-zoomOut',
30
- title: this.LogicFlow.t('缩小流程图'),
31
- text: this.LogicFlow.t('缩小'),
29
+ title: '缩小流程图',
30
+ text: '缩小',
32
31
  onClick: function () {
33
32
  _this.lf.zoom(false);
34
33
  },
@@ -36,8 +35,8 @@ var Control = /** @class */ (function () {
36
35
  {
37
36
  key: 'zoom-in',
38
37
  iconClass: 'lf-control-zoomIn',
39
- title: this.LogicFlow.t('放大流程图'),
40
- text: this.LogicFlow.t('放大'),
38
+ title: '放大流程图',
39
+ text: '放大',
41
40
  onClick: function () {
42
41
  _this.lf.zoom(true);
43
42
  },
@@ -45,8 +44,8 @@ var Control = /** @class */ (function () {
45
44
  {
46
45
  key: 'reset',
47
46
  iconClass: 'lf-control-fit',
48
- title: this.LogicFlow.t('恢复流程原有尺寸'),
49
- text: this.LogicFlow.t('适应'),
47
+ title: '恢复流程原有尺寸',
48
+ text: '适应',
50
49
  onClick: function () {
51
50
  _this.lf.resetZoom();
52
51
  },
@@ -54,8 +53,8 @@ var Control = /** @class */ (function () {
54
53
  {
55
54
  key: 'undo',
56
55
  iconClass: 'lf-control-undo',
57
- title: this.LogicFlow.t('回到上一步'),
58
- text: this.LogicFlow.t('上一步'),
56
+ title: '回到上一步',
57
+ text: '上一步',
59
58
  onClick: function () {
60
59
  _this.lf.undo();
61
60
  },
@@ -63,13 +62,14 @@ var Control = /** @class */ (function () {
63
62
  {
64
63
  key: 'redo',
65
64
  iconClass: 'lf-control-redo',
66
- title: this.LogicFlow.t('移到下一步'),
67
- text: this.LogicFlow.t('下一步'),
65
+ title: '移到下一步',
66
+ text: '下一步',
68
67
  onClick: function () {
69
68
  _this.lf.redo();
70
69
  },
71
70
  },
72
71
  ];
72
+ this.lf = lf;
73
73
  }
74
74
  Control.prototype.render = function (lf, domContainer) {
75
75
  this.destroy();
@@ -110,14 +110,14 @@ var Control = /** @class */ (function () {
110
110
  text.title = item.title;
111
111
  text.innerText = item.text;
112
112
  itemContainer.append(icon, text);
113
- switch (item.key) {
114
- case 'undo':
113
+ switch (item.text) {
114
+ case '上一步':
115
115
  _this.lf.on('history:change', function (_a) {
116
116
  var undoAble = _a.data.undoAble;
117
117
  itemContainer.className = undoAble ? NORMAL : DISABLED;
118
118
  });
119
119
  break;
120
- case 'redo':
120
+ case '下一步':
121
121
  _this.lf.on('history:change', function (_a) {
122
122
  var redoAble = _a.data.redoAble;
123
123
  itemContainer.className = redoAble ? NORMAL : DISABLED;
@@ -41,8 +41,11 @@ var DndPanel = /** @class */ (function () {
41
41
  el.className = shapeItem.className ? "lf-dnd-item " + shapeItem.className : 'lf-dnd-item';
42
42
  var shape = document.createElement('div');
43
43
  shape.className = 'lf-dnd-shape';
44
+ // if (typeof shapeItem.icon === 'string') {
44
45
  if (shapeItem.icon) {
45
46
  shape.style.backgroundImage = "url(" + shapeItem.icon + ")";
47
+ // } else {
48
+ // shape.appendChild(shapeItem.icon);
46
49
  }
47
50
  el.appendChild(shape);
48
51
  if (shapeItem.label) {
@@ -63,6 +66,24 @@ var DndPanel = /** @class */ (function () {
63
66
  shapeItem.callback(_this.lf, _this.domContainer);
64
67
  }
65
68
  };
69
+ el.ondblclick = function (e) {
70
+ _this.lf.graphModel.eventCenter.emit('dnd:panel-dbclick', {
71
+ e: e,
72
+ data: shapeItem,
73
+ });
74
+ };
75
+ el.onclick = function (e) {
76
+ _this.lf.graphModel.eventCenter.emit('dnd:panel-click', {
77
+ e: e,
78
+ data: shapeItem,
79
+ });
80
+ };
81
+ el.oncontextmenu = function (e) {
82
+ _this.lf.graphModel.eventCenter.emit('dnd:panel-contextmenu', {
83
+ e: e,
84
+ data: shapeItem,
85
+ });
86
+ };
66
87
  return el;
67
88
  };
68
89
  DndPanel.pluginName = 'dndPanel';
@@ -139,7 +139,6 @@ var Highlight = /** @class */ (function () {
139
139
  }
140
140
  Object.values(this.lf.graphModel.modelsMap).forEach(function (item) {
141
141
  // 所有节点样式都进行备份
142
- // eslint-disable-next-line operator-linebreak
143
142
  var oStyle = item.BaseType === 'node' ? item.getNodeStyle() : item.getEdgeStyle();
144
143
  _this.tempStyles[item.id] = __assign({}, oStyle);
145
144
  // 所有节点都设置透明度为0.1
@@ -13,13 +13,14 @@ export declare type MenuConfig = {
13
13
  };
14
14
  declare class Menu {
15
15
  lf: LogicFlow;
16
- LogicFlow: any;
17
16
  private __container;
18
17
  private __menuDOM;
19
18
  private menuTypeMap;
20
19
  private __currentData;
21
20
  static pluginName: string;
22
- constructor(args: any);
21
+ constructor({ lf }: {
22
+ lf: any;
23
+ });
23
24
  /**
24
25
  * 初始化设置默认内置菜单栏
25
26
  */
@@ -23,11 +23,11 @@ var DefaultEdgeMenuKey = 'lf:defaultEdgeMenu';
23
23
  var DefaultGraphMenuKey = 'lf:defaultGraphMenu';
24
24
  var DefaultSelectionMenuKey = 'lf:defaultSelectionMenu';
25
25
  var Menu = /** @class */ (function () {
26
- function Menu(args) {
26
+ function Menu(_a) {
27
27
  var _this = this;
28
+ var lf = _a.lf;
28
29
  this.__menuDOM = document.createElement('ul');
29
- this.lf = args.lf;
30
- this.LogicFlow = args.LogicFlow;
30
+ this.lf = lf;
31
31
  this.menuTypeMap = new Map();
32
32
  this.init();
33
33
  this.lf.setMenuConfig = function (config) {
@@ -47,19 +47,19 @@ var Menu = /** @class */ (function () {
47
47
  var _this = this;
48
48
  var defaultNodeMenu = [
49
49
  {
50
- text: this.LogicFlow.t('删除'),
50
+ text: '删除',
51
51
  callback: function (node) {
52
52
  _this.lf.deleteNode(node.id);
53
53
  },
54
54
  },
55
55
  {
56
- text: this.LogicFlow.t('编辑文本'),
56
+ text: '编辑文本',
57
57
  callback: function (node) {
58
58
  _this.lf.graphModel.editText(node.id);
59
59
  },
60
60
  },
61
61
  {
62
- text: this.LogicFlow.t('复制'),
62
+ text: '复制',
63
63
  callback: function (node) {
64
64
  _this.lf.cloneNode(node.id);
65
65
  },
@@ -68,13 +68,13 @@ var Menu = /** @class */ (function () {
68
68
  this.menuTypeMap.set(DefaultNodeMenuKey, defaultNodeMenu);
69
69
  var defaultEdgeMenu = [
70
70
  {
71
- text: this.LogicFlow.t('删除'),
71
+ text: '删除',
72
72
  callback: function (edge) {
73
73
  _this.lf.deleteEdge(edge.id);
74
74
  },
75
75
  },
76
76
  {
77
- text: this.LogicFlow.t('编辑文本'),
77
+ text: '编辑文本',
78
78
  callback: function (edge) {
79
79
  _this.lf.graphModel.editText(edge.id);
80
80
  },
@@ -84,7 +84,7 @@ var Menu = /** @class */ (function () {
84
84
  this.menuTypeMap.set(DefaultGraphMenuKey, []);
85
85
  var DefaultSelectionMenu = [
86
86
  {
87
- text: this.LogicFlow.t('删除'),
87
+ text: '删除',
88
88
  callback: function (elements) {
89
89
  _this.lf.clearSelectElements();
90
90
  elements.edges.forEach(function (edge) { return _this.lf.deleteEdge(edge.id); });
@@ -1,76 +1,88 @@
1
1
  declare class MiniMap {
2
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 }: {
3
+ static width: number;
4
+ static height: number;
5
+ static viewPortWidth: number;
6
+ static viewPortHeight: number;
7
+ static isShowHeader: boolean;
8
+ static isShowCloseIcon: boolean;
9
+ static leftPosition: number;
10
+ static topPosition: number;
11
+ static rightPosition: any;
12
+ static bottomPosition: any;
13
+ static headerTitle: string;
14
+ private lf;
15
+ private container;
16
+ private miniMapWrap;
17
+ private miniMapContainer;
18
+ private lfMap;
19
+ private viewport;
20
+ private width;
21
+ private height;
22
+ private leftPosition;
23
+ private topPosition;
24
+ private rightPosition;
25
+ private bottomPosition;
26
+ private miniMapWidth;
27
+ private miniMapHeight;
28
+ private viewPortTop;
29
+ private viewPortLeft;
30
+ private startPosition;
31
+ private viewPortScale;
32
+ private viewPortWidth;
33
+ private viewPortHeight;
34
+ private resetDataX;
35
+ private resetDataY;
36
+ private LogicFlow;
37
+ private isShow;
38
+ private isShowHeader;
39
+ private isShowCloseIcon;
40
+ private dragging;
41
+ private disabledPlugins;
42
+ constructor({ lf, LogicFlow, options }: {
25
43
  lf: any;
26
44
  LogicFlow: any;
45
+ options: any;
27
46
  });
28
47
  render(lf: any, container: any): void;
29
48
  init(option: any): void;
30
49
  /**
31
50
  * 显示mini map
32
- */
51
+ */
33
52
  show: (leftPosition?: number, topPosition?: number) => void;
34
53
  /**
35
54
  * 隐藏mini map
36
55
  */
37
56
  hide: () => void;
38
- __init(): void;
39
- __createMiniMap(left: any, top: any): void;
40
- __removeMiniMap(): void;
57
+ reset: () => void;
58
+ private setOption;
59
+ private initMiniMap;
60
+ private createMiniMap;
61
+ private removeMiniMap;
41
62
  /**
42
63
  * 计算所有图形一起,占领的区域范围。
43
64
  * @param data
44
65
  */
45
- __getBounds(data: any): {
46
- left: number;
47
- top: number;
48
- bottom: number;
49
- right: number;
50
- };
66
+ private getBounds;
51
67
  /**
52
68
  * 将负值的平移转换为正值。
53
69
  * 保证渲染的时候,minimap能完全展示。
54
70
  * 获取将画布所有元素平移到0,0开始时,所有节点数据
55
71
  */
56
- __resetData(data: any): any;
72
+ private resetData;
57
73
  /**
58
74
  * 显示导航
59
75
  * 显示视口范围
60
76
  * 1. 基于画布的范围比例,设置视口范围比例。宽度默认为导航宽度。
61
77
  */
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
- moveViewport: (top: any, left: any) => void;
72
- __drag: (e: any) => void;
73
- __drop: () => void;
78
+ private setView;
79
+ private setViewPort;
80
+ private createViewPort;
81
+ private startDrag;
82
+ private moveViewport;
83
+ private drag;
84
+ private drop;
85
+ private mapClick;
74
86
  }
75
87
  export default MiniMap;
76
88
  export { MiniMap };