@riil-frontend/component-topology 6.0.20 → 7.0.0-dev.10

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 (70) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +13 -13
  4. package/es/core/components/TopoView/topoView.js +15 -20
  5. package/es/core/components/titlebar/index.js +2 -1
  6. package/es/core/editor/components/EditorPlugin.js +1 -2
  7. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -9
  8. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -11
  9. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +18 -14
  10. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +4 -4
  11. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +16 -9
  12. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
  13. package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  14. package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
  15. package/es/core/editor/hooks/useUpdateHtTopoDefaultTagStyle.js +2 -2
  16. package/es/core/hooks/useTopoEdit.js +131 -169
  17. package/es/core/models/TopoApp.js +1 -1
  18. package/es/core/models/topoData.js +3 -3
  19. package/es/core/store/coreModels.js +2 -0
  20. package/es/core/store/models/selection.js +3 -1
  21. package/es/core/store/models/topoConfig.js +7 -5
  22. package/es/core/store/models/topoMod.js +1 -1
  23. package/es/core/store/models/viewer/resourceDetail.js +31 -0
  24. package/es/core/utils/saveSerialize.js +2 -3
  25. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -5
  26. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +72 -43
  27. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +136 -0
  28. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +9 -16
  29. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +1 -1
  30. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +119 -117
  31. package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
  32. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
  33. package/es/networkTopo/getTopoData.js +2 -3
  34. package/es/networkTopo/store/topoCenter.js +27 -4
  35. package/es/style.js +22 -22
  36. package/lib/core/components/TopoView/topoView.js +15 -21
  37. package/lib/core/components/titlebar/index.js +5 -1
  38. package/lib/core/editor/components/EditorPlugin.js +1 -3
  39. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -9
  40. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -12
  41. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +18 -15
  42. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +4 -4
  43. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +16 -10
  44. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
  45. package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  46. package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
  47. package/lib/core/editor/hooks/useUpdateHtTopoDefaultTagStyle.js +2 -2
  48. package/lib/core/hooks/useTopoEdit.js +131 -169
  49. package/lib/core/models/TopoApp.js +1 -1
  50. package/lib/core/models/topoData.js +7 -11
  51. package/lib/core/store/coreModels.js +3 -0
  52. package/lib/core/store/models/selection.js +3 -1
  53. package/lib/core/store/models/topoConfig.js +7 -5
  54. package/lib/core/store/models/topoMod.js +1 -1
  55. package/lib/core/store/models/viewer/resourceDetail.js +40 -0
  56. package/lib/core/utils/saveSerialize.js +1 -3
  57. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -5
  58. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +71 -46
  59. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +156 -0
  60. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +9 -16
  61. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +1 -1
  62. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +119 -117
  63. package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
  64. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
  65. package/lib/networkTopo/getTopoData.js +3 -5
  66. package/lib/networkTopo/store/topoCenter.js +27 -4
  67. package/lib/style.js +22 -22
  68. package/package.json +2 -2
  69. package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
  70. package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
