@nocobase/plugin-graph-collection-manager 0.9.1-alpha.2 → 0.9.2-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/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,95 +4,66 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useValuesFromRecord = exports.useUpdateFieldAction = exports.useUpdateCollectionActionAndRefreshCM = exports.useDestroyFieldActionAndRefreshCM = exports.useDestroyActionAndRefreshCM = exports.useCreateActionAndRefreshCM = exports.useCreateAction = exports.useCancelAction = exports.useAsyncDataSource = exports.SourceCollection = void 0;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = require("@formily/react");
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _reactive() {
|
|
19
15
|
const data = require("@formily/reactive");
|
|
20
|
-
|
|
21
16
|
_reactive = function _reactive() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _client() {
|
|
29
22
|
const data = require("@nocobase/client");
|
|
30
|
-
|
|
31
23
|
_client = function _client() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _antd() {
|
|
39
29
|
const data = require("antd");
|
|
40
|
-
|
|
41
30
|
_antd = function _antd() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _omit() {
|
|
49
36
|
const data = _interopRequireDefault(require("lodash/omit"));
|
|
50
|
-
|
|
51
37
|
_omit = function _omit() {
|
|
52
38
|
return data;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return data;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
function _react2() {
|
|
59
43
|
const data = _interopRequireWildcard(require("react"));
|
|
60
|
-
|
|
61
44
|
_react2 = function _react2() {
|
|
62
45
|
return data;
|
|
63
46
|
};
|
|
64
|
-
|
|
65
47
|
return data;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
49
|
function _reactI18next() {
|
|
69
50
|
const data = require("react-i18next");
|
|
70
|
-
|
|
71
51
|
_reactI18next = function _reactI18next() {
|
|
72
52
|
return data;
|
|
73
53
|
};
|
|
74
|
-
|
|
75
54
|
return data;
|
|
76
55
|
}
|
|
77
|
-
|
|
78
56
|
var _CollectionNodeProvder = require("./components/CollectionNodeProvder");
|
|
79
|
-
|
|
80
57
|
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); }
|
|
81
|
-
|
|
82
58
|
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; }
|
|
83
|
-
|
|
84
59
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
85
|
-
|
|
86
60
|
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); } }
|
|
87
|
-
|
|
88
61
|
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); }); }; }
|
|
89
|
-
|
|
90
62
|
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; }
|
|
91
|
-
|
|
92
63
|
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; }
|
|
93
|
-
|
|
94
|
-
function
|
|
95
|
-
|
|
64
|
+
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; }
|
|
65
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
66
|
+
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); }
|
|
96
67
|
const useValuesFromRecord = (options, data) => {
|
|
97
68
|
const result = (0, _client().useRequest)(() => Promise.resolve({
|
|
98
69
|
data
|
|
@@ -107,12 +78,10 @@ const useValuesFromRecord = (options, data) => {
|
|
|
107
78
|
}, [ctx.visible]);
|
|
108
79
|
return result;
|
|
109
80
|
};
|
|
110
|
-
|
|
111
81
|
exports.useValuesFromRecord = useValuesFromRecord;
|
|
112
82
|
const SourceCollection = (0, _react().observer)(() => {
|
|
113
83
|
const _useContext = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
114
|
-
|
|
115
|
-
|
|
84
|
+
record = _useContext.record;
|
|
116
85
|
const compile = (0, _client().useCompile)();
|
|
117
86
|
return _react2().default.createElement("div", null, _react2().default.createElement(_antd().Select, {
|
|
118
87
|
disabled: true,
|
|
@@ -124,7 +93,6 @@ const SourceCollection = (0, _react().observer)(() => {
|
|
|
124
93
|
}));
|
|
125
94
|
});
|
|
126
95
|
exports.SourceCollection = SourceCollection;
|
|
127
|
-
|
|
128
96
|
const useCancelAction = () => {
|
|
129
97
|
const form = (0, _react().useForm)();
|
|
130
98
|
const ctx = (0, _client().useActionContext)();
|
|
@@ -135,20 +103,15 @@ const useCancelAction = () => {
|
|
|
135
103
|
form.reset();
|
|
136
104
|
})();
|
|
137
105
|
}
|
|
138
|
-
|
|
139
106
|
};
|
|
140
107
|
};
|
|
141
|
-
|
|
142
108
|
exports.useCancelAction = useCancelAction;
|
|
143
|
-
|
|
144
109
|
const useCreateActionAndRefreshCM = setTargetNode => {
|
|
145
110
|
const form = (0, _react().useForm)();
|
|
146
111
|
const api = (0, _client().useAPIClient)();
|
|
147
112
|
const ctx = (0, _client().useActionContext)();
|
|
148
|
-
|
|
149
113
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
150
|
-
|
|
151
|
-
|
|
114
|
+
refreshCM = _useCollectionManager.refreshCM;
|
|
152
115
|
return {
|
|
153
116
|
run() {
|
|
154
117
|
return _asyncToGenerator(function* () {
|
|
@@ -162,27 +125,20 @@ const useCreateActionAndRefreshCM = setTargetNode => {
|
|
|
162
125
|
yield refreshCM();
|
|
163
126
|
})();
|
|
164
127
|
}
|
|
165
|
-
|
|
166
128
|
};
|
|
167
129
|
};
|
|
168
|
-
|
|
169
130
|
exports.useCreateActionAndRefreshCM = useCreateActionAndRefreshCM;
|
|
170
|
-
|
|
171
131
|
const useCreateAction = (collectionName, targetId) => {
|
|
172
132
|
const form = (0, _react().useForm)();
|
|
173
133
|
const api = (0, _client().useAPIClient)();
|
|
174
134
|
const ctx = (0, _client().useActionContext)();
|
|
175
|
-
|
|
176
135
|
const _useCollectionManager2 = (0, _client().useCollectionManager)(),
|
|
177
|
-
|
|
178
|
-
|
|
136
|
+
refreshCM = _useCollectionManager2.refreshCM;
|
|
179
137
|
const _useContext2 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
138
|
+
positionTargetNode = _useContext2.positionTargetNode,
|
|
139
|
+
openPorts = _useContext2.openPorts;
|
|
183
140
|
const _useCollectionFieldFo = (0, _client().useCollectionFieldFormValues)(),
|
|
184
|
-
|
|
185
|
-
|
|
141
|
+
getValues = _useCollectionFieldFo.getValues;
|
|
186
142
|
return {
|
|
187
143
|
run() {
|
|
188
144
|
return _asyncToGenerator(function* () {
|
|
@@ -190,12 +146,10 @@ const useCreateAction = (collectionName, targetId) => {
|
|
|
190
146
|
const values = getValues();
|
|
191
147
|
const formValues = (0, _omit().default)(values, ['key', 'uiSchemaUid', 'collectionName', 'autoCreateReverseField', 'uiSchema.x-uid', 'reverseField.key', 'reverseField.uiSchemaUid']);
|
|
192
148
|
const isOpenPorts = !['obo', 'oho', 'o2o', 'o2m', 'm2o', 'm2m', 'linkTo', 'id'].includes(values.interface);
|
|
193
|
-
|
|
194
149
|
const _yield$api$resource$c = yield api.resource('collections.fields', collectionName).create({
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
150
|
+
values: formValues
|
|
151
|
+
}),
|
|
152
|
+
data = _yield$api$resource$c.data.data;
|
|
199
153
|
targetId && (yield api.resource('fields').move({
|
|
200
154
|
sourceId: data.key,
|
|
201
155
|
targetId,
|
|
@@ -209,45 +163,35 @@ const useCreateAction = (collectionName, targetId) => {
|
|
|
209
163
|
yield refreshCM();
|
|
210
164
|
})();
|
|
211
165
|
}
|
|
212
|
-
|
|
213
166
|
};
|
|
214
167
|
};
|
|
215
|
-
|
|
216
168
|
exports.useCreateAction = useCreateAction;
|
|
217
|
-
|
|
218
169
|
const useUpdateFieldAction = ({
|
|
219
170
|
collectionName,
|
|
220
171
|
name,
|
|
221
172
|
key
|
|
222
173
|
}) => {
|
|
223
174
|
const _useCollectionManager3 = (0, _client().useCollectionManager)(),
|
|
224
|
-
|
|
225
|
-
|
|
175
|
+
refreshCM = _useCollectionManager3.refreshCM;
|
|
226
176
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
227
|
-
|
|
228
|
-
|
|
177
|
+
t = _useTranslation.t;
|
|
229
178
|
const form = (0, _react().useForm)();
|
|
230
179
|
const ctx = (0, _client().useActionContext)();
|
|
231
180
|
const api = (0, _client().useAPIClient)();
|
|
232
|
-
|
|
233
181
|
const _useContext3 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
182
|
+
positionTargetNode = _useContext3.positionTargetNode,
|
|
183
|
+
node = _useContext3.node;
|
|
237
184
|
return {
|
|
238
185
|
run() {
|
|
239
186
|
return _asyncToGenerator(function* () {
|
|
240
187
|
var _form$values;
|
|
241
|
-
|
|
242
188
|
yield form.submit();
|
|
243
189
|
yield api.resource('collections.fields', collectionName).update({
|
|
244
190
|
filterByTk: name,
|
|
245
191
|
values: form.values
|
|
246
192
|
});
|
|
247
193
|
ctx.setVisible(false);
|
|
248
|
-
|
|
249
194
|
_antd().message.success(t('Saved successfully'));
|
|
250
|
-
|
|
251
195
|
positionTargetNode();
|
|
252
196
|
refreshCM();
|
|
253
197
|
node.setPortProp(key, 'uiSchema', {
|
|
@@ -256,27 +200,20 @@ const useUpdateFieldAction = ({
|
|
|
256
200
|
yield form.reset();
|
|
257
201
|
})();
|
|
258
202
|
}
|
|
259
|
-
|
|
260
203
|
};
|
|
261
204
|
};
|
|
262
|
-
|
|
263
205
|
exports.useUpdateFieldAction = useUpdateFieldAction;
|
|
264
|
-
|
|
265
206
|
const useUpdateCollectionActionAndRefreshCM = () => {
|
|
266
207
|
const _useTranslation2 = (0, _reactI18next().useTranslation)(),
|
|
267
|
-
|
|
268
|
-
|
|
208
|
+
t = _useTranslation2.t;
|
|
269
209
|
const form = (0, _react().useForm)();
|
|
270
210
|
const ctx = (0, _client().useActionContext)();
|
|
271
211
|
const name = form.values.name;
|
|
272
212
|
const api = (0, _client().useAPIClient)();
|
|
273
|
-
|
|
274
213
|
const _useCollectionManager4 = (0, _client().useCollectionManager)(),
|
|
275
|
-
|
|
276
|
-
|
|
214
|
+
refreshCM = _useCollectionManager4.refreshCM;
|
|
277
215
|
const _useContext4 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
278
|
-
|
|
279
|
-
|
|
216
|
+
positionTargetNode = _useContext4.positionTargetNode;
|
|
280
217
|
return {
|
|
281
218
|
run() {
|
|
282
219
|
return _asyncToGenerator(function* () {
|
|
@@ -286,20 +223,15 @@ const useUpdateCollectionActionAndRefreshCM = () => {
|
|
|
286
223
|
values: _objectSpread({}, (0, _omit().default)(form.values, ['fields']))
|
|
287
224
|
});
|
|
288
225
|
ctx.setVisible(false);
|
|
289
|
-
|
|
290
226
|
_antd().message.success(t('Saved successfully'));
|
|
291
|
-
|
|
292
227
|
yield form.reset();
|
|
293
228
|
positionTargetNode();
|
|
294
229
|
refreshCM();
|
|
295
230
|
})();
|
|
296
231
|
}
|
|
297
|
-
|
|
298
232
|
};
|
|
299
233
|
};
|
|
300
|
-
|
|
301
234
|
exports.useUpdateCollectionActionAndRefreshCM = useUpdateCollectionActionAndRefreshCM;
|
|
302
|
-
|
|
303
235
|
const useDestroyAction = name => {
|
|
304
236
|
const api = (0, _client().useAPIClient)();
|
|
305
237
|
return {
|
|
@@ -315,22 +247,16 @@ const useDestroyAction = name => {
|
|
|
315
247
|
});
|
|
316
248
|
})();
|
|
317
249
|
}
|
|
318
|
-
|
|
319
250
|
};
|
|
320
251
|
};
|
|
321
|
-
|
|
322
252
|
const useDestroyActionAndRefreshCM = props => {
|
|
323
253
|
const name = props.name;
|
|
324
|
-
|
|
325
254
|
const _useDestroyAction = useDestroyAction(name),
|
|
326
|
-
|
|
327
|
-
|
|
255
|
+
run = _useDestroyAction.run;
|
|
328
256
|
const _useCollectionManager5 = (0, _client().useCollectionManager)(),
|
|
329
|
-
|
|
330
|
-
|
|
257
|
+
refreshCM = _useCollectionManager5.refreshCM;
|
|
331
258
|
const _useContext5 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
332
|
-
|
|
333
|
-
|
|
259
|
+
positionTargetNode = _useContext5.positionTargetNode;
|
|
334
260
|
return {
|
|
335
261
|
run() {
|
|
336
262
|
return _asyncToGenerator(function* () {
|
|
@@ -339,18 +265,13 @@ const useDestroyActionAndRefreshCM = props => {
|
|
|
339
265
|
yield refreshCM();
|
|
340
266
|
})();
|
|
341
267
|
}
|
|
342
|
-
|
|
343
268
|
};
|
|
344
269
|
};
|
|
345
|
-
|
|
346
270
|
exports.useDestroyActionAndRefreshCM = useDestroyActionAndRefreshCM;
|
|
347
|
-
|
|
348
271
|
const useDestroyFieldAction = (collectionName, name) => {
|
|
349
272
|
const api = (0, _client().useAPIClient)();
|
|
350
|
-
|
|
351
273
|
const _useContext6 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
352
|
-
|
|
353
|
-
|
|
274
|
+
positionTargetNode = _useContext6.positionTargetNode;
|
|
354
275
|
return {
|
|
355
276
|
run() {
|
|
356
277
|
return _asyncToGenerator(function* () {
|
|
@@ -360,20 +281,15 @@ const useDestroyFieldAction = (collectionName, name) => {
|
|
|
360
281
|
positionTargetNode();
|
|
361
282
|
})();
|
|
362
283
|
}
|
|
363
|
-
|
|
364
284
|
};
|
|
365
285
|
};
|
|
366
|
-
|
|
367
286
|
const useDestroyFieldActionAndRefreshCM = props => {
|
|
368
287
|
const collectionName = props.collectionName,
|
|
369
|
-
|
|
370
|
-
|
|
288
|
+
name = props.name;
|
|
371
289
|
const _useCollectionManager6 = (0, _client().useCollectionManager)(),
|
|
372
|
-
|
|
373
|
-
|
|
290
|
+
refreshCM = _useCollectionManager6.refreshCM;
|
|
374
291
|
const _useDestroyFieldActio = useDestroyFieldAction(collectionName, name),
|
|
375
|
-
|
|
376
|
-
|
|
292
|
+
run = _useDestroyFieldActio.run;
|
|
377
293
|
return {
|
|
378
294
|
run() {
|
|
379
295
|
return _asyncToGenerator(function* () {
|
|
@@ -381,12 +297,9 @@ const useDestroyFieldActionAndRefreshCM = props => {
|
|
|
381
297
|
yield refreshCM();
|
|
382
298
|
})();
|
|
383
299
|
}
|
|
384
|
-
|
|
385
300
|
};
|
|
386
301
|
};
|
|
387
|
-
|
|
388
302
|
exports.useDestroyFieldActionAndRefreshCM = useDestroyFieldActionAndRefreshCM;
|
|
389
|
-
|
|
390
303
|
const useAsyncDataSource = service => {
|
|
391
304
|
return (field, {
|
|
392
305
|
targetScope
|
|
@@ -398,5 +311,4 @@ const useAsyncDataSource = service => {
|
|
|
398
311
|
}));
|
|
399
312
|
};
|
|
400
313
|
};
|
|
401
|
-
|
|
402
314
|
exports.useAsyncDataSource = useAsyncDataSource;
|
|
@@ -4,51 +4,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.AddCollectionAction = 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 _antd() {
|
|
39
29
|
const data = require("antd");
|
|
40
|
-
|
|
41
30
|
_antd = function _antd() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
var _actionHooks = require("../action-hooks");
|
|
49
|
-
|
|
50
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
|
-
|
|
52
37
|
const AddCollectionAction = ({
|
|
53
38
|
item: record
|
|
54
39
|
}) => {
|
|
@@ -57,9 +42,9 @@ const AddCollectionAction = ({
|
|
|
57
42
|
align: {
|
|
58
43
|
overflow: {
|
|
59
44
|
adjustY: false // 关闭溢出位置调整
|
|
60
|
-
|
|
61
45
|
}
|
|
62
46
|
},
|
|
47
|
+
|
|
63
48
|
item: record,
|
|
64
49
|
scope: {
|
|
65
50
|
useCancelAction: _actionHooks.useCancelAction
|
|
@@ -69,5 +54,4 @@ const AddCollectionAction = ({
|
|
|
69
54
|
type: "primary"
|
|
70
55
|
}, _react().default.createElement(_icons().PlusOutlined, null)));
|
|
71
56
|
};
|
|
72
|
-
|
|
73
57
|
exports.AddCollectionAction = AddCollectionAction;
|
|
@@ -4,61 +4,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.AddFieldAction = 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 _useCreateCollectionField = record => {
|
|
47
33
|
const title = record.collectionName;
|
|
48
|
-
|
|
49
34
|
const _useCreateAction = (0, _actionHooks.useCreateAction)(title, record.key),
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
run = _useCreateAction.run;
|
|
52
36
|
return {
|
|
53
37
|
run() {
|
|
54
38
|
return _asyncToGenerator(function* () {
|
|
55
39
|
yield run();
|
|
56
40
|
})();
|
|
57
41
|
}
|
|
58
|
-
|
|
59
42
|
};
|
|
60
43
|
};
|
|
61
|
-
|
|
62
44
|
const AddFieldAction = ({
|
|
63
45
|
item: record
|
|
64
46
|
}) => {
|
|
@@ -67,9 +49,9 @@ const AddFieldAction = ({
|
|
|
67
49
|
align: {
|
|
68
50
|
overflow: {
|
|
69
51
|
adjustY: false // 关闭溢出位置调整
|
|
70
|
-
|
|
71
52
|
}
|
|
72
53
|
},
|
|
54
|
+
|
|
73
55
|
item: record,
|
|
74
56
|
scope: {
|
|
75
57
|
useCancelAction: _actionHooks.useCancelAction,
|
|
@@ -81,5 +63,4 @@ const AddFieldAction = ({
|
|
|
81
63
|
id: 'graph_btn_add_field'
|
|
82
64
|
}));
|
|
83
65
|
};
|
|
84
|
-
|
|
85
66
|
exports.AddFieldAction = AddFieldAction;
|
|
@@ -4,29 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GraphCollectionContext = exports.CollectionNodeProvder = void 0;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireWildcard(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
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); }
|
|
19
|
-
|
|
20
15
|
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; }
|
|
21
|
-
|
|
22
16
|
const GraphCollectionContext = (0, _react().createContext)(null);
|
|
23
17
|
exports.GraphCollectionContext = GraphCollectionContext;
|
|
24
|
-
|
|
25
18
|
const CollectionNodeProvder = props => {
|
|
26
19
|
const record = props.record,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
setTargetNode = props.setTargetNode,
|
|
21
|
+
node = props.node,
|
|
22
|
+
handelOpenPorts = props.handelOpenPorts;
|
|
30
23
|
return _react().default.createElement(GraphCollectionContext.Provider, {
|
|
31
24
|
value: {
|
|
32
25
|
node,
|
|
@@ -38,5 +31,4 @@ const CollectionNodeProvder = props => {
|
|
|
38
31
|
}
|
|
39
32
|
}, props.children);
|
|
40
33
|
};
|
|
41
|
-
|
|
42
34
|
exports.CollectionNodeProvder = CollectionNodeProvder;
|
|
@@ -4,51 +4,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.EditCollectionAction = 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 _css() {
|
|
39
29
|
const data = require("@emotion/css");
|
|
40
|
-
|
|
41
30
|
_css = function _css() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
var _actionHooks = require("../action-hooks");
|
|
49
|
-
|
|
50
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
|
-
|
|
52
37
|
const EditCollectionAction = ({
|
|
53
38
|
item: record
|
|
54
39
|
}) => {
|
|
@@ -74,5 +59,4 @@ const EditCollectionAction = ({
|
|
|
74
59
|
`
|
|
75
60
|
}));
|
|
76
61
|
};
|
|
77
|
-
|
|
78
62
|
exports.EditCollectionAction = EditCollectionAction;
|