@nocobase/plugin-graph-collection-manager 0.9.1-alpha.2 → 0.9.2-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/lib/client/GraphCollectionProvider.js +8 -27
- package/lib/client/GraphCollectionShortcut.js +6 -37
- package/lib/client/GraphDrawPage.js +66 -271
- package/lib/client/action-hooks.js +26 -114
- package/lib/client/components/AddCollectionAction.js +1 -17
- package/lib/client/components/AddFieldAction.js +2 -21
- package/lib/client/components/CollectionNodeProvder.js +3 -11
- package/lib/client/components/EditCollectionAction.js +0 -16
- package/lib/client/components/EditFieldAction.js +5 -24
- package/lib/client/components/Entity.js +32 -101
- package/lib/client/components/FieldSummary.js +2 -26
- package/lib/client/components/OverrideFieldAction.js +4 -24
- package/lib/client/components/ViewFieldAction.js +3 -16
- package/lib/client/components/ViewNode.js +0 -7
- package/lib/client/index.js +0 -1
- package/lib/client/locale/en-US.d.ts +1 -0
- package/lib/client/locale/en-US.js +1 -0
- package/lib/client/locale/index.js +0 -4
- package/lib/client/locale/pt-BR.d.ts +16 -0
- package/lib/client/locale/pt-BR.js +22 -0
- package/lib/client/locale/zh-CN.d.ts +1 -0
- package/lib/client/locale/zh-CN.js +1 -0
- package/lib/client/style.js +0 -4
- package/lib/client/utils.d.ts +1 -1
- package/lib/client/utils.js +6 -63
- package/lib/index.js +0 -2
- package/lib/server/collections/graphPositions.js +1 -6
- package/lib/server/index.js +0 -14
- package/package.json +4 -4
|
@@ -4,65 +4,47 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.EditFieldAction = void 0;
|
|
7
|
-
|
|
8
7
|
function _icons() {
|
|
9
8
|
const data = require("@ant-design/icons");
|
|
10
|
-
|
|
11
9
|
_icons = function _icons() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _client() {
|
|
19
15
|
const data = require("@nocobase/client");
|
|
20
|
-
|
|
21
16
|
_client = function _client() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _react() {
|
|
29
22
|
const data = _interopRequireDefault(require("react"));
|
|
30
|
-
|
|
31
23
|
_react = function _react() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
var _actionHooks = require("../action-hooks");
|
|
39
|
-
|
|
40
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
-
|
|
42
30
|
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); } }
|
|
43
|
-
|
|
44
31
|
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); }); }; }
|
|
45
|
-
|
|
46
32
|
const _useUpdateCollectionField = record => {
|
|
47
33
|
const collectionName = record.collectionName;
|
|
48
|
-
|
|
49
34
|
const _useUpdateFieldAction = (0, _actionHooks.useUpdateFieldAction)({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
collectionName,
|
|
36
|
+
name: record.name,
|
|
37
|
+
key: record.key
|
|
38
|
+
}),
|
|
39
|
+
run = _useUpdateFieldAction.run;
|
|
56
40
|
return {
|
|
57
41
|
run() {
|
|
58
42
|
return _asyncToGenerator(function* () {
|
|
59
43
|
yield run();
|
|
60
44
|
})();
|
|
61
45
|
}
|
|
62
|
-
|
|
63
46
|
};
|
|
64
47
|
};
|
|
65
|
-
|
|
66
48
|
const EditFieldAction = ({
|
|
67
49
|
item: record
|
|
68
50
|
}) => {
|
|
@@ -77,5 +59,4 @@ const EditFieldAction = ({
|
|
|
77
59
|
className: "btn-edit"
|
|
78
60
|
}));
|
|
79
61
|
};
|
|
80
|
-
|
|
81
62
|
exports.EditFieldAction = EditFieldAction;
|
|
@@ -4,136 +4,92 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _icons() {
|
|
9
8
|
const data = require("@ant-design/icons");
|
|
10
|
-
|
|
11
9
|
_icons = function _icons() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
require("@antv/x6-react-shape");
|
|
19
|
-
|
|
20
15
|
function _css() {
|
|
21
16
|
const data = require("@emotion/css");
|
|
22
|
-
|
|
23
17
|
_css = function _css() {
|
|
24
18
|
return data;
|
|
25
19
|
};
|
|
26
|
-
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
function _shared() {
|
|
31
23
|
const data = require("@formily/shared");
|
|
32
|
-
|
|
33
24
|
_shared = function _shared() {
|
|
34
25
|
return data;
|
|
35
26
|
};
|
|
36
|
-
|
|
37
27
|
return data;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
29
|
function _client() {
|
|
41
30
|
const data = require("@nocobase/client");
|
|
42
|
-
|
|
43
31
|
_client = function _client() {
|
|
44
32
|
return data;
|
|
45
33
|
};
|
|
46
|
-
|
|
47
34
|
return data;
|
|
48
35
|
}
|
|
49
|
-
|
|
50
36
|
function _antd() {
|
|
51
37
|
const data = require("antd");
|
|
52
|
-
|
|
53
38
|
_antd = function _antd() {
|
|
54
39
|
return data;
|
|
55
40
|
};
|
|
56
|
-
|
|
57
41
|
return data;
|
|
58
42
|
}
|
|
59
|
-
|
|
60
43
|
function _lodash() {
|
|
61
44
|
const data = require("lodash");
|
|
62
|
-
|
|
63
45
|
_lodash = function _lodash() {
|
|
64
46
|
return data;
|
|
65
47
|
};
|
|
66
|
-
|
|
67
48
|
return data;
|
|
68
49
|
}
|
|
69
|
-
|
|
70
50
|
function _react() {
|
|
71
51
|
const data = _interopRequireWildcard(require("react"));
|
|
72
|
-
|
|
73
52
|
_react = function _react() {
|
|
74
53
|
return data;
|
|
75
54
|
};
|
|
76
|
-
|
|
77
55
|
return data;
|
|
78
56
|
}
|
|
79
|
-
|
|
80
57
|
var _actionHooks = require("../action-hooks");
|
|
81
|
-
|
|
82
58
|
var _style = require("../style");
|
|
83
|
-
|
|
84
59
|
var _utils = require("../utils");
|
|
85
|
-
|
|
86
60
|
var _AddFieldAction = require("./AddFieldAction");
|
|
87
|
-
|
|
88
61
|
var _CollectionNodeProvder = require("./CollectionNodeProvder");
|
|
89
|
-
|
|
90
62
|
var _EditCollectionAction = require("./EditCollectionAction");
|
|
91
|
-
|
|
92
63
|
var _EditFieldAction = require("./EditFieldAction");
|
|
93
|
-
|
|
94
64
|
var _FieldSummary = require("./FieldSummary");
|
|
95
|
-
|
|
96
65
|
var _OverrideFieldAction = require("./OverrideFieldAction");
|
|
97
|
-
|
|
98
66
|
var _ViewFieldAction = require("./ViewFieldAction");
|
|
99
|
-
|
|
100
67
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
101
|
-
|
|
102
68
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
103
|
-
|
|
104
69
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
105
|
-
|
|
106
70
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
107
|
-
|
|
108
71
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
109
|
-
|
|
110
72
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
111
|
-
|
|
112
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
113
|
-
|
|
73
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
114
74
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
115
|
-
|
|
116
75
|
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); } }
|
|
117
|
-
|
|
118
76
|
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); }); }; }
|
|
119
|
-
|
|
120
77
|
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; }
|
|
121
|
-
|
|
122
78
|
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; }
|
|
123
|
-
|
|
124
|
-
function
|
|
125
|
-
|
|
79
|
+
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; }
|
|
80
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
81
|
+
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); }
|
|
126
82
|
const Entity = props => {
|
|
127
83
|
const node = props.node,
|
|
128
|
-
|
|
129
|
-
|
|
84
|
+
setTargetNode = props.setTargetNode,
|
|
85
|
+
targetGraph = props.targetGraph;
|
|
130
86
|
const _node$store$data = node.store.data,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
87
|
+
title = _node$store$data.title,
|
|
88
|
+
name = _node$store$data.name,
|
|
89
|
+
item = _node$store$data.item,
|
|
90
|
+
attrs = _node$store$data.attrs,
|
|
91
|
+
select = _node$store$data.select,
|
|
92
|
+
id = node.id;
|
|
137
93
|
const database = (0, _client().useCurrentAppInfo)();
|
|
138
94
|
const collectionData = (0, _react().useRef)();
|
|
139
95
|
const categoryData = (0, _react().useContext)(_client().CollectionCategroriesContext);
|
|
@@ -143,35 +99,29 @@ const Entity = props => {
|
|
|
143
99
|
});
|
|
144
100
|
const category = item.category;
|
|
145
101
|
const compile = (0, _client().useCompile)();
|
|
146
|
-
|
|
147
102
|
const loadCollections = /*#__PURE__*/function () {
|
|
148
103
|
var _ref = _asyncToGenerator(function* (field) {
|
|
149
104
|
var _targetGraph$collecti;
|
|
150
|
-
|
|
151
105
|
return (_targetGraph$collecti = targetGraph.collections) === null || _targetGraph$collecti === void 0 ? void 0 : _targetGraph$collecti.map(collection => ({
|
|
152
106
|
label: compile(collection.title),
|
|
153
107
|
value: collection.name
|
|
154
108
|
}));
|
|
155
109
|
});
|
|
156
|
-
|
|
157
110
|
return function loadCollections(_x) {
|
|
158
111
|
return _ref.apply(this, arguments);
|
|
159
112
|
};
|
|
160
113
|
}();
|
|
161
|
-
|
|
162
114
|
const loadCategories = /*#__PURE__*/function () {
|
|
163
115
|
var _ref2 = _asyncToGenerator(function* () {
|
|
164
|
-
return categoryData.data.map(item => ({
|
|
116
|
+
return categoryData === null || categoryData === void 0 ? void 0 : categoryData.data.map(item => ({
|
|
165
117
|
label: compile(item.name),
|
|
166
118
|
value: item.id
|
|
167
119
|
}));
|
|
168
120
|
});
|
|
169
|
-
|
|
170
121
|
return function loadCategories() {
|
|
171
122
|
return _ref2.apply(this, arguments);
|
|
172
123
|
};
|
|
173
124
|
}();
|
|
174
|
-
|
|
175
125
|
const portsProps = {
|
|
176
126
|
targetGraph,
|
|
177
127
|
collectionData,
|
|
@@ -279,7 +229,6 @@ const Entity = props => {
|
|
|
279
229
|
}
|
|
280
230
|
})))))), _react().default.createElement(PortsCom, _objectSpread({}, portsProps)));
|
|
281
231
|
};
|
|
282
|
-
|
|
283
232
|
const PortsCom = _react().default.memo(({
|
|
284
233
|
targetGraph,
|
|
285
234
|
collectionData,
|
|
@@ -288,25 +237,21 @@ const PortsCom = _react().default.memo(({
|
|
|
288
237
|
loadCollections
|
|
289
238
|
}) => {
|
|
290
239
|
var _portsData$initPorts, _portsData$morePorts;
|
|
291
|
-
|
|
292
240
|
const _node$store$data2 = node.store.data,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
241
|
+
title = _node$store$data2.title,
|
|
242
|
+
name = _node$store$data2.name,
|
|
243
|
+
item = _node$store$data2.item,
|
|
244
|
+
ports = _node$store$data2.ports,
|
|
245
|
+
data = _node$store$data2.data,
|
|
246
|
+
sourcePort = _node$store$data2.sourcePort,
|
|
247
|
+
associated = _node$store$data2.associated,
|
|
248
|
+
targetPort = _node$store$data2.targetPort;
|
|
302
249
|
const _useState = (0, _react().useState)(false),
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
250
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
251
|
+
collapse = _useState2[0],
|
|
252
|
+
setCollapse = _useState2[1];
|
|
307
253
|
const _useGCMTranslation = (0, _utils.useGCMTranslation)(),
|
|
308
|
-
|
|
309
|
-
|
|
254
|
+
t = _useGCMTranslation.t;
|
|
310
255
|
const compile = (0, _client().useCompile)();
|
|
311
256
|
const portsData = (0, _lodash().groupBy)(ports.items, v => {
|
|
312
257
|
if (v.isForeignKey || v.primaryKey || ['obo', 'oho', 'o2o', 'o2m', 'm2o', 'm2m', 'linkTo', 'id'].includes(v.interface)) {
|
|
@@ -315,17 +260,15 @@ const PortsCom = _react().default.memo(({
|
|
|
315
260
|
return 'morePorts';
|
|
316
261
|
}
|
|
317
262
|
});
|
|
318
|
-
|
|
319
263
|
const useNewId = prefix => {
|
|
320
264
|
return `${prefix || ''}${(0, _shared().uid)()}`;
|
|
321
265
|
};
|
|
322
|
-
|
|
323
266
|
const CollectionConten = data => {
|
|
324
267
|
const type = data.type,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
268
|
+
name = data.name,
|
|
269
|
+
primaryKey = data.primaryKey,
|
|
270
|
+
allowNull = data.allowNull,
|
|
271
|
+
autoIncrement = data.autoIncrement;
|
|
329
272
|
return _react().default.createElement("div", {
|
|
330
273
|
className: (0, _css().cx)(_style.collectiionPopoverClass)
|
|
331
274
|
}, _react().default.createElement("div", {
|
|
@@ -342,7 +285,6 @@ const PortsCom = _react().default.memo(({
|
|
|
342
285
|
color: "purple"
|
|
343
286
|
}, "AUTOINCREMENT")));
|
|
344
287
|
};
|
|
345
|
-
|
|
346
288
|
const typeColor = v => {
|
|
347
289
|
if (v.isForeignKey || v.primaryKey || v.interface === 'id') {
|
|
348
290
|
return 'red';
|
|
@@ -350,7 +292,6 @@ const PortsCom = _react().default.memo(({
|
|
|
350
292
|
return 'orange';
|
|
351
293
|
}
|
|
352
294
|
};
|
|
353
|
-
|
|
354
295
|
const OperationButton = ({
|
|
355
296
|
property
|
|
356
297
|
}) => {
|
|
@@ -489,24 +430,18 @@ const PortsCom = _react().default.memo(({
|
|
|
489
430
|
}
|
|
490
431
|
}))));
|
|
491
432
|
};
|
|
492
|
-
|
|
493
433
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
434
|
+
getInterface = _useCollectionManager.getInterface;
|
|
435
|
+
// 获取当前字段列表
|
|
497
436
|
const useCurrentFields = () => {
|
|
498
437
|
const record = (0, _client().useRecord)();
|
|
499
|
-
|
|
500
438
|
const _useCollectionManager2 = (0, _client().useCollectionManager)(),
|
|
501
|
-
|
|
502
|
-
|
|
439
|
+
getCollectionFields = _useCollectionManager2.getCollectionFields;
|
|
503
440
|
const fields = getCollectionFields(record.collectionName || record.name);
|
|
504
441
|
return fields;
|
|
505
442
|
};
|
|
506
|
-
|
|
507
443
|
const _handelOpenPorts = isCollapse => {
|
|
508
444
|
var _targetGraph$getCellB;
|
|
509
|
-
|
|
510
445
|
(_targetGraph$getCellB = targetGraph.getCellById(item.name)) === null || _targetGraph$getCellB === void 0 ? void 0 : _targetGraph$getCellB.toFront();
|
|
511
446
|
setCollapse(isCollapse);
|
|
512
447
|
const collapseNodes = targetGraph.collapseNodes || [];
|
|
@@ -518,13 +453,11 @@ const PortsCom = _react().default.memo(({
|
|
|
518
453
|
collapse: true
|
|
519
454
|
});
|
|
520
455
|
};
|
|
521
|
-
|
|
522
456
|
const isCollapse = collapse && (data === null || data === void 0 ? void 0 : data.collapse);
|
|
523
457
|
return _react().default.createElement("div", {
|
|
524
458
|
className: "body"
|
|
525
459
|
}, (_portsData$initPorts = portsData['initPorts']) === null || _portsData$initPorts === void 0 ? void 0 : _portsData$initPorts.map(property => {
|
|
526
460
|
var _property$uiSchema, _getInterface, _property$uiSchema2, _getInterface2;
|
|
527
|
-
|
|
528
461
|
return property.uiSchema && _react().default.createElement(_antd().Popover, {
|
|
529
462
|
content: CollectionConten(property),
|
|
530
463
|
getPopupContainer: () => {
|
|
@@ -560,7 +493,6 @@ const PortsCom = _react().default.memo(({
|
|
|
560
493
|
className: "morePorts"
|
|
561
494
|
}, isCollapse && ((_portsData$morePorts = portsData['morePorts']) === null || _portsData$morePorts === void 0 ? void 0 : _portsData$morePorts.map(property => {
|
|
562
495
|
var _property$uiSchema3, _getInterface3, _property$uiSchema4, _getInterface4;
|
|
563
|
-
|
|
564
496
|
return property.uiSchema && _react().default.createElement(_antd().Popover, {
|
|
565
497
|
content: CollectionConten(property),
|
|
566
498
|
getPopupContainer: () => {
|
|
@@ -618,6 +550,5 @@ const PortsCom = _react().default.memo(({
|
|
|
618
550
|
key: "all"
|
|
619
551
|
}, t('All Fields'))]));
|
|
620
552
|
});
|
|
621
|
-
|
|
622
553
|
var _default = Entity;
|
|
623
554
|
exports.default = _default;
|
|
@@ -4,80 +4,56 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.FieldSummary = void 0;
|
|
7
|
-
|
|
8
7
|
function _css() {
|
|
9
8
|
const data = require("@emotion/css");
|
|
10
|
-
|
|
11
9
|
_css = function _css() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _react() {
|
|
19
15
|
const data = require("@formily/react");
|
|
20
|
-
|
|
21
16
|
_react = function _react() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _antd() {
|
|
29
22
|
const data = require("antd");
|
|
30
|
-
|
|
31
23
|
_antd = function _antd() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _react2() {
|
|
39
29
|
const data = _interopRequireDefault(require("react"));
|
|
40
|
-
|
|
41
30
|
_react2 = function _react2() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _reactI18next() {
|
|
49
36
|
const data = require("react-i18next");
|
|
50
|
-
|
|
51
37
|
_reactI18next = function _reactI18next() {
|
|
52
38
|
return data;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return data;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
function _client() {
|
|
59
43
|
const data = require("@nocobase/client");
|
|
60
|
-
|
|
61
44
|
_client = function _client() {
|
|
62
45
|
return data;
|
|
63
46
|
};
|
|
64
|
-
|
|
65
47
|
return data;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
49
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
69
|
-
|
|
70
50
|
const FieldSummary = (0, _react().observer)(props => {
|
|
71
51
|
const schemaKey = props.schemaKey;
|
|
72
|
-
|
|
73
52
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
getInterface = _useCollectionManager.getInterface;
|
|
76
54
|
const compile = (0, _client().useCompile)();
|
|
77
|
-
|
|
78
55
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
79
|
-
|
|
80
|
-
|
|
56
|
+
t = _useTranslation.t;
|
|
81
57
|
const schema = getInterface(schemaKey);
|
|
82
58
|
if (!schema) return null;
|
|
83
59
|
return _react2().default.createElement("div", {
|
|
@@ -4,67 +4,48 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.OverrideFieldAction = void 0;
|
|
7
|
-
|
|
8
7
|
function _icons() {
|
|
9
8
|
const data = require("@ant-design/icons");
|
|
10
|
-
|
|
11
9
|
_icons = function _icons() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _client() {
|
|
19
15
|
const data = require("@nocobase/client");
|
|
20
|
-
|
|
21
16
|
_client = function _client() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _react() {
|
|
29
22
|
const data = _interopRequireDefault(require("react"));
|
|
30
|
-
|
|
31
23
|
_react = function _react() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
var _actionHooks = require("../action-hooks");
|
|
39
|
-
|
|
40
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
-
|
|
42
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; }
|
|
43
|
-
|
|
44
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; }
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
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); }
|
|
48
35
|
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); } }
|
|
49
|
-
|
|
50
36
|
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); }); }; }
|
|
51
|
-
|
|
52
37
|
const _useOverridingCollectionField = record => {
|
|
53
38
|
const collectionName = record.targetCollection;
|
|
54
|
-
|
|
55
39
|
const _useCreateAction = (0, _actionHooks.useCreateAction)(collectionName),
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
run = _useCreateAction.run;
|
|
58
41
|
return {
|
|
59
42
|
run() {
|
|
60
43
|
return _asyncToGenerator(function* () {
|
|
61
44
|
yield run();
|
|
62
45
|
})();
|
|
63
46
|
}
|
|
64
|
-
|
|
65
47
|
};
|
|
66
48
|
};
|
|
67
|
-
|
|
68
49
|
const OverrideFieldAction = ({
|
|
69
50
|
item: record
|
|
70
51
|
}) => {
|
|
@@ -79,5 +60,4 @@ const OverrideFieldAction = ({
|
|
|
79
60
|
className: "btn-override"
|
|
80
61
|
}));
|
|
81
62
|
};
|
|
82
|
-
|
|
83
63
|
exports.OverrideFieldAction = OverrideFieldAction;
|
|
@@ -4,45 +4,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ViewFieldAction = void 0;
|
|
7
|
-
|
|
8
7
|
function _icons() {
|
|
9
8
|
const data = require("@ant-design/icons");
|
|
10
|
-
|
|
11
9
|
_icons = function _icons() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _client() {
|
|
19
15
|
const data = require("@nocobase/client");
|
|
20
|
-
|
|
21
16
|
_client = function _client() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _react() {
|
|
29
22
|
const data = _interopRequireDefault(require("react"));
|
|
30
|
-
|
|
31
23
|
_react = function _react() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
|
-
|
|
40
29
|
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; }
|
|
41
|
-
|
|
42
30
|
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; }
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
31
|
+
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; }
|
|
32
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
33
|
+
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); }
|
|
46
34
|
const ViewFieldAction = ({
|
|
47
35
|
item: record
|
|
48
36
|
}) => {
|
|
@@ -53,5 +41,4 @@ const ViewFieldAction = ({
|
|
|
53
41
|
className: "btn-view"
|
|
54
42
|
}));
|
|
55
43
|
};
|
|
56
|
-
|
|
57
44
|
exports.ViewFieldAction = ViewFieldAction;
|
|
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SimpleNodeView = void 0;
|
|
7
|
-
|
|
8
7
|
function _x() {
|
|
9
8
|
const data = require("@antv/x6");
|
|
10
|
-
|
|
11
9
|
_x = function _x() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
class SimpleNodeView extends _x().NodeView {
|
|
19
15
|
renderMarkup() {
|
|
20
16
|
return this.renderJSONMarkup({
|
|
@@ -22,7 +18,6 @@ class SimpleNodeView extends _x().NodeView {
|
|
|
22
18
|
selector: 'body'
|
|
23
19
|
});
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
update() {
|
|
27
22
|
const attrs = this.cell.getAttrs();
|
|
28
23
|
const fill = attrs.hightLight ? '#1890ff' : 'gray';
|
|
@@ -34,7 +29,5 @@ class SimpleNodeView extends _x().NodeView {
|
|
|
34
29
|
}
|
|
35
30
|
});
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
}
|
|
39
|
-
|
|
40
33
|
exports.SimpleNodeView = SimpleNodeView;
|
package/lib/client/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var _default = {
|
|
|
12
12
|
'Create Collection': 'Create Collection',
|
|
13
13
|
'All Fields': 'All Fields',
|
|
14
14
|
'Association Fields': 'Association Fields',
|
|
15
|
+
'Optional fields': 'Optional fields',
|
|
15
16
|
'All relationships': 'All relationships',
|
|
16
17
|
'Entity relationship only': 'Entity relationship only',
|
|
17
18
|
'Inheritance relationship only': 'Inheritance relationship only',
|