@nocobase/plugin-graph-collection-manager 0.9.2-alpha.2 → 0.9.2-alpha.4
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/GraphCollectionProvider.js +1 -1
- package/lib/client/GraphDrawPage.js +4 -4
- package/lib/client/action-hooks.d.ts +1 -14
- package/lib/client/components/AddFieldAction.js +1 -1
- package/lib/client/locale/en-US.d.ts +1 -1
- package/lib/client/locale/en-US.js +2 -2
- package/lib/client/locale/ja-JP.js +1 -1
- package/lib/client/locale/pt-BR.d.ts +1 -1
- package/lib/client/locale/pt-BR.js +2 -2
- package/lib/client/locale/zh-CN.d.ts +1 -1
- package/lib/client/locale/zh-CN.js +2 -2
- package/lib/client/utils.js +1 -1
- package/package.json +4 -4
|
@@ -43,7 +43,7 @@ const GraphCollectionProvider = _react().default.memo(props => {
|
|
|
43
43
|
t = _useGCMTranslation.t;
|
|
44
44
|
const items = (0, _react().useContext)(_client().SettingsCenterContext);
|
|
45
45
|
items['collection-manager']['tabs']['graph'] = {
|
|
46
|
-
title: t(
|
|
46
|
+
title: t('Graphical interface'),
|
|
47
47
|
component: _GraphCollectionShortcut.GraphCollectionPane
|
|
48
48
|
};
|
|
49
49
|
return _react().default.createElement(_client().SettingsCenterProvider, {
|
|
@@ -101,7 +101,7 @@ const LINE_HEIGHT = 40;
|
|
|
101
101
|
const NODE_WIDTH = 250;
|
|
102
102
|
let targetGraph;
|
|
103
103
|
let targetNode;
|
|
104
|
-
|
|
104
|
+
const dir = 'TB'; // LR RL TB BT 横排
|
|
105
105
|
var DirectionType;
|
|
106
106
|
exports.DirectionType = DirectionType;
|
|
107
107
|
(function (DirectionType) {
|
|
@@ -390,7 +390,7 @@ const handelResetLayout = () => {
|
|
|
390
390
|
const yNodes = nodeWithEdges.filter(v => {
|
|
391
391
|
return Math.abs(targetGraph.getCellById(v).position().y - maxY) < 50;
|
|
392
392
|
});
|
|
393
|
-
|
|
393
|
+
const referenceNode = (_targetGraph$getCell = targetGraph.getCell((0, _lodash().maxBy)(yNodes, k => targetGraph.getCellById(k).position().x))) === null || _targetGraph$getCell === void 0 ? void 0 : _targetGraph$getCell.position();
|
|
394
394
|
num = Math.round(maxX / 320) || 1;
|
|
395
395
|
alternateNum = Math.floor((4500 - (maxX + 100 - referenceNode.x)) / 280);
|
|
396
396
|
rawEntity = getGridData(num, rawNodes);
|
|
@@ -453,7 +453,7 @@ const handelResetLayout = () => {
|
|
|
453
453
|
};
|
|
454
454
|
const GraphDrawPage = _react2().default.memo(() => {
|
|
455
455
|
var _targetGraph7;
|
|
456
|
-
|
|
456
|
+
const options = (0, _react2().useContext)(_react().SchemaOptionsContext);
|
|
457
457
|
const ctx = (0, _react2().useContext)(_client().CollectionManagerContext);
|
|
458
458
|
const api = (0, _client().useAPIClient)();
|
|
459
459
|
const compile = (0, _client().useCompile)();
|
|
@@ -991,7 +991,7 @@ const GraphDrawPage = _react2().default.memo(() => {
|
|
|
991
991
|
const node = targetGraph.getCellById(key);
|
|
992
992
|
targetGraph.cacheCollection[key] = true;
|
|
993
993
|
const connectedEdges = targetGraph.getConnectedEdges(node);
|
|
994
|
-
|
|
994
|
+
const visibleEdges = connectedEdges.filter(v => {
|
|
995
995
|
var _v$store$data;
|
|
996
996
|
return !((_v$store$data = v.store.data) === null || _v$store$data === void 0 ? void 0 : _v$store$data.connectionType) && v.getTargetCellId() === key;
|
|
997
997
|
});
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const useValuesFromRecord: (options: any, data: any) =>
|
|
3
|
-
state: {};
|
|
4
|
-
setState: import("ahooks/lib/useSetState").SetState<{}>;
|
|
5
|
-
loading: boolean;
|
|
6
|
-
data?: any;
|
|
7
|
-
error?: Error;
|
|
8
|
-
params: any;
|
|
9
|
-
cancel: () => void;
|
|
10
|
-
refresh: () => void;
|
|
11
|
-
refreshAsync: () => Promise<any>;
|
|
12
|
-
run: (...params: any) => void;
|
|
13
|
-
runAsync: (...params: any) => Promise<any>;
|
|
14
|
-
mutate: (data?: any) => void;
|
|
15
|
-
};
|
|
2
|
+
export declare const useValuesFromRecord: (options: any, data: any) => any;
|
|
16
3
|
export declare const SourceCollection: React.MemoExoticComponent<React.FunctionComponent<unknown>>;
|
|
17
4
|
export declare const useCancelAction: () => {
|
|
18
5
|
run(): Promise<void>;
|
|
@@ -60,7 +60,7 @@ const AddFieldAction = ({
|
|
|
60
60
|
getContainer: () => document.getElementById('graph_container')
|
|
61
61
|
}, _react().default.createElement(_icons().PlusOutlined, {
|
|
62
62
|
className: "btn-add",
|
|
63
|
-
id:
|
|
63
|
+
id: "graph_btn_add_field"
|
|
64
64
|
}));
|
|
65
65
|
};
|
|
66
66
|
exports.AddFieldAction = AddFieldAction;
|
|
@@ -6,7 +6,7 @@ declare const _default: {
|
|
|
6
6
|
'Create Collection': string;
|
|
7
7
|
'All Fields': string;
|
|
8
8
|
'Association Fields': string;
|
|
9
|
-
'
|
|
9
|
+
'Choices fields': string;
|
|
10
10
|
'All relationships': string;
|
|
11
11
|
'Entity relationship only': string;
|
|
12
12
|
'Inheritance relationship only': string;
|
|
@@ -12,11 +12,11 @@ var _default = {
|
|
|
12
12
|
'Create Collection': 'Create Collection',
|
|
13
13
|
'All Fields': 'All Fields',
|
|
14
14
|
'Association Fields': 'Association Fields',
|
|
15
|
-
'
|
|
15
|
+
'Choices fields': 'Choices fields',
|
|
16
16
|
'All relationships': 'All relationships',
|
|
17
17
|
'Entity relationship only': 'Entity relationship only',
|
|
18
18
|
'Inheritance relationship only': 'Inheritance relationship only',
|
|
19
19
|
'Graphical interface': 'Graphical interface',
|
|
20
|
-
|
|
20
|
+
Selection: 'Selection'
|
|
21
21
|
};
|
|
22
22
|
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ declare const _default: {
|
|
|
6
6
|
'Create Collection': string;
|
|
7
7
|
'All Fields': string;
|
|
8
8
|
'Association Fields': string;
|
|
9
|
-
'
|
|
9
|
+
'Choices fields': string;
|
|
10
10
|
'All relationships': string;
|
|
11
11
|
'Entity relationship only': string;
|
|
12
12
|
'Inheritance relationship only': string;
|
|
@@ -12,11 +12,11 @@ var _default = {
|
|
|
12
12
|
'Create Collection': 'Criar Coleção',
|
|
13
13
|
'All Fields': 'Todos os Campos',
|
|
14
14
|
'Association Fields': 'Campos de Associação',
|
|
15
|
-
'
|
|
15
|
+
'Choices fields': 'Campos de opções',
|
|
16
16
|
'All relationships': 'Todos os relacionamentos',
|
|
17
17
|
'Entity relationship only': 'Somente relação de Entidade',
|
|
18
18
|
'Inheritance relationship only': 'Somente relação de Herança',
|
|
19
19
|
'Graphical interface': 'Interface Gráfica',
|
|
20
|
-
|
|
20
|
+
Selection: 'Seleção'
|
|
21
21
|
};
|
|
22
22
|
exports.default = _default;
|
|
@@ -6,7 +6,7 @@ declare const _default: {
|
|
|
6
6
|
'Create Collection': string;
|
|
7
7
|
'All Fields': string;
|
|
8
8
|
'Association Fields': string;
|
|
9
|
-
'
|
|
9
|
+
'Choices fields': string;
|
|
10
10
|
'All relationships': string;
|
|
11
11
|
'Entity relationship only': string;
|
|
12
12
|
'Inheritance relationship only': string;
|
|
@@ -12,12 +12,12 @@ var _default = {
|
|
|
12
12
|
'Create Collection': '创建数据表',
|
|
13
13
|
'All Fields': '全部',
|
|
14
14
|
'Association Fields': '关系字段',
|
|
15
|
-
'
|
|
15
|
+
'Choices fields': '选项字段',
|
|
16
16
|
'All relationships': '所有关系',
|
|
17
17
|
'Entity relationship only': '实体关系',
|
|
18
18
|
'Inheritance relationship only': '继承关系',
|
|
19
19
|
'Graphical interface': '图形化界面',
|
|
20
20
|
'Auto layout': '自动布局',
|
|
21
|
-
|
|
21
|
+
Selection: '选择模式'
|
|
22
22
|
};
|
|
23
23
|
exports.default = _default;
|
package/lib/client/utils.js
CHANGED
|
@@ -444,7 +444,7 @@ const getRelationship = relatioship => {
|
|
|
444
444
|
}
|
|
445
445
|
};
|
|
446
446
|
const getDiffNode = (newNodes, oldNodes) => {
|
|
447
|
-
|
|
447
|
+
const arr = [];
|
|
448
448
|
const length1 = newNodes.length;
|
|
449
449
|
const length2 = oldNodes.length;
|
|
450
450
|
for (let i = 0; i < length1; i++) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-graph-collection-manager",
|
|
3
|
-
"version": "0.9.2-alpha.
|
|
3
|
+
"version": "0.9.2-alpha.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dagre": "^0.8.5"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@nocobase/client": "0.9.2-alpha.
|
|
15
|
-
"@nocobase/test": "0.9.2-alpha.
|
|
14
|
+
"@nocobase/client": "0.9.2-alpha.4",
|
|
15
|
+
"@nocobase/test": "0.9.2-alpha.4"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "96cb023f353a4fb099dea074c575be65ebab813f"
|
|
18
18
|
}
|