strategy-panel 1.0.1 → 1.0.2
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/.fatherrc.ts +11 -26
- package/.umirc.ts +4 -0
- package/README.md +33 -33
- package/es/assets/decive.svg +1 -1
- package/es/assets/hand.svg +1 -1
- package/es/assets/lock.svg +8 -0
- package/es/components/canvas/component-tree-panel/category-tree/category-type.d.ts +1 -0
- package/es/{common/graph-common → components/canvas/component-tree-panel/category-tree}/category-type.js +28 -12
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/index.d.ts +17 -16
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/index.js +14 -14
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/index.less +36 -36
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/node-title.d.ts +12 -12
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/node-title.js +5 -3
- package/es/{pages → components/canvas}/component-tree-panel/index.d.ts +17 -17
- package/es/{pages → components/canvas}/component-tree-panel/index.js +1 -0
- package/es/{pages → components/canvas}/component-tree-panel/index.less +1 -0
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/data-origin.d.ts +49 -49
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/data-origin.js +26 -34
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/index.d.ts +11 -11
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/index.js +15 -23
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/style.less +1 -1
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/cross-line.d.ts +9 -9
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/cross-line.js +6 -10
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/index.d.ts +10 -9
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/index.js +17 -13
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/style.less +74 -74
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/components/cycle-time.d.ts +9 -9
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/components/cycle-time.js +24 -33
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/components/time-horizon.d.ts +10 -10
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/components/time-horizon.js +18 -28
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/delay-time.d.ts +9 -9
- package/es/components/canvas/config-panel/components/time-trigger/effective-time.d.ts +7 -0
- package/es/components/canvas/config-panel/components/time-trigger/effective-time.js +43 -0
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/index.d.ts +9 -8
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/index.js +18 -17
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/interval-time.d.ts +9 -9
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/interval-time.js +4 -8
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/persistent-time.d.ts +9 -9
- package/es/components/canvas/config-panel/components/time-trigger/section-Detail.d.ts +10 -0
- package/es/components/canvas/config-panel/components/time-trigger/section-Detail.js +125 -0
- package/es/components/canvas/config-panel/components/time-trigger/section-time.d.ts +9 -0
- package/es/components/canvas/config-panel/components/time-trigger/section-time.js +81 -0
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/timing-time.d.ts +9 -9
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/timing-time.js +7 -11
- package/es/{pages → components/canvas}/config-panel/config-common.d.ts +38 -37
- package/es/{pages → components/canvas}/config-panel/config-common.js +9 -15
- package/es/{pages → components/canvas}/config-panel/index.d.ts +14 -13
- package/es/{pages → components/canvas}/config-panel/index.js +2 -2
- package/es/{pages → components/canvas}/config-panel/node-form.d.ts +23 -22
- package/es/{pages → components/canvas}/config-panel/node-form.js +14 -16
- package/es/{pages → components/canvas}/config-panel/style.less +90 -81
- package/es/{pages → components/canvas}/dag-canvas/canvas-content.d.ts +11 -10
- package/es/{pages → components/canvas}/dag-canvas/canvas-content.js +23 -12
- package/es/{pages → components/canvas}/dag-canvas/index.d.ts +23 -18
- package/es/{pages → components/canvas}/dag-canvas/index.js +5 -2
- package/es/{pages → components/canvas}/dag-canvas/preview.d.ts +10 -10
- package/es/components/canvas/dag-canvas/preview.js +53 -0
- package/es/{pages → components/canvas}/index.d.ts +48 -42
- package/es/{pages → components/canvas}/index.js +20 -10
- package/es/{pages → components/canvas}/index.less +2 -2
- package/es/{pages → components/canvas}/strategy-header/index.d.ts +48 -56
- package/es/components/canvas/strategy-header/index.js +210 -0
- package/es/{pages → components/canvas}/strategy-header/style.less +4 -3
- package/es/{pages → components/canvas}/strategy-header/theme-switch/index.d.ts +4 -4
- package/es/{pages → components/canvas}/strategy-header/theme-switch/index.js +2 -3
- package/es/index.d.ts +9 -8
- package/es/index.js +8 -7
- package/es/packages/graph-canvas/graph-common.d.ts +19 -0
- package/es/packages/graph-canvas/graph-common.js +19 -0
- package/es/packages/graph-canvas/graph-model/edge/group-edge/index.d.ts +4 -0
- package/es/packages/graph-canvas/graph-model/edge/group-edge/index.js +63 -0
- package/es/packages/graph-canvas/graph-model/edge/index.d.ts +2 -0
- package/es/packages/graph-canvas/graph-model/edge/index.js +2 -0
- package/es/packages/graph-canvas/graph-model/node/application-node/application-element.d.ts +9 -0
- package/es/packages/graph-canvas/graph-model/node/application-node/application-element.js +20 -0
- package/es/packages/graph-canvas/graph-model/node/application-node/application-element.less +17 -0
- package/es/packages/graph-canvas/graph-model/node/application-node/index.d.ts +7 -0
- package/es/{common/graph-common/shape/nodes/GroupNode.js → packages/graph-canvas/graph-model/node/application-node/index.js} +42 -22
- package/es/{common/graph-common/shape/nodes/CommonNode.d.ts → packages/graph-canvas/graph-model/node/common-node/index.d.ts} +7 -5
- package/es/{common/graph-common/shape/nodes/CommonNode.js → packages/graph-canvas/graph-model/node/common-node/index.js} +8 -7
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/common-node}/node-element.d.ts +9 -9
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/common-node}/node-element.js +16 -14
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/common-node}/node-element.less +4 -4
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/condition-node}/condition-element.d.ts +9 -9
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/condition-node}/condition-element.js +20 -15
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/condition-node}/condition-element.less +76 -81
- package/es/packages/graph-canvas/graph-model/node/condition-node/images/rhombus.svg +3 -0
- package/es/{common/graph-common/shape/nodes/ConditionJudgment.d.ts → packages/graph-canvas/graph-model/node/condition-node/index.d.ts} +5 -5
- package/es/{common/graph-common/shape/nodes/ConditionJudgment.js → packages/graph-canvas/graph-model/node/condition-node/index.js} +7 -6
- package/es/packages/graph-canvas/graph-model/node/index.d.ts +5 -0
- package/es/packages/graph-canvas/graph-model/node/index.js +5 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/AND.svg +11 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/OR.svg +11 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/XOR.svg +11 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/locking.svg +5 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/unlock.svg +5 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/index.d.ts +6 -0
- package/es/{common/graph-common/shape/nodes/LogicalNode.js → packages/graph-canvas/graph-model/node/logical-node/index.js} +15 -15
- package/es/packages/graph-canvas/graph-model/node/logical-node/logical-element.d.ts +9 -0
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/logical-node}/logical-element.js +36 -19
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/logical-node}/logical-element.less +4 -9
- package/es/packages/graph-canvas/graph-model/node/style.less +8 -0
- package/es/{common → packages/graph-canvas}/graph-utils/graph.d.ts +87 -83
- package/es/{common → packages/graph-canvas}/graph-utils/graph.js +8 -4
- package/es/{pages/rx-models/experiment-graph.d.ts → packages/graph-canvas/index.d.ts} +79 -82
- package/es/{pages/rx-models/experiment-graph.js → packages/graph-canvas/index.js} +285 -252
- package/es/packages/graph-canvas/node-types.d.ts +6 -0
- package/es/packages/graph-canvas/node-types.js +54 -0
- package/es/packages/graph-canvas/typings.d.ts +5 -0
- package/es/{common/constants → packages/graph-common}/global.d.ts +1 -1
- package/es/{common/constants → packages/graph-common}/graph.d.ts +12 -10
- package/es/{common/constants → packages/graph-common}/graph.js +4 -2
- package/es/{pages/rx-models → packages/graph-core}/graph-util.d.ts +182 -186
- package/es/{pages/rx-models → packages/graph-core}/graph-util.js +8 -15
- package/es/{pages/rx-models/graph-core.d.ts → packages/graph-core/index.d.ts} +96 -96
- package/es/{pages/rx-models/graph-core.js → packages/graph-core/index.js} +119 -87
- package/es/packages/graph-core/typing.d.ts +107 -0
- package/es/{common/graph-common → packages/graph-model}/connector/index.d.ts +1 -1
- package/es/packages/graph-model/connector/index.js +14 -0
- package/es/packages/graph-model/edge/edge.less +8 -0
- package/es/packages/graph-model/edge/index.d.ts +5 -0
- package/es/{common/graph-common/shape/edge.js → packages/graph-model/edge/index.js} +10 -61
- package/es/packages/graph-model/node/index.d.ts +7 -0
- package/es/{common/graph-common/shape/nodes/BaseNode.js → packages/graph-model/node/index.js} +12 -3
- package/es/{common/graph-common/node-element/common-element.less → packages/graph-model/node/node-basic.less} +1 -0
- package/es/{hooks → packages/hooks}/useObservableState.d.ts +3 -3
- package/es/packages/hooks/withMode.d.ts +3 -0
- package/es/packages/hooks/withMode.js +12 -0
- package/es/style/default.less +8 -0
- package/es/style/svgRaw.d.ts +1 -0
- package/es/style/svgRaw.js +1 -0
- package/es/typings.d.ts +2 -8
- package/es/utils/utils.d.ts +1 -1
- package/lib/assets/AND.svg +11 -0
- package/lib/assets/OR.svg +11 -0
- package/lib/assets/XOR.svg +11 -0
- package/lib/assets/add.svg +13 -0
- package/lib/assets/alarm.svg +11 -0
- package/lib/assets/application.svg +11 -0
- package/lib/assets/cancel.svg +13 -0
- package/lib/assets/check.svg +12 -0
- package/lib/assets/condition.svg +12 -0
- package/lib/assets/control.svg +11 -0
- package/lib/assets/decive.svg +11 -0
- package/lib/assets/delete.svg +11 -0
- package/lib/assets/device.svg +11 -0
- package/lib/assets/edit.svg +11 -0
- package/lib/assets/hand.svg +11 -0
- package/lib/assets/link.svg +11 -0
- package/lib/assets/lock.svg +8 -0
- package/lib/assets/logical.svg +12 -0
- package/lib/assets/notice.svg +11 -0
- package/lib/assets/order.svg +11 -0
- package/lib/assets/relation.svg +11 -0
- package/lib/assets/rhombus.svg +3 -0
- package/lib/assets/save.svg +13 -0
- package/lib/assets/time.svg +11 -0
- package/lib/assets/variate.svg +12 -0
- package/lib/components/canvas/component-tree-panel/category-tree/category-type.d.ts +1 -0
- package/lib/components/canvas/component-tree-panel/category-tree/category-type.js +111 -0
- package/lib/components/canvas/component-tree-panel/category-tree/index.d.ts +17 -0
- package/lib/components/canvas/component-tree-panel/category-tree/index.js +115 -0
- package/lib/components/canvas/component-tree-panel/category-tree/index.less +36 -0
- package/lib/components/canvas/component-tree-panel/category-tree/node-title.d.ts +12 -0
- package/lib/components/canvas/component-tree-panel/category-tree/node-title.js +75 -0
- package/lib/components/canvas/component-tree-panel/category-tree/node-title.less +113 -0
- package/lib/components/canvas/component-tree-panel/index.d.ts +17 -0
- package/lib/components/canvas/component-tree-panel/index.js +33 -0
- package/lib/components/canvas/component-tree-panel/index.less +52 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/data-origin.d.ts +49 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/data-origin.js +229 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/index.d.ts +11 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/index.js +187 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/style.less +13 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/cross-line.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/cross-line.js +57 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/index.d.ts +10 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/index.js +216 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/style.less +74 -0
- package/lib/components/canvas/config-panel/components/time-trigger/components/cycle-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/components/cycle-time.js +108 -0
- package/lib/components/canvas/config-panel/components/time-trigger/components/time-horizon.d.ts +10 -0
- package/lib/components/canvas/config-panel/components/time-trigger/components/time-horizon.js +78 -0
- package/lib/components/canvas/config-panel/components/time-trigger/delay-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/delay-time.js +33 -0
- package/lib/components/canvas/config-panel/components/time-trigger/effective-time.d.ts +7 -0
- package/lib/components/canvas/config-panel/components/time-trigger/effective-time.js +58 -0
- package/lib/components/canvas/config-panel/components/time-trigger/index.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/index.js +114 -0
- package/lib/components/canvas/config-panel/components/time-trigger/interval-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/interval-time.js +63 -0
- package/lib/components/canvas/config-panel/components/time-trigger/persistent-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/persistent-time.js +33 -0
- package/lib/components/canvas/config-panel/components/time-trigger/section-Detail.d.ts +10 -0
- package/lib/components/canvas/config-panel/components/time-trigger/section-Detail.js +140 -0
- package/lib/components/canvas/config-panel/components/time-trigger/section-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/section-time.js +96 -0
- package/lib/components/canvas/config-panel/components/time-trigger/timing-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/timing-time.js +65 -0
- package/lib/components/canvas/config-panel/config-common.d.ts +38 -0
- package/lib/components/canvas/config-panel/config-common.js +152 -0
- package/lib/components/canvas/config-panel/index.d.ts +14 -0
- package/lib/components/canvas/config-panel/index.js +68 -0
- package/lib/components/canvas/config-panel/node-form.d.ts +23 -0
- package/lib/components/canvas/config-panel/node-form.js +97 -0
- package/lib/components/canvas/config-panel/style.less +90 -0
- package/lib/components/canvas/dag-canvas/canvas-content.d.ts +11 -0
- package/lib/components/canvas/dag-canvas/canvas-content.js +130 -0
- package/lib/components/canvas/dag-canvas/canvas-content.less +5 -0
- package/lib/components/canvas/dag-canvas/index.d.ts +23 -0
- package/lib/components/canvas/dag-canvas/index.js +53 -0
- package/lib/components/canvas/dag-canvas/index.less +11 -0
- package/lib/components/canvas/dag-canvas/preview.d.ts +10 -0
- package/lib/components/canvas/dag-canvas/preview.js +73 -0
- package/lib/components/canvas/index.d.ts +48 -0
- package/lib/components/canvas/index.js +107 -0
- package/lib/components/canvas/index.less +50 -0
- package/lib/components/canvas/strategy-header/index.d.ts +48 -0
- package/lib/components/canvas/strategy-header/index.js +229 -0
- package/lib/components/canvas/strategy-header/style.less +23 -0
- package/lib/components/canvas/strategy-header/theme-switch/index.d.ts +4 -0
- package/lib/components/canvas/strategy-header/theme-switch/index.js +30 -0
- package/lib/components/canvas/strategy-header/theme-switch/style.less +11 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +71 -0
- package/lib/packages/graph-canvas/graph-common.d.ts +19 -0
- package/lib/packages/graph-canvas/graph-common.js +27 -0
- package/lib/packages/graph-canvas/graph-model/edge/group-edge/edge.less +8 -0
- package/lib/packages/graph-canvas/graph-model/edge/group-edge/index.d.ts +4 -0
- package/lib/packages/graph-canvas/graph-model/edge/group-edge/index.js +74 -0
- package/lib/packages/graph-canvas/graph-model/edge/index.d.ts +2 -0
- package/lib/packages/graph-canvas/graph-model/edge/index.js +15 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/application-element.d.ts +9 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/application-element.js +31 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/application-element.less +17 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/index.d.ts +7 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/index.js +133 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/index.d.ts +7 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/index.js +133 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/node-element.d.ts +9 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/node-element.js +69 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/node-element.less +48 -0
- package/{es/common/graph-common/node-element/logical-element.d.ts → lib/packages/graph-canvas/graph-model/node/condition-node/condition-element.d.ts} +9 -9
- package/lib/packages/graph-canvas/graph-model/node/condition-node/condition-element.js +81 -0
- package/lib/packages/graph-canvas/graph-model/node/condition-node/condition-element.less +76 -0
- package/lib/packages/graph-canvas/graph-model/node/condition-node/images/rhombus.svg +3 -0
- package/{es/common/graph-common/shape/nodes/LogicalNode.d.ts → lib/packages/graph-canvas/graph-model/node/condition-node/index.d.ts} +5 -5
- package/lib/packages/graph-canvas/graph-model/node/condition-node/index.js +143 -0
- package/lib/packages/graph-canvas/graph-model/node/index.d.ts +5 -0
- package/lib/packages/graph-canvas/graph-model/node/index.js +39 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/AND.svg +11 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/OR.svg +11 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/XOR.svg +11 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/locking.svg +5 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/unlock.svg +5 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/index.d.ts +6 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/index.js +143 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/logical-element.d.ts +9 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/logical-element.js +98 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/logical-element.less +49 -0
- package/lib/packages/graph-canvas/graph-model/node/style.less +8 -0
- package/lib/packages/graph-canvas/graph-utils/graph.d.ts +87 -0
- package/lib/packages/graph-canvas/graph-utils/graph.js +124 -0
- package/lib/packages/graph-canvas/index.d.ts +79 -0
- package/lib/packages/graph-canvas/index.js +1292 -0
- package/lib/packages/graph-canvas/node-types.d.ts +6 -0
- package/lib/packages/graph-canvas/node-types.js +66 -0
- package/lib/packages/graph-canvas/typings.d.ts +5 -0
- package/lib/packages/graph-common/global.d.ts +1 -0
- package/lib/packages/graph-common/global.js +8 -0
- package/lib/packages/graph-common/graph.d.ts +12 -0
- package/lib/packages/graph-common/graph.js +37 -0
- package/lib/packages/graph-core/graph-util.d.ts +182 -0
- package/lib/packages/graph-core/graph-util.js +368 -0
- package/lib/packages/graph-core/index.d.ts +96 -0
- package/lib/packages/graph-core/index.js +798 -0
- package/lib/packages/graph-core/typing.d.ts +107 -0
- package/lib/packages/graph-model/connector/index.d.ts +1 -0
- package/lib/packages/graph-model/connector/index.js +17 -0
- package/lib/packages/graph-model/edge/edge.less +8 -0
- package/lib/packages/graph-model/edge/index.d.ts +5 -0
- package/lib/packages/graph-model/edge/index.js +73 -0
- package/lib/packages/graph-model/node/index.d.ts +7 -0
- package/lib/packages/graph-model/node/index.js +63 -0
- package/lib/packages/graph-model/node/node-basic.less +118 -0
- package/lib/packages/hooks/useObservableState.d.ts +3 -0
- package/lib/packages/hooks/useObservableState.js +55 -0
- package/lib/packages/hooks/withMode.d.ts +3 -0
- package/lib/packages/hooks/withMode.js +22 -0
- package/lib/style/basic.less +12 -0
- package/lib/style/default.less +10 -0
- package/lib/style/position.less +25 -0
- package/lib/style/svgRaw.d.ts +1 -0
- package/lib/style/svgRaw.js +8 -0
- package/lib/style/theme-light.less +7 -0
- package/lib/style/variable.less +3 -0
- package/lib/typings.d.ts +8 -0
- package/lib/utils/utils.d.ts +1 -0
- package/lib/utils/utils.js +13 -0
- package/package.json +38 -37
- package/tsconfig.json +1 -1
- package/es/common/graph-common/category-type.d.ts +0 -16
- package/es/common/graph-common/connector/index.js +0 -14
- package/es/common/graph-common/node-element/node-group.d.ts +0 -8
- package/es/common/graph-common/node-element/node-group.js +0 -395
- package/es/common/graph-common/node-element/node-group.less +0 -53
- package/es/common/graph-common/node-popover/index.d.ts +0 -7
- package/es/common/graph-common/node-popover/index.js +0 -11
- package/es/common/graph-common/node-popover/index.less +0 -5
- package/es/common/graph-common/node-types.d.ts +0 -28
- package/es/common/graph-common/node-types.js +0 -60
- package/es/common/graph-common/shape/edge.d.ts +0 -10
- package/es/common/graph-common/shape/node.d.ts +0 -6
- package/es/common/graph-common/shape/node.js +0 -6
- package/es/common/graph-common/shape/nodes/BaseNode.d.ts +0 -4
- package/es/common/graph-common/shape/nodes/GroupNode.d.ts +0 -4
- package/es/component/cut.d.ts +0 -10
- package/es/component/cut.js +0 -34
- package/es/component/cut.less +0 -6
- package/es/component/item-name.d.ts +0 -6
- package/es/component/item-name.js +0 -30
- package/es/component/keyword.d.ts +0 -9
- package/es/component/keyword.js +0 -26
- package/es/component/keyword.less +0 -11
- package/es/component/rx-component/rx-input.d.ts +0 -8
- package/es/component/rx-component/rx-input.js +0 -47
- package/es/hooks/withMode.d.ts +0 -1
- package/es/hooks/withMode.js +0 -16
- package/es/pages/dag-canvas/preview.js +0 -42
- package/es/pages/rx-models/graph-core.less +0 -14
- package/es/pages/rx-models/typing.d.ts +0 -126
- package/es/pages/strategy-header/index.js +0 -154
- /package/es/{pages → components/canvas}/component-tree-panel/category-tree/node-title.less +0 -0
- /package/es/{pages → components/canvas}/config-panel/components/time-trigger/delay-time.js +0 -0
- /package/es/{pages → components/canvas}/config-panel/components/time-trigger/persistent-time.js +0 -0
- /package/es/{pages → components/canvas}/dag-canvas/canvas-content.less +0 -0
- /package/es/{pages → components/canvas}/dag-canvas/index.less +0 -0
- /package/es/{pages → components/canvas}/strategy-header/theme-switch/style.less +0 -0
- /package/es/{common/graph-common/shape → packages/graph-canvas/graph-model/edge/group-edge}/edge.less +0 -0
- /package/es/{common/constants → packages/graph-common}/global.js +0 -0
- /package/es/{hooks → packages/hooks}/useObservableState.js +0 -0
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strategy-panel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
7
7
|
"docs:deploy": "gh-pages -d docs-dist",
|
|
8
|
-
"
|
|
8
|
+
"dev": "father dev",
|
|
9
|
+
"build": "father build",
|
|
9
10
|
"deploy": "npm run docs:build && npm run docs:deploy",
|
|
10
11
|
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
|
11
12
|
"test": "umi-test",
|
|
@@ -26,45 +27,45 @@
|
|
|
26
27
|
]
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@ant-design/icons": "
|
|
30
|
-
"@antv/x6": "
|
|
31
|
-
"@antv/x6-react-components": "
|
|
32
|
-
"@antv/x6-react-shape": "
|
|
33
|
-
"@types/lodash-es": "
|
|
34
|
-
"@types/marked": "
|
|
35
|
-
"@types/node": "
|
|
36
|
-
"antd": "
|
|
37
|
-
"classnames": "
|
|
38
|
-
"dompurify": "
|
|
39
|
-
"immer": "
|
|
40
|
-
"marked": "
|
|
41
|
-
"moment": "
|
|
42
|
-
"react": "
|
|
43
|
-
"react-dnd": "
|
|
44
|
-
"react-dnd-html5-backend": "
|
|
45
|
-
"react-dom": "
|
|
46
|
-
"react-svg": "
|
|
30
|
+
"@ant-design/icons": "4.8.1",
|
|
31
|
+
"@antv/x6": "1.34.6",
|
|
32
|
+
"@antv/x6-react-components": "1.1.20",
|
|
33
|
+
"@antv/x6-react-shape": "1.6.5",
|
|
34
|
+
"@types/lodash-es": "4.17.6",
|
|
35
|
+
"@types/marked": "3.0.3",
|
|
36
|
+
"@types/node": "17.0.45",
|
|
37
|
+
"antd": "4.24.15",
|
|
38
|
+
"classnames": "2.3.1",
|
|
39
|
+
"dompurify": "2.4.1",
|
|
40
|
+
"immer": "9.0.16",
|
|
41
|
+
"marked": "3.0.8",
|
|
42
|
+
"moment": "2.29.4",
|
|
43
|
+
"react": "16.14.0",
|
|
44
|
+
"react-dnd": "11.1.3",
|
|
45
|
+
"react-dnd-html5-backend": "11.1.3",
|
|
46
|
+
"react-dom": "16.14.0",
|
|
47
|
+
"react-svg": "14.1.9"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@testing-library/jest-dom": "
|
|
50
|
-
"@testing-library/react": "
|
|
50
|
+
"@testing-library/jest-dom": "5.16.5",
|
|
51
|
+
"@testing-library/react": "12.1.5",
|
|
51
52
|
"@types/jest": "^27.0.3",
|
|
52
53
|
"@umijs/fabric": "^2.8.1",
|
|
53
54
|
"@umijs/test": "^3.0.5",
|
|
54
|
-
"@umijs/yorkie": "
|
|
55
|
-
"babel-plugin-import": "
|
|
56
|
-
"babel-plugin-module-resolver": "
|
|
57
|
-
"babel-plugin-react-css-modules": "
|
|
58
|
-
"babel-plugin-transform-remove-console": "
|
|
59
|
-
"dumi": "
|
|
60
|
-
"eslint": "
|
|
61
|
-
"eslint-plugin-react": "
|
|
62
|
-
"father
|
|
63
|
-
"gh-pages": "
|
|
64
|
-
"lint-staged": "
|
|
65
|
-
"prettier": "
|
|
66
|
-
"
|
|
67
|
-
"
|
|
55
|
+
"@umijs/yorkie": "2.0.5",
|
|
56
|
+
"babel-plugin-import": "1.13.5",
|
|
57
|
+
"babel-plugin-module-resolver": "4.1.0",
|
|
58
|
+
"babel-plugin-react-css-modules": "5.2.6",
|
|
59
|
+
"babel-plugin-transform-remove-console": "6.9.4",
|
|
60
|
+
"dumi": "1.1.54",
|
|
61
|
+
"eslint": "7.32.0",
|
|
62
|
+
"eslint-plugin-react": "7.31.10",
|
|
63
|
+
"father": "4.1.0",
|
|
64
|
+
"gh-pages": "3.2.3",
|
|
65
|
+
"lint-staged": "10.5.4",
|
|
66
|
+
"prettier": "2.7.1",
|
|
67
|
+
"umi-lint": "2.0.2",
|
|
68
|
+
"yorkie": "2.0.0"
|
|
68
69
|
},
|
|
69
|
-
"license"
|
|
70
|
+
"license": "MIT"
|
|
70
71
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const componentsData: {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
isDir: boolean;
|
|
5
|
-
children: ({
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
imgUrl: any;
|
|
9
|
-
number: number;
|
|
10
|
-
} | {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
imgUrl: any;
|
|
14
|
-
number?: undefined;
|
|
15
|
-
})[];
|
|
16
|
-
}[];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Graph } from '@antv/x6';
|
|
2
|
-
Graph.registerConnector('pai', function (s, t) {
|
|
3
|
-
var offset = 4;
|
|
4
|
-
var control = 80;
|
|
5
|
-
var v1 = {
|
|
6
|
-
x: s.x,
|
|
7
|
-
y: s.y + offset + control
|
|
8
|
-
};
|
|
9
|
-
var v2 = {
|
|
10
|
-
x: t.x,
|
|
11
|
-
y: t.y - offset - control
|
|
12
|
-
};
|
|
13
|
-
return "M ".concat(s.x, " ").concat(s.y, "\n L ").concat(s.x, " ").concat(s.y + offset, "\n C ").concat(v1.x, " ").concat(v1.y, " ").concat(v2.x, " ").concat(v2.y, " ").concat(t.x, " ").concat(t.y - offset, "\n L ").concat(t.x, " ").concat(t.y, "\n ");
|
|
14
|
-
}, true);
|
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
import "antd/es/popover/style";
|
|
2
|
-
import _Popover from "antd/es/popover";
|
|
3
|
-
import "antd/es/config-provider/style";
|
|
4
|
-
import _ConfigProvider from "antd/es/config-provider";
|
|
5
|
-
|
|
6
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
-
|
|
8
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
-
|
|
10
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
-
|
|
12
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13
|
-
|
|
14
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
|
|
18
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
19
|
-
|
|
20
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
21
|
-
|
|
22
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
23
|
-
|
|
24
|
-
import React, { useCallback } from 'react';
|
|
25
|
-
import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons';
|
|
26
|
-
import { ANT_PREFIX } from "../../constants/global";
|
|
27
|
-
import { calcNodeScale } from "../../../pages/rx-models/graph-util";
|
|
28
|
-
import { useExperimentGraph } from "../../../pages/rx-models/experiment-graph";
|
|
29
|
-
import GroupNode from "../shape/nodes/GroupNode";
|
|
30
|
-
import { X6DemoGroupEdge } from "../shape/edge";
|
|
31
|
-
import styles from "./node-group.less";
|
|
32
|
-
export var NodeGroup = function NodeGroup(props) {
|
|
33
|
-
var experimentId = props.experimentId,
|
|
34
|
-
node = props.node;
|
|
35
|
-
var data = node.getData();
|
|
36
|
-
var name = data.name,
|
|
37
|
-
_data$isCollapsed = data.isCollapsed,
|
|
38
|
-
isCollapsed = _data$isCollapsed === void 0 ? false : _data$isCollapsed;
|
|
39
|
-
var experimentGraph = useExperimentGraph(experimentId); // 折叠
|
|
40
|
-
|
|
41
|
-
var onCollapseGroup = useCallback(function () {
|
|
42
|
-
var graph = experimentGraph.graph;
|
|
43
|
-
var children = node.getDescendants();
|
|
44
|
-
var childNodes = children.filter(function (child) {
|
|
45
|
-
return child.isNode();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
var _calcNodeScale = calcNodeScale({
|
|
49
|
-
isCollapsed: true
|
|
50
|
-
}, childNodes.map(function (i) {
|
|
51
|
-
return i.getData();
|
|
52
|
-
})),
|
|
53
|
-
x = _calcNodeScale.x,
|
|
54
|
-
y = _calcNodeScale.y,
|
|
55
|
-
width = _calcNodeScale.width,
|
|
56
|
-
height = _calcNodeScale.height; // 还原尺寸
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
node.setProp({
|
|
60
|
-
position: {
|
|
61
|
-
x: x,
|
|
62
|
-
y: y
|
|
63
|
-
},
|
|
64
|
-
size: {
|
|
65
|
-
width: width,
|
|
66
|
-
height: height
|
|
67
|
-
}
|
|
68
|
-
}); // 处理 Data
|
|
69
|
-
|
|
70
|
-
node === null || node === void 0 ? void 0 : node.updateData({
|
|
71
|
-
isCollapsed: true
|
|
72
|
-
}); // 隐藏子元素
|
|
73
|
-
|
|
74
|
-
children.forEach(function (child) {
|
|
75
|
-
child.hide();
|
|
76
|
-
child.updateData({
|
|
77
|
-
hide: true
|
|
78
|
-
});
|
|
79
|
-
}); // 删除桩和边
|
|
80
|
-
|
|
81
|
-
var groupEdges = graph === null || graph === void 0 ? void 0 : graph.getConnectedEdges(node);
|
|
82
|
-
|
|
83
|
-
if (groupEdges === null || groupEdges === void 0 ? void 0 : groupEdges.length) {
|
|
84
|
-
experimentGraph.deleteEdges(groupEdges);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
var ports = node.getPorts();
|
|
88
|
-
|
|
89
|
-
if (ports === null || ports === void 0 ? void 0 : ports.length) {
|
|
90
|
-
node.removePorts(ports);
|
|
91
|
-
} // 创建新的连接桩和边
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var incomingEdges = childNodes.reduce(function (accu, curr) {
|
|
95
|
-
var incomingEdgs = graph.getIncomingEdges(curr);
|
|
96
|
-
|
|
97
|
-
if (incomingEdgs === null || incomingEdgs === void 0 ? void 0 : incomingEdgs.length) {
|
|
98
|
-
return [].concat(_toConsumableArray(accu), _toConsumableArray(incomingEdgs));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return accu;
|
|
102
|
-
}, []);
|
|
103
|
-
var outgoingEdges = childNodes.reduce(function (accu, curr) {
|
|
104
|
-
var outgoingEdgs = graph.getOutgoingEdges(curr);
|
|
105
|
-
|
|
106
|
-
if (outgoingEdgs === null || outgoingEdgs === void 0 ? void 0 : outgoingEdgs.length) {
|
|
107
|
-
return [].concat(_toConsumableArray(accu), _toConsumableArray(outgoingEdgs));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return accu;
|
|
111
|
-
}, []);
|
|
112
|
-
|
|
113
|
-
if (incomingEdges === null || incomingEdges === void 0 ? void 0 : incomingEdges.length) {
|
|
114
|
-
var inputPortId = Date.now().toString();
|
|
115
|
-
node.addPort({
|
|
116
|
-
group: 'in',
|
|
117
|
-
id: inputPortId,
|
|
118
|
-
connected: true
|
|
119
|
-
});
|
|
120
|
-
incomingEdges.filter(function (edge) {
|
|
121
|
-
return !childNodes.map(function (i) {
|
|
122
|
-
return i.id;
|
|
123
|
-
}).includes(edge.getSourceCellId());
|
|
124
|
-
}) // 只考虑从外部连接到组里的连线
|
|
125
|
-
.forEach(function (edge) {
|
|
126
|
-
var sourceNodeId = edge.getSourceCellId();
|
|
127
|
-
var sourcePortId = edge.getSourcePortId();
|
|
128
|
-
var sourceNode = edge.getSourceCell();
|
|
129
|
-
|
|
130
|
-
if (sourceNode instanceof GroupNode) {
|
|
131
|
-
experimentGraph.deleteEdges(edge);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
var sourceParentNode = sourceNode.parent; // 若源节点不可见,且存在父群组节点,则说明源节点的父群组节点已折叠,此时创建一个连接折叠父节点的桩
|
|
136
|
-
|
|
137
|
-
if (!sourceNode.visible && sourceParentNode instanceof GroupNode) {
|
|
138
|
-
sourceNodeId = sourceParentNode.id;
|
|
139
|
-
var parentNodePorts = sourceParentNode.getPortsByGroup('out');
|
|
140
|
-
sourcePortId = parentNodePorts[0].id;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
graph.addEdge(new X6DemoGroupEdge({
|
|
144
|
-
sourceAnchor: 'bottom',
|
|
145
|
-
source: {
|
|
146
|
-
cell: sourceNodeId,
|
|
147
|
-
port: sourcePortId,
|
|
148
|
-
anchor: {
|
|
149
|
-
name: 'bottom'
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
target: {
|
|
153
|
-
cell: node.id,
|
|
154
|
-
port: inputPortId,
|
|
155
|
-
anchor: {
|
|
156
|
-
name: 'center'
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
zIndex: 1
|
|
160
|
-
}));
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (outgoingEdges === null || outgoingEdges === void 0 ? void 0 : outgoingEdges.length) {
|
|
165
|
-
var outputPortId = Date.now().toString();
|
|
166
|
-
node.addPort({
|
|
167
|
-
group: 'out',
|
|
168
|
-
id: outputPortId,
|
|
169
|
-
connected: false
|
|
170
|
-
});
|
|
171
|
-
outgoingEdges.filter(function (edge) {
|
|
172
|
-
return !childNodes.map(function (i) {
|
|
173
|
-
return i.id;
|
|
174
|
-
}).includes(edge.getTargetCellId());
|
|
175
|
-
}).forEach(function (edge) {
|
|
176
|
-
var targetNodeId = edge.getTargetCellId();
|
|
177
|
-
var targetPortId = edge.getTargetPortId();
|
|
178
|
-
var targetNode = edge.getTargetCell();
|
|
179
|
-
|
|
180
|
-
if (targetNode instanceof GroupNode) {
|
|
181
|
-
experimentGraph.deleteEdges(edge);
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
var targetParentNode = targetNode.parent; // 若源节点不可见,且存在父群组节点,则说明源节点的父群组节点已折叠,此时创建一个连接折叠父节点的桩
|
|
186
|
-
|
|
187
|
-
if (!targetNode.visible && targetParentNode instanceof GroupNode) {
|
|
188
|
-
targetNodeId = targetParentNode.id;
|
|
189
|
-
var parentNodePorts = targetParentNode.getPortsByGroup('in');
|
|
190
|
-
targetPortId = parentNodePorts[0].id;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
graph.addEdge(new X6DemoGroupEdge({
|
|
194
|
-
sourceAnchor: 'bottom',
|
|
195
|
-
source: {
|
|
196
|
-
cell: node.id,
|
|
197
|
-
port: outputPortId,
|
|
198
|
-
anchor: {
|
|
199
|
-
name: 'bottom'
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
target: {
|
|
203
|
-
cell: targetNodeId,
|
|
204
|
-
port: targetPortId,
|
|
205
|
-
anchor: {
|
|
206
|
-
name: 'center'
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
zIndex: 1
|
|
210
|
-
}));
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}, [node, experimentGraph]); // 展开
|
|
214
|
-
|
|
215
|
-
var onExpandGroup = useCallback(function () {
|
|
216
|
-
var graph = experimentGraph.graph;
|
|
217
|
-
var children = node.getDescendants();
|
|
218
|
-
var childNodes = children.filter(function (child) {
|
|
219
|
-
return child.isNode();
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
var _calcNodeScale2 = calcNodeScale({
|
|
223
|
-
isCollapsed: false
|
|
224
|
-
}, children.filter(function (i) {
|
|
225
|
-
return i.isNode();
|
|
226
|
-
}).map(function (i) {
|
|
227
|
-
return i.getData();
|
|
228
|
-
})),
|
|
229
|
-
x = _calcNodeScale2.x,
|
|
230
|
-
y = _calcNodeScale2.y,
|
|
231
|
-
width = _calcNodeScale2.width,
|
|
232
|
-
height = _calcNodeScale2.height; // 还原尺寸
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
node.setProp({
|
|
236
|
-
position: {
|
|
237
|
-
x: x,
|
|
238
|
-
y: y
|
|
239
|
-
},
|
|
240
|
-
size: {
|
|
241
|
-
width: width,
|
|
242
|
-
height: height
|
|
243
|
-
}
|
|
244
|
-
}); // 处理 Data
|
|
245
|
-
|
|
246
|
-
var prevData = node.getData();
|
|
247
|
-
node === null || node === void 0 ? void 0 : node.setData(_objectSpread(_objectSpread({}, prevData), {}, {
|
|
248
|
-
isCollapsed: false
|
|
249
|
-
})); // 显示子元素
|
|
250
|
-
|
|
251
|
-
childNodes.forEach(function (child) {
|
|
252
|
-
child.show();
|
|
253
|
-
child.updateData({
|
|
254
|
-
hide: false
|
|
255
|
-
});
|
|
256
|
-
}); // 删除桩和边
|
|
257
|
-
|
|
258
|
-
var groupEdges = graph === null || graph === void 0 ? void 0 : graph.getConnectedEdges(node);
|
|
259
|
-
|
|
260
|
-
if (groupEdges === null || groupEdges === void 0 ? void 0 : groupEdges.length) {
|
|
261
|
-
experimentGraph.deleteEdges(groupEdges);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
var ports = node.getPorts();
|
|
265
|
-
|
|
266
|
-
if (ports === null || ports === void 0 ? void 0 : ports.length) {
|
|
267
|
-
node.removePorts(ports);
|
|
268
|
-
} // 建立与外部折叠群组的连接
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
var childIncomingEdges = childNodes.reduce(function (accu, curr) {
|
|
272
|
-
var incomingEdgs = graph.getIncomingEdges(curr);
|
|
273
|
-
|
|
274
|
-
if (incomingEdgs === null || incomingEdgs === void 0 ? void 0 : incomingEdgs.length) {
|
|
275
|
-
return [].concat(_toConsumableArray(accu), _toConsumableArray(incomingEdgs));
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return accu;
|
|
279
|
-
}, []);
|
|
280
|
-
var childOutgoingEdges = childNodes.reduce(function (accu, curr) {
|
|
281
|
-
var outgoingEdgs = graph.getOutgoingEdges(curr);
|
|
282
|
-
|
|
283
|
-
if (outgoingEdgs === null || outgoingEdgs === void 0 ? void 0 : outgoingEdgs.length) {
|
|
284
|
-
return [].concat(_toConsumableArray(accu), _toConsumableArray(outgoingEdgs));
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return accu;
|
|
288
|
-
}, []);
|
|
289
|
-
|
|
290
|
-
if (childIncomingEdges === null || childIncomingEdges === void 0 ? void 0 : childIncomingEdges.length) {
|
|
291
|
-
childIncomingEdges.filter(function (edge) {
|
|
292
|
-
return !childNodes.map(function (i) {
|
|
293
|
-
return i.id;
|
|
294
|
-
}).includes(edge.getSourceCellId());
|
|
295
|
-
}) // 只考虑从外部连接到组里的连线
|
|
296
|
-
.forEach(function (edge) {
|
|
297
|
-
var sourceNode = edge.getSourceCell();
|
|
298
|
-
|
|
299
|
-
if (sourceNode instanceof GroupNode) {
|
|
300
|
-
experimentGraph.deleteEdges(edge);
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
var sourceParentNode = sourceNode.parent; // 若源节点不可见,且存在父群组节点,则说明源节点的父群组节点已折叠,此时创建一个连接折叠父节点的桩
|
|
305
|
-
|
|
306
|
-
if (!sourceNode.visible && sourceParentNode instanceof GroupNode) {
|
|
307
|
-
var sourceNodeId = sourceParentNode.id;
|
|
308
|
-
var parentNodePorts = sourceParentNode.getPortsByGroup('out');
|
|
309
|
-
var sourcePortId = parentNodePorts[0].id;
|
|
310
|
-
var targetNodeId = edge.getTargetCellId();
|
|
311
|
-
var targetPortId = edge.getTargetPortId();
|
|
312
|
-
graph.addEdge(new X6DemoGroupEdge({
|
|
313
|
-
sourceAnchor: 'bottom',
|
|
314
|
-
source: {
|
|
315
|
-
cell: sourceNodeId,
|
|
316
|
-
port: sourcePortId,
|
|
317
|
-
anchor: {
|
|
318
|
-
name: 'bottom'
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
target: {
|
|
322
|
-
cell: targetNodeId,
|
|
323
|
-
port: targetPortId,
|
|
324
|
-
anchor: {
|
|
325
|
-
name: 'center'
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
zIndex: 1
|
|
329
|
-
}));
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (childOutgoingEdges === null || childOutgoingEdges === void 0 ? void 0 : childOutgoingEdges.length) {
|
|
335
|
-
childOutgoingEdges.filter(function (edge) {
|
|
336
|
-
return !childNodes.map(function (i) {
|
|
337
|
-
return i.id;
|
|
338
|
-
}).includes(edge.getTargetCellId());
|
|
339
|
-
}).forEach(function (edge) {
|
|
340
|
-
var targetNode = edge.getTargetCell();
|
|
341
|
-
|
|
342
|
-
if (targetNode instanceof GroupNode) {
|
|
343
|
-
experimentGraph.deleteEdges(edge);
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
var targetParentNode = targetNode.parent; // 若源节点不可见,且存在父群组节点,则说明源节点的父群组节点已折叠,此时创建一个连接折叠父节点的桩
|
|
348
|
-
|
|
349
|
-
if (!targetNode.visible && targetParentNode instanceof GroupNode) {
|
|
350
|
-
var targetNodeId = targetParentNode.id;
|
|
351
|
-
var parentNodePorts = targetParentNode.getPortsByGroup('in');
|
|
352
|
-
var targetPortId = parentNodePorts[0].id;
|
|
353
|
-
var sourceNodeId = edge.getSourceCellId();
|
|
354
|
-
var sourcePortId = edge.getSourcePortId();
|
|
355
|
-
graph.addEdge(new X6DemoGroupEdge({
|
|
356
|
-
sourceAnchor: 'bottom',
|
|
357
|
-
source: {
|
|
358
|
-
cell: sourceNodeId,
|
|
359
|
-
port: sourcePortId,
|
|
360
|
-
anchor: {
|
|
361
|
-
name: 'bottom'
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
target: {
|
|
365
|
-
cell: targetNodeId,
|
|
366
|
-
port: targetPortId,
|
|
367
|
-
anchor: {
|
|
368
|
-
name: 'center'
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
zIndex: 1
|
|
372
|
-
}));
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
}, [node, experimentGraph]);
|
|
377
|
-
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
378
|
-
prefixCls: ANT_PREFIX
|
|
379
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
380
|
-
className: styles.nodeGroup
|
|
381
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
382
|
-
className: styles.row
|
|
383
|
-
}, /*#__PURE__*/React.createElement(_Popover, {
|
|
384
|
-
content: name,
|
|
385
|
-
overlayClassName: styles.namePopover
|
|
386
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
387
|
-
className: styles.name
|
|
388
|
-
}, name.length > 20 ? "".concat(name.slice(0, 20), "...") : name)), isCollapsed ? /*#__PURE__*/React.createElement(PlusSquareOutlined, {
|
|
389
|
-
className: styles.collapseButton,
|
|
390
|
-
onClick: onExpandGroup
|
|
391
|
-
}) : /*#__PURE__*/React.createElement(MinusSquareOutlined, {
|
|
392
|
-
className: styles.collapseButton,
|
|
393
|
-
onClick: onCollapseGroup
|
|
394
|
-
}))));
|
|
395
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
@borderColor: #d9d9d9;
|
|
2
|
-
|
|
3
|
-
.nodeGroup {
|
|
4
|
-
width: 100%;
|
|
5
|
-
height: 100%;
|
|
6
|
-
font-size: 12px;
|
|
7
|
-
background-color: #fff;
|
|
8
|
-
border: 1px dashed @borderColor;
|
|
9
|
-
border-radius: 4px;
|
|
10
|
-
cursor: default; // TODO: 暂时还不支持群组移动,先把鼠标变成不可拖动的类型
|
|
11
|
-
|
|
12
|
-
.row {
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: row-reverse;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
height: 32px;
|
|
18
|
-
padding: 0 8px;
|
|
19
|
-
|
|
20
|
-
.name {
|
|
21
|
-
z-index: 11;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.collapseButton {
|
|
25
|
-
z-index: 11;
|
|
26
|
-
order: -1;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.toolbar {
|
|
31
|
-
z-index: 11;
|
|
32
|
-
margin-top: 2px;
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.x6-node-selected {
|
|
39
|
-
:local {
|
|
40
|
-
.nodeGroup {
|
|
41
|
-
background-color: rgba(243, 249, 255, 0.92);
|
|
42
|
-
border: 1px solid #1890ff;
|
|
43
|
-
box-shadow: 0 0 3px 3px rgba(64, 169, 255, 0.2);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.namePopover {
|
|
49
|
-
.ant-popover-inner-content {
|
|
50
|
-
padding: 8px 12px !important;
|
|
51
|
-
font-size: 12px;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import "./index.less";
|
|
3
|
-
export var NodePopover = function NodePopover(_ref) {
|
|
4
|
-
var children = _ref.children;
|
|
5
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
-
style: {
|
|
7
|
-
width: '100%',
|
|
8
|
-
height: '100%'
|
|
9
|
-
}
|
|
10
|
-
}, children);
|
|
11
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare const SCENE_DISPLAY: {
|
|
2
|
-
EQUIPMENT: string;
|
|
3
|
-
TIME: string;
|
|
4
|
-
MANUAL: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const COMPONENTS_TYPE: {
|
|
7
|
-
COMMONLY_USED: string;
|
|
8
|
-
SCENE_DISPLAY: string;
|
|
9
|
-
SIGN_OPERATION: string;
|
|
10
|
-
MOTION_OPERATION: string;
|
|
11
|
-
APPLICATION: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const COMMONLY_USED: {
|
|
14
|
-
VARIATE: string;
|
|
15
|
-
};
|
|
16
|
-
export declare const SIGN_OPERATION: {
|
|
17
|
-
RELATION: string;
|
|
18
|
-
LOGICAL: string;
|
|
19
|
-
CONDITION: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const MOTION_OPERATION: {
|
|
22
|
-
ALARM: string;
|
|
23
|
-
NOTICE: string;
|
|
24
|
-
ORDER: string;
|
|
25
|
-
CONTROL: string;
|
|
26
|
-
};
|
|
27
|
-
export declare const ALL_NODE_TYPE: string[];
|
|
28
|
-
export declare const nodeTypeMeta: any;
|