@logicflow/extension 1.1.20 → 1.2.0-alpha.10

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 (101) hide show
  1. package/cjs/NodeResize/Control/Control.js +21 -17
  2. package/cjs/NodeResize/Control/Util.js +11 -11
  3. package/cjs/NodeResize/Node/DiamondResize.js +10 -8
  4. package/cjs/NodeResize/Node/EllipseResize.js +10 -8
  5. package/cjs/NodeResize/Node/HtmlResize.js +10 -8
  6. package/cjs/NodeResize/Node/RectResize.js +10 -8
  7. package/cjs/bpmn-adapter/index.js +124 -76
  8. package/cjs/bpmn-adapter/json2xml.js +5 -2
  9. package/cjs/bpmn-adapter/xml2json.js +38 -284
  10. package/cjs/components/context-menu/index.js +2 -2
  11. package/cjs/components/control/index.js +16 -16
  12. package/cjs/components/menu/index.js +32 -32
  13. package/cjs/components/mini-map/index.js +2 -2
  14. package/cjs/components/selection-select/index.js +27 -7
  15. package/cjs/index.js +1 -0
  16. package/cjs/insert-node-in-polyline/edge.js +4 -4
  17. package/cjs/insert-node-in-polyline/index.js +1 -1
  18. package/cjs/locale/en-locale/en.js +22 -0
  19. package/cjs/locale/en-locale/index.js +29 -0
  20. package/cjs/locale/locale.js +19 -0
  21. package/cjs/materials/group/GroupNode.js +24 -14
  22. package/cjs/materials/group/index.js +3 -3
  23. package/cjs/tools/auto-layout/index.js +9 -9
  24. package/es/NodeResize/Control/Control.d.ts +1 -1
  25. package/es/NodeResize/Control/Control.js +22 -18
  26. package/es/NodeResize/Control/Util.d.ts +3 -3
  27. package/es/NodeResize/Control/Util.js +7 -7
  28. package/es/NodeResize/Node/DiamondResize.d.ts +1 -1
  29. package/es/NodeResize/Node/DiamondResize.js +10 -8
  30. package/es/NodeResize/Node/EllipseResize.d.ts +1 -1
  31. package/es/NodeResize/Node/EllipseResize.js +10 -8
  32. package/es/NodeResize/Node/HtmlResize.d.ts +1 -1
  33. package/es/NodeResize/Node/HtmlResize.js +10 -8
  34. package/es/NodeResize/Node/RectResize.d.ts +1 -1
  35. package/es/NodeResize/Node/RectResize.js +10 -8
  36. package/es/bpmn-adapter/index.d.ts +41 -33
  37. package/es/bpmn-adapter/index.js +124 -76
  38. package/es/bpmn-adapter/json2xml.js +5 -2
  39. package/es/bpmn-adapter/xml2json.js +38 -284
  40. package/es/components/context-menu/index.js +2 -2
  41. package/es/components/control/index.d.ts +2 -3
  42. package/es/components/control/index.js +16 -16
  43. package/es/components/menu/index.d.ts +2 -3
  44. package/es/components/menu/index.js +32 -32
  45. package/es/components/mini-map/index.js +2 -2
  46. package/es/components/selection-select/index.d.ts +2 -1
  47. package/es/components/selection-select/index.js +27 -7
  48. package/es/index.d.ts +1 -0
  49. package/es/index.js +1 -0
  50. package/es/insert-node-in-polyline/edge.d.ts +3 -3
  51. package/es/insert-node-in-polyline/edge.js +3 -3
  52. package/es/insert-node-in-polyline/index.js +2 -2
  53. package/es/locale/en-locale/en.d.ts +19 -0
  54. package/es/locale/en-locale/en.js +19 -0
  55. package/es/locale/en-locale/index.d.ts +9 -0
  56. package/es/locale/en-locale/index.js +26 -0
  57. package/es/locale/locale.d.ts +6 -0
  58. package/es/locale/locale.js +16 -0
  59. package/es/materials/group/GroupNode.d.ts +1 -1
  60. package/es/materials/group/GroupNode.js +24 -14
  61. package/es/materials/group/index.d.ts +1 -1
  62. package/es/materials/group/index.js +3 -3
  63. package/es/tools/auto-layout/index.d.ts +2 -2
  64. package/es/tools/auto-layout/index.js +9 -9
  65. package/lib/AutoLayout.js +1 -1
  66. package/lib/BpmnAdapter.js +1 -1
  67. package/lib/BpmnElement.js +1 -1
  68. package/lib/ContextMenu.js +1 -1
  69. package/lib/Control.js +1 -1
  70. package/lib/CurvedEdge.js +1 -1
  71. package/lib/DndPanel.js +1 -1
  72. package/lib/EnLocale.js +1 -0
  73. package/lib/FlowPath.js +1 -1
  74. package/lib/Group.js +1 -1
  75. package/lib/Highlight.js +1 -1
  76. package/lib/InsertNodeInPolyline.js +1 -1
  77. package/lib/Menu.js +1 -1
  78. package/lib/MiniMap.js +1 -1
  79. package/lib/NodeResize.js +1 -1
  80. package/lib/RectLabelNode.js +1 -1
  81. package/lib/SelectionSelect.js +1 -1
  82. package/lib/Snapshot.js +1 -1
  83. package/lib/TurboAdapter.js +1 -1
  84. package/lib/lfJson2Xml.js +1 -1
  85. package/lib/lfXml2Json.js +1 -1
  86. package/package.json +2 -2
  87. package/types/NodeResize/Control/Control.d.ts +1 -1
  88. package/types/NodeResize/Control/Util.d.ts +3 -3
  89. package/types/NodeResize/Node/DiamondResize.d.ts +1 -1
  90. package/types/NodeResize/Node/EllipseResize.d.ts +1 -1
  91. package/types/NodeResize/Node/HtmlResize.d.ts +1 -1
  92. package/types/NodeResize/Node/RectResize.d.ts +1 -1
  93. package/types/bpmn-adapter/index.d.ts +41 -33
  94. package/types/components/control/index.d.ts +2 -3
  95. package/types/components/menu/index.d.ts +2 -3
  96. package/types/components/selection-select/index.d.ts +2 -1
  97. package/types/index.d.ts +1 -0
  98. package/types/insert-node-in-polyline/edge.d.ts +3 -3
  99. package/types/materials/group/GroupNode.d.ts +1 -1
  100. package/types/materials/group/index.d.ts +1 -1
  101. package/types/tools/auto-layout/index.d.ts +2 -2
