@riil-frontend/component-topology 5.0.6 → 5.0.7

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.
@@ -2,16 +2,20 @@ import React from 'react';
2
2
  import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
3
3
  import NodeIconSelect from "../node/NodeIconSelect";
4
4
  export default function BatchSetNodeIcon(props) {
5
- var topo = props.topo;
5
+ var topo = props.topo; // 节点及折叠的区域可设置图标
6
6
 
7
7
  var setNodeIcon = function setNodeIcon(iconId) {
8
8
  topo.historyManager.beginTransaction();
9
9
  var selection = topo.getSelectionModel().getSelection().toArray();
10
10
  var nodes = selection.filter(function (element) {
11
- return isNode(element) && !isGroup(element);
11
+ return isNode(element);
12
12
  });
13
13
  nodes.forEach(function (node) {
14
- node.setImage(iconId);
14
+ if (isGroup(node) && !node.isExpanded()) {
15
+ node.setImage(iconId);
16
+ } else if (!isGroup(node)) {
17
+ node.setImage(iconId);
18
+ }
15
19
  });
16
20
  topo.historyManager.endTransaction();
17
21
  };
@@ -21,7 +21,7 @@ import PluginManager from "./PluginManager";
21
21
  import topoFactory from "./topoFactory";
22
22
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig"; // eslint-disable-next-line no-undef
23
23
 
24
- var version = typeof "5.0.6" === 'string' ? "5.0.6" : null;
24
+ var version = typeof "5.0.7" === 'string' ? "5.0.7" : null;
25
25
  console.info("\u62D3\u6251\u7248\u672C: " + version);
26
26
  /**
27
27
  * 拓扑显示和编辑
@@ -12,16 +12,20 @@ var _htElementUtils = require("../../../../../../utils/htElementUtils");
12
12
  var _NodeIconSelect = _interopRequireDefault(require("../node/NodeIconSelect"));
13
13
 
14
14
  function BatchSetNodeIcon(props) {
15
- var topo = props.topo;
15
+ var topo = props.topo; // 节点及折叠的区域可设置图标
16
16
 
17
17
  var setNodeIcon = function setNodeIcon(iconId) {
18
18
  topo.historyManager.beginTransaction();
19
19
  var selection = topo.getSelectionModel().getSelection().toArray();
20
20
  var nodes = selection.filter(function (element) {
21
- return (0, _htElementUtils.isNode)(element) && !(0, _htElementUtils.isGroup)(element);
21
+ return (0, _htElementUtils.isNode)(element);
22
22
  });
23
23
  nodes.forEach(function (node) {
24
- node.setImage(iconId);
24
+ if ((0, _htElementUtils.isGroup)(node) && !node.isExpanded()) {
25
+ node.setImage(iconId);
26
+ } else if (!(0, _htElementUtils.isGroup)(node)) {
27
+ node.setImage(iconId);
28
+ }
25
29
  });
26
30
  topo.historyManager.endTransaction();
27
31
  };
@@ -50,7 +50,7 @@ var _topoFactory = _interopRequireDefault(require("./topoFactory"));
50
50
  var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTagTipConfig"));
51
51
 
52
52
  // eslint-disable-next-line no-undef
53
- var version = typeof "5.0.6" === 'string' ? "5.0.6" : null;
53
+ var version = typeof "5.0.7" === 'string' ? "5.0.7" : null;
54
54
  console.info("\u62D3\u6251\u7248\u672C: " + version);
55
55
  /**
56
56
  * 拓扑显示和编辑
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -115,6 +115,6 @@
115
115
  "access": "public"
116
116
  },
117
117
  "license": "MIT",
118
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@5.0.6/build/index.html",
118
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@5.0.7/build/index.html",
119
119
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
120
120
  }