@riil-frontend/component-topology 6.0.0-alpha.30 → 6.0.0-alpha.32

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.
Files changed (95) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +20 -20
  5. package/es/core/editor/components/EditorPlugin.js +2 -1
  6. package/es/core/editor/components/Sidebar/Sidebar.js +2 -1
  7. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +2 -3
  8. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -0
  9. package/es/core/editor/components/Toolbar/buttons.js +5 -4
  10. package/es/core/editor/components/Toolbar/hooks/textStyleSetting/EmptySetting.js +8 -0
  11. package/es/core/editor/components/Toolbar/hooks/textStyleSetting/edgeTagSetting.js +8 -0
  12. package/es/core/editor/components/Toolbar/hooks/textStyleSetting/globalTag.js +36 -0
  13. package/es/core/editor/components/Toolbar/hooks/textStyleSetting/nodeTagSetting.js +8 -0
  14. package/es/core/editor/components/Toolbar/hooks/textStyleSetting/text.js +8 -0
  15. package/es/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +54 -14
  16. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +29 -9
  17. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +15 -0
  18. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +4 -0
  19. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +16 -16
  20. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +20 -18
  21. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +85 -39
  22. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +20 -25
  23. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +22 -6
  24. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +15 -11
  25. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +23 -8
  26. package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +13 -5
  27. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +40 -0
  28. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +13 -0
  29. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +13 -0
  30. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +12 -0
  31. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +13 -0
  32. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +13 -0
  33. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +25 -0
  34. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +46 -0
  35. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +25 -0
  36. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +36 -0
  37. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +17 -0
  38. package/es/core/editor/components/settings/CloseablePanel.js +7 -2
  39. package/es/core/editor/components/settings/CloseablePanel.module.scss +9 -0
  40. package/es/core/editor/components/settings/PropertyView.js +7 -5
  41. package/es/core/editor/components/settings/common/AlignSetting/index.js +1 -2
  42. package/es/core/editor/components/settings/common/text/fontStyleUtil.js +5 -4
  43. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -1
  44. package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +1 -1
  45. package/es/core/editor/utils/textStyleUtil.js +0 -0
  46. package/es/core/hooks/usePolling.js +2 -5
  47. package/es/core/models/AttributeMetricDisplay.js +4 -0
  48. package/es/core/models/TopoApp.js +1 -1
  49. package/es/utils/htElementUtils.js +3 -0
  50. package/lib/core/editor/components/EditorPlugin.js +3 -1
  51. package/lib/core/editor/components/Sidebar/Sidebar.js +2 -1
  52. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +2 -3
  53. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -0
  54. package/lib/core/editor/components/Toolbar/buttons.js +5 -4
  55. package/lib/core/editor/components/Toolbar/hooks/textStyleSetting/EmptySetting.js +13 -0
  56. package/lib/core/editor/components/Toolbar/hooks/textStyleSetting/edgeTagSetting.js +13 -0
  57. package/lib/core/editor/components/Toolbar/hooks/textStyleSetting/globalTag.js +47 -0
  58. package/lib/core/editor/components/Toolbar/hooks/textStyleSetting/nodeTagSetting.js +13 -0
  59. package/lib/core/editor/components/Toolbar/hooks/textStyleSetting/text.js +13 -0
  60. package/lib/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +57 -17
  61. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +29 -8
  62. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +15 -0
  63. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +5 -0
  64. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +17 -16
  65. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +21 -18
  66. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +89 -39
  67. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +20 -25
  68. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +22 -6
  69. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +14 -11
  70. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +23 -8
  71. package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +14 -5
  72. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +54 -0
  73. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +23 -0
  74. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +23 -0
  75. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +25 -0
  76. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +23 -0
  77. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +23 -0
  78. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +40 -0
  79. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +58 -0
  80. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +39 -0
  81. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +47 -0
  82. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +28 -0
  83. package/lib/core/editor/components/settings/CloseablePanel.js +8 -2
  84. package/lib/core/editor/components/settings/CloseablePanel.module.scss +9 -0
  85. package/lib/core/editor/components/settings/PropertyView.js +9 -7
  86. package/lib/core/editor/components/settings/common/AlignSetting/index.js +1 -2
  87. package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +5 -4
  88. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -1
  89. package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +1 -1
  90. package/lib/core/editor/utils/textStyleUtil.js +1 -0
  91. package/lib/core/hooks/usePolling.js +2 -5
  92. package/lib/core/models/AttributeMetricDisplay.js +4 -0
  93. package/lib/core/models/TopoApp.js +1 -1
  94. package/lib/utils/htElementUtils.js +5 -0
  95. package/package.json +2 -2
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports.getElementTextStyle = getElementTextStyle;
7
+ exports.getTextStyle = getTextStyle;
8
+ exports.setTextStyle = setTextStyle;
9
+
10
+ var _htElementUtils = require("../../../../../../../../utils/htElementUtils");
11
+
12
+ var _elements = _interopRequireDefault(require("./elements"));
13
+
14
+ function getElementType(element) {
15
+ if ((0, _htElementUtils.isText)(element)) {
16
+ return 'text';
17
+ } else if ((0, _htElementUtils.isGroup)(element)) {
18
+ return 'groupTitle';
19
+ } else if ((0, _htElementUtils.isNode)(element)) {
20
+ return 'nodeTag';
21
+ } else if ((0, _htElementUtils.isEdge)(element)) {
22
+ return 'edgeTag';
23
+ } else if ((0, _htElementUtils.isLayer)(element)) {
24
+ return 'layerTitle';
25
+ }
26
+
27
+ return null;
28
+ }
29
+
30
+ function getElementTextStyle(element) {
31
+ var type = getElementType(element);
32
+ var handler = _elements["default"][type];
33
+
34
+ if (handler) {
35
+ return handler.getTextStyle(element);
36
+ }
37
+
38
+ return null;
39
+ }
40
+
41
+ function getTextStyle(htSelection) {
42
+ if (htSelection.length === 1) {
43
+ var element = htSelection[0];
44
+ return getElementTextStyle(element);
45
+ } // 多选时值相同返回?
46
+
47
+
48
+ return null;
49
+ }
50
+
51
+ function setTextStyle(element, style) {
52
+ var type = getElementType(element);
53
+ var handler = _elements["default"][type];
54
+
55
+ if (handler) {
56
+ handler.setTextStyle(element, style);
57
+ }
58
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports["default"] = void 0;
7
+
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
+
12
+ var _react = _interopRequireWildcard(require("react"));
13
+
14
+ var _globalTag = require("./globalTag");
15
+
16
+ var _excluded = ["Component"];
17
+
18
+ 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); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function GlobalTagStyleSetting(props) {
23
+ var topo = props.topo;
24
+ var Component = props.Component,
25
+ widgetProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
26
+ var values = (0, _globalTag.useValues)(topo);
27
+ var setStyle = (0, _react.useMemo)(function () {
28
+ return function (style) {
29
+ return (0, _globalTag.setGlobalTagStyle)(topo, style);
30
+ };
31
+ }, []);
32
+ return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({
33
+ style: values,
34
+ setStyle: setStyle
35
+ }, widgetProps));
36
+ }
37
+
38
+ var _default = GlobalTagStyleSetting;
39
+ exports["default"] = _default;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports.setGlobalTagStyle = void 0;
7
+ exports.setStyle = setStyle;
8
+ exports.useValues = useValues;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var defaultStyle = {
13
+ color: '#AFB9C2',
14
+ fontFamily: '微软雅黑'
15
+ };
16
+
17
+ function useValues(topo) {
18
+ var displayConfigState = topo.store.useModelState('displayConfig');
19
+ var nodeLabelStyle = displayConfigState.nodeLabelStyle,
20
+ defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
21
+ return {
22
+ color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
23
+ fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
24
+ fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize
25
+ };
26
+ }
27
+
28
+ var setGlobalTagStyle = function setGlobalTagStyle(topo, styleData) {
29
+ var _topo$store$getModel = topo.store.getModel('displayConfig'),
30
+ displayConfigState = _topo$store$getModel[0],
31
+ displayConfigDispatchers = _topo$store$getModel[1];
32
+
33
+ var nodeLabelStyle = displayConfigState.nodeLabelStyle,
34
+ defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
35
+ var globalNodeLabelStyle = (0, _extends2["default"])({}, nodeLabelStyle, styleData);
36
+ topo.getHtTopo().setGlobalNodeLabelStyle(globalNodeLabelStyle);
37
+ var globalEdgeTagStyle = (0, _extends2["default"])({}, defaultEdgeLabelStyle, styleData);
38
+ topo.getHtTopo().setGlobalEdgeTagStyle(globalEdgeTagStyle);
39
+ displayConfigDispatchers.update({
40
+ nodeLabelStyle: globalNodeLabelStyle,
41
+ defaultEdgeLabelStyle: globalEdgeTagStyle
42
+ });
43
+ };
44
+
45
+ exports.setGlobalTagStyle = setGlobalTagStyle;
46
+
47
+ function setStyle() {}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.__esModule = true;
6
+ exports["default"] = void 0;
7
+
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _ElementTextStyleSetting = _interopRequireDefault(require("./ElementTextStyleSetting/ElementTextStyleSetting"));
13
+
14
+ var _GlobalTagStyleSetting = _interopRequireDefault(require("./GlobalTagStyleSetting/GlobalTagStyleSetting"));
15
+
16
+ function textStyleSettingRouter(Component, options) {
17
+ return function TextStyleSettingButton(props) {
18
+ var topo = props.topo;
19
+ var selection = topo.selectionManager.useHtSelection();
20
+ var Widget = !selection.length ? _GlobalTagStyleSetting["default"] : _ElementTextStyleSetting["default"];
21
+ return /*#__PURE__*/_react["default"].createElement(Widget, (0, _extends2["default"])({
22
+ Component: Component
23
+ }, props));
24
+ };
25
+ }
26
+
27
+ var _default = textStyleSettingRouter;
28
+ exports["default"] = _default;
@@ -11,12 +11,16 @@ var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
11
11
 
