@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.
Files changed (101) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +28 -28
  5. 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
  6. package/es/components/Drawer/index.js +2 -1
  7. package/es/components/Drawer/index.module.scss +13 -0
  8. package/es/components/ResourceList/ResourceSelect.js +3 -2
  9. package/es/components/ResourceList/ResourceSelect.module.scss +7 -0
  10. package/es/components/ResourceSelect/ResourceSelectDrawer.js +3 -1
  11. package/es/core/{editor/components/settings/group/GroupNodeList → common}/icons/defaultIcons.d.ts +15 -0
  12. package/es/core/{editor/components/settings/group/GroupNodeList → common}/icons/defaultIcons.js +62 -0
  13. package/es/core/common/text.module.scss +5 -0
  14. package/es/core/editor/components/LinkDynamicStyleSettingDrawer/rule/ColorPicker.module.scss +7 -3
  15. package/es/core/editor/components/iconManage/UploadIconDialog.js +2 -2
  16. package/es/core/editor/components/settings/Settings.js +47 -42
  17. package/es/core/editor/components/settings/Settings.module.scss +6 -1
  18. package/es/core/editor/components/settings/common/{NodeSizeInput.d.ts → NodeSizeInput/NodeSizeInput.d.ts} +0 -0
  19. package/es/core/editor/components/settings/common/{NodeSizeInput.js → NodeSizeInput/NodeSizeInput.js} +2 -0
  20. package/es/core/editor/components/settings/common/NodeSizeInput/img/icon_/350/247/243/351/224/201.svg +16 -0
  21. package/es/core/editor/components/settings/common/NodeSizeInput/img/icon_/351/224/201.svg +15 -0
  22. package/es/core/editor/components/settings/common/text/FontStyleCheckbox.d.ts +1 -0
  23. package/es/core/editor/components/settings/common/text/FontStyleCheckbox.js +50 -0
  24. package/es/core/editor/components/settings/common/text/FontStyleCheckbox.module.scss +31 -0
  25. package/es/core/editor/components/settings/common/text/TextStyle.d.ts +1 -0
  26. package/es/core/editor/components/settings/common/text/TextStyle.js +133 -0
  27. package/es/core/editor/components/settings/common/text/fontStyleUtil.d.ts +19 -0
  28. package/es/core/editor/components/settings/common/text/fontStyleUtil.js +53 -0
  29. package/es/core/editor/components/settings/common/text/img/bold.svg +12 -0
  30. package/es/core/editor/components/settings/common/text/img/italics.svg +10 -0
  31. package/es/core/editor/components/settings/common/text/img/underline.svg +12 -0
  32. package/es/core/editor/components/settings/group/GroupNodeList/ResourceList.js +22 -6
  33. package/es/core/editor/components/settings/group/GroupNodeList/ResourceList.module.scss +16 -0
  34. package/es/core/editor/components/settings/group/GroupNodeList/icon.d.ts +10 -0
  35. package/es/core/editor/components/settings/group/GroupNodeList/icon.js +20 -1
  36. package/es/core/editor/components/settings/node/NodeIconSelect.d.ts +1 -0
  37. package/es/core/editor/components/settings/node/NodeIconSelect.js +42 -0
  38. package/es/core/editor/components/settings/node/NodePropertyView.d.ts +1 -1
  39. package/es/core/editor/components/settings/node/NodePropertyView.js +68 -86
  40. package/es/core/editor/components/settings/node/NodeRelateResourceButton.d.ts +4 -0
  41. package/es/core/editor/components/settings/node/NodeRelateResourceButton.js +22 -0
  42. package/es/core/editor/components/settings/node/TopoTreeSelect.d.ts +1 -0
  43. package/es/core/editor/components/settings/node/TopoTreeSelect.js +40 -0
  44. package/es/core/editor/components/settings/text/TextPropertyView.js +31 -144
  45. package/es/core/editor/components/settings/view/ViewPropertyView.js +1 -1
  46. package/es/core/editor/{buildContextmenu.d.ts → contextmenu/buildContextmenu.d.ts} +1 -4
  47. package/es/core/editor/contextmenu/buildContextmenu.js +10 -0
  48. package/es/hooks/useSelection.js +9 -3
  49. package/es/plugins/useSelectionPlugin.d.ts +23 -0
  50. package/es/plugins/useSelectionPlugin.js +84 -0
  51. package/es/style.js +1 -0
  52. package/es/utils/topoData.js +1 -1
  53. package/lib/components/Drawer/index.js +2 -1
  54. package/lib/components/Drawer/index.module.scss +13 -0
  55. package/lib/components/ResourceList/ResourceSelect.js +4 -2
  56. package/lib/components/ResourceList/ResourceSelect.module.scss +7 -0
  57. package/lib/components/ResourceSelect/ResourceSelectDrawer.js +3 -1
  58. package/lib/core/{editor/components/settings/group/GroupNodeList → common}/icons/defaultIcons.d.ts +15 -0
  59. package/lib/core/{editor/components/settings/group/GroupNodeList → common}/icons/defaultIcons.js +68 -1
  60. package/lib/core/common/text.module.scss +5 -0
  61. package/lib/core/editor/components/LinkDynamicStyleSettingDrawer/rule/ColorPicker.module.scss +7 -3
  62. package/lib/core/editor/components/iconManage/UploadIconDialog.js +2 -2
  63. package/lib/core/editor/components/settings/Settings.js +45 -42
  64. package/lib/core/editor/components/settings/Settings.module.scss +6 -1
  65. package/lib/core/editor/components/settings/common/{NodeSizeInput.d.ts → NodeSizeInput/NodeSizeInput.d.ts} +0 -0
  66. package/lib/core/editor/components/settings/common/{NodeSizeInput.js → NodeSizeInput/NodeSizeInput.js} +2 -0
  67. package/lib/core/editor/components/settings/common/NodeSizeInput/img/icon_/350/247/243/351/224/201.svg +16 -0
  68. package/lib/core/editor/components/settings/common/NodeSizeInput/img/icon_/351/224/201.svg +15 -0
  69. package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.d.ts +1 -0
  70. package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.js +68 -0
  71. package/lib/core/editor/components/settings/common/text/FontStyleCheckbox.module.scss +31 -0
  72. package/lib/core/editor/components/settings/common/text/TextStyle.d.ts +1 -0
  73. package/lib/core/editor/components/settings/common/text/TextStyle.js +150 -0
  74. package/lib/core/editor/components/settings/common/text/fontStyleUtil.d.ts +19 -0
  75. package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +58 -0
  76. package/lib/core/editor/components/settings/common/text/img/bold.svg +12 -0
  77. package/lib/core/editor/components/settings/common/text/img/italics.svg +10 -0
  78. package/lib/core/editor/components/settings/common/text/img/underline.svg +12 -0
  79. package/lib/core/editor/components/settings/group/GroupNodeList/ResourceList.js +22 -7
  80. package/lib/core/editor/components/settings/group/GroupNodeList/ResourceList.module.scss +16 -0
  81. package/lib/core/editor/components/settings/group/GroupNodeList/icon.d.ts +10 -0
  82. package/lib/core/editor/components/settings/group/GroupNodeList/icon.js +23 -1
  83. package/lib/core/editor/components/settings/node/NodeIconSelect.d.ts +1 -0
  84. package/lib/core/editor/components/settings/node/NodeIconSelect.js +57 -0
  85. package/lib/core/editor/components/settings/node/NodePropertyView.d.ts +1 -1
  86. package/lib/core/editor/components/settings/node/NodePropertyView.js +74 -89
  87. package/lib/core/editor/components/settings/node/NodeRelateResourceButton.d.ts +4 -0
  88. package/lib/core/editor/components/settings/node/NodeRelateResourceButton.js +31 -0
  89. package/lib/core/editor/components/settings/node/TopoTreeSelect.d.ts +1 -0
  90. package/lib/core/editor/components/settings/node/TopoTreeSelect.js +53 -0
  91. package/lib/core/editor/components/settings/text/TextPropertyView.js +30 -149
  92. package/lib/core/editor/components/settings/view/ViewPropertyView.js +1 -1
  93. package/lib/core/editor/{buildContextmenu.d.ts → contextmenu/buildContextmenu.d.ts} +1 -4
  94. package/lib/core/editor/{buildContextmenu.js → contextmenu/buildContextmenu.js} +3 -7
  95. package/lib/hooks/useSelection.js +9 -3
  96. package/lib/plugins/useSelectionPlugin.d.ts +23 -0
  97. package/lib/plugins/useSelectionPlugin.js +90 -0
  98. package/lib/style.js +1 -0
  99. package/lib/utils/topoData.js +1 -1
  100. package/package.json +6 -6
  101. package/es/core/editor/buildContextmenu.js +0 -14
