ronds-metadata 1.2.38 → 1.2.39
Sign up to get free protection for your applications and to get access to all the features.
- package/es/api/index.js +83 -131
- package/es/comps/DynamicPorts/comps/ContextMenu.js +3 -11
- package/es/comps/DynamicPorts/comps/DragNode.js +2 -7
- package/es/comps/DynamicPorts/comps/GraphHandler/index.js +4 -5
- package/es/comps/DynamicPorts/comps/NodeElement.js +1 -4
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.js +3 -6
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.js +3 -7
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +18 -21
- package/es/comps/DynamicPorts/comps/shape/edge.js +5 -18
- package/es/comps/DynamicPorts/comps/shape/node.js +4 -17
- package/es/comps/DynamicPorts/constant/index.js +2 -5
- package/es/comps/DynamicPorts/graph.d.ts +2 -2
- package/es/comps/DynamicPorts/graph.js +228 -312
- package/es/comps/DynamicPorts/index.js +39 -58
- package/es/comps/DynamicPorts/utils.js +21 -25
- package/es/comps/Editable/DataCell/ButtonCell.js +4 -10
- package/es/comps/Editable/DataCell/ColorPicker.js +2 -7
- package/es/comps/Editable/DataCell/Input.js +5 -14
- package/es/comps/Editable/DataCell/Number.js +3 -10
- package/es/comps/Editable/DataCell/Select.js +7 -14
- package/es/comps/Editable/DataCell/Switch.js +2 -7
- package/es/comps/Editable/comps/EditableAction.js +8 -12
- package/es/comps/Editable/comps/EditableCell.js +16 -26
- package/es/comps/Editable/comps/EditableHeardCell.js +21 -34
- package/es/comps/Editable/comps/EditableRow.js +49 -59
- package/es/comps/Editable/comps/Texty.js +36 -72
- package/es/comps/Editable/index.js +67 -112
- package/es/comps/Editable/interface.d.ts +1 -1
- package/es/comps/Editable/utils.js +0 -1
- package/es/comps/FileView/index.js +65 -101
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Checkbox.js +8 -13
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Color.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/List.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.js +6 -10
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Password.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Radio.js +8 -13
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.js +6 -10
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Table.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.js +6 -3
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Upload.js +2 -5
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.js +86 -109
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +3 -7
- package/es/comps/FormGenerator/comps/Canvas/core/index.js +54 -91
- package/es/comps/FormGenerator/comps/Canvas/core/index.less +23 -23
- package/es/comps/FormGenerator/comps/Canvas/index.js +8 -15
- package/es/comps/FormGenerator/comps/Settings/index.js +16 -30
- package/es/comps/FormGenerator/comps/Sidebar/Elements.js +23 -22
- package/es/comps/FormGenerator/comps/Sidebar/index.js +6 -2
- package/es/comps/FormGenerator/index.js +3 -9
- package/es/comps/FormGenerator/interface.d.ts +1 -1
- package/es/comps/FormGenerator/settings/index.js +12 -11
- package/es/comps/FormGenerator/settings/ruleConfig.js +0 -1
- package/es/comps/FormGenerator/transformer.js +40 -105
- package/es/comps/Icons/index.js +4 -7
- package/es/comps/JsonEdit/index.js +25 -50
- package/es/comps/JsonView/index.js +7 -21
- package/es/comps/JsonView/index.less +41 -41
- package/es/comps/MdEdit/index.js +7 -10
- package/es/comps/MdEdit/index.less +6 -6
- package/es/comps/MdEditPro/index.d.ts +10 -0
- package/es/comps/MdEditPro/index.js +22 -0
- package/es/comps/MdEditPro/index.less +74 -0
- package/es/comps/MdNavbar/index.js +17 -40
- package/es/comps/MdNavbar/utils.js +0 -4
- package/es/comps/MdView/index.js +7 -11
- package/es/comps/MdView/index.less +353 -353
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +129 -183
- package/es/comps/MetadataEdit/components/MetaPropsEdit.js +11 -27
- package/es/comps/MetadataEdit/hooks/index.js +3 -11
- package/es/comps/MetadataEdit/index.js +25 -58
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.js +17 -33
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.js +15 -29
- package/es/comps/MetadataEditV2/hooks/index.js +5 -12
- package/es/comps/MetadataEditV2/index.js +30 -65
- package/es/comps/MetadataForm/DataCell/Array.js +12 -23
- package/es/comps/MetadataForm/DataCell/Input.js +12 -32
- package/es/comps/MetadataForm/DataCell/Number.js +10 -21
- package/es/comps/MetadataForm/DataCell/Ref.js +87 -121
- package/es/comps/MetadataForm/DataCell/Select.js +127 -222
- package/es/comps/MetadataForm/DataCell/Switch.js +7 -14
- package/es/comps/MetadataForm/DataCell/layout/TableArray.js +93 -164
- package/es/comps/MetadataForm/HOC/index.js +20 -37
- package/es/comps/MetadataForm/HOC/index.less +41 -41
- package/es/comps/MetadataForm/hooks/index.js +12 -38
- package/es/comps/MetadataForm/index.js +37 -72
- package/es/comps/MetadataForm/interface.d.ts +3 -3
- package/es/comps/MetadataForm/utils.js +0 -14
- package/es/comps/Split/index.js +20 -22
- package/es/config.js +0 -4
- package/es/framework/RxStore/demo/index.js +9 -10
- package/es/framework/RxStore/hooks.d.ts +9 -9
- package/es/framework/RxStore/hooks.js +10 -35
- package/es/framework/RxStore/store.d.ts +4 -4
- package/es/framework/RxStore/store.js +0 -10
- package/es/framework/fg/index.js +18 -80
- package/es/framework/fg/interface.d.ts +2 -2
- package/es/framework/fg/utils.js +0 -10
- package/es/framework/graph/index.d.ts +2 -2
- package/es/framework/graph/index.js +55 -110
- package/es/framework/hooks/use-async-memo.js +3 -7
- package/es/framework/hooks/use-sync-scroll.js +2 -15
- package/es/framework/http/cache.js +25 -32
- package/es/framework/http/cancel.js +1 -7
- package/es/framework/http/index.js +22 -82
- package/es/framework/http/msgpack.js +0 -4
- package/es/framework/http/msgpack5/index.js +2 -12
- package/es/framework/http/msgpack5/lib/codecs/DateCodec.js +1 -13
- package/es/framework/http/msgpack5/lib/decoder.js +10 -68
- package/es/framework/http/msgpack5/lib/encoder.js +8 -36
- package/es/framework/http/msgpack5/lib/helpers.js +3 -2
- package/es/framework/http/msgpack5/lib/streams.js +0 -18
- package/es/framework/libs/jquery.min.js +1009 -1696
- package/es/framework/locale/dil8/di18n.js +4 -15
- package/es/framework/locale/dil8/translate.js +0 -14
- package/es/framework/locale/dil8/util.js +0 -3
- package/es/framework/locale/index.js +2 -3
- package/es/framework/metadata/MetadataService.js +39 -78
- package/es/framework/metadata/index.js +4 -70
- package/es/framework/metadata/types.d.ts +98 -98
- package/es/framework/rxjs-hooks/useMemoSubject.js +0 -2
- package/es/framework/rxjs-hooks/useObservable.js +2 -4
- package/es/framework/rxjs-hooks/useObservableState.js +8 -14
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/theme.less +79 -79
- package/es/utils.js +58 -97
- package/package.json +104 -102
package/es/api/index.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
4
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
5
|
-
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
6
5
|
/*
|
7
6
|
* @Author:wangxian
|
8
7
|
* @Date: 2021-09-18 14:15:04
|
@@ -17,13 +16,10 @@ addInterceptor(function (httpClient) {
|
|
17
16
|
if (!_config.headers) {
|
18
17
|
_config.headers = {};
|
19
18
|
}
|
20
|
-
|
21
19
|
_config.headers.Authorization = token;
|
22
20
|
var url = _config.url;
|
23
21
|
var timestamp = new Date().getTime();
|
24
|
-
|
25
22
|
var _guid = guid();
|
26
|
-
|
27
23
|
var signature = md5("".concat(url).concat(timestamp).concat(guid));
|
28
24
|
_config.headers.url = url;
|
29
25
|
_config.headers.timestamp = timestamp;
|
@@ -32,12 +28,10 @@ addInterceptor(function (httpClient) {
|
|
32
28
|
return _config;
|
33
29
|
});
|
34
30
|
});
|
35
|
-
|
36
31
|
var Api = /*#__PURE__*/function () {
|
37
32
|
function Api() {
|
38
33
|
_classCallCheck(this, Api);
|
39
34
|
}
|
40
|
-
|
41
35
|
_createClass(Api, [{
|
42
36
|
key: "GetMetadataList",
|
43
37
|
value:
|
@@ -49,43 +43,36 @@ var Api = /*#__PURE__*/function () {
|
|
49
43
|
function () {
|
50
44
|
var _GetMetadataList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(keyWords) {
|
51
45
|
var _res$data;
|
52
|
-
|
53
46
|
var param, url, res;
|
54
47
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
55
|
-
while (1) {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
case 6:
|
78
|
-
case "end":
|
79
|
-
return _context.stop();
|
80
|
-
}
|
48
|
+
while (1) switch (_context.prev = _context.next) {
|
49
|
+
case 0:
|
50
|
+
param = {
|
51
|
+
filter: {
|
52
|
+
name: '',
|
53
|
+
tags: keyWords
|
54
|
+
},
|
55
|
+
order: [],
|
56
|
+
pagination: {
|
57
|
+
page: 1,
|
58
|
+
size: 30
|
59
|
+
}
|
60
|
+
};
|
61
|
+
url = "/metamgt-web/metadata/list";
|
62
|
+
_context.next = 4;
|
63
|
+
return http.post(url, param);
|
64
|
+
case 4:
|
65
|
+
res = _context.sent;
|
66
|
+
return _context.abrupt("return", (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list);
|
67
|
+
case 6:
|
68
|
+
case "end":
|
69
|
+
return _context.stop();
|
81
70
|
}
|
82
71
|
}, _callee);
|
83
72
|
}));
|
84
|
-
|
85
73
|
function GetMetadataList(_x) {
|
86
74
|
return _GetMetadataList.apply(this, arguments);
|
87
75
|
}
|
88
|
-
|
89
76
|
return GetMetadataList;
|
90
77
|
}()
|
91
78
|
/**
|
@@ -93,157 +80,122 @@ var Api = /*#__PURE__*/function () {
|
|
93
80
|
* @param metadataId
|
94
81
|
* @returns
|
95
82
|
*/
|
96
|
-
|
97
83
|
}, {
|
98
84
|
key: "GetMetadataDetailById",
|
99
85
|
value: function () {
|
100
86
|
var _GetMetadataDetailById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(metadataId) {
|
101
87
|
var url, res;
|
102
88
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
103
|
-
while (1) {
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
case 5:
|
115
|
-
case "end":
|
116
|
-
return _context2.stop();
|
117
|
-
}
|
89
|
+
while (1) switch (_context2.prev = _context2.next) {
|
90
|
+
case 0:
|
91
|
+
url = "/metamgt-web/metadata/".concat(metadataId);
|
92
|
+
_context2.next = 3;
|
93
|
+
return http.get(url);
|
94
|
+
case 3:
|
95
|
+
res = _context2.sent;
|
96
|
+
return _context2.abrupt("return", res.data);
|
97
|
+
case 5:
|
98
|
+
case "end":
|
99
|
+
return _context2.stop();
|
118
100
|
}
|
119
101
|
}, _callee2);
|
120
102
|
}));
|
121
|
-
|
122
103
|
function GetMetadataDetailById(_x2) {
|
123
104
|
return _GetMetadataDetailById.apply(this, arguments);
|
124
105
|
}
|
125
|
-
|
126
106
|
return GetMetadataDetailById;
|
127
|
-
}()
|
128
|
-
/** 添加元数据 */
|
129
|
-
|
107
|
+
}() /** 添加元数据 */
|
130
108
|
}, {
|
131
109
|
key: "SaveMetadata",
|
132
110
|
value: function () {
|
133
111
|
var _SaveMetadata = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data, metadataTag) {
|
134
112
|
var param, url, res;
|
135
113
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
136
|
-
while (1) {
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
case 6:
|
154
|
-
case "end":
|
155
|
-
return _context3.stop();
|
156
|
-
}
|
114
|
+
while (1) switch (_context3.prev = _context3.next) {
|
115
|
+
case 0:
|
116
|
+
param = {
|
117
|
+
schema: JSON.stringify([data]),
|
118
|
+
name: data.id,
|
119
|
+
tags: [metadataTag],
|
120
|
+
permission: 'public'
|
121
|
+
};
|
122
|
+
url = "/metamgt-web/metadata/add";
|
123
|
+
_context3.next = 4;
|
124
|
+
return http.post(url, param);
|
125
|
+
case 4:
|
126
|
+
res = _context3.sent;
|
127
|
+
return _context3.abrupt("return", res.data);
|
128
|
+
case 6:
|
129
|
+
case "end":
|
130
|
+
return _context3.stop();
|
157
131
|
}
|
158
132
|
}, _callee3);
|
159
133
|
}));
|
160
|
-
|
161
134
|
function SaveMetadata(_x3, _x4) {
|
162
135
|
return _SaveMetadata.apply(this, arguments);
|
163
136
|
}
|
164
|
-
|
165
137
|
return SaveMetadata;
|
166
138
|
}() // 获取元数据的值
|
167
|
-
|
168
139
|
}, {
|
169
140
|
key: "GetMetadataObjList",
|
170
141
|
value: function () {
|
171
142
|
var _GetMetadataObjList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
|
172
143
|
var url, res;
|
173
144
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
174
|
-
while (1) {
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
case 5:
|
186
|
-
case "end":
|
187
|
-
return _context4.stop();
|
188
|
-
}
|
145
|
+
while (1) switch (_context4.prev = _context4.next) {
|
146
|
+
case 0:
|
147
|
+
url = "/dataset-web/source/{namespace}/entity/page".replace('{namespace}', data.id);
|
148
|
+
_context4.next = 3;
|
149
|
+
return http.post(encodeURI(url), data);
|
150
|
+
case 3:
|
151
|
+
res = _context4.sent;
|
152
|
+
return _context4.abrupt("return", res.successed ? res.data : []);
|
153
|
+
case 5:
|
154
|
+
case "end":
|
155
|
+
return _context4.stop();
|
189
156
|
}
|
190
157
|
}, _callee4);
|
191
158
|
}));
|
192
|
-
|
193
159
|
function GetMetadataObjList(_x5) {
|
194
160
|
return _GetMetadataObjList.apply(this, arguments);
|
195
161
|
}
|
196
|
-
|
197
162
|
return GetMetadataObjList;
|
198
163
|
}() // 通过扩展规则获取枚举类型的值
|
199
|
-
|
200
164
|
}, {
|
201
165
|
key: "GetEnumDataByUrl",
|
202
166
|
value: function () {
|
203
167
|
var _GetEnumDataByUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url, method, body) {
|
204
168
|
var res, _res;
|
205
|
-
|
206
169
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
207
|
-
while (1) {
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
_res = _context5.sent;
|
228
|
-
return _context5.abrupt("return", _res.successed ? _res.data : []);
|
229
|
-
|
230
|
-
case 11:
|
231
|
-
case "end":
|
232
|
-
return _context5.stop();
|
233
|
-
}
|
170
|
+
while (1) switch (_context5.prev = _context5.next) {
|
171
|
+
case 0:
|
172
|
+
if (!(method === 'get')) {
|
173
|
+
_context5.next = 7;
|
174
|
+
break;
|
175
|
+
}
|
176
|
+
_context5.next = 3;
|
177
|
+
return http.get(encodeURI(url));
|
178
|
+
case 3:
|
179
|
+
res = _context5.sent;
|
180
|
+
return _context5.abrupt("return", res.successed ? res.data : []);
|
181
|
+
case 7:
|
182
|
+
_context5.next = 9;
|
183
|
+
return http.post(encodeURI(url), body);
|
184
|
+
case 9:
|
185
|
+
_res = _context5.sent;
|
186
|
+
return _context5.abrupt("return", _res.successed ? _res.data : []);
|
187
|
+
case 11:
|
188
|
+
case "end":
|
189
|
+
return _context5.stop();
|
234
190
|
}
|
235
191
|
}, _callee5);
|
236
192
|
}));
|
237
|
-
|
238
193
|
function GetEnumDataByUrl(_x6, _x7, _x8) {
|
239
194
|
return _GetEnumDataByUrl.apply(this, arguments);
|
240
195
|
}
|
241
|
-
|
242
196
|
return GetEnumDataByUrl;
|
243
197
|
}()
|
244
198
|
}]);
|
245
|
-
|
246
199
|
return Api;
|
247
200
|
}();
|
248
|
-
|
249
201
|
export { Api as default };
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
|
-
|
3
2
|
/*
|
4
3
|
* @Author: wangxian
|
5
4
|
* @Date: 2022-05-27 09:56:39
|
@@ -10,26 +9,20 @@ import NodeContextMenu from './contextMenu/NodeContextMenu';
|
|
10
9
|
import './ContextMenu.less';
|
11
10
|
import { EdgeContextMenu } from './contextMenu/EdgeContextMenu';
|
12
11
|
import useObservable from '../../../framework/rxjs-hooks/useObservable';
|
13
|
-
|
14
12
|
var ContextMenu = function ContextMenu(props) {
|
15
13
|
var _graph$factory$;
|
16
|
-
|
17
14
|
var graph = props.graph;
|
18
|
-
|
19
15
|
var _React$useState = React.useState(),
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
17
|
+
menu = _React$useState2[0],
|
18
|
+
setMenu = _React$useState2[1];
|
24
19
|
useObservable(function (v) {
|
25
20
|
setMenu(v);
|
26
21
|
}, [graph === null || graph === void 0 ? void 0 : (_graph$factory$ = graph.factory$) === null || _graph$factory$ === void 0 ? void 0 : _graph$factory$.contextMenuInfo]);
|
27
|
-
|
28
22
|
// 暂时屏蔽graph的右击菜单
|
29
23
|
if (!(menu === null || menu === void 0 ? void 0 : menu.type) || (menu === null || menu === void 0 ? void 0 : menu.type) === 'graph') {
|
30
24
|
return null;
|
31
25
|
}
|
32
|
-
|
33
26
|
return /*#__PURE__*/React.createElement("div", {
|
34
27
|
className: "mask"
|
35
28
|
}, (menu === null || menu === void 0 ? void 0 : menu.type) === 'node' && /*#__PURE__*/React.createElement(NodeContextMenu, {
|
@@ -40,5 +33,4 @@ var ContextMenu = function ContextMenu(props) {
|
|
40
33
|
data: menu.data
|
41
34
|
}));
|
42
35
|
};
|
43
|
-
|
44
36
|
export default ContextMenu;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import React from "react";
|
2
|
-
|
3
2
|
/*
|
4
3
|
* @Author: wangxian
|
5
4
|
* @Date: 2022-05-26 08:50:06
|
@@ -10,11 +9,10 @@ import { GlobalOutlined } from '@ant-design/icons';
|
|
10
9
|
import Icon from '../../../comps/Icons';
|
11
10
|
import { DRAGGABLE_COMPONENT } from '../constant';
|
12
11
|
import '../index.less';
|
13
|
-
|
14
12
|
var InnerNodeTitle = function InnerNodeTitle(props) {
|
15
13
|
var data = props.data,
|
16
|
-
|
17
|
-
|
14
|
+
connectDragPreview = props.connectDragPreview,
|
15
|
+
connectDragSource = props.connectDragSource;
|
18
16
|
return /*#__PURE__*/React.createElement("div", null, connectDragPreview(connectDragSource( /*#__PURE__*/React.createElement("div", {
|
19
17
|
className: "node-element",
|
20
18
|
style: {
|
@@ -30,7 +28,6 @@ var InnerNodeTitle = function InnerNodeTitle(props) {
|
|
30
28
|
className: "name"
|
31
29
|
}, data.name))))));
|
32
30
|
};
|
33
|
-
|
34
31
|
var NodeTitle = DragSource(DRAGGABLE_COMPONENT, {
|
35
32
|
beginDrag: function beginDrag(props) {
|
36
33
|
return {
|
@@ -44,12 +41,10 @@ var NodeTitle = DragSource(DRAGGABLE_COMPONENT, {
|
|
44
41
|
isDragging: monitor.isDragging()
|
45
42
|
};
|
46
43
|
})(InnerNodeTitle);
|
47
|
-
|
48
44
|
var DragNode = function DragNode(props) {
|
49
45
|
var data = props.data;
|
50
46
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NodeTitle, {
|
51
47
|
data: data
|
52
48
|
}));
|
53
49
|
};
|
54
|
-
|
55
50
|
export default DragNode;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import "antd/es/popover/style";
|
2
2
|
import _Popover from "antd/es/popover";
|
3
|
-
|
4
3
|
/*
|
5
4
|
* @Author: wangxian
|
6
5
|
* @Date: 2022-05-27 14:21:23
|
@@ -13,10 +12,10 @@ import './index.less';
|
|
13
12
|
import { tr } from '../../../../framework/locale';
|
14
13
|
export var GraphHandler = function GraphHandler(props) {
|
15
14
|
var className = props.className,
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
onZoomIn = props.onZoomIn,
|
16
|
+
onZoomOut = props.onZoomOut,
|
17
|
+
onFitContent = props.onFitContent,
|
18
|
+
onRealContent = props.onRealContent;
|
20
19
|
return /*#__PURE__*/React.createElement("ul", {
|
21
20
|
className: classNames('handler', className)
|
22
21
|
}, /*#__PURE__*/React.createElement(_Popover, {
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import React from "react";
|
2
|
-
|
3
2
|
/*
|
4
3
|
* @Author: wangxian
|
5
4
|
* @Date: 2022-05-24 08:50:16
|
@@ -8,12 +7,11 @@ import React from "react";
|
|
8
7
|
import { GlobalOutlined } from '@ant-design/icons';
|
9
8
|
import '../index.less';
|
10
9
|
import Icon from '../../../comps/Icons';
|
11
|
-
|
12
10
|
var NodeElement = function NodeElement(props) {
|
13
11
|
var node = props.node;
|
14
12
|
var data = (node === null || node === void 0 ? void 0 : node.getData()) || {};
|
15
13
|
var name = data.name,
|
16
|
-
|
14
|
+
icon = data.icon;
|
17
15
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
18
16
|
className: "node-element"
|
19
17
|
}, /*#__PURE__*/React.createElement("div", {
|
@@ -27,5 +25,4 @@ var NodeElement = function NodeElement(props) {
|
|
27
25
|
title: name
|
28
26
|
}, name))));
|
29
27
|
};
|
30
|
-
|
31
28
|
export default NodeElement;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import "antd/es/menu/style";
|
2
2
|
import _Menu from "antd/es/menu";
|
3
|
-
|
4
3
|
/*
|
5
4
|
* @Author: wangxian
|
6
5
|
* @Date: 2022-05-27 15:55:57
|
@@ -14,7 +13,7 @@ import './index.less';
|
|
14
13
|
import { tr } from '../../../../../framework/locale';
|
15
14
|
export var EdgeContextMenu = function EdgeContextMenu(props) {
|
16
15
|
var graph = props.graph,
|
17
|
-
|
16
|
+
data = props.data;
|
18
17
|
var containerRef = useRef(null);
|
19
18
|
useClickAway(function () {
|
20
19
|
graph.clearContextMenuInfo();
|
@@ -23,11 +22,9 @@ export var EdgeContextMenu = function EdgeContextMenu(props) {
|
|
23
22
|
graph.onDeleteEdges(data.edge);
|
24
23
|
graph.clearContextMenuInfo();
|
25
24
|
}, [graph, data]);
|
26
|
-
|
27
25
|
var _graphPointToOffsetPo = graphPointToOffsetPoint(graph.graph, data, graph.wrapper),
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
left = _graphPointToOffsetPo.x,
|
27
|
+
top = _graphPointToOffsetPo.y;
|
31
28
|
return /*#__PURE__*/React.createElement("div", {
|
32
29
|
ref: containerRef,
|
33
30
|
className: "edgeContextMenu",
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import "antd/es/menu/style";
|
2
2
|
import _Menu from "antd/es/menu";
|
3
|
-
|
4
3
|
/*
|
5
4
|
* @Author: wangxian
|
6
5
|
* @Date: 2022-05-27 16:04:27
|
@@ -14,18 +13,15 @@ import { tr } from '../../../../../framework/locale';
|
|
14
13
|
import './index.less';
|
15
14
|
export var GraphContextMenu = function GraphContextMenu(props) {
|
16
15
|
var graph = props.graph,
|
17
|
-
|
16
|
+
data = props.data;
|
18
17
|
var containerRef = useRef(null);
|
19
18
|
useClickAway(function () {
|
20
19
|
graph.clearContextMenuInfo();
|
21
20
|
}, containerRef);
|
22
|
-
|
23
21
|
var onRefresh = function onRefresh() {};
|
24
|
-
|
25
22
|
var _graphPointToOffsetPo = graphPointToOffsetPoint(graph.graph, data, graph.wrapper),
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
left = _graphPointToOffsetPo.x,
|
24
|
+
top = _graphPointToOffsetPo.y;
|
29
25
|
return /*#__PURE__*/React.createElement("div", {
|
30
26
|
ref: containerRef,
|
31
27
|
className: "graphContextMenu",
|
@@ -1,44 +1,42 @@
|
|
1
1
|
import "antd/es/menu/style";
|
2
2
|
import _Menu from "antd/es/menu";
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
|
+
/*
|
5
|
+
* @Author: wangxian
|
6
|
+
* @Date: 2022-05-27 11:35:01
|
7
|
+
* @LastEditTime: 2022-05-28 10:08:32
|
8
|
+
*/
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
5
10
|
import { DeleteOutlined } from '@ant-design/icons';
|
6
11
|
import React from 'react';
|
7
12
|
import { useClickAway } from 'ahooks';
|
8
13
|
import { graphPointToOffsetPoint } from '../../../utils';
|
9
14
|
import { tr } from '../../../../../framework/locale';
|
10
15
|
import './index.less';
|
11
|
-
|
12
16
|
var NodeContextMenu = function NodeContextMenu(props) {
|
13
17
|
var graph = props.graph,
|
14
|
-
|
18
|
+
data = props.data;
|
15
19
|
var containerRef = React.useRef(null);
|
16
20
|
useClickAway(function () {
|
17
21
|
graph.clearContextMenuInfo();
|
18
22
|
}, containerRef);
|
19
23
|
var onNodeDel = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
20
24
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
21
|
-
while (1) {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
case 3:
|
31
|
-
case "end":
|
32
|
-
return _context.stop();
|
33
|
-
}
|
25
|
+
while (1) switch (_context.prev = _context.next) {
|
26
|
+
case 0:
|
27
|
+
_context.next = 2;
|
28
|
+
return graph.onDeleteNodes([data.node.id]);
|
29
|
+
case 2:
|
30
|
+
graph.clearContextMenuInfo();
|
31
|
+
case 3:
|
32
|
+
case "end":
|
33
|
+
return _context.stop();
|
34
34
|
}
|
35
35
|
}, _callee);
|
36
36
|
})), [graph]);
|
37
|
-
|
38
37
|
var _graphPointToOffsetPo = graphPointToOffsetPoint(graph.graph, data, graph.wrapper),
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
left = _graphPointToOffsetPo.x,
|
39
|
+
top = _graphPointToOffsetPo.y;
|
42
40
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
43
41
|
ref: containerRef,
|
44
42
|
className: "graphContextMenu",
|
@@ -51,5 +49,4 @@ var NodeContextMenu = function NodeContextMenu(props) {
|
|
51
49
|
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
|
52
50
|
}, tr('删除')))));
|
53
51
|
};
|
54
|
-
|
55
52
|
export default NodeContextMenu;
|
@@ -2,7 +2,6 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
5
|
-
|
6
5
|
/*
|
7
6
|
* @Author: wangxian
|
8
7
|
* @Date: 2022-05-24 09:18:34
|
@@ -12,37 +11,29 @@ import { Shape, Edge } from '@antv/x6';
|
|
12
11
|
import './edge.less';
|
13
12
|
export var BaseEdge = /*#__PURE__*/function (_Shape$Edge) {
|
14
13
|
_inherits(BaseEdge, _Shape$Edge);
|
15
|
-
|
16
14
|
var _super = _createSuper(BaseEdge);
|
17
|
-
|
18
15
|
function BaseEdge() {
|
19
16
|
_classCallCheck(this, BaseEdge);
|
20
|
-
|
21
17
|
return _super.apply(this, arguments);
|
22
18
|
}
|
23
|
-
|
24
19
|
_createClass(BaseEdge, [{
|
25
20
|
key: "isGroupEdge",
|
26
|
-
value:
|
21
|
+
value:
|
22
|
+
// eslint-disable-next-line class-methods-use-this
|
27
23
|
function isGroupEdge() {
|
28
24
|
return false;
|
29
25
|
}
|
30
26
|
}]);
|
31
|
-
|
32
27
|
return BaseEdge;
|
33
28
|
}(Shape.Edge);
|
34
29
|
export var DPEdge = /*#__PURE__*/function (_BaseEdge) {
|
35
30
|
_inherits(DPEdge, _BaseEdge);
|
36
|
-
|
37
31
|
var _super2 = _createSuper(DPEdge);
|
38
|
-
|
39
32
|
function DPEdge() {
|
40
33
|
_classCallCheck(this, DPEdge);
|
41
|
-
|
42
34
|
return _super2.apply(this, arguments);
|
43
35
|
}
|
44
|
-
|
45
|
-
return DPEdge;
|
36
|
+
return _createClass(DPEdge);
|
46
37
|
}(BaseEdge);
|
47
38
|
DPEdge.config({
|
48
39
|
shape: 'DPEdge',
|
@@ -63,23 +54,19 @@ DPEdge.config({
|
|
63
54
|
});
|
64
55
|
export var DPGroupEdge = /*#__PURE__*/function (_DPEdge) {
|
65
56
|
_inherits(DPGroupEdge, _DPEdge);
|
66
|
-
|
67
57
|
var _super3 = _createSuper(DPGroupEdge);
|
68
|
-
|
69
58
|
function DPGroupEdge() {
|
70
59
|
_classCallCheck(this, DPGroupEdge);
|
71
|
-
|
72
60
|
return _super3.apply(this, arguments);
|
73
61
|
}
|
74
|
-
|
75
62
|
_createClass(DPGroupEdge, [{
|
76
63
|
key: "isGroupEdge",
|
77
|
-
value:
|
64
|
+
value:
|
65
|
+
// eslint-disable-next-line class-methods-use-this
|
78
66
|
function isGroupEdge() {
|
79
67
|
return true;
|
80
68
|
}
|
81
69
|
}]);
|
82
|
-
|
83
70
|
return DPGroupEdge;
|
84
71
|
}(DPEdge);
|
85
72
|
DPGroupEdge.config({
|