@@ -17,10 +17,10 @@ var _fontStyleUtil = _interopRequireDefault(require("../../../../../../settings/
17
17
 
18
18
  var _colorUtil = require("../colorUtil");
19
19
 
20
- var _excluded = ["color", "background", "opacity", "bold", "italic"];
20
+ var _excluded = ["color", "background", "opacity", "bold", "italic", "underline"];
21
21
 
22
22
  function getTextStyle(element) {
23
- var underline = null;
23
+ var underline = !!element.a('node.tag.fontUnderline');
24
24
  return (0, _extends2["default"])({
25
25
  color: (0, _colorUtil.parseColor)(element.a('ht.color')),
26
26
  underline: underline
@@ -28,14 +28,13 @@ function getTextStyle(element) {
28
28
  }
29
29
 
30
30
  function setTextStyle(element, style, topo) {
31
- var _fontStyleUtil$remove = _fontStyleUtil["default"].removeBoldItalic(style),
32
- color = _fontStyleUtil$remove.color,
33
- background = _fontStyleUtil$remove.background,
34
- opacity = _fontStyleUtil$remove.opacity,
35
- bold = _fontStyleUtil$remove.bold,
36
- italic = _fontStyleUtil$remove.italic,
37
- otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(_fontStyleUtil$remove, _excluded);
38
-
31
+ var color = style.color,
32
+ background = style.background,
33
+ opacity = style.opacity,
34
+ bold = style.bold,
35
+ italic = style.italic,
36
+ underline = style.underline,
37
+ otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(style, _excluded);
39
38
  var tagStyle = (0, _extends2["default"])({}, otherStyle);
40
39
 
41
40
  if ('color' in style) {
@@ -50,6 +49,10 @@ function setTextStyle(element, style, topo) {
50
49
  tagStyle.fontItalic = italic;
51
50
  }
52
51
 
52
+ if ('underline' in style) {
53
+ tagStyle.fontUnderline = underline;
54
+ }
55
+
53
56
  if ('background' in style) {
54
57
  // 背景颜色
55
58
  var prevStyle = getTextStyle(element);
@@ -66,7 +69,7 @@ function setTextStyle(element, style, topo) {
66
69
  }
67
70
 
68
71
  function getEnabledFields(element) {
69
- return ['fontFamily', 'color', 'background', 'opacity'];
72
+ return ['fontFamily', 'color', 'background', 'opacity', 'fontSize', 'bold', 'italic', 'underline'];
70
73
  }
71
74
  /**
72
75
  * 获得字段是否禁用
@@ -78,10 +81,10 @@ function getEnabledFields(element) {
78
81
 
79
82
  function getFieldDisabled(element) {
80
83
  return {
81
- fontSize: true,
82
- bold: true,
83
- italic: true,
84
- underline: true
84
+ fontSize: false,
85
+ bold: false,
86
+ italic: false,
87
+ underline: false
85
88
  };
86
89
  }
87
90
 
@@ -20,10 +20,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
20
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
21
 
22
22
  var fieldDisabled = {
23
- fontSize: true,
24
- bold: true,
25
- italic: true,
26
- underline: true
23
+ fontSize: false,
24
+ bold: false,
25
+ italic: false,
26
+ underline: false
27
27
  };
28
28
 
29
29
  function GlobalTagStyleSetting(props) {
@@ -16,7 +16,7 @@ var _fontStyleUtil = _interopRequireDefault(require("../../../../../settings/com
16
16
  var _colorUtil = require("../ElementTextStyleSetting/colorUtil");
17
17
 
18
18
  var _excluded = ["color", "background", "opacity"],
19
- _excluded2 = ["color", "background", "opacity", "bold", "italic"];
19
+ _excluded2 = ["color", "background", "opacity", "bold", "italic", "underline"];
20
20
  var defaultStyle = {
21
21
  color: '#AFB9C2',
22
22
  fontFamily: '微软雅黑'
@@ -29,7 +29,10 @@ function useValues(topo) {
29
29
  return (0, _extends2["default"])({
30
30
  color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
31
31
  fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
32
- fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize
32
+ fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize,
33
+ bold: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.bold,
34
+ italic: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.italic,
35
+ underline: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.underline
33
36
  }, (0, _colorUtil.parseBackground)(nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.background));
34
37
  }
35
38
 
@@ -74,14 +77,13 @@ function buildStyle(styleData, prevTagStyle) {
74
77
  }
75
78
 
76
79
  function buildGlobalStyle(styleData) {
77
- var _fontStyleUtil$remove = _fontStyleUtil["default"].removeBoldItalic(styleData),
78
- color = _fontStyleUtil$remove.color,
79
- background = _fontStyleUtil$remove.background,
80
- opacity = _fontStyleUtil$remove.opacity,
81
- bold = _fontStyleUtil$remove.bold,
82
- italic = _fontStyleUtil$remove.italic,
83
- otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(_fontStyleUtil$remove, _excluded2);
84
-
80
+ var color = styleData.color,
81
+ background = styleData.background,
82
+ opacity = styleData.opacity,
83
+ bold = styleData.bold,
84
+ italic = styleData.italic,
85
+ underline = styleData.underline,
86
+ otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(styleData, _excluded2);
85
87
  var tagStyle = (0, _extends2["default"])({}, otherStyle);
86
88
 
87
89
  if ('color' in styleData) {
@@ -96,6 +98,10 @@ function buildGlobalStyle(styleData) {
96
98
  tagStyle.fontItalic = italic;
97
99
  }
98
100
 
101
+ if ('underline' in styleData) {
102
+ tagStyle.fontUnderline = underline;
103
+ }
104
+
99
105
  if ('background' in styleData) {
100
106
  // 背景颜色
101
107
  tagStyle.background = (0, _colorUtil.formatRgbaColor)(background);
@@ -164,7 +164,8 @@ function Data(props) {
164
164
  nodeElement: node,
165
165
  node: values,
166
166
  topo: topo,
167
- topoEditApi: topoEditApi
167
+ topoEditApi: topoEditApi,
168
+ nodeBindResourceDrawerComponent: editorProps.nodeBindResourceDrawerComponent
168
169
  }))), bindType === "topo" && RelateTopoTree && /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
169
170
  label: "\u5173\u8054\u62D3\u6251"
170
171
  }, /*#__PURE__*/_react["default"].createElement(RelateTopoTree, {
@@ -28,7 +28,8 @@ function NodeRelateResourceButton(props) {
28
28
  var nodeElement = props.nodeElement,
29
29
  topo = props.topo,
30
30
  topoEditApi = props.topoEditApi,
31
- node = props.node;
31
+ node = props.node,
32
+ nodeBindResourceDrawerComponent = props.nodeBindResourceDrawerComponent;
32
33
  var hide = (0, _clusterUtil.isClusterMemberHtElement)(nodeElement) || ((_node$attrObject$data = node.attrObject.data) === null || _node$attrObject$data === void 0 ? void 0 : _node$attrObject$data.relateResource) === false;
33
34
  var currentResId = node.tag;
34
35
 
@@ -36,6 +37,7 @@ function NodeRelateResourceButton(props) {
36
37
  visible = _useState[0],
37
38
  setVisible = _useState[1];
38
39
 
40
+ var BindResourceDrawer = nodeBindResourceDrawerComponent || _BindResourceDrawer["default"];
39
41
  return !hide ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
40
42
  type: "primary",
41
43
  text: true,
@@ -43,7 +45,7 @@ function NodeRelateResourceButton(props) {
43
45
  onClick: function onClick() {
44
46
  setVisible(true);
45
47
  }
46
- }, node.tag ? '切换资源' : '选择资源', /*#__PURE__*/_react["default"].createElement(_BindResourceDrawer["default"], (0, _extends2["default"])({
48
+ }, node.tag ? '切换资源' : '选择资源', /*#__PURE__*/_react["default"].createElement(BindResourceDrawer, (0, _extends2["default"])({
47
49
  visible: visible,
48
50
  currentResId: currentResId
49
51
  }, props, {
@@ -32,7 +32,7 @@ function useKeyboardShortcut(props) {
32
32
 
33
33
  }
34
34
 
35
- if (e.keyCode === 32) {
35
+ if (e.keyCode === 32 && e.target.nodeName !== 'TEXTAREA') {
36
36
  // 空格
37
37
  var _topo$store$getModelS = topo.store.getModelState('topoEdit'),
38
38
  viewMouseMode = _topo$store$getModelS.viewMouseMode;
@@ -22,12 +22,12 @@ function useUpdateHtTopoDefaultTagStyle(props) {
22
22
  var nodeLabelStyle = displayConfig.nodeLabelStyle,
23
23
  defaultEdgeLabelStyle = displayConfig.defaultEdgeLabelStyle;
24
24
  (0, _react.useEffect)(function () {
25
- if (nodeLabelStyle) {
25
+ if (nodeLabelStyle && topo.getHtTopo().setDefaultNodeLabelStyle) {
26
26
  topo.getHtTopo().setDefaultNodeLabelStyle(nodeLabelStyle);
27
27
  }
28
28
  }, [nodeLabelStyle]);
29
29
  (0, _react.useEffect)(function () {
30
- if (defaultEdgeLabelStyle) {
30
+ if (defaultEdgeLabelStyle && topo.getHtTopo().setDefaultEdgeTagStyle) {
31
31
  topo.getHtTopo().setDefaultEdgeTagStyle(defaultEdgeLabelStyle);
32
32
  }
33
33
  }, [defaultEdgeLabelStyle]);