@nocobase/plugin-workflow 0.10.0-alpha.5 → 0.11.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.d.ts +2 -3
- package/client.js +1 -30
- package/lib/client/AddButton.js +1 -8
- package/lib/client/Branch.js +8 -8
- package/lib/client/CanvasContent.js +8 -8
- package/lib/client/ExecutionCanvas.js +20 -27
- package/lib/client/ExecutionPage.js +1 -8
- package/lib/client/WorkflowCanvas.js +3 -10
- package/lib/client/WorkflowPage.js +1 -8
- package/lib/client/WorkflowProvider.js +3 -42
- package/lib/client/components/CollectionFieldset.d.ts +1 -1
- package/lib/client/components/CollectionFieldset.js +8 -15
- package/lib/client/components/Duration.js +5 -5
- package/lib/client/components/DynamicExpression.d.ts +3 -3
- package/lib/client/components/DynamicExpression.js +14 -4
- package/lib/client/components/FieldsSelect.d.ts +1 -1
- package/lib/client/components/FieldsSelect.js +6 -6
- package/lib/client/components/NodeDescription.js +11 -11
- package/lib/client/components/RadioWithTooltip.js +13 -20
- package/lib/client/components/ValueBlock.js +14 -21
- package/lib/client/components/renderEngineReference.js +1 -8
- package/lib/client/index.d.ts +12 -4
- package/lib/client/index.js +78 -15
- package/lib/client/nodes/aggregate.d.ts +10 -4
- package/lib/client/nodes/aggregate.js +12 -9
- package/lib/client/nodes/calculation.d.ts +11 -16
- package/lib/client/nodes/calculation.js +72 -52
- package/lib/client/nodes/condition.d.ts +2 -6
- package/lib/client/nodes/condition.js +20 -24
- package/lib/client/nodes/create.d.ts +8 -5
- package/lib/client/nodes/create.js +34 -7
- package/lib/client/nodes/destroy.d.ts +1 -1
- package/lib/client/nodes/index.d.ts +4 -4
- package/lib/client/nodes/index.js +79 -86
- package/lib/client/nodes/loop.d.ts +3 -1
- package/lib/client/nodes/loop.js +48 -35
- package/lib/client/nodes/manual/ModeConfig.js +23 -30
- package/lib/client/nodes/manual/SchemaConfig.d.ts +3 -3
- package/lib/client/nodes/manual/SchemaConfig.js +18 -17
- package/lib/client/nodes/manual/WorkflowTodo.js +66 -72
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +2 -5
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +6 -5
- package/lib/client/nodes/manual/forms/custom.js +11 -18
- package/lib/client/nodes/manual/index.d.ts +11 -5
- package/lib/client/nodes/manual/index.js +21 -10
- package/lib/client/nodes/parallel.js +20 -20
- package/lib/client/nodes/query.d.ts +7 -4
- package/lib/client/nodes/query.js +34 -7
- package/lib/client/nodes/request.d.ts +10 -6
- package/lib/client/nodes/request.js +37 -9
- package/lib/client/nodes/update.d.ts +2 -2
- package/lib/client/nodes/update.js +1 -1
- package/lib/client/schemas/collection.d.ts +1 -1
- package/lib/client/schemas/collection.js +3 -10
- package/lib/client/style.js +18 -18
- package/lib/client/triggers/collection.d.ts +4 -3
- package/lib/client/triggers/collection.js +21 -7
- package/lib/client/triggers/index.d.ts +2 -2
- package/lib/client/triggers/index.js +46 -52
- package/lib/client/triggers/schedule/DateFieldsSelect.js +1 -1
- package/lib/client/triggers/schedule/EndsByField.js +11 -11
- package/lib/client/triggers/schedule/OnField.js +11 -11
- package/lib/client/triggers/schedule/RepeatField.js +4 -4
- package/lib/client/triggers/schedule/ScheduleConfig.js +17 -24
- package/lib/client/triggers/schedule/index.d.ts +3 -4
- package/lib/client/triggers/schedule/index.js +21 -11
- package/lib/client/variable.d.ts +3 -4
- package/lib/client/variable.js +110 -45
- package/lib/server/Plugin.d.ts +2 -3
- package/lib/server/Plugin.js +8 -9
- package/lib/server/Processor.d.ts +2 -4
- package/lib/server/actions/nodes.js +7 -7
- package/lib/server/fields/expression-field.d.ts +1 -2
- package/lib/server/fields/expression-field.js +1 -8
- package/lib/server/functions/index.d.ts +2 -3
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +12 -0
- package/lib/server/instructions/aggregate.d.ts +1 -1
- package/lib/server/instructions/aggregate.js +5 -5
- package/lib/server/instructions/condition.d.ts +2 -1
- package/lib/server/instructions/create.d.ts +1 -1
- package/lib/server/instructions/delay.d.ts +3 -3
- package/lib/server/instructions/delay.js +66 -64
- package/lib/server/instructions/destroy.d.ts +1 -1
- package/lib/server/instructions/index.d.ts +5 -5
- package/lib/server/instructions/loop.d.ts +1 -2
- package/lib/server/instructions/manual/actions.js +1 -1
- package/lib/server/instructions/manual/forms/index.d.ts +1 -1
- package/lib/server/instructions/manual/index.d.ts +1 -1
- package/lib/server/instructions/parallel.d.ts +1 -2
- package/lib/server/instructions/query.d.ts +1 -1
- package/lib/server/instructions/request.d.ts +2 -2
- package/lib/server/instructions/request.js +1 -0
- package/lib/server/instructions/update.d.ts +1 -1
- package/lib/server/migrations/20230221071831-calculation-expression.js +1 -1
- package/lib/server/migrations/20230221121203-condition-calculation.js +1 -1
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +7 -7
- package/lib/server/migrations/20230411034722-manual-multi-form.js +1 -8
- package/lib/server/triggers/collection.d.ts +1 -1
- package/lib/server/triggers/collection.js +2 -2
- package/lib/server/triggers/index.d.ts +1 -1
- package/lib/server/triggers/schedule.d.ts +1 -1
- package/lib/server/triggers/schedule.js +18 -18
- package/lib/server/{models → types}/Execution.d.ts +2 -3
- package/lib/server/{models → types}/FlowNode.d.ts +1 -2
- package/lib/server/{models → types}/Job.d.ts +1 -2
- package/lib/server/{models → types}/Workflow.d.ts +1 -2
- package/lib/server/types/index.d.ts +4 -0
- package/lib/server/types/index.js +5 -0
- package/package.json +40 -20
- package/server.d.ts +2 -3
- package/server.js +1 -30
- package/src/client/AddButton.tsx +99 -0
- package/src/client/Branch.tsx +35 -0
- package/src/client/CanvasContent.tsx +23 -0
- package/src/client/ExecutionCanvas.tsx +168 -0
- package/src/client/ExecutionLink.tsx +16 -0
- package/src/client/ExecutionPage.tsx +44 -0
- package/src/client/ExecutionResourceProvider.tsx +21 -0
- package/src/client/FlowContext.ts +7 -0
- package/src/client/WorkflowCanvas.tsx +220 -0
- package/src/client/WorkflowLink.tsx +16 -0
- package/src/client/WorkflowPage.tsx +51 -0
- package/src/client/WorkflowProvider.tsx +84 -0
- package/src/client/components/CollectionBlockInitializer.tsx +71 -0
- package/src/client/components/CollectionFieldset.tsx +158 -0
- package/src/client/components/Duration.tsx +45 -0
- package/src/client/components/DynamicExpression.tsx +53 -0
- package/src/client/components/FieldsSelect.tsx +28 -0
- package/src/client/components/FilterDynamicComponent.tsx +15 -0
- package/src/client/components/NodeDescription.tsx +44 -0
- package/src/client/components/NullRender.tsx +3 -0
- package/src/client/components/OpenDrawer.tsx +24 -0
- package/src/client/components/RadioWithTooltip.tsx +38 -0
- package/src/client/components/ValueBlock.tsx +67 -0
- package/src/client/components/renderEngineReference.tsx +30 -0
- package/src/client/constants.tsx +91 -0
- package/src/client/index.tsx +51 -0
- package/src/client/interfaces/expression.tsx +25 -0
- package/src/client/locale/en-US.ts +136 -0
- package/src/client/locale/es-ES.ts +129 -0
- package/src/client/locale/index.ts +18 -0
- package/src/client/locale/ja-JP.ts +90 -0
- package/src/client/locale/pt-BR.ts +136 -0
- package/src/client/locale/ru-RU.ts +90 -0
- package/src/client/locale/tr-TR.ts +90 -0
- package/src/client/locale/zh-CN.ts +242 -0
- package/src/client/nodes/aggregate.tsx +327 -0
- package/src/client/nodes/calculation.tsx +217 -0
- package/src/client/nodes/condition.tsx +490 -0
- package/src/client/nodes/create.tsx +86 -0
- package/src/client/nodes/delay.tsx +37 -0
- package/src/client/nodes/destroy.tsx +34 -0
- package/src/client/nodes/index.tsx +489 -0
- package/src/client/nodes/loop.tsx +159 -0
- package/src/client/nodes/manual/AssigneesSelect.tsx +33 -0
- package/src/client/nodes/manual/DetailsBlockProvider.tsx +80 -0
- package/src/client/nodes/manual/FormBlockInitializer.tsx +68 -0
- package/src/client/nodes/manual/FormBlockProvider.tsx +75 -0
- package/src/client/nodes/manual/ModeConfig.tsx +84 -0
- package/src/client/nodes/manual/SchemaConfig.tsx +365 -0
- package/src/client/nodes/manual/WorkflowTodo.tsx +611 -0
- package/src/client/nodes/manual/WorkflowTodoBlockInitializer.tsx +28 -0
- package/src/client/nodes/manual/forms/create.tsx +88 -0
- package/src/client/nodes/manual/forms/custom.tsx +388 -0
- package/src/client/nodes/manual/forms/update.tsx +130 -0
- package/src/client/nodes/manual/index.tsx +162 -0
- package/src/client/nodes/manual/utils.ts +28 -0
- package/src/client/nodes/parallel.tsx +137 -0
- package/src/client/nodes/query.tsx +89 -0
- package/src/client/nodes/request.tsx +185 -0
- package/src/client/nodes/update.tsx +99 -0
- package/src/client/schemas/collection.ts +75 -0
- package/src/client/schemas/executions.tsx +169 -0
- package/src/client/schemas/workflows.ts +364 -0
- package/src/client/style.tsx +312 -0
- package/src/client/triggers/collection.tsx +186 -0
- package/src/client/triggers/index.tsx +307 -0
- package/src/client/triggers/schedule/DateFieldsSelect.tsx +28 -0
- package/src/client/triggers/schedule/EndsByField.tsx +40 -0
- package/src/client/triggers/schedule/OnField.tsx +50 -0
- package/src/client/triggers/schedule/RepeatField.tsx +116 -0
- package/src/client/triggers/schedule/ScheduleConfig.tsx +225 -0
- package/src/client/triggers/schedule/constants.ts +4 -0
- package/src/client/triggers/schedule/index.tsx +72 -0
- package/src/client/triggers/schedule/locale/Cron.zh-CN.ts +79 -0
- package/src/client/utils.ts +36 -0
- package/src/client/variable.tsx +296 -0
- package/src/index.ts +1 -0
- package/src/server/Plugin.ts +351 -0
- package/src/server/Processor.ts +354 -0
- package/src/server/__tests__/Plugin.test.ts +398 -0
- package/src/server/__tests__/Processor.test.ts +474 -0
- package/src/server/__tests__/actions/workflows.test.ts +419 -0
- package/src/server/__tests__/collections/categories.ts +23 -0
- package/src/server/__tests__/collections/comments.ts +24 -0
- package/src/server/__tests__/collections/posts.ts +42 -0
- package/src/server/__tests__/collections/replies.ts +9 -0
- package/src/server/__tests__/collections/tags.ts +15 -0
- package/src/server/__tests__/index.ts +89 -0
- package/src/server/__tests__/instructions/aggregate.test.ts +294 -0
- package/src/server/__tests__/instructions/calculation.test.ts +265 -0
- package/src/server/__tests__/instructions/condition.test.ts +335 -0
- package/src/server/__tests__/instructions/create.test.ts +129 -0
- package/src/server/__tests__/instructions/delay.test.ts +182 -0
- package/src/server/__tests__/instructions/destroy.test.ts +58 -0
- package/src/server/__tests__/instructions/loop.test.ts +331 -0
- package/src/server/__tests__/instructions/manual.test.ts +854 -0
- package/src/server/__tests__/instructions/parallel.test.ts +445 -0
- package/src/server/__tests__/instructions/query.test.ts +359 -0
- package/src/server/__tests__/instructions/request.test.ts +217 -0
- package/src/server/__tests__/instructions/update.test.ts +189 -0
- package/src/server/__tests__/triggers/collection.test.ts +298 -0
- package/src/server/__tests__/triggers/schedule.test.ts +369 -0
- package/src/server/actions/index.ts +25 -0
- package/src/server/actions/nodes.ts +214 -0
- package/src/server/actions/workflows.ts +178 -0
- package/src/server/collections/executions.ts +35 -0
- package/src/server/collections/flow_nodes.ts +54 -0
- package/src/server/collections/jobs.ts +31 -0
- package/src/server/collections/workflows.ts +88 -0
- package/src/server/constants.ts +26 -0
- package/src/server/fields/expression-field.ts +11 -0
- package/src/server/fields/index.ts +7 -0
- package/src/server/functions/index.ts +16 -0
- package/src/server/index.ts +6 -0
- package/src/server/instructions/aggregate.ts +42 -0
- package/src/server/instructions/calculation.ts +41 -0
- package/src/server/instructions/condition.ts +172 -0
- package/src/server/instructions/create.ts +37 -0
- package/src/server/instructions/delay.ts +105 -0
- package/src/server/instructions/destroy.ts +23 -0
- package/src/server/instructions/index.ts +63 -0
- package/src/server/instructions/loop.ts +99 -0
- package/src/server/instructions/manual/actions.ts +79 -0
- package/src/server/instructions/manual/collecions/jobs.ts +17 -0
- package/src/server/instructions/manual/collecions/users.ts +15 -0
- package/src/server/instructions/manual/collecions/users_jobs.ts +50 -0
- package/src/server/instructions/manual/forms/create.ts +22 -0
- package/src/server/instructions/manual/forms/index.ts +12 -0
- package/src/server/instructions/manual/forms/update.ts +22 -0
- package/src/server/instructions/manual/index.ts +184 -0
- package/src/server/instructions/parallel.ts +121 -0
- package/src/server/instructions/query.ts +31 -0
- package/src/server/instructions/request.ts +87 -0
- package/src/server/instructions/update.ts +24 -0
- package/src/server/migrations/20221129153547-calculation-variables.ts +64 -0
- package/src/server/migrations/20230221032941-change-request-body-type.ts +76 -0
- package/src/server/migrations/20230221071831-calculation-expression.ts +102 -0
- package/src/server/migrations/20230221121203-condition-calculation.ts +82 -0
- package/src/server/migrations/20230221162902-jsonb-to-json.ts +51 -0
- package/src/server/migrations/20230411034722-manual-multi-form.ts +282 -0
- package/src/server/migrations/20230612021134-manual-collection-block.ts +138 -0
- package/src/server/triggers/collection.ts +142 -0
- package/src/server/triggers/index.ts +22 -0
- package/src/server/triggers/schedule.ts +567 -0
- package/src/server/types/Execution.ts +26 -0
- package/src/server/types/FlowNode.ts +21 -0
- package/src/server/types/Job.ts +18 -0
- package/src/server/types/Workflow.ts +36 -0
- package/src/server/types/index.ts +4 -0
- /package/lib/server/{models → types}/Execution.js +0 -0
- /package/lib/server/{models → types}/FlowNode.js +0 -0
- /package/lib/server/{models → types}/Job.js +0 -0
- /package/lib/server/{models → types}/Workflow.js +0 -0
package/client.d.ts
CHANGED
package/client.js
CHANGED
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
var _index = _interopRequireWildcard(require("./lib/client"));
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
|
10
|
-
value: true
|
|
11
|
-
});
|
|
12
|
-
var _exportNames = {};
|
|
13
|
-
Object.defineProperty(exports, "default", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _index.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Object.keys(_index).forEach(function (key) {
|
|
21
|
-
if (key === "default" || key === "__esModule") return;
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
23
|
-
if (key in exports && exports[key] === _index[key]) return;
|
|
24
|
-
Object.defineProperty(exports, key, {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _index[key];
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
1
|
+
module.exports = require('./lib/client/index.js');
|
package/lib/client/AddButton.js
CHANGED
|
@@ -11,13 +11,6 @@ function _icons() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _css() {
|
|
15
|
-
const data = require("@emotion/css");
|
|
16
|
-
_css = function _css() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
14
|
function _client() {
|
|
22
15
|
const data = require("@nocobase/client");
|
|
23
16
|
_client = function _client() {
|
|
@@ -147,7 +140,7 @@ function AddButton({
|
|
|
147
140
|
return null;
|
|
148
141
|
}
|
|
149
142
|
return _react().default.createElement("div", {
|
|
150
|
-
className: (0,
|
|
143
|
+
className: (0, _client().cx)(_style.addButtonClass)
|
|
151
144
|
}, _react().default.createElement(_antd().Dropdown, {
|
|
152
145
|
trigger: ['click'],
|
|
153
146
|
menu: menu,
|
package/lib/client/Branch.js
CHANGED
|
@@ -4,23 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Branch = Branch;
|
|
7
|
-
function
|
|
8
|
-
const data =
|
|
9
|
-
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = require("
|
|
16
|
-
|
|
14
|
+
function _react() {
|
|
15
|
+
const data = _interopRequireDefault(require("react"));
|
|
16
|
+
_react = function _react() {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
var _style = require("./style");
|
|
22
21
|
var _AddButton = require("./AddButton");
|
|
23
22
|
var _nodes = require("./nodes");
|
|
23
|
+
var _style = require("./style");
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
function Branch({
|
|
26
26
|
from = null,
|
|
@@ -33,7 +33,7 @@ function Branch({
|
|
|
33
33
|
list.push(node);
|
|
34
34
|
}
|
|
35
35
|
return _react().default.createElement("div", {
|
|
36
|
-
className: (0,
|
|
36
|
+
className: (0, _client().cx)(_style.branchClass)
|
|
37
37
|
}, _react().default.createElement("div", {
|
|
38
38
|
className: "workflow-branch-lines"
|
|
39
39
|
}), controller, _react().default.createElement(_AddButton.AddButton, {
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CanvasContent = CanvasContent;
|
|
7
|
-
function
|
|
8
|
-
const data =
|
|
9
|
-
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
@@ -18,9 +18,9 @@ function _antd() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const data = require("
|
|
23
|
-
|
|
21
|
+
function _react() {
|
|
22
|
+
const data = _interopRequireDefault(require("react"));
|
|
23
|
+
_react = function _react() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
@@ -40,9 +40,9 @@ function CanvasContent({
|
|
|
40
40
|
}, _react().default.createElement(_Branch.Branch, {
|
|
41
41
|
entry: entry
|
|
42
42
|
})), _react().default.createElement("div", {
|
|
43
|
-
className: (0,
|
|
43
|
+
className: (0, _client().cx)('end', _style.nodeCardClass)
|
|
44
44
|
}, _react().default.createElement("div", {
|
|
45
|
-
className: (0,
|
|
45
|
+
className: (0, _client().cx)(_style.nodeMetaClass)
|
|
46
46
|
}, _react().default.createElement(_antd().Tag, {
|
|
47
47
|
color: "#333"
|
|
48
48
|
}, (0, _locale.lang)('End')))));
|
|
@@ -4,9 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ExecutionCanvas = ExecutionCanvas;
|
|
7
|
-
function
|
|
8
|
-
const data =
|
|
9
|
-
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _client2() {
|
|
15
|
+
const data = require("@nocobase/utils/client");
|
|
16
|
+
_client2 = function _client2() {
|
|
10
17
|
return data;
|
|
11
18
|
};
|
|
12
19
|
return data;
|
|
@@ -18,9 +25,9 @@ function _antd() {
|
|
|
18
25
|
};
|
|
19
26
|
return data;
|
|
20
27
|
}
|
|
21
|
-
function
|
|
22
|
-
const data = require("
|
|
23
|
-
|
|
28
|
+
function _react() {
|
|
29
|
+
const data = _interopRequireWildcard(require("react"));
|
|
30
|
+
_react = function _react() {
|
|
24
31
|
return data;
|
|
25
32
|
};
|
|
26
33
|
return data;
|
|
@@ -32,27 +39,13 @@ function _reactRouterDom() {
|
|
|
32
39
|
};
|
|
33
40
|
return data;
|
|
34
41
|
}
|
|
35
|
-
|
|
36
|
-
const data = require("@nocobase/client");
|
|
37
|
-
_client = function _client() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
function _client2() {
|
|
43
|
-
const data = require("@nocobase/utils/client");
|
|
44
|
-
_client2 = function _client2() {
|
|
45
|
-
return data;
|
|
46
|
-
};
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
var _FlowContext = require("./FlowContext");
|
|
50
|
-
var _style = require("./style");
|
|
42
|
+
var _CanvasContent = require("./CanvasContent");
|
|
51
43
|
var _constants = require("./constants");
|
|
44
|
+
var _FlowContext = require("./FlowContext");
|
|
52
45
|
var _locale = require("./locale");
|
|
53
|
-
var _utils = require("./utils");
|
|
54
46
|
var _nodes = require("./nodes");
|
|
55
|
-
var
|
|
47
|
+
var _style = require("./style");
|
|
48
|
+
var _utils = require("./utils");
|
|
56
49
|
const _excluded = ["nodes", "revisions"],
|
|
57
50
|
_excluded2 = ["jobs", "workflow"];
|
|
58
51
|
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); }
|
|
@@ -139,7 +132,7 @@ function JobModal() {
|
|
|
139
132
|
'x-decorator': 'FormItem',
|
|
140
133
|
'x-component': 'Input.JSON',
|
|
141
134
|
'x-component-props': {
|
|
142
|
-
className: (0,
|
|
135
|
+
className: (0, _client().css)`
|
|
143
136
|
padding: 1em;
|
|
144
137
|
background-color: #eee;
|
|
145
138
|
`
|
|
@@ -168,9 +161,9 @@ function ExecutionCanvas() {
|
|
|
168
161
|
var _data$data;
|
|
169
162
|
const _ref2 = (_data$data = data === null || data === void 0 ? void 0 : data.data) !== null && _data$data !== void 0 ? _data$data : {},
|
|
170
163
|
workflow = _ref2.workflow;
|
|
171
|
-
setTitle === null || setTitle === void 0 ? void 0 : setTitle(`${
|
|
164
|
+
setTitle === null || setTitle === void 0 ? void 0 : setTitle(`${workflow !== null && workflow !== void 0 && workflow.title ? `${workflow.title} - ` : ''}${(0, _locale.lang)('Execution history')}`);
|
|
172
165
|
}, [data === null || data === void 0 ? void 0 : data.data]);
|
|
173
|
-
if (!(data
|
|
166
|
+
if (!(data !== null && data !== void 0 && data.data)) {
|
|
174
167
|
if (loading) {
|
|
175
168
|
return _react().default.createElement("div", null, (0, _locale.lang)('Loading'));
|
|
176
169
|
} else {
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ExecutionPage = void 0;
|
|
7
|
-
function _css() {
|
|
8
|
-
const data = require("@emotion/css");
|
|
9
|
-
_css = function _css() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _client() {
|
|
15
8
|
const data = require("@nocobase/client");
|
|
16
9
|
_client = function _client() {
|
|
@@ -38,7 +31,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
38
31
|
const ExecutionPage = () => {
|
|
39
32
|
const params = (0, _reactRouterDom().useParams)();
|
|
40
33
|
return _react().default.createElement("div", {
|
|
41
|
-
className: (0,
|
|
34
|
+
className: (0, _client().cx)(_style.workflowPageClass)
|
|
42
35
|
}, _react().default.createElement(_client().SchemaComponent, {
|
|
43
36
|
schema: {
|
|
44
37
|
type: 'void',
|
|
@@ -11,13 +11,6 @@ function _icons() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _css() {
|
|
15
|
-
const data = require("@emotion/css");
|
|
16
|
-
_css = function _css() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
14
|
function _client() {
|
|
22
15
|
const data = require("@nocobase/client");
|
|
23
16
|
_client = function _client() {
|
|
@@ -129,7 +122,7 @@ function WorkflowCanvas() {
|
|
|
129
122
|
title = _ref2.title;
|
|
130
123
|
setTitle === null || setTitle === void 0 ? void 0 : setTitle(`${(0, _locale.lang)('Workflow')}${title ? `: ${title}` : ''}`);
|
|
131
124
|
}, [data === null || data === void 0 ? void 0 : data.data]);
|
|
132
|
-
if (!(data
|
|
125
|
+
if (!(data !== null && data !== void 0 && data.data)) {
|
|
133
126
|
return _react().default.createElement("div", null, loading ? (0, _locale.lang)('Loading') : (0, _locale.lang)('Load failed'));
|
|
134
127
|
}
|
|
135
128
|
const _ref3 = (_data$data2 = data === null || data === void 0 ? void 0 : data.data) !== null && _data$data2 !== void 0 ? _data$data2 : {},
|
|
@@ -241,7 +234,7 @@ function WorkflowCanvas() {
|
|
|
241
234
|
menu: {
|
|
242
235
|
onClick: onSwitchVersion,
|
|
243
236
|
defaultSelectedKeys: [`${workflow.id}`],
|
|
244
|
-
className: (0,
|
|
237
|
+
className: (0, _client().cx)(_style.workflowVersionDropdownClass),
|
|
245
238
|
items: revisions.sort((a, b) => b.id - a.id).map((item, index) => ({
|
|
246
239
|
key: `${item.id}`,
|
|
247
240
|
icon: item.current ? _react().default.createElement(_icons().RightOutlined, null) : null,
|
|
@@ -256,7 +249,7 @@ function WorkflowCanvas() {
|
|
|
256
249
|
}
|
|
257
250
|
}, _react().default.createElement(_antd().Button, {
|
|
258
251
|
type: "text"
|
|
259
|
-
}, _react().default.createElement("label", null, (0, _locale.lang)('Version')), _react().default.createElement("span", null,
|
|
252
|
+
}, _react().default.createElement("label", null, (0, _locale.lang)('Version')), _react().default.createElement("span", null, workflow !== null && workflow !== void 0 && workflow.id ? `#${workflow.id}` : null), _react().default.createElement(_icons().DownOutlined, null)))), _react().default.createElement(_antd().Switch, {
|
|
260
253
|
checked: workflow.enabled,
|
|
261
254
|
onChange: onToggle,
|
|
262
255
|
checkedChildren: (0, _locale.lang)('On'),
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.WorkflowPage = void 0;
|
|
7
|
-
function _css() {
|
|
8
|
-
const data = require("@emotion/css");
|
|
9
|
-
_css = function _css() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _client() {
|
|
15
8
|
const data = require("@nocobase/client");
|
|
16
9
|
_client = function _client() {
|
|
@@ -38,7 +31,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
38
31
|
const WorkflowPage = () => {
|
|
39
32
|
const params = (0, _reactRouterDom().useParams)();
|
|
40
33
|
return _react().default.createElement("div", {
|
|
41
|
-
className: (0,
|
|
34
|
+
className: (0, _client().cx)(_style.workflowPageClass)
|
|
42
35
|
}, _react().default.createElement(_client().SchemaComponent, {
|
|
43
36
|
schema: {
|
|
44
37
|
type: 'void',
|
|
@@ -26,21 +26,15 @@ function _react() {
|
|
|
26
26
|
};
|
|
27
27
|
return data;
|
|
28
28
|
}
|
|
29
|
+
var _OpenDrawer = _interopRequireDefault(require("./components/OpenDrawer"));
|
|
29
30
|
var _ExecutionLink = require("./ExecutionLink");
|
|
30
|
-
var _ExecutionPage = require("./ExecutionPage");
|
|
31
31
|
var _ExecutionResourceProvider = require("./ExecutionResourceProvider");
|
|
32
|
-
var _WorkflowLink = require("./WorkflowLink");
|
|
33
|
-
var _WorkflowPage = require("./WorkflowPage");
|
|
34
|
-
var _DynamicExpression = require("./components/DynamicExpression");
|
|
35
|
-
var _OpenDrawer = _interopRequireDefault(require("./components/OpenDrawer"));
|
|
36
32
|
var _expression = _interopRequireDefault(require("./interfaces/expression"));
|
|
37
33
|
var _locale = require("./locale");
|
|
38
34
|
var _nodes = require("./nodes");
|
|
39
|
-
var _WorkflowTodo = require("./nodes/manual/WorkflowTodo");
|
|
40
|
-
var _WorkflowTodoBlockInitializer = require("./nodes/manual/WorkflowTodoBlockInitializer");
|
|
41
35
|
var _workflows = require("./schemas/workflows");
|
|
42
36
|
var _triggers = require("./triggers");
|
|
43
|
-
|
|
37
|
+
var _WorkflowLink = require("./WorkflowLink");
|
|
44
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
45
39
|
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); }
|
|
46
40
|
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; }
|
|
@@ -49,8 +43,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
49
43
|
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; }
|
|
50
44
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
51
45
|
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); }
|
|
52
|
-
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; }
|
|
53
|
-
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; }
|
|
54
46
|
// registerField(expressionField.group, 'expression', expressionField);
|
|
55
47
|
const WorkflowContext = _react().default.createContext({});
|
|
56
48
|
exports.WorkflowContext = WorkflowContext;
|
|
@@ -73,19 +65,6 @@ function WorkflowPane() {
|
|
|
73
65
|
const WorkflowProvider = props => {
|
|
74
66
|
const pmCtx = (0, _react().useContext)(_client().PluginManagerContext);
|
|
75
67
|
const cmCtx = (0, _react().useContext)(_client().CollectionManagerContext);
|
|
76
|
-
const _useContext = (0, _react().useContext)(_client().RouteSwitchContext),
|
|
77
|
-
routes = _useContext.routes,
|
|
78
|
-
components = _useContext.components,
|
|
79
|
-
others = _objectWithoutProperties(_useContext, _excluded);
|
|
80
|
-
routes[1].routes.unshift({
|
|
81
|
-
type: 'route',
|
|
82
|
-
path: '/admin/settings/workflow/workflows/:id',
|
|
83
|
-
component: 'WorkflowPage'
|
|
84
|
-
}, {
|
|
85
|
-
type: 'route',
|
|
86
|
-
path: '/admin/settings/workflow/executions/:id',
|
|
87
|
-
component: 'ExecutionPage'
|
|
88
|
-
});
|
|
89
68
|
return _react().default.createElement(_client().SettingsCenterProvider, {
|
|
90
69
|
settings: {
|
|
91
70
|
workflow: {
|
|
@@ -105,24 +84,6 @@ const WorkflowProvider = props => {
|
|
|
105
84
|
value: {
|
|
106
85
|
components: _objectSpread({}, pmCtx === null || pmCtx === void 0 ? void 0 : pmCtx.components)
|
|
107
86
|
}
|
|
108
|
-
}, _react().default.createElement(_client().RouteSwitchContext.Provider, {
|
|
109
|
-
value: _objectSpread(_objectSpread({
|
|
110
|
-
components: _objectSpread(_objectSpread({}, components), {}, {
|
|
111
|
-
WorkflowPage: _WorkflowPage.WorkflowPage,
|
|
112
|
-
ExecutionPage: _ExecutionPage.ExecutionPage
|
|
113
|
-
})
|
|
114
|
-
}, others), {}, {
|
|
115
|
-
routes
|
|
116
|
-
})
|
|
117
|
-
}, _react().default.createElement(_client().SchemaComponentOptions, {
|
|
118
|
-
components: {
|
|
119
|
-
WorkflowTodo: _WorkflowTodo.WorkflowTodo,
|
|
120
|
-
WorkflowTodoBlockInitializer: _WorkflowTodoBlockInitializer.WorkflowTodoBlockInitializer,
|
|
121
|
-
DynamicExpression: _DynamicExpression.DynamicExpression
|
|
122
|
-
},
|
|
123
|
-
scope: {
|
|
124
|
-
useCollectionDataSource: _client().useCollectionDataSource
|
|
125
|
-
}
|
|
126
87
|
}, _react().default.createElement(_client().CollectionManagerContext.Provider, {
|
|
127
88
|
value: _objectSpread(_objectSpread({}, cmCtx), {}, {
|
|
128
89
|
interfaces: _objectSpread(_objectSpread({}, cmCtx.interfaces), {}, {
|
|
@@ -134,6 +95,6 @@ const WorkflowProvider = props => {
|
|
|
134
95
|
triggers: _triggers.triggers,
|
|
135
96
|
instructions: _nodes.instructions
|
|
136
97
|
}
|
|
137
|
-
}, props.children))))
|
|
98
|
+
}, props.children))));
|
|
138
99
|
};
|
|
139
100
|
exports.WorkflowProvider = WorkflowProvider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare function useCollectionUIFields(collection: any): import("@nocobase/client").CollectionFieldOptions[];
|
|
3
|
-
declare const CollectionFieldSet: React.MemoExoticComponent<import("@formily/react").ReactFC<
|
|
3
|
+
declare const CollectionFieldSet: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
|
|
4
4
|
export default CollectionFieldSet;
|
|
@@ -12,16 +12,16 @@ function _icons() {
|
|
|
12
12
|
};
|
|
13
13
|
return data;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const data = require("@
|
|
17
|
-
|
|
15
|
+
function _react() {
|
|
16
|
+
const data = require("@formily/react");
|
|
17
|
+
_react = function _react() {
|
|
18
18
|
return data;
|
|
19
19
|
};
|
|
20
20
|
return data;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const data = require("@
|
|
24
|
-
|
|
22
|
+
function _client() {
|
|
23
|
+
const data = require("@nocobase/client");
|
|
24
|
+
_client = function _client() {
|
|
25
25
|
return data;
|
|
26
26
|
};
|
|
27
27
|
return data;
|
|
@@ -47,13 +47,6 @@ function _reactI18next() {
|
|
|
47
47
|
};
|
|
48
48
|
return data;
|
|
49
49
|
}
|
|
50
|
-
function _client() {
|
|
51
|
-
const data = require("@nocobase/client");
|
|
52
|
-
_client = function _client() {
|
|
53
|
-
return data;
|
|
54
|
-
};
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
57
50
|
var _locale = require("../locale");
|
|
58
51
|
var _variable = require("../variable");
|
|
59
52
|
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); }
|
|
@@ -134,7 +127,7 @@ const CollectionFieldSet = (0, _react().observer)(({
|
|
|
134
127
|
};
|
|
135
128
|
}, [_onChange, unassignedFields, value]);
|
|
136
129
|
return _react2().default.createElement("fieldset", {
|
|
137
|
-
className: (0,
|
|
130
|
+
className: (0, _client().css)`
|
|
138
131
|
margin-top: 0.5em;
|
|
139
132
|
|
|
140
133
|
> .ant-formily-item {
|
|
@@ -157,7 +150,7 @@ const CollectionFieldSet = (0, _react().observer)(({
|
|
|
157
150
|
key: field.name,
|
|
158
151
|
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),
|
|
159
152
|
labelAlign: "left",
|
|
160
|
-
className: (0,
|
|
153
|
+
className: (0, _client().css)`
|
|
161
154
|
.ant-form-item-control-input-content {
|
|
162
155
|
display: flex;
|
|
163
156
|
}
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
function
|
|
8
|
-
const data = require("@
|
|
9
|
-
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
@@ -53,7 +53,7 @@ function _default({
|
|
|
53
53
|
const option = getNumberOption(value);
|
|
54
54
|
const quantity = Math.round(value / option.value);
|
|
55
55
|
return _react().default.createElement("fieldset", {
|
|
56
|
-
className: (0,
|
|
56
|
+
className: (0, _client().css)`
|
|
57
57
|
display: flex;
|
|
58
58
|
gap: 0.5em;
|
|
59
59
|
`
|
|
@@ -62,7 +62,7 @@ function _default({
|
|
|
62
62
|
value: quantity,
|
|
63
63
|
onChange: v => _onChange(Math.round(v * option.value))
|
|
64
64
|
}), _react().default.createElement(_antd().Select, {
|
|
65
|
-
|
|
65
|
+
popupMatchSelectWidth: false,
|
|
66
66
|
value: option.value,
|
|
67
67
|
onChange: unit => _onChange(Math.round(quantity * unit))
|
|
68
68
|
}, UnitOptions.map(item => _react().default.createElement(_antd().Select.Option, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DynamicExpression: React.ForwardRefExoticComponent<
|
|
2
|
+
export declare const DynamicExpression: React.ForwardRefExoticComponent<Omit<Partial<Omit<{
|
|
3
3
|
children?: React.ReactNode;
|
|
4
|
-
}, string | number | symbol> &
|
|
4
|
+
}, string | number | symbol> & Omit<any, "ref"> & {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
-
}>,
|
|
6
|
+
}>, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -69,6 +69,9 @@ const InternalExpression = (0, _react().observer)(props => {
|
|
|
69
69
|
_useState2 = _slicedToArray(_useState, 2),
|
|
70
70
|
collection = _useState2[0],
|
|
71
71
|
setCollection = _useState2[1];
|
|
72
|
+
const compile = (0, _client().useCompile)();
|
|
73
|
+
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
74
|
+
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
72
75
|
(0, _react().useFormEffects)(() => {
|
|
73
76
|
(0, _core().onFormInitialValuesChange)(form => {
|
|
74
77
|
setCollection(form.values.sourceCollection);
|
|
@@ -78,8 +81,10 @@ const InternalExpression = (0, _react().observer)(props => {
|
|
|
78
81
|
onChange(null);
|
|
79
82
|
});
|
|
80
83
|
});
|
|
81
|
-
const options = (0, _variable.
|
|
82
|
-
collection
|
|
84
|
+
const options = (0, _variable.getCollectionFieldOptions)({
|
|
85
|
+
collection,
|
|
86
|
+
compile,
|
|
87
|
+
getCollectionFields
|
|
83
88
|
});
|
|
84
89
|
return _react2().default.createElement(_client().Variable.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
85
90
|
scope: options
|
|
@@ -91,8 +96,13 @@ function Result(props) {
|
|
|
91
96
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
92
97
|
t = _useTranslation.t;
|
|
93
98
|
const values = (0, _client().useRecord)();
|
|
94
|
-
const
|
|
95
|
-
|
|
99
|
+
const compile = (0, _client().useCompile)();
|
|
100
|
+
const _useCollectionManager2 = (0, _client().useCollectionManager)(),
|
|
101
|
+
getCollectionFields = _useCollectionManager2.getCollectionFields;
|
|
102
|
+
const options = (0, _react2().useMemo)(() => (0, _variable.getCollectionFieldOptions)({
|
|
103
|
+
collection: values.sourceCollection,
|
|
104
|
+
compile,
|
|
105
|
+
getCollectionFields
|
|
96
106
|
}), [values.sourceCollection, values.sourceCollection]);
|
|
97
107
|
return props.value ? _react2().default.createElement(_client().Variable.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
98
108
|
scope: options
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const FieldsSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<
|
|
2
|
+
export declare const FieldsSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FieldsSelect = void 0;
|
|
7
7
|
function _react() {
|
|
8
|
-
const data =
|
|
8
|
+
const data = require("@formily/react");
|
|
9
9
|
_react = function _react() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
@@ -19,7 +19,7 @@ function _antd() {
|
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
21
|
function _react2() {
|
|
22
|
-
const data = require("
|
|
22
|
+
const data = _interopRequireDefault(require("react"));
|
|
23
23
|
_react2 = function _react2() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
@@ -41,19 +41,19 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
41
41
|
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); }
|
|
42
42
|
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; }
|
|
43
43
|
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; }
|
|
44
|
-
const FieldsSelect = (0,
|
|
44
|
+
const FieldsSelect = (0, _react().observer)(props => {
|
|
45
45
|
const _props$filter = props.filter,
|
|
46
46
|
filter = _props$filter === void 0 ? () => true : _props$filter,
|
|
47
47
|
others = _objectWithoutProperties(props, _excluded);
|
|
48
48
|
const compile = (0, _client().useCompile)();
|
|
49
49
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
50
50
|
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
51
|
-
const _useForm = (0,
|
|
51
|
+
const _useForm = (0, _react().useForm)(),
|
|
52
52
|
values = _useForm.values;
|
|
53
53
|
const fields = getCollectionFields(values === null || values === void 0 ? void 0 : values.collection);
|
|
54
|
-
return
|
|
54
|
+
return _react2().default.createElement(_antd().Select, _objectSpread(_objectSpread({
|
|
55
55
|
className: "full-width",
|
|
56
|
-
|
|
56
|
+
popupMatchSelectWidth: false
|
|
57
57
|
}, others), {}, {
|
|
58
58
|
options: fields.filter(filter).map(field => {
|
|
59
59
|
var _field$uiSchema;
|
|
@@ -4,23 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.NodeDescription = NodeDescription;
|
|
7
|
-
function
|
|
8
|
-
const data =
|
|
9
|
-
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = require("
|
|
16
|
-
|
|
14
|
+
function _antd() {
|
|
15
|
+
const data = require("antd");
|
|
16
|
+
_antd = function _antd() {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const data = require("
|
|
23
|
-
|
|
21
|
+
function _react() {
|
|
22
|
+
const data = _interopRequireDefault(require("react"));
|
|
23
|
+
_react = function _react() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
@@ -29,7 +29,7 @@ var _locale = require("../locale");
|
|
|
29
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
30
|
function NodeDescription(props) {
|
|
31
31
|
const instruction = props.instruction;
|
|
32
|
-
const className = (0,
|
|
32
|
+
const className = (0, _client().css)`
|
|
33
33
|
margin-bottom: 1.5em;
|
|
34
34
|
padding: 1em;
|
|
35
35
|
background: #f6f6f6;
|
|
@@ -54,6 +54,6 @@ function NodeDescription(props) {
|
|
|
54
54
|
}
|
|
55
55
|
`;
|
|
56
56
|
return _react().default.createElement("div", {
|
|
57
|
-
className: (0,
|
|
57
|
+
className: (0, _client().cx)(className, props.className)
|
|
58
58
|
}, _react().default.createElement("dl", null, _react().default.createElement("dt", null, (0, _locale.lang)('Node type')), _react().default.createElement("dd", null, _react().default.createElement(_antd().Tag, null, instruction.title))), instruction.description ? _react().default.createElement("p", null, instruction.description) : null);
|
|
59
59
|
}
|