dcim-topology2d 2.2.3 → 3.0.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 (222) hide show
  1. package/activity-diagram/src/final/final.d.ts +1 -1
  2. package/activity-diagram/src/final/final.rect.d.ts +1 -1
  3. package/activity-diagram/src/final/final.rect.js +1 -1
  4. package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
  5. package/activity-diagram/src/fork/fork.anchor.js +1 -1
  6. package/activity-diagram/src/fork/fork.d.ts +1 -1
  7. package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
  8. package/activity-diagram/src/fork/fork.rect.js +1 -1
  9. package/activity-diagram/src/register.js +1 -1
  10. package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
  11. package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
  12. package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
  13. package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
  14. package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
  15. package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
  16. package/chart-diagram/index.d.ts +1 -3
  17. package/chart-diagram/index.js +1 -2
  18. package/chart-diagram/src/echarts/index.d.ts +2 -1
  19. package/chart-diagram/src/echarts/index.js +78 -86
  20. package/chart-diagram/src/register.js +8 -9
  21. package/class-diagram/src/class/class.d.ts +1 -1
  22. package/class-diagram/src/class/class.rect.d.ts +1 -1
  23. package/class-diagram/src/class/class.rect.js +1 -1
  24. package/class-diagram/src/register.js +1 -1
  25. package/core/index.d.ts +0 -2
  26. package/core/index.js +18 -2
  27. package/core/src/activeLayer.d.ts +10 -2
  28. package/core/src/activeLayer.js +62 -57
  29. package/core/src/animateLayer.d.ts +7 -3
  30. package/core/src/animateLayer.js +12 -10
  31. package/core/src/calling.d.ts +4 -1
  32. package/core/src/calling.js +68 -69
  33. package/core/src/canvas.d.ts +6 -1
  34. package/core/src/canvas.js +21 -22
  35. package/core/src/common.d.ts +7 -7
  36. package/core/src/common.js +698 -397
  37. package/core/src/core.d.ts +4 -5
  38. package/core/src/core.js +385 -536
  39. package/core/src/divLayer.d.ts +36 -2
  40. package/core/src/divLayer.js +305 -33
  41. package/core/src/healps/changeData.d.ts +2 -1
  42. package/core/src/healps/changeData.js +100 -89
  43. package/core/src/hoverLayer.d.ts +9 -2
  44. package/core/src/hoverLayer.js +34 -31
  45. package/core/src/middles/default.d.ts +3 -1
  46. package/core/src/middles/default.js +51 -65
  47. package/core/src/middles/index.d.ts +2 -1
  48. package/core/src/middles/index.js +2 -4
  49. package/core/src/middles/nodes/arbitrarygraph.js +9 -11
  50. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  51. package/core/src/middles/nodes/rectangle.js +15 -54
  52. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  53. package/core/src/models/data.d.ts +26 -0
  54. package/core/src/models/data.js +77 -0
  55. package/core/src/models/data.js.map +1 -0
  56. package/core/src/models/index.d.ts +1 -0
  57. package/core/src/models/index.js +1 -0
  58. package/core/src/models/line.js +7 -7
  59. package/core/src/models/node.d.ts +0 -10
  60. package/core/src/models/node.js +101 -155
  61. package/core/src/models/pen.js +68 -37
  62. package/core/src/models/rect.js +2 -2
  63. package/core/src/mqtt.d.ts +14 -0
  64. package/core/src/mqtt.js +82 -0
  65. package/core/src/mqtt.js.map +1 -0
  66. package/core/src/offscreen.d.ts +4 -1
  67. package/core/src/offscreen.js +24 -26
  68. package/core/src/options.d.ts +1 -3
  69. package/core/src/options.js +0 -2
  70. package/core/src/poll.js +39 -0
  71. package/core/src/preview.d.ts +13 -2
  72. package/core/src/preview.js +54 -181
  73. package/core/src/renderLayer.d.ts +9 -11
  74. package/core/src/renderLayer.js +61 -60
  75. package/core/src/socket.d.ts +10 -0
  76. package/core/src/socket.js +51 -0
  77. package/core/src/socket.js.map +1 -0
  78. package/core/src/utils/canvas.js +1 -1
  79. package/core/src/utils/construction.d.ts +3 -36
  80. package/core/src/utils/construction.js +1 -29
  81. package/core/src/utils/conversion.d.ts +0 -15
  82. package/core/src/utils/conversion.js +0 -319
  83. package/core/src/utils/dom.d.ts +8 -0
  84. package/core/src/utils/dom.js +67 -0
  85. package/core/src/utils/dom.js.map +1 -0
  86. package/core/src/utils/index.d.ts +1 -2
  87. package/core/src/utils/index.js +1 -2
  88. package/core/src/utils/onmousevent.d.ts +0 -3
  89. package/core/src/utils/onmousevent.js +10 -42
  90. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  91. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  92. package/flow-diagram/src/comment/comment.d.ts +1 -1
  93. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  94. package/flow-diagram/src/data/data.anchor.js +1 -1
  95. package/flow-diagram/src/data/data.d.ts +1 -1
  96. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  97. package/flow-diagram/src/data/data.rect.js +1 -1
  98. package/flow-diagram/src/db/db.d.ts +1 -1
  99. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  100. package/flow-diagram/src/db/db.rect.js +1 -1
  101. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  102. package/flow-diagram/src/display/display.anchor.js +1 -1
  103. package/flow-diagram/src/display/display.d.ts +1 -1
  104. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  105. package/flow-diagram/src/display/display.rect.js +1 -1
  106. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  107. package/flow-diagram/src/document/document.anchor.js +1 -1
  108. package/flow-diagram/src/document/document.d.ts +1 -1
  109. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  110. package/flow-diagram/src/document/document.rect.js +1 -1
  111. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  112. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  113. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  114. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  115. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  116. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  117. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  118. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  119. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  120. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  121. package/flow-diagram/src/manually/manually.d.ts +1 -1
  122. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  123. package/flow-diagram/src/manually/manually.rect.js +1 -1
  124. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  125. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  126. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  127. package/flow-diagram/src/queue/queue.d.ts +1 -1
  128. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  129. package/flow-diagram/src/queue/queue.rect.js +1 -1
  130. package/flow-diagram/src/register.js +1 -1
  131. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  132. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  133. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  134. package/layout/src/align.d.ts +1 -1
  135. package/layout/src/align.js +1 -1
  136. package/layout/src/layout.d.ts +1 -1
  137. package/layout/src/layout.js +1 -1
  138. package/myShape-diagram/{index.js → myShape.js} +1 -4
  139. package/package.json +1 -1
  140. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  141. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  142. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  143. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  144. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  145. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  146. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  147. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  148. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  149. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  150. package/sequence-diagram/src/register.js +1 -1
  151. package/chart-diagram/src/utils/changeOptions.d.ts +0 -8
  152. package/chart-diagram/src/utils/changeOptions.js +0 -273
  153. package/chart-diagram/src/utils/conversion.d.ts +0 -19
  154. package/chart-diagram/src/utils/conversion.js +0 -601
  155. package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
  156. package/chart-diagram/src/utils/drawGraphic.js +0 -97
  157. package/chart-diagram/src/utils/formatter.d.ts +0 -1
  158. package/chart-diagram/src/utils/formatter.js +0 -206
  159. package/chart-diagram/src/utils/index.d.ts +0 -5
  160. package/chart-diagram/src/utils/index.js +0 -5
  161. package/chart-diagram/src/utils/render.d.ts +0 -8
  162. package/chart-diagram/src/utils/render.js +0 -223
  163. package/chart-diagram/src/utils/surfaceParametricConversion.d.ts +0 -3
  164. package/chart-diagram/src/utils/surfaceParametricConversion.js +0 -252
  165. package/core/src/element/common.d.ts +0 -6
  166. package/core/src/element/common.js +0 -62
  167. package/core/src/element/datePicker.d.ts +0 -3
  168. package/core/src/element/datePicker.js +0 -44
  169. package/core/src/element/iframe.d.ts +0 -3
  170. package/core/src/element/iframe.js +0 -12
  171. package/core/src/element/index.d.ts +0 -5
  172. package/core/src/element/index.js +0 -6
  173. package/core/src/element/select.d.ts +0 -11
  174. package/core/src/element/select.js +0 -273
  175. package/core/src/element/tab.d.ts +0 -1
  176. package/core/src/element/tab.js +0 -20
  177. package/core/src/element/time.d.ts +0 -3
  178. package/core/src/element/time.js +0 -44
  179. package/core/src/middles/arrows/index.d.ts +0 -4
  180. package/core/src/middles/arrows/index.js +0 -5
  181. package/core/src/middles/lines/index.d.ts +0 -4
  182. package/core/src/middles/lines/index.js +0 -5
  183. package/core/src/middles/nodes/formDatePicker.d.ts +0 -2
  184. package/core/src/middles/nodes/formDatePicker.js +0 -108
  185. package/core/src/middles/nodes/formoverflow.js +0 -62
  186. package/core/src/middles/nodes/formselect.d.ts +0 -2
  187. package/core/src/middles/nodes/formselect.js +0 -111
  188. package/core/src/middles/nodes/iframe.d.ts +0 -2
  189. package/core/src/middles/nodes/iframe.js +0 -29
  190. package/core/src/middles/nodes/index.d.ts +0 -52
  191. package/core/src/middles/nodes/index.js +0 -54
  192. package/core/src/middles/nodes/progress.d.ts +0 -2
  193. package/core/src/middles/nodes/progress.js +0 -63
  194. package/core/src/middles/nodes/progress.js.map +0 -1
  195. package/core/src/middles/nodes/switchs.d.ts +0 -2
  196. package/core/src/middles/nodes/switchs.js +0 -46
  197. package/core/src/middles/nodes/time.d.ts +0 -2
  198. package/core/src/middles/nodes/time.js +0 -98
  199. package/core/src/store/common.d.ts +0 -9
  200. package/core/src/store/common.js +0 -5
  201. package/core/src/store/data.d.ts +0 -205
  202. package/core/src/store/data.js +0 -198
  203. package/core/src/store/index.d.ts +0 -2
  204. package/core/src/store/index.js +0 -2
  205. package/core/src/utils/assignment.d.ts +0 -7
  206. package/core/src/utils/assignment.js +0 -229
  207. package/core/src/utils/params.d.ts +0 -3
  208. package/core/src/utils/params.js +0 -136
  209. package/static/echartsDefaultData.js +0 -178
  210. package/static/element.js +0 -14
  211. package/static/form.js +0 -11
  212. package/static/index.js +0 -3
  213. package/store/actions.js +0 -2
  214. package/store/clear.js +0 -14
  215. package/store/default.js +0 -22
  216. package/store/index.js +0 -3
  217. package/style/common.css +0 -15
  218. package/style/datePicker.css +0 -44
  219. package/style/editor.css +0 -16
  220. package/style/index.css +0 -5
  221. package/style/select.css +0 -143
  222. /package/myShape-diagram/{index.d.ts → myShape.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
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]; };
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
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
@@ -20,9 +20,8 @@ import { defaultAnchors } from '../middles/default.anchor';
20
20
  import { defaultIconRect, defaultTextRect } from '../middles/default.rect';
