@riil-frontend/component-topology 6.0.5 → 6.0.6
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.
@@ -1,6 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
-
var _excluded = ["topo", "showLabel"];
|
3
|
+
var _excluded = ["topo", "showLabel", "editorProps"];
|
4
4
|
import React, { useEffect, useMemo, useState } from 'react';
|
5
5
|
import { getEdgesBySelection, setEdgesAndChildren, setEdgesType } from "../../../../utils/edgeTypeStyleUtil";
|
6
6
|
import DropdownButton from "../components/DropdownButton";
|
@@ -16,24 +16,29 @@ import EdgeType from "./EdgeType";
|
|
16
16
|
function EdgeTypeButton(props) {
|
17
17
|
var topo = props.topo,
|
18
18
|
showLabel = props.showLabel,
|
19
|
+
editorProps = props.editorProps,
|
19
20
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
20
21
|
|
21
22
|
var _useState = useState(true),
|
22
23
|
disabled = _useState[0],
|
23
|
-
setDisabled = _useState[1]; //
|
24
|
+
setDisabled = _useState[1]; // FIXME 临时方案支持业务拓扑禁用连线设置
|
24
25
|
|
25
26
|
|
27
|
+
var linkDrawShapeEnabled = editorProps.linkDrawShapeEnabled; // 拓扑图是否加载
|
28
|
+
|
26
29
|
var _topo$store$useModelS = topo.store.useModelState('topoMod'),
|
27
30
|
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
28
31
|
|
29
32
|
|
30
33
|
var selection = topo.selectionModel.useHtSelection();
|
31
34
|
useEffect(function () {
|
32
|
-
if (graphLoaded) {
|
35
|
+
if (graphLoaded && linkDrawShapeEnabled !== false) {
|
33
36
|
var edges = getEdgesBySelection(topo);
|
34
37
|
setDisabled(!edges.length);
|
38
|
+
} else {
|
39
|
+
setDisabled(true);
|
35
40
|
}
|
36
|
-
}, [selection, graphLoaded]);
|
41
|
+
}, [selection, graphLoaded, linkDrawShapeEnabled]);
|
37
42
|
|
38
43
|
var handleChange = function handleChange(name, value) {
|
39
44
|
var edges = getEdgesBySelection(topo);
|
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "6.0.
|
26
|
+
var version = typeof "6.0.6" === 'string' ? "6.0.6" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -21,7 +21,7 @@ var _constants = require("./constants");
|
|
21
21
|
|
22
22
|
var _EdgeType = _interopRequireDefault(require("./EdgeType"));
|
23
23
|
|
24
|
-
var _excluded = ["topo", "showLabel"];
|
24
|
+
var _excluded = ["topo", "showLabel", "editorProps"];
|
25
25
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
27
27
|
|
@@ -35,24 +35,29 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
35
35
|
function EdgeTypeButton(props) {
|
36
36
|
var topo = props.topo,
|
37
37
|
showLabel = props.showLabel,
|
38
|
+
editorProps = props.editorProps,
|
38
39
|
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
|
39
40
|
|
40
41
|
var _useState = (0, _react.useState)(true),
|
41
42
|
disabled = _useState[0],
|
42
|
-
setDisabled = _useState[1]; //
|
43
|
+
setDisabled = _useState[1]; // FIXME 临时方案支持业务拓扑禁用连线设置
|
43
44
|
|
44
45
|
|
46
|
+
var linkDrawShapeEnabled = editorProps.linkDrawShapeEnabled; // 拓扑图是否加载
|
47
|
+
|
45
48
|
var _topo$store$useModelS = topo.store.useModelState('topoMod'),
|
46
49
|
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
47
50
|
|
48
51
|
|
49
52
|
var selection = topo.selectionModel.useHtSelection();
|
50
53
|
(0, _react.useEffect)(function () {
|
51
|
-
if (graphLoaded) {
|
54
|
+
if (graphLoaded && linkDrawShapeEnabled !== false) {
|
52
55
|
var edges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
|
53
56
|
setDisabled(!edges.length);
|
57
|
+
} else {
|
58
|
+
setDisabled(true);
|
54
59
|
}
|
55
|
-
}, [selection, graphLoaded]);
|
60
|
+
}, [selection, graphLoaded, linkDrawShapeEnabled]);
|
56
61
|
|
57
62
|
var handleChange = function handleChange(name, value) {
|
58
63
|
var edges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "6.0.
|
57
|
+
var version = typeof "6.0.6" === 'string' ? "6.0.6" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.6",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.6/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|