@riil-frontend/component-topology 2.12.2 → 2.12.5-alpha.2
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/es/components/Link/index.js +1 -1
- package/es/components/Link/index.module.scss +2 -2
- package/es/components/MultiResourceDrawer/index.js +3 -2
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -0
- package/es/components/ResourceSelectDrawer/ResourceSelectList.js +6 -1
- package/es/components/SingleResourceDrawer/SelectDrawer.js +54 -0
- package/es/components/SingleResourceDrawer/index.js +3 -3
- package/es/core/common/icons/defaultIcons.js +9 -2
- package/es/core/components/TopoView/topoView.js +3 -2
- package/es/core/editor/components/LinkDynamicStyleSettingDrawer/rule/ColorPicker.module.scss +1 -1
- package/es/core/editor/components/ResourceViewAttributeSetting/ResourceViewAttributeSettingPlugin.js +1 -1
- package/es/core/editor/components/ResourceViewAttributeSetting/Setting.js +1 -1
- package/es/core/editor/components/settings/Settings.js +5 -29
- package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.js +0 -0
- package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.module.scss +0 -0
- package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceSelectButton.js +12 -14
- package/es/core/editor/components/settings/{group → common}/GroupNodeList/icon.js +0 -0
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.module.scss +1 -1
- package/es/core/editor/components/settings/group/DataTab/GroupNodeList.js +19 -0
- package/es/core/editor/components/settings/group/DataTab/RelateData.js +45 -0
- package/es/core/editor/components/settings/group/GroupPropertyView.js +44 -0
- package/es/core/editor/components/settings/group/GroupPropertyView.module.scss +3 -0
- package/es/core/editor/components/settings/group/SettingTab/GroupExpandSetting.js +27 -0
- package/es/core/editor/components/settings/group/SettingTab/NodeIconSelect.js +32 -0
- package/es/core/editor/components/settings/group/SettingTab/Setting.js +86 -0
- package/es/core/editor/components/settings/group/hooks/useGroup.js +9 -0
- package/es/core/editor/components/settings/group/hooks/useGroupExpand.js +20 -0
- package/es/core/editor/components/settings/layer/LayerSettingsForm.js +2 -2
- package/es/core/editor/components/settings/{group/GroupNodeList/GroupNodeList.js → layer/NodeList.js} +3 -3
- package/es/core/editor/components/settings/link/LinkPropertyView.js +3 -3
- package/es/core/editor/components/settings/node/NodeIconSelect.js +1 -1
- package/es/core/editor/components/settings/propertyViews.js +23 -0
- package/es/core/models/TopoApp.js +28 -16
- package/es/hooks/useContainerLinkTopo.js +1 -1
- package/es/hooks/usePolling.js +1 -1
- package/es/hooks/useTopoEdit.js +139 -103
- package/es/style.js +3 -4
- package/es/topoCenter/models/TopoCenter.js +40 -12
- package/es/utils/htElementUtils.js +36 -7
- package/lib/components/Link/index.js +6 -6
- package/lib/components/Link/index.module.scss +2 -2
- package/lib/components/MultiResourceDrawer/index.js +3 -2
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -0
- package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +6 -1
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +68 -0
- package/lib/components/SingleResourceDrawer/index.js +3 -3
- package/lib/core/common/icons/defaultIcons.js +11 -2
- package/lib/core/components/TopoView/topoView.js +15 -13
- package/lib/core/editor/components/LinkDynamicStyleSettingDrawer/rule/ColorPicker.module.scss +1 -1
- package/lib/core/editor/components/ResourceViewAttributeSetting/ResourceViewAttributeSettingPlugin.js +3 -3
- package/lib/core/editor/components/ResourceViewAttributeSetting/Setting.js +2 -2
- package/lib/core/editor/components/settings/Settings.js +5 -34
- package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.js +0 -0
- package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.module.scss +0 -0
- package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceSelectButton.js +13 -14
- package/lib/core/editor/components/settings/{group → common}/GroupNodeList/icon.js +0 -0
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.module.scss +1 -1
- package/lib/core/editor/components/settings/group/DataTab/GroupNodeList.js +33 -0
- package/lib/core/editor/components/settings/group/DataTab/RelateData.js +57 -0
- package/lib/core/editor/components/settings/group/GroupPropertyView.js +58 -0
- package/lib/core/editor/components/settings/group/GroupPropertyView.module.scss +3 -0
- package/lib/core/editor/components/settings/group/SettingTab/GroupExpandSetting.js +37 -0
- package/lib/core/editor/components/settings/group/SettingTab/NodeIconSelect.js +45 -0
- package/lib/core/editor/components/settings/group/SettingTab/Setting.js +106 -0
- package/lib/core/editor/components/settings/group/hooks/useGroup.js +15 -0
- package/lib/core/editor/components/settings/group/hooks/useGroupExpand.js +26 -0
- package/lib/core/editor/components/settings/layer/LayerSettingsForm.js +3 -3
- package/lib/core/editor/components/settings/{group/GroupNodeList/GroupNodeList.js → layer/NodeList.js} +3 -3
- package/lib/core/editor/components/settings/link/LinkPropertyView.js +3 -3
- package/lib/core/editor/components/settings/node/NodeIconSelect.js +1 -1
- package/lib/core/editor/components/settings/propertyViews.js +38 -0
- package/lib/core/models/TopoApp.js +29 -17
- package/lib/hooks/useContainerLinkTopo.js +2 -2
- package/lib/hooks/usePolling.js +3 -3
- package/lib/hooks/useTopoEdit.js +149 -112
- package/lib/style.js +3 -4
- package/lib/topoCenter/models/TopoCenter.js +40 -12
- package/lib/utils/htElementUtils.js +44 -7
- package/package.json +10 -10
|
@@ -31,6 +31,34 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
|
31
31
|
loadData: _getTopoData["default"]
|
|
32
32
|
}, options, {
|
|
33
33
|
usePermission: true,
|
|
34
|
+
beforeSwitchToEditMode: function () {
|
|
35
|
+
var _beforeSwitchToEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
36
|
+
var topoDispatchers;
|
|
37
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
38
|
+
while (1) {
|
|
39
|
+
switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
topoDispatchers = _this.store.getModelDispatchers('topoMod');
|
|
42
|
+
topoDispatchers.update({
|
|
43
|
+
topoData: null
|
|
44
|
+
});
|
|
45
|
+
_context.next = 4;
|
|
46
|
+
return topoDispatchers.refreshTopo();
|
|
47
|
+
|
|
48
|
+
case 4:
|
|
49
|
+
case "end":
|
|
50
|
+
return _context.stop();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, _callee);
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
function beforeSwitchToEditMode() {
|
|
57
|
+
return _beforeSwitchToEditMode.apply(this, arguments);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return beforeSwitchToEditMode;
|
|
61
|
+
}(),
|
|
34
62
|
onSwitchToEditMode: function onSwitchToEditMode() {
|
|
35
63
|
var editDispatchers = _this.store.getModelDispatchers('topoCreateMod');
|
|
36
64
|
|
|
@@ -63,22 +91,22 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
|
63
91
|
_proto.initData =
|
|
64
92
|
/*#__PURE__*/
|
|
65
93
|
function () {
|
|
66
|
-
var _initData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
94
|
+
var _initData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(params) {
|
|
67
95
|
var topoDispatchers;
|
|
68
|
-
return _regenerator["default"].wrap(function
|
|
96
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
69
97
|
while (1) {
|
|
70
|
-
switch (
|
|
98
|
+
switch (_context2.prev = _context2.next) {
|
|
71
99
|
case 0:
|
|
72
100
|
topoDispatchers = this.store.getModelDispatchers('topoCenter');
|
|
73
|
-
|
|
101
|
+
_context2.next = 3;
|
|
74
102
|
return topoDispatchers.initData(params);
|
|
75
103
|
|
|
76
104
|
case 3:
|
|
77
105
|
case "end":
|
|
78
|
-
return
|
|
106
|
+
return _context2.stop();
|
|
79
107
|
}
|
|
80
108
|
}
|
|
81
|
-
},
|
|
109
|
+
}, _callee2, this);
|
|
82
110
|
}));
|
|
83
111
|
|
|
84
112
|
function initData(_x) {
|
|
@@ -100,22 +128,22 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
|
100
128
|
_proto.exit =
|
|
101
129
|
/*#__PURE__*/
|
|
102
130
|
function () {
|
|
103
|
-
var _exit = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
131
|
+
var _exit = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
104
132
|
var topoDispatchers;
|
|
105
|
-
return _regenerator["default"].wrap(function
|
|
133
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
106
134
|
while (1) {
|
|
107
|
-
switch (
|
|
135
|
+
switch (_context3.prev = _context3.next) {
|
|
108
136
|
case 0:
|
|
109
137
|
topoDispatchers = this.store.getModelDispatchers('topoCenter');
|
|
110
|
-
|
|
138
|
+
_context3.next = 3;
|
|
111
139
|
return topoDispatchers.exit();
|
|
112
140
|
|
|
113
141
|
case 3:
|
|
114
142
|
case "end":
|
|
115
|
-
return
|
|
143
|
+
return _context3.stop();
|
|
116
144
|
}
|
|
117
145
|
}
|
|
118
|
-
},
|
|
146
|
+
}, _callee3, this);
|
|
119
147
|
}));
|
|
120
148
|
|
|
121
149
|
function exit() {
|
|
@@ -5,9 +5,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.getEdges = getEdges;
|
|
7
7
|
exports.getElements = getElements;
|
|
8
|
+
exports.getGroupChildren = getGroupChildren;
|
|
9
|
+
exports.getGroupChildrenData = getGroupChildrenData;
|
|
8
10
|
exports.getGroupData = getGroupData;
|
|
11
|
+
exports.getGroupElementByTag = getGroupElementByTag;
|
|
9
12
|
exports.getGroupNodes = getGroupNodes;
|
|
10
13
|
exports.getGroups = getGroups;
|
|
14
|
+
exports.getNodeData = getNodeData;
|
|
11
15
|
exports.getNodes = getNodes;
|
|
12
16
|
|
|
13
17
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -52,6 +56,12 @@ function getGroups(dataModel) {
|
|
|
52
56
|
});
|
|
53
57
|
}
|
|
54
58
|
|
|
59
|
+
function getGroupElementByTag(dataModel, tag) {
|
|
60
|
+
return dataModel.getDataByTag(tag) || dataModel.getDatas().toArray().filter(function (item) {
|
|
61
|
+
return item.a('tag') === tag;
|
|
62
|
+
})[0];
|
|
63
|
+
}
|
|
64
|
+
|
|
55
65
|
function getGroupData(element) {
|
|
56
66
|
if (!element) {
|
|
57
67
|
return null;
|
|
@@ -72,13 +82,15 @@ function getGroupData(element) {
|
|
|
72
82
|
function getNodes(dataModel) {
|
|
73
83
|
return getElements(dataModel).filter(function (element) {
|
|
74
84
|
return element.getClassName() === 'ht.Node';
|
|
75
|
-
}).map(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
}).map(getNodeData);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function getNodeData(element) {
|
|
89
|
+
var parentGroup = getGroupData(element.getParent());
|
|
90
|
+
return (0, _extends2["default"])({}, element.getAttrObject(), {
|
|
91
|
+
tag: element.getId(),
|
|
92
|
+
image: element.getImage(),
|
|
93
|
+
groupTag: parentGroup ? parentGroup.id : undefined
|
|
82
94
|
});
|
|
83
95
|
}
|
|
84
96
|
|
|
@@ -100,4 +112,29 @@ function getGroupNodes(dataModel, groupIdOrTag) {
|
|
|
100
112
|
return getNodes(dataModel).filter(function (element) {
|
|
101
113
|
return element.groupId === groupIdOrTag || element.groupTag === groupIdOrTag;
|
|
102
114
|
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 获取容器里的节点列表
|
|
118
|
+
*
|
|
119
|
+
* @param group
|
|
120
|
+
* @return {*}
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
function getGroupChildren(group) {
|
|
125
|
+
// HT为了支持区域内无节点可展开增加了站位节点,因此 节点的layer等于container_blank的过滤掉就可以了
|
|
126
|
+
return group.getChildren().getArray().filter(function (node) {
|
|
127
|
+
return node._layer !== 'container_blank';
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* 获取容器里的节点数据列表
|
|
132
|
+
*
|
|
133
|
+
* @param group
|
|
134
|
+
* @return {*}
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
function getGroupChildrenData(group) {
|
|
139
|
+
return getGroupChildren(group).map(getNodeData);
|
|
103
140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.12.2",
|
|
3
|
+
"version": "2.12.5-alpha.2",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@alifd/biz-anchor": "^1.1.7",
|
|
44
44
|
"@ice/store": "^1.4.2",
|
|
45
45
|
"@riil-frontend/component-topo-icon-select": "^1.0.4",
|
|
46
|
-
"@riil-frontend/component-topology-common": "^1.0.
|
|
47
|
-
"@riil-frontend/component-topology-utils": "^2.0.
|
|
46
|
+
"@riil-frontend/component-topology-common": "^1.0.2",
|
|
47
|
+
"@riil-frontend/component-topology-utils": "^2.0.19",
|
|
48
48
|
"classnames": "^2.2.3",
|
|
49
49
|
"prop-types": "^15.5.8",
|
|
50
50
|
"react-color": "^2.19.3",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@alifd/next": "^1.21.16",
|
|
55
|
-
"@alifd/theme-19926": "^0.
|
|
55
|
+
"@alifd/theme-19926": "^0.25.0",
|
|
56
56
|
"@formily/next": "1.3.13",
|
|
57
57
|
"@formily/next-components": "1.3.13",
|
|
58
58
|
"@iceworks/spec": "^1.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@riil-frontend/component-row-delete-ballon": "^1.0.2",
|
|
70
70
|
"@riil-frontend/component-table-filter-tags": "latest",
|
|
71
71
|
"@riil-frontend/component-table-layout": "^2.0.2",
|
|
72
|
-
"@riil-frontend/component-topology-graph": "^2.3.
|
|
72
|
+
"@riil-frontend/component-topology-graph": "^2.3.4",
|
|
73
73
|
"@riil-frontend/css": "^2.0.2",
|
|
74
74
|
"@riil-frontend/hooks": "latest",
|
|
75
75
|
"@riil-frontend/next-collapse": "^1.0.1-a.0",
|
|
@@ -85,16 +85,16 @@
|
|
|
85
85
|
"enzyme-adapter-react-16": "^1.14.0",
|
|
86
86
|
"eslint": "^6.0.1",
|
|
87
87
|
"html2canvas": "^1.3.2",
|
|
88
|
-
"lnk-cli": "^1.0.1",
|
|
89
88
|
"jspdf": "^2.3.1",
|
|
89
|
+
"lnk-cli": "^1.0.1",
|
|
90
90
|
"react": "^17.0.2",
|
|
91
91
|
"react-dom": "^17.0.2",
|
|
92
92
|
"stylelint": "^13.7.2"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@alifd/next": "1.x",
|
|
96
|
-
"
|
|
97
|
-
"
|
|
96
|
+
"@riil-frontend/component-topology-graph": "^2.x",
|
|
97
|
+
"react": "^16 || ^17"
|
|
98
98
|
},
|
|
99
99
|
"componentConfig": {
|
|
100
100
|
"name": "Topology",
|
|
@@ -105,6 +105,6 @@
|
|
|
105
105
|
"access": "public"
|
|
106
106
|
},
|
|
107
107
|
"license": "MIT",
|
|
108
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.12.2/build/index.html",
|
|
109
|
-
"gitHead": "
|
|
108
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.12.5-alpha.2/build/index.html",
|
|
109
|
+
"gitHead": "e53aaebbab89c4155be21b26a1cbac09542ad400"
|
|
110
110
|
}
|