@@ -35,26 +35,26 @@ XML.ObjTree.prototype.parseXML = function (xml) {
35
35
  };
36
36
  // method: parseHTTP( url, options, callback )
37
37
  XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
38
- var myopt = {};
38
+ var myOpt = {};
39
39
  for (var key in options) {
40
- myopt[key] = options[key]; // copy object
40
+ myOpt[key] = options[key]; // copy object
41
41
  }
42
- if (!myopt.method) {
43
- if (typeof (myopt.postBody) == "undefined" &&
44
- typeof (myopt.postbody) == "undefined" &&
45
- typeof (myopt.parameters) == "undefined") {
46
- myopt.method = "get";
42
+ if (!myOpt.method) {
43
+ if (typeof (myOpt.postBody) == "undefined" &&
44
+ typeof (myOpt.postbody) == "undefined" &&
45
+ typeof (myOpt.parameters) == "undefined") {
46
+ myOpt.method = "get";
47
47
  }
48
48
  else {
49
- myopt.method = "post";
49
+ myOpt.method = "post";
50
50
  }
51
51
  }
52
52
  if (callback) {
53
- myopt.asynchronous = true; // async-mode
53
+ myOpt.asynchronous = true; // async-mode
54
54
  var __this = this;
55
55
  var __func = callback;
56
- var __save = myopt.onComplete;
57
- myopt.onComplete = function (trans) {
56
+ var __save = myOpt.onComplete;
57
+ myOpt.onComplete = function (trans) {
58
58
  var tree;
59
59
  if (trans && trans.responseXML && trans.responseXML.documentElement) {
60
60
  tree = __this.parseDOM(trans.responseXML.documentElement);
@@ -65,17 +65,17 @@ XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
65
65
  };
66
66
  }
67
67
  else {
68
- myopt.asynchronous = false; // sync-mode
68
+ myOpt.asynchronous = false;
69
69
  }
70
70
  var trans;
71
71
  if (typeof (HTTP) != "undefined" && HTTP.Request) {
72
- myopt.uri = url;
73
- var req = new HTTP.Request(myopt); // JSAN
72
+ myOpt.uri = url;
73
+ var req = new HTTP.Request(myOpt);
74
74
  if (req)
75
75
  trans = req.transport;
76
76
  }
77
77
  else if (typeof (Ajax) != "undefined" && Ajax.Request) {
78
- var req = new Ajax.Request(url, myopt); // ptorotype.js
78
+ var req = new Ajax.Request(url, myOpt);
79
79
  if (req)
80
80
  trans = req.transport;
81
81
  }
@@ -85,7 +85,7 @@ XML.ObjTree.prototype.parseHTTP = function (url, options, callback) {
85
85
  return this.parseDOM(trans.responseXML.documentElement);
86
86
  }
87
87
  };
88
- // method: parseDOM( documentroot )
88
+ // method: parseDOM( document root )
89
89
  XML.ObjTree.prototype.parseDOM = function (root) {
90
90
  if (!root)
91
91
  return;
@@ -119,11 +119,11 @@ XML.ObjTree.prototype.parseElement = function (elem) {
119
119
  return; // ignore white spaces
120
120
  return elem.nodeValue;
121
121
  }
122
- var retval;
122
+ var retVal;
123
123
  var cnt = {};
124
124
  // parse attributes
125
125
  if (elem.attributes && elem.attributes.length) {
126
- retval = {};
126
+ retVal = {};
127
127
  for (var i = 0; i < elem.attributes.length; i++) {
128
128
  var key = elem.attributes[i].nodeName;
129
129
  if (typeof (key) != "string")
@@ -135,30 +135,30 @@ XML.ObjTree.prototype.parseElement = function (elem) {
135
135
  if (typeof (cnt[key]) == "undefined")
136
136
  cnt[key] = 0;
137
137
  cnt[key]++;
138
- this.addNode(retval, key, cnt[key], val);
138
+ this.addNode(retVal, key, cnt[key], val);
139
139
  }
140
140
  }
141
141
  // parse child nodes (recursive)
142
142
  if (elem.childNodes && elem.childNodes.length) {
143
- var textonly = true;
144
- if (retval)
145
- textonly = false; // some attributes exists
146
- for (var i = 0; i < elem.childNodes.length && textonly; i++) {
147
- var ntype = elem.childNodes[i].nodeType;
148
- if (ntype == 3 || ntype == 4)
143
+ var textOnly = true;
144
+ if (retVal)
145
+ textOnly = false; // some attributes exists
146
+ for (var i = 0; i < elem.childNodes.length && textOnly; i++) {
147
+ var nType = elem.childNodes[i].nodeType;
148
+ if (nType == 3 || nType == 4)
149
149
  continue;
150
- textonly = false;
150
+ textOnly = false;
151
151
  }
152
- if (textonly) {
153
- if (!retval)
154
- retval = "";
152
+ if (textOnly) {
153
+ if (!retVal)
154
+ retVal = "";
155
155
  for (var i = 0; i < elem.childNodes.length; i++) {
156
- retval += elem.childNodes[i].nodeValue;
156
+ retVal += elem.childNodes[i].nodeValue;
157
157
  }
158
158
  }
159
159
  else {
160
- if (!retval)
161
- retval = {};
160
+ if (!retVal)
161
+ retVal = {};
162
162
  for (var i = 0; i < elem.childNodes.length; i++) {
163
163
  var key = elem.childNodes[i].nodeName;
164
164
  if (typeof (key) != "string")
@@ -169,23 +169,23 @@ XML.ObjTree.prototype.parseElement = function (elem) {
169
169
  if (typeof (cnt[key]) == "undefined")
170
170
  cnt[key] = 0;
171
171
  cnt[key]++;
172
- this.addNode(retval, key, cnt[key], val);
172
+ this.addNode(retVal, key, cnt[key], val);
173
173
  }
174
174
  }
175
175
  }
176
- return retval;
176
+ return retVal;
177
177
  };
178
178
  // method: addNode( hash, key, count, value )
179
- XML.ObjTree.prototype.addNode = function (hash, key, cnts, val) {
179
+ XML.ObjTree.prototype.addNode = function (hash, key, counts, val) {
180
180
  if (this.__force_array[key]) {
181
- if (cnts == 1)
181
+ if (counts == 1)
182
182
  hash[key] = [];
183
183
  hash[key][hash[key].length] = val; // push
184
184
  }
185
- else if (cnts == 1) { // 1st sibling
185
+ else if (counts == 1) { // 1st sibling
186
186
  hash[key] = val;
187
187
  }
188
- else if (cnts == 2) { // 2nd sibling
188
+ else if (counts == 2) { // 2nd sibling
189
189
  hash[key] = [hash[key], val];
190
190
  }
191
191
  else { // 3rd sibling and more
@@ -274,252 +274,6 @@ XML.ObjTree.prototype.scalar_to_xml = function (name, text) {
274
274
  XML.ObjTree.prototype.xml_escape = function (text) {
275
275
  return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
276
276
  };
277
- /*
278
- // ========================================================================
279
-
280
- =head1 NAME
281
-
282
- XML.ObjTree -- XML source code from/to JavaScript object like E4X
283
-
284
- =head1 SYNOPSIS
285
-
286
- var xotree = new XML.ObjTree();
287
- var tree1 = {
288
- root: {
289
- node: "Hello, World!"
290
- }
291
- };
292
- var xml1 = xotree.writeXML( tree1 ); // object tree to XML source
293
- alert( "xml1: "+xml1 );
294
-
295
- var xml2 = '<?xml version="1.0"?><response><error>0</error></response>';
296
- var tree2 = xotree.parseXML( xml2 ); // XML source to object tree
297
- alert( "error: "+tree2.response.error );
298
-
299
- =head1 DESCRIPTION
300
-
301
- XML.ObjTree class is a parser/generater between XML source code
302
- and JavaScript object like E4X, ECMAScript for XML.
303
- This is a JavaScript version of the XML::TreePP module for Perl.
304
- This also works as a wrapper for XMLHTTPRequest and successor to JKL.ParseXML class
305
- when this is used with prototype.js or JSAN's HTTP.Request class.
306
-
307
- =head2 JavaScript object tree format
308
-
309
- A sample XML source:
310
-
311
- <?xml version="1.0" encoding="UTF-8"?>
312
- <family name="Kawasaki">
313
- <father>Yasuhisa</father>
314
- <mother>Chizuko</mother>
315
- <children>
316
- <girl>Shiori</girl>
317
- <boy>Yusuke</boy>
318
- <boy>Kairi</boy>
319
- </children>
320
- </family>
321
-
322
- Its JavaScript object tree like JSON/E4X:
323
-
324
- {
325
- 'family': {
326
- '-name': 'Kawasaki',
327
- 'father': 'Yasuhisa',
328
- 'mother': 'Chizuko',
329
- 'children': {
330
- 'girl': 'Shiori'
331
- 'boy': [
332
- 'Yusuke',
333
- 'Kairi'
334
- ]
335
- }
336
- }
337
- };
338
-
339
- Each elements are parsed into objects:
340
-
341
- tree.family.father; # the father's given name.
342
-
343
- Prefix '-' is inserted before every attributes' name.
344
-
345
- tree.family["-name"]; # this family's family name
346
-
347
- A array is used because this family has two boys.
348
-
349
- tree.family.children.boy[0]; # first boy's name
350
- tree.family.children.boy[1]; # second boy's name
351
- tree.family.children.girl; # (girl has no other sisiters)
352
-
353
- =head1 METHODS
354
-
355
- =head2 xotree = new XML.ObjTree()
356
-
357
- This constructor method returns a new XML.ObjTree object.
358
-
359
- =head2 xotree.force_array = [ "rdf:li", "item", "-xmlns" ];
360
-
361
- This property allows you to specify a list of element names
362
- which should always be forced into an array representation.
363
- The default value is null, it means that context of the elements
364
- will determine to make array or to keep it scalar.
365
-
366
- =head2 xotree.attr_prefix = '@';
367
-
368
- This property allows you to specify a prefix character which is
369
- inserted before each attribute names.
370
- Instead of default prefix '-', E4X-style prefix '@' is also available.
371
- The default character is '-'.
372
- Or set '@' to access attribute values like E4X, ECMAScript for XML.
373
- The length of attr_prefix must be just one character and not be empty.
374
-
375
- =head2 tree = xotree.parseXML( xmlsrc );
376
-
377
- This method loads an XML document using the supplied string
378
- and returns its JavaScript object converted.
379
-
380
- =head2 tree = xotree.parseDOM( domnode );
381
-
382
- This method parses a DOM tree (ex. responseXML.documentElement)
383
- and returns its JavaScript object converted.
384
-
385
- =head2 tree = xotree.parseHTTP( url, options );
386
-
387
- This method loads a XML file from remote web server
388
- and returns its JavaScript object converted.
389
- XMLHTTPRequest's synchronous mode is always used.
390
- This mode blocks the process until the response is completed.
391
-
392
- First argument is a XML file's URL
393
- which must exist in the same domain as parent HTML file's.
394
- Cross-domain loading is not available for security reasons.
395
-
396
- Second argument is options' object which can contains some parameters:
397
- method, postBody, parameters, onLoading, etc.
398
-
399
- This method requires JSAN's L<HTTP.Request> class or prototype.js's Ajax.Request class.
400
-
401
- =head2 xotree.parseHTTP( url, options, callback );
402
-
403
- If a callback function is set as third argument,
404
- XMLHTTPRequest's asynchronous mode is used.
405
-
406
- This mode calls a callback function with XML file's JavaScript object converted
407
- after the response is completed.
408
-
409
- =head2 xmlsrc = xotree.writeXML( tree );
410
-
411
- This method parses a JavaScript object tree
412
- and returns its XML source generated.
413
-
414
- =head1 EXAMPLES
415
-
416
- =head2 Text node and attributes
417
-
418
- If a element has both of a text node and attributes
419
- or both of a text node and other child nodes,
420
- text node's value is moved to a special node named "#text".
421
-
422
- var xotree = new XML.ObjTree();
423
- var xmlsrc = '<span class="author">Kawasaki Yusuke</span>';
424
- var tree = xotree.parseXML( xmlsrc );
425
- var class = tree.span["-class"]; # attribute
426
- var name = tree.span["#text"]; # text node
427
-
428
- =head2 parseHTTP() method with HTTP-GET and sync-mode
429
-
430
- HTTP/Request.js or prototype.js must be loaded before calling this method.
431
-
432
- var xotree = new XML.ObjTree();
433
- var url = "http://example.com/index.html";
434
- var tree = xotree.parseHTTP( url );
435
- xotree.attr_prefix = '@'; // E4X-style
436
- alert( tree.html["@lang"] );
437
-
438
- This code shows C<lang=""> attribute from a X-HTML source code.
439
-
440
- =head2 parseHTTP() method with HTTP-POST and async-mode
441
-
442
- Third argument is a callback function which is called on onComplete.
443
-
444
- var xotree = new XML.ObjTree();
445
- var url = "http://example.com/mt-tb.cgi";
446
- var opts = {
447
- postBody: "title=...&excerpt=...&url=...&blog_name=..."
448
- };
449
- var func = function ( tree ) {
450
- alert( tree.response.error );
451
- };
452
- xotree.parseHTTP( url, opts, func );
453
-
454
- This code send a trackback ping and shows its response code.
455
-
456
- =head2 Simple RSS reader
457
-
458
- This is a RSS reader which loads RDF file and displays all items.
459
-
460
- var xotree = new XML.ObjTree();
461
- xotree.force_array = [ "rdf:li", "item" ];
462
- var url = "http://example.com/news-rdf.xml";
463
- var func = function( tree ) {
464
- var elem = document.getElementById("rss_here");
465
- for( var i=0; i<tree["rdf:RDF"].item.length; i++ ) {
466
- var divtag = document.createElement( "div" );
467
- var atag = document.createElement( "a" );
468
- atag.href = tree["rdf:RDF"].item[i].link;
469
- var title = tree["rdf:RDF"].item[i].title;
470
- var tnode = document.createTextNode( title );
471
- atag.appendChild( tnode );
472
- divtag.appendChild( atag );
473
- elem.appendChild( divtag );
474
- }
475
- };
476
- xotree.parseHTTP( url, {}, func );
477
-
478
- =head2 XML-RPC using writeXML, prototype.js and parseDOM
479
-
480
- If you wish to use prototype.js's Ajax.Request class by yourself:
481
-
482
- var xotree = new XML.ObjTree();
483
- var reqtree = {
484
- methodCall: {
485
- methodName: "weblogUpdates.ping",
486
- params: {
487
- param: [
488
- { value: "Kawa.net xp top page" }, // 1st param
489
- { value: "http://www.kawa.net/" } // 2nd param
490
- ]
491
- }
492
- }
493
- };
494
- var reqxml = xotree.writeXML( reqtree ); // JS-Object to XML code
495
- var url = "http://example.com/xmlrpc";
496
- var func = function( req ) {
497
- var resdom = req.responseXML.documentElement;
498
- xotree.force_array = [ "member" ];
499
- var restree = xotree.parseDOM( resdom ); // XML-DOM to JS-Object
500
- alert( restree.methodResponse.params.param.value.struct.member[0].value.string );
501
- };
502
- var opt = {
503
- method: "post",
504
- postBody: reqxml,
505
- asynchronous: true,
506
- onComplete: func
507
- };
508
- new Ajax.Request( url, opt );
509
-
510
- =head1 AUTHOR
511
-
512
- Yusuke Kawasaki http://www.kawa.net/
513
- =head1 COPYRIGHT AND LICENSE
514
-
515
- Copyright (c) 2005-2006 Yusuke Kawasaki. All rights reserved.
516
- This program is free software; you can redistribute it and/or
517
- modify it under the Artistic license. Or whatever license I choose,
518
- which I will do instead of keeping this documentation like it is.
519
-
520
- =cut
521
- // ========================================================================
522
- */
523
277
  var lfXml2Json = function (xmlData) {
524
278
  return new XML.ObjTree().parseXML(xmlData);
525
279
  };
@@ -174,8 +174,8 @@ var ContextMenu = /** @class */ (function () {
174
174
  var leftTopY = y - node.y / 2 - 20;
175
175
  var rightBottomX = node.x + nodeModel.width + NEXT_X_DISTANCE;
176
176
  var rightBottomY = y + node.y / 2 + 20;
177
- var exsitElements = this.lf.getAreaElement([leftTopX, leftTopY], [rightBottomX, rightBottomY]);
178
- if (exsitElements.length) {
177
+ var existElements = this.lf.getAreaElement([leftTopX, leftTopY], [rightBottomX, rightBottomY]);
178
+ if (existElements.length) {
179
179
  y = y + NEXT_Y_DISTANCE;
180
180
  this.addNode(node, y);
181
181
  return;
@@ -9,13 +9,12 @@ declare type ControlItem = {
9
9
  };
10
10
  declare class Control {
11
11
  private lf;
12
+ private LogicFlow;
12
13
  static pluginName: string;
13
14
  private controlItems;
14
15
  private domContainer;
15
16
  private toolEl;
16
- constructor({ lf }: {
17
- lf: any;
18
- });
17
+ constructor(args: any);
19
18
  render(lf: any, domContainer: any): void;
20
19
  destroy(): void;
21
20
  addItem(item: any): void;
@@ -19,15 +19,16 @@ var __spread = (this && this.__spread) || function () {
19
19
  return ar;
20
20
  };
21
21
  var Control = /** @class */ (function () {
22
- function Control(_a) {
22
+ function Control(args) {
23
23
  var _this = this;
24
- var lf = _a.lf;
24
+ this.lf = args.lf;
25
+ this.LogicFlow = args.LogicFlow;
25
26
  this.controlItems = [
26
27
  {
27
28
  key: 'zoom-out',
28
29
  iconClass: 'lf-control-zoomOut',
29
- title: '缩小流程图',
30
- text: '缩小',
30
+ title: this.LogicFlow.t('缩小流程图'),
31
+ text: this.LogicFlow.t('缩小'),
31
32
  onClick: function () {
32
33
  _this.lf.zoom(false);
33
34
  },
@@ -35,8 +36,8 @@ var Control = /** @class */ (function () {
35
36
  {
36
37
  key: 'zoom-in',
37
38
  iconClass: 'lf-control-zoomIn',
38
- title: '放大流程图',
39
- text: '放大',
39
+ title: this.LogicFlow.t('放大流程图'),
40
+ text: this.LogicFlow.t('放大'),
40
41
  onClick: function () {
41
42
  _this.lf.zoom(true);
42
43
  },
@@ -44,8 +45,8 @@ var Control = /** @class */ (function () {
44
45
  {
45
46
  key: 'reset',
46
47
  iconClass: 'lf-control-fit',
47
- title: '恢复流程原有尺寸',
48
- text: '适应',
48
+ title: this.LogicFlow.t('恢复流程原有尺寸'),
49
+ text: this.LogicFlow.t('适应'),
49
50
  onClick: function () {
50
51
  _this.lf.resetZoom();
51
52
  },
@@ -53,8 +54,8 @@ var Control = /** @class */ (function () {
53
54
  {
54
55
  key: 'undo',
55
56
  iconClass: 'lf-control-undo',
56
- title: '回到上一步',
57
- text: '上一步',
57
+ title: this.LogicFlow.t('回到上一步'),
58
+ text: this.LogicFlow.t('上一步'),
58
59
  onClick: function () {
59
60
  _this.lf.undo();
60
61
  },
@@ -62,14 +63,13 @@ var Control = /** @class */ (function () {
62
63
  {
63
64
  key: 'redo',
64
65
  iconClass: 'lf-control-redo',
65
- title: '移到下一步',
66
- text: '下一步',
66
+ title: this.LogicFlow.t('移到下一步'),
67
+ text: this.LogicFlow.t('下一步'),
67
68
  onClick: function () {
68
69
  _this.lf.redo();
69
70
  },
70
71
  },
71
72
  ];
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.text) {
114
- case '上一步':
113
+ switch (item.key) {
114
+ case 'undo':
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 '下一步':
120
+ case 'redo':
121
121
  _this.lf.on('history:change', function (_a) {
122
122
  var redoAble = _a.data.redoAble;
123
123
  itemContainer.className = redoAble ? NORMAL : DISABLED;
@@ -13,14 +13,13 @@ export declare type MenuConfig = {
13
13
  };
14
14
  declare class Menu {
15
15
  lf: LogicFlow;
16
+ LogicFlow: any;
16
17
  private __container;
17
18
  private __menuDOM;
18
19
  private menuTypeMap;
19
20
  private __currentData;
20
21
  static pluginName: string;
21
- constructor({ lf }: {
22
- lf: any;
23
- });
22
+ constructor(args: any);
24
23
  /**
25
24
  * 初始化设置默认内置菜单栏
26
25
  */