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,121 @@
1
+ import React from 'react';
2
+ import classNames from 'classnames';
3
+ import { debounce } from 'lodash';
4
+ import { Modal, Tooltip, message } from 'antd';
5
+ import { DeleteOutlined, EditOutlined, MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons';
6
+ import styles from "./index.module.less";
7
+ import { history } from "../../hooks/useHistory";
8
+ import { useTranslation } from 'react-i18next';
9
+ var NodeToolBar = function NodeToolBar(props) {
10
+ var node = props.node;
11
+ var _ref = node.getData() || {},
12
+ model = _ref.model,
13
+ _ref$toolbar = _ref.toolbar,
14
+ toolbar = _ref$toolbar === void 0 ? {
15
+ append: true,
16
+ delete: true,
17
+ prepend: true,
18
+ replace: true,
19
+ collapse: false
20
+ } : _ref$toolbar;
21
+ var _useTranslation = useTranslation(),
22
+ t = _useTranslation.t;
23
+ var showContextPad = debounce(function (info) {
24
+ var _node$model;
25
+ (_node$model = node.model) === null || _node$model === void 0 || (_node$model = _node$model.graph) === null || _node$model === void 0 || _node$model.trigger('graph:showContextPad', info);
26
+ }, 100);
27
+ var onPrepend = function onPrepend(event) {
28
+ showContextPad({
29
+ x: event.clientX,
30
+ y: event.clientY,
31
+ node: node,
32
+ scene: 'prepend',
33
+ title: t('insert_node_before'),
34
+ edge: null
35
+ });
36
+ };
37
+ var onAppend = function onAppend(event) {
38
+ showContextPad({
39
+ x: event.clientX,
40
+ y: event.clientY,
41
+ node: node,
42
+ scene: 'append',
43
+ title: t('insert_node_after'),
44
+ edge: null
45
+ });
46
+ };
47
+ var onReplace = function onReplace(event) {
48
+ if (localStorage.getItem('hasPermission') !== 'true') {
49
+ return message.warning(t('no_permission'));
50
+ }
51
+ event.stopPropagation();
52
+ // node.model?.graph?.select(model.getNodes());
53
+ // node.model?.graph?.trigger('model:select', model);
54
+ showContextPad({
55
+ x: event.clientX + 20,
56
+ y: event.clientY + 20,
57
+ node: node,
58
+ scene: 'replace',
59
+ title: t('replace_node'),
60
+ edge: null
61
+ });
62
+ };
63
+ var onDelete = debounce(function (event) {
64
+ if (localStorage.getItem('hasPermission') !== 'true') {
65
+ return message.warning(t('no_permission'));
66
+ }
67
+ event.stopPropagation();
68
+ // node.model?.graph?.select(model.selectNodes());
69
+ // node.model?.graph?.trigger('model:select', model);
70
+ Modal.confirm({
71
+ title: t('delete_node_tips'),
72
+ content: t('delete_node_content'),
73
+ onOk: function onOk() {
74
+ if (model.remove()) {
75
+ var _node$model2;
76
+ (_node$model2 = node.model) === null || _node$model2 === void 0 || (_node$model2 = _node$model2.graph) === null || _node$model2 === void 0 || _node$model2.cleanSelection();
77
+ history.push();
78
+ }
79
+ }
80
+ });
81
+ }, 100);
82
+ var onCollapse = debounce(function (event) {
83
+ var _node$model3;
84
+ event.stopPropagation();
85
+ model.toggleCollapse();
86
+ (_node$model3 = node.model) === null || _node$model3 === void 0 || (_node$model3 = _node$model3.graph) === null || _node$model3 === void 0 || _node$model3.trigger('model:change');
87
+ }, 100);
88
+ var collapsed = model === null || model === void 0 ? void 0 : model.isCollapsed();
89
+ return /*#__PURE__*/React.createElement("div", {
90
+ className: classNames(styles.liteflowNodeToolBar)
91
+ }, (toolbar.replace || toolbar.delete) && /*#__PURE__*/React.createElement("div", {
92
+ className: classNames(styles.liteflowTopToolBar)
93
+ }, /*#__PURE__*/React.createElement("div", {
94
+ className: classNames(styles.liteflowToolBarBtn),
95
+ onClick: onReplace,
96
+ onMouseDown: function onMouseDown(e) {
97
+ return e.stopPropagation();
98
+ }
99
+ }, /*#__PURE__*/React.createElement(Tooltip, {
100
+ title: t('replace_node')
101
+ }, /*#__PURE__*/React.createElement(EditOutlined, null))), /*#__PURE__*/React.createElement("div", {
102
+ className: classNames(styles.liteflowToolBarBtn, styles.liteflowDeleteNode),
103
+ onClick: onDelete,
104
+ onMouseDown: function onMouseDown(e) {
105
+ return e.stopPropagation();
106
+ }
107
+ }, /*#__PURE__*/React.createElement(Tooltip, {
108
+ title: t('delete_node')
109
+ }, /*#__PURE__*/React.createElement(DeleteOutlined, null)))), toolbar.collapse && /*#__PURE__*/React.createElement("div", {
110
+ className: classNames(styles.liteflowBottomToolBar, styles.show)
111
+ }, /*#__PURE__*/React.createElement("div", {
112
+ className: classNames(styles.liteflowToolBarBtn, styles.liteflowCollapseNode),
113
+ onClick: onCollapse,
114
+ onMouseDown: function onMouseDown(e) {
115
+ return e.stopPropagation();
116
+ }
117
+ }, /*#__PURE__*/React.createElement(Tooltip, {
118
+ title: collapsed ? t('open_node') : t('close_node')
119
+ }, collapsed ? /*#__PURE__*/React.createElement(PlusSquareOutlined, null) : /*#__PURE__*/React.createElement(MinusSquareOutlined, null)))));
120
+ };
121
+ export default NodeToolBar;
@@ -0,0 +1,133 @@
1
+ .liteflowNodeToolBar {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ .liteflowAddNodePrepend {
8
+ position: absolute;
9
+ top: 5px;
10
+ left: -18px;
11
+ width: 18px;
12
+ height: 20px;
13
+ background-color: #d9d9d9;
14
+ border-radius: 8px;
15
+ display: flex;
16
+ justify-content: center;
17
+ align-items: center;
18
+ .liteflowAddNodePrependIcon {
19
+ width: 100%;
20
+ height: 100%;
21
+ background: url(../../assets/indicator-icons.svg) -1px 0px no-repeat;
22
+ background-size: cover;
23
+ filter: opacity(0.5);
24
+ }
25
+ &:hover .liteflowAddNodePrependIcon {
26
+ filter: opacity(1);
27
+ }
28
+ }
29
+ .liteflowAddNodeAppend {
30
+ position: absolute;
31
+ top: 5px;
32
+ right: -17px;
33
+ width: 18px;
34
+ height: 20px;
35
+ background-color: #d9d9d9;
36
+ border-radius: 8px;
37
+ display: flex;
38
+ justify-content: center;
39
+ align-items: center;
40
+ .liteflowAddNodeAppendIcon {
41
+ width: 100%;
42
+ height: 100%;
43
+ background: url(../../assets/indicator-icons.svg) -16px 0px no-repeat;
44
+ background-size: cover;
45
+ filter: opacity(0.5);
46
+ }
47
+ &:hover .liteflowAddNodeAppendIcon {
48
+ filter: opacity(1);
49
+ }
50
+ }
51
+ .liteflowTopToolBar {
52
+ display: flex;
53
+ justify-content: space-around;
54
+ align-items: center;
55
+ position: absolute;
56
+ top: -24px;
57
+ left: 50%;
58
+ width: 50px;
59
+ height: 24px;
60
+ margin-left: -25px;
61
+ border-radius: 4px;
62
+ background-color: #fff;
63
+ box-shadow: 0 0 0 1px rgba(64, 87, 109, 0.07),
64
+ 0 2px 12px rgba(53, 71, 90, 0.2);
65
+ }
66
+ .liteflowToolBarBtn {
67
+ display: flex;
68
+ justify-content: center;
69
+ align-items: center;
70
+ width: 20px;
71
+ height: 20px;
72
+ font-size: 16px;
73
+ border: 1px solid transparent;
74
+ &:hover {
75
+ border: 1px solid #ccc;
76
+ background-color: rgba(64, 87, 109, 0.07);
77
+ }
78
+ }
79
+ .liteflowDeleteNode {
80
+ position: relative;
81
+ color: #f54a45;
82
+ &:before {
83
+ position: absolute;
84
+ top: 0;
85
+ left: -4px;
86
+ width: 1px;
87
+ height: 18px;
88
+ content: ' ';
89
+ border-left: solid 1px rgba(57, 76, 96, 0.15);
90
+ }
91
+ }
92
+ .liteflowBottomToolBar {
93
+ display: flex;
94
+ justify-content: space-around;
95
+ align-items: center;
96
+ position: absolute;
97
+ top: 24px;
98
+ left: 50%;
99
+ width: 50px;
100
+ height: 24px;
101
+ margin-left: -25px;
102
+ &.show {
103
+ display: flex !important;
104
+ }
105
+ }
106
+ .liteflowCollapseNode {
107
+ position: relative;
108
+ top: -2px;
109
+ color: #c1c1c1;
110
+ width: 12px;
111
+ height: 12px;
112
+ font-size: 12px;
113
+ background: rgba(255, 255, 255, 0.85);
114
+ &:hover {
115
+ color: rgba(0, 0, 0, 0.85);
116
+ background: #ffffff;
117
+ }
118
+ }
119
+ .liteflowAddNodePrepend,
120
+ .liteflowAddNodeAppend,
121
+ .liteflowTopToolBar,
122
+ .liteflowBottomToolBar {
123
+ display: none;
124
+ }
125
+ &:hover {
126
+ .liteflowAddNodePrepend,
127
+ .liteflowAddNodeAppend,
128
+ .liteflowTopToolBar,
129
+ .liteflowBottomToolBar {
130
+ display: flex;
131
+ }
132
+ }
133
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { Node } from '@antv/x6';
3
+ declare const NodeView: React.FC<{
4
+ icon: string;
5
+ node: Node;
6
+ }>;
7
+ export default NodeView;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import classNames from 'classnames';
3
+ import styles from "./index.module.less";
4
+ var NodeView = function NodeView(props) {
5
+ var icon = props.icon,
6
+ children = props.children;
7
+ return /*#__PURE__*/React.createElement("div", {
8
+ className: classNames(styles.liteflowShapeWrapper)
9
+ }, /*#__PURE__*/React.createElement("img", {
10
+ className: styles.liteflowShapeSvg,
11
+ src: icon
12
+ }), children);
13
+ };
14
+ export default NodeView;
@@ -0,0 +1,14 @@
1
+ .liteflowShapeWrapper {
2
+ position: relative;
3
+ font-size: 12px;
4
+ cursor: pointer;
5
+ pointer-events: auto;
6
+ width: 100%;
7
+ height: 100%;
8
+ }
9
+
10
+ .liteflowShapeSvg {
11
+ width: 100%;
12
+ height: 100%;
13
+ overflow: visible !important;
14
+ }
@@ -0,0 +1,3 @@
1
+ export { default as NodeView } from './NodeView';
2
+ export { default as NodeToolBar } from './NodeToolBar';
3
+ export { default as NodeBadge } from './NodeBadge';
@@ -0,0 +1,3 @@
1
+ export { default as NodeView } from "./NodeView";
2
+ export { default as NodeToolBar } from "./NodeToolBar";
3
+ export { default as NodeBadge } from "./NodeBadge";
@@ -0,0 +1,79 @@
1
+ /** 常量 */
2
+ export declare const NODE_WIDTH = 30;
3
+ export declare const NODE_HEIGHT = 30;
4
+ export declare const MIN_ZOOM = 0.1;
5
+ export declare const MAX_ZOOM = 3;
6
+ export declare const ZOOM_STEP = 0.1;
7
+ export declare const RANK_SEP = 20;
8
+ export declare const NODE_SEP = 20;
9
+ export declare const NODE_TYPE_START = "LITEFLOW_START";
10
+ export declare const NODE_TYPE_END = "LITEFLOW_END";
11
+ export declare const NODE_TYPE_INTERMEDIATE_END = "LITEFLOW_INTERMEDIATE_END";
12
+ export declare const LITEFLOW_EDGE = "LITEFLOW_EDGE";
13
+ export declare const LITEFLOW_ANCHOR = "LITEFLOW_ANCHOR";
14
+ export declare const LITEFLOW_ROUTER = "LITEFLOW_ROUTER";
15
+ export declare const LINE_COLOR = "#c1c1c1";
16
+ /** 逻辑组件类型 */
17
+ export declare enum NodeTypeEnum {
18
+ COMMON = "NodeComponent",// common, 普通
19
+ BOOLEAN = "NodeBooleanComponent",// boolean, 布尔
20
+ SWITCH = "NodeSwitchComponent",// switch, 选择
21
+ IF = "NodeIfComponent",// if, 条件
22
+ FOR = "NodeForComponent",// for, 循环次数
23
+ WHILE = "NodeWhileComponent",// while, 循环条件
24
+ BREAK = "NodeBreakComponent",// break, 循环跳出
25
+ ITERATOR = "NodeIteratorComponent",// iterator, 循环迭代
26
+ SCRIPT = "ScriptCommonComponent",// script, 脚本
27
+ BOOLEAN_SCRIPT = "ScriptBooleanComponent",// boolean_script, 布尔脚本
28
+ SWITCH_SCRIPT = "ScriptSwitchComponent",// switch_script, 选择脚本
29
+ IF_SCRIPT = "ScriptIfComponent",// if_script, 条件脚本
30
+ FOR_SCRIPT = "ScriptForComponent",// for_script, 循环次数脚本
31
+ WHILE_SCRIPT = "ScriptWhileComponent",// while_script, 循环条件脚本
32
+ BREAK_SCRIPT = "ScriptBreakComponent",// break_script, 循环跳出脚本
33
+ FALLBACK = "fallback",// 降级
34
+ VIRTUAL = "NodeVirtualComponent"
35
+ }
36
+ /** 逻辑编排类型 */
37
+ export declare enum ConditionTypeEnum {
38
+ CHAIN = "CHAIN",// chain,编排的根节点或者子流程
39
+ THEN = "THEN",// then,串行编排
40
+ SER = "SER",// ser,串行编排
41
+ WHEN = "WHEN",// when,并行编排
42
+ PAR = "PAR",// par,并行编排
43
+ SWITCH = "SWITCH",// switch,选择编排
44
+ IF = "IF",// if,条件编排
45
+ PRE = "PRE",// pre
46
+ FINALLY = "FINALLY",// finally
47
+ FOR = "FOR",// for,循环编排
48
+ WHILE = "WHILE",// while,循环编排
49
+ ITERATOR = "ITERATOR",// iterator
50
+ BREAK = "BREAK",// break
51
+ CATCH = "CATCH",// catch
52
+ AND = "AND",// and,与
53
+ OR = "OR",// or,或
54
+ NOT = "NOT",// not,非
55
+ ABSTRACT = "ABSTRACT",// abstract
56
+ DEFAULT = "DEFAULT"
57
+ }
58
+ export declare const unitNumOptions: {
59
+ label: string;
60
+ value: string;
61
+ }[];
62
+ export declare const unitOptions: {
63
+ label: string;
64
+ value: string;
65
+ }[];
66
+ export declare const allGather: {
67
+ value: string;
68
+ label: string;
69
+ }[];
70
+ export declare const unitList: {
71
+ value: string;
72
+ label: string;
73
+ eg: string;
74
+ }[];
75
+ export declare const timeDistributionConfig: string[];
76
+ export declare const formatUnitListX: {
77
+ label: string;
78
+ value: string;
79
+ }[];
@@ -0,0 +1,215 @@
1
+ /** 常量 */
2
+ export var NODE_WIDTH = 30; // 节点宽度
3
+ export var NODE_HEIGHT = 30; // 节点高度
4
+ export var MIN_ZOOM = 0.1;
5
+ export var MAX_ZOOM = 3.0;
6
+ export var ZOOM_STEP = 0.1;
7
+
8
+ // 布局相关常量
9
+ export var RANK_SEP = 20;
10
+ export var NODE_SEP = 20;
11
+ export var NODE_TYPE_START = 'LITEFLOW_START';
12
+ export var NODE_TYPE_END = 'LITEFLOW_END';
13
+ export var NODE_TYPE_INTERMEDIATE_END = 'LITEFLOW_INTERMEDIATE_END';
14
+ export var LITEFLOW_EDGE = 'LITEFLOW_EDGE';
15
+ export var LITEFLOW_ANCHOR = 'LITEFLOW_ANCHOR';
16
+ export var LITEFLOW_ROUTER = 'LITEFLOW_ROUTER';
17
+ export var LINE_COLOR = '#c1c1c1';
18
+
19
+ /** 逻辑组件类型 */
20
+ export var NodeTypeEnum = /*#__PURE__*/function (NodeTypeEnum) {
21
+ NodeTypeEnum["COMMON"] = "NodeComponent";
22
+ NodeTypeEnum["BOOLEAN"] = "NodeBooleanComponent";
23
+ NodeTypeEnum["SWITCH"] = "NodeSwitchComponent";
24
+ NodeTypeEnum["IF"] = "NodeIfComponent";
25
+ NodeTypeEnum["FOR"] = "NodeForComponent";
26
+ NodeTypeEnum["WHILE"] = "NodeWhileComponent";
27
+ NodeTypeEnum["BREAK"] = "NodeBreakComponent";
28
+ NodeTypeEnum["ITERATOR"] = "NodeIteratorComponent";
29
+ NodeTypeEnum["SCRIPT"] = "ScriptCommonComponent";
30
+ NodeTypeEnum["BOOLEAN_SCRIPT"] = "ScriptBooleanComponent";
31
+ NodeTypeEnum["SWITCH_SCRIPT"] = "ScriptSwitchComponent";
32
+ NodeTypeEnum["IF_SCRIPT"] = "ScriptIfComponent";
33
+ NodeTypeEnum["FOR_SCRIPT"] = "ScriptForComponent";
34
+ NodeTypeEnum["WHILE_SCRIPT"] = "ScriptWhileComponent";
35
+ NodeTypeEnum["BREAK_SCRIPT"] = "ScriptBreakComponent";
36
+ NodeTypeEnum["FALLBACK"] = "fallback";
37
+ NodeTypeEnum["VIRTUAL"] = "NodeVirtualComponent";
38
+ return NodeTypeEnum;
39
+ }({}); // virtual, 虚节点
40
+
41
+ /** 逻辑编排类型 */
42
+ export var ConditionTypeEnum = /*#__PURE__*/function (ConditionTypeEnum) {
43
+ ConditionTypeEnum["CHAIN"] = "CHAIN";
44
+ ConditionTypeEnum["THEN"] = "THEN";
45
+ ConditionTypeEnum["SER"] = "SER";
46
+ ConditionTypeEnum["WHEN"] = "WHEN";
47
+ ConditionTypeEnum["PAR"] = "PAR";
48
+ ConditionTypeEnum["SWITCH"] = "SWITCH";
49
+ ConditionTypeEnum["IF"] = "IF";
50
+ ConditionTypeEnum["PRE"] = "PRE";
51
+ ConditionTypeEnum["FINALLY"] = "FINALLY";
52
+ ConditionTypeEnum["FOR"] = "FOR";
53
+ ConditionTypeEnum["WHILE"] = "WHILE";
54
+ ConditionTypeEnum["ITERATOR"] = "ITERATOR";
55
+ ConditionTypeEnum["BREAK"] = "BREAK";
56
+ ConditionTypeEnum["CATCH"] = "CATCH";
57
+ ConditionTypeEnum["AND"] = "AND";
58
+ ConditionTypeEnum["OR"] = "OR";
59
+ ConditionTypeEnum["NOT"] = "NOT";
60
+ ConditionTypeEnum["ABSTRACT"] = "ABSTRACT";
61
+ ConditionTypeEnum["DEFAULT"] = "DEFAULT";
62
+ return ConditionTypeEnum;
63
+ }({}); // default
64
+ export var unitNumOptions = [{
65
+ label: "",
66
+ value: "Basic"
67
+ }, {
68
+ label: "千",
69
+ value: "Thousand"
70
+ }, {
71
+ label: "百万",
72
+ value: "Million"
73
+ }, {
74
+ label: "十亿",
75
+ value: "Billion"
76
+ }];
77
+ export var unitOptions = [{
78
+ label: "毫秒",
79
+ value: "Millisecond"
80
+ }, {
81
+ label: "秒",
82
+ value: "Seconds"
83
+ }, {
84
+ label: "分",
85
+ value: "Minutes"
86
+ }, {
87
+ label: "小时",
88
+ value: "Hours"
89
+ }, {
90
+ label: "天",
91
+ value: "Days"
92
+ }, {
93
+ label: "周",
94
+ value: "Weeks"
95
+ }, {
96
+ label: "月",
97
+ value: "Months"
98
+ }, {
99
+ label: "年",
100
+ value: "Years"
101
+ }];
102
+ export var allGather = [{
103
+ value: "SUM",
104
+ label: "合计"
105
+ }, {
106
+ value: "COUNT",
107
+ label: "计数"
108
+ }, {
109
+ value: "AVG",
110
+ label: "平均值"
111
+ }, {
112
+ value: "STDDEV",
113
+ label: "标准差"
114
+ }, {
115
+ value: "MEDIAN",
116
+ label: "中位数"
117
+ }, {
118
+ value: "MAX",
119
+ label: "最大值"
120
+ }, {
121
+ value: "MIN",
122
+ label: "最小值"
123
+ }, {
124
+ value: "COUNT_DISTINCT",
125
+ label: "计数不同"
126
+ }, {
127
+ value: "CALCULATION",
128
+ label: "指标计算"
129
+ }];
130
+ export var unitList = [{
131
+ value: 'no',
132
+ label: "无聚集",
133
+ eg: ""
134
+ }, {
135
+ value: "SECONDS",
136
+ label: "秒",
137
+ eg: "2024/01/08 13:15:56"
138
+ }, {
139
+ value: "MINUTES",
140
+ label: "分钟",
141
+ eg: "2024/01/08 13:15"
142
+ }, {
143
+ value: "HOURS",
144
+ label: "小时",
145
+ eg: "2024/01/08 13"
146
+ }, {
147
+ value: "DAYS",
148
+ label: "天",
149
+ eg: "2024/01/08"
150
+ }, {
151
+ value: "WEEKS",
152
+ label: "周",
153
+ eg: "W02/2024"
154
+ }, {
155
+ value: "MONTHS",
156
+ label: "月",
157
+ eg: "01/2024"
158
+ }, {
159
+ value: "YEARS",
160
+ label: "年",
161
+ eg: "2024"
162
+ }, {
163
+ value: "HOUR_OF_DAY",
164
+ label: "日小时",
165
+ eg: "05"
166
+ }, {
167
+ value: "DAY_OF_WEEK",
168
+ label: "星期几",
169
+ eg: "星期一"
170
+ }, {
171
+ value: "DAY_OF_MONTH",
172
+ label: "月日期",
173
+ eg: "8日"
174
+ }, {
175
+ value: "DAY_OF_YEAR",
176
+ label: "年日期",
177
+ eg: "一月8日"
178
+ }, {
179
+ value: "WEEK_OF_YEAR",
180
+ label: "年周",
181
+ eg: "W02"
182
+ }, {
183
+ value: "MONTH_OF_YEAR",
184
+ label: "年月份",
185
+ eg: "一月"
186
+ }];
187
+ export var timeDistributionConfig = ["SECONDS", "MINUTES", "HOURS", "DAYS", "WEEKS", "MONTHS", "YEARS"];
188
+ export var formatUnitListX = [{
189
+ label: "以毫秒",
190
+ value: "Millisecond"
191
+ }, {
192
+ label: "以秒",
193
+ value: "Seconds"
194
+ }, {
195
+ label: "以分",
196
+ value: "Minutes"
197
+ }, {
198
+ label: "以小时",
199
+ value: "Hours"
200
+ }, {
201
+ label: "以天",
202
+ value: "Days"
203
+ }, {
204
+ label: "以周",
205
+ value: "Weeks"
206
+ }, {
207
+ label: "以月",
208
+ value: "Months"
209
+ }, {
210
+ label: "以年",
211
+ value: "Years"
212
+ }, {
213
+ label: "以-天-小时-分钟-秒",
214
+ value: "forMatTime"
215
+ }];
@@ -0,0 +1,13 @@
1
+ import { Context, RefObject } from 'react';
2
+ import { Graph } from '@antv/x6';
3
+ /**
4
+ * graph: Graph实例
5
+ * graphWrapper: Graph的容器
6
+ */
7
+ interface IGraphContext {
8
+ model: any;
9
+ graph: Graph;
10
+ graphWrapper: RefObject<HTMLDivElement>;
11
+ }
12
+ export declare const GraphContext: Context<IGraphContext>;
13
+ export default GraphContext;
@@ -0,0 +1,10 @@
1
+ import { createContext } from 'react';
2
+
3
+ /**
4
+ * graph: Graph实例
5
+ * graphWrapper: Graph的容器
6
+ */
7
+
8
+ var defaultValue = {};
9
+ export var GraphContext = /*#__PURE__*/createContext(defaultValue);
10
+ export default GraphContext;
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ interface DataType {
3
+ key: string;
4
+ name: string;
5
+ type: string;
6
+ description: string;
7
+ action: number;
8
+ }
9
+ export interface IParameter {
10
+ getParams: () => Array<DataType>;
11
+ }
12
+ interface AnyObject {
13
+ /**
14
+ * 脚本列表
15
+ */
16
+ scriptList: {
17
+ id: number;
18
+ scriptId: string;
19
+ scriptName: string;
20
+ scriptData: string;
21
+ logId: number;
22
+ type: number;
23
+ params: string;
24
+ [key: string]: any;
25
+ }[];
26
+ /**
27
+ * 注册脚本
28
+ */
29
+ register: (inst: IParameter) => void;
30
+ /**
31
+ * 其他可扩展属性
32
+ */
33
+ [key: string]: any;
34
+ }
35
+ export declare const ScriptContext: React.Context<AnyObject | null>;
36
+ export declare const useScriptContext: () => AnyObject;
37
+ export {};
@@ -0,0 +1,15 @@
1
+ import { createContext, useContext } from 'react';
2
+ ;
3
+ export var ScriptContext = /*#__PURE__*/createContext(null);
4
+ export var useScriptContext = function useScriptContext() {
5
+ var context = useContext(ScriptContext);
6
+ if (!context) {
7
+ context = {
8
+ scriptList: [],
9
+ register: function register() {
10
+ return null;
11
+ }
12
+ };
13
+ }
14
+ return context;
15
+ };
@@ -0,0 +1,5 @@
1
+ export { default as useClickAway } from './useClickAway';
2
+ export { useGraph } from './useGraph';
3
+ export { useGraphWrapper } from './useGraphWrapper';
4
+ export { useHistory } from './useHistory';
5
+ export { useModel } from './useModel';
@@ -0,0 +1,5 @@
1
+ export { default as useClickAway } from "./useClickAway";
2
+ export { useGraph } from "./useGraph";
3
+ export { useGraphWrapper } from "./useGraphWrapper";
4
+ export { useHistory } from "./useHistory";
5
+ export { useModel } from "./useModel";