12
12
  var _react = _interopRequireDefault(require("react"));
13
13
 
14
+ var _CloseablePanelModule = _interopRequireDefault(require("./CloseablePanel.module.scss"));
15
+
14
16
  function CloseablePanel(props) {
15
17
  var prefix = props.prefix,
16
18
  title = props.title,
17
19
  onClose = props.onClose,
18
20
  children = props.children;
19
- return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
21
+ return /*#__PURE__*/_react["default"].createElement("div", {
22
+ className: _CloseablePanelModule["default"].panel
23
+ }, /*#__PURE__*/_react["default"].createElement("div", {
20
24
  className: prefix + "drawer-header",
21
25
  role: "heading",
22
26
  "aria-level": "1"
@@ -28,7 +32,9 @@ function CloseablePanel(props) {
28
32
  }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
29
33
  type: "close",
30
34
  className: "next-drawer-close-icon"
31
- }))), /*#__PURE__*/_react["default"].createElement("div", null, children));
35
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
36
+ className: _CloseablePanelModule["default"].body
37
+ }, children));
32
38
  }
33
39
 
34
40
  CloseablePanel.defaultProps = {
@@ -0,0 +1,9 @@
1
+ .panel {
2
+ height: 100%;
3
+ display: flex;
4
+ flex-direction: column;
5
+ background: #FFFFFF;
6
+ }
7
+ .body {
8
+ flex: 1;
9
+ }
@@ -5,17 +5,17 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports["default"] = PropertyView;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _classnames = _interopRequireDefault(require("classnames"));
11
9
 
12
- var _Settings = _interopRequireDefault(require("./Settings"));
10
+ var _react = _interopRequireDefault(require("react"));
13
11
 
14
- var _SettingsModule = _interopRequireDefault(require("./Settings.module.scss"));
12
+ var _CloseablePanel = _interopRequireDefault(require("./CloseablePanel"));
15
13
 
16
14
  var _OpenPropertyPanelListener = _interopRequireDefault(require("./OpenPropertyPanelListener"));
17
15
 
18
- var _CloseablePanel = _interopRequireDefault(require("./CloseablePanel"));
16
+ var _Settings = _interopRequireDefault(require("./Settings"));
17
+
18
+ var _SettingsModule = _interopRequireDefault(require("./Settings.module.scss"));
19
19
 
20
20
  function PropertyView(props) {
21
21
  var _classNames;
@@ -41,7 +41,7 @@ function PropertyView(props) {
41
41
  }
42
42
 
43
43
  var renderContent = function renderContent() {
44
- if (!graphLoaded) {
44
+ if (!propertyPanelVisible) {
45
45
  return null;
46
46
  }
47
47
 
@@ -65,5 +65,7 @@ function PropertyView(props) {
65
65
  propertyPanelVisible: false
66
66
  });
67
67
  }
68
- }), renderContent());
68
+ }, /*#__PURE__*/_react["default"].createElement(_OpenPropertyPanelListener["default"], {
69
+ topo: topo
70
+ }, renderContent())));
69
71
  }
