@riil-frontend/component-topology 2.3.21 → 2.4.0
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 +28 -28
- package/demo/5/345/205/266/344/273/226/347/273/204/344/273/266//345/233/276/346/240/207/351/200/211/346/213/251.md +5 -5
- package/es/components/Drawer/index.js +2 -1
- package/es/components/Drawer/index.module.scss +13 -0
- package/es/components/ResourceList/ResourceSelect.js +3 -2
- package/es/components/ResourceList/ResourceSelect.module.scss +7 -0
- package/es/components/ResourceSelect/ResourceSelectDrawer.js +3 -1
- package/es/core/{editor/components/settings/group/GroupNodeList → common}/icons/defaultIcons.d.ts +15 -0
- package/es/core/{editor/components/settings/group/GroupNodeList → common}/icons/defaultIcons.js +62 -0
- package/es/core/common/text.module.scss +5 -0
- package/es/core/editor/components/LinkDynamicStyleSettingDrawer/rule/ColorPicker.module.scss +7 -3
- package/es/core/editor/components/iconManage/UploadIconDialog.js +2 -2
- package/es/core/editor/components/settings/Settings.js +47 -42
- package/es/core/editor/components/settings/Settings.module.scss +6 -1
- package/es/core/editor/components/settings/common/{NodeSizeInput.d.ts → NodeSizeInput/NodeSizeInput.d.ts} +0 -0
- package/es/core/editor/components/settings/common/{NodeSizeInput.js → NodeSizeInput/NodeSizeInput.js} +2 -0
- package/es/core/editor/components/settings/common/NodeSizeInput/img/icon_/350/247/243/351/224/201.svg +16 -0
- package/es/core/editor/components/settings/common/NodeSizeInput/img/icon_/351/224/201.svg +15 -0
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.d.ts +1 -0
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.js +50 -0
- package/es/core/editor/components/settings/common/text/FontStyleCheckbox.module.scss +31 -0
- package/es/core/editor/components/settings/common/text/TextStyle.d.ts +1 -0
- package/es/core/editor/components/settings/common/text/TextStyle.js +133 -0
- package/es/core/editor/components/settings/common/text/fontStyleUtil.d.ts +19 -0
- package/es/core/editor/components/settings/common/text/fontStyleUtil.js +53 -0
- package/es/core/editor/components/settings/common/text/img/bold.svg +12 -0
- package/es/core/editor/components/settings/common/text/img/italics.svg +10 -0
- package/es/core/editor/components/settings/common/text/img/underline.svg +12 -0
- package/es/core/editor/components/settings/group/GroupNodeList/ResourceList.js +22 -6
- package/es/core/editor/components/settings/group/GroupNodeList/ResourceList.module.scss +16 -0
- package/es/core/editor/components/settings/group/GroupNodeList/icon.d.ts +10 -0
- package/es/core/editor/components/settings/group/GroupNodeList/icon.js +20 -1
- package/es/core/editor/components/settings/node/NodeIconSelect.d.ts +1 -0
- package/es/core/editor/components/settings/node/NodeIconSelect.js +42 -0
- package/es/core/editor/components/settings/node/NodePropertyView.d.ts +1 -1
- package/es/core/editor/components/settings/node/NodePropertyView.js +68 -86
- package/es/core/editor/components/settings/node/NodeRelateResourceButton.d.ts +4 -0
- package/es/core/editor/components/settings/node/NodeRelateResourceButton.js +22 -0
- package/es/core/editor/components/settings/node/TopoTreeSelect.d.ts +1 -0
- package/es/core/editor/components/settings/node/TopoTreeSelect.js +40 -0
- package/es/core/editor/components/settings/text/TextPropertyView.js +31 -144
- package/es/core/editor/components/settings/view/ViewPropertyView.js +1 -1
- package/es/core/editor/{buildContextmenu.d.ts → contextmenu/buildContextmenu.d.ts} +1 -4
- package/es/core/editor/contextmenu/buildContextmenu.js +10 -0
- package/es/hooks/useSelection.js +9 -3
- package/es/plugins/useSelectionPlugin.d.ts +23 -0
- package/es/plugins/useSelectionPlugin.js +84 -0
- package/es/style.js +1 -0
- package/es/utils/topoData.js +1 -1
- package/lib/components/Drawer/index.js +2 -1
- package/lib/components/Drawer/index.module.scss +13 -0
- package/lib/components/ResourceList/ResourceSelect.js +4 -2
- package/lib/components/ResourceList/ResourceSelect.module.scss +7 -0
- package/lib/components/ResourceSelect/ResourceSelectDrawer.js +3 -1
- package/lib/core/{editor/components/settings/group/GroupNodeList → common}/icons/defaultIcons.d.ts +15 -0
- package/lib/core/{editor/components/settings/group/GroupNodeList → common}/icons/defaultIcons.js +68 -1
- package/lib/core/common/text.module.scss +5 -0
- package/lib/core/editor/components/LinkDynamicStyleSettingDrawer/rule/ColorPicker.module.scss +7 -3
- package/lib/core/editor/components/iconManage/UploadIconDialog.js +2 -2
- package/lib/core/editor/components/settings/Settings.js +45 -42
- package/lib/core/editor/components/settings/Settings.module.scss +6 -1
- package/lib/core/editor/components/settings/common/{NodeSizeInput.d.ts → NodeSizeInput/NodeSizeInput.d.ts} +0 -0
- package/lib/core/editor/components/settings/common/{NodeSizeInput.js → NodeSizeInput/NodeSizeInput.js} +2 -0
- package/lib/core/editor/components/settings/common/NodeSizeInput/img/icon_/350/247/243/351/224/201.svg +16 -0
- package/lib/core/editor/components/settings/common/NodeSizeInput/img/icon_/351/224/201.svg +15 -0
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.d.ts +1 -0
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.js +68 -0
- package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.module.scss +31 -0
- package/lib/core/editor/components/settings/common/text/TextStyle.d.ts +1 -0
- package/lib/core/editor/components/settings/common/text/TextStyle.js +150 -0
- package/lib/core/editor/components/settings/common/text/fontStyleUtil.d.ts +19 -0
- package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +58 -0
- package/lib/core/editor/components/settings/common/text/img/bold.svg +12 -0
- package/lib/core/editor/components/settings/common/text/img/italics.svg +10 -0
- package/lib/core/editor/components/settings/common/text/img/underline.svg +12 -0
- package/lib/core/editor/components/settings/group/GroupNodeList/ResourceList.js +22 -7
- package/lib/core/editor/components/settings/group/GroupNodeList/ResourceList.module.scss +16 -0
- package/lib/core/editor/components/settings/group/GroupNodeList/icon.d.ts +10 -0
- package/lib/core/editor/components/settings/group/GroupNodeList/icon.js +23 -1
- package/lib/core/editor/components/settings/node/NodeIconSelect.d.ts +1 -0
- package/lib/core/editor/components/settings/node/NodeIconSelect.js +57 -0
- package/lib/core/editor/components/settings/node/NodePropertyView.d.ts +1 -1
- package/lib/core/editor/components/settings/node/NodePropertyView.js +74 -89
- package/lib/core/editor/components/settings/node/NodeRelateResourceButton.d.ts +4 -0
- package/lib/core/editor/components/settings/node/NodeRelateResourceButton.js +31 -0
- package/lib/core/editor/components/settings/node/TopoTreeSelect.d.ts +1 -0
- package/lib/core/editor/components/settings/node/TopoTreeSelect.js +53 -0
- package/lib/core/editor/components/settings/text/TextPropertyView.js +30 -149
- package/lib/core/editor/components/settings/view/ViewPropertyView.js +1 -1
- package/lib/core/editor/{buildContextmenu.d.ts → contextmenu/buildContextmenu.d.ts} +1 -4
- package/lib/core/editor/{buildContextmenu.js → contextmenu/buildContextmenu.js} +3 -7
- package/lib/hooks/useSelection.js +9 -3
- package/lib/plugins/useSelectionPlugin.d.ts +23 -0
- package/lib/plugins/useSelectionPlugin.js +90 -0
- package/lib/style.js +1 -0
- package/lib/utils/topoData.js +1 -1
- package/package.json +6 -6
- package/es/core/editor/buildContextmenu.js +0 -14
|
@@ -7,13 +7,9 @@ function buildContextmenu(topoApp) {
|
|
|
7
7
|
return {
|
|
8
8
|
node: {
|
|
9
9
|
enable: true,
|
|
10
|
-
items: [{
|
|
11
|
-
label: '
|
|
12
|
-
|
|
13
|
-
}, {
|
|
14
|
-
label: '打开全局属性设置',
|
|
15
|
-
id: 'openAllSet'
|
|
16
|
-
}]
|
|
10
|
+
items: [// { label: '打开属性设置', id: 'openSet' },
|
|
11
|
+
// { label: '打开全局属性设置', id: 'openAllSet' },
|
|
12
|
+
]
|
|
17
13
|
}
|
|
18
14
|
};
|
|
19
15
|
}
|
|
@@ -18,7 +18,9 @@ function getElementData(element) {
|
|
|
18
18
|
// 业务id
|
|
19
19
|
name: element.getName(),
|
|
20
20
|
attrObject: element.getAttrObject(),
|
|
21
|
-
|
|
21
|
+
attr: element.getAttrObject(),
|
|
22
|
+
styleMap: element.getStyleMap(),
|
|
23
|
+
style: element.getStyleMap()
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
if (className === 'ht.Edge') {
|
|
@@ -59,18 +61,22 @@ function _default(props) {
|
|
|
59
61
|
var selectionModel = topoApp.getSelectionModel();
|
|
60
62
|
updateSelection();
|
|
61
63
|
selectionModel.addSelectionChangeListener(function (e) {
|
|
62
|
-
// console.info('
|
|
64
|
+
// console.info('selectionChangeListener', e);
|
|
63
65
|
updateSelection();
|
|
64
66
|
});
|
|
65
67
|
dataModel.addDataPropertyChangeListener(function (e) {
|
|
66
68
|
var property = e.property,
|
|
67
69
|
data = e.data;
|
|
70
|
+
|
|
71
|
+
if (['position'].indexOf(property) !== -1) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
68
75
|
var selectionIds = selectionModel.getSelection().getArray().map(function (item) {
|
|
69
76
|
return item.getId();
|
|
70
77
|
});
|
|
71
78
|
|
|
72
79
|
if (selectionIds.indexOf(data.getId()) > -1) {
|
|
73
|
-
// console.info('DataPropertyChange');
|
|
74
80
|
updateSelection();
|
|
75
81
|
}
|
|
76
82
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default useTableSelectionPlugin;
|
|
2
|
+
/**
|
|
3
|
+
* Modified version of @ahooksjs/use-selection-plugin.
|
|
4
|
+
* Selected keys can be persistent across page changes, if not be reset.
|
|
5
|
+
*/
|
|
6
|
+
declare function useTableSelectionPlugin(options?: {}): {
|
|
7
|
+
middlewares: (ctx: any, next: any) => any;
|
|
8
|
+
props: () => {
|
|
9
|
+
tableProps: {
|
|
10
|
+
rowSelection: {
|
|
11
|
+
onChange: (selectedRowKeys: any, records: any) => void;
|
|
12
|
+
selectedRowKeys: any;
|
|
13
|
+
mode: any;
|
|
14
|
+
getProps: (record: any) => {
|
|
15
|
+
disabled: any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
primaryKey: any;
|
|
19
|
+
};
|
|
20
|
+
getSelectedRowKeys: () => any;
|
|
21
|
+
setSelectedRowKeys: (selectedRowKeys: any) => void;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Modified version of @ahooksjs/use-selection-plugin.
|
|
10
|
+
* Selected keys can be persistent across page changes, if not be reset.
|
|
11
|
+
*/
|
|
12
|
+
var useTableSelectionPlugin = function useTableSelectionPlugin(options) {
|
|
13
|
+
if (options === void 0) {
|
|
14
|
+
options = {};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var _useState = (0, _react.useState)({
|
|
18
|
+
selectedRowKeys: options.defaultSelectedRowKeys || []
|
|
19
|
+
}),
|
|
20
|
+
state = _useState[0],
|
|
21
|
+
setSelectedRowKeys = _useState[1];
|
|
22
|
+
|
|
23
|
+
var _options = options,
|
|
24
|
+
_options$primaryKey = _options.primaryKey,
|
|
25
|
+
primaryKey = _options$primaryKey === void 0 ? 'id' : _options$primaryKey,
|
|
26
|
+
_options$mode = _options.mode,
|
|
27
|
+
mode = _options$mode === void 0 ? 'multiple' : _options$mode,
|
|
28
|
+
_options$checkIsNeedR = _options.checkIsNeedReset,
|
|
29
|
+
checkIsNeedReset = _options$checkIsNeedR === void 0 ? function () {
|
|
30
|
+
return true;
|
|
31
|
+
} : _options$checkIsNeedR,
|
|
32
|
+
checkIsDisabled = _options.checkIsDisabled;
|
|
33
|
+
|
|
34
|
+
var onChange = function onChange(selectedRowKeys, records) {
|
|
35
|
+
setSelectedRowKeys({
|
|
36
|
+
selectedRowKeys: selectedRowKeys
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var getSelectedRowKeys = function getSelectedRowKeys() {
|
|
41
|
+
return state.selectedRowKeys;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var $setSelectedRowKeys = function $setSelectedRowKeys(selectedRowKeys) {
|
|
45
|
+
setSelectedRowKeys({
|
|
46
|
+
selectedRowKeys: selectedRowKeys
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
middlewares: function middlewares(ctx, next) {
|
|
52
|
+
var isNeedReset = checkIsNeedReset(ctx);
|
|
53
|
+
|
|
54
|
+
if (isNeedReset) {
|
|
55
|
+
return next().then(function () {
|
|
56
|
+
setSelectedRowKeys({
|
|
57
|
+
selectedRowKeys: []
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return next();
|
|
63
|
+
},
|
|
64
|
+
props: function props() {
|
|
65
|
+
var getProps = checkIsDisabled ? function (record) {
|
|
66
|
+
return {
|
|
67
|
+
disabled: checkIsDisabled(record)
|
|
68
|
+
};
|
|
69
|
+
} : undefined;
|
|
70
|
+
return {
|
|
71
|
+
tableProps: {
|
|
72
|
+
rowSelection: {
|
|
73
|
+
// onSelect,
|
|
74
|
+
// onSelectAll,
|
|
75
|
+
onChange: onChange,
|
|
76
|
+
selectedRowKeys: state.selectedRowKeys,
|
|
77
|
+
mode: mode,
|
|
78
|
+
getProps: getProps
|
|
79
|
+
},
|
|
80
|
+
primaryKey: primaryKey
|
|
81
|
+
},
|
|
82
|
+
getSelectedRowKeys: getSelectedRowKeys,
|
|
83
|
+
setSelectedRowKeys: $setSelectedRowKeys
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var _default = useTableSelectionPlugin;
|
|
90
|
+
exports["default"] = _default;
|
package/lib/style.js
CHANGED
|
@@ -25,6 +25,7 @@ require('@alifd/next/lib/tab/style');
|
|
|
25
25
|
require('@alifd/next/lib/radio/style');
|
|
26
26
|
require('@alifd/next/lib/collapse/style');
|
|
27
27
|
require('@alifd/next/lib/list/style');
|
|
28
|
+
require('@alifd/next/lib/tree-select/style');
|
|
28
29
|
require('@alifd/next/lib/avatar/style');
|
|
29
30
|
|
|
30
31
|
require('./index.scss');
|
package/lib/utils/topoData.js
CHANGED
|
@@ -22,7 +22,7 @@ var _topoPermissionUtil = _interopRequireDefault(require("./topoPermissionUtil")
|
|
|
22
22
|
|
|
23
23
|
var _buildContextmenu = _interopRequireDefault(require("../core/viewer/contextmenu/buildContextmenu"));
|
|
24
24
|
|
|
25
|
-
var _buildContextmenu2 = _interopRequireDefault(require("../core/editor/buildContextmenu"));
|
|
25
|
+
var _buildContextmenu2 = _interopRequireDefault(require("../core/editor/contextmenu/buildContextmenu"));
|
|
26
26
|
|
|
27
27
|
var _topoIconUtil = require("./topoIconUtil");
|
|
28
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"files": [
|
|
6
6
|
"demo/",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"@riil-frontend/component-row-delete-ballon": "^1.0.2",
|
|
56
56
|
"@riil-frontend/component-table-filter-tags": "latest",
|
|
57
57
|
"@riil-frontend/component-table-layout": "^2.0.1",
|
|
58
|
-
"@riil-frontend/component-topology-graph": "^2.1.
|
|
59
|
-
"@riil-frontend/component-topology-utils": "^2.0.
|
|
58
|
+
"@riil-frontend/component-topology-graph": "^2.1.12",
|
|
59
|
+
"@riil-frontend/component-topology-utils": "^2.0.13",
|
|
60
60
|
"@riil-frontend/css": "^2.0.2",
|
|
61
61
|
"@riil-frontend/hooks": "latest",
|
|
62
62
|
"@riil-frontend/next-collapse": "^1.0.1-a.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@alifd/next": "^1.21.16",
|
|
75
|
-
"@alifd/theme-19926": "^0.
|
|
75
|
+
"@alifd/theme-19926": "^0.17.0",
|
|
76
76
|
"@iceworks/spec": "^1.0.0",
|
|
77
77
|
"axios": "^0.21.1",
|
|
78
78
|
"build-plugin-component": "^1.0.0",
|
|
@@ -99,6 +99,6 @@
|
|
|
99
99
|
"access": "public"
|
|
100
100
|
},
|
|
101
101
|
"license": "MIT",
|
|
102
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.
|
|
103
|
-
"gitHead": "
|
|
102
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.4.0/build/index.html",
|
|
103
|
+
"gitHead": "4c30a81dfb48bf8ebfd910e644605ce85604fcb7"
|
|
104
104
|
}
|