liteflow-editor-process 1.0.0

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 (281) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1020 -0
  3. package/dist/LiteFlowEditor/assets/and-icon.svg +20 -0
  4. package/dist/LiteFlowEditor/assets/catch-icon.svg +14 -0
  5. package/dist/LiteFlowEditor/assets/chain-icon.svg +11 -0
  6. package/dist/LiteFlowEditor/assets/common-icon.svg +18 -0
  7. package/dist/LiteFlowEditor/assets/end-icon.svg +14 -0
  8. package/dist/LiteFlowEditor/assets/for-icon.svg +20 -0
  9. package/dist/LiteFlowEditor/assets/if-icon.svg +14 -0
  10. package/dist/LiteFlowEditor/assets/indicator-icons.svg +16 -0
  11. package/dist/LiteFlowEditor/assets/intermediate-end-icon.svg +20 -0
  12. package/dist/LiteFlowEditor/assets/intermediate-event-catch-error.svg +40 -0
  13. package/dist/LiteFlowEditor/assets/iterator-icon.svg +7 -0
  14. package/dist/LiteFlowEditor/assets/little-warning-icon.svg +1 -0
  15. package/dist/LiteFlowEditor/assets/not-icon.svg +20 -0
  16. package/dist/LiteFlowEditor/assets/or-icon.svg +20 -0
  17. package/dist/LiteFlowEditor/assets/start-icon.svg +16 -0
  18. package/dist/LiteFlowEditor/assets/switch-icon.svg +15 -0
  19. package/dist/LiteFlowEditor/assets/then-icon.svg +23 -0
  20. package/dist/LiteFlowEditor/assets/virtual-icon.svg +21 -0
  21. package/dist/LiteFlowEditor/assets/warning-icon.svg +1 -0
  22. package/dist/LiteFlowEditor/assets/when-icon.svg +21 -0
  23. package/dist/LiteFlowEditor/assets/while-icon.svg +24 -0
  24. package/dist/LiteFlowEditor/cells/and.d.ts +2 -0
  25. package/dist/LiteFlowEditor/cells/and.js +8 -0
  26. package/dist/LiteFlowEditor/cells/catch.d.ts +2 -0
  27. package/dist/LiteFlowEditor/cells/catch.js +8 -0
  28. package/dist/LiteFlowEditor/cells/chain.d.ts +2 -0
  29. package/dist/LiteFlowEditor/cells/chain.js +8 -0
  30. package/dist/LiteFlowEditor/cells/common.d.ts +2 -0
  31. package/dist/LiteFlowEditor/cells/common.js +8 -0
  32. package/dist/LiteFlowEditor/cells/end.d.ts +2 -0
  33. package/dist/LiteFlowEditor/cells/end.js +11 -0
  34. package/dist/LiteFlowEditor/cells/for.d.ts +2 -0
  35. package/dist/LiteFlowEditor/cells/for.js +8 -0
  36. package/dist/LiteFlowEditor/cells/if.d.ts +2 -0
  37. package/dist/LiteFlowEditor/cells/if.js +9 -0
  38. package/dist/LiteFlowEditor/cells/index.d.ts +25 -0
  39. package/dist/LiteFlowEditor/cells/index.js +219 -0
  40. package/dist/LiteFlowEditor/cells/intermediate-end.d.ts +2 -0
  41. package/dist/LiteFlowEditor/cells/intermediate-end.js +11 -0
  42. package/dist/LiteFlowEditor/cells/iterator.d.ts +2 -0
  43. package/dist/LiteFlowEditor/cells/iterator.js +8 -0
  44. package/dist/LiteFlowEditor/cells/not.d.ts +2 -0
  45. package/dist/LiteFlowEditor/cells/not.js +8 -0
  46. package/dist/LiteFlowEditor/cells/or.d.ts +2 -0
  47. package/dist/LiteFlowEditor/cells/or.js +8 -0
  48. package/dist/LiteFlowEditor/cells/start.d.ts +2 -0
  49. package/dist/LiteFlowEditor/cells/start.js +11 -0
  50. package/dist/LiteFlowEditor/cells/switch.d.ts +2 -0
  51. package/dist/LiteFlowEditor/cells/switch.js +9 -0
  52. package/dist/LiteFlowEditor/cells/then.d.ts +2 -0
  53. package/dist/LiteFlowEditor/cells/then.js +11 -0
  54. package/dist/LiteFlowEditor/cells/virtual.d.ts +2 -0
  55. package/dist/LiteFlowEditor/cells/virtual.js +8 -0
  56. package/dist/LiteFlowEditor/cells/when.d.ts +2 -0
  57. package/dist/LiteFlowEditor/cells/when.js +11 -0
  58. package/dist/LiteFlowEditor/cells/while.d.ts +2 -0
  59. package/dist/LiteFlowEditor/cells/while.js +8 -0
  60. package/dist/LiteFlowEditor/common/anchor.d.ts +2 -0
  61. package/dist/LiteFlowEditor/common/anchor.js +10 -0
  62. package/dist/LiteFlowEditor/common/connector.d.ts +2 -0
  63. package/dist/LiteFlowEditor/common/connector.js +20 -0
  64. package/dist/LiteFlowEditor/common/edge.d.ts +61 -0
  65. package/dist/LiteFlowEditor/common/edge.js +57 -0
  66. package/dist/LiteFlowEditor/common/events.d.ts +4 -0
  67. package/dist/LiteFlowEditor/common/events.js +97 -0
  68. package/dist/LiteFlowEditor/common/index.d.ts +4 -0
  69. package/dist/LiteFlowEditor/common/index.js +11 -0
  70. package/dist/LiteFlowEditor/common/layout.d.ts +12 -0
  71. package/dist/LiteFlowEditor/common/layout.js +308 -0
  72. package/dist/LiteFlowEditor/common/router.d.ts +2 -0
  73. package/dist/LiteFlowEditor/common/router.js +40 -0
  74. package/dist/LiteFlowEditor/common/shortcuts.d.ts +10 -0
  75. package/dist/LiteFlowEditor/common/shortcuts.js +183 -0
  76. package/dist/LiteFlowEditor/components/NodeBadge/index.d.ts +6 -0
  77. package/dist/LiteFlowEditor/components/NodeBadge/index.js +24 -0
  78. package/dist/LiteFlowEditor/components/NodeBadge/index.module.less +10 -0
  79. package/dist/LiteFlowEditor/components/NodeToolBar/index.d.ts +6 -0
  80. package/dist/LiteFlowEditor/components/NodeToolBar/index.js +121 -0
  81. package/dist/LiteFlowEditor/components/NodeToolBar/index.module.less +133 -0
  82. package/dist/LiteFlowEditor/components/NodeView/index.d.ts +7 -0
  83. package/dist/LiteFlowEditor/components/NodeView/index.js +14 -0
  84. package/dist/LiteFlowEditor/components/NodeView/index.module.less +14 -0
  85. package/dist/LiteFlowEditor/components/index.d.ts +3 -0
  86. package/dist/LiteFlowEditor/components/index.js +3 -0
  87. package/dist/LiteFlowEditor/constant/index.d.ts +79 -0
  88. package/dist/LiteFlowEditor/constant/index.js +215 -0
  89. package/dist/LiteFlowEditor/context/GraphContext.d.ts +13 -0
  90. package/dist/LiteFlowEditor/context/GraphContext.js +10 -0
  91. package/dist/LiteFlowEditor/context/ScriptContext.d.ts +37 -0
  92. package/dist/LiteFlowEditor/context/ScriptContext.js +15 -0
  93. package/dist/LiteFlowEditor/hooks/index.d.ts +5 -0
  94. package/dist/LiteFlowEditor/hooks/index.js +5 -0
  95. package/dist/LiteFlowEditor/hooks/useClickAway.d.ts +5 -0
  96. package/dist/LiteFlowEditor/hooks/useClickAway.js +38 -0
  97. package/dist/LiteFlowEditor/hooks/useGraph.d.ts +1 -0
  98. package/dist/LiteFlowEditor/hooks/useGraph.js +7 -0
  99. package/dist/LiteFlowEditor/hooks/useGraphWrapper.d.ts +2 -0
  100. package/dist/LiteFlowEditor/hooks/useGraphWrapper.js +7 -0
  101. package/dist/LiteFlowEditor/hooks/useHistory.d.ts +2 -0
  102. package/dist/LiteFlowEditor/hooks/useHistory.js +69 -0
  103. package/dist/LiteFlowEditor/hooks/useModel.d.ts +3 -0
  104. package/dist/LiteFlowEditor/hooks/useModel.js +7 -0
  105. package/dist/LiteFlowEditor/hooks/useUpdateEffect.d.ts +7 -0
  106. package/dist/LiteFlowEditor/hooks/useUpdateEffect.js +17 -0
  107. package/dist/LiteFlowEditor/i18n/en_US/translation.json +138 -0
  108. package/dist/LiteFlowEditor/i18n/index.d.ts +2 -0
  109. package/dist/LiteFlowEditor/i18n/index.js +28 -0
  110. package/dist/LiteFlowEditor/i18n/zh_CN/translation.json +139 -0
  111. package/dist/LiteFlowEditor/i18n/zh_TW/translation.json +139 -0
  112. package/dist/LiteFlowEditor/index.d.ts +37 -0
  113. package/dist/LiteFlowEditor/index.js +299 -0
  114. package/dist/LiteFlowEditor/index.module.less +127 -0
  115. package/dist/LiteFlowEditor/mock/index.d.ts +2 -0
  116. package/dist/LiteFlowEditor/mock/index.js +272 -0
  117. package/dist/LiteFlowEditor/model/builder.d.ts +43 -0
  118. package/dist/LiteFlowEditor/model/builder.js +239 -0
  119. package/dist/LiteFlowEditor/model/chain.d.ts +83 -0
  120. package/dist/LiteFlowEditor/model/chain.js +278 -0
  121. package/dist/LiteFlowEditor/model/el/and-operator.d.ts +53 -0
  122. package/dist/LiteFlowEditor/model/el/and-operator.js +178 -0
  123. package/dist/LiteFlowEditor/model/el/catch-operator.d.ts +81 -0
  124. package/dist/LiteFlowEditor/model/el/catch-operator.js +338 -0
  125. package/dist/LiteFlowEditor/model/el/chain-operator.d.ts +53 -0
  126. package/dist/LiteFlowEditor/model/el/chain-operator.js +170 -0
  127. package/dist/LiteFlowEditor/model/el/for-operator.d.ts +56 -0
  128. package/dist/LiteFlowEditor/model/el/for-operator.js +171 -0
  129. package/dist/LiteFlowEditor/model/el/if-operator.d.ts +64 -0
  130. package/dist/LiteFlowEditor/model/el/if-operator.js +265 -0
  131. package/dist/LiteFlowEditor/model/el/index.d.ts +40 -0
  132. package/dist/LiteFlowEditor/model/el/index.js +47 -0
  133. package/dist/LiteFlowEditor/model/el/iterator-operator.d.ts +56 -0
  134. package/dist/LiteFlowEditor/model/el/iterator-operator.js +183 -0
  135. package/dist/LiteFlowEditor/model/el/node-operator.d.ts +62 -0
  136. package/dist/LiteFlowEditor/model/el/node-operator.js +136 -0
  137. package/dist/LiteFlowEditor/model/el/not-operator.d.ts +68 -0
  138. package/dist/LiteFlowEditor/model/el/not-operator.js +231 -0
  139. package/dist/LiteFlowEditor/model/el/or-operator.d.ts +53 -0
  140. package/dist/LiteFlowEditor/model/el/or-operator.js +178 -0
  141. package/dist/LiteFlowEditor/model/el/switch-operator.d.ts +56 -0
  142. package/dist/LiteFlowEditor/model/el/switch-operator.js +173 -0
  143. package/dist/LiteFlowEditor/model/el/then-operator.d.ts +66 -0
  144. package/dist/LiteFlowEditor/model/el/then-operator.js +159 -0
  145. package/dist/LiteFlowEditor/model/el/when-operator.d.ts +58 -0
  146. package/dist/LiteFlowEditor/model/el/when-operator.js +181 -0
  147. package/dist/LiteFlowEditor/model/el/while-operator.d.ts +56 -0
  148. package/dist/LiteFlowEditor/model/el/while-operator.js +171 -0
  149. package/dist/LiteFlowEditor/model/node.d.ts +182 -0
  150. package/dist/LiteFlowEditor/model/node.js +463 -0
  151. package/dist/LiteFlowEditor/model/utils/createTag.d.ts +1 -0
  152. package/dist/LiteFlowEditor/model/utils/createTag.js +5 -0
  153. package/dist/LiteFlowEditor/model/utils/end.d.ts +87 -0
  154. package/dist/LiteFlowEditor/model/utils/end.js +185 -0
  155. package/dist/LiteFlowEditor/model/utils/index.d.ts +7 -0
  156. package/dist/LiteFlowEditor/model/utils/index.js +10 -0
  157. package/dist/LiteFlowEditor/model/utils/start.d.ts +87 -0
  158. package/dist/LiteFlowEditor/model/utils/start.js +185 -0
  159. package/dist/LiteFlowEditor/model/utils/virtual.d.ts +78 -0
  160. package/dist/LiteFlowEditor/model/utils/virtual.js +167 -0
  161. package/dist/LiteFlowEditor/model-checker/checkers/AnalysisNodeChecker.d.ts +7 -0
  162. package/dist/LiteFlowEditor/model-checker/checkers/AnalysisNodeChecker.js +44 -0
  163. package/dist/LiteFlowEditor/model-checker/checkers/CurScheduleSetChecker.d.ts +7 -0
  164. package/dist/LiteFlowEditor/model-checker/checkers/CurScheduleSetChecker.js +26 -0
  165. package/dist/LiteFlowEditor/model-checker/checkers/InputListChecker.d.ts +7 -0
  166. package/dist/LiteFlowEditor/model-checker/checkers/InputListChecker.js +39 -0
  167. package/dist/LiteFlowEditor/model-checker/checkers/InputListValueChecker.d.ts +7 -0
  168. package/dist/LiteFlowEditor/model-checker/checkers/InputListValueChecker.js +154 -0
  169. package/dist/LiteFlowEditor/model-checker/checkers/IteratorBindChecker.d.ts +7 -0
  170. package/dist/LiteFlowEditor/model-checker/checkers/IteratorBindChecker.js +27 -0
  171. package/dist/LiteFlowEditor/model-checker/checkers/QueryDimensionChecker.d.ts +7 -0
  172. package/dist/LiteFlowEditor/model-checker/checkers/QueryDimensionChecker.js +33 -0
  173. package/dist/LiteFlowEditor/model-checker/checkers/QueryLogChecker.d.ts +7 -0
  174. package/dist/LiteFlowEditor/model-checker/checkers/QueryLogChecker.js +27 -0
  175. package/dist/LiteFlowEditor/model-checker/checkers/ReportTemplateChecker.d.ts +7 -0
  176. package/dist/LiteFlowEditor/model-checker/checkers/ReportTemplateChecker.js +27 -0
  177. package/dist/LiteFlowEditor/model-checker/checkers/UnconfiguredComponentChecker.d.ts +7 -0
  178. package/dist/LiteFlowEditor/model-checker/checkers/UnconfiguredComponentChecker.js +27 -0
  179. package/dist/LiteFlowEditor/model-checker/checkers/index.d.ts +14 -0
  180. package/dist/LiteFlowEditor/model-checker/checkers/index.js +38 -0
  181. package/dist/LiteFlowEditor/model-checker/index.d.ts +22 -0
  182. package/dist/LiteFlowEditor/model-checker/index.js +43 -0
  183. package/dist/LiteFlowEditor/model-checker/types.d.ts +11 -0
  184. package/dist/LiteFlowEditor/model-checker/types.js +1 -0
  185. package/dist/LiteFlowEditor/panels/breadcrumb/index.d.ts +7 -0
  186. package/dist/LiteFlowEditor/panels/breadcrumb/index.js +67 -0
  187. package/dist/LiteFlowEditor/panels/breadcrumb/index.module.less +23 -0
  188. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.d.ts +11 -0
  189. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.js +98 -0
  190. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.module.less +7 -0
  191. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/blank.d.ts +8 -0
  192. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/blank.js +18 -0
  193. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/index.d.ts +3 -0
  194. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/index.js +3 -0
  195. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/node.d.ts +9 -0
  196. package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/node.js +10 -0
  197. package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.d.ts +14 -0
  198. package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.js +108 -0
  199. package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.module.less +81 -0
  200. package/dist/LiteFlowEditor/panels/flowGraph/createFlowGraph.d.ts +3 -0
  201. package/dist/LiteFlowEditor/panels/flowGraph/createFlowGraph.js +199 -0
  202. package/dist/LiteFlowEditor/panels/flowGraph/miniMapSimpleNode/index.d.ts +7 -0
  203. package/dist/LiteFlowEditor/panels/flowGraph/miniMapSimpleNode/index.js +42 -0
  204. package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.d.ts +8 -0
  205. package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.js +110 -0
  206. package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.module.less +11 -0
  207. package/dist/LiteFlowEditor/panels/layout/index.d.ts +16 -0
  208. package/dist/LiteFlowEditor/panels/layout/index.js +117 -0
  209. package/dist/LiteFlowEditor/panels/layout/index.module.less +30 -0
  210. package/dist/LiteFlowEditor/panels/settingBar/basic/index.d.ts +7 -0
  211. package/dist/LiteFlowEditor/panels/settingBar/basic/index.js +50 -0
  212. package/dist/LiteFlowEditor/panels/settingBar/basic/index.module.less +17 -0
  213. package/dist/LiteFlowEditor/panels/settingBar/index.d.ts +7 -0
  214. package/dist/LiteFlowEditor/panels/settingBar/index.js +219 -0
  215. package/dist/LiteFlowEditor/panels/settingBar/index.module.less +45 -0
  216. package/dist/LiteFlowEditor/panels/settingBar/outline/index.d.ts +7 -0
  217. package/dist/LiteFlowEditor/panels/settingBar/outline/index.js +124 -0
  218. package/dist/LiteFlowEditor/panels/settingBar/outline/index.module.less +39 -0
  219. package/dist/LiteFlowEditor/panels/settingBar/parameters/index.d.ts +6 -0
  220. package/dist/LiteFlowEditor/panels/settingBar/parameters/index.js +415 -0
  221. package/dist/LiteFlowEditor/panels/settingBar/parameters/index.module.less +4 -0
  222. package/dist/LiteFlowEditor/panels/settingBar/properties/CustomDropdown.d.ts +13 -0
  223. package/dist/LiteFlowEditor/panels/settingBar/properties/CustomDropdown.js +62 -0
  224. package/dist/LiteFlowEditor/panels/settingBar/properties/DraggableWrapper.d.ts +48 -0
  225. package/dist/LiteFlowEditor/panels/settingBar/properties/DraggableWrapper.js +94 -0
  226. package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor-new.d.ts +33 -0
  227. package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor-new.js +433 -0
  228. package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor.d.ts +33 -0
  229. package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor.js +195 -0
  230. package/dist/LiteFlowEditor/panels/settingBar/properties/component.d.ts +10 -0
  231. package/dist/LiteFlowEditor/panels/settingBar/properties/component.js +2780 -0
  232. package/dist/LiteFlowEditor/panels/settingBar/properties/condition.d.ts +7 -0
  233. package/dist/LiteFlowEditor/panels/settingBar/properties/condition.js +54 -0
  234. package/dist/LiteFlowEditor/panels/settingBar/properties/index.d.ts +2 -0
  235. package/dist/LiteFlowEditor/panels/settingBar/properties/index.js +2 -0
  236. package/dist/LiteFlowEditor/panels/settingBar/properties/index.module.less +149 -0
  237. package/dist/LiteFlowEditor/panels/sideBar/index.d.ts +7 -0
  238. package/dist/LiteFlowEditor/panels/sideBar/index.js +153 -0
  239. package/dist/LiteFlowEditor/panels/sideBar/index.module.less +48 -0
  240. package/dist/LiteFlowEditor/panels/toolBar/index.d.ts +8 -0
  241. package/dist/LiteFlowEditor/panels/toolBar/index.js +42 -0
  242. package/dist/LiteFlowEditor/panels/toolBar/index.module.less +19 -0
  243. package/dist/LiteFlowEditor/panels/toolBar/widgets/check.d.ts +7 -0
  244. package/dist/LiteFlowEditor/panels/toolBar/widgets/check.js +40 -0
  245. package/dist/LiteFlowEditor/panels/toolBar/widgets/common/badge.d.ts +12 -0
  246. package/dist/LiteFlowEditor/panels/toolBar/widgets/common/badge.js +46 -0
  247. package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeBtnWidget.d.ts +15 -0
  248. package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeBtnWidget.js +133 -0
  249. package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeDropdownWidget.d.ts +14 -0
  250. package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeDropdownWidget.js +38 -0
  251. package/dist/LiteFlowEditor/panels/toolBar/widgets/fitWindow.d.ts +7 -0
  252. package/dist/LiteFlowEditor/panels/toolBar/widgets/fitWindow.js +17 -0
  253. package/dist/LiteFlowEditor/panels/toolBar/widgets/fullscreen.d.ts +4 -0
  254. package/dist/LiteFlowEditor/panels/toolBar/widgets/fullscreen.js +104 -0
  255. package/dist/LiteFlowEditor/panels/toolBar/widgets/global.less +6 -0
  256. package/dist/LiteFlowEditor/panels/toolBar/widgets/index.d.ts +7 -0
  257. package/dist/LiteFlowEditor/panels/toolBar/widgets/index.js +12 -0
  258. package/dist/LiteFlowEditor/panels/toolBar/widgets/index.module.less +169 -0
  259. package/dist/LiteFlowEditor/panels/toolBar/widgets/mock.d.ts +7 -0
  260. package/dist/LiteFlowEditor/panels/toolBar/widgets/mock.js +83 -0
  261. package/dist/LiteFlowEditor/panels/toolBar/widgets/redo.d.ts +7 -0
  262. package/dist/LiteFlowEditor/panels/toolBar/widgets/redo.js +16 -0
  263. package/dist/LiteFlowEditor/panels/toolBar/widgets/save.d.ts +7 -0
  264. package/dist/LiteFlowEditor/panels/toolBar/widgets/save.js +12 -0
  265. package/dist/LiteFlowEditor/panels/toolBar/widgets/selection.d.ts +7 -0
  266. package/dist/LiteFlowEditor/panels/toolBar/widgets/selection.js +23 -0
  267. package/dist/LiteFlowEditor/panels/toolBar/widgets/undo.d.ts +7 -0
  268. package/dist/LiteFlowEditor/panels/toolBar/widgets/undo.js +16 -0
  269. package/dist/LiteFlowEditor/panels/toolBar/widgets/view.d.ts +7 -0
  270. package/dist/LiteFlowEditor/panels/toolBar/widgets/view.js +37 -0
  271. package/dist/LiteFlowEditor/panels/toolBar/widgets/zoom.d.ts +7 -0
  272. package/dist/LiteFlowEditor/panels/toolBar/widgets/zoom.js +67 -0
  273. package/dist/LiteFlowEditor/utils/eventBus.d.ts +34 -0
  274. package/dist/LiteFlowEditor/utils/eventBus.js +86 -0
  275. package/dist/LiteFlowEditor/utils/flowChartUtils.d.ts +9 -0
  276. package/dist/LiteFlowEditor/utils/flowChartUtils.js +34 -0
  277. package/dist/LiteFlowEditor/utils/index.d.ts +33 -0
  278. package/dist/LiteFlowEditor/utils/index.js +245 -0
  279. package/dist/index.d.ts +4 -0
  280. package/dist/index.js +4 -0
  281. package/package.json +97 -0
