@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.
- package/build/1.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +13 -13
- package/es/core/components/TopoView/topoView.js +15 -20
- package/es/core/components/titlebar/index.js +2 -1
- package/es/core/editor/components/EditorPlugin.js +1 -2
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -9
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -11
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +18 -14
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +4 -4
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +16 -9
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/es/core/editor/hooks/useUpdateHtTopoDefaultTagStyle.js +2 -2
- package/es/core/hooks/useTopoEdit.js +131 -169
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +3 -3
- package/es/core/store/coreModels.js +2 -0
- package/es/core/store/models/selection.js +3 -1
- package/es/core/store/models/topoConfig.js +7 -5
- package/es/core/store/models/topoMod.js +1 -1
- package/es/core/store/models/viewer/resourceDetail.js +31 -0
- package/es/core/utils/saveSerialize.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -5
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +72 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +136 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +9 -16
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +119 -117
- package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
- package/es/networkTopo/getTopoData.js +2 -3
- package/es/networkTopo/store/topoCenter.js +27 -4
- package/es/style.js +22 -22
- package/lib/core/components/TopoView/topoView.js +15 -21
- package/lib/core/components/titlebar/index.js +5 -1
- package/lib/core/editor/components/EditorPlugin.js +1 -3
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -9
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -12
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +18 -15
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +4 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +16 -10
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/lib/core/editor/hooks/useUpdateHtTopoDefaultTagStyle.js +2 -2
- package/lib/core/hooks/useTopoEdit.js +131 -169
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +7 -11
- package/lib/core/store/coreModels.js +3 -0
- package/lib/core/store/models/selection.js +3 -1
- package/lib/core/store/models/topoConfig.js +7 -5
- package/lib/core/store/models/topoMod.js +1 -1
- package/lib/core/store/models/viewer/resourceDetail.js +40 -0
- package/lib/core/utils/saveSerialize.js +1 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +71 -46
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +156 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +9 -16
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +119 -117
- package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
- package/lib/networkTopo/getTopoData.js +3 -5
- package/lib/networkTopo/store/topoCenter.js +27 -4
- package/lib/style.js +22 -22
- package/package.json +2 -2
- package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
- 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 =
|
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
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(
|
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:
|
82
|
-
bold:
|
83
|
-
italic:
|
84
|
-
underline:
|
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:
|
24
|
-
bold:
|
25
|
-
italic:
|
26
|
-
underline:
|
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
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(
|
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, {
|
package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js
CHANGED
@@ -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(
|
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]);
|