@nocobase/plugin-graph-collection-manager 0.9.0-alpha.1
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/LICENSE +661 -0
- package/client.d.ts +4 -0
- package/client.js +30 -0
- package/lib/client/GraphCollectionProvider.d.ts +2 -0
- package/lib/client/GraphCollectionProvider.js +97 -0
- package/lib/client/GraphCollectionShortcut.d.ts +2 -0
- package/lib/client/GraphCollectionShortcut.js +236 -0
- package/lib/client/GraphDrawPage.d.ts +13 -0
- package/lib/client/GraphDrawPage.js +1746 -0
- package/lib/client/action-hooks.d.ts +44 -0
- package/lib/client/action-hooks.js +402 -0
- package/lib/client/components/AddCollectionAction.d.ts +3 -0
- package/lib/client/components/AddCollectionAction.js +73 -0
- package/lib/client/components/AddFieldAction.d.ts +3 -0
- package/lib/client/components/AddFieldAction.js +85 -0
- package/lib/client/components/CollectionNodeProvder.d.ts +10 -0
- package/lib/client/components/CollectionNodeProvder.js +42 -0
- package/lib/client/components/EditCollectionAction.d.ts +3 -0
- package/lib/client/components/EditCollectionAction.js +78 -0
- package/lib/client/components/EditFieldAction.d.ts +3 -0
- package/lib/client/components/EditFieldAction.js +81 -0
- package/lib/client/components/Entity.d.ts +8 -0
- package/lib/client/components/Entity.js +603 -0
- package/lib/client/components/FieldSummary.d.ts +2 -0
- package/lib/client/components/FieldSummary.js +98 -0
- package/lib/client/components/OverrideFieldAction.d.ts +3 -0
- package/lib/client/components/OverrideFieldAction.js +83 -0
- package/lib/client/components/ViewFieldAction.d.ts +3 -0
- package/lib/client/components/ViewFieldAction.js +57 -0
- package/lib/client/components/ViewNode.d.ts +5 -0
- package/lib/client/components/ViewNode.js +40 -0
- package/lib/client/index.d.ts +1 -0
- package/lib/client/index.js +13 -0
- package/lib/client/locale/en-US.d.ts +15 -0
- package/lib/client/locale/en-US.js +21 -0
- package/lib/client/locale/index.d.ts +3 -0
- package/lib/client/locale/index.js +31 -0
- package/lib/client/locale/ja-JP.d.ts +14 -0
- package/lib/client/locale/ja-JP.js +20 -0
- package/lib/client/locale/zh-CN.d.ts +16 -0
- package/lib/client/locale/zh-CN.js +22 -0
- package/lib/client/style.d.ts +9 -0
- package/lib/client/style.js +222 -0
- package/lib/client/utils.d.ts +11 -0
- package/lib/client/utils.js +565 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +15 -0
- package/lib/server/collections/graphPositions.d.ts +2 -0
- package/lib/server/collections/graphPositions.js +33 -0
- package/lib/server/index.d.ts +5 -0
- package/lib/server/index.js +51 -0
- package/package.json +18 -0
- package/server.d.ts +4 -0
- package/server.js +30 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.tableNameClass = exports.tableBtnClass = exports.nodeSubtreeClass = exports.headClass = exports.graphCollectionContainerClass = exports.entityContainer = exports.collectionListClass = exports.collectiionPopoverClass = exports.addButtonClass = void 0;
|
|
7
|
+
|
|
8
|
+
function _css() {
|
|
9
|
+
const data = require("@emotion/css");
|
|
10
|
+
|
|
11
|
+
_css = function _css() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const nodeSubtreeClass = (0, _css().css)`
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column-reverse;
|
|
21
|
+
align-items: center;
|
|
22
|
+
`;
|
|
23
|
+
exports.nodeSubtreeClass = nodeSubtreeClass;
|
|
24
|
+
const addButtonClass = (0, _css().css)`
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
padding: 2em 0;
|
|
27
|
+
`;
|
|
28
|
+
exports.addButtonClass = addButtonClass;
|
|
29
|
+
const entityContainer = (0, _css().css)`
|
|
30
|
+
width: 250px;
|
|
31
|
+
height: 100%;
|
|
32
|
+
border-radius: 2px;
|
|
33
|
+
background-color: #fff;
|
|
34
|
+
border: 0;
|
|
35
|
+
&:hover {
|
|
36
|
+
box-shadow: 0 1px 2px -2px rgb(0 0 0 / 16%), 0 3px 6px 0 rgb(0 0 0 / 12%), 0 5px 12px 4px rgb(0 0 0 / 9%);
|
|
37
|
+
}
|
|
38
|
+
.body {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
background-color: #fff;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
.morePorts {
|
|
44
|
+
max-height: 300px;
|
|
45
|
+
overflow: auto;
|
|
46
|
+
}
|
|
47
|
+
.body-item {
|
|
48
|
+
display: inline-table;
|
|
49
|
+
width: 100%;
|
|
50
|
+
max-width: 250px;
|
|
51
|
+
height: 40px;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
color: rgba(0, 0, 0, 0.85);
|
|
54
|
+
height: 40px;
|
|
55
|
+
border-top: 1px solid #f0f0f0;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
|
|
62
|
+
.field-operator {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
&:hover {
|
|
66
|
+
.field-operator {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: row-reverse;
|
|
69
|
+
height: 32px;
|
|
70
|
+
line-height: 32px;
|
|
71
|
+
z-index: 999;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
text-align: right;
|
|
74
|
+
background: #fff;
|
|
75
|
+
padding-right: 3px;
|
|
76
|
+
span {
|
|
77
|
+
margin: 3px;
|
|
78
|
+
margin-left: 4px;
|
|
79
|
+
padding: 3px;
|
|
80
|
+
height: 20px;
|
|
81
|
+
width: 20px;
|
|
82
|
+
}
|
|
83
|
+
.btn-del {
|
|
84
|
+
border-color: transparent;
|
|
85
|
+
color: rgb(78 89 105);
|
|
86
|
+
height: 20px;
|
|
87
|
+
width: 20px;
|
|
88
|
+
&:hover {
|
|
89
|
+
background-color: rgb(229 230 235);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
.btn-add {
|
|
93
|
+
background: rgb(232 255 234);
|
|
94
|
+
border-color: transparent;
|
|
95
|
+
color: rgb(0, 180, 42);
|
|
96
|
+
width: 20px;
|
|
97
|
+
}
|
|
98
|
+
.btn-edit {
|
|
99
|
+
color: rgba(0, 0, 0, 0.85);
|
|
100
|
+
display: flex;
|
|
101
|
+
}
|
|
102
|
+
.btn-edit:hover {
|
|
103
|
+
background: rgb(229 230 235);
|
|
104
|
+
}
|
|
105
|
+
.btn-override {
|
|
106
|
+
border-color: transparent;
|
|
107
|
+
width: 20px;
|
|
108
|
+
color: rgba(0, 0, 0, 0.85);
|
|
109
|
+
&:hover {
|
|
110
|
+
background-color: rgb(229 230 235);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.btn-view {
|
|
114
|
+
border-color: transparent;
|
|
115
|
+
color: rgba(0, 0, 0, 0.85);
|
|
116
|
+
width: 20px;
|
|
117
|
+
}
|
|
118
|
+
.btn-view:hover {
|
|
119
|
+
background: rgb(229 230 235);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
.field_type {
|
|
123
|
+
display: none;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.name {
|
|
128
|
+
text-overflow: ellipsis;
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
margin-left: 8px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.type {
|
|
135
|
+
color: rgba(0, 0, 0, 0.45);
|
|
136
|
+
margin-right: 8px;
|
|
137
|
+
text-overflow: ellipsis;
|
|
138
|
+
white-space: nowrap;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`;
|
|
144
|
+
exports.entityContainer = entityContainer;
|
|
145
|
+
const headClass = (0, _css().css)`
|
|
146
|
+
height: 40px;
|
|
147
|
+
font-size: 14px;
|
|
148
|
+
font-weight: 500;
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: row;
|
|
151
|
+
justify-content: space-between;
|
|
152
|
+
align-items: center;
|
|
153
|
+
background: #fafafa;
|
|
154
|
+
color: rgb(29 33 41);
|
|
155
|
+
padding: 0 8px;
|
|
156
|
+
border-radius: 3px;
|
|
157
|
+
`;
|
|
158
|
+
exports.headClass = headClass;
|
|
159
|
+
const tableNameClass = (0, _css().css)`
|
|
160
|
+
max-width: 80%;
|
|
161
|
+
overflow: hidden;
|
|
162
|
+
text-overflow: ellipsis;
|
|
163
|
+
white-space: nowrap;
|
|
164
|
+
font-weight: 500;
|
|
165
|
+
`;
|
|
166
|
+
exports.tableNameClass = tableNameClass;
|
|
167
|
+
const tableBtnClass = (0, _css().css)`
|
|
168
|
+
display: flex;
|
|
169
|
+
span {
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
}
|
|
172
|
+
`;
|
|
173
|
+
exports.tableBtnClass = tableBtnClass;
|
|
174
|
+
const collectiionPopoverClass = (0, _css().css)`
|
|
175
|
+
div.field-content {
|
|
176
|
+
font-size: 14px;
|
|
177
|
+
color: rgb(134 144 156);
|
|
178
|
+
opacity: 0.8;
|
|
179
|
+
display: block;
|
|
180
|
+
.field-type {
|
|
181
|
+
color: #333;
|
|
182
|
+
float: right;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
`;
|
|
186
|
+
exports.collectiionPopoverClass = collectiionPopoverClass;
|
|
187
|
+
const collectionListClass = (0, _css().css)`
|
|
188
|
+
float: right;
|
|
189
|
+
position: fixed;
|
|
190
|
+
margin-top: 24px;
|
|
191
|
+
right: 24px;
|
|
192
|
+
z-index: 1000;
|
|
193
|
+
.trigger {
|
|
194
|
+
float: right;
|
|
195
|
+
margin: 2px 4px;
|
|
196
|
+
font-size: 16px;
|
|
197
|
+
}
|
|
198
|
+
.ant-input {
|
|
199
|
+
margin: 4px;
|
|
200
|
+
}
|
|
201
|
+
.ant-menu-inline {
|
|
202
|
+
border-top: 1px solid #f0f0f0;
|
|
203
|
+
}
|
|
204
|
+
.ant-layout-sider {
|
|
205
|
+
margin-top: 24px;
|
|
206
|
+
}
|
|
207
|
+
.ant-menu-item {
|
|
208
|
+
height: 32px;
|
|
209
|
+
}
|
|
210
|
+
.ant-btn {
|
|
211
|
+
border: 0;
|
|
212
|
+
}
|
|
213
|
+
`;
|
|
214
|
+
exports.collectionListClass = collectionListClass;
|
|
215
|
+
const graphCollectionContainerClass = (0, _css().css)`
|
|
216
|
+
overflow: hidden;
|
|
217
|
+
.x6-graph-scroller {
|
|
218
|
+
height: calc(100vh) !important;
|
|
219
|
+
width: calc(100vw) !important;
|
|
220
|
+
}
|
|
221
|
+
`;
|
|
222
|
+
exports.graphCollectionContainerClass = graphCollectionContainerClass;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const getInheritCollections: (collections: any, name: any) => any[];
|
|
2
|
+
export declare const getChildrenCollections: (collections: any, name: any) => any[];
|
|
3
|
+
export declare const formatData: (data: any) => {
|
|
4
|
+
nodesData: any;
|
|
5
|
+
edgesData: any[];
|
|
6
|
+
inheritEdges: any[];
|
|
7
|
+
};
|
|
8
|
+
export declare const formatPortData: (ports: any) => import("lodash").Dictionary<[any, ...any[]]>;
|
|
9
|
+
export declare const formatInheritEdgeData: (collections: any) => any[];
|
|
10
|
+
export declare const getDiffNode: (newNodes: any, oldNodes: any) => any[];
|
|
11
|
+
export declare const getDiffEdge: (newEdges: any, oldEdges: any) => any[];
|