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.
- package/LICENSE +21 -0
- package/README.md +1020 -0
- package/dist/LiteFlowEditor/assets/and-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/catch-icon.svg +14 -0
- package/dist/LiteFlowEditor/assets/chain-icon.svg +11 -0
- package/dist/LiteFlowEditor/assets/common-icon.svg +18 -0
- package/dist/LiteFlowEditor/assets/end-icon.svg +14 -0
- package/dist/LiteFlowEditor/assets/for-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/if-icon.svg +14 -0
- package/dist/LiteFlowEditor/assets/indicator-icons.svg +16 -0
- package/dist/LiteFlowEditor/assets/intermediate-end-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/intermediate-event-catch-error.svg +40 -0
- package/dist/LiteFlowEditor/assets/iterator-icon.svg +7 -0
- package/dist/LiteFlowEditor/assets/little-warning-icon.svg +1 -0
- package/dist/LiteFlowEditor/assets/not-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/or-icon.svg +20 -0
- package/dist/LiteFlowEditor/assets/start-icon.svg +16 -0
- package/dist/LiteFlowEditor/assets/switch-icon.svg +15 -0
- package/dist/LiteFlowEditor/assets/then-icon.svg +23 -0
- package/dist/LiteFlowEditor/assets/virtual-icon.svg +21 -0
- package/dist/LiteFlowEditor/assets/warning-icon.svg +1 -0
- package/dist/LiteFlowEditor/assets/when-icon.svg +21 -0
- package/dist/LiteFlowEditor/assets/while-icon.svg +24 -0
- package/dist/LiteFlowEditor/cells/and.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/and.js +8 -0
- package/dist/LiteFlowEditor/cells/catch.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/catch.js +8 -0
- package/dist/LiteFlowEditor/cells/chain.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/chain.js +8 -0
- package/dist/LiteFlowEditor/cells/common.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/common.js +8 -0
- package/dist/LiteFlowEditor/cells/end.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/end.js +11 -0
- package/dist/LiteFlowEditor/cells/for.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/for.js +8 -0
- package/dist/LiteFlowEditor/cells/if.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/if.js +9 -0
- package/dist/LiteFlowEditor/cells/index.d.ts +25 -0
- package/dist/LiteFlowEditor/cells/index.js +219 -0
- package/dist/LiteFlowEditor/cells/intermediate-end.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/intermediate-end.js +11 -0
- package/dist/LiteFlowEditor/cells/iterator.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/iterator.js +8 -0
- package/dist/LiteFlowEditor/cells/not.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/not.js +8 -0
- package/dist/LiteFlowEditor/cells/or.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/or.js +8 -0
- package/dist/LiteFlowEditor/cells/start.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/start.js +11 -0
- package/dist/LiteFlowEditor/cells/switch.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/switch.js +9 -0
- package/dist/LiteFlowEditor/cells/then.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/then.js +11 -0
- package/dist/LiteFlowEditor/cells/virtual.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/virtual.js +8 -0
- package/dist/LiteFlowEditor/cells/when.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/when.js +11 -0
- package/dist/LiteFlowEditor/cells/while.d.ts +2 -0
- package/dist/LiteFlowEditor/cells/while.js +8 -0
- package/dist/LiteFlowEditor/common/anchor.d.ts +2 -0
- package/dist/LiteFlowEditor/common/anchor.js +10 -0
- package/dist/LiteFlowEditor/common/connector.d.ts +2 -0
- package/dist/LiteFlowEditor/common/connector.js +20 -0
- package/dist/LiteFlowEditor/common/edge.d.ts +61 -0
- package/dist/LiteFlowEditor/common/edge.js +57 -0
- package/dist/LiteFlowEditor/common/events.d.ts +4 -0
- package/dist/LiteFlowEditor/common/events.js +97 -0
- package/dist/LiteFlowEditor/common/index.d.ts +4 -0
- package/dist/LiteFlowEditor/common/index.js +11 -0
- package/dist/LiteFlowEditor/common/layout.d.ts +12 -0
- package/dist/LiteFlowEditor/common/layout.js +308 -0
- package/dist/LiteFlowEditor/common/router.d.ts +2 -0
- package/dist/LiteFlowEditor/common/router.js +40 -0
- package/dist/LiteFlowEditor/common/shortcuts.d.ts +10 -0
- package/dist/LiteFlowEditor/common/shortcuts.js +183 -0
- package/dist/LiteFlowEditor/components/NodeBadge/index.d.ts +6 -0
- package/dist/LiteFlowEditor/components/NodeBadge/index.js +24 -0
- package/dist/LiteFlowEditor/components/NodeBadge/index.module.less +10 -0
- package/dist/LiteFlowEditor/components/NodeToolBar/index.d.ts +6 -0
- package/dist/LiteFlowEditor/components/NodeToolBar/index.js +121 -0
- package/dist/LiteFlowEditor/components/NodeToolBar/index.module.less +133 -0
- package/dist/LiteFlowEditor/components/NodeView/index.d.ts +7 -0
- package/dist/LiteFlowEditor/components/NodeView/index.js +14 -0
- package/dist/LiteFlowEditor/components/NodeView/index.module.less +14 -0
- package/dist/LiteFlowEditor/components/index.d.ts +3 -0
- package/dist/LiteFlowEditor/components/index.js +3 -0
- package/dist/LiteFlowEditor/constant/index.d.ts +79 -0
- package/dist/LiteFlowEditor/constant/index.js +215 -0
- package/dist/LiteFlowEditor/context/GraphContext.d.ts +13 -0
- package/dist/LiteFlowEditor/context/GraphContext.js +10 -0
- package/dist/LiteFlowEditor/context/ScriptContext.d.ts +37 -0
- package/dist/LiteFlowEditor/context/ScriptContext.js +15 -0
- package/dist/LiteFlowEditor/hooks/index.d.ts +5 -0
- package/dist/LiteFlowEditor/hooks/index.js +5 -0
- package/dist/LiteFlowEditor/hooks/useClickAway.d.ts +5 -0
- package/dist/LiteFlowEditor/hooks/useClickAway.js +38 -0
- package/dist/LiteFlowEditor/hooks/useGraph.d.ts +1 -0
- package/dist/LiteFlowEditor/hooks/useGraph.js +7 -0
- package/dist/LiteFlowEditor/hooks/useGraphWrapper.d.ts +2 -0
- package/dist/LiteFlowEditor/hooks/useGraphWrapper.js +7 -0
- package/dist/LiteFlowEditor/hooks/useHistory.d.ts +2 -0
- package/dist/LiteFlowEditor/hooks/useHistory.js +69 -0
- package/dist/LiteFlowEditor/hooks/useModel.d.ts +3 -0
- package/dist/LiteFlowEditor/hooks/useModel.js +7 -0
- package/dist/LiteFlowEditor/hooks/useUpdateEffect.d.ts +7 -0
- package/dist/LiteFlowEditor/hooks/useUpdateEffect.js +17 -0
- package/dist/LiteFlowEditor/i18n/en_US/translation.json +138 -0
- package/dist/LiteFlowEditor/i18n/index.d.ts +2 -0
- package/dist/LiteFlowEditor/i18n/index.js +28 -0
- package/dist/LiteFlowEditor/i18n/zh_CN/translation.json +139 -0
- package/dist/LiteFlowEditor/i18n/zh_TW/translation.json +139 -0
- package/dist/LiteFlowEditor/index.d.ts +37 -0
- package/dist/LiteFlowEditor/index.js +299 -0
- package/dist/LiteFlowEditor/index.module.less +127 -0
- package/dist/LiteFlowEditor/mock/index.d.ts +2 -0
- package/dist/LiteFlowEditor/mock/index.js +272 -0
- package/dist/LiteFlowEditor/model/builder.d.ts +43 -0
- package/dist/LiteFlowEditor/model/builder.js +239 -0
- package/dist/LiteFlowEditor/model/chain.d.ts +83 -0
- package/dist/LiteFlowEditor/model/chain.js +278 -0
- package/dist/LiteFlowEditor/model/el/and-operator.d.ts +53 -0
- package/dist/LiteFlowEditor/model/el/and-operator.js +178 -0
- package/dist/LiteFlowEditor/model/el/catch-operator.d.ts +81 -0
- package/dist/LiteFlowEditor/model/el/catch-operator.js +338 -0
- package/dist/LiteFlowEditor/model/el/chain-operator.d.ts +53 -0
- package/dist/LiteFlowEditor/model/el/chain-operator.js +170 -0
- package/dist/LiteFlowEditor/model/el/for-operator.d.ts +56 -0
- package/dist/LiteFlowEditor/model/el/for-operator.js +171 -0
- package/dist/LiteFlowEditor/model/el/if-operator.d.ts +64 -0
- package/dist/LiteFlowEditor/model/el/if-operator.js +265 -0
- package/dist/LiteFlowEditor/model/el/index.d.ts +40 -0
- package/dist/LiteFlowEditor/model/el/index.js +47 -0
- package/dist/LiteFlowEditor/model/el/iterator-operator.d.ts +56 -0
- package/dist/LiteFlowEditor/model/el/iterator-operator.js +183 -0
- package/dist/LiteFlowEditor/model/el/node-operator.d.ts +62 -0
- package/dist/LiteFlowEditor/model/el/node-operator.js +136 -0
- package/dist/LiteFlowEditor/model/el/not-operator.d.ts +68 -0
- package/dist/LiteFlowEditor/model/el/not-operator.js +231 -0
- package/dist/LiteFlowEditor/model/el/or-operator.d.ts +53 -0
- package/dist/LiteFlowEditor/model/el/or-operator.js +178 -0
- package/dist/LiteFlowEditor/model/el/switch-operator.d.ts +56 -0
- package/dist/LiteFlowEditor/model/el/switch-operator.js +173 -0
- package/dist/LiteFlowEditor/model/el/then-operator.d.ts +66 -0
- package/dist/LiteFlowEditor/model/el/then-operator.js +159 -0
- package/dist/LiteFlowEditor/model/el/when-operator.d.ts +58 -0
- package/dist/LiteFlowEditor/model/el/when-operator.js +181 -0
- package/dist/LiteFlowEditor/model/el/while-operator.d.ts +56 -0
- package/dist/LiteFlowEditor/model/el/while-operator.js +171 -0
- package/dist/LiteFlowEditor/model/node.d.ts +182 -0
- package/dist/LiteFlowEditor/model/node.js +463 -0
- package/dist/LiteFlowEditor/model/utils/createTag.d.ts +1 -0
- package/dist/LiteFlowEditor/model/utils/createTag.js +5 -0
- package/dist/LiteFlowEditor/model/utils/end.d.ts +87 -0
- package/dist/LiteFlowEditor/model/utils/end.js +185 -0
- package/dist/LiteFlowEditor/model/utils/index.d.ts +7 -0
- package/dist/LiteFlowEditor/model/utils/index.js +10 -0
- package/dist/LiteFlowEditor/model/utils/start.d.ts +87 -0
- package/dist/LiteFlowEditor/model/utils/start.js +185 -0
- package/dist/LiteFlowEditor/model/utils/virtual.d.ts +78 -0
- package/dist/LiteFlowEditor/model/utils/virtual.js +167 -0
- package/dist/LiteFlowEditor/model-checker/checkers/AnalysisNodeChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/AnalysisNodeChecker.js +44 -0
- package/dist/LiteFlowEditor/model-checker/checkers/CurScheduleSetChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/CurScheduleSetChecker.js +26 -0
- package/dist/LiteFlowEditor/model-checker/checkers/InputListChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/InputListChecker.js +39 -0
- package/dist/LiteFlowEditor/model-checker/checkers/InputListValueChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/InputListValueChecker.js +154 -0
- package/dist/LiteFlowEditor/model-checker/checkers/IteratorBindChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/IteratorBindChecker.js +27 -0
- package/dist/LiteFlowEditor/model-checker/checkers/QueryDimensionChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/QueryDimensionChecker.js +33 -0
- package/dist/LiteFlowEditor/model-checker/checkers/QueryLogChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/QueryLogChecker.js +27 -0
- package/dist/LiteFlowEditor/model-checker/checkers/ReportTemplateChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/ReportTemplateChecker.js +27 -0
- package/dist/LiteFlowEditor/model-checker/checkers/UnconfiguredComponentChecker.d.ts +7 -0
- package/dist/LiteFlowEditor/model-checker/checkers/UnconfiguredComponentChecker.js +27 -0
- package/dist/LiteFlowEditor/model-checker/checkers/index.d.ts +14 -0
- package/dist/LiteFlowEditor/model-checker/checkers/index.js +38 -0
- package/dist/LiteFlowEditor/model-checker/index.d.ts +22 -0
- package/dist/LiteFlowEditor/model-checker/index.js +43 -0
- package/dist/LiteFlowEditor/model-checker/types.d.ts +11 -0
- package/dist/LiteFlowEditor/model-checker/types.js +1 -0
- package/dist/LiteFlowEditor/panels/breadcrumb/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/breadcrumb/index.js +67 -0
- package/dist/LiteFlowEditor/panels/breadcrumb/index.module.less +23 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.d.ts +11 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.js +98 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/index.module.less +7 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/blank.d.ts +8 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/blank.js +18 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/index.d.ts +3 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/index.js +3 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/node.d.ts +9 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextMenu/menuConfig/node.js +10 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.d.ts +14 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.js +108 -0
- package/dist/LiteFlowEditor/panels/flowGraph/contextPad/index.module.less +81 -0
- package/dist/LiteFlowEditor/panels/flowGraph/createFlowGraph.d.ts +3 -0
- package/dist/LiteFlowEditor/panels/flowGraph/createFlowGraph.js +199 -0
- package/dist/LiteFlowEditor/panels/flowGraph/miniMapSimpleNode/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/flowGraph/miniMapSimpleNode/index.js +42 -0
- package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.d.ts +8 -0
- package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.js +110 -0
- package/dist/LiteFlowEditor/panels/flowGraph/nodeEditorModal/index.module.less +11 -0
- package/dist/LiteFlowEditor/panels/layout/index.d.ts +16 -0
- package/dist/LiteFlowEditor/panels/layout/index.js +117 -0
- package/dist/LiteFlowEditor/panels/layout/index.module.less +30 -0
- package/dist/LiteFlowEditor/panels/settingBar/basic/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/settingBar/basic/index.js +50 -0
- package/dist/LiteFlowEditor/panels/settingBar/basic/index.module.less +17 -0
- package/dist/LiteFlowEditor/panels/settingBar/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/settingBar/index.js +219 -0
- package/dist/LiteFlowEditor/panels/settingBar/index.module.less +45 -0
- package/dist/LiteFlowEditor/panels/settingBar/outline/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/settingBar/outline/index.js +124 -0
- package/dist/LiteFlowEditor/panels/settingBar/outline/index.module.less +39 -0
- package/dist/LiteFlowEditor/panels/settingBar/parameters/index.d.ts +6 -0
- package/dist/LiteFlowEditor/panels/settingBar/parameters/index.js +415 -0
- package/dist/LiteFlowEditor/panels/settingBar/parameters/index.module.less +4 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/CustomDropdown.d.ts +13 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/CustomDropdown.js +62 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/DraggableWrapper.d.ts +48 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/DraggableWrapper.js +94 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor-new.d.ts +33 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor-new.js +433 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor.d.ts +33 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/RichParamEditor.js +195 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/component.d.ts +10 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/component.js +2780 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/condition.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/condition.js +54 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/index.d.ts +2 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/index.js +2 -0
- package/dist/LiteFlowEditor/panels/settingBar/properties/index.module.less +149 -0
- package/dist/LiteFlowEditor/panels/sideBar/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/sideBar/index.js +153 -0
- package/dist/LiteFlowEditor/panels/sideBar/index.module.less +48 -0
- package/dist/LiteFlowEditor/panels/toolBar/index.d.ts +8 -0
- package/dist/LiteFlowEditor/panels/toolBar/index.js +42 -0
- package/dist/LiteFlowEditor/panels/toolBar/index.module.less +19 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/check.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/check.js +40 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/badge.d.ts +12 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/badge.js +46 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeBtnWidget.d.ts +15 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeBtnWidget.js +133 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeDropdownWidget.d.ts +14 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/common/makeDropdownWidget.js +38 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/fitWindow.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/fitWindow.js +17 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/fullscreen.d.ts +4 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/fullscreen.js +104 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/global.less +6 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/index.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/index.js +12 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/index.module.less +169 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/mock.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/mock.js +83 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/redo.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/redo.js +16 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/save.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/save.js +12 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/selection.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/selection.js +23 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/undo.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/undo.js +16 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/view.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/view.js +37 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/zoom.d.ts +7 -0
- package/dist/LiteFlowEditor/panels/toolBar/widgets/zoom.js +67 -0
- package/dist/LiteFlowEditor/utils/eventBus.d.ts +34 -0
- package/dist/LiteFlowEditor/utils/eventBus.js +86 -0
- package/dist/LiteFlowEditor/utils/flowChartUtils.d.ts +9 -0
- package/dist/LiteFlowEditor/utils/flowChartUtils.js +34 -0
- package/dist/LiteFlowEditor/utils/index.d.ts +33 -0
- package/dist/LiteFlowEditor/utils/index.js +245 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/package.json +97 -0
|
@@ -0,0 +1,171 @@
|
|
|
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 { Edge, Node } from '@antv/x6';
|
|
8
|
+
import ELNode from "../node";
|
|
9
|
+
import { ELEndNode } from "../utils";
|
|
10
|
+
import { ConditionTypeEnum, LITEFLOW_EDGE, NODE_TYPE_INTERMEDIATE_END, NodeTypeEnum } from "../../constant";
|
|
11
|
+
import NodeOperator from "./node-operator";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ๅพช็ฏ็ผๆๆไฝ็ฌฆ๏ผFORใ
|
|
15
|
+
*
|
|
16
|
+
* ไพๅฆไธไธชFORๅพช็ฏ็ผๆ็คบไพ๏ผ
|
|
17
|
+
* (1) EL่กจ่พพๅผ่ฏญๆณ๏ผFOR(x).DO(THEN(a, b))
|
|
18
|
+
* (2) JSON่กจ็คบๅฝขๅผ๏ผ
|
|
19
|
+
* {
|
|
20
|
+
type: ConditionTypeEnum.FOR,
|
|
21
|
+
condition: { type: NodeTypeEnum.FOR, id: 'x' },
|
|
22
|
+
children: [
|
|
23
|
+
{
|
|
24
|
+
type: ConditionTypeEnum.THEN,
|
|
25
|
+
children: [
|
|
26
|
+
{ type: NodeTypeEnum.COMMON, id: 'a' },
|
|
27
|
+
{ type: NodeTypeEnum.COMMON, id: 'b' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
}
|
|
32
|
+
* (3) ้่ฟELNode่็นๆจกๅ่ฟ่ก่กจ็คบ็็ปๅๅ
ณ็ณปไธบ๏ผ
|
|
33
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
34
|
+
โโโโถโ NodeOperator โ
|
|
35
|
+
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
|
36
|
+
โ Chain โโโโโถโ ForOperator โโโโค โโโโโโโโโโโโโโโโโโโ โโโโถโ NodeOperator โ
|
|
37
|
+
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโถโ ThenOperator โโโโค โโโโโโโโโโโโโโโโโโโ
|
|
38
|
+
โโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
|
|
39
|
+
โโโโถโ NodeOperator โ
|
|
40
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
41
|
+
*/
|
|
42
|
+
var ForOperator = /*#__PURE__*/function (_ELNode) {
|
|
43
|
+
_inherits(ForOperator, _ELNode);
|
|
44
|
+
var _super = _createSuper(ForOperator);
|
|
45
|
+
function ForOperator(parent, condition, children, properties) {
|
|
46
|
+
var _this;
|
|
47
|
+
_classCallCheck(this, ForOperator);
|
|
48
|
+
_this = _super.call(this);
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "type", ConditionTypeEnum.FOR);
|
|
50
|
+
_defineProperty(_assertThisInitialized(_this), "parent", void 0);
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "condition", new NodeOperator(_assertThisInitialized(_this), NodeTypeEnum.FOR, '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(ForOperator, [{
|
|
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.FOR
|
|
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 nextStartNode = child.getStartNode();
|
|
122
|
+
cells.push(Edge.create({
|
|
123
|
+
shape: LITEFLOW_EDGE,
|
|
124
|
+
source: start.id,
|
|
125
|
+
target: nextStartNode.id
|
|
126
|
+
}));
|
|
127
|
+
var nextEndNode = child.getEndNode();
|
|
128
|
+
cells.push(Edge.create({
|
|
129
|
+
shape: LITEFLOW_EDGE,
|
|
130
|
+
source: nextEndNode.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, "FOR(").concat(this.condition.toEL(), ").DO(\n").concat(this.children.map(function (x) {
|
|
154
|
+
return x.toEL("".concat(prefix, " "));
|
|
155
|
+
}).join(', \n'), "\n").concat(prefix, ")");
|
|
156
|
+
}
|
|
157
|
+
return "FOR(".concat(this.condition.toEL(), ").DO(").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 ForOperator(parent);
|
|
165
|
+
newNode.appendChild(NodeOperator.create(newNode, type));
|
|
166
|
+
return newNode;
|
|
167
|
+
}
|
|
168
|
+
}]);
|
|
169
|
+
return ForOperator;
|
|
170
|
+
}(ELNode);
|
|
171
|
+
export { ForOperator as default };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Cell, Node } from '@antv/x6';
|
|
2
|
+
import ELNode, { Properties } from '../node';
|
|
3
|
+
import { ConditionTypeEnum, NodeTypeEnum } from '../../constant';
|
|
4
|
+
/**
|
|
5
|
+
* ๆกไปถ็ผๆๆไฝ็ฌฆ๏ผIFใ
|
|
6
|
+
*
|
|
7
|
+
* ไพๅฆไธไธชๆกไปถ็ผๆ(IF)็คบไพ๏ผ
|
|
8
|
+
* (1) EL่กจ่พพๅผ่ฏญๆณ๏ผIF(x, a)
|
|
9
|
+
* (2) JSON่กจ็คบๅฝขๅผ๏ผ
|
|
10
|
+
* {
|
|
11
|
+
type: ConditionTypeEnum.IF,
|
|
12
|
+
condition: { type: NodeTypeEnum.IF, id: 'x' },
|
|
13
|
+
children: [
|
|
14
|
+
{ type: NodeTypeEnum.COMMON, id: 'a' }
|
|
15
|
+
],
|
|
16
|
+
}
|
|
17
|
+
* (3) ้่ฟELNode่็นๆจกๅ่ฟ่ก่กจ็คบ็็ปๅๅ
ณ็ณปไธบ๏ผ
|
|
18
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
19
|
+
โโโโถโ NodeOperator โ
|
|
20
|
+
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
|
|
21
|
+
โ Chain โโโโโถโ IfOperator โโโโค โโโโโโโโโโโโโโโโโโโ
|
|
22
|
+
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโถโ NodeOperator โ
|
|
23
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
24
|
+
*/
|
|
25
|
+
export default class IfOperator extends ELNode {
|
|
26
|
+
type: ConditionTypeEnum;
|
|
27
|
+
parent?: ELNode;
|
|
28
|
+
condition: ELNode;
|
|
29
|
+
children: ELNode[];
|
|
30
|
+
properties?: Properties;
|
|
31
|
+
startNode?: Node;
|
|
32
|
+
endNode?: Node;
|
|
33
|
+
constructor(parent?: ELNode, condition?: ELNode, children?: ELNode[], properties?: Properties);
|
|
34
|
+
/**
|
|
35
|
+
* ๅๅปบๆฐ็่็น
|
|
36
|
+
* @param parent ๆฐ่็น็็ถ่็น
|
|
37
|
+
* @param type ๆฐ่็น็ๅญ่็น็ฑปๅ
|
|
38
|
+
*/
|
|
39
|
+
static create(parent?: ELNode, type?: NodeTypeEnum): ELNode;
|
|
40
|
+
/**
|
|
41
|
+
* ่ฝฌๆขไธบX6็ๅพๆฐๆฎๆ ผๅผ
|
|
42
|
+
*/
|
|
43
|
+
toCells(options?: Record<string, any>): Cell[];
|
|
44
|
+
/**
|
|
45
|
+
* ๅจๅ้ขๆทปๅ ๅญ่็น
|
|
46
|
+
* @param newNode ๅญ่็น
|
|
47
|
+
* @param index ๆๅฎไฝ็ฝฎ๏ผๅฏไปฅๆฏ็ดขๅผ๏ผไนๅฏไปฅๆฏๅ
ๅผ่็น
|
|
48
|
+
*/
|
|
49
|
+
appendChild(newNode: ELNode): boolean;
|
|
50
|
+
appendChild(newNode: ELNode, index: number): boolean;
|
|
51
|
+
appendChild(newNode: ELNode, sibling: ELNode): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* ๅจๅ้ขๆทปๅ ๅญ่็น
|
|
54
|
+
* @param newNode ๅญ่็น
|
|
55
|
+
* @param index ๆๅฎไฝ็ฝฎ๏ผๅฏไปฅๆฏ็ดขๅผ๏ผไนๅฏไปฅๆฏๅ
ๅผ่็น
|
|
56
|
+
*/
|
|
57
|
+
prependChild(newNode: ELNode): boolean;
|
|
58
|
+
prependChild(newNode: ELNode, index: number): boolean;
|
|
59
|
+
prependChild(newNode: ELNode, sibling: ELNode): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* ่ฝฌๆขไธบEL่กจ่พพๅผๅญ็ฌฆไธฒ
|
|
62
|
+
*/
|
|
63
|
+
toEL(prefix?: string): string;
|
|
64
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
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 { Node, Edge } from '@antv/x6';
|
|
10
|
+
import ELNode from "../node";
|
|
11
|
+
import { ELEndNode, ELVirtualNode, generateUniqueId } from "../utils";
|
|
12
|
+
import { ConditionTypeEnum, LITEFLOW_EDGE, NODE_TYPE_INTERMEDIATE_END, NodeTypeEnum } from "../../constant";
|
|
13
|
+
import NodeOperator from "./node-operator";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* ๆกไปถ็ผๆๆไฝ็ฌฆ๏ผIFใ
|
|
17
|
+
*
|
|
18
|
+
* ไพๅฆไธไธชๆกไปถ็ผๆ(IF)็คบไพ๏ผ
|
|
19
|
+
* (1) EL่กจ่พพๅผ่ฏญๆณ๏ผIF(x, a)
|
|
20
|
+
* (2) JSON่กจ็คบๅฝขๅผ๏ผ
|
|
21
|
+
* {
|
|
22
|
+
type: ConditionTypeEnum.IF,
|
|
23
|
+
condition: { type: NodeTypeEnum.IF, id: 'x' },
|
|
24
|
+
children: [
|
|
25
|
+
{ type: NodeTypeEnum.COMMON, id: 'a' }
|
|
26
|
+
],
|
|
27
|
+
}
|
|
28
|
+
* (3) ้่ฟELNode่็นๆจกๅ่ฟ่ก่กจ็คบ็็ปๅๅ
ณ็ณปไธบ๏ผ
|
|
29
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
30
|
+
โโโโถโ NodeOperator โ
|
|
31
|
+
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
|
|
32
|
+
โ Chain โโโโโถโ IfOperator โโโโค โโโโโโโโโโโโโโโโโโโ
|
|
33
|
+
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโถโ NodeOperator โ
|
|
34
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
35
|
+
*/
|
|
36
|
+
var IfOperator = /*#__PURE__*/function (_ELNode) {
|
|
37
|
+
_inherits(IfOperator, _ELNode);
|
|
38
|
+
var _super = _createSuper(IfOperator);
|
|
39
|
+
function IfOperator(parent, condition, children, properties) {
|
|
40
|
+
var _this;
|
|
41
|
+
_classCallCheck(this, IfOperator);
|
|
42
|
+
_this = _super.call(this);
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "type", ConditionTypeEnum.IF);
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "parent", void 0);
|
|
45
|
+
_defineProperty(_assertThisInitialized(_this), "condition", new NodeOperator(_assertThisInitialized(_this), NodeTypeEnum.IF, 'x'));
|
|
46
|
+
_defineProperty(_assertThisInitialized(_this), "children", []);
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "properties", void 0);
|
|
48
|
+
_defineProperty(_assertThisInitialized(_this), "startNode", void 0);
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "endNode", void 0);
|
|
50
|
+
_this.parent = parent;
|
|
51
|
+
if (condition) {
|
|
52
|
+
_this.condition = condition;
|
|
53
|
+
}
|
|
54
|
+
if (children) {
|
|
55
|
+
_this.children = children;
|
|
56
|
+
}
|
|
57
|
+
_this.properties = properties;
|
|
58
|
+
return _this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* ๅๅปบๆฐ็่็น
|
|
63
|
+
* @param parent ๆฐ่็น็็ถ่็น
|
|
64
|
+
* @param type ๆฐ่็น็ๅญ่็น็ฑปๅ
|
|
65
|
+
*/
|
|
66
|
+
_createClass(IfOperator, [{
|
|
67
|
+
key: "toCells",
|
|
68
|
+
value:
|
|
69
|
+
/**
|
|
70
|
+
* ่ฝฌๆขไธบX6็ๅพๆฐๆฎๆ ผๅผ
|
|
71
|
+
*/
|
|
72
|
+
function toCells() {
|
|
73
|
+
var _this2 = this;
|
|
74
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
75
|
+
this.resetCells();
|
|
76
|
+
var condition = this.condition,
|
|
77
|
+
_this$children = this.children,
|
|
78
|
+
children = _this$children === void 0 ? [] : _this$children,
|
|
79
|
+
cells = this.cells;
|
|
80
|
+
condition.toCells({
|
|
81
|
+
shape: NodeTypeEnum.IF
|
|
82
|
+
});
|
|
83
|
+
var start = condition.getStartNode();
|
|
84
|
+
start.setData({
|
|
85
|
+
model: condition,
|
|
86
|
+
toolbar: {
|
|
87
|
+
prepend: true,
|
|
88
|
+
append: false,
|
|
89
|
+
delete: true,
|
|
90
|
+
replace: true,
|
|
91
|
+
collapse: true
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
overwrite: true
|
|
95
|
+
});
|
|
96
|
+
this.startNode = start;
|
|
97
|
+
start = condition.getEndNode();
|
|
98
|
+
if (!this.collapsed) {
|
|
99
|
+
var end = Node.create({
|
|
100
|
+
shape: NODE_TYPE_INTERMEDIATE_END,
|
|
101
|
+
attrs: {
|
|
102
|
+
label: {
|
|
103
|
+
text: ''
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
end.setData({
|
|
108
|
+
model: new ELEndNode(this),
|
|
109
|
+
toolbar: {
|
|
110
|
+
prepend: false,
|
|
111
|
+
append: true,
|
|
112
|
+
delete: true,
|
|
113
|
+
replace: true
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
overwrite: true
|
|
117
|
+
});
|
|
118
|
+
cells.push(this.addNode(end));
|
|
119
|
+
this.endNode = end;
|
|
120
|
+
var _children = _slicedToArray(children, 2),
|
|
121
|
+
trueNode = _children[0],
|
|
122
|
+
falseNode = _children[1];
|
|
123
|
+
[trueNode, falseNode].forEach(function (item, index) {
|
|
124
|
+
var next = item || NodeOperator.create(_this2, NodeTypeEnum.VIRTUAL, ' ');
|
|
125
|
+
next.toCells(options);
|
|
126
|
+
var nextStartNode = next.getStartNode();
|
|
127
|
+
cells.push(Edge.create({
|
|
128
|
+
shape: LITEFLOW_EDGE,
|
|
129
|
+
source: start.id,
|
|
130
|
+
target: nextStartNode.id,
|
|
131
|
+
label: index ? 'false' : 'true'
|
|
132
|
+
}));
|
|
133
|
+
var nextEndNode = next.getEndNode();
|
|
134
|
+
cells.push(Edge.create({
|
|
135
|
+
shape: LITEFLOW_EDGE,
|
|
136
|
+
source: nextEndNode.id,
|
|
137
|
+
target: end.id,
|
|
138
|
+
label: ' '
|
|
139
|
+
}));
|
|
140
|
+
if (!item) {
|
|
141
|
+
nextStartNode.setData({
|
|
142
|
+
model: new ELVirtualNode(_this2, index, next),
|
|
143
|
+
toolbar: {
|
|
144
|
+
prepend: false,
|
|
145
|
+
append: false,
|
|
146
|
+
delete: false,
|
|
147
|
+
replace: true
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
150
|
+
overwrite: true
|
|
151
|
+
});
|
|
152
|
+
cells.push(_this2.addNode(nextStartNode));
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return this.getCells();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* ๅจๅ้ขๆทปๅ ๅญ่็น
|
|
161
|
+
* @param newNode ๅญ่็น
|
|
162
|
+
* @param index ๆๅฎไฝ็ฝฎ๏ผๅฏไปฅๆฏ็ดขๅผ๏ผไนๅฏไปฅๆฏๅ
ๅผ่็น
|
|
163
|
+
*/
|
|
164
|
+
}, {
|
|
165
|
+
key: "appendChild",
|
|
166
|
+
value: function appendChild(newNode, index) {
|
|
167
|
+
newNode.parent = this;
|
|
168
|
+
if (this.children) {
|
|
169
|
+
// ๅฐ่ฏๅจ็ถ่็นไธญๆทปๅ ๆฐ่็น
|
|
170
|
+
if (typeof index === 'number') {
|
|
171
|
+
// 1. ๅฆๆๆ็ดขๅผ
|
|
172
|
+
// this.children.splice(index, this.children[index] ? 1: 0, newNode);
|
|
173
|
+
this.children[index <= 1 ? index : 1] = newNode;
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
if (index) {
|
|
177
|
+
// 2. ๅฆๆๆ็ฎๆ ่็น
|
|
178
|
+
var _index = this.children.indexOf(index);
|
|
179
|
+
if (_index !== -1) {
|
|
180
|
+
// this.children.splice(_index + 1, this.children[_index] ? 1: 0, newNode);
|
|
181
|
+
this.children[_index <= 1 ? _index : 1] = newNode;
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
// 3. ๅฆๆๆฏๅจconditionไนๅ่ฟฝๅ
|
|
185
|
+
if (this.condition === index) {
|
|
186
|
+
return this.appendChild(newNode, 0);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// 4. ๅฆๅ็ดๆฅๆๅ
ฅ
|
|
190
|
+
this.children.push(newNode);
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* ๅจๅ้ขๆทปๅ ๅญ่็น
|
|
198
|
+
* @param newNode ๅญ่็น
|
|
199
|
+
* @param index ๆๅฎไฝ็ฝฎ๏ผๅฏไปฅๆฏ็ดขๅผ๏ผไนๅฏไปฅๆฏๅ
ๅผ่็น
|
|
200
|
+
*/
|
|
201
|
+
}, {
|
|
202
|
+
key: "prependChild",
|
|
203
|
+
value: function prependChild(newNode, index) {
|
|
204
|
+
newNode.parent = this;
|
|
205
|
+
if (this.children) {
|
|
206
|
+
// ๅฐ่ฏๅจ็ถ่็นไธญๆทปๅ ๆฐ่็น
|
|
207
|
+
if (typeof index === 'number') {
|
|
208
|
+
// 1. ๅฆๆๆ็ดขๅผ
|
|
209
|
+
// this.children.splice(index, this.children[index] ? 1: 0, newNode);
|
|
210
|
+
this.children[index] = newNode;
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
if (index) {
|
|
214
|
+
// 2. ๅฆๆๆ็ฎๆ ่็น
|
|
215
|
+
var _index = this.children.indexOf(index);
|
|
216
|
+
if (_index !== -1) {
|
|
217
|
+
// this.children.splice(_index, this.children[_index] ? 1: 0, newNode);
|
|
218
|
+
this.children[_index] = newNode;
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
if (this.condition === index) {
|
|
222
|
+
// 3. ๅฆๆๆฏๅจconditionไนๅ่ฟฝๅ
|
|
223
|
+
return this.prepend(newNode);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// 4. ๅฆๅ็ดๆฅๆๅ
ฅ
|
|
227
|
+
this.children.splice(0, this.children[0] ? 1 : 0, newNode);
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* ่ฝฌๆขไธบEL่กจ่พพๅผๅญ็ฌฆไธฒ
|
|
235
|
+
*/
|
|
236
|
+
}, {
|
|
237
|
+
key: "toEL",
|
|
238
|
+
value: function toEL() {
|
|
239
|
+
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
240
|
+
if (prefix) {
|
|
241
|
+
return "".concat(prefix, "IF(\n").concat([this.condition.toEL("".concat(prefix, " "))].concat(_toConsumableArray(this.children.filter(function (x) {
|
|
242
|
+
return x;
|
|
243
|
+
}).map(function (x) {
|
|
244
|
+
return x.toEL("".concat(prefix, " "));
|
|
245
|
+
}))).join(', \n'), "\n").concat(prefix, ")").concat(this.propertiesToEL());
|
|
246
|
+
}
|
|
247
|
+
return "IF(".concat([this.condition.toEL()].concat(_toConsumableArray(this.children.filter(function (x) {
|
|
248
|
+
return x;
|
|
249
|
+
}).map(function (x) {
|
|
250
|
+
return x.toEL();
|
|
251
|
+
}))).join(', '), ")").concat(this.propertiesToEL());
|
|
252
|
+
}
|
|
253
|
+
}], [{
|
|
254
|
+
key: "create",
|
|
255
|
+
value: function create(parent, type) {
|
|
256
|
+
var newNode = new IfOperator(parent);
|
|
257
|
+
newNode.appendChild(NodeOperator.create(newNode, type, undefined, {
|
|
258
|
+
tag: generateUniqueId()
|
|
259
|
+
}));
|
|
260
|
+
return newNode;
|
|
261
|
+
}
|
|
262
|
+
}]);
|
|
263
|
+
return IfOperator;
|
|
264
|
+
}(ELNode);
|
|
265
|
+
export { IfOperator as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EL่กจ่พพๅผๅไธชๆไฝ็ฌฆๆจกๅ๏ผ็ปงๆฟๅ
ณ็ณปไธบ๏ผ
|
|
3
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
4
|
+
โโโโถโ ThenOperator โ
|
|
5
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
6
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
7
|
+
โโโโถโ WhenOperator โ
|
|
8
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
9
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
10
|
+
โโโโถโ SwitchOperator โ
|
|
11
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
12
|
+
โโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
|
|
13
|
+
โ ELNode โโโโโโผโโโถโ IfOperator โ
|
|
14
|
+
โโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
|
|
15
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
16
|
+
โโโโถโ ForOperator โ
|
|
17
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
18
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
19
|
+
โโโโถโ WhileOperator โ
|
|
20
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
21
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
22
|
+
โโโโถโ CatchOperator โ
|
|
23
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
24
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
25
|
+
โโโโถโ NodeOperator โ
|
|
26
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
27
|
+
*/
|
|
28
|
+
export { default as ThenOperator } from './then-operator';
|
|
29
|
+
export { default as WhenOperator } from './when-operator';
|
|
30
|
+
export { default as SwitchOperator } from './switch-operator';
|
|
31
|
+
export { default as IfOperator } from './if-operator';
|
|
32
|
+
export { default as ForOperator } from './for-operator';
|
|
33
|
+
export { default as WhileOperator } from './while-operator';
|
|
34
|
+
export { default as IteratorOperator } from './iterator-operator';
|
|
35
|
+
export { default as CatchOperator } from './catch-operator';
|
|
36
|
+
export { default as AndOperator } from './and-operator';
|
|
37
|
+
export { default as OrOperator } from './or-operator';
|
|
38
|
+
export { default as NotOperator } from './not-operator';
|
|
39
|
+
export { default as NodeOperator } from './node-operator';
|
|
40
|
+
export { default as ChainOperator } from './chain-operator';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EL่กจ่พพๅผๅไธชๆไฝ็ฌฆๆจกๅ๏ผ็ปงๆฟๅ
ณ็ณปไธบ๏ผ
|
|
3
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
4
|
+
โโโโถโ ThenOperator โ
|
|
5
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
6
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
7
|
+
โโโโถโ WhenOperator โ
|
|
8
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
9
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
10
|
+
โโโโถโ SwitchOperator โ
|
|
11
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
12
|
+
โโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
|
|
13
|
+
โ ELNode โโโโโโผโโโถโ IfOperator โ
|
|
14
|
+
โโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
|
|
15
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
16
|
+
โโโโถโ ForOperator โ
|
|
17
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
18
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
19
|
+
โโโโถโ WhileOperator โ
|
|
20
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
21
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
22
|
+
โโโโถโ CatchOperator โ
|
|
23
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
24
|
+
โ โโโโโโโโโโโโโโโโโโโ
|
|
25
|
+
โโโโถโ NodeOperator โ
|
|
26
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
27
|
+
*/
|
|
28
|
+
// 1. ้กบๅบ็ฑป
|
|
29
|
+
export { default as ThenOperator } from "./then-operator";
|
|
30
|
+
export { default as WhenOperator } from "./when-operator";
|
|
31
|
+
// 2. ๅๆฏ็ฑป
|
|
32
|
+
export { default as SwitchOperator } from "./switch-operator";
|
|
33
|
+
export { default as IfOperator } from "./if-operator";
|
|
34
|
+
// 3. ๅพช็ฏ็ฑป
|
|
35
|
+
export { default as ForOperator } from "./for-operator";
|
|
36
|
+
export { default as WhileOperator } from "./while-operator";
|
|
37
|
+
export { default as IteratorOperator } from "./iterator-operator";
|
|
38
|
+
// 4. ๆ่ทๅผๅธธ
|
|
39
|
+
export { default as CatchOperator } from "./catch-operator";
|
|
40
|
+
// 5. ่ฟ็ฎ็ฌฆ
|
|
41
|
+
export { default as AndOperator } from "./and-operator";
|
|
42
|
+
export { default as OrOperator } from "./or-operator";
|
|
43
|
+
export { default as NotOperator } from "./not-operator";
|
|
44
|
+
// 6. ่็น็ฑป
|
|
45
|
+
export { default as NodeOperator } from "./node-operator";
|
|
46
|
+
// 7. ๅญๆต็จ
|
|
47
|
+
export { default as ChainOperator } from "./chain-operator";
|
|
@@ -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
|
+
* Iterator็ผๆๆไฝ็ฌฆ๏ผITERATORใ
|
|
6
|
+
*
|
|
7
|
+
* ไพๅฆไธไธชITERATORๅพช็ฏ็ผๆ็คบไพ๏ผ
|
|
8
|
+
* (1) EL่กจ่พพๅผ่ฏญๆณ๏ผITERATOR(x).DO(THEN(a, b))
|
|
9
|
+
* (2) JSON่กจ็คบๅฝขๅผ๏ผ
|
|
10
|
+
* {
|
|
11
|
+
type: ConditionTypeEnum.ITERATOR,
|
|
12
|
+
condition: { type: NodeTypeEnum.ITERATOR, id: 'x' },
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
type: ConditionTypeEnum.THEN,
|
|
16
|
+
children: [
|
|
17
|
+
{ type: NodeTypeEnum.COMMON, id: 'a' },
|
|
18
|
+
{ type: NodeTypeEnum.COMMON, id: 'b' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
}
|
|
23
|
+
* (3) ้่ฟELNode่็นๆจกๅ่ฟ่ก่กจ็คบ็็ปๅๅ
ณ็ณปไธบ๏ผ
|
|
24
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
25
|
+
โโโโถโ NodeOperator โ
|
|
26
|
+
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
|
27
|
+
โ Chain โโโโโถโ IteratorOperator โโโโค โโโโโโโโโโโโโโโโโโโ โโโโถโ NodeOperator โ
|
|
28
|
+
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโถโ ThenOperator โโโโค โโโโโโโโโโโโโโโโโโโ
|
|
29
|
+
โโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
|
|
30
|
+
โโโโถโ NodeOperator โ
|
|
31
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
32
|
+
*/
|
|
33
|
+
export default class IteratorOperator 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
|
+
}
|