@@ -23,8 +23,7 @@ function AlignSetting(props) {
23
23
  return !(0, _htElementUtils.isLayer)(ele) && !(0, _htElementUtils.isEdge)(ele);
24
24
  }); // console.info("element--selectList", element, selectList);
25
25
 
26
- topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(type, nodes); // topo.view.topoClient.htTopoClient.setElementsSpace(nodes,'h',300)
27
-
26
+ topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(type, nodes);
28
27
  topo.historyManager.endTransaction();
29
28
  };
30
29
 
@@ -12,7 +12,8 @@ var fontStyleUtil = {
12
12
  var arr = font.trim().split(' ');
13
13
  var bold = font.indexOf('bold') > -1;
14
14
  var italic = font.indexOf('italic') > -1;
15
- var fontFamily, fontSize;
15
+ var fontFamily;
16
+ var fontSize;
16
17
 
17
18
  if (arr.length) {
18
19
  fontFamily = arr[arr.length - 1];
@@ -33,15 +34,15 @@ var fontStyleUtil = {
33
34
  build: function build(style) {
34
35
  var font = '';
35
36
 
36
- if (style.font.bold) {
37
+ if (style.bold) {
37
38
  font += 'bold ';
38
39
  }
39
40
 
40
- if (style.font.italic) {
41
+ if (style.italic) {
41
42
  font += 'italic ';
42
43
  }
43
44
 
44
- return "" + font + style.font.fontSize + "px " + style.font.fontFamily;
45
+ return "" + font + style.fontSize + "px " + style.fontFamily;
45
46
  },
46
47
  getFontStyleMap: function getFontStyleMap(obj, prefix) {
47
48
  var map = {};
@@ -62,8 +62,10 @@ function CommonEdgePropertyView(props) {
62
62
  }, [values]);
63
63
 
64
64
  var setLineColor = function setLineColor(color) {
65
- var style = edge.a("styles") || {};
65
+ // 同时修改实线、虚线
66
66
  edge.s("edge.color", color);
67
+ edge.s("edge.dash.color", color);
68
+ var style = edge.a("styles") || {};
67
69
  edge.a("styles", (0, _extends2["default"])({}, style, {
68
70
  color: color
69
71
  }));
@@ -114,6 +116,10 @@ function CommonEdgePropertyView(props) {
114
116
  style: {
115
117
  width: "100%"
116
118
  },
119
+ onChange: function onChange(val) {
120
+ // 同时修改实线、虚线的线宽
121
+ edge.s('edge.dash.width', val);
122
+ },
117
123
  onFocus: function onFocus() {
118
124
  topo.historyManager.beginTransaction();
119
125
  },
@@ -56,7 +56,7 @@ function TextPropertyView(props) {
56
56
 
57
57
  _onChange('styleMap.label.color', value.color, newValues);
58
58
 
59
- var font = _fontStyleUtil["default"].build(value);
59
+ var font = _fontStyleUtil["default"].build(value.font);
60
60
 
61
61
  _onChange('styleMap.text.font', font, newValues);
62
62
 
@@ -0,0 +1 @@
1
+ "use strict";
@@ -74,11 +74,8 @@ var usePolling = function usePolling(props) {
74
74
 
75
75
 
76
76
  (0, _react.useEffect)(function () {
77
- var isViewer = topoState.viewState === 'view';
78
-
79
- if (topo.options.enableDefaultMetricLoader && isViewer) {
77
+ if (topo.options.enableDefaultMetricLoader) {
80
78
  _rlog["default"].debug('usePolling.useEffect: 开始轮询', {
81
- isViewer: isViewer,
82
79
  pollingSwitch: pollingSwitch,
83
80
  resIdsList: resIdsList,
84
81
  resourceOverviewState: resourceOverviewState,
@@ -95,7 +92,7 @@ var usePolling = function usePolling(props) {
95
92
  stopPoll();
96
93
  }
97
94
  };
98
- }, [topoState.viewState, pollingSwitch, resIdsList, displayConfig, resourceOverviewState.id, resourceOverviewState.metricCodes]);
95
+ }, [pollingSwitch, resIdsList, displayConfig, resourceOverviewState.id, resourceOverviewState.metricCodes]);
99
96
  /**
100
97
  *
101
98
  * @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
@@ -668,7 +668,11 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
668
668
  var htTopo = topo.getHtTopo();
669
669
 
670
670
  if (htTopo) {
671
+ var _topo$historyManager, _topo$historyManager2;
672
+
673
+ (_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
671
674
  htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
675
+ (_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
672
676
  }
673
677
  }
674
678
  /**
@@ -52,7 +52,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
52
52
  var _SelectionManager = _interopRequireDefault(require("./SelectionManager"));
53
53
 
54
54
  // eslint-disable-next-line no-undef
55
- var version = typeof "6.0.0-alpha.30" === 'string' ? "6.0.0-alpha.30" : null;
55
+ var version = typeof "6.0.0-alpha.32" === 'string' ? "6.0.0-alpha.32" : null;
56
56
  console.info("\u62D3\u6251\u7248\u672C: " + version);
57
57
  /**
58
58
  * 拓扑显示和编辑
@@ -31,6 +31,7 @@ exports.isExistedElement = isExistedElement;
31
31
  exports.isGroup = isGroup;
32
32
  exports.isLayer = isLayer;
33
33
  exports.isNode = isNode;
34
+ exports.isText = isText;
34
35
  exports.isValidEdge = isValidEdge;
35
36
  exports.setElementRuntimeStyle = setElementRuntimeStyle;
36
37
 
@@ -95,6 +96,10 @@ function isLayer(element) {
95
96
  return element instanceof ht.Grid;
96
97
  }
97
98
 
99
+ function isText(element) {
100
+ return element instanceof ht.Text && element.a('isText');
101
+ }
102
+
98
103
  function getElements(dataModel) {
99
104
  // console.error(111, dataModel.getDatas().getArray())
100
105
  return dataModel.getDatas().getArray();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "6.0.0-alpha.30",
3
+ "version": "6.0.0-alpha.32",
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@6.0.0-alpha.30/build/index.html",
118
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.0-alpha.32/build/index.html",
119
119
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
120
120
  }