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,54 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Form } from 'antd';
|
|
7
|
+
import { debounce } from 'lodash';
|
|
8
|
+
import { history } from "../../../hooks/useHistory";
|
|
9
|
+
import styles from "./index.module.less";
|
|
10
|
+
var WHEN_ANY_TRUE = true;
|
|
11
|
+
var WHEN_ANY_FALSE = false;
|
|
12
|
+
var ConditionPropertiesEditor = function ConditionPropertiesEditor(props) {
|
|
13
|
+
var model = props.model;
|
|
14
|
+
var properties = model.getProperties();
|
|
15
|
+
var _Form$useForm = Form.useForm(),
|
|
16
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
17
|
+
form = _Form$useForm2[0];
|
|
18
|
+
var handleOnChange = debounce( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
19
|
+
var changedValues;
|
|
20
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
_context.prev = 0;
|
|
24
|
+
_context.next = 3;
|
|
25
|
+
return form.validateFields();
|
|
26
|
+
case 3:
|
|
27
|
+
changedValues = _context.sent;
|
|
28
|
+
// console.log(changedValues);
|
|
29
|
+
model.setProperties(_objectSpread(_objectSpread({}, properties), changedValues));
|
|
30
|
+
history.push(undefined, {
|
|
31
|
+
silent: true
|
|
32
|
+
});
|
|
33
|
+
_context.next = 11;
|
|
34
|
+
break;
|
|
35
|
+
case 8:
|
|
36
|
+
_context.prev = 8;
|
|
37
|
+
_context.t0 = _context["catch"](0);
|
|
38
|
+
console.log('Failed:', _context.t0);
|
|
39
|
+
case 11:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
42
|
+
}
|
|
43
|
+
}, _callee, null, [[0, 8]]);
|
|
44
|
+
})), 200);
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: styles.liteflowEditorPropertiesEditorContainer
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
48
|
+
layout: "vertical",
|
|
49
|
+
form: form,
|
|
50
|
+
initialValues: _objectSpread({}, properties),
|
|
51
|
+
onValuesChange: handleOnChange
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
export default ConditionPropertiesEditor;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
.liteflowEditorPropertiesEditorContainer {
|
|
2
|
+
// height: 900px;
|
|
3
|
+
// overflow-y: auto;
|
|
4
|
+
padding: 10px;
|
|
5
|
+
|
|
6
|
+
:global {
|
|
7
|
+
.ant-form-item {
|
|
8
|
+
margin-bottom: 8px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ant-input-number {
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.liteflowEditorPropertiesInformation {
|
|
17
|
+
padding: 0 12px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.liteflowEditorPropertiesDataPropertyInformation {
|
|
21
|
+
padding-left: 8px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.flexBox {
|
|
25
|
+
width: 100%;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
align-items: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.filterList {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
gap: 12px;
|
|
35
|
+
flex: 0.97;
|
|
36
|
+
|
|
37
|
+
.filterItem {
|
|
38
|
+
width: 48%;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
gap: 12px;
|
|
43
|
+
padding: 12px 16px;
|
|
44
|
+
background-color: #fff;
|
|
45
|
+
border: 1px solid #d9d9d9;
|
|
46
|
+
border-radius: 8px;
|
|
47
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
48
|
+
transition: box-shadow 0.2s ease, border-color 0.2s ease;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
border-color: #409eff;
|
|
52
|
+
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.filterItemLeft {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
align-items: flex-start;
|
|
59
|
+
gap: 6px;
|
|
60
|
+
line-height: 1.4;
|
|
61
|
+
|
|
62
|
+
>span:first-child {
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
color: #333;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
>span:nth-child(2) {
|
|
68
|
+
display: -webkit-box;
|
|
69
|
+
-webkit-box-orient: vertical;
|
|
70
|
+
-webkit-line-clamp: 2;
|
|
71
|
+
line-clamp: 2;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
word-break: break-word;
|
|
75
|
+
color: #666;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.aggList{
|
|
83
|
+
display: flex;
|
|
84
|
+
// flex-direction: column;
|
|
85
|
+
gap: 12px;
|
|
86
|
+
flex: 0.97;
|
|
87
|
+
flex-wrap: wrap;
|
|
88
|
+
|
|
89
|
+
.aggItem {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
gap: 12px;
|
|
94
|
+
padding: 12px 16px;
|
|
95
|
+
background-color: #fff;
|
|
96
|
+
border: 1px solid #d9d9d9;
|
|
97
|
+
border-radius: 8px;
|
|
98
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
99
|
+
transition: box-shadow 0.2s ease, border-color 0.2s ease;
|
|
100
|
+
&:hover {
|
|
101
|
+
border-color: #409eff;
|
|
102
|
+
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15);
|
|
103
|
+
}
|
|
104
|
+
.aggItemLeft {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
align-items: flex-start;
|
|
108
|
+
gap: 6px;
|
|
109
|
+
line-height: 1.4;
|
|
110
|
+
>span:first-child {
|
|
111
|
+
font-weight: 600;
|
|
112
|
+
color: #333;
|
|
113
|
+
}
|
|
114
|
+
>span:nth-child(2) {
|
|
115
|
+
display: -webkit-box;
|
|
116
|
+
-webkit-box-orient: vertical;
|
|
117
|
+
-webkit-line-clamp: 2;
|
|
118
|
+
line-clamp: 2;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
text-overflow: ellipsis;
|
|
121
|
+
word-break: break-word;
|
|
122
|
+
color: #666;
|
|
123
|
+
font-size: 14px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.fieldLabel{
|
|
130
|
+
font-size: 14px;
|
|
131
|
+
font-weight: 600;
|
|
132
|
+
color: #333;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.operationBox{
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
gap: 28px;
|
|
139
|
+
flex: 1;
|
|
140
|
+
justify-content: flex-end;
|
|
141
|
+
margin-right: 20px;
|
|
142
|
+
}
|
|
143
|
+
// .listItem:active{
|
|
144
|
+
// cursor: grabbing !important;
|
|
145
|
+
// }
|
|
146
|
+
// .listItem:hover{
|
|
147
|
+
// background-color: #e6f7ff47 !important;
|
|
148
|
+
// }
|
|
149
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
var _excluded = ["node", "icon"];
|
|
6
|
+
import React, { useState, useEffect, useMemo, useRef } from 'react';
|
|
7
|
+
import { Collapse } from 'antd';
|
|
8
|
+
import { Addon, Node } from '@antv/x6';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import { NODE_GROUP, SEQUENCE_GROUP, BRANCH_GROUP, CONTROL_GROUP
|
|
11
|
+
// OTHER_GROUP,
|
|
12
|
+
} from "../../cells";
|
|
13
|
+
import { findViewsFromPoint } from "../../common/events";
|
|
14
|
+
import ELBuilder from "../../model/builder";
|
|
15
|
+
import styles from "./index.module.less";
|
|
16
|
+
import { history } from "../../hooks/useHistory";
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
18
|
+
var Panel = Collapse.Panel;
|
|
19
|
+
var SideBar = function SideBar(props) {
|
|
20
|
+
var flowGraph = props.flowGraph;
|
|
21
|
+
var _useTranslation = useTranslation(),
|
|
22
|
+
t = _useTranslation.t;
|
|
23
|
+
var lastEdgeRef = useRef(null);
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
var handleSetLastEdge = function handleSetLastEdge(args) {
|
|
26
|
+
lastEdgeRef.current = args.edge;
|
|
27
|
+
};
|
|
28
|
+
var handleResetLastEdge = function handleResetLastEdge() {
|
|
29
|
+
lastEdgeRef.current = null;
|
|
30
|
+
};
|
|
31
|
+
flowGraph.on('edge:mouseover', handleSetLastEdge);
|
|
32
|
+
flowGraph.on('edge:mouseleave', handleResetLastEdge);
|
|
33
|
+
return function () {
|
|
34
|
+
flowGraph.off('edge:mouseover', handleSetLastEdge);
|
|
35
|
+
flowGraph.off('edge:mouseleave', handleResetLastEdge);
|
|
36
|
+
};
|
|
37
|
+
}, [flowGraph]);
|
|
38
|
+
var _useState = useState([]),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
groups = _useState2[0],
|
|
41
|
+
setGroups = _useState2[1];
|
|
42
|
+
var dnd = useMemo(function () {
|
|
43
|
+
return new Addon.Dnd({
|
|
44
|
+
target: flowGraph,
|
|
45
|
+
scaled: true,
|
|
46
|
+
validateNode: function validateNode(droppingNode) {
|
|
47
|
+
var position = droppingNode.getPosition();
|
|
48
|
+
// console.log('position', position);
|
|
49
|
+
var size = droppingNode.getSize();
|
|
50
|
+
// console.log('size', size);
|
|
51
|
+
var _droppingNode$getData = droppingNode.getData(),
|
|
52
|
+
node = _droppingNode$getData.node;
|
|
53
|
+
// console.log('node', node);
|
|
54
|
+
var cellViewsFromPoint = findViewsFromPoint(flowGraph, position.x + size.width / 2, position.y + size.height / 2);
|
|
55
|
+
if (lastEdgeRef.current) {
|
|
56
|
+
var currentEdge = lastEdgeRef.current;
|
|
57
|
+
if (currentEdge) {
|
|
58
|
+
var targetNode = currentEdge.getTargetNode();
|
|
59
|
+
var _ref = (targetNode === null || targetNode === void 0 ? void 0 : targetNode.getData()) || {},
|
|
60
|
+
targetModel = _ref.model;
|
|
61
|
+
var sourceNode = currentEdge.getSourceNode();
|
|
62
|
+
var _ref2 = (sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.getData()) || {},
|
|
63
|
+
sourceModel = _ref2.model;
|
|
64
|
+
var inComingEdgesLength = (flowGraph.getIncomingEdges(targetNode) || []).length;
|
|
65
|
+
if (inComingEdgesLength > 1 || sourceModel && targetModel !== null && targetModel !== void 0 && targetModel.isParentOf(sourceModel)) {
|
|
66
|
+
sourceModel === null || sourceModel === void 0 || sourceModel.append(ELBuilder.createELNode(node.type, targetModel));
|
|
67
|
+
} else {
|
|
68
|
+
targetModel === null || targetModel === void 0 || targetModel.prepend(ELBuilder.createELNode(node.type, targetModel));
|
|
69
|
+
}
|
|
70
|
+
history.push();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
var cellViews = cellViewsFromPoint.filter(function (cellView) {
|
|
74
|
+
return cellView.isNodeView();
|
|
75
|
+
}) || [];
|
|
76
|
+
if (cellViews && cellViews.length) {
|
|
77
|
+
var currentNode = flowGraph.getCellById(cellViews[cellViews.length - 1].cell.id);
|
|
78
|
+
if (currentNode) {
|
|
79
|
+
var _currentNode$getData = currentNode.getData(),
|
|
80
|
+
model = _currentNode$getData.model;
|
|
81
|
+
model === null || model === void 0 || model.replace(ELBuilder.createELNode(node.type));
|
|
82
|
+
history.push();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}, [flowGraph]);
|
|
89
|
+
|
|
90
|
+
// life
|
|
91
|
+
useEffect(function () {
|
|
92
|
+
setGroups([SEQUENCE_GROUP, BRANCH_GROUP, NODE_GROUP, CONTROL_GROUP]);
|
|
93
|
+
}, [setGroups]);
|
|
94
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: styles.liteflowEditorSideBarContainer
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Collapse, {
|
|
97
|
+
className: styles.liteflowEditorSideBarCollapse,
|
|
98
|
+
defaultActiveKey: ['node', 'sequence', 'branch', 'control', 'other']
|
|
99
|
+
}, groups.map(function (group) {
|
|
100
|
+
return /*#__PURE__*/React.createElement(Panel, {
|
|
101
|
+
key: group.key,
|
|
102
|
+
header: t(group.name)
|
|
103
|
+
}, /*#__PURE__*/React.createElement(PanelContent, {
|
|
104
|
+
dnd: dnd,
|
|
105
|
+
cellTypes: group.cellTypes,
|
|
106
|
+
t: t
|
|
107
|
+
}));
|
|
108
|
+
})));
|
|
109
|
+
};
|
|
110
|
+
var View = function View(props) {
|
|
111
|
+
var node = props.node,
|
|
112
|
+
icon = props.icon,
|
|
113
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
114
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
115
|
+
className: classNames(styles.liteflowShapeWrapper)
|
|
116
|
+
}, rest), /*#__PURE__*/React.createElement("img", {
|
|
117
|
+
className: styles.liteflowShapeSvg,
|
|
118
|
+
src: icon
|
|
119
|
+
}));
|
|
120
|
+
};
|
|
121
|
+
var PanelContent = function PanelContent(props) {
|
|
122
|
+
var dnd = props.dnd,
|
|
123
|
+
cellTypes = props.cellTypes,
|
|
124
|
+
t = props.t;
|
|
125
|
+
var _onMouseDown = function onMouseDown(evt, node) {
|
|
126
|
+
dnd.start(Node.create({
|
|
127
|
+
shape: node.shape,
|
|
128
|
+
data: {
|
|
129
|
+
node: node
|
|
130
|
+
}
|
|
131
|
+
}), evt);
|
|
132
|
+
};
|
|
133
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: styles.liteflowEditorSideBarPanelContent
|
|
135
|
+
}, cellTypes.map(function (cellType, index) {
|
|
136
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
key: index,
|
|
138
|
+
className: classNames(styles.liteflowEditorSideBarCellContainer, _defineProperty({}, styles.disabled, cellType.disabled))
|
|
139
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
140
|
+
className: styles.liteflowEditorSideBarCellWrapper
|
|
141
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
142
|
+
icon: cellType.icon,
|
|
143
|
+
onMouseDown: function onMouseDown(evt) {
|
|
144
|
+
if (!cellType.disabled) {
|
|
145
|
+
_onMouseDown(evt, cellType);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
})), /*#__PURE__*/React.createElement("p", {
|
|
149
|
+
className: styles.liteflowEditorSideBarCellTitle
|
|
150
|
+
}, t(cellType.label)));
|
|
151
|
+
}));
|
|
152
|
+
};
|
|
153
|
+
export default SideBar;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@import '../../components/NodeView/index.module.less';
|
|
2
|
+
|
|
3
|
+
.liteflowEditorSideBarContainer {
|
|
4
|
+
width: 100%;
|
|
5
|
+
|
|
6
|
+
:global {
|
|
7
|
+
.ant-collapse > .ant-collapse-item > .ant-collapse-header {
|
|
8
|
+
padding: 10px 16px 10px 40px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.liteflowEditorSideBarCollapse {
|
|
13
|
+
border: 0;
|
|
14
|
+
border-radius: 0;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.liteflowEditorSideBarPanelContent {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
.liteflowEditorSideBarCellContainer {
|
|
24
|
+
margin: 8px;
|
|
25
|
+
width: 90px;
|
|
26
|
+
height: 60px;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: center;
|
|
30
|
+
&.disabled {
|
|
31
|
+
opacity: 0.5;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.liteflowEditorSideBarCellWrapper {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
flex-wrap: wrap;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
width: 30px;
|
|
41
|
+
height: 30px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.liteflowEditorSideBarCellTitle {
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useEffect, useReducer } from 'react';
|
|
2
|
+
import widgets from "./widgets";
|
|
3
|
+
import { useGraph } from "../../hooks";
|
|
4
|
+
import styles from "./index.module.less";
|
|
5
|
+
var ToolBar = function ToolBar(_ref) {
|
|
6
|
+
var customWidgets = _ref.widgets;
|
|
7
|
+
var flowGraph = useGraph();
|
|
8
|
+
var forceUpdate = useReducer(function (n) {
|
|
9
|
+
return n + 1;
|
|
10
|
+
}, 0)[1];
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
flowGraph.on('toolBar:forceUpdate', forceUpdate);
|
|
13
|
+
return function () {
|
|
14
|
+
flowGraph.off('toolBar:forceUpdate');
|
|
15
|
+
};
|
|
16
|
+
}, [flowGraph]);
|
|
17
|
+
var customWidgetsGroup = null;
|
|
18
|
+
if (customWidgets && customWidgets.length) {
|
|
19
|
+
customWidgetsGroup = /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: styles.liteflowEditorToolBarGroup
|
|
21
|
+
}, customWidgets.map(function (WidgetItem, index) {
|
|
22
|
+
return /*#__PURE__*/React.createElement(WidgetItem, {
|
|
23
|
+
key: index,
|
|
24
|
+
flowGraph: flowGraph
|
|
25
|
+
});
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: styles.liteflowEditorToolBarContainer
|
|
30
|
+
}, widgets.map(function (group, index) {
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
key: index,
|
|
33
|
+
className: styles.liteflowEditorToolBarGroup
|
|
34
|
+
}, group.map(function (ToolItem, index) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(ToolItem, {
|
|
36
|
+
key: index,
|
|
37
|
+
flowGraph: flowGraph
|
|
38
|
+
});
|
|
39
|
+
}));
|
|
40
|
+
}), customWidgetsGroup);
|
|
41
|
+
};
|
|
42
|
+
export default ToolBar;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.liteflowEditorToolBarContainer {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
justify-content: flex-start;
|
|
5
|
+
align-items: center;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
background-color: #fafafa;
|
|
9
|
+
border-bottom: 1px solid #d9d9d9;
|
|
10
|
+
|
|
11
|
+
.liteflowEditorToolBarGroup {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
align-items: center;
|
|
15
|
+
padding: 0 4px;
|
|
16
|
+
height: 100%;
|
|
17
|
+
border-right: 1px solid #d9d9d9;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import makeBtnWidget from "./common/makeBtnWidget";
|
|
4
|
+
import Icon from '@ant-design/icons';
|
|
5
|
+
// import { Badge } from 'antd';
|
|
6
|
+
import MyBadge from "./common/badge";
|
|
7
|
+
var checkIconSvg = function checkIconSvg() {
|
|
8
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
width: "1.2em",
|
|
12
|
+
height: "1.2em",
|
|
13
|
+
fill: "currentColor"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
15
|
+
d: "M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z"
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// 为 props 指定类型为 React.HTMLAttributes<HTMLElement>,避免隐式 any 类型
|
|
20
|
+
var CheckIcon = function CheckIcon(props) {
|
|
21
|
+
return /*#__PURE__*/React.createElement(Icon, _extends({
|
|
22
|
+
component: checkIconSvg
|
|
23
|
+
}, props));
|
|
24
|
+
};
|
|
25
|
+
var Check = makeBtnWidget({
|
|
26
|
+
tooltip: 'view_check_items',
|
|
27
|
+
handler: function handler(flowGraph, props, checkList) {
|
|
28
|
+
console.log('checkList', checkList);
|
|
29
|
+
},
|
|
30
|
+
getIcon: function getIcon(flowGraph, checkList) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(MyBadge, {
|
|
32
|
+
count: checkList.length,
|
|
33
|
+
color: "#faad14",
|
|
34
|
+
style: {
|
|
35
|
+
transform: 'translate(120%, -40%)'
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/React.createElement(CheckIcon, null));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export default Check;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
interface MyBadgeProps {
|
|
3
|
+
count?: number;
|
|
4
|
+
showZero?: boolean;
|
|
5
|
+
dot?: boolean;
|
|
6
|
+
overflowCount?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const MyBadge: React.FC<MyBadgeProps>;
|
|
12
|
+
export default MyBadge;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var MyBadge = function MyBadge(_ref) {
|
|
4
|
+
var _ref$count = _ref.count,
|
|
5
|
+
count = _ref$count === void 0 ? 0 : _ref$count,
|
|
6
|
+
_ref$showZero = _ref.showZero,
|
|
7
|
+
showZero = _ref$showZero === void 0 ? false : _ref$showZero,
|
|
8
|
+
_ref$dot = _ref.dot,
|
|
9
|
+
dot = _ref$dot === void 0 ? false : _ref$dot,
|
|
10
|
+
_ref$overflowCount = _ref.overflowCount,
|
|
11
|
+
overflowCount = _ref$overflowCount === void 0 ? 99 : _ref$overflowCount,
|
|
12
|
+
_ref$color = _ref.color,
|
|
13
|
+
color = _ref$color === void 0 ? '#f5222d' : _ref$color,
|
|
14
|
+
_ref$style = _ref.style,
|
|
15
|
+
style = _ref$style === void 0 ? {} : _ref$style,
|
|
16
|
+
children = _ref.children;
|
|
17
|
+
var isZero = count === 0;
|
|
18
|
+
var displayCount = count > overflowCount ? "".concat(overflowCount, "+") : count;
|
|
19
|
+
var shouldShow = dot || !isZero || showZero;
|
|
20
|
+
var badgeStyle = _objectSpread({
|
|
21
|
+
position: 'absolute',
|
|
22
|
+
top: 0,
|
|
23
|
+
right: 0,
|
|
24
|
+
transform: 'translate(50%, -50%)',
|
|
25
|
+
minWidth: dot ? 8 : 20,
|
|
26
|
+
height: dot ? 8 : 20,
|
|
27
|
+
lineHeight: dot ? '8px' : '20px',
|
|
28
|
+
padding: dot ? 0 : '0 6px',
|
|
29
|
+
fontSize: 12,
|
|
30
|
+
borderRadius: 10,
|
|
31
|
+
background: color,
|
|
32
|
+
color: '#fff',
|
|
33
|
+
textAlign: 'center',
|
|
34
|
+
whiteSpace: 'nowrap'
|
|
35
|
+
}, style);
|
|
36
|
+
var wrapperStyle = {
|
|
37
|
+
position: 'relative',
|
|
38
|
+
display: 'inline-block'
|
|
39
|
+
};
|
|
40
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
41
|
+
style: wrapperStyle
|
|
42
|
+
}, children, shouldShow && /*#__PURE__*/React.createElement("sup", {
|
|
43
|
+
style: badgeStyle
|
|
44
|
+
}, !dot && displayCount));
|
|
45
|
+
};
|
|
46
|
+
export default MyBadge;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { Graph } from '@antv/x6';
|
|
3
|
+
import '../global.less';
|
|
4
|
+
interface IOptions {
|
|
5
|
+
tooltip: string;
|
|
6
|
+
getIcon: (flowGraph: Graph, checkList: Array<any>) => ReactElement;
|
|
7
|
+
handler: (flowGraph: Graph, props?: any, checkList?: Array<any>) => void;
|
|
8
|
+
disabled?: (flowGraph: Graph) => boolean;
|
|
9
|
+
selected?: (flowGraph: Graph) => boolean;
|
|
10
|
+
}
|
|
11
|
+
interface IBtnWidgetProps {
|
|
12
|
+
flowGraph: Graph;
|
|
13
|
+
}
|
|
14
|
+
declare const makeBtnWidget: (options: IOptions) => React.FC<IBtnWidgetProps>;
|
|
15
|
+
export default makeBtnWidget;
|