@nocobase/plugin-workflow 0.10.1-alpha.1 → 0.11.1-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 +13 -11
- package/lib/client/Branch.js +10 -8
- package/lib/client/CanvasContent.js +12 -10
- package/lib/client/ExecutionCanvas.js +37 -33
- package/lib/client/ExecutionPage.js +4 -9
- package/lib/client/WorkflowCanvas.js +18 -15
- package/lib/client/WorkflowPage.js +4 -9
- package/lib/client/WorkflowProvider.js +1 -40
- package/lib/client/components/CollectionBlockInitializer.js +3 -3
- package/lib/client/components/CollectionFieldset.d.ts +1 -1
- package/lib/client/components/CollectionFieldset.js +15 -16
- package/lib/client/components/Duration.js +5 -5
- package/lib/client/components/DynamicExpression.d.ts +3 -3
- package/lib/client/components/FieldsSelect.d.ts +1 -1
- package/lib/client/components/FieldsSelect.js +10 -7
- package/lib/client/components/NodeDescription.js +45 -31
- 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/locale/zh-CN.d.ts +5 -1
- package/lib/client/locale/zh-CN.js +6 -2
- package/lib/client/nodes/aggregate.d.ts +8 -3
- package/lib/client/nodes/aggregate.js +5 -4
- package/lib/client/nodes/calculation.d.ts +6 -4
- package/lib/client/nodes/calculation.js +22 -28
- package/lib/client/nodes/condition.d.ts +2 -10
- package/lib/client/nodes/condition.js +19 -37
- package/lib/client/nodes/create.d.ts +5 -6
- package/lib/client/nodes/create.js +1 -3
- package/lib/client/nodes/destroy.d.ts +1 -1
- package/lib/client/nodes/index.d.ts +2 -3
- package/lib/client/nodes/index.js +95 -102
- package/lib/client/nodes/loop.d.ts +1 -1
- package/lib/client/nodes/loop.js +46 -54
- package/lib/client/nodes/manual/FormBlockInitializer.js +6 -5
- package/lib/client/nodes/manual/ModeConfig.js +23 -30
- package/lib/client/nodes/manual/SchemaConfig.d.ts +4 -5
- package/lib/client/nodes/manual/SchemaConfig.js +180 -25
- package/lib/client/nodes/manual/WorkflowTodo.js +95 -110
- 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/create.js +8 -1
- package/lib/client/nodes/manual/forms/custom.js +22 -22
- package/lib/client/nodes/manual/forms/update.js +8 -1
- package/lib/client/nodes/manual/index.d.ts +6 -1
- package/lib/client/nodes/manual/index.js +5 -4
- package/lib/client/nodes/parallel.js +23 -20
- package/lib/client/nodes/query.d.ts +3 -5
- package/lib/client/nodes/query.js +1 -3
- package/lib/client/nodes/request.d.ts +2 -2
- package/lib/client/nodes/request.js +7 -7
- package/lib/client/nodes/sql.d.ts +26 -0
- package/lib/client/{triggers/schedule/DateFieldsSelect.js → nodes/sql.js} +37 -46
- package/lib/client/nodes/update.d.ts +2 -2
- package/lib/client/nodes/update.js +1 -1
- package/lib/client/schemas/collection.d.ts +3 -4
- package/lib/client/schemas/collection.js +11 -17
- package/lib/client/style.d.ts +18 -13
- package/lib/client/style.js +315 -292
- package/lib/client/triggers/collection.d.ts +13 -13
- package/lib/client/triggers/collection.js +5 -1
- package/lib/client/triggers/index.d.ts +3 -4
- package/lib/client/triggers/index.js +51 -53
- package/lib/client/triggers/schedule/EndsByField.js +11 -11
- package/lib/client/triggers/schedule/OnField.js +45 -33
- package/lib/client/triggers/schedule/RepeatField.js +4 -4
- package/lib/client/triggers/schedule/ScheduleConfig.js +24 -31
- package/lib/client/triggers/schedule/index.d.ts +1 -1
- package/lib/client/triggers/schedule/index.js +32 -20
- package/lib/client/variable.d.ts +31 -13
- package/lib/client/variable.js +44 -29
- package/lib/server/Plugin.d.ts +3 -6
- package/lib/server/Plugin.js +15 -12
- package/lib/server/Processor.d.ts +3 -5
- package/lib/server/Processor.js +2 -2
- 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 +2 -2
- package/lib/server/instructions/create.js +13 -13
- 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/index.js +1 -1
- package/lib/server/instructions/loop.d.ts +1 -2
- package/lib/server/instructions/manual/actions.js +19 -7
- package/lib/server/instructions/manual/forms/create.js +7 -1
- package/lib/server/instructions/manual/forms/index.d.ts +1 -1
- package/lib/server/instructions/manual/forms/update.js +7 -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/query.js +8 -1
- package/lib/server/instructions/request.d.ts +3 -3
- package/lib/server/instructions/request.js +5 -2
- package/lib/server/instructions/sql.d.ts +12 -0
- package/lib/server/instructions/sql.js +34 -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/migrations/20230710115902-manual-action-values.d.ts +4 -0
- package/lib/server/migrations/20230710115902-manual-action-values.js +97 -0
- package/lib/server/triggers/collection.d.ts +1 -1
- package/lib/server/triggers/collection.js +15 -13
- 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/lib/server/utils.d.ts +2 -0
- package/lib/server/utils.js +21 -0
- package/package.json +39 -18
- package/server.d.ts +2 -3
- package/server.js +1 -30
- package/src/client/AddButton.tsx +111 -0
- package/src/client/Branch.tsx +37 -0
- package/src/client/CanvasContent.tsx +25 -0
- package/src/client/ExecutionCanvas.tsx +166 -0
- package/src/client/ExecutionLink.tsx +16 -0
- package/src/client/ExecutionPage.tsx +45 -0
- package/src/client/ExecutionResourceProvider.tsx +21 -0
- package/src/client/FlowContext.ts +7 -0
- package/src/client/WorkflowCanvas.tsx +221 -0
- package/src/client/WorkflowLink.tsx +16 -0
- package/src/client/WorkflowPage.tsx +52 -0
- package/src/client/WorkflowProvider.tsx +84 -0
- package/src/client/components/CollectionBlockInitializer.tsx +71 -0
- package/src/client/components/CollectionFieldset.tsx +160 -0
- package/src/client/components/Duration.tsx +45 -0
- package/src/client/components/DynamicExpression.tsx +53 -0
- package/src/client/components/FieldsSelect.tsx +32 -0
- package/src/client/components/FilterDynamicComponent.tsx +15 -0
- package/src/client/components/NodeDescription.tsx +51 -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 +248 -0
- package/src/client/nodes/aggregate.tsx +327 -0
- package/src/client/nodes/calculation.tsx +216 -0
- package/src/client/nodes/condition.tsx +463 -0
- package/src/client/nodes/create.tsx +85 -0
- package/src/client/nodes/delay.tsx +37 -0
- package/src/client/nodes/destroy.tsx +34 -0
- package/src/client/nodes/index.tsx +485 -0
- package/src/client/nodes/loop.tsx +144 -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 +69 -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 +509 -0
- package/src/client/nodes/manual/WorkflowTodo.tsx +607 -0
- package/src/client/nodes/manual/WorkflowTodoBlockInitializer.tsx +28 -0
- package/src/client/nodes/manual/forms/create.tsx +92 -0
- package/src/client/nodes/manual/forms/custom.tsx +392 -0
- package/src/client/nodes/manual/forms/update.tsx +134 -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 +138 -0
- package/src/client/nodes/query.tsx +88 -0
- package/src/client/nodes/request.tsx +185 -0
- package/src/client/nodes/sql.tsx +37 -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 +347 -0
- package/src/client/triggers/collection.tsx +190 -0
- package/src/client/triggers/index.tsx +311 -0
- package/src/client/triggers/schedule/EndsByField.tsx +40 -0
- package/src/client/triggers/schedule/OnField.tsx +64 -0
- package/src/client/triggers/schedule/RepeatField.tsx +116 -0
- package/src/client/triggers/schedule/ScheduleConfig.tsx +227 -0
- package/src/client/triggers/schedule/constants.ts +4 -0
- package/src/client/triggers/schedule/index.tsx +78 -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 +318 -0
- package/src/index.ts +1 -0
- package/src/server/Plugin.ts +355 -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 +27 -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 +1173 -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 +247 -0
- package/src/server/__tests__/instructions/sql.test.ts +162 -0
- package/src/server/__tests__/instructions/update.test.ts +189 -0
- package/src/server/__tests__/triggers/collection.test.ts +333 -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 +39 -0
- package/src/server/instructions/delay.ts +105 -0
- package/src/server/instructions/destroy.ts +23 -0
- package/src/server/instructions/index.ts +64 -0
- package/src/server/instructions/loop.ts +99 -0
- package/src/server/instructions/manual/actions.ts +91 -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 +23 -0
- package/src/server/instructions/manual/forms/index.ts +12 -0
- package/src/server/instructions/manual/forms/update.ts +23 -0
- package/src/server/instructions/manual/index.ts +184 -0
- package/src/server/instructions/parallel.ts +121 -0
- package/src/server/instructions/query.ts +42 -0
- package/src/server/instructions/request.ts +88 -0
- package/src/server/instructions/sql.ts +25 -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/migrations/20230710115902-manual-action-values.ts +78 -0
- package/src/server/triggers/collection.ts +146 -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/src/server/utils.ts +17 -0
- package/lib/client/triggers/schedule/DateFieldsSelect.d.ts +0 -2
- /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
|
@@ -67,7 +67,7 @@ declare const _default: {
|
|
|
67
67
|
title: string;
|
|
68
68
|
'x-component-props': {
|
|
69
69
|
className: string;
|
|
70
|
-
|
|
70
|
+
popupMatchSelectWidth: boolean;
|
|
71
71
|
};
|
|
72
72
|
'x-reactions': any[];
|
|
73
73
|
type: string;
|
|
@@ -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<import("@formily/react").ReactFC<
|
|
174
|
+
FieldsSelect: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
|
|
175
175
|
ValueBlock: (() => JSX.Element) & {
|
|
176
176
|
Initializer: (props: any) => JSX.Element;
|
|
177
177
|
Result: (props: any) => JSX.Element;
|
|
@@ -181,8 +181,13 @@ declare const _default: {
|
|
|
181
181
|
useVariables({ id, title }: {
|
|
182
182
|
id: any;
|
|
183
183
|
title: any;
|
|
184
|
-
}, { types }: {
|
|
184
|
+
}, { types, fieldNames }: {
|
|
185
185
|
types: any;
|
|
186
|
+
fieldNames?: {
|
|
187
|
+
readonly label: "label";
|
|
188
|
+
readonly value: "value";
|
|
189
|
+
readonly children: "children";
|
|
190
|
+
};
|
|
186
191
|
}): {
|
|
187
192
|
value: string;
|
|
188
193
|
label: any;
|
|
@@ -84,7 +84,7 @@ function AssociatedConfig(_ref) {
|
|
|
84
84
|
p = [...matched[1].trim().split('.').slice(0, -1), fieldName];
|
|
85
85
|
}
|
|
86
86
|
const onSelectChange = (0, _react().useCallback)((path, option) => {
|
|
87
|
-
if (!(path
|
|
87
|
+
if (!(path !== null && path !== void 0 && path.length)) {
|
|
88
88
|
setValuesIn('collection', null);
|
|
89
89
|
onChange({});
|
|
90
90
|
return;
|
|
@@ -325,14 +325,15 @@ var _default = {
|
|
|
325
325
|
id,
|
|
326
326
|
title
|
|
327
327
|
}, {
|
|
328
|
-
types
|
|
328
|
+
types,
|
|
329
|
+
fieldNames = _variable.defaultFieldNames
|
|
329
330
|
}) {
|
|
330
331
|
if (types && !types.some(type => type in _variable.BaseTypeSets || Object.values(_variable.BaseTypeSets).some(set => set.has(type)))) {
|
|
331
332
|
return null;
|
|
332
333
|
}
|
|
333
334
|
return {
|
|
334
|
-
value: `${id}`,
|
|
335
|
-
label: title
|
|
335
|
+
[fieldNames.value]: `${id}`,
|
|
336
|
+
[fieldNames.label]: title
|
|
336
337
|
};
|
|
337
338
|
},
|
|
338
339
|
useInitializers(node) {
|
|
@@ -18,7 +18,7 @@ declare const _default: {
|
|
|
18
18
|
'x-decorator': string;
|
|
19
19
|
'x-component': string;
|
|
20
20
|
'x-component-props': {
|
|
21
|
-
options: any
|
|
21
|
+
options: any;
|
|
22
22
|
};
|
|
23
23
|
required: boolean;
|
|
24
24
|
default: string;
|
|
@@ -95,9 +95,11 @@ declare const _default: {
|
|
|
95
95
|
useVariables({ id, title }: {
|
|
96
96
|
id: any;
|
|
97
97
|
title: any;
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
}, { types, fieldNames }: {
|
|
99
|
+
types: any;
|
|
100
|
+
fieldNames?: import("@nocobase/client").FieldNames;
|
|
101
|
+
}): {
|
|
102
|
+
[x: string]: any;
|
|
101
103
|
};
|
|
102
104
|
useInitializers(node: any): SchemaInitializerItemOptions;
|
|
103
105
|
};
|
|
@@ -4,16 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data = require("@
|
|
9
|
-
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _antd() {
|
|
15
|
-
const data = require("@formily/antd");
|
|
16
|
-
_antd = function _antd() {
|
|
7
|
+
function _antdV() {
|
|
8
|
+
const data = require("@formily/antd-v5");
|
|
9
|
+
_antdV = function _antdV() {
|
|
17
10
|
return data;
|
|
18
11
|
};
|
|
19
12
|
return data;
|
|
@@ -39,9 +32,9 @@ function _client3() {
|
|
|
39
32
|
};
|
|
40
33
|
return data;
|
|
41
34
|
}
|
|
42
|
-
function
|
|
35
|
+
function _antd() {
|
|
43
36
|
const data = require("antd");
|
|
44
|
-
|
|
37
|
+
_antd = function _antd() {
|
|
45
38
|
return data;
|
|
46
39
|
};
|
|
47
40
|
return data;
|
|
@@ -62,10 +55,10 @@ function _reactI18next() {
|
|
|
62
55
|
}
|
|
63
56
|
var _FlowContext = require("../FlowContext");
|
|
64
57
|
var _RadioWithTooltip = require("../components/RadioWithTooltip");
|
|
58
|
+
var _ValueBlock = require("../components/ValueBlock");
|
|
65
59
|
var _renderEngineReference = require("../components/renderEngineReference");
|
|
66
60
|
var _locale = require("../locale");
|
|
67
61
|
var _variable = require("../variable");
|
|
68
|
-
var _ValueBlock = require("../components/ValueBlock");
|
|
69
62
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
70
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; }
|
|
71
64
|
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; }
|
|
@@ -98,27 +91,27 @@ const DynamicConfig = ({
|
|
|
98
91
|
getCollection
|
|
99
92
|
})]
|
|
100
93
|
});
|
|
101
|
-
return _react().default.createElement(
|
|
94
|
+
return _react().default.createElement(_antdV().FormLayout, {
|
|
102
95
|
layout: "vertical"
|
|
103
|
-
}, _react().default.createElement(
|
|
96
|
+
}, _react().default.createElement(_antdV().FormItem, {
|
|
104
97
|
colon: true,
|
|
105
98
|
label: t('Expression type', {
|
|
106
99
|
ns: _locale.NAMESPACE
|
|
107
100
|
})
|
|
108
|
-
}, _react().default.createElement(
|
|
109
|
-
value: value === false ? false : value ||
|
|
101
|
+
}, _react().default.createElement(_antd().Radio.Group, {
|
|
102
|
+
value: value === false ? false : value || '',
|
|
110
103
|
onChange: ev => {
|
|
111
104
|
_onChange(ev.target.value);
|
|
112
105
|
}
|
|
113
|
-
}, _react().default.createElement(
|
|
106
|
+
}, _react().default.createElement(_antd().Radio, {
|
|
114
107
|
value: false
|
|
115
108
|
}, t('Static', {
|
|
116
109
|
ns: _locale.NAMESPACE
|
|
117
|
-
})), _react().default.createElement(
|
|
118
|
-
value: value ||
|
|
110
|
+
})), _react().default.createElement(_antd().Radio, {
|
|
111
|
+
value: value || ''
|
|
119
112
|
}, t('Dynamic', {
|
|
120
113
|
ns: _locale.NAMESPACE
|
|
121
|
-
})))), value !== false ? _react().default.createElement(
|
|
114
|
+
})))), value !== false ? _react().default.createElement(_antdV().FormItem, {
|
|
122
115
|
label: t('Select dynamic expression', {
|
|
123
116
|
ns: _locale.NAMESPACE
|
|
124
117
|
}),
|
|
@@ -126,7 +119,7 @@ const DynamicConfig = ({
|
|
|
126
119
|
ns: _locale.NAMESPACE
|
|
127
120
|
})
|
|
128
121
|
}, _react().default.createElement(_client().Variable.Input, {
|
|
129
|
-
value: value ||
|
|
122
|
+
value: value || '',
|
|
130
123
|
onChange: v => _onChange(v),
|
|
131
124
|
scope: scope
|
|
132
125
|
})) : null);
|
|
@@ -262,7 +255,7 @@ var _default = {
|
|
|
262
255
|
}), {})
|
|
263
256
|
});
|
|
264
257
|
return _react().default.createElement("pre", {
|
|
265
|
-
className: (0,
|
|
258
|
+
className: (0, _client().css)`
|
|
266
259
|
margin: 0;
|
|
267
260
|
`
|
|
268
261
|
}, JSON.stringify(result, null, 2));
|
|
@@ -273,15 +266,16 @@ var _default = {
|
|
|
273
266
|
useVariables({
|
|
274
267
|
id,
|
|
275
268
|
title
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
|
|
269
|
+
}, {
|
|
270
|
+
types,
|
|
271
|
+
fieldNames = _client().defaultFieldNames
|
|
272
|
+
}) {
|
|
279
273
|
if (types && !types.some(type => type in _variable.BaseTypeSets || Object.values(_variable.BaseTypeSets).some(set => set.has(type)))) {
|
|
280
274
|
return null;
|
|
281
275
|
}
|
|
282
276
|
return {
|
|
283
|
-
value: id
|
|
284
|
-
label: title
|
|
277
|
+
[fieldNames.value]: `${id}`,
|
|
278
|
+
[fieldNames.label]: title
|
|
285
279
|
};
|
|
286
280
|
},
|
|
287
281
|
useInitializers(node) {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { Registry } from '@nocobase/utils/client';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { RadioWithTooltip } from '../components/RadioWithTooltip';
|
|
4
3
|
import { useWorkflowVariableOptions } from '../variable';
|
|
5
|
-
|
|
6
|
-
name: string;
|
|
7
|
-
type: 'boolean' | 'number' | 'string' | 'date' | 'unknown' | 'null' | 'array';
|
|
8
|
-
group: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const calculators: Registry<Calculator>;
|
|
4
|
+
export declare const calculators: any;
|
|
11
5
|
declare function CalculationConfig({ value, onChange }: {
|
|
12
6
|
value: any;
|
|
13
7
|
onChange: any;
|
|
@@ -37,9 +31,7 @@ declare const _default: {
|
|
|
37
31
|
'x-decorator': string;
|
|
38
32
|
'x-component': string;
|
|
39
33
|
'x-component-props': {
|
|
40
|
-
options:
|
|
41
|
-
label: string;
|
|
42
|
-
})[];
|
|
34
|
+
options: unknown;
|
|
43
35
|
};
|
|
44
36
|
required: boolean;
|
|
45
37
|
default: string;
|
|
@@ -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() {
|
|
@@ -62,11 +55,11 @@ function _reactI18next() {
|
|
|
62
55
|
}
|
|
63
56
|
var _ = require(".");
|
|
64
57
|
var _Branch = require("../Branch");
|
|
65
|
-
var _FlowContext = require("../FlowContext");
|
|
66
58
|
var _RadioWithTooltip = require("../components/RadioWithTooltip");
|
|
67
59
|
var _renderEngineReference = require("../components/renderEngineReference");
|
|
60
|
+
var _FlowContext = require("../FlowContext");
|
|
68
61
|
var _locale = require("../locale");
|
|
69
|
-
var _style = require("../style");
|
|
62
|
+
var _style = _interopRequireDefault(require("../style"));
|
|
70
63
|
var _variable = require("../variable");
|
|
71
64
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
72
65
|
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; }
|
|
@@ -190,7 +183,7 @@ function Calculation({
|
|
|
190
183
|
const compile = (0, _client().useCompile)();
|
|
191
184
|
const options = (0, _variable.useWorkflowVariableOptions)();
|
|
192
185
|
return _react().default.createElement("fieldset", {
|
|
193
|
-
className: (0,
|
|
186
|
+
className: (0, _client().css)`
|
|
194
187
|
display: flex;
|
|
195
188
|
gap: 0.5em;
|
|
196
189
|
align-items: center;
|
|
@@ -211,7 +204,7 @@ function Calculation({
|
|
|
211
204
|
calculator: v
|
|
212
205
|
}),
|
|
213
206
|
placeholder: (0, _locale.lang)('Calculator'),
|
|
214
|
-
|
|
207
|
+
popupMatchSelectWidth: false
|
|
215
208
|
}, calculatorGroups.filter(group => Boolean(getGroupCalculators(group.value).length)).map(group => _react().default.createElement(_antd().Select.OptGroup, {
|
|
216
209
|
key: group.value,
|
|
217
210
|
label: compile(group.title)
|
|
@@ -242,7 +235,7 @@ function CalculationItem({
|
|
|
242
235
|
_value$operands = value.operands,
|
|
243
236
|
operands = _value$operands === void 0 ? [] : _value$operands;
|
|
244
237
|
return _react().default.createElement("div", {
|
|
245
|
-
className: (0,
|
|
238
|
+
className: (0, _client().css)`
|
|
246
239
|
display: flex;
|
|
247
240
|
position: relative;
|
|
248
241
|
margin: 0.5em 0;
|
|
@@ -304,7 +297,7 @@ function CalculationGroup({
|
|
|
304
297
|
}));
|
|
305
298
|
}
|
|
306
299
|
return _react().default.createElement("div", {
|
|
307
|
-
className: (0,
|
|
300
|
+
className: (0, _client().cx)('node-type-condition-group', (0, _client().css)`
|
|
308
301
|
position: relative;
|
|
309
302
|
width: 100%;
|
|
310
303
|
.node-type-condition-group {
|
|
@@ -317,7 +310,7 @@ function CalculationGroup({
|
|
|
317
310
|
}
|
|
318
311
|
`)
|
|
319
312
|
}, _react().default.createElement("div", {
|
|
320
|
-
className: (0,
|
|
313
|
+
className: (0, _client().css)`
|
|
321
314
|
display: flex;
|
|
322
315
|
align-items: center;
|
|
323
316
|
gap: 0.5em;
|
|
@@ -343,7 +336,7 @@ function CalculationGroup({
|
|
|
343
336
|
onChange: onItemChange.bind(this, i),
|
|
344
337
|
onRemove: () => _onRemove(i)
|
|
345
338
|
}))), _react().default.createElement("div", {
|
|
346
|
-
className: (0,
|
|
339
|
+
className: (0, _client().css)`
|
|
347
340
|
button {
|
|
348
341
|
padding: 0;
|
|
349
342
|
&:not(:last-child) {
|
|
@@ -482,6 +475,8 @@ var _default = {
|
|
|
482
475
|
t = _useTranslation2.t;
|
|
483
476
|
const _useFlowContext = (0, _FlowContext.useFlowContext)(),
|
|
484
477
|
nodes = _useFlowContext.nodes;
|
|
478
|
+
const _useStyles = (0, _style.default)(),
|
|
479
|
+
styles = _useStyles.styles;
|
|
485
480
|
const id = data.id,
|
|
486
481
|
rejectOnFalse = data.config.rejectOnFalse;
|
|
487
482
|
const trueEntry = nodes.find(item => item.upstreamId === id && item.branchIndex === 1);
|
|
@@ -489,9 +484,9 @@ var _default = {
|
|
|
489
484
|
return _react().default.createElement(_.NodeDefaultView, {
|
|
490
485
|
data: data
|
|
491
486
|
}, rejectOnFalse ? null : _react().default.createElement("div", {
|
|
492
|
-
className: (0,
|
|
487
|
+
className: (0, _client().cx)(styles.nodeSubtreeClass)
|
|
493
488
|
}, _react().default.createElement("div", {
|
|
494
|
-
className: (0,
|
|
489
|
+
className: (0, _client().cx)(styles.branchBlockClass, (0, _client().css)`
|
|
495
490
|
> * > .workflow-branch-lines {
|
|
496
491
|
> button {
|
|
497
492
|
display: none;
|
|
@@ -507,28 +502,15 @@ var _default = {
|
|
|
507
502
|
entry: trueEntry,
|
|
508
503
|
branchIndex: 1
|
|
509
504
|
})), _react().default.createElement("div", {
|
|
510
|
-
className:
|
|
511
|
-
position: relative;
|
|
512
|
-
height: 2em;
|
|
513
|
-
overflow: visible;
|
|
514
|
-
|
|
515
|
-
> span {
|
|
516
|
-
position: absolute;
|
|
517
|
-
top: calc(1.5em - 1px);
|
|
518
|
-
line-height: 1em;
|
|
519
|
-
color: #999;
|
|
520
|
-
background-color: #f0f2f5;
|
|
521
|
-
padding: 1px;
|
|
522
|
-
}
|
|
523
|
-
`
|
|
505
|
+
className: styles.conditionClass
|
|
524
506
|
}, _react().default.createElement("span", {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
507
|
+
style: {
|
|
508
|
+
right: '4em'
|
|
509
|
+
}
|
|
528
510
|
}, t('No')), _react().default.createElement("span", {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
511
|
+
style: {
|
|
512
|
+
left: '4em'
|
|
513
|
+
}
|
|
532
514
|
}, t('Yes')))));
|
|
533
515
|
},
|
|
534
516
|
scope: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { SchemaInitializerItemOptions, useCollectionDataSource } from '@nocobase/client';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
@@ -13,7 +14,7 @@ declare const _default: {
|
|
|
13
14
|
'x-decorator': string;
|
|
14
15
|
'x-component': string;
|
|
15
16
|
'x-component-props': {
|
|
16
|
-
|
|
17
|
+
popupMatchSelectWidth: boolean;
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
20
|
params: {
|
|
@@ -37,9 +38,8 @@ declare const _default: {
|
|
|
37
38
|
'x-decorator': string;
|
|
38
39
|
'x-component': string;
|
|
39
40
|
'x-component-props': {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
filter(field: any): boolean;
|
|
41
|
+
useCollection(): any;
|
|
42
|
+
className: string;
|
|
43
43
|
};
|
|
44
44
|
'x-reactions': {
|
|
45
45
|
dependencies: string[];
|
|
@@ -58,8 +58,7 @@ declare const _default: {
|
|
|
58
58
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
59
59
|
};
|
|
60
60
|
components: {
|
|
61
|
-
CollectionFieldset: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<
|
|
62
|
-
FieldsSelect: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
61
|
+
CollectionFieldset: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
|
|
63
62
|
};
|
|
64
63
|
useVariables({ id, title, config }: {
|
|
65
64
|
id: any;
|
|
@@ -16,7 +16,6 @@ var _CollectionFieldset = _interopRequireDefault(require("../components/Collecti
|
|
|
16
16
|
var _locale = require("../locale");
|
|
17
17
|
var _CollectionBlockInitializer = require("../components/CollectionBlockInitializer");
|
|
18
18
|
var _variable = require("../variable");
|
|
19
|
-
var _FieldsSelect = require("../components/FieldsSelect");
|
|
20
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
20
|
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; }
|
|
22
21
|
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; }
|
|
@@ -59,8 +58,7 @@ var _default = {
|
|
|
59
58
|
useCollectionDataSource: _client().useCollectionDataSource
|
|
60
59
|
},
|
|
61
60
|
components: {
|
|
62
|
-
CollectionFieldset: _CollectionFieldset.default
|
|
63
|
-
FieldsSelect: _FieldsSelect.FieldsSelect
|
|
61
|
+
CollectionFieldset: _CollectionFieldset.default
|
|
64
62
|
},
|
|
65
63
|
useVariables({
|
|
66
64
|
id,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ISchema } from '@formily/react';
|
|
3
|
-
import { Registry } from '@nocobase/utils/client';
|
|
4
2
|
import { SchemaInitializerItemOptions } from '@nocobase/client';
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import { VariableOption, VariableOptions } from '../variable';
|
|
6
5
|
export interface Instruction {
|
|
7
6
|
title: string;
|
|
@@ -32,7 +31,7 @@ export interface Instruction {
|
|
|
32
31
|
[key: string]: any;
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
|
-
export declare const instructions:
|
|
34
|
+
export declare const instructions: any;
|
|
36
35
|
export declare const NodeContext: React.Context<any>;
|
|
37
36
|
export declare function useNodeContext(): any;
|
|
38
37
|
export declare function useAvailableUpstreams(node: any): any[];
|