@@ -0,0 +1,53 @@
1
+ import { Cell, Node } from '@antv/x6';
2
+ import ELNode, { Properties } from '../node';
3
+ import { ConditionTypeEnum, NodeTypeEnum } from '../../constant';
4
+ /**
5
+ * 或操作符:OR。
6
+ *
7
+ * 例如一个或(OR)示例:
8
+ * (1) EL表达式语法:IF(OR(a, b)), c)
9
+ * (2) JSON表示形式:
10
+ * {
11
+ type: ConditionTypeEnum.IF,
12
+ condition: {
13
+ type: ConditionTypeEnum.OR,
14
+ children: [
15
+ { type: NodeTypeEnum.COMMON, id: 'a' },
16
+ { type: NodeTypeEnum.COMMON, id: 'b' }
17
+ ]
18
+ },
19
+ children: [
20
+ { type: NodeTypeEnum.COMMON, id: 'c' }
21
+ ],
22
+ }
23
+ * (3) 通过ELNode节点模型进行表示的组合关系为:
24
+ ┌─────────────────┐ ┌─────────────────┐
25
+ ┌──▶│ OrOperator │──┌──▶│ NodeOperator │
26
+ ┌─────────┐ ┌─────────────────┐ │ └─────────────────┘ │ └─────────────────┘
27
+ │ Chain │───▶│ IfOperator │──┤ ┌─────────────────┐ │ ┌─────────────────┐
28
+ └─────────┘ └─────────────────┘ └──▶│ NodeOperator │ └──▶│ NodeOperator │
29
+ └─────────────────┘ └─────────────────┘
30
+ */
31
+ export default class OrOperator extends ELNode {
32
+ type: ConditionTypeEnum;
33
+ parent?: ELNode;
34
+ children: ELNode[];
35
+ properties?: Properties;
36
+ startNode?: Node;
37
+ endNode?: Node;
38
+ constructor(parent?: ELNode, children?: ELNode[], properties?: Properties);
39
+ /**
40
+ * 创建新的节点
41
+ * @param parent 新节点的父节点
42
+ * @param type 新节点的子节点类型
43
+ */
44
+ static create(parent?: ELNode, type?: NodeTypeEnum): ELNode;
45
+ /**
46
+ * 转换为X6的图数据格式
47
+ */
48
+ toCells(options?: Record<string, any>): Cell[];
49
+ /**
50
+ * 转换为EL表达式字符串
51
+ */
52
+ toEL(prefix?: string): string;
53
+ }
@@ -0,0 +1,178 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
+ import { Node, Edge } from '@antv/x6';
9
+ import ELNode from "../node";
10
+ import { ELStartNode, ELEndNode } from "../utils";
11
+ import { ConditionTypeEnum, LITEFLOW_EDGE, NODE_TYPE_INTERMEDIATE_END } from "../../constant";
12
+ import NodeOperator from "./node-operator";
13
+
14
+ /**
15
+ * 或操作符:OR。
16
+ *
17
+ * 例如一个或(OR)示例:
18
+ * (1) EL表达式语法:IF(OR(a, b)), c)
19
+ * (2) JSON表示形式:
20
+ * {
21
+ type: ConditionTypeEnum.IF,
22
+ condition: {
23
+ type: ConditionTypeEnum.OR,
24
+ children: [
25
+ { type: NodeTypeEnum.COMMON, id: 'a' },
26
+ { type: NodeTypeEnum.COMMON, id: 'b' }
27
+ ]
28
+ },
29
+ children: [
30
+ { type: NodeTypeEnum.COMMON, id: 'c' }
31
+ ],
32
+ }
33
+ * (3) 通过ELNode节点模型进行表示的组合关系为:
34
+ ┌─────────────────┐ ┌─────────────────┐
35
+ ┌──▶│ OrOperator │──┌──▶│ NodeOperator │
36
+ ┌─────────┐ ┌─────────────────┐ │ └─────────────────┘ │ └─────────────────┘
37
+ │ Chain │───▶│ IfOperator │──┤ ┌─────────────────┐ │ ┌─────────────────┐
38
+ └─────────┘ └─────────────────┘ └──▶│ NodeOperator │ └──▶│ NodeOperator │
39
+ └─────────────────┘ └─────────────────┘
40
+ */
41
+ var OrOperator = /*#__PURE__*/function (_ELNode) {
42
+ _inherits(OrOperator, _ELNode);
43
+ var _super = _createSuper(OrOperator);
44
+ function OrOperator(parent, children, properties) {
45
+ var _this;
46
+ _classCallCheck(this, OrOperator);
47
+ _this = _super.call(this);
48
+ _defineProperty(_assertThisInitialized(_this), "type", ConditionTypeEnum.OR);
49
+ _defineProperty(_assertThisInitialized(_this), "parent", void 0);
50
+ _defineProperty(_assertThisInitialized(_this), "children", []);
51
+ _defineProperty(_assertThisInitialized(_this), "properties", void 0);
52
+ _defineProperty(_assertThisInitialized(_this), "startNode", void 0);
53
+ _defineProperty(_assertThisInitialized(_this), "endNode", void 0);
54
+ _this.parent = parent;
55
+ if (children) {
56
+ _this.children = children;
57
+ }
58
+ _this.properties = properties;
59
+ return _this;
60
+ }
61
+
62
+ /**
63
+ * 创建新的节点
64
+ * @param parent 新节点的父节点
65
+ * @param type 新节点的子节点类型
66
+ */
67
+ _createClass(OrOperator, [{
68
+ key: "toCells",
69
+ value:
70
+ /**
71
+ * 转换为X6的图数据格式
72
+ */
73
+ function toCells() {
74
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
75
+ this.resetCells();
76
+ var children = this.children,
77
+ cells = this.cells;
78
+ var start = Node.create(_objectSpread({
79
+ shape: ConditionTypeEnum.OR,
80
+ attrs: {
81
+ label: {
82
+ text: ''
83
+ }
84
+ }
85
+ }, options));
86
+ start.setData({
87
+ model: new ELStartNode(this),
88
+ toolbar: {
89
+ prepend: true,
90
+ append: true,
91
+ delete: true,
92
+ replace: true,
93
+ collapse: true
94
+ }
95
+ }, {
96
+ overwrite: true
97
+ });
98
+ cells.push(this.addNode(start));
99
+ this.startNode = start;
100
+ if (!this.collapsed) {
101
+ var end = Node.create({
102
+ shape: NODE_TYPE_INTERMEDIATE_END,
103
+ attrs: {
104
+ label: {
105
+ text: ''
106
+ }
107
+ }
108
+ });
109
+ end.setData({
110
+ model: new ELEndNode(this)
111
+ }, {
112
+ overwrite: true
113
+ });
114
+ cells.push(this.addNode(end));
115
+ this.endNode = end;
116
+ if (children.length) {
117
+ children.forEach(function (child) {
118
+ child.toCells();
119
+ var nextStartNode = child.getStartNode();
120
+ cells.push(Edge.create({
121
+ shape: LITEFLOW_EDGE,
122
+ source: start.id,
123
+ target: nextStartNode.id,
124
+ label: ' * ',
125
+ defaultLabel: {
126
+ position: {
127
+ options: {
128
+ keepGradient: false,
129
+ ensureLegibility: false
130
+ }
131
+ }
132
+ }
133
+ }));
134
+ var nextEndNode = child.getEndNode();
135
+ cells.push(Edge.create({
136
+ shape: LITEFLOW_EDGE,
137
+ source: nextEndNode.id,
138
+ target: end.id
139
+ }));
140
+ });
141
+ } else {
142
+ cells.push(Edge.create({
143
+ shape: LITEFLOW_EDGE,
144
+ source: start.id,
145
+ target: end.id
146
+ }));
147
+ }
148
+ }
149
+ return this.getCells();
150
+ }
151
+
152
+ /**
153
+ * 转换为EL表达式字符串
154
+ */
155
+ }, {
156
+ key: "toEL",
157
+ value: function toEL() {
158
+ var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
159
+ if (prefix) {
160
+ return "".concat(prefix, "OR(\n").concat(this.children.map(function (x) {
161
+ return x.toEL("".concat(prefix, " "));
162
+ }).join(', \n'), "\n").concat(prefix, ")").concat(this.propertiesToEL());
163
+ }
164
+ return "OR(".concat(this.children.map(function (x) {
165
+ return x.toEL();
166
+ }).join(', '), ")").concat(this.propertiesToEL());
167
+ }
168
+ }], [{
169
+ key: "create",
170
+ value: function create(parent, type) {
171
+ var newNode = new OrOperator(parent);
172
+ newNode.appendChild(NodeOperator.create(newNode, type));
173
+ return newNode;
174
+ }
175
+ }]);
176
+ return OrOperator;
177
+ }(ELNode);
178
+ export { OrOperator as default };
@@ -0,0 +1,56 @@
1
+ import { Cell, Node } from '@antv/x6';
2
+ import ELNode, { Properties } from '../node';
3
+ import { ConditionTypeEnum, NodeTypeEnum } from '../../constant';
4
+ /**
5
+ * 选择编排操作符:SWITCH。
6
+ *
7
+ * 例如一个选择编排(SWITCH)示例:
8
+ * (1) EL表达式语法:SWITCH(x).to(a, b, c)
9
+ * (2) JSON表示形式:
10
+ * {
11
+ type: ConditionTypeEnum.SWITCH,
12
+ condition: { type: NodeTypeEnum.SWITCH, id: 'x' },
13
+ children: [
14
+ { type: NodeTypeEnum.COMMON, id: 'a' },
15
+ { type: NodeTypeEnum.COMMON, id: 'b' },
16
+ { type: NodeTypeEnum.COMMON, id: 'c' },
17
+ ],
18
+ }
19
+ * (3) 通过ELNode节点模型进行表示的组合关系为:
20
+ ┌─────────────────┐
21
+ ┌──▶│ NodeOperator │
22
+ │ └─────────────────┘
23
+ │ ┌─────────────────┐
24
+ ├──▶│ NodeOperator │
25
+ ┌─────────┐ ┌─────────────────┐ │ └─────────────────┘
26
+ │ Chain │───▶│ SwitchOperator │──┤ ┌─────────────────┐
27
+ └─────────┘ └─────────────────┘ ├──▶│ NodeOperator │
28
+ │ └─────────────────┘
29
+ │ ┌─────────────────┐
30
+ └──▶│ NodeOperator │
31
+ └─────────────────┘
32
+ */
33
+ export default class SwitchOperator extends ELNode {
34
+ type: ConditionTypeEnum;
35
+ parent?: ELNode;
36
+ condition: ELNode;
37
+ children: ELNode[];
38
+ properties?: Properties;
39
+ startNode?: Node;
40
+ endNode?: Node;
41
+ constructor(parent?: ELNode, condition?: ELNode, children?: ELNode[], properties?: Properties);
42
+ /**
43
+ * 创建新的节点
44
+ * @param parent 新节点的父节点
45
+ * @param type 新节点的子节点类型
46
+ */
47
+ static create(parent?: ELNode, type?: NodeTypeEnum): ELNode;
48
+ /**
49
+ * 转换为X6的图数据格式
50
+ */
51
+ toCells(options?: Record<string, any>): Cell[];
52
+ /**
53
+ * 转换为EL表达式字符串
54
+ */
55
+ toEL(prefix?: string): string;
56
+ }
@@ -0,0 +1,173 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
+ import { Node, Edge } from '@antv/x6';
8
+ import ELNode from "../node";
9
+ import { ELEndNode, generateUniqueId } from "../utils";
10
+ import { ConditionTypeEnum, LITEFLOW_EDGE, NODE_TYPE_INTERMEDIATE_END, NodeTypeEnum } from "../../constant";
11
+ import NodeOperator from "./node-operator";
12
+
13
+ /**
14
+ * 选择编排操作符:SWITCH。
15
+ *
16
+ * 例如一个选择编排(SWITCH)示例:
17
+ * (1) EL表达式语法:SWITCH(x).to(a, b, c)
18
+ * (2) JSON表示形式:
19
+ * {
20
+ type: ConditionTypeEnum.SWITCH,
21
+ condition: { type: NodeTypeEnum.SWITCH, id: 'x' },
22
+ children: [
23
+ { type: NodeTypeEnum.COMMON, id: 'a' },
24
+ { type: NodeTypeEnum.COMMON, id: 'b' },
25
+ { type: NodeTypeEnum.COMMON, id: 'c' },
26
+ ],
27
+ }
28
+ * (3) 通过ELNode节点模型进行表示的组合关系为:
29
+ ┌─────────────────┐
30
+ ┌──▶│ NodeOperator │
31
+ │ └─────────────────┘
32
+ │ ┌─────────────────┐
33
+ ├──▶│ NodeOperator │
34
+ ┌─────────┐ ┌─────────────────┐ │ └─────────────────┘
35
+ │ Chain │───▶│ SwitchOperator │──┤ ┌─────────────────┐
36
+ └─────────┘ └─────────────────┘ ├──▶│ NodeOperator │
37
+ │ └─────────────────┘
38
+ │ ┌─────────────────┐
39
+ └──▶│ NodeOperator │
40
+ └─────────────────┘
41
+ */
42
+ var SwitchOperator = /*#__PURE__*/function (_ELNode) {
43
+ _inherits(SwitchOperator, _ELNode);
44
+ var _super = _createSuper(SwitchOperator);
45
+ function SwitchOperator(parent, condition, children, properties) {
46
+ var _this;
47
+ _classCallCheck(this, SwitchOperator);
48
+ _this = _super.call(this);
49
+ _defineProperty(_assertThisInitialized(_this), "type", ConditionTypeEnum.SWITCH);
50
+ _defineProperty(_assertThisInitialized(_this), "parent", void 0);
51
+ _defineProperty(_assertThisInitialized(_this), "condition", new NodeOperator(_assertThisInitialized(_this), NodeTypeEnum.SWITCH, 'x'));
52
+ _defineProperty(_assertThisInitialized(_this), "children", []);
53
+ _defineProperty(_assertThisInitialized(_this), "properties", void 0);
54
+ _defineProperty(_assertThisInitialized(_this), "startNode", void 0);
55
+ _defineProperty(_assertThisInitialized(_this), "endNode", void 0);
56
+ _this.parent = parent;
57
+ if (condition) {
58
+ _this.condition = condition;
59
+ }
60
+ if (children) {
61
+ _this.children = children;
62
+ }
63
+ _this.properties = properties;
64
+ return _this;
65
+ }
66
+
67
+ /**
68
+ * 创建新的节点
69
+ * @param parent 新节点的父节点
70
+ * @param type 新节点的子节点类型
71
+ */
72
+ _createClass(SwitchOperator, [{
73
+ key: "toCells",
74
+ value:
75
+ /**
76
+ * 转换为X6的图数据格式
77
+ */
78
+ function toCells() {
79
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
80
+ this.resetCells();
81
+ var condition = this.condition,
82
+ children = this.children,
83
+ cells = this.cells;
84
+ condition.toCells({
85
+ shape: NodeTypeEnum.SWITCH
86
+ });
87
+ var start = condition.getStartNode();
88
+ start.setData({
89
+ model: condition,
90
+ toolbar: {
91
+ prepend: true,
92
+ append: true,
93
+ delete: true,
94
+ replace: true,
95
+ collapse: true
96
+ }
97
+ }, {
98
+ overwrite: true
99
+ });
100
+ this.startNode = start;
101
+ start = condition.getEndNode();
102
+ if (!this.collapsed) {
103
+ var end = Node.create({
104
+ shape: NODE_TYPE_INTERMEDIATE_END,
105
+ attrs: {
106
+ label: {
107
+ text: ''
108
+ }
109
+ }
110
+ });
111
+ end.setData({
112
+ model: new ELEndNode(this)
113
+ }, {
114
+ overwrite: true
115
+ });
116
+ cells.push(this.addNode(end));
117
+ this.endNode = end;
118
+ if (children.length) {
119
+ children.forEach(function (child) {
120
+ child.toCells(options);
121
+ var childStartNode = child.getStartNode();
122
+ cells.push(Edge.create({
123
+ shape: LITEFLOW_EDGE,
124
+ source: start.id,
125
+ target: childStartNode.id
126
+ }));
127
+ var childEndNode = child.getEndNode();
128
+ cells.push(Edge.create({
129
+ shape: LITEFLOW_EDGE,
130
+ source: childEndNode.id,
131
+ target: end.id
132
+ }));
133
+ });
134
+ } else {
135
+ cells.push(Edge.create({
136
+ shape: LITEFLOW_EDGE,
137
+ source: start.id,
138
+ target: end.id
139
+ }));
140
+ }
141
+ }
142
+ return this.getCells();
143
+ }
144
+
145
+ /**
146
+ * 转换为EL表达式字符串
147
+ */
148
+ }, {
149
+ key: "toEL",
150
+ value: function toEL() {
151
+ var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
152
+ if (prefix) {
153
+ return "".concat(prefix, "SWITCH(").concat(this.condition.toEL(), ").to(\n").concat(this.children.map(function (x) {
154
+ return x.toEL("".concat(prefix, " "));
155
+ }).join(', \n'), "\n").concat(prefix, ")");
156
+ }
157
+ return "SWITCH(".concat(this.condition.toEL(), ").to(").concat(this.children.map(function (x) {
158
+ return x.toEL();
159
+ }).join(', '), ")");
160
+ }
161
+ }], [{
162
+ key: "create",
163
+ value: function create(parent, type) {
164
+ var newNode = new SwitchOperator(parent);
165
+ newNode.appendChild(NodeOperator.create(newNode, type, undefined, {
166
+ tag: generateUniqueId()
167
+ }));
168
+ return newNode;
169
+ }
170
+ }]);
171
+ return SwitchOperator;
172
+ }(ELNode);
173
+ export { SwitchOperator as default };
@@ -0,0 +1,66 @@
1
+ import { Cell, Node } from '@antv/x6';
2
+ import ELNode, { Properties } from '../node';
3
+ import { ConditionTypeEnum, NodeTypeEnum } from '../../constant';
4
+ /**
5
+ * 串行编排操作符:THEN。
6
+ *
7
+ * 例如一个串行编排(THEN)示例:
8
+ * (1) EL表达式语法:THEN(a, b, c, d)
9
+ * (2) JSON表示形式:
10
+ * {
11
+ type: ConditionTypeEnum.THEN,
12
+ children: [
13
+ { type: NodeTypeEnum.COMMON, id: 'a' },
14
+ { type: NodeTypeEnum.COMMON, id: 'b' },
15
+ { type: NodeTypeEnum.COMMON, id: 'c' },
16
+ { type: NodeTypeEnum.COMMON, id: 'd' },
17
+ ],
18
+ }
19
+ * (3) 通过ELNode节点模型进行表示的组合关系为:
20
+ ┌─────────────────┐
21
+ ┌──▶│ NodeOperator │
22
+ │ └─────────────────┘
23
+ │ ┌─────────────────┐
24
+ ├──▶│ NodeOperator │
25
+ ┌─────────┐ ┌─────────────────┐ │ └─────────────────┘
26
+ │ Chain │───▶│ ThenOperator │──┤ ┌─────────────────┐
27
+ └─────────┘ └─────────────────┘ ├──▶│ NodeOperator │
28
+ │ └─────────────────┘
29
+ │ ┌─────────────────┐
30
+ └──▶│ NodeOperator │
31
+ └─────────────────┘
32
+ */
33
+ export default class ThenOperator extends ELNode {
34
+ type: ConditionTypeEnum;
35
+ parent?: ELNode;
36
+ children: ELNode[];
37
+ properties?: Properties;
38
+ constructor(parent?: ELNode, children?: ELNode[], properties?: Properties);
39
+ /**
40
+ * 创建新的节点
41
+ * @param parent 新节点的父节点
42
+ * @param type 新节点的子节点类型
43
+ */
44
+ static create(parent?: ELNode, type?: NodeTypeEnum): ELNode;
45
+ /**
46
+ * 删除指定的子节点
47
+ * @param child 子节点
48
+ */
49
+ removeChild(child: ELNode): boolean;
50
+ /**
51
+ * 转换为X6的图数据格式
52
+ */
53
+ toCells(options?: Record<string, any>): Cell[];
54
+ /**
55
+ * 获取当前节点的开始节点
56
+ */
57
+ getStartNode(): Node;
58
+ /**
59
+ * 获取当前节点的结束节点
60
+ */
61
+ getEndNode(): Node;
62
+ /**
63
+ * 转换为EL表达式字符串
64
+ */
65
+ toEL(prefix: string): string;
66
+ }
@@ -0,0 +1,159 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
4
+ import _get from "@babel/runtime/helpers/esm/get";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
7
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
+ import { Edge } from '@antv/x6';
10
+ import ELNode from "../node";
11
+ import { ConditionTypeEnum, LITEFLOW_EDGE } from "../../constant";
12
+ import NodeOperator from "./node-operator";
13
+
14
+ /**
15
+ * 串行编排操作符:THEN。
16
+ *
17
+ * 例如一个串行编排(THEN)示例:
18
+ * (1) EL表达式语法:THEN(a, b, c, d)
19
+ * (2) JSON表示形式:
20
+ * {
21
+ type: ConditionTypeEnum.THEN,
22
+ children: [
23
+ { type: NodeTypeEnum.COMMON, id: 'a' },
24
+ { type: NodeTypeEnum.COMMON, id: 'b' },
25
+ { type: NodeTypeEnum.COMMON, id: 'c' },
26
+ { type: NodeTypeEnum.COMMON, id: 'd' },
27
+ ],
28
+ }
29
+ * (3) 通过ELNode节点模型进行表示的组合关系为:
30
+ ┌─────────────────┐
31
+ ┌──▶│ NodeOperator │
32
+ │ └─────────────────┘
33
+ │ ┌─────────────────┐
34
+ ├──▶│ NodeOperator │
35
+ ┌─────────┐ ┌─────────────────┐ │ └─────────────────┘
36
+ │ Chain │───▶│ ThenOperator │──┤ ┌─────────────────┐
37
+ └─────────┘ └─────────────────┘ ├──▶│ NodeOperator │
38
+ │ └─────────────────┘
39
+ │ ┌─────────────────┐
40
+ └──▶│ NodeOperator │
41
+ └─────────────────┘
42
+ */
43
+ var ThenOperator = /*#__PURE__*/function (_ELNode) {
44
+ _inherits(ThenOperator, _ELNode);
45
+ var _super = _createSuper(ThenOperator);
46
+ function ThenOperator(parent, children, properties) {
47
+ var _this;
48
+ _classCallCheck(this, ThenOperator);
49
+ _this = _super.call(this);
50
+ _defineProperty(_assertThisInitialized(_this), "type", ConditionTypeEnum.THEN);
51
+ _defineProperty(_assertThisInitialized(_this), "parent", void 0);
52
+ _defineProperty(_assertThisInitialized(_this), "children", []);
53
+ _defineProperty(_assertThisInitialized(_this), "properties", void 0);
54
+ _this.parent = parent;
55
+ if (children) {
56
+ _this.children = children;
57
+ }
58
+ _this.properties = properties;
59
+ return _this;
60
+ }
61
+
62
+ /**
63
+ * 创建新的节点
64
+ * @param parent 新节点的父节点
65
+ * @param type 新节点的子节点类型
66
+ */
67
+ _createClass(ThenOperator, [{
68
+ key: "removeChild",
69
+ value:
70
+ /**
71
+ * 删除指定的子节点
72
+ * @param child 子节点
73
+ */
74
+ function removeChild(child) {
75
+ if (this.children && this.children.length > 1) {
76
+ return _get(_getPrototypeOf(ThenOperator.prototype), "removeChild", this).call(this, child);
77
+ } else {
78
+ return this.remove();
79
+ }
80
+ }
81
+
82
+ /**
83
+ * 转换为X6的图数据格式
84
+ */
85
+ }, {
86
+ key: "toCells",
87
+ value: function toCells() {
88
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
89
+ this.resetCells();
90
+ var children = this.children,
91
+ cells = this.cells;
92
+ var last;
93
+ children.forEach(function (child) {
94
+ child.toCells(options);
95
+ var next = child.getStartNode();
96
+ if (last) {
97
+ cells.push(Edge.create({
98
+ shape: LITEFLOW_EDGE,
99
+ source: last.id,
100
+ target: next.id
101
+ }));
102
+ }
103
+ last = child.getEndNode();
104
+ });
105
+ return this.getCells();
106
+ }
107
+
108
+ /**
109
+ * 获取当前节点的开始节点
110
+ */
111
+ }, {
112
+ key: "getStartNode",
113
+ value: function getStartNode() {
114
+ return this.children[0].getStartNode();
115
+ }
116
+
117
+ /**
118
+ * 获取当前节点的结束节点
119
+ */
120
+ }, {
121
+ key: "getEndNode",
122
+ value: function getEndNode() {
123
+ return this.children[this.children.length - 1].getEndNode();
124
+ }
125
+
126
+ /**
127
+ * 转换为EL表达式字符串
128
+ */
129
+ }, {
130
+ key: "toEL",
131
+ value: function toEL(prefix) {
132
+ var type = this.type;
133
+ if (prefix) {
134
+ return "".concat(prefix).concat(type, "(\n").concat(this.children.map(function (x) {
135
+ return x.toEL("".concat(prefix, " "));
136
+ }).join(', \n'), "\n").concat(prefix, ")").concat(this.propertiesToEL());
137
+ }
138
+ return "".concat(type, "(").concat(this.children.map(function (x) {
139
+ return x.toEL();
140
+ }).join(','), ")").concat(this.propertiesToEL());
141
+ }
142
+ }], [{
143
+ key: "create",
144
+ value: function create(parent, type) {
145
+ function generateUniqueId() {
146
+ var timestamp = Date.now().toString(36).slice(-4);
147
+ var randomStr = Math.random().toString(36).slice(2, 6);
148
+ return timestamp + randomStr;
149
+ }
150
+ var newNode = new ThenOperator(parent);
151
+ newNode.appendChild(NodeOperator.create(newNode, type, undefined, {
152
+ tag: generateUniqueId()
153
+ }));
154
+ return newNode;
155
+ }
156
+ }]);
157
+ return ThenOperator;
158
+ }(ELNode);
159
+ export { ThenOperator as default };