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,133 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import { Tooltip, Popover, message, Empty } from 'antd';
|
|
4
|
+
import styles from "../index.module.less";
|
|
5
|
+
import { useGraph } from "../../../../hooks";
|
|
6
|
+
import GraphContext from "../../../../context/GraphContext";
|
|
7
|
+
import commonIcon from "../../../../assets/common-icon.svg";
|
|
8
|
+
import warningIcon from "../../../../assets/warning-icon.svg";
|
|
9
|
+
import littleWarningIcon from "../../../../assets/little-warning-icon.svg";
|
|
10
|
+
import "../global.less";
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
12
|
+
var makeBtnWidget = function makeBtnWidget(options) {
|
|
13
|
+
var Widget = function Widget(props) {
|
|
14
|
+
var _useTranslation = useTranslation(),
|
|
15
|
+
t = _useTranslation.t;
|
|
16
|
+
var flowGraph = useGraph();
|
|
17
|
+
var _message$useMessage = message.useMessage(),
|
|
18
|
+
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
19
|
+
messageApi = _message$useMessage2[0],
|
|
20
|
+
contextHolder = _message$useMessage2[1];
|
|
21
|
+
var tooltip = options.tooltip,
|
|
22
|
+
getIcon = options.getIcon,
|
|
23
|
+
handler = options.handler;
|
|
24
|
+
var _useContext = useContext(GraphContext),
|
|
25
|
+
checkList = _useContext.checkList;
|
|
26
|
+
var _React$useState = React.useState(false),
|
|
27
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
28
|
+
popIsOpen = _React$useState2[0],
|
|
29
|
+
setPopIsOpen = _React$useState2[1];
|
|
30
|
+
var iconWrapperCls = [styles.btnWidget];
|
|
31
|
+
var handleOpenChange = function handleOpenChange(open) {
|
|
32
|
+
setPopIsOpen(open);
|
|
33
|
+
};
|
|
34
|
+
var handleCheckItem = function handleCheckItem(item) {
|
|
35
|
+
return function () {
|
|
36
|
+
setPopIsOpen(false);
|
|
37
|
+
// console.log('item', item);
|
|
38
|
+
if (!Object.keys(item.model).length) {
|
|
39
|
+
messageApi.open({
|
|
40
|
+
type: 'warning',
|
|
41
|
+
content: t('check_list_tips_2')
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
} else {
|
|
45
|
+
messageApi.open({
|
|
46
|
+
type: 'warning',
|
|
47
|
+
content: item.message
|
|
48
|
+
});
|
|
49
|
+
flowGraph.selection.reset(item.model.node);
|
|
50
|
+
flowGraph.centerCell(item.model.node);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
var checkContent = /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: styles.checkContent
|
|
56
|
+
}, contextHolder, /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: styles.checkContentTitle
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: styles.grow
|
|
60
|
+
}, t('check_list'), checkList.length ? "(".concat(checkList.length, ")") : "")), checkList.length ? /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: styles.checkContentList
|
|
62
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: styles.checkTips
|
|
64
|
+
}, t('check_list_tips')), /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: styles.checkBox
|
|
66
|
+
}, checkList.map(function (item, index) {
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
key: index,
|
|
69
|
+
className: styles.checkContentItem,
|
|
70
|
+
onClick: handleCheckItem(item)
|
|
71
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: styles.checkContentItemTitle
|
|
73
|
+
}, Object.keys(item.model).length ? /*#__PURE__*/React.createElement("img", {
|
|
74
|
+
src: commonIcon,
|
|
75
|
+
alt: "",
|
|
76
|
+
className: styles.icon
|
|
77
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
78
|
+
src: warningIcon,
|
|
79
|
+
alt: "",
|
|
80
|
+
className: styles.icon
|
|
81
|
+
}), /*#__PURE__*/React.createElement("span", null, Object.keys(item.model).length ? item.model.properties.scriptName ? item.model.properties.scriptName : item.model.id : t('tips'))), /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: styles.checkContentItemDesc
|
|
83
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
84
|
+
src: littleWarningIcon,
|
|
85
|
+
alt: "",
|
|
86
|
+
className: styles.icon,
|
|
87
|
+
style: {
|
|
88
|
+
width: '12px',
|
|
89
|
+
height: '12px'
|
|
90
|
+
}
|
|
91
|
+
}), /*#__PURE__*/React.createElement("span", null, item.message)));
|
|
92
|
+
}))) : /*#__PURE__*/React.createElement(Empty, {
|
|
93
|
+
description: t('check_list_tips_3'),
|
|
94
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
95
|
+
}));
|
|
96
|
+
var _options$disabled = options.disabled,
|
|
97
|
+
disabled = _options$disabled === void 0 ? false : _options$disabled,
|
|
98
|
+
_options$selected = options.selected,
|
|
99
|
+
selected = _options$selected === void 0 ? false : _options$selected;
|
|
100
|
+
if (typeof disabled === 'function') {
|
|
101
|
+
disabled = disabled(flowGraph);
|
|
102
|
+
disabled && iconWrapperCls.push(styles.disabled);
|
|
103
|
+
}
|
|
104
|
+
if (typeof selected === 'function') {
|
|
105
|
+
selected = selected(flowGraph);
|
|
106
|
+
selected && iconWrapperCls.push(styles.selected);
|
|
107
|
+
}
|
|
108
|
+
var onClick = function onClick() {
|
|
109
|
+
if (disabled) return;
|
|
110
|
+
handler(flowGraph, props, checkList);
|
|
111
|
+
flowGraph.trigger('toolBar:forceUpdate');
|
|
112
|
+
};
|
|
113
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, tooltip == 'view_check_items' ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
114
|
+
title: t('view_check_items')
|
|
115
|
+
}, /*#__PURE__*/React.createElement(Popover, {
|
|
116
|
+
placement: "bottom",
|
|
117
|
+
content: checkContent,
|
|
118
|
+
trigger: "click",
|
|
119
|
+
open: popIsOpen,
|
|
120
|
+
onOpenChange: handleOpenChange
|
|
121
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
122
|
+
className: iconWrapperCls.join(' '),
|
|
123
|
+
onClick: onClick
|
|
124
|
+
}, getIcon(flowGraph, checkList)))) : /*#__PURE__*/React.createElement(Tooltip, {
|
|
125
|
+
title: t(tooltip)
|
|
126
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
127
|
+
className: iconWrapperCls.join(' '),
|
|
128
|
+
onClick: onClick
|
|
129
|
+
}, getIcon(flowGraph, checkList))));
|
|
130
|
+
};
|
|
131
|
+
return Widget;
|
|
132
|
+
};
|
|
133
|
+
export default makeBtnWidget;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { Graph } from '@antv/x6';
|
|
3
|
+
interface IOptions {
|
|
4
|
+
tooltip: string;
|
|
5
|
+
getIcon: (flowGraph: Graph) => ReactElement;
|
|
6
|
+
getOverlay: (flowGraph: Graph, onChange: (data: any) => void) => ReactElement;
|
|
7
|
+
handler: (flowGraph: Graph, data: any) => void;
|
|
8
|
+
disabled?: (flowGraph: Graph) => boolean;
|
|
9
|
+
}
|
|
10
|
+
interface IDropdownWidgetProps {
|
|
11
|
+
flowGraph: Graph;
|
|
12
|
+
}
|
|
13
|
+
declare const makeDropdownWidget: (options: IOptions) => React.FC<IDropdownWidgetProps>;
|
|
14
|
+
export default makeDropdownWidget;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip, Dropdown } from 'antd';
|
|
3
|
+
import { CaretDownOutlined } from '@ant-design/icons';
|
|
4
|
+
import styles from "../index.module.less";
|
|
5
|
+
var makeDropdownWidget = function makeDropdownWidget(options) {
|
|
6
|
+
var Widget = function Widget(props) {
|
|
7
|
+
var flowGraph = props.flowGraph;
|
|
8
|
+
var tooltip = options.tooltip,
|
|
9
|
+
getIcon = options.getIcon,
|
|
10
|
+
getOverlay = options.getOverlay,
|
|
11
|
+
handler = options.handler;
|
|
12
|
+
var iconWrapperCls = [styles.btnWidget];
|
|
13
|
+
var _options$disabled = options.disabled,
|
|
14
|
+
disabled = _options$disabled === void 0 ? false : _options$disabled;
|
|
15
|
+
if (typeof disabled === 'function') {
|
|
16
|
+
disabled = disabled(flowGraph);
|
|
17
|
+
disabled && iconWrapperCls.push(styles.disabled);
|
|
18
|
+
}
|
|
19
|
+
var onChange = function onChange(data) {
|
|
20
|
+
if (disabled) return;
|
|
21
|
+
handler(flowGraph, data);
|
|
22
|
+
flowGraph.trigger('toolBar:forceUpdate');
|
|
23
|
+
};
|
|
24
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
25
|
+
title: tooltip
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
27
|
+
disabled: disabled,
|
|
28
|
+
overlay: getOverlay(flowGraph, onChange),
|
|
29
|
+
trigger: ['click']
|
|
30
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: iconWrapperCls.join(' ')
|
|
32
|
+
}, getIcon(flowGraph), " ", /*#__PURE__*/React.createElement(CaretDownOutlined, {
|
|
33
|
+
className: styles.caret
|
|
34
|
+
}))));
|
|
35
|
+
};
|
|
36
|
+
return Widget;
|
|
37
|
+
};
|
|
38
|
+
export default makeDropdownWidget;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import makeBtnWidget from "./common/makeBtnWidget";
|
|
3
|
+
import { LayoutOutlined } from '@ant-design/icons';
|
|
4
|
+
import { MIN_ZOOM } from "../../../constant";
|
|
5
|
+
var FitWindow = makeBtnWidget({
|
|
6
|
+
tooltip: 'adaptation_window',
|
|
7
|
+
getIcon: function getIcon() {
|
|
8
|
+
return /*#__PURE__*/React.createElement(LayoutOutlined, null);
|
|
9
|
+
},
|
|
10
|
+
handler: function handler(flowGraph) {
|
|
11
|
+
flowGraph.zoomToFit({
|
|
12
|
+
minScale: MIN_ZOOM,
|
|
13
|
+
maxScale: 1
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export default FitWindow;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
4
|
+
import { FullscreenOutlined, FullscreenExitOutlined } from '@ant-design/icons';
|
|
5
|
+
import makeBtnWidget from "./common/makeBtnWidget";
|
|
6
|
+
import { useGraph, useGraphWrapper } from "../../../hooks";
|
|
7
|
+
export function getFullscreenElement() {
|
|
8
|
+
var element = document;
|
|
9
|
+
return element.fullscreenElement || element.mozFullScreenElement || element.msFullScreenElement || element.webkitFullscreenElement || null;
|
|
10
|
+
}
|
|
11
|
+
var previousSize = {
|
|
12
|
+
width: 800,
|
|
13
|
+
height: 500
|
|
14
|
+
};
|
|
15
|
+
var _onFullscreenChange = function onFullscreenChange() {
|
|
16
|
+
// Do nothing
|
|
17
|
+
};
|
|
18
|
+
var Fullscreen = makeBtnWidget({
|
|
19
|
+
tooltip: 'full_screen',
|
|
20
|
+
handler: function handler(flowGraph, props) {
|
|
21
|
+
var element = props.graphWrapperRef.current;
|
|
22
|
+
previousSize.width = element.clientWidth;
|
|
23
|
+
previousSize.height = element.clientHeight;
|
|
24
|
+
_onFullscreenChange = function onFullscreenChange() {
|
|
25
|
+
flowGraph.resize(previousSize.width, previousSize.height);
|
|
26
|
+
flowGraph.centerContent();
|
|
27
|
+
document.removeEventListener('fullscreenchange', _onFullscreenChange);
|
|
28
|
+
flowGraph.trigger('flowGraph:fullscreenchange');
|
|
29
|
+
};
|
|
30
|
+
if (element.requestFullscreen) {
|
|
31
|
+
element.requestFullscreen();
|
|
32
|
+
} else if (element.mozRequestFullScreen) {
|
|
33
|
+
element.mozRequestFullScreen();
|
|
34
|
+
} else if (element.msRequestFullscreen) {
|
|
35
|
+
element.msRequestFullscreen();
|
|
36
|
+
} else if (element.webkitRequestFullscreen) {
|
|
37
|
+
element.webkitRequestFullscreen();
|
|
38
|
+
}
|
|
39
|
+
setTimeout(function () {
|
|
40
|
+
flowGraph.resize(element.clientWidth, element.clientHeight);
|
|
41
|
+
flowGraph.centerContent();
|
|
42
|
+
document.addEventListener('fullscreenchange', _onFullscreenChange);
|
|
43
|
+
flowGraph.trigger('flowGraph:fullscreenchange');
|
|
44
|
+
}, 300);
|
|
45
|
+
},
|
|
46
|
+
getIcon: function getIcon() {
|
|
47
|
+
return /*#__PURE__*/React.createElement(FullscreenOutlined, null);
|
|
48
|
+
},
|
|
49
|
+
disabled: function disabled() {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
var FullscreenExit = makeBtnWidget({
|
|
54
|
+
tooltip: '退出全屏',
|
|
55
|
+
handler: function handler() {
|
|
56
|
+
if (getFullscreenElement()) {
|
|
57
|
+
if (_onFullscreenChange) {
|
|
58
|
+
_onFullscreenChange();
|
|
59
|
+
}
|
|
60
|
+
var element = document;
|
|
61
|
+
if (element.exitFullscreen) {
|
|
62
|
+
element.exitFullscreen();
|
|
63
|
+
} else if (element.mozCancelFullScreen) {
|
|
64
|
+
element.mozCancelFullScreen();
|
|
65
|
+
} else if (element.msExitFullscreen) {
|
|
66
|
+
element.msExitFullscreen();
|
|
67
|
+
} else if (element.webkitExitFullscreen) {
|
|
68
|
+
element.webkitExitFullscreen();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
getIcon: function getIcon() {
|
|
73
|
+
return /*#__PURE__*/React.createElement(FullscreenExitOutlined, null);
|
|
74
|
+
},
|
|
75
|
+
disabled: function disabled() {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
var FullscreenTools = function FullscreenTools(props) {
|
|
80
|
+
var flowGraph = useGraph();
|
|
81
|
+
var graphWrapperRef = useGraphWrapper();
|
|
82
|
+
var _useState = useState(false),
|
|
83
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
+
isFullscreen = _useState2[0],
|
|
85
|
+
setIsFullscreen = _useState2[1];
|
|
86
|
+
useEffect(function () {
|
|
87
|
+
function fullscreenchange() {
|
|
88
|
+
setIsFullscreen(!isFullscreen);
|
|
89
|
+
}
|
|
90
|
+
flowGraph.on('flowGraph:fullscreenchange', fullscreenchange);
|
|
91
|
+
return function () {
|
|
92
|
+
flowGraph.off('flowGraph:fullscreenchange', fullscreenchange);
|
|
93
|
+
};
|
|
94
|
+
}, [flowGraph, setIsFullscreen, isFullscreen]);
|
|
95
|
+
if (isFullscreen) {
|
|
96
|
+
return /*#__PURE__*/React.createElement(FullscreenExit, _extends({}, props, {
|
|
97
|
+
graphWrapperRef: graphWrapperRef
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
return /*#__PURE__*/React.createElement(Fullscreen, _extends({}, props, {
|
|
101
|
+
graphWrapperRef: graphWrapperRef
|
|
102
|
+
}));
|
|
103
|
+
};
|
|
104
|
+
export default FullscreenTools;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// import Save from './save';
|
|
2
|
+
import Selection from "./selection";
|
|
3
|
+
import Undo from "./undo";
|
|
4
|
+
import Redo from "./redo";
|
|
5
|
+
import Zoom from "./zoom";
|
|
6
|
+
import FitWindow from "./fitWindow";
|
|
7
|
+
// import View from './view';
|
|
8
|
+
import Fullscreen from "./fullscreen";
|
|
9
|
+
// import Mock from './mock';
|
|
10
|
+
import Check from "./check";
|
|
11
|
+
var tools = [[Zoom], [FitWindow, Undo, Redo, Selection, Fullscreen, Check]];
|
|
12
|
+
export default tools;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
@--tw-ring-offset-shadow: 0 0 #0000;
|
|
2
|
+
@--tw-ring-shadow: 0 0 #0000;
|
|
3
|
+
@--tw-shadow: 0px 4px 6px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08);
|
|
4
|
+
.btnWidget {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding: 0 8px;
|
|
10
|
+
min-width: 34px;
|
|
11
|
+
height: 34px;
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
border-radius: 2px;
|
|
14
|
+
border: 0.5px solid transparent;
|
|
15
|
+
|
|
16
|
+
.caret {
|
|
17
|
+
margin-left: 4px;
|
|
18
|
+
font-size: 10px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
border: 0.5px solid #ccc;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.selected {
|
|
27
|
+
border: 0.5px solid #ccc;
|
|
28
|
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
29
|
+
background-color: #eee;
|
|
30
|
+
background-image: linear-gradient(top, #eee, #e0e0e0);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.disabled {
|
|
34
|
+
color: #ccc;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.disabled:hover {
|
|
38
|
+
cursor: default;
|
|
39
|
+
border: 0.5px solid transparent;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.zoomContainer {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
align-items: center;
|
|
47
|
+
|
|
48
|
+
.zoomText {
|
|
49
|
+
width: 45px;
|
|
50
|
+
text-align: center;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.modifyStatusContainer {
|
|
55
|
+
margin-left: 8px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bgColorContainer,
|
|
59
|
+
.textColorContainer,
|
|
60
|
+
.borderColorContainer {
|
|
61
|
+
position: relative;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
|
|
66
|
+
.fillIcon {
|
|
67
|
+
position: relative;
|
|
68
|
+
top: -2px;
|
|
69
|
+
font-size: 15px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.textIcon {
|
|
73
|
+
position: relative;
|
|
74
|
+
top: -2px;
|
|
75
|
+
font-size: 15px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.borderColorIcon {
|
|
79
|
+
position: relative;
|
|
80
|
+
top: -2px;
|
|
81
|
+
font-size: 15px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.colorPreview {
|
|
85
|
+
position: absolute;
|
|
86
|
+
bottom: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
height: 1.6px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.checkContent {
|
|
94
|
+
width: 420px;
|
|
95
|
+
max-height: 66vh;
|
|
96
|
+
overflow-y: auto;
|
|
97
|
+
border-radius: 1rem;
|
|
98
|
+
background-color: #fff;
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
|
|
101
|
+
.icon{
|
|
102
|
+
width: 18px;
|
|
103
|
+
height: 18px;
|
|
104
|
+
margin-right: .475rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.checkContentTitle{
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: 44px;
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
color: #101828;
|
|
114
|
+
position: sticky;
|
|
115
|
+
top: 0;
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
padding: .75rem 1rem .75rem 1rem;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
background-color: #fff;
|
|
120
|
+
.grow{
|
|
121
|
+
flex-grow: 1;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
.checkContentList{
|
|
125
|
+
box-sizing: border-box;
|
|
126
|
+
padding: .5rem 0;
|
|
127
|
+
.checkTips{
|
|
128
|
+
color: #676f83;
|
|
129
|
+
font-size: .75rem;
|
|
130
|
+
line-height: 1rem;
|
|
131
|
+
padding: 0 1rem;
|
|
132
|
+
box-sizing: border-box;
|
|
133
|
+
}
|
|
134
|
+
.checkBox{
|
|
135
|
+
padding: .5rem 1rem;
|
|
136
|
+
box-sizing: border-box;
|
|
137
|
+
.checkContentItem{
|
|
138
|
+
margin-bottom: .5rem;
|
|
139
|
+
border-radius: .5rem;
|
|
140
|
+
border: .5px solid #eaecf0;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
box-shadow: @--tw-ring-offset-shadow, @--tw-ring-shadow, @--tw-shadow;
|
|
143
|
+
box-sizing: border-box;
|
|
144
|
+
border-top-right-radius: .5rem;
|
|
145
|
+
border-top-left-radius: .5rem;
|
|
146
|
+
.checkContentItemTitle{
|
|
147
|
+
font-size: .75rem;
|
|
148
|
+
line-height: 1rem;
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
padding:.5rem;
|
|
152
|
+
box-sizing: border-box;
|
|
153
|
+
}
|
|
154
|
+
.checkContentItemDesc{
|
|
155
|
+
border-top: .5px solid #eaecf0;
|
|
156
|
+
border-bottom-right-radius: .5rem;
|
|
157
|
+
border-bottom-left-radius: .5rem;
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
padding: 1rem .75rem;
|
|
161
|
+
box-sizing: border-box;
|
|
162
|
+
color: #676f83;
|
|
163
|
+
font-size: .75rem;
|
|
164
|
+
line-height: 18px;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useContext, useState } from 'react';
|
|
3
|
+
import { Select } from 'antd';
|
|
4
|
+
import mocks from "../../../mock";
|
|
5
|
+
import { ConditionTypeEnum } from "../../../constant";
|
|
6
|
+
import styles from "./index.module.less";
|
|
7
|
+
import GraphContext from "../../../context/GraphContext";
|
|
8
|
+
var Mock = function Mock(props) {
|
|
9
|
+
// const {flowGraph} = props;
|
|
10
|
+
var _useState = useState(''),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
selectedValue = _useState2[0],
|
|
13
|
+
setSelectedValue = _useState2[1];
|
|
14
|
+
var _useContext = useContext(GraphContext),
|
|
15
|
+
currentEditor = _useContext.currentEditor,
|
|
16
|
+
chainObject = _useContext.chainObject;
|
|
17
|
+
var handleOnChange = function handleOnChange(value) {
|
|
18
|
+
setSelectedValue(value);
|
|
19
|
+
var mockData = mocks[value];
|
|
20
|
+
currentEditor.fromJSON(mockData);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// useEffect(() => {
|
|
24
|
+
// setTimeout(() => {
|
|
25
|
+
// if (chainObject?.dslData) {
|
|
26
|
+
// currentEditor.fromJSON(chainObject?.dslData);
|
|
27
|
+
// return;
|
|
28
|
+
// }
|
|
29
|
+
// currentEditor.fromJSON({});
|
|
30
|
+
// }, 500);
|
|
31
|
+
// }, [flowGraph]);
|
|
32
|
+
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: styles.zoomContainer,
|
|
35
|
+
style: {
|
|
36
|
+
margin: '0 8px'
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u793A\u4F8B\u6570\u636E\uFF1A"), /*#__PURE__*/React.createElement(Select, {
|
|
39
|
+
placeholder: "\u8BF7\u9009\u62E9\u793A\u4F8B\u6570\u636E",
|
|
40
|
+
value: selectedValue,
|
|
41
|
+
style: {
|
|
42
|
+
width: 200
|
|
43
|
+
},
|
|
44
|
+
onChange: handleOnChange,
|
|
45
|
+
options: [{
|
|
46
|
+
label: '顺序类',
|
|
47
|
+
options: [{
|
|
48
|
+
label: '串行编排(THEN)',
|
|
49
|
+
value: ConditionTypeEnum.THEN
|
|
50
|
+
}, {
|
|
51
|
+
label: '并行编排(WHEN)',
|
|
52
|
+
value: ConditionTypeEnum.WHEN
|
|
53
|
+
}]
|
|
54
|
+
}, {
|
|
55
|
+
label: '分支类',
|
|
56
|
+
options: [{
|
|
57
|
+
label: '选择编排(SWITCH)',
|
|
58
|
+
value: ConditionTypeEnum.SWITCH
|
|
59
|
+
}, {
|
|
60
|
+
label: '条件编排(IF)',
|
|
61
|
+
value: ConditionTypeEnum.IF
|
|
62
|
+
}]
|
|
63
|
+
}
|
|
64
|
+
// {
|
|
65
|
+
// label: '循环类',
|
|
66
|
+
// options: [
|
|
67
|
+
// {label: 'FOR循环', value: ConditionTypeEnum.FOR},
|
|
68
|
+
// {label: 'WHILE循环', value: ConditionTypeEnum.WHILE},
|
|
69
|
+
// {label: 'ITERATOR循环', value: ConditionTypeEnum.ITERATOR},
|
|
70
|
+
// ],
|
|
71
|
+
// },
|
|
72
|
+
// {
|
|
73
|
+
// label: '其他类',
|
|
74
|
+
// options: [
|
|
75
|
+
// {label: '捕获异常(CATCH)', value: ConditionTypeEnum.CATCH},
|
|
76
|
+
// {label: '与或非(AND_OR_NOT)', value: ConditionTypeEnum.AND},
|
|
77
|
+
// {label: '子流程(CHAIN)', value: ConditionTypeEnum.CHAIN},
|
|
78
|
+
// ],
|
|
79
|
+
// },
|
|
80
|
+
]
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
export default Mock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RedoOutlined } from '@ant-design/icons';
|
|
3
|
+
import { shortcuts } from "../../../common/shortcuts";
|
|
4
|
+
import makeBtnWidget from "./common/makeBtnWidget";
|
|
5
|
+
import { history } from "../../../hooks/useHistory";
|
|
6
|
+
var Save = makeBtnWidget({
|
|
7
|
+
tooltip: 'redo',
|
|
8
|
+
handler: shortcuts.redo.handler,
|
|
9
|
+
getIcon: function getIcon() {
|
|
10
|
+
return /*#__PURE__*/React.createElement(RedoOutlined, null);
|
|
11
|
+
},
|
|
12
|
+
disabled: function disabled() {
|
|
13
|
+
return !history.canRedo();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export default Save;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SaveOutlined } from '@ant-design/icons';
|
|
3
|
+
import { shortcuts } from "../../../common/shortcuts";
|
|
4
|
+
import makeBtnWidget from "./common/makeBtnWidget";
|
|
5
|
+
var Save = makeBtnWidget({
|
|
6
|
+
tooltip: 'save',
|
|
7
|
+
handler: shortcuts.save.handler,
|
|
8
|
+
getIcon: function getIcon() {
|
|
9
|
+
return /*#__PURE__*/React.createElement(SaveOutlined, null);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export default Save;
|