@riil-frontend/component-topology 2.15.45 → 2.15.46
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/build/index.css +1 -1
- package/build/index.js +22 -22
- package/es/components/TagImageSelect/index.js +3 -1
- package/es/components/TagSelect/index.js +3 -3
- package/es/core/editor/components/settings/common/LayoutSettings.js +11 -19
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -4
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +13 -8
- package/es/core/models/TopoApp.js +1 -1
- package/lib/components/TagImageSelect/index.js +3 -1
- package/lib/components/TagSelect/index.js +3 -3
- package/lib/core/editor/components/settings/common/LayoutSettings.js +10 -18
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +2 -4
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +12 -7
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
|
@@ -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 = ["dataSource", "onChange", "size", "boxProps", "tagProps", "itemProps", "ItemComponent"];
|
|
3
|
+
var _excluded = ["dataSource", "onChange", "size", "boxProps", "tagProps", "itemProps", "ItemComponent", "value"];
|
|
4
4
|
import React from "react";
|
|
5
5
|
import TemplateButton from "../TemplateButton";
|
|
6
6
|
import TagSelect from "../TagSelect";
|
|
@@ -14,12 +14,14 @@ var TagImageSelect = function TagImageSelect(props) {
|
|
|
14
14
|
tagProps = props.tagProps,
|
|
15
15
|
itemProps = props.itemProps,
|
|
16
16
|
ItemComponent = props.ItemComponent,
|
|
17
|
+
value = props.value,
|
|
17
18
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
19
|
|
|
19
20
|
var Item = ItemComponent || TemplateButton;
|
|
20
21
|
return /*#__PURE__*/React.createElement(TagSelect, _extends({}, otherProps, {
|
|
21
22
|
onChange: onChange,
|
|
22
23
|
className: styles.tagSelect,
|
|
24
|
+
value: value,
|
|
23
25
|
dataSource: dataSource.map(function (item) {
|
|
24
26
|
return {
|
|
25
27
|
key: item.id,
|
|
@@ -20,9 +20,9 @@ var TagSelect = function TagSelect(props) {
|
|
|
20
20
|
setCurrent = _useState[1];
|
|
21
21
|
|
|
22
22
|
useEffect(function () {
|
|
23
|
-
if (value) {
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
// if (value) {
|
|
24
|
+
// }
|
|
25
|
+
setCurrent(value);
|
|
26
26
|
}, [value]);
|
|
27
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
28
|
className: "tag-select-wrap"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _Form from "@alifd/next/es/form";
|
|
2
2
|
import _Radio from "@alifd/next/es/radio";
|
|
3
|
-
import React, { useState } from "react";
|
|
3
|
+
import React, { useState, useEffect } from "react";
|
|
4
4
|
import TemplateGroup from "../../../../../components/TagImageSelect";
|
|
5
5
|
import styles from "./LayoutSettings.module.scss";
|
|
6
6
|
var LAYOUTS = {
|
|
@@ -21,33 +21,25 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
21
21
|
var _props$layout = props.layout,
|
|
22
22
|
layout = _props$layout === void 0 ? {} : _props$layout,
|
|
23
23
|
onChange = props.onChange,
|
|
24
|
+
regionId = props.regionId,
|
|
24
25
|
size = props.size;
|
|
25
26
|
var layoutId = layout.id,
|
|
26
|
-
layoutOptions = layout.options;
|
|
27
|
-
|
|
28
|
-
var _useState = useState(layout || {}),
|
|
29
|
-
value = _useState[0],
|
|
30
|
-
setValue = _useState[1];
|
|
27
|
+
layoutOptions = layout.options; // const [value, setValue] = useState();
|
|
31
28
|
|
|
32
29
|
var handleChange = function handleChange(data) {
|
|
33
|
-
|
|
34
|
-
onChange && onChange(data); // setValue({
|
|
35
|
-
// id: data,
|
|
36
|
-
// options: {
|
|
37
|
-
// value: "east",
|
|
38
|
-
// label: "横向",
|
|
39
|
-
// },
|
|
40
|
-
// });
|
|
30
|
+
onChange && onChange(data);
|
|
41
31
|
};
|
|
42
32
|
|
|
43
33
|
var onLayoutSelect = function onLayoutSelect(id) {
|
|
34
|
+
// console.log("onLayoutSelect", id, layout, value);
|
|
44
35
|
var options;
|
|
45
36
|
|
|
46
37
|
if (id === "toward") {
|
|
47
38
|
options = {
|
|
48
39
|
subId: TREE_LAYOUT_OPTIONS[0].value
|
|
49
40
|
};
|
|
50
|
-
}
|
|
41
|
+
} // setValue(id);
|
|
42
|
+
|
|
51
43
|
|
|
52
44
|
handleChange({
|
|
53
45
|
id: id,
|
|
@@ -60,14 +52,14 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
60
52
|
id: id,
|
|
61
53
|
name: LAYOUTS[id],
|
|
62
54
|
icon: "layout_" + id,
|
|
63
|
-
selected: layoutId === id
|
|
64
|
-
onSelect: onLayoutSelect
|
|
55
|
+
selected: layoutId === id
|
|
65
56
|
};
|
|
66
57
|
});
|
|
67
58
|
return /*#__PURE__*/React.createElement("div", {
|
|
68
59
|
className: styles["layout-setting-template-group"]
|
|
69
60
|
}, /*#__PURE__*/React.createElement(TemplateGroup, {
|
|
70
61
|
dataSource: layoutGroup,
|
|
62
|
+
value: layoutId,
|
|
71
63
|
size: size,
|
|
72
64
|
onChange: onLayoutSelect,
|
|
73
65
|
boxProps: {
|
|
@@ -86,7 +78,7 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
86
78
|
iconClassName: styles.icon,
|
|
87
79
|
textClassName: styles.text
|
|
88
80
|
}
|
|
89
|
-
}), layoutId === "toward"
|
|
81
|
+
}), layoutId === "toward" ? /*#__PURE__*/React.createElement(_Form.Item, {
|
|
90
82
|
label: "\u5E03\u5C40\u65B9\u5411"
|
|
91
83
|
}, /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
92
84
|
dataSource: TREE_LAYOUT_OPTIONS,
|
|
@@ -99,7 +91,7 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
99
91
|
}
|
|
100
92
|
});
|
|
101
93
|
}
|
|
102
|
-
})));
|
|
94
|
+
})) : null);
|
|
103
95
|
};
|
|
104
96
|
|
|
105
97
|
export default LayoutSettings;
|
|
@@ -2,11 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
4
4
|
import { iconFactory } from "@riil-frontend/component-topology-graph";
|
|
5
|
-
import sortBy from
|
|
5
|
+
import sortBy from "lodash/sortBy";
|
|
6
6
|
import { getGroupChildrenNodes, getNodeData } from "../../../../../../../../utils/htElementUtils";
|
|
7
7
|
|
|
8
8
|
function sortResourcesByName(resources) {
|
|
9
|
-
return sortBy(resources,
|
|
9
|
+
return sortBy(resources, "name");
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export default function useGroupRelateResource(props) {
|
|
@@ -33,7 +33,7 @@ export default function useGroupRelateResource(props) {
|
|
|
33
33
|
data: item,
|
|
34
34
|
node: item.node
|
|
35
35
|
};
|
|
36
|
-
});
|
|
37
|
-
|
|
36
|
+
}); // rlog.info('useGroupRelateResource', data);
|
|
37
|
+
|
|
38
38
|
return data;
|
|
39
39
|
}
|
package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _Form from "@alifd/next/es/form";
|
|
2
2
|
import _Collapse from "@alifd/next/es/collapse";
|
|
3
|
-
import React, { useState, useEffect, useRef, useCallback } from
|
|
3
|
+
import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
4
4
|
import GroupExpandStatus from "./GroupExpandStatus";
|
|
5
5
|
import AlignSetting from "../../../common/AlignSetting";
|
|
6
6
|
import LayoutSettings from "../../../common/LayoutSettings"; // import NodeIconSelect from '../../node/NodeIconSelect';
|
|
@@ -12,6 +12,7 @@ export default function GroupExpandSetting(props) {
|
|
|
12
12
|
group = props.group,
|
|
13
13
|
expanded = props.expanded,
|
|
14
14
|
onChange = props.onChange,
|
|
15
|
+
id = props.id,
|
|
15
16
|
settingRuntimeState = props.settingRuntimeState;
|
|
16
17
|
|
|
17
18
|
var _useState = useState(),
|
|
@@ -19,22 +20,26 @@ export default function GroupExpandSetting(props) {
|
|
|
19
20
|
setLayout = _useState[1];
|
|
20
21
|
|
|
21
22
|
var alignOnChange = function alignOnChange(v) {
|
|
22
|
-
console.log(
|
|
23
|
-
|
|
24
|
-
onChange(
|
|
23
|
+
// console.log("setAlignmentBySelectionNodes", v);
|
|
24
|
+
// topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
|
|
25
|
+
onChange("groupAlign", v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
var layoutOnChange = function layoutOnChange(v) {
|
|
28
|
-
console.log(
|
|
29
|
+
// console.log("layoutOnChange", v);
|
|
29
30
|
setLayout(v); // topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
|
|
30
31
|
|
|
31
|
-
onChange(
|
|
32
|
+
onChange("layout", v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
32
33
|
};
|
|
33
34
|
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
// console.log("GroupExpandSetting-id-layout", id, layout);
|
|
37
|
+
setLayout({}); // onChange("layout", {});
|
|
38
|
+
}, [id]);
|
|
34
39
|
return /*#__PURE__*/React.createElement(_Collapse, {
|
|
35
|
-
defaultExpandedKeys: [
|
|
40
|
+
defaultExpandedKeys: ["布局", "显示设置", "对齐方式"],
|
|
36
41
|
style: {
|
|
37
|
-
border:
|
|
42
|
+
border: "none"
|
|
38
43
|
}
|
|
39
44
|
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
|
40
45
|
key: "\u5E03\u5C40",
|
|
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
22
22
|
|
|
23
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.46" === 'string' ? "2.15.46" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
|
@@ -17,7 +17,7 @@ var _TagSelect = _interopRequireDefault(require("../TagSelect"));
|
|
|
17
17
|
|
|
18
18
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
|
19
19
|
|
|
20
|
-
var _excluded = ["dataSource", "onChange", "size", "boxProps", "tagProps", "itemProps", "ItemComponent"];
|
|
20
|
+
var _excluded = ["dataSource", "onChange", "size", "boxProps", "tagProps", "itemProps", "ItemComponent", "value"];
|
|
21
21
|
|
|
22
22
|
var TagImageSelect = function TagImageSelect(props) {
|
|
23
23
|
var dataSource = props.dataSource,
|
|
@@ -27,11 +27,13 @@ var TagImageSelect = function TagImageSelect(props) {
|
|
|
27
27
|
tagProps = props.tagProps,
|
|
28
28
|
itemProps = props.itemProps,
|
|
29
29
|
ItemComponent = props.ItemComponent,
|
|
30
|
+
value = props.value,
|
|
30
31
|
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
|
|
31
32
|
var Item = ItemComponent || _TemplateButton["default"];
|
|
32
33
|
return /*#__PURE__*/_react["default"].createElement(_TagSelect["default"], (0, _extends2["default"])({}, otherProps, {
|
|
33
34
|
onChange: onChange,
|
|
34
35
|
className: _indexModule["default"].tagSelect,
|
|
36
|
+
value: value,
|
|
35
37
|
dataSource: dataSource.map(function (item) {
|
|
36
38
|
return {
|
|
37
39
|
key: item.id,
|
|
@@ -37,9 +37,9 @@ var TagSelect = function TagSelect(props) {
|
|
|
37
37
|
setCurrent = _useState[1];
|
|
38
38
|
|
|
39
39
|
(0, _react.useEffect)(function () {
|
|
40
|
-
if (value) {
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
// if (value) {
|
|
41
|
+
// }
|
|
42
|
+
setCurrent(value);
|
|
43
43
|
}, [value]);
|
|
44
44
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
45
45
|
className: "tag-select-wrap"
|
|
@@ -37,33 +37,25 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
37
37
|
var _props$layout = props.layout,
|
|
38
38
|
layout = _props$layout === void 0 ? {} : _props$layout,
|
|
39
39
|
onChange = props.onChange,
|
|
40
|
+
regionId = props.regionId,
|
|
40
41
|
size = props.size;
|
|
41
42
|
var layoutId = layout.id,
|
|
42
|
-
layoutOptions = layout.options;
|
|
43
|
-
|
|
44
|
-
var _useState = (0, _react.useState)(layout || {}),
|
|
45
|
-
value = _useState[0],
|
|
46
|
-
setValue = _useState[1];
|
|
43
|
+
layoutOptions = layout.options; // const [value, setValue] = useState();
|
|
47
44
|
|
|
48
45
|
var handleChange = function handleChange(data) {
|
|
49
|
-
|
|
50
|
-
onChange && onChange(data); // setValue({
|
|
51
|
-
// id: data,
|
|
52
|
-
// options: {
|
|
53
|
-
// value: "east",
|
|
54
|
-
// label: "横向",
|
|
55
|
-
// },
|
|
56
|
-
// });
|
|
46
|
+
onChange && onChange(data);
|
|
57
47
|
};
|
|
58
48
|
|
|
59
49
|
var onLayoutSelect = function onLayoutSelect(id) {
|
|
50
|
+
// console.log("onLayoutSelect", id, layout, value);
|
|
60
51
|
var options;
|
|
61
52
|
|
|
62
53
|
if (id === "toward") {
|
|
63
54
|
options = {
|
|
64
55
|
subId: TREE_LAYOUT_OPTIONS[0].value
|
|
65
56
|
};
|
|
66
|
-
}
|
|
57
|
+
} // setValue(id);
|
|
58
|
+
|
|
67
59
|
|
|
68
60
|
handleChange({
|
|
69
61
|
id: id,
|
|
@@ -76,14 +68,14 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
76
68
|
id: id,
|
|
77
69
|
name: LAYOUTS[id],
|
|
78
70
|
icon: "layout_" + id,
|
|
79
|
-
selected: layoutId === id
|
|
80
|
-
onSelect: onLayoutSelect
|
|
71
|
+
selected: layoutId === id
|
|
81
72
|
};
|
|
82
73
|
});
|
|
83
74
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
84
75
|
className: _LayoutSettingsModule["default"]["layout-setting-template-group"]
|
|
85
76
|
}, /*#__PURE__*/_react["default"].createElement(_TagImageSelect["default"], {
|
|
86
77
|
dataSource: layoutGroup,
|
|
78
|
+
value: layoutId,
|
|
87
79
|
size: size,
|
|
88
80
|
onChange: onLayoutSelect,
|
|
89
81
|
boxProps: {
|
|
@@ -102,7 +94,7 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
102
94
|
iconClassName: _LayoutSettingsModule["default"].icon,
|
|
103
95
|
textClassName: _LayoutSettingsModule["default"].text
|
|
104
96
|
}
|
|
105
|
-
}), layoutId === "toward"
|
|
97
|
+
}), layoutId === "toward" ? /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
106
98
|
label: "\u5E03\u5C40\u65B9\u5411"
|
|
107
99
|
}, /*#__PURE__*/_react["default"].createElement(_radio["default"].Group, {
|
|
108
100
|
dataSource: TREE_LAYOUT_OPTIONS,
|
|
@@ -115,7 +107,7 @@ var LayoutSettings = function LayoutSettings(props) {
|
|
|
115
107
|
}
|
|
116
108
|
});
|
|
117
109
|
}
|
|
118
|
-
})));
|
|
110
|
+
})) : null);
|
|
119
111
|
};
|
|
120
112
|
|
|
121
113
|
var _default = LayoutSettings;
|
|
@@ -18,7 +18,7 @@ var _sortBy = _interopRequireDefault(require("lodash/sortBy"));
|
|
|
18
18
|
var _htElementUtils = require("../../../../../../../../utils/htElementUtils");
|
|
19
19
|
|
|
20
20
|
function sortResourcesByName(resources) {
|
|
21
|
-
return (0, _sortBy["default"])(resources,
|
|
21
|
+
return (0, _sortBy["default"])(resources, "name");
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function useGroupRelateResource(props) {
|
|
@@ -45,9 +45,7 @@ function useGroupRelateResource(props) {
|
|
|
45
45
|
data: item,
|
|
46
46
|
node: item.node
|
|
47
47
|
};
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
_rlog["default"].info('useGroupRelateResource', data);
|
|
48
|
+
}); // rlog.info('useGroupRelateResource', data);
|
|
51
49
|
|
|
52
50
|
return data;
|
|
53
51
|
}
|
package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js
CHANGED
|
@@ -30,6 +30,7 @@ function GroupExpandSetting(props) {
|
|
|
30
30
|
group = props.group,
|
|
31
31
|
expanded = props.expanded,
|
|
32
32
|
onChange = props.onChange,
|
|
33
|
+
id = props.id,
|
|
33
34
|
settingRuntimeState = props.settingRuntimeState;
|
|
34
35
|
|
|
35
36
|
var _useState = (0, _react.useState)(),
|
|
@@ -37,22 +38,26 @@ function GroupExpandSetting(props) {
|
|
|
37
38
|
setLayout = _useState[1];
|
|
38
39
|
|
|
39
40
|
var alignOnChange = function alignOnChange(v) {
|
|
40
|
-
console.log(
|
|
41
|
-
|
|
42
|
-
onChange(
|
|
41
|
+
// console.log("setAlignmentBySelectionNodes", v);
|
|
42
|
+
// topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
|
|
43
|
+
onChange("groupAlign", v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
var layoutOnChange = function layoutOnChange(v) {
|
|
46
|
-
console.log(
|
|
47
|
+
// console.log("layoutOnChange", v);
|
|
47
48
|
setLayout(v); // topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(v);
|
|
48
49
|
|
|
49
|
-
onChange(
|
|
50
|
+
onChange("layout", v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
|
50
51
|
};
|
|
51
52
|
|
|
53
|
+
(0, _react.useEffect)(function () {
|
|
54
|
+
// console.log("GroupExpandSetting-id-layout", id, layout);
|
|
55
|
+
setLayout({}); // onChange("layout", {});
|
|
56
|
+
}, [id]);
|
|
52
57
|
return /*#__PURE__*/_react["default"].createElement(_collapse["default"], {
|
|
53
|
-
defaultExpandedKeys: [
|
|
58
|
+
defaultExpandedKeys: ["布局", "显示设置", "对齐方式"],
|
|
54
59
|
style: {
|
|
55
|
-
border:
|
|
60
|
+
border: "none"
|
|
56
61
|
}
|
|
57
62
|
}, /*#__PURE__*/_react["default"].createElement(CollapsePanel, {
|
|
58
63
|
key: "\u5E03\u5C40",
|
|
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
|
48
48
|
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
var version = typeof "2.15.
|
|
51
|
+
var version = typeof "2.15.46" === 'string' ? "2.15.46" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.46",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -110,6 +110,6 @@
|
|
|
110
110
|
"access": "public"
|
|
111
111
|
},
|
|
112
112
|
"license": "MIT",
|
|
113
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.
|
|
113
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.46/build/index.html",
|
|
114
114
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
115
115
|
}
|