@@ -1,9 +1,6 @@
1
1
  export default function buildContextmenu(topoApp: any): {
2
2
  node: {
3
3
  enable: boolean;
4
- items: {
5
- label: string;
6
- id: string;
7
- }[];
4
+ items: any[];
8
5
  };
9
6
  };
@@ -7,13 +7,9 @@ function buildContextmenu(topoApp) {
7
7
  return {
8
8
  node: {
9
9
  enable: true,
10
- items: [{
11
- label: '打开属性设置',
12
- id: 'openSet'
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
- styleMap: element.getStyleMap()
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('SelectionChange');
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');
@@ -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.21",
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.11",
59
- "@riil-frontend/component-topology-utils": "^2.0.12",
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.16.3",
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.3.21/build/index.html",
103
- "gitHead": "acd84d669c432aec95797d5873045b308a3e64d3"
102
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@2.4.0/build/index.html",
103
+ "gitHead": "4c30a81dfb48bf8ebfd910e644605ce85604fcb7"
104
104
  }
@@ -1,14 +0,0 @@
1
- export default function buildContextmenu(topoApp) {
2
- return {
3
- node: {
4
- enable: true,
5
- items: [{
6
- label: '打开属性设置',
7
- id: 'openSet'
8
- }, {
9
- label: '打开全局属性设置',
10
- id: 'openAllSet'
11
- }]
12
- }
13
- };
14
- }