@nocobase/plugin-graph-collection-manager 0.10.0-alpha.2 → 0.10.0-alpha.3
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/lib/client/GraphDrawPage.js +60 -53
- package/lib/client/components/AddCollectionAction.js +8 -7
- package/lib/client/components/AddFieldAction.js +2 -1
- package/lib/client/components/EditCollectionAction.js +9 -8
- package/lib/client/components/EditFieldAction.js +2 -1
- package/lib/client/components/Entity.js +5 -15
- package/lib/client/components/OverrideFieldAction.js +2 -1
- package/lib/client/components/ViewFieldAction.js +2 -1
- package/lib/client/utils.d.ts +5 -0
- package/lib/client/utils.js +14 -2
- package/package.json +4 -4
|
@@ -298,9 +298,6 @@ function getEdges(edges) {
|
|
|
298
298
|
}
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
const getPopupContainer = () => {
|
|
302
|
-
return document.getElementById('graph_container');
|
|
303
|
-
};
|
|
304
301
|
const CollapsedContext = (0, _react2().createContext)({});
|
|
305
302
|
const formatNodeData = () => {
|
|
306
303
|
const layoutNodes = [];
|
|
@@ -1211,9 +1208,7 @@ const GraphDrawPage = _react2().default.memo(() => {
|
|
|
1211
1208
|
}, _react2().default.createElement(_client().SchemaComponent, {
|
|
1212
1209
|
components: {
|
|
1213
1210
|
Select: props => _react2().default.createElement(_client().Select, _objectSpread(_objectSpread({}, props), {}, {
|
|
1214
|
-
getPopupContainer:
|
|
1215
|
-
return document.getElementById('graph_container');
|
|
1216
|
-
}
|
|
1211
|
+
getPopupContainer: _utils.getPopupContainer
|
|
1217
1212
|
})),
|
|
1218
1213
|
AddCollectionAction: _AddCollectionAction.AddCollectionAction
|
|
1219
1214
|
},
|
|
@@ -1268,7 +1263,7 @@ const GraphDrawPage = _react2().default.memo(() => {
|
|
|
1268
1263
|
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
1269
1264
|
return _react2().default.createElement(_antd().Tooltip, {
|
|
1270
1265
|
title: t('Full Screen'),
|
|
1271
|
-
getPopupContainer: getPopupContainer
|
|
1266
|
+
getPopupContainer: _utils.getPopupContainer
|
|
1272
1267
|
}, _react2().default.createElement(_antd().Button, {
|
|
1273
1268
|
onClick: () => {
|
|
1274
1269
|
toggleFullscreen();
|
|
@@ -1284,7 +1279,7 @@ const GraphDrawPage = _react2().default.memo(() => {
|
|
|
1284
1279
|
},
|
|
1285
1280
|
collectionList: {
|
|
1286
1281
|
type: 'void',
|
|
1287
|
-
'x-component': ()
|
|
1282
|
+
'x-component': function Com() {
|
|
1288
1283
|
const _useContext = (0, _react2().useContext)(CollapsedContext),
|
|
1289
1284
|
handleSearchCollection = _useContext.handleSearchCollection,
|
|
1290
1285
|
collectionList = _useContext.collectionList;
|
|
@@ -1312,28 +1307,32 @@ const GraphDrawPage = _react2().default.memo(() => {
|
|
|
1312
1307
|
maxHeight: '70vh',
|
|
1313
1308
|
overflowY: 'auto',
|
|
1314
1309
|
border: 'none'
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1310
|
+
},
|
|
1311
|
+
items: [{
|
|
1312
|
+
type: 'divider'
|
|
1313
|
+
}, ...collectionList.map(v => {
|
|
1314
|
+
return {
|
|
1315
|
+
key: v.name,
|
|
1316
|
+
label: compile(v.title),
|
|
1317
|
+
onClick: e => {
|
|
1318
|
+
if (e.key !== selectedKeys[0]) {
|
|
1319
|
+
setSelectKey([e.key]);
|
|
1320
|
+
handleFiterCollections(e.key);
|
|
1321
|
+
} else {
|
|
1322
|
+
targetGraph.filterConfig = null;
|
|
1323
|
+
handleFiterCollections(false);
|
|
1324
|
+
setSelectKey([]);
|
|
1325
|
+
}
|
|
1327
1326
|
}
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
}))
|
|
1327
|
+
};
|
|
1328
|
+
})]
|
|
1329
|
+
}));
|
|
1331
1330
|
return _react2().default.createElement(_antd().Popover, {
|
|
1332
1331
|
content: content,
|
|
1333
1332
|
autoAdjustOverflow: true,
|
|
1334
1333
|
placement: "bottomRight",
|
|
1335
1334
|
trigger: ['click'],
|
|
1336
|
-
getPopupContainer: getPopupContainer,
|
|
1335
|
+
getPopupContainer: _utils.getPopupContainer,
|
|
1337
1336
|
overlayClassName: (0, _css().css)`
|
|
1338
1337
|
.ant-popover-inner-content {
|
|
1339
1338
|
padding: 0;
|
|
@@ -1357,7 +1356,7 @@ const GraphDrawPage = _react2().default.memo(() => {
|
|
|
1357
1356
|
component: (0, _react2().forwardRef)(() => {
|
|
1358
1357
|
return _react2().default.createElement(_antd().Tooltip, {
|
|
1359
1358
|
title: t('Auto layout'),
|
|
1360
|
-
getPopupContainer: getPopupContainer
|
|
1359
|
+
getPopupContainer: _utils.getPopupContainer
|
|
1361
1360
|
}, _react2().default.createElement(_antd().Button, {
|
|
1362
1361
|
onClick: () => {
|
|
1363
1362
|
handelResetLayout();
|
|
@@ -1397,25 +1396,29 @@ const GraphDrawPage = _react2().default.memo(() => {
|
|
|
1397
1396
|
maxHeight: '70vh',
|
|
1398
1397
|
overflowY: 'auto',
|
|
1399
1398
|
border: 'none'
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1399
|
+
},
|
|
1400
|
+
items: [{
|
|
1401
|
+
type: 'divider'
|
|
1402
|
+
}, ...menuItems.map(v => {
|
|
1403
|
+
return {
|
|
1404
|
+
key: v.key,
|
|
1405
|
+
label: t(v.label),
|
|
1406
|
+
onClick: e => {
|
|
1407
|
+
targetGraph.connectionType = v.key;
|
|
1408
|
+
const _targetGraph8 = targetGraph,
|
|
1409
|
+
filterConfig = _targetGraph8.filterConfig;
|
|
1410
|
+
filterConfig && handleFiterCollections(filterConfig.key);
|
|
1411
|
+
handleSetRelationshipType(v.key);
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
})]
|
|
1415
|
+
}));
|
|
1413
1416
|
return _react2().default.createElement(_antd().Popover, {
|
|
1414
1417
|
content: content,
|
|
1415
1418
|
autoAdjustOverflow: true,
|
|
1416
1419
|
placement: "bottomRight",
|
|
1417
1420
|
trigger: ['click'],
|
|
1418
|
-
getPopupContainer: getPopupContainer,
|
|
1421
|
+
getPopupContainer: _utils.getPopupContainer,
|
|
1419
1422
|
overlayClassName: (0, _css().css)`
|
|
1420
1423
|
.ant-popover-inner-content {
|
|
1421
1424
|
padding: 0;
|
|
@@ -1458,26 +1461,30 @@ const GraphDrawPage = _react2().default.memo(() => {
|
|
|
1458
1461
|
maxHeight: '70vh',
|
|
1459
1462
|
overflowY: 'auto',
|
|
1460
1463
|
border: 'none'
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1464
|
+
},
|
|
1465
|
+
items: [{
|
|
1466
|
+
type: 'divider'
|
|
1467
|
+
}, ...menuItems.map(v => {
|
|
1468
|
+
return {
|
|
1469
|
+
key: v.key,
|
|
1470
|
+
label: t(v.label),
|
|
1471
|
+
onClick: e => {
|
|
1472
|
+
targetGraph.direction = v.key;
|
|
1473
|
+
const _targetGraph9 = targetGraph,
|
|
1474
|
+
filterConfig = _targetGraph9.filterConfig;
|
|
1475
|
+
if (filterConfig) {
|
|
1476
|
+
handleFiterCollections(filterConfig.key);
|
|
1477
|
+
}
|
|
1471
1478
|
}
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
}))
|
|
1479
|
+
};
|
|
1480
|
+
})]
|
|
1481
|
+
}));
|
|
1475
1482
|
return _react2().default.createElement(_antd().Popover, {
|
|
1476
1483
|
content: content,
|
|
1477
1484
|
autoAdjustOverflow: true,
|
|
1478
1485
|
placement: "bottomRight",
|
|
1479
1486
|
trigger: ['click'],
|
|
1480
|
-
getPopupContainer: getPopupContainer,
|
|
1487
|
+
getPopupContainer: _utils.getPopupContainer,
|
|
1481
1488
|
overlayClassName: (0, _css().css)`
|
|
1482
1489
|
.ant-popover-inner-content {
|
|
1483
1490
|
padding: 0;
|
|
@@ -18,21 +18,22 @@ function _client() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const data =
|
|
23
|
-
|
|
21
|
+
function _antd() {
|
|
22
|
+
const data = require("antd");
|
|
23
|
+
_antd = function _antd() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const data = require("
|
|
30
|
-
|
|
28
|
+
function _react() {
|
|
29
|
+
const data = _interopRequireDefault(require("react"));
|
|
30
|
+
_react = function _react() {
|
|
31
31
|
return data;
|
|
32
32
|
};
|
|
33
33
|
return data;
|
|
34
34
|
}
|
|
35
35
|
var _actionHooks = require("../action-hooks");
|
|
36
|
+
var _utils = require("../utils");
|
|
36
37
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
38
|
const AddCollectionAction = ({
|
|
38
39
|
item: record
|
|
@@ -49,7 +50,7 @@ const AddCollectionAction = ({
|
|
|
49
50
|
scope: {
|
|
50
51
|
useCancelAction: _actionHooks.useCancelAction
|
|
51
52
|
},
|
|
52
|
-
getContainer:
|
|
53
|
+
getContainer: _utils.getPopupContainer
|
|
53
54
|
}, _react().default.createElement(_antd().Button, {
|
|
54
55
|
type: "primary"
|
|
55
56
|
}, _react().default.createElement(_icons().PlusOutlined, null)));
|
|
@@ -26,6 +26,7 @@ function _react() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
var _actionHooks = require("../action-hooks");
|
|
29
|
+
var _utils = require("../utils");
|
|
29
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
31
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
31
32
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -57,7 +58,7 @@ const AddFieldAction = ({
|
|
|
57
58
|
useCancelAction: _actionHooks.useCancelAction,
|
|
58
59
|
useCreateCollectionField: () => _useCreateCollectionField(record)
|
|
59
60
|
},
|
|
60
|
-
getContainer:
|
|
61
|
+
getContainer: _utils.getPopupContainer
|
|
61
62
|
}, _react().default.createElement(_icons().PlusOutlined, {
|
|
62
63
|
className: "btn-add",
|
|
63
64
|
id: "graph_btn_add_field"
|
|
@@ -11,6 +11,13 @@ function _icons() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
+
function _css() {
|
|
15
|
+
const data = require("@emotion/css");
|
|
16
|
+
_css = function _css() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
14
21
|
function _client() {
|
|
15
22
|
const data = require("@nocobase/client");
|
|
16
23
|
_client = function _client() {
|
|
@@ -25,14 +32,8 @@ function _react() {
|
|
|
25
32
|
};
|
|
26
33
|
return data;
|
|
27
34
|
}
|
|
28
|
-
function _css() {
|
|
29
|
-
const data = require("@emotion/css");
|
|
30
|
-
_css = function _css() {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
35
|
var _actionHooks = require("../action-hooks");
|
|
36
|
+
var _utils = require("../utils");
|
|
36
37
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
38
|
const EditCollectionAction = ({
|
|
38
39
|
item: record
|
|
@@ -44,7 +45,7 @@ const EditCollectionAction = ({
|
|
|
44
45
|
useUpdateCollectionActionAndRefreshCM: _actionHooks.useUpdateCollectionActionAndRefreshCM,
|
|
45
46
|
createOnly: false
|
|
46
47
|
},
|
|
47
|
-
getContainer:
|
|
48
|
+
getContainer: _utils.getPopupContainer
|
|
48
49
|
}, _react().default.createElement(_icons().EditOutlined, {
|
|
49
50
|
className: (0, _css().css)`
|
|
50
51
|
border-color: transparent;
|
|
@@ -26,6 +26,7 @@ function _react() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
var _actionHooks = require("../action-hooks");
|
|
29
|
+
var _utils = require("../utils");
|
|
29
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
31
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
31
32
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -54,7 +55,7 @@ const EditFieldAction = ({
|
|
|
54
55
|
useCancelAction: _actionHooks.useCancelAction,
|
|
55
56
|
useUpdateCollectionField: () => _useUpdateCollectionField(record)
|
|
56
57
|
},
|
|
57
|
-
getContainer:
|
|
58
|
+
getContainer: _utils.getPopupContainer
|
|
58
59
|
}, _react().default.createElement(_icons().EditOutlined, {
|
|
59
60
|
className: "btn-edit"
|
|
60
61
|
}));
|
|
@@ -214,9 +214,7 @@ const Entity = props => {
|
|
|
214
214
|
`,
|
|
215
215
|
confirm: {
|
|
216
216
|
title: "{{t('Delete record')}}",
|
|
217
|
-
getContainer:
|
|
218
|
-
return document.getElementById('graph_container');
|
|
219
|
-
},
|
|
217
|
+
getContainer: _utils.getPopupContainer,
|
|
220
218
|
collectionConten: "{{t('Are you sure you want to delete it?')}}"
|
|
221
219
|
},
|
|
222
220
|
useAction: () => (0, _actionHooks.useDestroyActionAndRefreshCM)({
|
|
@@ -306,9 +304,7 @@ const PortsCom = _react().default.memo(({
|
|
|
306
304
|
Form: _client().Form,
|
|
307
305
|
ResourceActionProvider: _client().ResourceActionProvider,
|
|
308
306
|
Select: props => _react().default.createElement(_client().Select, _objectSpread(_objectSpread({}, props), {}, {
|
|
309
|
-
getPopupContainer:
|
|
310
|
-
return document.getElementById('graph_container');
|
|
311
|
-
}
|
|
307
|
+
getPopupContainer: _utils.getPopupContainer
|
|
312
308
|
})),
|
|
313
309
|
Checkbox: _client().Checkbox,
|
|
314
310
|
Radio: _client().Radio,
|
|
@@ -388,9 +384,7 @@ const PortsCom = _react().default.memo(({
|
|
|
388
384
|
`,
|
|
389
385
|
confirm: {
|
|
390
386
|
title: "{{t('Delete record')}}",
|
|
391
|
-
getContainer:
|
|
392
|
-
return document.getElementById('graph_container');
|
|
393
|
-
},
|
|
387
|
+
getContainer: _utils.getPopupContainer,
|
|
394
388
|
collectionConten: "{{t('Are you sure you want to delete it?')}}"
|
|
395
389
|
},
|
|
396
390
|
useAction: () => (0, _actionHooks.useDestroyFieldActionAndRefreshCM)({
|
|
@@ -460,9 +454,7 @@ const PortsCom = _react().default.memo(({
|
|
|
460
454
|
var _property$uiSchema, _getInterface, _property$uiSchema2, _getInterface2;
|
|
461
455
|
return property.uiSchema && _react().default.createElement(_antd().Popover, {
|
|
462
456
|
content: CollectionConten(property),
|
|
463
|
-
getPopupContainer:
|
|
464
|
-
return document.getElementById('graph_container');
|
|
465
|
-
},
|
|
457
|
+
getPopupContainer: _utils.getPopupContainer,
|
|
466
458
|
mouseLeaveDelay: 0,
|
|
467
459
|
zIndex: 100,
|
|
468
460
|
title: _react().default.createElement("div", null, compile((_property$uiSchema = property.uiSchema) === null || _property$uiSchema === void 0 ? void 0 : _property$uiSchema.title), _react().default.createElement("span", {
|
|
@@ -495,9 +487,7 @@ const PortsCom = _react().default.memo(({
|
|
|
495
487
|
var _property$uiSchema3, _getInterface3, _property$uiSchema4, _getInterface4;
|
|
496
488
|
return property.uiSchema && _react().default.createElement(_antd().Popover, {
|
|
497
489
|
content: CollectionConten(property),
|
|
498
|
-
getPopupContainer:
|
|
499
|
-
return document.getElementById('graph_container');
|
|
500
|
-
},
|
|
490
|
+
getPopupContainer: _utils.getPopupContainer,
|
|
501
491
|
mouseLeaveDelay: 0,
|
|
502
492
|
zIndex: 100,
|
|
503
493
|
title: _react().default.createElement("div", null, compile((_property$uiSchema3 = property.uiSchema) === null || _property$uiSchema3 === void 0 ? void 0 : _property$uiSchema3.title), _react().default.createElement("span", {
|
|
@@ -26,6 +26,7 @@ function _react() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
var _actionHooks = require("../action-hooks");
|
|
29
|
+
var _utils = require("../utils");
|
|
29
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
31
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -55,7 +56,7 @@ const OverrideFieldAction = ({
|
|
|
55
56
|
useCancelAction: _actionHooks.useCancelAction,
|
|
56
57
|
useOverridingCollectionField: () => _useOverridingCollectionField(record)
|
|
57
58
|
},
|
|
58
|
-
getContainer:
|
|
59
|
+
getContainer: _utils.getPopupContainer
|
|
59
60
|
}, _react().default.createElement(_icons().CopyOutlined, {
|
|
60
61
|
className: "btn-override"
|
|
61
62
|
}));
|
|
@@ -25,6 +25,7 @@ function _react() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
+
var _utils = require("../utils");
|
|
28
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
30
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
30
31
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -36,7 +37,7 @@ const ViewFieldAction = ({
|
|
|
36
37
|
}) => {
|
|
37
38
|
return _react().default.createElement(_client().ViewFieldAction, {
|
|
38
39
|
item: _objectSpread({}, record),
|
|
39
|
-
getContainer:
|
|
40
|
+
getContainer: _utils.getPopupContainer
|
|
40
41
|
}, _react().default.createElement(_icons().EyeOutlined, {
|
|
41
42
|
className: "btn-view"
|
|
42
43
|
}));
|
package/lib/client/utils.d.ts
CHANGED
|
@@ -10,3 +10,8 @@ export declare const formatPortData: (ports: any) => import("lodash").Dictionary
|
|
|
10
10
|
export declare const formatInheritEdgeData: (collections: any) => any[];
|
|
11
11
|
export declare const getDiffNode: (newNodes: any, oldNodes: any) => any[];
|
|
12
12
|
export declare const getDiffEdge: (newEdges: any, oldEdges: any) => any[];
|
|
13
|
+
/**
|
|
14
|
+
* 所有的 getPopupContainer 都需要保证返回的是唯一的 div。React 18 concurrent 下会反复调用该方法
|
|
15
|
+
* 参考:https://ant.design/docs/react/migration-v5-cn#%E5%8D%87%E7%BA%A7%E5%87%86%E5%A4%87
|
|
16
|
+
*/
|
|
17
|
+
export declare const getPopupContainer: () => any;
|
package/lib/client/utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useGCMTranslation = exports.getInheritCollections = exports.getDiffNode = exports.getDiffEdge = exports.getChildrenCollections = exports.formatPortData = exports.formatInheritEdgeData = exports.formatData = void 0;
|
|
6
|
+
exports.useGCMTranslation = exports.getPopupContainer = exports.getInheritCollections = exports.getDiffNode = exports.getDiffEdge = exports.getChildrenCollections = exports.formatPortData = exports.formatInheritEdgeData = exports.formatData = void 0;
|
|
7
7
|
function _lodash() {
|
|
8
8
|
const data = require("lodash");
|
|
9
9
|
_lodash = function _lodash() {
|
|
@@ -521,4 +521,16 @@ const getDiffEdge = (newEdges, oldEdges) => {
|
|
|
521
521
|
}
|
|
522
522
|
return edges;
|
|
523
523
|
};
|
|
524
|
-
exports.getDiffEdge = getDiffEdge;
|
|
524
|
+
exports.getDiffEdge = getDiffEdge;
|
|
525
|
+
let graphContainer;
|
|
526
|
+
/**
|
|
527
|
+
* 所有的 getPopupContainer 都需要保证返回的是唯一的 div。React 18 concurrent 下会反复调用该方法
|
|
528
|
+
* 参考:https://ant.design/docs/react/migration-v5-cn#%E5%8D%87%E7%BA%A7%E5%87%86%E5%A4%87
|
|
529
|
+
*/
|
|
530
|
+
const getPopupContainer = () => {
|
|
531
|
+
if (graphContainer) {
|
|
532
|
+
return graphContainer;
|
|
533
|
+
}
|
|
534
|
+
return graphContainer = document.getElementById('graph_container');
|
|
535
|
+
};
|
|
536
|
+
exports.getPopupContainer = getPopupContainer;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "数据库可视化管理",
|
|
5
5
|
"description": "database collection manage",
|
|
6
6
|
"description.zh-CN": "数据库管理。",
|
|
7
|
-
"version": "0.10.0-alpha.
|
|
7
|
+
"version": "0.10.0-alpha.3",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./lib/index.js",
|
|
10
10
|
"types": "./lib/index.d.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"dagre": "^0.8.5"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@nocobase/client": "0.10.0-alpha.
|
|
18
|
-
"@nocobase/test": "0.10.0-alpha.
|
|
17
|
+
"@nocobase/client": "0.10.0-alpha.3",
|
|
18
|
+
"@nocobase/test": "0.10.0-alpha.3"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "1f0b27fc9ab2398cd41c308a6b01a986e025cd20"
|
|
21
21
|
}
|