21
21
  import { text, tableText, defaultText, iconfont } from '../middles/nodes/text';
22
22
  import { Store } from 'le5le-store';
23
- import { abs, s8, animateType } from '../utils';
24
- export const images = {};
25
- export const defaultImages = {};
23
+ import { abs, s8, animateType, createChildrenDivByElementId } from '../utils';
24
+ export var images = {};
26
25
  var Node = /** @class */ (function (_super) {
27
26
  __extends(Node, _super);
28
27
  function Node(json, noChild) {
@@ -35,13 +34,9 @@ var Node = /** @class */ (function (_super) {
35
34
  _this.rotatedAnchors = [];
36
35
  _this.animateDuration = 0;
37
36
  _this.animateFrames = [];
38
- _this.attribute = json.attribute || 'default';
39
37
  _this.type = PenType.Node;
40
- _this.TID = json.TID;
41
- _this.selectDropdown = json.selectDropdown || false;
42
38
  _this.is3D = json.is3D;
43
39
  _this.z = json.z;
44
- _this.order = json.order;
45
40
  _this.zRotate = json.zRotate || 0;
46
41
  _this.borderRadius = +json.borderRadius || 0;
47
42
  _this.icon = json.icon;
@@ -49,16 +44,8 @@ var Node = /** @class */ (function (_super) {
49
44
  _this.iconSize = +json.iconSize;
50
45
  _this.iconColor = json.iconColor;
51
46
  _this.image = json.image;
52
- _this.tabData = json.tabData || {
53
- state: false,
54
- name: '℃',
55
- min: 0,
56
- max: 60,
57
- interval: 20
58
- };
59
47
  _this.floorImageIndex = json.floorImageIndex || false;
60
48
  _this.formData = json.formData || null;
61
- _this.pickerOptions = json.pickerOptions || null;
62
49
  _this.formStyle = json.formStyle || null;
63
50
  _this.formEvents = json.formEvents || [];
64
51
  _this.paginationData = json.paginationData || null;
@@ -92,11 +79,10 @@ var Node = /** @class */ (function (_super) {
92
79
  _this.leakageEnd = json.leakageEnd || 0;
93
80
  _this.leakageFillStyle = json.leakageFillStyle || '#ff0000';
94
81
  _this.bindStaticId = json.bindStaticId || '';
95
- //_this.buttonCheckSlide = json.buttonCheckSlide || '';
96
- _this.visitStrokeStyle = json.visitStrokeStyle || '';
82
+ _this.buttonCheckSlide = json.buttonCheckSlide || '';
83
+ _this.activeImgeIndex = json.activeImgeIndex || false;
97
84
  _this.thBottomStrokeStyle = json.thBottomStrokeStyle || '#fff';
98
85
  _this.thBottomLineWidth = json.thBottomLineWidth || 1;
99
- _this.focusFillStyle = json.focusFillStyle;
100
86
  // 兼容老数据
101
87
  if (json.children && json.children[0] && json.children[0].parentRect) {
102
88
  _this.paddingLeft = json.children[0].parentRect.offsetX;
@@ -135,34 +121,28 @@ var Node = /** @class */ (function (_super) {
135
121
  _this.animateDuration = json.animateDuration;
136
122
  }
137
123
  _this.animateType = json.animateType
138
- ? json.animateType
139
- : json.animateDuration
140
- ? 'custom'
141
- : '';
124
+ ? json.animateType
125
+ : json.animateDuration
126
+ ? 'custom'
127
+ : '';
142
128
  _this.animateAlone = json.animateAlone;
143
129
  _this.iframe = json.iframe;
144
- _this.iframePageAuto = json.iframePageAuto || false;
145
130
  _this.elementId = json.elementId;
146
131
  _this.audio = json.audio;
147
132
  _this.video = json.video;
148
133
  _this.play = json.play;
149
134
  _this.nextPlay = json.nextPlay;
150
- _this.time = json.time;
151
- _this.isOpen = json.isOpen;
152
- _this.isShowPercent = json.isShowPercent || false;
153
- _this.maxValue = json.maxValue || 100;
154
- _this.retationDecimalPlaces = json.retationDecimalPlaces;
155
135
  if (json.elementLoaded !== undefined) {
156
136
  _this.elementId = null;
157
137
  _this.elementLoaded = false;
158
138
  }
159
- if (this.name == 'arbitraryGraph') {
139
+ if(this.name == 'arbitraryGraph') {
160
140
  this.rect.circles = json.rect.circles;
161
141
  //let {x, y} = this.centroid(json.rect.circles);
162
- let minX = Math.min.apply(Math, json.rect.circles.map((item) => { return item.x }));
163
- let minY = Math.min.apply(Math, json.rect.circles.map((item) => { return item.y }));
164
- this.rect.x = minX;
165
- this.rect.y = minY;
142
+ let minX = Math.min.apply(Math, json.rect.circles.map((item)=>{ return item.x}));
143
+ let minY = Math.min.apply(Math, json.rect.circles.map((item)=>{ return item.y}));
144
+ this.rect.x = minX;
145
+ this.rect.y = minY;
166
146
  this.rect.ex = this.rect.x + this.rect.width;
167
147
  this.rect.ey = this.rect.y + this.rect.height;
168
148
  // this.rect.center.x = x;
@@ -170,8 +150,8 @@ var Node = /** @class */ (function (_super) {
170
150
  // console.log('this.rect', this.rect);
171
151
  // console.log('this---node---', this);
172
152
  }
173
- if (json.name === 'formTable') _this.setFormTableData(json);
174
- if (json.name === 'tablePagination') _this.setTablePagination(json);
153
+ if(json.name === 'formTable') _this.setFormTableData(json);
154
+ if(json.name === 'tablePagination') _this.setTablePagination(json);
175
155
  _this.init();
176
156
  if (!noChild) {
177
157
  _this.setChild(json.children);
@@ -180,16 +160,6 @@ var Node = /** @class */ (function (_super) {
180
160
  _this.children = null;
181
161
  }
182
162
 
183
- if (json.name === 'time') {
184
- _this.animateFn = function () {
185
- let date = new Date();
186
- var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
187
- var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
188
- var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
189
- _this.time = { h: hour, m: minute, s: second }
190
- }
191
- }
192
-
193
163
  return _this;
194
164
  }
195
165
  Node.cloneState = function (json) {
@@ -218,7 +188,7 @@ var Node = /** @class */ (function (_super) {
218
188
  this.addToDiv();
219
189
  };
220
190
  Node.prototype.setFormTableData = function (json) {
221
- if (!Store.get('FORM:tableData')) {
191
+ if(!Store.get('FORM:tableData')){
222
192
  Store.set('FORM:tableData', {
223
193
  data: {
224
194
  tableNodes: {},
@@ -233,18 +203,18 @@ var Node = /** @class */ (function (_super) {
233
203
  data: tableData
234
204
  })
235
205
  const fromData = Store.get('SYNC:tableData');
236
- if (fromData) {
237
- if (!fromData[json.id].loading) {
206
+ if(fromData) {
207
+ if(!fromData[json.id].loading){
238
208
  this.formData.tableBody = fromData[json.id].tableBody;
239
209
  this.formData.total = fromData[json.id].total;
240
- } else {
210
+ }else {
241
211
  this.formData.tableBody = null;
242
212
  this.formData.total = 0;
243
213
  }
244
214
  }
245
215
  };
246
216
  Node.prototype.setTablePagination = function (json) {
247
- if (!Store.get('FORM:tableData')) {
217
+ if(!Store.get('FORM:tableData')){
248
218
  Store.set('FORM:tableData', {
249
219
  data: {
250
220
  tableNodes: {},
@@ -256,22 +226,26 @@ var Node = /** @class */ (function (_super) {
256
226
  const tableData = Store.get('FORM:tableData').data;
257
227
  const fromData = Store.get('SYNC:tableData');
258
228
  const tnode = fromData ? fromData[json.paginationData.bindFromTableId] : null;
259
- if (tnode) json.paginationData.total = tnode.total;
229
+ if(tnode) json.paginationData.total = tnode.total;
260
230
  tableData.paginationNodes[json.id] = json;
261
231
  Store.set('FORM:tableData', {
262
232
  data: tableData
263
233
  })
264
234
  };
265
- Node.prototype.addToDiv = function () {
266
- if (this.iframe ||
267
- this.elementId ||
268
- this.hasGif()) {
235
+ Node.prototype.addToDiv = function (type) {
236
+ if (this.audio ||
237
+ this.video ||
238
+ this.iframe ||
239
+ this.elementId ||
240
+ this.hasGif()) {
241
+ if(type) {
242
+ // 复合Echarts初始化
243
+ createChildrenDivByElementId(this);
244
+ }else {
269
245
  Store.set(this.generateStoreKey('LT:addDiv'), this);
246
+ }
270
247
  }
271
248
  };
272
- Node.prototype.createOverflow = function () {
273
- Store.set(this.generateStoreKey('LT:createOverflow'), this);
274
- };
275
249
  Node.prototype.hasGif = function () {
276
250
  if (this.gif) {
277
251
  return true;
@@ -299,7 +273,6 @@ var Node = /** @class */ (function (_super) {
299
273
  this.children = [];
300
274
  for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
301
275
  var item = children_1[_i];
302
- item.visible = this.visible;
303
276
  var child = void 0;
304
277
  switch (item.type) {
305
278
  case PenType.Line:
@@ -344,13 +317,13 @@ var Node = /** @class */ (function (_super) {
344
317
  this.drawBkRadialGradient(ctx);
345
318
  break;
346
319
  }
347
- if (this.name === 'tablePagination') defaultText(ctx, this);
320
+ if(this.name === 'tablePagination') defaultText(ctx, this);
348
321
  // Draw shape.
349
322
  drawNodeFns[this.name](ctx, this);
350
323
  // Draw text.
351
- if (this.name === 'formTable') {
324
+ if(this.name === 'formTable') {
352
325
  tableText(ctx, this);
353
- } else {
326
+ }else {
354
327
  if (this.name !== 'text' && this.text && !(this.image && this.floorImageIndex === true)) {
355
328
  text(ctx, this);
356
329
  }
@@ -432,10 +405,9 @@ var Node = /** @class */ (function (_super) {
432
405
  //this.drawImg(ctx);
433
406
  return;
434
407
  }
435
- const defaultImageNode = defaultImages[this.id];
436
408
  var img = new Image();
437
409
  img.crossOrigin = 'anonymous';
438
- img.src = defaultImageNode && defaultImageNode.status === 404 ? '' : this.image;
410
+ img.src = this.image;
439
411
  img.onload = function (e) {
440
412
  _this.lastImage = _this.image;
441
413
  _this.imgNaturalWidth = img.naturalWidth;
@@ -445,22 +417,14 @@ var Node = /** @class */ (function (_super) {
445
417
  img: img,
446
418
  cnt: 1,
447
419
  };
448
- if (defaultImageNode) delete defaultImages[_this.id];
449
420
  Store.set(_this.generateStoreKey('LT:imageLoaded'), true);
450
421
  if (!_this.gif && gif) {
451
422
  _this.gif = true;
452
423
  Store.set(_this.generateStoreKey('LT:addDiv'), _this);
453
424
  }
454
425
  };
455
- img.onerror = function (e) {
456
- // 图片加载失败时预留默认图为空
457
- defaultImages[_this.id] = {
458
- img: '',
459
- status: 404
460
- };
461
- };
462
426
  };
463
- Node.prototype.initDrawImg = function (ctx) {
427
+ Node.prototype.initDrawImg = function (ctx){
464
428
  var _this = this;
465
429
  ctx.save();
466
430
  ctx.shadowColor = '';
@@ -518,7 +482,7 @@ var Node = /** @class */ (function (_super) {
518
482
  y = rect.ey - h;
519
483
  break;
520
484
  }
521
- if (!_this.activeImgeIndex) ctx.drawImage(this.img, x, y, w, h);
485
+ if(!_this.activeImgeIndex) ctx.drawImage(this.img, x, y, w, h);
522
486
  ctx.restore();
523
487
  };
524
488
  Node.prototype.calcAnchors = function () {
@@ -563,21 +527,21 @@ var Node = /** @class */ (function (_super) {
563
527
  var parentW = parent.rect.width - parent.paddingLeftNum - parent.paddingRightNum;
564
528
  var parentH = parent.rect.height - parent.paddingTopNum - parent.paddingBottomNum;
565
529
  var x = parent.rect.x +
566
- parent.paddingLeftNum +
567
- abs(parentW, this.rectInParent.x) +
568
- abs(parentW, this.rectInParent.marginLeft);
530
+ parent.paddingLeftNum +
531
+ abs(parentW, this.rectInParent.x) +
532
+ abs(parentW, this.rectInParent.marginLeft);
569
533
  var y = parent.rect.y +
570
- parent.paddingTopNum +
571
- abs(parentH, this.rectInParent.y) +
572
- abs(parentW, this.rectInParent.marginTop);
534
+ parent.paddingTopNum +
535
+ abs(parentH, this.rectInParent.y) +
536
+ abs(parentW, this.rectInParent.marginTop);
573
537
  var w = abs(parentW, this.rectInParent.width);
574
538
  var h = abs(parentH, this.rectInParent.height);
575
539
  if (this.rectInParent.marginLeft === undefined &&
576
- this.rectInParent.marginRight) {
540
+ this.rectInParent.marginRight) {
577
541
  x -= abs(parentW, this.rectInParent.marginRight);
578
542
  }
579
543
  if (this.rectInParent.marginTop === undefined &&
580
- this.rectInParent.marginBottom) {
544
+ this.rectInParent.marginBottom) {
581
545
  y -= abs(parentW, this.rectInParent.marginBottom);
582
546
  }
583
547
  this.rect = new Rect(x, y, w, h);
@@ -608,15 +572,15 @@ var Node = /** @class */ (function (_super) {
608
572
  var parentH = parent.rect.height - parent.paddingTopNum - parent.paddingBottomNum;
609
573
  this.rectInParent = {
610
574
  x: ((this.rect.x - parent.rect.x - parent.paddingLeftNum) * 100) /
611
- parentW +
612
- '%',
575
+ parentW +
576
+ '%',
613
577
  y: ((this.rect.y - parent.rect.y - parent.paddingTopNum) * 100) / parentH +
614
- '%',
578
+ '%',
615
579
  width: (this.rect.width * 100) / parentW + '%',
616
580
  height: (this.rect.height * 100) / parentH + '%',
617
581
  rotate: this.rectInParent
618
- ? this.rectInParent.rotate || 0
619
- : this.rotate || 0,
582
+ ? this.rectInParent.rotate || 0
583
+ : this.rotate || 0,
620
584
  rect: this.rect.clone(),
621
585
  };
622
586
  };
@@ -637,7 +601,7 @@ var Node = /** @class */ (function (_super) {
637
601
  var timeline = now - this.animateStart;
638
602
  if (timeline > this.animateDuration) {
639
603
  if (++this.animateCycleIndex >= this.animateCycle &&
640
- this.animateCycle > 0) {
604
+ this.animateCycle > 0) {
641
605
  this.animateStart = 0;
642
606
  this.animateCycleIndex = 0;
643
607
  var item = this.animateFrames[this.animateFrames.length - 1];
@@ -645,8 +609,8 @@ var Node = /** @class */ (function (_super) {
645
609
  this.dash = item.state.dash;
646
610
  this.strokeStyle = item.state.strokeStyle;
647
611
  this.fillStyle = item.state.fillStyle;
648
- //this.text = item.state.text;
649
- //this.font = item.state.font;
612
+ this.text = item.state.text;
613
+ this.font = item.state.font;
650
614
  this.lineWidth = item.state.lineWidth;
651
615
  this.rotate = item.state.rotate;
652
616
  this.globalAlpha = item.state.globalAlpha;
@@ -672,83 +636,72 @@ var Node = /** @class */ (function (_super) {
672
636
  this.dash = item.state.dash;
673
637
  this.strokeStyle = item.state.strokeStyle;
674
638
  this.fillStyle = item.state.fillStyle;
675
- //this.text = item.state.text;
676
- //this.font = item.state.font;
639
+ this.text = item.state.text;
640
+ this.font = item.state.font;
677
641
  var rate = (timeline - item.start) / item.duration;
678
642
  if (item.linear) {
679
643
  // 线条左右流动动画
680
- if ([animateType.LeftFlow, animateType.RightFlow].includes(this.animateType) && item.state.lineDashOffset) {
681
- let o = item.state.lineDashOffset;
682
- switch (this.animateType) {
683
- case animateType.LeftFlow:
684
- o = Math.abs(o)
685
- if (o > 100) o = 1;
686
- o++
687
-
688
- break;
689
- case animateType.RightFlow:
690
- o = Math.abs(o) * -1
691
- if (o < -100) o = -1;
692
- o--
693
- break;
694
- }
695
- item.state.lineDashOffset = o
644
+ if([animateType.LeftFlow, animateType.RightFlow].includes(this.animateType) && item.state.lineDashOffset){
645
+ const lineDashOffset = item.state.lineDashOffset;
646
+ if (lineDashOffset > 100) item.state.lineDashOffset = 1;
647
+ if (lineDashOffset < -100) item.state.lineDashOffset = -1;
648
+ lineDashOffset > 0 ? item.state.lineDashOffset++ : item.state.lineDashOffset--;
696
649
  this.lineDashOffset = item.state.lineDashOffset;
697
- } else if (([animateType.Show, animateType.Rotate].includes(this.animateType) || this.name === 'electricFan') && item.state.rotate !== item.initState.rotate) {
650
+ }else if(([animateType.Show, animateType.Rotate].includes(this.animateType) || this.name === 'electricFan') && item.state.rotate !== item.initState.rotate) {
698
651
  // 旋转动画,判断逻辑先这么写,日后将所有动画统一在编辑器中配置,再做优化
699
652
  this.rotate =
700
- item.initState.rotate +
701
- (item.state.rotate - item.initState.rotate) * rate;
653
+ item.initState.rotate +
654
+ (item.state.rotate - item.initState.rotate) * rate;
702
655
  rectChanged = true;
703
- } else {
656
+ }else {
704
657
 
705
658
  if (item.state.rect.x !== item.initState.rect.x) {
706
659
  this.rect.x =
707
- item.initState.rect.x +
708
- (item.state.rect.x - item.initState.rect.x) * rate;
660
+ item.initState.rect.x +
661
+ (item.state.rect.x - item.initState.rect.x) * rate;
709
662
  rectChanged = true;
710
663
  }
711
664
  if (item.state.rect.y !== item.initState.rect.y) {
712
665
  this.rect.y =
713
- item.initState.rect.y +
714
- (item.state.rect.y - item.initState.rect.y) * rate;
666
+ item.initState.rect.y +
667
+ (item.state.rect.y - item.initState.rect.y) * rate;
715
668
  rectChanged = true;
716
669
  }
717
670
  if (item.state.rect.width !== item.initState.rect.width) {
718
671
  this.rect.width =
719
- item.initState.rect.width +
720
- (item.state.rect.width - item.initState.rect.width) * rate;
672
+ item.initState.rect.width +
673
+ (item.state.rect.width - item.initState.rect.width) * rate;
721
674
  rectChanged = true;
722
675
  }
723
676
  if (item.state.rect.height !== item.initState.rect.height) {
724
677
  this.rect.height =
725
- item.initState.rect.height +
726
- (item.state.rect.height - item.initState.rect.height) * rate;
678
+ item.initState.rect.height +
679
+ (item.state.rect.height - item.initState.rect.height) * rate;
727
680
  rectChanged = true;
728
681
  }
729
682
  this.rect.ex = this.rect.x + this.rect.width;
730
683
  this.rect.ey = this.rect.y + this.rect.height;
731
684
  this.rect.calcCenter();
732
685
  if (item.initState.z !== undefined &&
733
- item.state.z !== item.initState.z) {
686
+ item.state.z !== item.initState.z) {
734
687
  this.z =
735
- item.initState.z + (item.state.z - item.initState.z) * rate;
688
+ item.initState.z + (item.state.z - item.initState.z) * rate;
736
689
  rectChanged = true;
737
690
  }
738
691
  if (item.state.borderRadius !== item.initState.borderRadius) {
739
692
  this.borderRadius =
740
- item.initState.borderRadius +
741
- (item.state.borderRadius - item.initState.borderRadius) * rate;
693
+ item.initState.borderRadius +
694
+ (item.state.borderRadius - item.initState.borderRadius) * rate;
742
695
  }
743
696
  if (item.state.lineWidth !== item.initState.lineWidth) {
744
697
  this.lineWidth =
745
- item.initState.lineWidth +
746
- (item.state.lineWidth - item.initState.lineWidth) * rate;
698
+ item.initState.lineWidth +
699
+ (item.state.lineWidth - item.initState.lineWidth) * rate;
747
700
  }
748
701
  if (item.state.globalAlpha !== item.initState.globalAlpha) {
749
702
  this.globalAlpha =
750
- item.initState.globalAlpha +
751
- (item.state.globalAlpha - item.initState.globalAlpha) * rate;
703
+ item.initState.globalAlpha +
704
+ (item.state.globalAlpha - item.initState.globalAlpha) * rate;
752
705
  }
753
706
  }
754
707
  }
@@ -779,29 +732,28 @@ var Node = /** @class */ (function (_super) {
779
732
  h = scale;
780
733
  }
781
734
  this['oldRect'] = this.rect.clone();
782
- if (this.rect.circles) {
783
- for (let c = 0, circles = this.rect.circles; c < circles.length; c++) {
784
- circles[c].x = center.x - (center.x - circles[c].x) * w;
785
- circles[c].y = center.y - (center.y - circles[c].y) * h;
735
+ if(this.rect.circles) {
736
+ for(let c=0, circles= this.rect.circles; c<circles.length; c++) {
737
+ circles[c].x = (center.x - (center.x - circles[c].x)) * w;
738
+ circles[c].y = (center.y - (center.y - circles[c].y)) * h + 15;
786
739
  }
740
+ }else {
741
+ this.rect.x = center.x - (center.x - this.rect.x) * w;
742
+ if(this.rotate % 180) {
743
+ this.rect.x = this.rect.x + (this.rect.width * w - this.rect.width * h) / 2;
744
+ }
745
+ this.rect.y = center.y - (center.y - this.rect.y) * h;
787
746
  }
788
- this.rect.x = center.x - (center.x - this.rect.x) * w;
789
- if (this.rotate % 180) {
790
- this.rect.x = this.rect.x + (this.rect.width * w - this.rect.width * h) / 2;
791
- }
792
- this.rect.y = center.y - (center.y - this.rect.y) * h;
747
+ this.z *= scale;
793
748
  this.rect.width *= this.rotate % 180 ? h : w;
794
749
  this.rect.height *= h;
795
750
  this.rect.ex = this.rect.x + this.rect.width;
796
751
  this.rect.ey = this.rect.y + this.rect.height;
797
- this.z *= scale;
798
- if (!(center.type && center.type === 'bottLogo')) {
799
- if (this.imageWidth) {
800
- this.imageWidth *= w;
801
- }
802
- if (this.imageHeight) {
803
- this.imageHeight *= h;
804
- }
752
+ if (this.imageWidth) {
753
+ this.imageWidth *= w;
754
+ }
755
+ if (this.imageHeight) {
756
+ this.imageHeight *= h;
805
757
  }
806
758
  this.lastImage = null;
807
759
  this.font.fontSize *= scale;
@@ -899,12 +851,6 @@ var Node = /** @class */ (function (_super) {
899
851
  }
900
852
  };
901
853
  Node.prototype.translate = function (x, y) {
902
- if (this.rect.circles) {
903
- for (let c = 0, circles = this.rect.circles; c < circles.length; c++) {
904
- circles[c].x += x;
905
- circles[c].y += y;
906
- }
907
- }
908
854
  this.rect.x += x;
909
855
  this.rect.y += y;
910
856
  this.rect.ex = this.rect.x + this.rect.width;
@@ -957,7 +903,7 @@ var Node = /** @class */ (function (_super) {
957
903
  return n;
958
904
  };
959
905
  //新增属性
960
- Node.prototype.area = function (pts) {
906
+ Node.prototype.area = function(pts) {
961
907
  var area = 0;
962
908
  var pts = pts;
963
909
  var nPts = pts.length;
@@ -973,7 +919,7 @@ var Node = /** @class */ (function (_super) {
973
919
  area /= 2;
974
920
  return area;
975
921
  };
976
- Node.prototype.centroid = function (pts) {
922
+ Node.prototype.centroid = function(pts) {
977
923
  var pts = pts;
978
924
  var nPts = pts.length;
979
925
  var x = 0;