@riil-frontend/component-topology 6.0.0-alpha.42 → 6.0.0-alpha.44
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 +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +21 -21
- package/demo/CHANGELOG/CHANGELOG.md +5 -0
- package/es/components/VerticalIconTab/VerticalIconTab.js +11 -1
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +1 -0
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +8 -3
- package/es/core/components/TopoView/topoView.js +3 -3
- package/es/core/editor/components/Sidebar/panes.js +6 -1
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +38 -12
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +4 -5
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +8 -1
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +1 -1
- package/es/core/editor/components/settings/CloseablePanel.module.scss +12 -0
- package/es/core/editor/components/settings/PropertyView.js +21 -18
- package/es/core/editor/components/settings/Settings.js +39 -77
- package/es/core/editor/components/settings/Settings.module.scss +2 -10
- package/es/core/editor/components/settings/core/PropertyViewManager.js +61 -0
- package/es/core/editor/components/settings/core/getPropertyViewType.js +34 -0
- package/es/core/editor/components/settings/core/updateElementProperty.js +21 -0
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +6 -13
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +58 -0
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +5 -2
- package/es/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +7 -8
- package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +9 -23
- package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +10 -0
- package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +13 -21
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +28 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +74 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -7
- package/es/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +2 -1
- package/es/core/editor/components/settings/propertyViews/index.js +4 -2
- package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +57 -0
- package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +11 -17
- package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.module.scss +10 -0
- package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +27 -0
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -32
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +53 -0
- package/es/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +49 -0
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +1 -0
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +4 -19
- package/es/core/models/HistoryManager.js +11 -14
- package/es/core/models/{SelectionManager.js → SelectionModel.js} +27 -18
- package/es/core/models/TopoApp.js +3 -3
- package/es/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +39 -6
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -16
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +37 -0
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/style.js +1 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.js +14 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +1 -0
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +8 -3
- package/lib/core/components/TopoView/topoView.js +3 -3
- package/lib/core/editor/components/Sidebar/panes.js +6 -1
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +38 -12
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +4 -5
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +8 -1
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +1 -1
- package/lib/core/editor/components/settings/CloseablePanel.module.scss +12 -0
- package/lib/core/editor/components/settings/PropertyView.js +26 -19
- package/lib/core/editor/components/settings/Settings.js +44 -79
- package/lib/core/editor/components/settings/Settings.module.scss +2 -10
- package/lib/core/editor/components/settings/core/PropertyViewManager.js +70 -0
- package/lib/core/editor/components/settings/core/getPropertyViewType.js +40 -0
- package/lib/core/editor/components/settings/core/updateElementProperty.js +27 -0
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +6 -13
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +76 -0
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +8 -2
- package/lib/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +9 -12
- package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +7 -23
- package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +19 -0
- package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +14 -25
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +43 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +97 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +2 -1
- package/lib/core/editor/components/settings/propertyViews/index.js +5 -2
- package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +76 -0
- package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +12 -20
- package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.module.scss +10 -0
- package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +40 -0
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -35
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +68 -0
- package/lib/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +64 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +1 -0
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +4 -19
- package/lib/core/models/HistoryManager.js +11 -14
- package/lib/core/models/{SelectionManager.js → SelectionModel.js} +27 -18
- package/lib/core/models/TopoApp.js +3 -3
- package/lib/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +45 -7
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -18
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +50 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/style.js +1 -1
- package/package.json +2 -2
- package/es/core/editor/components/settings/OpenPropertyPanelListener.js +0 -33
- package/lib/core/editor/components/settings/OpenPropertyPanelListener.js +0 -43
@@ -1,30 +1,24 @@
|
|
1
|
-
import _Tab from "@alifd/next/es/tab";
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
3
2
|
import React from 'react';
|
4
|
-
import TabView from "../../common/tab/TabView";
|
5
|
-
import Setting from "./SettingTab/Setting";
|
6
3
|
import RelateData from "./DataTab/RelateData";
|
7
|
-
import
|
4
|
+
import Setting from "./BasicSetting";
|
5
|
+
import styles from "./LayerPropertyView.module.scss";
|
8
6
|
export default function LayerPropertyView(props) {
|
9
7
|
var topo = props.topo,
|
10
8
|
topoEditApi = props.topoEditApi,
|
11
9
|
values = props.values,
|
12
10
|
onChange = props.onChange,
|
13
11
|
settingRuntimeState = props.settingRuntimeState,
|
14
|
-
editorProps = props.editorProps
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
return /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
|
20
|
-
title: "\u6570\u636E",
|
21
|
-
key: "1"
|
22
|
-
}, /*#__PURE__*/React.createElement(RelateData, _extends({
|
23
|
-
layer: layer
|
24
|
-
}, props))), /*#__PURE__*/React.createElement(_Tab.Item, {
|
25
|
-
title: "\u8BBE\u7F6E",
|
26
|
-
key: "2"
|
12
|
+
editorProps = props.editorProps,
|
13
|
+
selectionElement = props.selectionElement;
|
14
|
+
var layer = selectionElement;
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
16
|
+
className: styles.container
|
27
17
|
}, /*#__PURE__*/React.createElement(Setting, _extends({
|
28
18
|
layer: layer
|
19
|
+
}, props)), /*#__PURE__*/React.createElement("div", {
|
20
|
+
className: styles.data
|
21
|
+
}, /*#__PURE__*/React.createElement(RelateData, _extends({
|
22
|
+
layer: layer
|
29
23
|
}, props))));
|
30
24
|
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import _Tab from "@alifd/next/es/tab";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import React from 'react';
|
4
|
+
import TabView from "../../common/tab/TabView";
|
5
|
+
import Setting from "./SettingTab/Setting";
|
6
|
+
import RelateData from "./DataTab/RelateData";
|
7
|
+
export default function LayerPropertyView(props) {
|
8
|
+
var topo = props.topo,
|
9
|
+
topoEditApi = props.topoEditApi,
|
10
|
+
values = props.values,
|
11
|
+
onChange = props.onChange,
|
12
|
+
settingRuntimeState = props.settingRuntimeState,
|
13
|
+
editorProps = props.editorProps,
|
14
|
+
selectionElement = props.selectionElement;
|
15
|
+
var layer = selectionElement;
|
16
|
+
return /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
|
17
|
+
title: "\u6570\u636E",
|
18
|
+
key: "1"
|
19
|
+
}, /*#__PURE__*/React.createElement(RelateData, _extends({
|
20
|
+
layer: layer
|
21
|
+
}, props))), /*#__PURE__*/React.createElement(_Tab.Item, {
|
22
|
+
title: "\u8BBE\u7F6E",
|
23
|
+
key: "2"
|
24
|
+
}, /*#__PURE__*/React.createElement(Setting, _extends({
|
25
|
+
layer: layer
|
26
|
+
}, props))));
|
27
|
+
}
|
@@ -1,11 +1,8 @@
|
|
1
|
-
import _Tab from "@alifd/next/es/tab";
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
3
2
|
import React from 'react';
|
4
|
-
import useHtElement from "../../../../../common/hooks/useHtElement";
|
5
|
-
import TabView from "../../common/tab/TabView";
|
6
3
|
import Data from "./data/Data";
|
7
4
|
import styles from "./NodePropertyView.module.scss";
|
8
|
-
import
|
5
|
+
import BasicSetting from "./Setting/BasicSetting";
|
9
6
|
export default function NodePropertyView(props) {
|
10
7
|
var _topo$options$editor;
|
11
8
|
|
@@ -14,40 +11,19 @@ export default function NodePropertyView(props) {
|
|
14
11
|
values = props.values,
|
15
12
|
onChange = props.onChange,
|
16
13
|
editorProps = props.editorProps,
|
17
|
-
|
18
|
-
var node =
|
19
|
-
topo: topo,
|
20
|
-
id: values.id
|
21
|
-
});
|
22
|
-
|
23
|
-
var renderData = function renderData() {
|
24
|
-
return /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
25
|
-
node: node
|
26
|
-
}));
|
27
|
-
};
|
28
|
-
|
29
|
-
var renderSetting = function renderSetting() {
|
30
|
-
var nodeSettingViewProps = editorProps.nodeSettingViewProps;
|
31
|
-
return /*#__PURE__*/React.createElement(Setting, _extends({}, props, nodeSettingViewProps));
|
32
|
-
}; // 未绑定资源的节点,根据参数控制是否可关联资源
|
33
|
-
|
14
|
+
selectionElement = props.selectionElement;
|
15
|
+
var node = selectionElement; // 未绑定资源的节点,根据参数控制是否可关联资源
|
34
16
|
|
35
17
|
var showRelateResource = !!values.tag || !values.tag && ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.enableRelateResource) !== false;
|
36
|
-
var
|
18
|
+
var dataContent = null;
|
37
19
|
|
38
20
|
if (showRelateResource) {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
}, renderData()), /*#__PURE__*/React.createElement(_Tab.Item, {
|
43
|
-
title: "\u8BBE\u7F6E",
|
44
|
-
key: "2"
|
45
|
-
}, renderSetting()));
|
46
|
-
} else {
|
47
|
-
content = renderSetting();
|
21
|
+
dataContent = /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
22
|
+
node: node
|
23
|
+
}));
|
48
24
|
}
|
49
25
|
|
50
26
|
return /*#__PURE__*/React.createElement("div", {
|
51
27
|
className: styles.NodePropertyView
|
52
|
-
},
|
28
|
+
}, /*#__PURE__*/React.createElement(BasicSetting, props), dataContent);
|
53
29
|
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import _Tab from "@alifd/next/es/tab";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import React from 'react';
|
4
|
+
import useHtElement from "../../../../../common/hooks/useHtElement";
|
5
|
+
import TabView from "../../common/tab/TabView";
|
6
|
+
import Data from "./data/Data";
|
7
|
+
import styles from "./NodePropertyView.module.scss";
|
8
|
+
import Setting from "./Setting";
|
9
|
+
export default function NodePropertyView(props) {
|
10
|
+
var _topo$options$editor;
|
11
|
+
|
12
|
+
var topo = props.topo,
|
13
|
+
topoEditApi = props.topoEditApi,
|
14
|
+
values = props.values,
|
15
|
+
onChange = props.onChange,
|
16
|
+
editorProps = props.editorProps,
|
17
|
+
settingRuntimeState = props.settingRuntimeState;
|
18
|
+
var node = useHtElement({
|
19
|
+
topo: topo,
|
20
|
+
id: values.id
|
21
|
+
});
|
22
|
+
|
23
|
+
var renderData = function renderData() {
|
24
|
+
return /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
25
|
+
node: node
|
26
|
+
}));
|
27
|
+
};
|
28
|
+
|
29
|
+
var renderSetting = function renderSetting() {
|
30
|
+
var nodeSettingViewProps = editorProps.nodeSettingViewProps;
|
31
|
+
return /*#__PURE__*/React.createElement(Setting, _extends({}, props, nodeSettingViewProps));
|
32
|
+
}; // 未绑定资源的节点,根据参数控制是否可关联资源
|
33
|
+
|
34
|
+
|
35
|
+
var showRelateResource = !!values.tag || !values.tag && ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.enableRelateResource) !== false;
|
36
|
+
var content;
|
37
|
+
|
38
|
+
if (showRelateResource) {
|
39
|
+
content = /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
|
40
|
+
title: "\u6570\u636E",
|
41
|
+
key: "1"
|
42
|
+
}, renderData()), /*#__PURE__*/React.createElement(_Tab.Item, {
|
43
|
+
title: "\u8BBE\u7F6E",
|
44
|
+
key: "2"
|
45
|
+
}, renderSetting()));
|
46
|
+
} else {
|
47
|
+
content = renderSetting();
|
48
|
+
}
|
49
|
+
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
51
|
+
className: styles.NodePropertyView
|
52
|
+
}, content);
|
53
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import _Form from "@alifd/next/es/form";
|
2
|
+
import _Field from "@alifd/next/es/field";
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
import NameInput from "./NameInput";
|
6
|
+
|
7
|
+
function parseValues(values) {
|
8
|
+
return _extends({}, values, {
|
9
|
+
'attrObject.customName': values['attrObject.customName'] || values['attrObject.name'],
|
10
|
+
'attrObject.bindTopo': values['attrObject.bindTopo'] || '' // 解决切换节点时关联拓扑选项未重置
|
11
|
+
|
12
|
+
});
|
13
|
+
}
|
14
|
+
|
15
|
+
export default function BasicSetting(props) {
|
16
|
+
var topo = props.topo,
|
17
|
+
values = props.values,
|
18
|
+
_onChange = props.onChange,
|
19
|
+
editorProps = props.editorProps,
|
20
|
+
settingRuntimeState = props.settingRuntimeState,
|
21
|
+
_props$showImageSetti = props.showImageSetting,
|
22
|
+
showImageSetting = _props$showImageSetti === void 0 ? true : _props$showImageSetti;
|
23
|
+
|
24
|
+
var field = _Field.useField({
|
25
|
+
autoUnmount: false,
|
26
|
+
values: parseValues(values),
|
27
|
+
onChange: function onChange(name, value) {
|
28
|
+
var newValues = field.getValues();
|
29
|
+
|
30
|
+
_onChange(name, value, newValues);
|
31
|
+
}
|
32
|
+
});
|
33
|
+
|
34
|
+
useEffect(function () {
|
35
|
+
field.setValues(parseValues(values));
|
36
|
+
}, [values]);
|
37
|
+
return /*#__PURE__*/React.createElement(_Form, {
|
38
|
+
field: field,
|
39
|
+
labelAlign: "top",
|
40
|
+
style: {
|
41
|
+
margin: '12px 16px 0 32px'
|
42
|
+
}
|
43
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
44
|
+
label: "\u56FE\u7247\u540D\u79F0"
|
45
|
+
}, /*#__PURE__*/React.createElement(NameInput, {
|
46
|
+
name: "attrObject.customName",
|
47
|
+
topo: topo
|
48
|
+
})));
|
49
|
+
}
|
@@ -134,7 +134,8 @@ export default function Data(props) {
|
|
134
134
|
style: {
|
135
135
|
flex: 1,
|
136
136
|
paddingRight: 16,
|
137
|
-
color: "#4D6277"
|
137
|
+
color: "#4D6277",
|
138
|
+
lineHeight: '20px'
|
138
139
|
},
|
139
140
|
title: values.tag ? values.name : null
|
140
141
|
}, values.tag ? values.name : "—"), /*#__PURE__*/React.createElement(NodeRelateResourceButton, {
|
@@ -59,23 +59,11 @@ export default function TextPropertyView(props) {
|
|
59
59
|
useEffect(function () {
|
60
60
|
field.setValues(parseValues(values));
|
61
61
|
}, [values]);
|
62
|
-
return /*#__PURE__*/React.createElement(
|
63
|
-
style: {
|
64
|
-
paddingTop: 4
|
65
|
-
}
|
66
|
-
}, /*#__PURE__*/React.createElement(_Form, {
|
62
|
+
return /*#__PURE__*/React.createElement(_Form, {
|
67
63
|
field: field,
|
68
|
-
labelAlign: "top"
|
69
|
-
}, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
|
70
|
-
defaultExpandedKeys: ['显示设置'],
|
71
|
-
style: {
|
72
|
-
border: 'none'
|
73
|
-
}
|
74
|
-
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
75
|
-
key: "\u663E\u793A\u8BBE\u7F6E",
|
76
|
-
title: "\u663E\u793A\u8BBE\u7F6E",
|
64
|
+
labelAlign: "top",
|
77
65
|
style: {
|
78
|
-
|
66
|
+
margin: '12px 16px 0 32px'
|
79
67
|
}
|
80
68
|
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
81
69
|
label: "\u6587\u672C"
|
@@ -92,8 +80,5 @@ export default function TextPropertyView(props) {
|
|
92
80
|
onBlur: function onBlur() {
|
93
81
|
topo.historyManager.endTransaction();
|
94
82
|
}
|
95
|
-
}))
|
96
|
-
name: "styleMap.textObj",
|
97
|
-
topo: topo
|
98
|
-
})))))));
|
83
|
+
})));
|
99
84
|
}
|
@@ -65,6 +65,10 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
65
65
|
var _this = this;
|
66
66
|
|
67
67
|
this.htHistoryManager.beginTransaction();
|
68
|
+
var displayConfigProperties = [// 单多链路
|
69
|
+
'expandAllEdges', // 节点标注
|
70
|
+
'nodeLabelStyle', // 画布主题
|
71
|
+
'canvasTheme', 'linkTag', 'linkTip', 'nodeTag', 'nodeTip'];
|
68
72
|
var items = [{
|
69
73
|
modelName: 'topoMod',
|
70
74
|
property: 'data'
|
@@ -72,23 +76,16 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
72
76
|
{
|
73
77
|
modelName: 'topoMod',
|
74
78
|
property: 'type'
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
modelName: 'displayConfig',
|
82
|
-
property: 'nodeLabelStyle'
|
83
|
-
}, // 画布主题
|
84
|
-
{
|
85
|
-
modelName: 'displayConfig',
|
86
|
-
property: 'canvasTheme'
|
87
|
-
}, // 背景
|
79
|
+
}].concat(displayConfigProperties.map(function (property) {
|
80
|
+
return {
|
81
|
+
modelName: 'displayConfig',
|
82
|
+
property: property
|
83
|
+
};
|
84
|
+
}), [// 背景
|
88
85
|
{
|
89
86
|
modelName: 'background',
|
90
87
|
property: 'current'
|
91
|
-
}];
|
88
|
+
}]);
|
92
89
|
this.storeHistory = items.map(function (item) {
|
93
90
|
return _extends({}, item, {
|
94
91
|
oldValue: _this.topo.store.getModelState(item.modelName)[item.property]
|
@@ -3,25 +3,13 @@ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
3
|
import useHtElements from "../common/hooks/useHtElements";
|
4
4
|
import ignoreList from "./selection/ignoreList";
|
5
5
|
|
6
|
-
var
|
7
|
-
function
|
6
|
+
var SelectionModel = /*#__PURE__*/function () {
|
7
|
+
function SelectionModel(topo) {
|
8
8
|
var _this = this;
|
9
9
|
|
10
10
|
this.topo = null;
|
11
11
|
this.inited = false;
|
12
12
|
|
13
|
-
this.setSelection = function (selection) {
|
14
|
-
var selectionDispatchers = _this.topo.store.getModelDispatchers('selection');
|
15
|
-
|
16
|
-
_this.selectionIds = selection.map(function (item) {
|
17
|
-
return item.id;
|
18
|
-
});
|
19
|
-
selectionDispatchers.update({
|
20
|
-
selection: selection,
|
21
|
-
selectionIds: _this.selectionIds
|
22
|
-
});
|
23
|
-
};
|
24
|
-
|
25
13
|
this.updateSelection = function () {
|
26
14
|
try {
|
27
15
|
var selectionModel = _this.topo.getSelectionModel();
|
@@ -30,18 +18,30 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
30
18
|
|
31
19
|
var selectionArr = htSelection.map(getElementData); // rlog.info("updateSelection", selectionArr.map((element) => element.id));
|
32
20
|
|
33
|
-
_this.
|
21
|
+
_this.updateStoreSelection(selectionArr);
|
34
22
|
} catch (e) {
|
35
23
|
rlog.error('updateSelection error', e);
|
36
24
|
}
|
37
25
|
};
|
38
26
|
|
27
|
+
this.updateStoreSelection = function (selection) {
|
28
|
+
var selectionDispatchers = _this.topo.store.getModelDispatchers('selection');
|
29
|
+
|
30
|
+
_this.selectionIds = selection.map(function (item) {
|
31
|
+
return item.id;
|
32
|
+
});
|
33
|
+
selectionDispatchers.update({
|
34
|
+
selection: selection,
|
35
|
+
selectionIds: _this.selectionIds
|
36
|
+
});
|
37
|
+
};
|
38
|
+
|
39
39
|
this.topo = topo;
|
40
40
|
this.handleSelectionChange = this.handleSelectionChange.bind(this);
|
41
41
|
this.handleDataPropertyChange = this.handleDataPropertyChange.bind(this);
|
42
42
|
}
|
43
43
|
|
44
|
-
var _proto =
|
44
|
+
var _proto = SelectionModel.prototype;
|
45
45
|
|
46
46
|
_proto.init = function init() {
|
47
47
|
if (this.inited) {
|
@@ -75,6 +75,15 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
75
75
|
return elements;
|
76
76
|
};
|
77
77
|
|
78
|
+
_proto.getSelection = function getSelection() {
|
79
|
+
var selectionModel = this.topo.getSelectionModel();
|
80
|
+
return selectionModel.getSelection().getArray();
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* 同步选中元素到store
|
84
|
+
*/
|
85
|
+
;
|
86
|
+
|
78
87
|
_proto.handleSelectionChange = function handleSelectionChange(e) {
|
79
88
|
rlog.info('Selection handleSelectionChange', e);
|
80
89
|
this.updateSelection();
|
@@ -121,10 +130,10 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
121
130
|
dataModel.removeDataPropertyChangeListener(this.handleDataPropertyChange);
|
122
131
|
};
|
123
132
|
|
124
|
-
return
|
133
|
+
return SelectionModel;
|
125
134
|
}();
|
126
135
|
|
127
|
-
export {
|
136
|
+
export { SelectionModel as default };
|
128
137
|
; // 构造元素数据
|
129
138
|
|
130
139
|
var map = {
|
@@ -20,9 +20,9 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
20
20
|
import PluginManager from "./PluginManager";
|
21
21
|
import topoFactory from "./topoFactory";
|
22
22
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
23
|
-
import
|
23
|
+
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
24
24
|
|
25
|
-
var version = typeof "6.0.0-alpha.
|
25
|
+
var version = typeof "6.0.0-alpha.44" === 'string' ? "6.0.0-alpha.44" : null;
|
26
26
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
27
27
|
/**
|
28
28
|
* 拓扑显示和编辑
|
@@ -78,7 +78,7 @@ var Topo = /*#__PURE__*/function () {
|
|
78
78
|
|
79
79
|
this.test = new Test(this);
|
80
80
|
this.uid = topoFactory.add(options.name, this);
|
81
|
-
this.
|
81
|
+
this.selectionModel = new SelectionModel(this);
|
82
82
|
};
|
83
83
|
|
84
84
|
_proto.destroy = function destroy() {
|
@@ -1,10 +1,43 @@
|
|
1
|
+
import _Form from "@alifd/next/es/form";
|
2
|
+
import _Field from "@alifd/next/es/field";
|
1
3
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import
|
3
|
-
import
|
4
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
5
|
+
import React, { useEffect } from 'react';
|
4
6
|
import BindExitLinkSelect from "./link/BindExitLinkSelect";
|
7
|
+
|
8
|
+
function parseValues(values, edge) {
|
9
|
+
return _extends({}, values);
|
10
|
+
}
|
11
|
+
|
5
12
|
export default function EdgePropertyView(props) {
|
6
|
-
var
|
7
|
-
|
8
|
-
|
9
|
-
|
13
|
+
var topo = props.topo,
|
14
|
+
edge = props.edge,
|
15
|
+
values = props.values,
|
16
|
+
_onChange = props.onChange,
|
17
|
+
editorProps = props.editorProps,
|
18
|
+
extraDisplaySetting = props.extraDisplaySetting;
|
19
|
+
var store = topo.store;
|
20
|
+
|
21
|
+
var field = _Field.useField({
|
22
|
+
autoUnmount: false,
|
23
|
+
values: parseValues(values, edge),
|
24
|
+
onChange: function onChange(name, value) {
|
25
|
+
rlog.debug('CommonEdgePropertyView', name, value);
|
26
|
+
var newValues = field.getValues();
|
27
|
+
|
28
|
+
_onChange(name, value, newValues);
|
29
|
+
}
|
30
|
+
});
|
31
|
+
|
32
|
+
useEffect(function () {
|
33
|
+
field.setValues(parseValues(values, edge));
|
34
|
+
}, [values]);
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
36
|
+
style: {
|
37
|
+
margin: '12px 0 0 32px'
|
38
|
+
}
|
39
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
40
|
+
field: field,
|
41
|
+
labelAlign: "top"
|
42
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(BindExitLinkSelect, props))));
|
10
43
|
}
|
package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js
CHANGED
@@ -1,37 +1,31 @@
|
|
1
|
-
import _Tab from "@alifd/next/es/tab";
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
-
import
|
4
|
-
import
|
2
|
+
import NoDataPage from '@riil-frontend/component-no-data-page';
|
3
|
+
import React from 'react';
|
5
4
|
import Data from "./Data";
|
6
|
-
import Setting from "./Setting";
|
7
5
|
export default function LinkPropertyView(props) {
|
8
6
|
var edge = props.edge,
|
9
7
|
topo = props.topo; // 无权限不显示数据页签
|
10
8
|
|
11
|
-
var _topo$store$useModelS = topo.store.useModelState(
|
9
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod').data,
|
12
10
|
links = _topo$store$useModelS.links,
|
13
11
|
linkGroups = _topo$store$useModelS.linkGroups;
|
14
12
|
var link = [].concat(links, linkGroups).find(function (item) {
|
15
13
|
return item.id === edge.getTag();
|
16
|
-
});
|
14
|
+
});
|
17
15
|
|
18
16
|
if (link) {
|
19
17
|
var readable = link.permission.readable;
|
20
18
|
|
21
19
|
if (!readable) {
|
22
|
-
return /*#__PURE__*/React.createElement(
|
20
|
+
return /*#__PURE__*/React.createElement(NoDataPage, {
|
21
|
+
statusCode: "\u6CA1\u6709\u67E5\u770B\u6743\u9650"
|
22
|
+
});
|
23
23
|
}
|
24
24
|
} else {
|
25
|
-
return
|
25
|
+
return null;
|
26
26
|
}
|
27
27
|
|
28
|
-
return /*#__PURE__*/React.createElement(
|
29
|
-
title: "\u6570\u636E",
|
30
|
-
key: "1"
|
31
|
-
}, /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
28
|
+
return /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
32
29
|
link: link
|
33
|
-
}))
|
34
|
-
title: "\u8BBE\u7F6E",
|
35
|
-
key: "2"
|
36
|
-
}, /*#__PURE__*/React.createElement(Setting, props)));
|
30
|
+
}));
|
37
31
|
}
|
package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
import _Tab from "@alifd/next/es/tab";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import React from 'react';
|
4
|
+
import TabView from "../../../../../../core/editor/components/settings/common/tab/TabView";
|
5
|
+
import Data from "./Data";
|
6
|
+
import Setting from "./Setting";
|
7
|
+
export default function LinkPropertyView(props) {
|
8
|
+
var edge = props.edge,
|
9
|
+
topo = props.topo; // 无权限不显示数据页签
|
10
|
+
|
11
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod').data,
|
12
|
+
links = _topo$store$useModelS.links,
|
13
|
+
linkGroups = _topo$store$useModelS.linkGroups;
|
14
|
+
var link = [].concat(links, linkGroups).find(function (item) {
|
15
|
+
return item.id === edge.getTag();
|
16
|
+
}); // console.log('LinkPropertyView',link)
|
17
|
+
|
18
|
+
if (link) {
|
19
|
+
var readable = link.permission.readable;
|
20
|
+
|
21
|
+
if (!readable) {
|
22
|
+
return /*#__PURE__*/React.createElement(Setting, props);
|
23
|
+
}
|
24
|
+
} else {
|
25
|
+
return /*#__PURE__*/React.createElement(Setting, props);
|
26
|
+
}
|
27
|
+
|
28
|
+
return /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
|
29
|
+
title: "\u6570\u636E",
|
30
|
+
key: "1"
|
31
|
+
}, /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
32
|
+
link: link
|
33
|
+
}))), /*#__PURE__*/React.createElement(_Tab.Item, {
|
34
|
+
title: "\u8BBE\u7F6E",
|
35
|
+
key: "2"
|
36
|
+
}, /*#__PURE__*/React.createElement(Setting, props)));
|
37
|
+
}
|
@@ -54,13 +54,13 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
|
|
54
54
|
var _this = this;
|
55
55
|
|
56
56
|
var topo = this.topo;
|
57
|
-
topo.historyManager && topo.historyManager.setDisabled(true, '链路动态样式');
|
58
57
|
|
59
58
|
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
60
59
|
links = _topo$dataModel$getDa.links,
|
61
60
|
linkGroups = _topo$dataModel$getDa.linkGroups;
|
62
61
|
|
63
|
-
var dataModel = this.topo.getDataModel();
|
62
|
+
var dataModel = this.topo.getDataModel();
|
63
|
+
topo.historyManager && topo.historyManager.setDisabled(true, '链路动态样式'); // 1、如果连线可见,设置线宽
|
64
64
|
|
65
65
|
links.forEach(function (link) {
|
66
66
|
var edge = dataModel.getDataByTag(link.id);
|
package/es/style.js
CHANGED
@@ -38,8 +38,8 @@ import '@alifd/next/es/menu/style';
|
|
38
38
|
import '@alifd/next/es/collapse/style';
|
39
39
|
import '@alifd/next/es/select/style';
|
40
40
|
import '@alifd/next/es/number-picker/style';
|
41
|
-
|
42
41
|
import '@alifd/next/es/tag/style';
|
42
|
+
|
43
43
|
import '@riil-frontend/component-riil-event-emitter/es/style';
|
44
44
|
import '@alifd/next/es/range/style';
|
45
45
|
import './index.scss';
|