@nocobase/plugin-graph-collection-manager 0.11.1-alpha.5 → 0.12.0-alpha.2
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/client.d.ts +2 -3
- package/client.js +1 -1
- package/dist/client/index.js +65917 -0
- package/{lib → dist}/client/utils.d.ts +4 -3
- package/{lib → dist}/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/locale/en-US.js +19 -0
- package/dist/locale/es-ES.js +19 -0
- package/dist/locale/fr-FR.js +19 -0
- package/dist/locale/ja-JP.js +17 -0
- package/dist/locale/pt-BR.js +19 -0
- package/dist/locale/zh-CN.js +20 -0
- package/dist/server/collections/graphPositions.js +26 -0
- package/dist/server/index.js +23 -0
- package/package.json +17 -28
- package/server.d.ts +2 -3
- package/server.js +1 -1
- package/lib/client/GraphCollectionProvider.js +0 -51
- package/lib/client/GraphCollectionShortcut.js +0 -169
- package/lib/client/GraphDrawPage.js +0 -1546
- package/lib/client/action-hooks.js +0 -318
- package/lib/client/components/AddCollectionAction.js +0 -58
- package/lib/client/components/AddFieldAction.js +0 -69
- package/lib/client/components/CollectionNodeProvder.js +0 -34
- package/lib/client/components/EditCollectionAction.js +0 -47
- package/lib/client/components/EditFieldAction.js +0 -63
- package/lib/client/components/Entity.js +0 -529
- package/lib/client/components/FieldSummary.js +0 -69
- package/lib/client/components/OverrideFieldAction.js +0 -64
- package/lib/client/components/ViewFieldAction.js +0 -45
- package/lib/client/components/ViewNode.js +0 -33
- package/lib/client/index.js +0 -27
- package/lib/client/locale/index.js +0 -4
- package/lib/client/style.js +0 -233
- package/lib/client/utils.js +0 -540
- package/lib/index.js +0 -13
- package/lib/locale/en-US.js +0 -22
- package/lib/locale/es-ES.js +0 -22
- package/lib/locale/fr-FR.js +0 -22
- package/lib/locale/ja-JP.js +0 -20
- package/lib/locale/pt-BR.js +0 -22
- package/lib/locale/zh-CN.js +0 -23
- package/lib/server/collections/graphPositions.js +0 -30
- package/lib/server/index.js +0 -37
- package/src/client/GraphCollectionProvider.tsx +0 -33
- package/src/client/GraphCollectionShortcut.tsx +0 -141
- package/src/client/GraphDrawPage.tsx +0 -1382
- package/src/client/action-hooks.tsx +0 -237
- package/src/client/components/AddCollectionAction.tsx +0 -28
- package/src/client/components/AddFieldAction.tsx +0 -37
- package/src/client/components/CollectionNodeProvder.tsx +0 -28
- package/src/client/components/EditCollectionAction.tsx +0 -21
- package/src/client/components/EditFieldAction.tsx +0 -30
- package/src/client/components/Entity.tsx +0 -495
- package/src/client/components/FieldSummary.tsx +0 -42
- package/src/client/components/OverrideFieldAction.tsx +0 -30
- package/src/client/components/ViewFieldAction.tsx +0 -12
- package/src/client/components/ViewNode.tsx +0 -22
- package/src/client/index.tsx +0 -10
- package/src/client/locale/index.ts +0 -3
- package/src/client/style.tsx +0 -227
- package/src/client/utils.tsx +0 -548
- package/src/index.ts +0 -1
- package/src/locale/en-US.ts +0 -15
- package/src/locale/es-ES.ts +0 -15
- package/src/locale/fr-FR.ts +0 -15
- package/src/locale/ja-JP.ts +0 -13
- package/src/locale/pt-BR.ts +0 -15
- package/src/locale/zh-CN.ts +0 -16
- package/src/server/actions/.gitkeep +0 -0
- package/src/server/collections/.gitkeep +0 -0
- package/src/server/collections/graphPositions.ts +0 -22
- package/src/server/index.ts +0 -13
- package/src/server/models/.gitkeep +0 -0
- package/src/server/repositories/.gitkeep +0 -0
- /package/{lib → dist}/client/GraphCollectionProvider.d.ts +0 -0
- /package/{lib → dist}/client/GraphCollectionShortcut.d.ts +0 -0
- /package/{lib → dist}/client/GraphDrawPage.d.ts +0 -0
- /package/{lib → dist}/client/action-hooks.d.ts +0 -0
- /package/{lib → dist}/client/components/AddCollectionAction.d.ts +0 -0
- /package/{lib → dist}/client/components/AddFieldAction.d.ts +0 -0
- /package/{lib → dist}/client/components/CollectionNodeProvder.d.ts +0 -0
- /package/{lib → dist}/client/components/EditCollectionAction.d.ts +0 -0
- /package/{lib → dist}/client/components/EditFieldAction.d.ts +0 -0
- /package/{lib → dist}/client/components/Entity.d.ts +0 -0
- /package/{lib → dist}/client/components/FieldSummary.d.ts +0 -0
- /package/{lib → dist}/client/components/OverrideFieldAction.d.ts +0 -0
- /package/{lib → dist}/client/components/ViewFieldAction.d.ts +0 -0
- /package/{lib → dist}/client/components/ViewNode.d.ts +0 -0
- /package/{lib → dist}/client/index.d.ts +0 -0
- /package/{lib → dist}/client/locale/index.d.ts +0 -0
- /package/{lib → dist}/client/style.d.ts +0 -0
- /package/{lib → dist}/locale/en-US.d.ts +0 -0
- /package/{lib → dist}/locale/es-ES.d.ts +0 -0
- /package/{lib → dist}/locale/fr-FR.d.ts +0 -0
- /package/{lib → dist}/locale/ja-JP.d.ts +0 -0
- /package/{lib → dist}/locale/pt-BR.d.ts +0 -0
- /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
- /package/{lib → dist}/server/collections/graphPositions.d.ts +0 -0
- /package/{lib → dist}/server/index.d.ts +0 -0
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ViewFieldAction = void 0;
|
|
7
|
-
function _icons() {
|
|
8
|
-
const data = require("@ant-design/icons");
|
|
9
|
-
_icons = function _icons() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _client() {
|
|
15
|
-
const data = require("@nocobase/client");
|
|
16
|
-
_client = function _client() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _react() {
|
|
22
|
-
const data = _interopRequireDefault(require("react"));
|
|
23
|
-
_react = function _react() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
var _utils = require("../utils");
|
|
29
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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; }
|
|
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; }
|
|
32
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
34
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
35
|
-
const ViewFieldAction = ({
|
|
36
|
-
item: record
|
|
37
|
-
}) => {
|
|
38
|
-
return _react().default.createElement(_client().ViewFieldAction, {
|
|
39
|
-
item: _objectSpread({}, record),
|
|
40
|
-
getContainer: _utils.getPopupContainer
|
|
41
|
-
}, _react().default.createElement(_icons().EyeOutlined, {
|
|
42
|
-
className: "btn-view"
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
exports.ViewFieldAction = ViewFieldAction;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SimpleNodeView = void 0;
|
|
7
|
-
function _x() {
|
|
8
|
-
const data = require("@antv/x6");
|
|
9
|
-
_x = function _x() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
class SimpleNodeView extends _x().NodeView {
|
|
15
|
-
renderMarkup() {
|
|
16
|
-
return this.renderJSONMarkup({
|
|
17
|
-
tagName: 'rect',
|
|
18
|
-
selector: 'body'
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
update() {
|
|
22
|
-
const attrs = this.cell.getAttrs();
|
|
23
|
-
const fill = attrs.hightLight ? '#1890ff' : 'gray';
|
|
24
|
-
super.update({
|
|
25
|
-
body: {
|
|
26
|
-
refWidth: '50px',
|
|
27
|
-
refHeight: '100px',
|
|
28
|
-
fill: fill
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.SimpleNodeView = SimpleNodeView;
|
package/lib/client/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.GraphCollectionPlugin = void 0;
|
|
7
|
-
function _client() {
|
|
8
|
-
const data = require("@nocobase/client");
|
|
9
|
-
_client = function _client() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
var _GraphCollectionProvider = require("./GraphCollectionProvider");
|
|
15
|
-
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); } }
|
|
16
|
-
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); }); }; }
|
|
17
|
-
class GraphCollectionPlugin extends _client().Plugin {
|
|
18
|
-
load() {
|
|
19
|
-
var _this = this;
|
|
20
|
-
return _asyncToGenerator(function* () {
|
|
21
|
-
_this.app.use(_GraphCollectionProvider.GraphCollectionProvider);
|
|
22
|
-
})();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.GraphCollectionPlugin = GraphCollectionPlugin;
|
|
26
|
-
var _default = GraphCollectionPlugin;
|
|
27
|
-
exports.default = _default;
|
package/lib/client/style.js
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
function _client() {
|
|
8
|
-
const data = require("@nocobase/client");
|
|
9
|
-
_client = function _client() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
const useStyles = (0, _client().createStyles)(({
|
|
15
|
-
token,
|
|
16
|
-
css
|
|
17
|
-
}) => {
|
|
18
|
-
return {
|
|
19
|
-
// 右下角的小画布
|
|
20
|
-
graphMinimap: css`
|
|
21
|
-
.x6-widget-minimap {
|
|
22
|
-
background-color: ${token.colorBgContainer};
|
|
23
|
-
}
|
|
24
|
-
`,
|
|
25
|
-
addButtonClass: css`
|
|
26
|
-
flex-shrink: 0;
|
|
27
|
-
padding: 2em 0;
|
|
28
|
-
`,
|
|
29
|
-
entityContainer: css`
|
|
30
|
-
.btn-del {
|
|
31
|
-
border-color: transparent;
|
|
32
|
-
background-color: ${token.colorErrorBg};
|
|
33
|
-
color: ${token.colorErrorText};
|
|
34
|
-
height: 20px;
|
|
35
|
-
width: 20px;
|
|
36
|
-
&:hover {
|
|
37
|
-
background-color: ${token.colorErrorBgHover};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
.btn-add {
|
|
41
|
-
background: ${token.colorSuccessBg};
|
|
42
|
-
border-color: transparent;
|
|
43
|
-
color: ${token.colorSuccessText};
|
|
44
|
-
width: 20px;
|
|
45
|
-
&:hover {
|
|
46
|
-
background-color: ${token.colorSuccessBgHover};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
.btn-edit {
|
|
50
|
-
color: ${token.colorText};
|
|
51
|
-
display: flex;
|
|
52
|
-
&:hover {
|
|
53
|
-
background: ${token.colorBgTextHover};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
.btn-edit-in-head {
|
|
57
|
-
border-color: transparent;
|
|
58
|
-
color: ${token.colorText};
|
|
59
|
-
height: 20px;
|
|
60
|
-
width: 22px;
|
|
61
|
-
margin: 0px 5px 4px;
|
|
62
|
-
line-height: 25px;
|
|
63
|
-
&:hover {
|
|
64
|
-
background: ${token.colorBgTextHover};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
width: 250px;
|
|
68
|
-
height: 100%;
|
|
69
|
-
border-radius: ${token.borderRadiusLG}px;
|
|
70
|
-
background-color: ${token.colorBgContainer};
|
|
71
|
-
border: 0;
|
|
72
|
-
overflow: hidden;
|
|
73
|
-
&:hover {
|
|
74
|
-
box-shadow: ${token.boxShadowTertiary};
|
|
75
|
-
}
|
|
76
|
-
.body {
|
|
77
|
-
width: 100%;
|
|
78
|
-
height: 100%;
|
|
79
|
-
background-color: ${token.colorBgContainer};
|
|
80
|
-
cursor: pointer;
|
|
81
|
-
.morePorts {
|
|
82
|
-
max-height: 300px;
|
|
83
|
-
overflow: auto;
|
|
84
|
-
}
|
|
85
|
-
.body-item {
|
|
86
|
-
display: inline-table;
|
|
87
|
-
width: 100%;
|
|
88
|
-
max-width: 250px;
|
|
89
|
-
height: 40px;
|
|
90
|
-
font-size: 14px;
|
|
91
|
-
color: ${token.colorText};
|
|
92
|
-
border-top: 1px solid ${token.colorBorderSecondary};
|
|
93
|
-
text-overflow: ellipsis;
|
|
94
|
-
display: flex;
|
|
95
|
-
flex-direction: row;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: space-between;
|
|
98
|
-
|
|
99
|
-
.field-operator {
|
|
100
|
-
display: none;
|
|
101
|
-
}
|
|
102
|
-
&:hover {
|
|
103
|
-
.field-operator {
|
|
104
|
-
display: flex;
|
|
105
|
-
flex-direction: row-reverse;
|
|
106
|
-
height: 32px;
|
|
107
|
-
line-height: 32px;
|
|
108
|
-
z-index: 999;
|
|
109
|
-
cursor: pointer;
|
|
110
|
-
text-align: right;
|
|
111
|
-
background: ${token.colorBgContainer};
|
|
112
|
-
padding-right: 3px;
|
|
113
|
-
span {
|
|
114
|
-
margin: 3px;
|
|
115
|
-
margin-left: 4px;
|
|
116
|
-
padding: 3px;
|
|
117
|
-
height: 20px;
|
|
118
|
-
width: 20px;
|
|
119
|
-
}
|
|
120
|
-
.btn-override {
|
|
121
|
-
border-color: transparent;
|
|
122
|
-
width: 20px;
|
|
123
|
-
color: ${token.colorText};
|
|
124
|
-
&:hover {
|
|
125
|
-
background-color: ${token.colorBgTextHover};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
.btn-view {
|
|
129
|
-
border-color: transparent;
|
|
130
|
-
color: ${token.colorText};
|
|
131
|
-
width: 20px;
|
|
132
|
-
}
|
|
133
|
-
.btn-view:hover {
|
|
134
|
-
background: ${token.colorBgTextHover};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
.field_type {
|
|
138
|
-
display: none;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.name {
|
|
143
|
-
text-overflow: ellipsis;
|
|
144
|
-
white-space: nowrap;
|
|
145
|
-
overflow: hidden;
|
|
146
|
-
margin-left: 8px;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.type {
|
|
150
|
-
color: ${token.colorTextTertiary};
|
|
151
|
-
margin-right: 8px;
|
|
152
|
-
text-overflow: ellipsis;
|
|
153
|
-
white-space: nowrap;
|
|
154
|
-
overflow: hidden;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
`,
|
|
159
|
-
headClass: css`
|
|
160
|
-
height: 50px;
|
|
161
|
-
font-size: 14px;
|
|
162
|
-
font-weight: 500;
|
|
163
|
-
display: flex;
|
|
164
|
-
flex-direction: row;
|
|
165
|
-
justify-content: space-between;
|
|
166
|
-
align-items: center;
|
|
167
|
-
background: ${token.colorFillAlter};
|
|
168
|
-
color: ${token.colorTextHeading};
|
|
169
|
-
padding: 0 8px;
|
|
170
|
-
`,
|
|
171
|
-
tableNameClass: css`
|
|
172
|
-
max-width: 80%;
|
|
173
|
-
overflow: hidden;
|
|
174
|
-
text-overflow: ellipsis;
|
|
175
|
-
white-space: nowrap;
|
|
176
|
-
font-weight: 500;
|
|
177
|
-
`,
|
|
178
|
-
tableBtnClass: css`
|
|
179
|
-
display: flex;
|
|
180
|
-
span {
|
|
181
|
-
cursor: pointer;
|
|
182
|
-
}
|
|
183
|
-
`,
|
|
184
|
-
collectionPopoverClass: css`
|
|
185
|
-
div.field-content {
|
|
186
|
-
font-size: 14px;
|
|
187
|
-
color: ${token.colorTextSecondary};
|
|
188
|
-
opacity: 0.8;
|
|
189
|
-
display: block;
|
|
190
|
-
.field-type {
|
|
191
|
-
color: ${token.colorText};
|
|
192
|
-
float: right;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
`,
|
|
196
|
-
collectionListClass: css`
|
|
197
|
-
float: right;
|
|
198
|
-
position: fixed;
|
|
199
|
-
margin-top: 24px;
|
|
200
|
-
right: 24px;
|
|
201
|
-
z-index: 1000;
|
|
202
|
-
.trigger {
|
|
203
|
-
float: right;
|
|
204
|
-
margin: 2px 4px;
|
|
205
|
-
font-size: 16px;
|
|
206
|
-
}
|
|
207
|
-
.ant-input {
|
|
208
|
-
margin: 4px;
|
|
209
|
-
}
|
|
210
|
-
.ant-menu-inline {
|
|
211
|
-
border-top: 1px solid ${token.colorBorderSecondary};
|
|
212
|
-
}
|
|
213
|
-
.ant-layout-sider {
|
|
214
|
-
margin-top: 24px;
|
|
215
|
-
}
|
|
216
|
-
.ant-menu-item {
|
|
217
|
-
height: 32px;
|
|
218
|
-
}
|
|
219
|
-
.ant-btn {
|
|
220
|
-
border: 0;
|
|
221
|
-
}
|
|
222
|
-
`,
|
|
223
|
-
graphCollectionContainerClass: css`
|
|
224
|
-
overflow: hidden;
|
|
225
|
-
.x6-graph-scroller {
|
|
226
|
-
height: calc(100vh) !important;
|
|
227
|
-
width: calc(100vw) !important;
|
|
228
|
-
}
|
|
229
|
-
`
|
|
230
|
-
};
|
|
231
|
-
});
|
|
232
|
-
var _default = useStyles;
|
|
233
|
-
exports.default = _default;
|