@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,318 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useValuesFromRecord = exports.useUpdateFieldAction = exports.useUpdateCollectionActionAndRefreshCM = exports.useDestroyFieldActionAndRefreshCM = exports.useDestroyActionAndRefreshCM = exports.useCreateActionAndRefreshCM = exports.useCreateAction = exports.useCancelAction = exports.useAsyncDataSource = exports.SourceCollection = void 0;
|
|
7
|
-
function _react() {
|
|
8
|
-
const data = require("@formily/react");
|
|
9
|
-
_react = function _react() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _reactive() {
|
|
15
|
-
const data = require("@formily/reactive");
|
|
16
|
-
_reactive = function _reactive() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _client() {
|
|
22
|
-
const data = require("@nocobase/client");
|
|
23
|
-
_client = function _client() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _client2() {
|
|
29
|
-
const data = require("@nocobase/utils/client");
|
|
30
|
-
_client2 = function _client2() {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
function _antd() {
|
|
36
|
-
const data = require("antd");
|
|
37
|
-
_antd = function _antd() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
function _react2() {
|
|
43
|
-
const data = _interopRequireWildcard(require("react"));
|
|
44
|
-
_react2 = function _react2() {
|
|
45
|
-
return data;
|
|
46
|
-
};
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
function _reactI18next() {
|
|
50
|
-
const data = require("react-i18next");
|
|
51
|
-
_reactI18next = function _reactI18next() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
return data;
|
|
55
|
-
}
|
|
56
|
-
var _CollectionNodeProvder = require("./components/CollectionNodeProvder");
|
|
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); }
|
|
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; }
|
|
59
|
-
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); } }
|
|
60
|
-
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); }); }; }
|
|
61
|
-
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; }
|
|
62
|
-
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; }
|
|
63
|
-
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; }
|
|
64
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
65
|
-
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); }
|
|
66
|
-
const useValuesFromRecord = (options, data) => {
|
|
67
|
-
const result = (0, _client().useRequest)(() => Promise.resolve({
|
|
68
|
-
data
|
|
69
|
-
}), _objectSpread(_objectSpread({}, options), {}, {
|
|
70
|
-
manual: true
|
|
71
|
-
}));
|
|
72
|
-
const ctx = (0, _client().useActionContext)();
|
|
73
|
-
(0, _react2().useEffect)(() => {
|
|
74
|
-
if (ctx.visible) {
|
|
75
|
-
result.run();
|
|
76
|
-
}
|
|
77
|
-
}, [ctx.visible]);
|
|
78
|
-
return result;
|
|
79
|
-
};
|
|
80
|
-
exports.useValuesFromRecord = useValuesFromRecord;
|
|
81
|
-
const SourceCollection = (0, _react().observer)(() => {
|
|
82
|
-
const _useContext = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
83
|
-
record = _useContext.record;
|
|
84
|
-
const compile = (0, _client().useCompile)();
|
|
85
|
-
return _react2().default.createElement("div", null, _react2().default.createElement(_antd().Select, {
|
|
86
|
-
popupMatchSelectWidth: false,
|
|
87
|
-
disabled: true,
|
|
88
|
-
value: record.name,
|
|
89
|
-
options: [{
|
|
90
|
-
value: record.name,
|
|
91
|
-
label: compile(record.title)
|
|
92
|
-
}]
|
|
93
|
-
}));
|
|
94
|
-
}, {
|
|
95
|
-
displayName: 'SourceCollection'
|
|
96
|
-
});
|
|
97
|
-
exports.SourceCollection = SourceCollection;
|
|
98
|
-
const useCancelAction = () => {
|
|
99
|
-
const form = (0, _react().useForm)();
|
|
100
|
-
const ctx = (0, _client().useActionContext)();
|
|
101
|
-
return {
|
|
102
|
-
run() {
|
|
103
|
-
return _asyncToGenerator(function* () {
|
|
104
|
-
ctx.setVisible(false);
|
|
105
|
-
form.reset();
|
|
106
|
-
})();
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
exports.useCancelAction = useCancelAction;
|
|
111
|
-
const useCreateActionAndRefreshCM = setTargetNode => {
|
|
112
|
-
const form = (0, _react().useForm)();
|
|
113
|
-
const api = (0, _client().useAPIClient)();
|
|
114
|
-
const ctx = (0, _client().useActionContext)();
|
|
115
|
-
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
116
|
-
refreshCM = _useCollectionManager.refreshCM;
|
|
117
|
-
return {
|
|
118
|
-
run() {
|
|
119
|
-
return _asyncToGenerator(function* () {
|
|
120
|
-
yield form.submit();
|
|
121
|
-
yield api.resource('collections').create({
|
|
122
|
-
values: form.values
|
|
123
|
-
});
|
|
124
|
-
ctx.setVisible(false);
|
|
125
|
-
yield form.reset();
|
|
126
|
-
setTargetNode('last');
|
|
127
|
-
yield refreshCM();
|
|
128
|
-
})();
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
exports.useCreateActionAndRefreshCM = useCreateActionAndRefreshCM;
|
|
133
|
-
const useCreateAction = (collectionName, targetId) => {
|
|
134
|
-
const form = (0, _react().useForm)();
|
|
135
|
-
const api = (0, _client().useAPIClient)();
|
|
136
|
-
const ctx = (0, _client().useActionContext)();
|
|
137
|
-
const _useCollectionManager2 = (0, _client().useCollectionManager)(),
|
|
138
|
-
refreshCM = _useCollectionManager2.refreshCM;
|
|
139
|
-
const _useContext2 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
140
|
-
positionTargetNode = _useContext2.positionTargetNode,
|
|
141
|
-
openPorts = _useContext2.openPorts;
|
|
142
|
-
const _useCollectionFieldFo = (0, _client().useCollectionFieldFormValues)(),
|
|
143
|
-
getValues = _useCollectionFieldFo.getValues;
|
|
144
|
-
return {
|
|
145
|
-
run() {
|
|
146
|
-
return _asyncToGenerator(function* () {
|
|
147
|
-
yield form.submit();
|
|
148
|
-
const values = getValues();
|
|
149
|
-
const formValues = _client2().lodash.omit(values, ['key', 'uiSchemaUid', 'collectionName', 'autoCreateReverseField', 'uiSchema.x-uid', 'reverseField.key', 'reverseField.uiSchemaUid']);
|
|
150
|
-
const isOpenPorts = !['obo', 'oho', 'o2o', 'o2m', 'm2o', 'm2m', 'linkTo', 'id'].includes(values.interface);
|
|
151
|
-
const _yield$api$resource$c = yield api.resource('collections.fields', collectionName).create({
|
|
152
|
-
values: formValues
|
|
153
|
-
}),
|
|
154
|
-
data = _yield$api$resource$c.data.data;
|
|
155
|
-
targetId && (yield api.resource('fields').move({
|
|
156
|
-
sourceId: data.key,
|
|
157
|
-
targetId,
|
|
158
|
-
targetScope: collectionName,
|
|
159
|
-
method: 'insertAfter'
|
|
160
|
-
}));
|
|
161
|
-
ctx.setVisible(false);
|
|
162
|
-
yield form.reset();
|
|
163
|
-
positionTargetNode();
|
|
164
|
-
isOpenPorts && openPorts && openPorts();
|
|
165
|
-
yield refreshCM();
|
|
166
|
-
})();
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
exports.useCreateAction = useCreateAction;
|
|
171
|
-
const useUpdateFieldAction = ({
|
|
172
|
-
collectionName,
|
|
173
|
-
name,
|
|
174
|
-
key
|
|
175
|
-
}) => {
|
|
176
|
-
const _useCollectionManager3 = (0, _client().useCollectionManager)(),
|
|
177
|
-
refreshCM = _useCollectionManager3.refreshCM;
|
|
178
|
-
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
179
|
-
t = _useTranslation.t;
|
|
180
|
-
const form = (0, _react().useForm)();
|
|
181
|
-
const ctx = (0, _client().useActionContext)();
|
|
182
|
-
const api = (0, _client().useAPIClient)();
|
|
183
|
-
const _useContext3 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
184
|
-
positionTargetNode = _useContext3.positionTargetNode,
|
|
185
|
-
node = _useContext3.node;
|
|
186
|
-
return {
|
|
187
|
-
run() {
|
|
188
|
-
return _asyncToGenerator(function* () {
|
|
189
|
-
var _form$values;
|
|
190
|
-
yield form.submit();
|
|
191
|
-
yield api.resource('collections.fields', collectionName).update({
|
|
192
|
-
filterByTk: name,
|
|
193
|
-
values: form.values
|
|
194
|
-
});
|
|
195
|
-
ctx.setVisible(false);
|
|
196
|
-
_antd().message.success(t('Saved successfully'));
|
|
197
|
-
positionTargetNode();
|
|
198
|
-
refreshCM();
|
|
199
|
-
node.setPortProp(key, 'uiSchema', {
|
|
200
|
-
title: (_form$values = form.values) === null || _form$values === void 0 ? void 0 : _form$values.uiSchema.title
|
|
201
|
-
});
|
|
202
|
-
yield form.reset();
|
|
203
|
-
})();
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
exports.useUpdateFieldAction = useUpdateFieldAction;
|
|
208
|
-
const useUpdateCollectionActionAndRefreshCM = () => {
|
|
209
|
-
const _useTranslation2 = (0, _reactI18next().useTranslation)(),
|
|
210
|
-
t = _useTranslation2.t;
|
|
211
|
-
const form = (0, _react().useForm)();
|
|
212
|
-
const ctx = (0, _client().useActionContext)();
|
|
213
|
-
const name = form.values.name;
|
|
214
|
-
const api = (0, _client().useAPIClient)();
|
|
215
|
-
const _useCollectionManager4 = (0, _client().useCollectionManager)(),
|
|
216
|
-
refreshCM = _useCollectionManager4.refreshCM;
|
|
217
|
-
const _useContext4 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
218
|
-
positionTargetNode = _useContext4.positionTargetNode;
|
|
219
|
-
return {
|
|
220
|
-
run() {
|
|
221
|
-
return _asyncToGenerator(function* () {
|
|
222
|
-
yield form.submit();
|
|
223
|
-
yield api.resource('collections').update({
|
|
224
|
-
filterByTk: name,
|
|
225
|
-
values: _objectSpread({}, _client2().lodash.omit(form.values, ['fields']))
|
|
226
|
-
});
|
|
227
|
-
ctx.setVisible(false);
|
|
228
|
-
_antd().message.success(t('Saved successfully'));
|
|
229
|
-
yield form.reset();
|
|
230
|
-
positionTargetNode();
|
|
231
|
-
refreshCM();
|
|
232
|
-
})();
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
exports.useUpdateCollectionActionAndRefreshCM = useUpdateCollectionActionAndRefreshCM;
|
|
237
|
-
const useDestroyAction = name => {
|
|
238
|
-
const api = (0, _client().useAPIClient)();
|
|
239
|
-
return {
|
|
240
|
-
run() {
|
|
241
|
-
return _asyncToGenerator(function* () {
|
|
242
|
-
yield api.resource('collections').destroy({
|
|
243
|
-
filterByTk: name
|
|
244
|
-
});
|
|
245
|
-
yield api.resource('graphPositions').destroy({
|
|
246
|
-
filter: {
|
|
247
|
-
collectionName: name
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
})();
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
const useDestroyActionAndRefreshCM = props => {
|
|
255
|
-
const name = props.name;
|
|
256
|
-
const _useDestroyAction = useDestroyAction(name),
|
|
257
|
-
run = _useDestroyAction.run;
|
|
258
|
-
const _useCollectionManager5 = (0, _client().useCollectionManager)(),
|
|
259
|
-
refreshCM = _useCollectionManager5.refreshCM;
|
|
260
|
-
const _useContext5 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
261
|
-
positionTargetNode = _useContext5.positionTargetNode;
|
|
262
|
-
return {
|
|
263
|
-
run() {
|
|
264
|
-
return _asyncToGenerator(function* () {
|
|
265
|
-
yield run();
|
|
266
|
-
positionTargetNode('destory');
|
|
267
|
-
yield refreshCM();
|
|
268
|
-
})();
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
exports.useDestroyActionAndRefreshCM = useDestroyActionAndRefreshCM;
|
|
273
|
-
const useDestroyFieldAction = (collectionName, name) => {
|
|
274
|
-
const api = (0, _client().useAPIClient)();
|
|
275
|
-
const _useContext6 = (0, _react2().useContext)(_CollectionNodeProvder.GraphCollectionContext),
|
|
276
|
-
positionTargetNode = _useContext6.positionTargetNode;
|
|
277
|
-
return {
|
|
278
|
-
run() {
|
|
279
|
-
return _asyncToGenerator(function* () {
|
|
280
|
-
yield api.resource('collections.fields', collectionName).destroy({
|
|
281
|
-
filterByTk: name
|
|
282
|
-
});
|
|
283
|
-
positionTargetNode();
|
|
284
|
-
})();
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
};
|
|
288
|
-
const useDestroyFieldActionAndRefreshCM = props => {
|
|
289
|
-
const collectionName = props.collectionName,
|
|
290
|
-
name = props.name;
|
|
291
|
-
const _useCollectionManager6 = (0, _client().useCollectionManager)(),
|
|
292
|
-
refreshCM = _useCollectionManager6.refreshCM;
|
|
293
|
-
const _useDestroyFieldActio = useDestroyFieldAction(collectionName, name),
|
|
294
|
-
run = _useDestroyFieldActio.run;
|
|
295
|
-
return {
|
|
296
|
-
run() {
|
|
297
|
-
return _asyncToGenerator(function* () {
|
|
298
|
-
yield run();
|
|
299
|
-
yield refreshCM();
|
|
300
|
-
})();
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
};
|
|
304
|
-
exports.useDestroyFieldActionAndRefreshCM = useDestroyFieldActionAndRefreshCM;
|
|
305
|
-
const useAsyncDataSource = service => {
|
|
306
|
-
return (field, {
|
|
307
|
-
targetScope
|
|
308
|
-
}) => {
|
|
309
|
-
field.loading = true;
|
|
310
|
-
service(targetScope).then(_reactive().action.bound(data => {
|
|
311
|
-
field.dataSource = data;
|
|
312
|
-
field.loading = false;
|
|
313
|
-
})).catch(err => {
|
|
314
|
-
(0, _client2().error)(err);
|
|
315
|
-
});
|
|
316
|
-
};
|
|
317
|
-
};
|
|
318
|
-
exports.useAsyncDataSource = useAsyncDataSource;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.AddCollectionAction = 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 _antd() {
|
|
22
|
-
const data = require("antd");
|
|
23
|
-
_antd = function _antd() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _react() {
|
|
29
|
-
const data = _interopRequireDefault(require("react"));
|
|
30
|
-
_react = function _react() {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
var _actionHooks = require("../action-hooks");
|
|
36
|
-
var _utils = require("../utils");
|
|
37
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
38
|
-
const AddCollectionAction = ({
|
|
39
|
-
item: record
|
|
40
|
-
}) => {
|
|
41
|
-
return _react().default.createElement(_client().AddCollection, {
|
|
42
|
-
trigger: ['click'],
|
|
43
|
-
align: {
|
|
44
|
-
overflow: {
|
|
45
|
-
adjustY: false // 关闭溢出位置调整
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
item: record,
|
|
50
|
-
scope: {
|
|
51
|
-
useCancelAction: _actionHooks.useCancelAction
|
|
52
|
-
},
|
|
53
|
-
getContainer: _utils.getPopupContainer
|
|
54
|
-
}, _react().default.createElement(_antd().Button, {
|
|
55
|
-
type: "primary"
|
|
56
|
-
}, _react().default.createElement(_icons().PlusOutlined, null)));
|
|
57
|
-
};
|
|
58
|
-
exports.AddCollectionAction = AddCollectionAction;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.AddFieldAction = 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 _actionHooks = require("../action-hooks");
|
|
29
|
-
var _utils = require("../utils");
|
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
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); } }
|
|
32
|
-
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); }); }; }
|
|
33
|
-
const _useCreateCollectionField = record => {
|
|
34
|
-
const title = record.collectionName;
|
|
35
|
-
const _useCreateAction = (0, _actionHooks.useCreateAction)(title, record.key),
|
|
36
|
-
run = _useCreateAction.run;
|
|
37
|
-
return {
|
|
38
|
-
run() {
|
|
39
|
-
return _asyncToGenerator(function* () {
|
|
40
|
-
yield run();
|
|
41
|
-
})();
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const AddFieldAction = ({
|
|
46
|
-
item: record,
|
|
47
|
-
database
|
|
48
|
-
}) => {
|
|
49
|
-
return _react().default.createElement(_client().AddFieldAction, {
|
|
50
|
-
trigger: ['click'],
|
|
51
|
-
align: {
|
|
52
|
-
overflow: {
|
|
53
|
-
adjustY: false // 关闭溢出位置调整
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
item: record,
|
|
58
|
-
database: database,
|
|
59
|
-
scope: {
|
|
60
|
-
useCancelAction: _actionHooks.useCancelAction,
|
|
61
|
-
useCreateCollectionField: () => _useCreateCollectionField(record)
|
|
62
|
-
},
|
|
63
|
-
getContainer: _utils.getPopupContainer
|
|
64
|
-
}, _react().default.createElement(_icons().PlusOutlined, {
|
|
65
|
-
className: "btn-add",
|
|
66
|
-
id: "graph_btn_add_field"
|
|
67
|
-
}));
|
|
68
|
-
};
|
|
69
|
-
exports.AddFieldAction = AddFieldAction;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.GraphCollectionContext = exports.CollectionNodeProvder = void 0;
|
|
7
|
-
function _react() {
|
|
8
|
-
const data = _interopRequireWildcard(require("react"));
|
|
9
|
-
_react = function _react() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
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); }
|
|
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; }
|
|
16
|
-
const GraphCollectionContext = (0, _react().createContext)(null);
|
|
17
|
-
exports.GraphCollectionContext = GraphCollectionContext;
|
|
18
|
-
const CollectionNodeProvder = props => {
|
|
19
|
-
const record = props.record,
|
|
20
|
-
setTargetNode = props.setTargetNode,
|
|
21
|
-
node = props.node,
|
|
22
|
-
handelOpenPorts = props.handelOpenPorts;
|
|
23
|
-
return _react().default.createElement(GraphCollectionContext.Provider, {
|
|
24
|
-
value: {
|
|
25
|
-
node,
|
|
26
|
-
record,
|
|
27
|
-
positionTargetNode: target => {
|
|
28
|
-
setTargetNode(target || node);
|
|
29
|
-
},
|
|
30
|
-
openPorts: handelOpenPorts
|
|
31
|
-
}
|
|
32
|
-
}, props.children);
|
|
33
|
-
};
|
|
34
|
-
exports.CollectionNodeProvder = CollectionNodeProvder;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.EditCollectionAction = 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 _actionHooks = require("../action-hooks");
|
|
29
|
-
var _utils = require("../utils");
|
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
const EditCollectionAction = ({
|
|
32
|
-
item: record,
|
|
33
|
-
className
|
|
34
|
-
}) => {
|
|
35
|
-
return _react().default.createElement(_client().EditCollection, {
|
|
36
|
-
item: record,
|
|
37
|
-
scope: {
|
|
38
|
-
useCancelAction: _actionHooks.useCancelAction,
|
|
39
|
-
useUpdateCollectionActionAndRefreshCM: _actionHooks.useUpdateCollectionActionAndRefreshCM,
|
|
40
|
-
createOnly: false
|
|
41
|
-
},
|
|
42
|
-
getContainer: _utils.getPopupContainer
|
|
43
|
-
}, _react().default.createElement(_icons().EditOutlined, {
|
|
44
|
-
className: className
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
exports.EditCollectionAction = EditCollectionAction;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.EditFieldAction = 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 _actionHooks = require("../action-hooks");
|
|
29
|
-
var _utils = require("../utils");
|
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
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); } }
|
|
32
|
-
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); }); }; }
|
|
33
|
-
const _useUpdateCollectionField = record => {
|
|
34
|
-
const collectionName = record.collectionName;
|
|
35
|
-
const _useUpdateFieldAction = (0, _actionHooks.useUpdateFieldAction)({
|
|
36
|
-
collectionName,
|
|
37
|
-
name: record.name,
|
|
38
|
-
key: record.key
|
|
39
|
-
}),
|
|
40
|
-
run = _useUpdateFieldAction.run;
|
|
41
|
-
return {
|
|
42
|
-
run() {
|
|
43
|
-
return _asyncToGenerator(function* () {
|
|
44
|
-
yield run();
|
|
45
|
-
})();
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
const EditFieldAction = ({
|
|
50
|
-
item: record
|
|
51
|
-
}) => {
|
|
52
|
-
return _react().default.createElement(_client().EditFieldAction, {
|
|
53
|
-
item: record,
|
|
54
|
-
scope: {
|
|
55
|
-
useCancelAction: _actionHooks.useCancelAction,
|
|
56
|
-
useUpdateCollectionField: () => _useUpdateCollectionField(record)
|
|
57
|
-
},
|
|
58
|
-
getContainer: _utils.getPopupContainer
|
|
59
|
-
}, _react().default.createElement(_icons().EditOutlined, {
|
|
60
|
-
className: "btn-edit"
|
|
61
|
-
}));
|
|
62
|
-
};
|
|
63
|
-
exports.EditFieldAction = EditFieldAction;
|