@nocobase/plugin-workflow 0.9.4-alpha.2 → 0.10.0-alpha.3
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/AddButton.d.ts +2 -2
- package/lib/client/AddButton.js +76 -65
- package/lib/client/Branch.d.ts +2 -2
- package/lib/client/CanvasContent.d.ts +2 -2
- package/lib/client/ExecutionCanvas.d.ts +2 -2
- package/lib/client/ExecutionCanvas.js +1 -1
- package/lib/client/ExecutionLink.d.ts +2 -1
- package/lib/client/ExecutionPage.d.ts +2 -1
- package/lib/client/ExecutionPage.js +14 -15
- package/lib/client/ExecutionResourceProvider.d.ts +2 -1
- package/lib/client/WorkflowCanvas.d.ts +2 -2
- package/lib/client/WorkflowCanvas.js +31 -31
- package/lib/client/WorkflowLink.d.ts +2 -1
- package/lib/client/WorkflowPage.d.ts +2 -1
- package/lib/client/WorkflowPage.js +11 -10
- package/lib/client/WorkflowProvider.d.ts +1 -1
- package/lib/client/WorkflowProvider.js +15 -15
- package/lib/client/components/CollectionBlockInitializer.d.ts +2 -7
- package/lib/client/components/CollectionBlockInitializer.js +49 -17
- package/lib/client/components/CollectionFieldset.d.ts +3 -2
- package/lib/client/components/CollectionFieldset.js +87 -74
- package/lib/client/components/Duration.d.ts +2 -2
- package/lib/client/components/DynamicExpression.d.ts +3 -1
- package/lib/client/components/DynamicExpression.js +2 -0
- package/lib/client/components/FieldsSelect.d.ts +1 -1
- package/lib/client/components/FieldsSelect.js +2 -0
- package/lib/client/components/FilterDynamicComponent.d.ts +2 -2
- package/lib/client/components/NodeDescription.d.ts +2 -2
- package/lib/client/components/OpenDrawer.d.ts +2 -2
- package/lib/client/components/OpenDrawer.js +1 -1
- package/lib/client/components/RadioWithTooltip.d.ts +2 -2
- package/lib/client/components/renderEngineReference.d.ts +2 -1
- package/lib/client/constants.d.ts +2 -1
- package/lib/client/locale/zh-CN.d.ts +8 -0
- package/lib/client/locale/zh-CN.js +8 -0
- package/lib/client/nodes/aggregate.d.ts +1 -1
- package/lib/client/nodes/calculation.d.ts +4 -3
- package/lib/client/nodes/condition.d.ts +6 -4
- package/lib/client/nodes/condition.js +3 -1
- package/lib/client/nodes/create.d.ts +3 -6
- package/lib/client/nodes/create.js +1 -4
- package/lib/client/nodes/index.d.ts +5 -5
- package/lib/client/nodes/index.js +9 -6
- package/lib/client/nodes/loop.d.ts +4 -1
- package/lib/client/nodes/loop.js +3 -1
- package/lib/client/nodes/manual/AssigneesSelect.d.ts +2 -2
- package/lib/client/nodes/manual/DetailsBlockProvider.d.ts +2 -0
- package/lib/client/nodes/manual/DetailsBlockProvider.js +106 -0
- package/lib/client/nodes/manual/FormBlockInitializer.d.ts +2 -0
- package/lib/client/nodes/manual/FormBlockInitializer.js +106 -0
- package/lib/client/nodes/manual/FormBlockProvider.d.ts +2 -0
- package/lib/client/nodes/manual/FormBlockProvider.js +113 -0
- package/lib/client/nodes/manual/ModeConfig.d.ts +2 -2
- package/lib/client/nodes/manual/SchemaConfig.d.ts +43 -3
- package/lib/client/nodes/manual/SchemaConfig.js +42 -79
- package/lib/client/nodes/manual/WorkflowTodo.d.ts +5 -8
- package/lib/client/nodes/manual/WorkflowTodo.js +111 -76
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +2 -2
- package/lib/client/nodes/manual/forms/create.d.ts +3 -0
- package/lib/client/nodes/manual/forms/create.js +104 -0
- package/lib/client/nodes/manual/forms/custom.d.ts +3 -0
- package/lib/client/nodes/manual/forms/{customForm.js → custom.js} +63 -45
- package/lib/client/nodes/manual/forms/update.d.ts +3 -0
- package/lib/client/nodes/manual/forms/update.js +161 -0
- package/lib/client/nodes/manual/index.d.ts +2 -5
- package/lib/client/nodes/manual/index.js +17 -16
- package/lib/client/nodes/manual/utils.d.ts +2 -0
- package/lib/client/nodes/manual/utils.js +31 -0
- package/lib/client/nodes/parallel.d.ts +4 -1
- package/lib/client/nodes/parallel.js +3 -1
- package/lib/client/nodes/query.d.ts +2 -5
- package/lib/client/nodes/query.js +2 -5
- package/lib/client/nodes/request.d.ts +1 -1
- package/lib/client/nodes/request.js +1 -11
- package/lib/client/nodes/update.d.ts +24 -1
- package/lib/client/nodes/update.js +76 -3
- package/lib/client/schemas/collection.js +1 -1
- package/lib/client/schemas/executions.d.ts +2 -0
- package/lib/client/style.js +4 -0
- package/lib/client/triggers/collection.d.ts +2 -5
- package/lib/client/triggers/collection.js +5 -8
- package/lib/client/triggers/index.d.ts +1 -2
- package/lib/client/triggers/index.js +10 -8
- package/lib/client/triggers/schedule/DateFieldsSelect.js +14 -12
- package/lib/client/triggers/schedule/EndsByField.d.ts +2 -2
- package/lib/client/triggers/schedule/OnField.d.ts +2 -2
- package/lib/client/triggers/schedule/RepeatField.d.ts +2 -2
- package/lib/client/triggers/schedule/ScheduleConfig.d.ts +2 -1
- package/lib/client/triggers/schedule/index.d.ts +3 -6
- package/lib/client/triggers/schedule/index.js +1 -4
- package/lib/server/Plugin.js +6 -3
- package/lib/server/Processor.d.ts +2 -2
- package/lib/server/Processor.js +22 -26
- package/lib/server/instructions/delay.js +1 -1
- package/lib/server/instructions/loop.d.ts +1 -1
- package/lib/server/instructions/loop.js +1 -1
- package/lib/server/instructions/manual/actions.js +42 -47
- package/lib/server/instructions/manual/forms/create.d.ts +5 -0
- package/lib/server/instructions/manual/forms/create.js +46 -0
- package/lib/server/instructions/manual/forms/index.d.ts +6 -0
- package/lib/server/instructions/manual/forms/index.js +15 -0
- package/lib/server/instructions/manual/forms/update.d.ts +6 -0
- package/lib/server/instructions/manual/forms/update.js +47 -0
- package/lib/server/instructions/manual/index.d.ts +3 -0
- package/lib/server/instructions/manual/index.js +16 -3
- package/lib/server/instructions/parallel.js +2 -2
- package/lib/server/instructions/request.js +3 -3
- package/lib/server/instructions/update.js +2 -3
- package/lib/server/migrations/20230612021134-manual-collection-block.d.ts +4 -0
- package/lib/server/migrations/20230612021134-manual-collection-block.js +155 -0
- package/package.json +16 -13
- package/lib/client/WorkflowShortcut.d.ts +0 -1
- package/lib/client/WorkflowShortcut.js +0 -48
- package/lib/client/components/CollectionFieldInitializers.d.ts +0 -2
- package/lib/client/components/CollectionFieldInitializers.js +0 -70
- package/lib/client/nodes/manual/forms/customForm.d.ts +0 -40
|
@@ -18,6 +18,7 @@ function _client() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
var _utils = require("../nodes/manual/utils");
|
|
21
22
|
const _excluded = ["insert", "collection", "dataSource"];
|
|
22
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
24
|
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; }
|
|
@@ -25,47 +26,78 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
25
26
|
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; }
|
|
26
27
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
27
28
|
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); }
|
|
29
|
+
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); } }
|
|
30
|
+
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); }); }; }
|
|
28
31
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
32
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
30
|
-
function
|
|
33
|
+
function InnerCollectionBlockInitializer(_ref) {
|
|
31
34
|
let insert = _ref.insert,
|
|
32
35
|
collection = _ref.collection,
|
|
33
36
|
dataSource = _ref.dataSource,
|
|
34
37
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
const _useSchemaTemplateMan = (0, _client().useSchemaTemplateManager)(),
|
|
39
|
+
getTemplateSchemaByMode = _useSchemaTemplateMan.getTemplateSchemaByMode;
|
|
35
40
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
36
41
|
getCollection = _useCollectionManager.getCollection;
|
|
42
|
+
const items = (0, _client().useRecordCollectionDataSourceItems)('FormItem');
|
|
37
43
|
const resovledCollection = getCollection(collection);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
function onConfirm(_x) {
|
|
45
|
+
return _onConfirm.apply(this, arguments);
|
|
46
|
+
}
|
|
47
|
+
function _onConfirm() {
|
|
48
|
+
_onConfirm = _asyncToGenerator(function* ({
|
|
49
|
+
item
|
|
50
|
+
}) {
|
|
51
|
+
const template = item.template ? yield getTemplateSchemaByMode(item) : null;
|
|
52
|
+
const result = {
|
|
41
53
|
type: 'void',
|
|
42
54
|
name: resovledCollection.name,
|
|
43
55
|
title: resovledCollection.title,
|
|
44
|
-
'x-decorator': '
|
|
56
|
+
'x-decorator': 'DetailsBlockProvider',
|
|
45
57
|
'x-decorator-props': {
|
|
46
|
-
collection
|
|
58
|
+
collection,
|
|
59
|
+
dataSource
|
|
47
60
|
},
|
|
48
61
|
'x-component': 'CardItem',
|
|
49
62
|
'x-component-props': {
|
|
50
|
-
|
|
63
|
+
title: props.title
|
|
51
64
|
},
|
|
52
65
|
'x-designer': 'SimpleDesigner',
|
|
53
|
-
'x-designer-props': {
|
|
54
|
-
type: 'record'
|
|
55
|
-
},
|
|
56
66
|
properties: {
|
|
57
67
|
grid: {
|
|
58
68
|
type: 'void',
|
|
59
|
-
'x-
|
|
60
|
-
'x-
|
|
61
|
-
|
|
69
|
+
'x-component': 'FormV2',
|
|
70
|
+
'x-component-props': {
|
|
71
|
+
useProps: '{{useDetailsBlockProps}}'
|
|
62
72
|
},
|
|
63
|
-
'x-
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
'x-read-pretty': true,
|
|
74
|
+
properties: {
|
|
75
|
+
grid: template || {
|
|
76
|
+
type: 'void',
|
|
77
|
+
'x-component': 'Grid',
|
|
78
|
+
'x-initializer': 'ReadPrettyFormItemInitializers',
|
|
79
|
+
properties: {}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
66
82
|
}
|
|
67
83
|
}
|
|
84
|
+
};
|
|
85
|
+
(0, _utils.traverseSchema)(result, node => {
|
|
86
|
+
if (node['x-uid']) {
|
|
87
|
+
delete node['x-uid'];
|
|
88
|
+
}
|
|
68
89
|
});
|
|
69
|
-
|
|
90
|
+
insert(result);
|
|
91
|
+
});
|
|
92
|
+
return _onConfirm.apply(this, arguments);
|
|
93
|
+
}
|
|
94
|
+
return _react().default.createElement(_client().SchemaInitializer.Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
95
|
+
onClick: onConfirm,
|
|
96
|
+
items: items
|
|
70
97
|
}));
|
|
98
|
+
}
|
|
99
|
+
function CollectionBlockInitializer(props) {
|
|
100
|
+
return _react().default.createElement(_client().CollectionProvider, {
|
|
101
|
+
collection: props.collection
|
|
102
|
+
}, _react().default.createElement(InnerCollectionBlockInitializer, _objectSpread({}, props)));
|
|
71
103
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
3
|
-
|
|
2
|
+
export declare function useCollectionUIFields(collection: any): import("@nocobase/client").CollectionFieldOptions[];
|
|
3
|
+
declare const CollectionFieldSet: React.MemoExoticComponent<import("@formily/react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
4
|
+
export default CollectionFieldSet;
|
|
@@ -4,16 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
exports.useCollectionUIFields = useCollectionUIFields;
|
|
8
|
+
function _icons() {
|
|
9
|
+
const data = require("@ant-design/icons");
|
|
10
|
+
_icons = function _icons() {
|
|
10
11
|
return data;
|
|
11
12
|
};
|
|
12
13
|
return data;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function _css() {
|
|
16
|
+
const data = require("@emotion/css");
|
|
17
|
+
_css = function _css() {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
function _react() {
|
|
15
23
|
const data = require("@formily/react");
|
|
16
|
-
|
|
24
|
+
_react = function _react() {
|
|
17
25
|
return data;
|
|
18
26
|
};
|
|
19
27
|
return data;
|
|
@@ -25,9 +33,9 @@ function _antd() {
|
|
|
25
33
|
};
|
|
26
34
|
return data;
|
|
27
35
|
}
|
|
28
|
-
function
|
|
29
|
-
const data = require("
|
|
30
|
-
|
|
36
|
+
function _react2() {
|
|
37
|
+
const data = _interopRequireWildcard(require("react"));
|
|
38
|
+
_react2 = function _react2() {
|
|
31
39
|
return data;
|
|
32
40
|
};
|
|
33
41
|
return data;
|
|
@@ -39,13 +47,6 @@ function _reactI18next() {
|
|
|
39
47
|
};
|
|
40
48
|
return data;
|
|
41
49
|
}
|
|
42
|
-
function _css() {
|
|
43
|
-
const data = require("@emotion/css");
|
|
44
|
-
_css = function _css() {
|
|
45
|
-
return data;
|
|
46
|
-
};
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
50
|
function _client() {
|
|
50
51
|
const data = require("@nocobase/client");
|
|
51
52
|
_client = function _client() {
|
|
@@ -55,7 +56,8 @@ function _client() {
|
|
|
55
56
|
}
|
|
56
57
|
var _locale = require("../locale");
|
|
57
58
|
var _variable = require("../variable");
|
|
58
|
-
function
|
|
59
|
+
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); }
|
|
60
|
+
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
61
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
60
62
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
61
63
|
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; }
|
|
@@ -66,10 +68,10 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
66
68
|
function AssociationInput(props) {
|
|
67
69
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
68
70
|
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
69
|
-
const _useField = (0,
|
|
71
|
+
const _useField = (0, _react().useField)(),
|
|
70
72
|
path = _useField.path;
|
|
71
73
|
const fieldName = path.segments[path.segments.length - 1];
|
|
72
|
-
const _useForm = (0,
|
|
74
|
+
const _useForm = (0, _react().useForm)(),
|
|
73
75
|
config = _useForm.values;
|
|
74
76
|
const fields = getCollectionFields(config === null || config === void 0 ? void 0 : config.collection);
|
|
75
77
|
const _fields$find = fields.find(item => item.name === fieldName),
|
|
@@ -79,63 +81,88 @@ function AssociationInput(props) {
|
|
|
79
81
|
const trimed = ev.target.value.trim();
|
|
80
82
|
props.onChange(['belongsTo', 'hasOne'].includes(type) ? trimed : trimed.split(/[,\s]+/));
|
|
81
83
|
}
|
|
82
|
-
return
|
|
84
|
+
return _react2().default.createElement(_antd().Input, _objectSpread(_objectSpread({}, props), {}, {
|
|
83
85
|
value: value,
|
|
84
86
|
onChange: onChange
|
|
85
87
|
}));
|
|
86
88
|
}
|
|
89
|
+
function useCollectionUIFields(collection) {
|
|
90
|
+
const _useCollectionManager2 = (0, _client().useCollectionManager)(),
|
|
91
|
+
getCollectionFields = _useCollectionManager2.getCollectionFields;
|
|
92
|
+
return getCollectionFields(collection).filter(field => !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : false));
|
|
93
|
+
}
|
|
87
94
|
// NOTE: observer for watching useProps
|
|
88
|
-
|
|
95
|
+
const CollectionFieldSet = (0, _react().observer)(({
|
|
89
96
|
value,
|
|
90
97
|
disabled,
|
|
91
|
-
onChange: _onChange
|
|
98
|
+
onChange: _onChange,
|
|
99
|
+
filter
|
|
92
100
|
}) => {
|
|
93
101
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
94
102
|
t = _useTranslation.t;
|
|
95
103
|
const compile = (0, _client().useCompile)();
|
|
96
|
-
const form = (0,
|
|
97
|
-
const
|
|
98
|
-
getCollection =
|
|
99
|
-
getCollectionFields = _useCollectionManager2.getCollectionFields;
|
|
100
|
-
const _useForm2 = (0, _react2().useForm)(),
|
|
101
|
-
config = _useForm2.values;
|
|
102
|
-
const collectionName = config === null || config === void 0 ? void 0 : config.collection;
|
|
103
|
-
const fields = getCollectionFields(collectionName).filter(field => !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : false) &&
|
|
104
|
-
// TODO: should use some field option but not type to control this
|
|
105
|
-
!['formula'].includes(field.type));
|
|
106
|
-
const unassignedFields = fields.filter(field => !value || !(field.name in value));
|
|
104
|
+
const form = (0, _react().useForm)();
|
|
105
|
+
const _useCollectionManager3 = (0, _client().useCollectionManager)(),
|
|
106
|
+
getCollection = _useCollectionManager3.getCollection;
|
|
107
107
|
const scope = (0, _variable.useWorkflowVariableOptions)();
|
|
108
|
+
const config = form.values;
|
|
109
|
+
const collectionName = config === null || config === void 0 ? void 0 : config.collection;
|
|
110
|
+
const collectionFields = useCollectionUIFields(collectionName);
|
|
111
|
+
const fields = filter ? collectionFields.filter(filter.bind(config)) : collectionFields;
|
|
112
|
+
const unassignedFields = (0, _react2().useMemo)(() => fields.filter(field => !value || !(field.name in value)), [fields, value]);
|
|
108
113
|
const mergedDisabled = disabled || form.disabled;
|
|
109
|
-
|
|
114
|
+
const menu = (0, _react2().useMemo)(() => {
|
|
115
|
+
return {
|
|
116
|
+
onClick: ({
|
|
117
|
+
key
|
|
118
|
+
}) => {
|
|
119
|
+
_onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
120
|
+
[key]: null
|
|
121
|
+
}));
|
|
122
|
+
},
|
|
123
|
+
style: {
|
|
124
|
+
maxHeight: 300,
|
|
125
|
+
overflowY: 'auto'
|
|
126
|
+
},
|
|
127
|
+
items: unassignedFields.map(field => {
|
|
128
|
+
var _field$uiSchema$title, _field$uiSchema;
|
|
129
|
+
return {
|
|
130
|
+
key: field.name,
|
|
131
|
+
label: compile((_field$uiSchema$title = (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title) !== null && _field$uiSchema$title !== void 0 ? _field$uiSchema$title : field.name)
|
|
132
|
+
};
|
|
133
|
+
})
|
|
134
|
+
};
|
|
135
|
+
}, [_onChange, unassignedFields, value]);
|
|
136
|
+
return _react2().default.createElement("fieldset", {
|
|
110
137
|
className: (0, _css().css)`
|
|
111
|
-
|
|
138
|
+
margin-top: 0.5em;
|
|
112
139
|
|
|
113
|
-
|
|
114
|
-
|
|
140
|
+
> .ant-formily-item {
|
|
141
|
+
flex-direction: column;
|
|
115
142
|
|
|
116
|
-
|
|
117
|
-
|
|
143
|
+
> .ant-formily-item-label {
|
|
144
|
+
line-height: 32px;
|
|
145
|
+
}
|
|
118
146
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}, fields.length ? _react().default.createElement(_client().CollectionProvider, {
|
|
147
|
+
`
|
|
148
|
+
}, fields.length ? _react2().default.createElement(_client().CollectionProvider, {
|
|
122
149
|
collection: getCollection(collectionName)
|
|
123
150
|
}, fields.filter(field => value && field.name in value).map(field => {
|
|
124
|
-
var _field$uiSchema$
|
|
151
|
+
var _field$uiSchema$title2, _field$uiSchema2;
|
|
125
152
|
// constant for associations to use Input, others to use CollectionField
|
|
126
153
|
// dynamic values only support belongsTo/hasOne association, other association type should disable
|
|
127
154
|
const ConstantCompoent = ['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type) ? AssociationInput : _client().CollectionField;
|
|
128
155
|
// TODO: try to use <ObjectField> to replace this map
|
|
129
|
-
return
|
|
156
|
+
return _react2().default.createElement(_antd().Form.Item, {
|
|
130
157
|
key: field.name,
|
|
131
|
-
label: compile((_field$uiSchema$
|
|
158
|
+
label: compile((_field$uiSchema$title2 = (_field$uiSchema2 = field.uiSchema) === null || _field$uiSchema2 === void 0 ? void 0 : _field$uiSchema2.title) !== null && _field$uiSchema$title2 !== void 0 ? _field$uiSchema$title2 : field.name),
|
|
132
159
|
labelAlign: "left",
|
|
133
160
|
className: (0, _css().css)`
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
},
|
|
161
|
+
.ant-form-item-control-input-content {
|
|
162
|
+
display: flex;
|
|
163
|
+
}
|
|
164
|
+
`
|
|
165
|
+
}, _react2().default.createElement(_client().Variable.Input, {
|
|
139
166
|
scope: scope,
|
|
140
167
|
value: value[field.name],
|
|
141
168
|
onChange: next => {
|
|
@@ -143,7 +170,7 @@ var _default = (0, _react2().observer)(({
|
|
|
143
170
|
[field.name]: next
|
|
144
171
|
}));
|
|
145
172
|
}
|
|
146
|
-
},
|
|
173
|
+
}, _react2().default.createElement(_client().SchemaComponent, {
|
|
147
174
|
schema: {
|
|
148
175
|
type: 'void',
|
|
149
176
|
properties: {
|
|
@@ -155,9 +182,9 @@ var _default = (0, _react2().observer)(({
|
|
|
155
182
|
}
|
|
156
183
|
}
|
|
157
184
|
}
|
|
158
|
-
})), !mergedDisabled ?
|
|
185
|
+
})), !mergedDisabled ? _react2().default.createElement(_antd().Button, {
|
|
159
186
|
type: "link",
|
|
160
|
-
icon:
|
|
187
|
+
icon: _react2().default.createElement(_icons().CloseCircleOutlined, null),
|
|
161
188
|
onClick: () => {
|
|
162
189
|
const _field$name = field.name,
|
|
163
190
|
_ = value[_field$name],
|
|
@@ -165,27 +192,13 @@ var _default = (0, _react2().observer)(({
|
|
|
165
192
|
_onChange(rest);
|
|
166
193
|
}
|
|
167
194
|
}) : null);
|
|
168
|
-
}), unassignedFields.length ?
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
};
|
|
176
|
-
}),
|
|
177
|
-
onClick: ({
|
|
178
|
-
key
|
|
179
|
-
}) => _onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
180
|
-
[key]: null
|
|
181
|
-
})),
|
|
182
|
-
className: (0, _css().css)`
|
|
183
|
-
max-height: 300px;
|
|
184
|
-
overflow-y: auto;
|
|
185
|
-
`
|
|
186
|
-
})
|
|
187
|
-
}, _react().default.createElement(_antd().Button, {
|
|
188
|
-
icon: _react().default.createElement(_icons().PlusOutlined, null)
|
|
189
|
-
}, t('Add field'))) : null) : _react().default.createElement("p", null, (0, _locale.lang)('Please select collection first')));
|
|
195
|
+
}), unassignedFields.length ? _react2().default.createElement(_antd().Dropdown, {
|
|
196
|
+
menu: menu
|
|
197
|
+
}, _react2().default.createElement(_antd().Button, {
|
|
198
|
+
icon: _react2().default.createElement(_icons().PlusOutlined, null)
|
|
199
|
+
}, t('Add field'))) : null) : _react2().default.createElement("p", null, (0, _locale.lang)('Please select collection first')));
|
|
200
|
+
}, {
|
|
201
|
+
displayName: 'CollectionFieldSet'
|
|
190
202
|
});
|
|
203
|
+
var _default = CollectionFieldSet;
|
|
191
204
|
exports.default = _default;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DynamicExpression: React.ForwardRefExoticComponent<Pick<Partial<
|
|
2
|
+
export declare const DynamicExpression: React.ForwardRefExoticComponent<Pick<Partial<Omit<{
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
}, string | number | symbol> & Pick<any, string | number | symbol> & {
|
|
3
5
|
children?: React.ReactNode;
|
|
4
6
|
}>, string | number | symbol> & React.RefAttributes<unknown>>;
|
|
@@ -84,6 +84,8 @@ const InternalExpression = (0, _react().observer)(props => {
|
|
|
84
84
|
return _react2().default.createElement(_client().Variable.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
85
85
|
scope: options
|
|
86
86
|
}));
|
|
87
|
+
}, {
|
|
88
|
+
displayName: 'InternalExpression'
|
|
87
89
|
});
|
|
88
90
|
function Result(props) {
|
|
89
91
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const FieldsSelect: React.MemoExoticComponent<
|
|
2
|
+
export declare const FieldsSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function NodeDescription(props: any): JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function NodeDescription(props: any): React.JSX.Element;
|
|
@@ -51,7 +51,7 @@ function _default(_ref) {
|
|
|
51
51
|
visible = _useState2[0],
|
|
52
52
|
setVisible = _useState2[1];
|
|
53
53
|
const fieldSchema = (0, _react2().useFieldSchema)();
|
|
54
|
-
return _react().default.createElement(_client().
|
|
54
|
+
return _react().default.createElement(_client().ActionContextProvider, {
|
|
55
55
|
value: {
|
|
56
56
|
visible,
|
|
57
57
|
setVisible,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface RadioWithTooltipOption {
|
|
3
3
|
value: any;
|
|
4
4
|
label: string;
|
|
5
5
|
tooltip?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function RadioWithTooltip(props: any): JSX.Element;
|
|
7
|
+
export declare function RadioWithTooltip(props: any): React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const renderEngineReference: (key: string) => React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export declare const EXECUTION_STATUS: {
|
|
2
3
|
QUEUEING: any;
|
|
3
4
|
STARTED: number;
|
|
@@ -27,6 +28,6 @@ export declare const JobStatusOptions: {
|
|
|
27
28
|
value: number;
|
|
28
29
|
label: string;
|
|
29
30
|
color: string;
|
|
30
|
-
icon: JSX.Element;
|
|
31
|
+
icon: React.JSX.Element;
|
|
31
32
|
}[];
|
|
32
33
|
export declare const JobStatusOptionsMap: {};
|
|
@@ -146,10 +146,18 @@ declare const _default: {
|
|
|
146
146
|
'Field name existed in form': string;
|
|
147
147
|
'Custom form': string;
|
|
148
148
|
'Data record': string;
|
|
149
|
+
'Create record form': string;
|
|
150
|
+
'Update record form': string;
|
|
151
|
+
'Filter settings': string;
|
|
149
152
|
'Create record': string;
|
|
150
153
|
'Add new record to a collection. You can use variables from upstream nodes to assign values to fields.': string;
|
|
151
154
|
'Update record': string;
|
|
152
155
|
'Update records of a collection. You can use variables from upstream nodes as query conditions and field values.': string;
|
|
156
|
+
'Update mode': string;
|
|
157
|
+
'Update in a batch': string;
|
|
158
|
+
'Update one by one': string;
|
|
159
|
+
'Update all eligible data at one time, which has better performance when the amount of data is large. But the updated data will not trigger other workflows, and will not record audit logs.': string;
|
|
160
|
+
'The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.': string;
|
|
153
161
|
'Query record': string;
|
|
154
162
|
'Query records from a collection. You can use variables from upstream nodes as query conditions.': string;
|
|
155
163
|
'Allow multiple records as result': string;
|
|
@@ -152,10 +152,18 @@ var _default = {
|
|
|
152
152
|
'Field name existed in form': '表单中已有对应标识的字段',
|
|
153
153
|
'Custom form': '自定义表单',
|
|
154
154
|
'Data record': '数据记录',
|
|
155
|
+
'Create record form': '新增数据表单',
|
|
156
|
+
'Update record form': '更新数据表单',
|
|
157
|
+
'Filter settings': '筛选设置',
|
|
155
158
|
'Create record': '新增数据',
|
|
156
159
|
'Add new record to a collection. You can use variables from upstream nodes to assign values to fields.': '向一个数据表中添加新的数据。可以使用上游节点里的变量为字段赋值。',
|
|
157
160
|
'Update record': '更新数据',
|
|
158
161
|
'Update records of a collection. You can use variables from upstream nodes as query conditions and field values.': '更新一个数据表中的数据。可以使用上游节点里的变量作为查询条件和数据值。',
|
|
162
|
+
'Update mode': '更新模式',
|
|
163
|
+
'Update in a batch': '批量更新',
|
|
164
|
+
'Update one by one': '逐条更新',
|
|
165
|
+
'Update all eligible data at one time, which has better performance when the amount of data is large. But the updated data will not trigger other workflows, and will not record audit logs.': '一次性更新所有符合条件的数据,在数据量较大时有比较好的性能;但被更新的数据不会触发其他工作流,也不会记录更新日志。',
|
|
166
|
+
'The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.': '被更新的数据可以再次触发其他工作流,也会记录更新日志;但通常只适用于数条或数十条数据,否则会有性能问题。',
|
|
159
167
|
'Query record': '查询数据',
|
|
160
168
|
'Query records from a collection. You can use variables from upstream nodes as query conditions.': '查询一个数据表中的数据。可以使用上游节点里的变量作为查询条件。',
|
|
161
169
|
'Allow multiple records as result': '允许结果是多条数据',
|
|
@@ -171,7 +171,7 @@ declare const _default: {
|
|
|
171
171
|
components: {
|
|
172
172
|
SchemaComponentContext: React.Context<import("@nocobase/client").ISchemaComponentContext>;
|
|
173
173
|
FilterDynamicComponent: typeof FilterDynamicComponent;
|
|
174
|
-
FieldsSelect: React.MemoExoticComponent<
|
|
174
|
+
FieldsSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
175
175
|
ValueBlock: (() => JSX.Element) & {
|
|
176
176
|
Initializer: (props: any) => JSX.Element;
|
|
177
177
|
Result: (props: any) => JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SchemaInitializerItemOptions } from '@nocobase/client';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { RadioWithTooltip } from '../components/RadioWithTooltip';
|
|
3
4
|
import { useWorkflowVariableOptions } from '../variable';
|
|
4
5
|
declare function useWorkflowVariableEntityOptions(): {
|
|
@@ -90,17 +91,17 @@ declare const _default: {
|
|
|
90
91
|
scope: {
|
|
91
92
|
useWorkflowVariableOptions: typeof useWorkflowVariableOptions;
|
|
92
93
|
useWorkflowVariableEntityOptions: typeof useWorkflowVariableEntityOptions;
|
|
93
|
-
renderEngineReference: (key: string) => JSX.Element;
|
|
94
|
+
renderEngineReference: (key: string) => React.JSX.Element;
|
|
94
95
|
};
|
|
95
96
|
components: {
|
|
96
97
|
CalculationResult({ dataSource }: {
|
|
97
98
|
dataSource: any;
|
|
98
|
-
}): string | JSX.Element;
|
|
99
|
+
}): string | React.JSX.Element;
|
|
99
100
|
RadioWithTooltip: typeof RadioWithTooltip;
|
|
100
101
|
DynamicConfig: ({ value, onChange }: {
|
|
101
102
|
value: any;
|
|
102
103
|
onChange: any;
|
|
103
|
-
}) => JSX.Element;
|
|
104
|
+
}) => React.JSX.Element;
|
|
104
105
|
};
|
|
105
106
|
useVariables(current: any, options: any): any[];
|
|
106
107
|
useInitializers(node: any): SchemaInitializerItemOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Registry } from '@nocobase/utils/client';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { RadioWithTooltip } from '../components/RadioWithTooltip';
|
|
4
4
|
import { useWorkflowVariableOptions } from '../variable';
|
|
5
5
|
interface Calculator {
|
|
@@ -11,7 +11,7 @@ export declare const calculators: Registry<Calculator>;
|
|
|
11
11
|
declare function CalculationConfig({ value, onChange }: {
|
|
12
12
|
value: any;
|
|
13
13
|
onChange: any;
|
|
14
|
-
}): JSX.Element;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
15
|
declare const _default: {
|
|
16
16
|
title: string;
|
|
17
17
|
type: string;
|
|
@@ -92,9 +92,11 @@ declare const _default: {
|
|
|
92
92
|
rejectOnFalse: boolean;
|
|
93
93
|
};
|
|
94
94
|
}[];
|
|
95
|
-
|
|
95
|
+
component: ({ data }: {
|
|
96
|
+
data: any;
|
|
97
|
+
}) => React.JSX.Element;
|
|
96
98
|
scope: {
|
|
97
|
-
renderEngineReference: (key: string) => JSX.Element;
|
|
99
|
+
renderEngineReference: (key: string) => React.JSX.Element;
|
|
98
100
|
useWorkflowVariableOptions: typeof useWorkflowVariableOptions;
|
|
99
101
|
};
|
|
100
102
|
components: {
|
|
@@ -478,7 +478,9 @@ var _default = {
|
|
|
478
478
|
rejectOnFalse: false
|
|
479
479
|
}
|
|
480
480
|
}],
|
|
481
|
-
|
|
481
|
+
component: function Component({
|
|
482
|
+
data
|
|
483
|
+
}) {
|
|
482
484
|
const _useTranslation2 = (0, _reactI18next().useTranslation)(),
|
|
483
485
|
t = _useTranslation2.t;
|
|
484
486
|
const _useFlowContext = (0, _FlowContext.useFlowContext)(),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SchemaInitializerItemOptions, useCollectionDataSource } from '@nocobase/client';
|
|
2
|
-
import { CollectionFieldInitializers } from '../components/CollectionFieldInitializers';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
type: string;
|
|
@@ -59,15 +58,13 @@ declare const _default: {
|
|
|
59
58
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
60
59
|
};
|
|
61
60
|
components: {
|
|
62
|
-
CollectionFieldset: import("react").MemoExoticComponent<import("react").
|
|
63
|
-
FieldsSelect: import("react").MemoExoticComponent<import("react").
|
|
61
|
+
CollectionFieldset: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
62
|
+
FieldsSelect: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
64
63
|
};
|
|
65
64
|
useVariables({ config }: {
|
|
66
65
|
config: any;
|
|
67
66
|
}, options: any): import("../variable").VariableOption[];
|
|
68
67
|
useInitializers(node: any): SchemaInitializerItemOptions | null;
|
|
69
|
-
initializers: {
|
|
70
|
-
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
71
|
-
};
|
|
68
|
+
initializers: {};
|
|
72
69
|
};
|
|
73
70
|
export default _default;
|