@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
|
@@ -77,7 +77,7 @@ var _default = {
|
|
|
77
77
|
'x-decorator': 'FormItem',
|
|
78
78
|
'x-component': 'Select',
|
|
79
79
|
'x-component-props': {
|
|
80
|
-
|
|
80
|
+
popupMatchSelectWidth: false,
|
|
81
81
|
options: collectionModeOptions,
|
|
82
82
|
placeholder: `{{t("Trigger on", { ns: "${_locale.NAMESPACE}" })}}`
|
|
83
83
|
},
|
|
@@ -98,6 +98,7 @@ var _default = {
|
|
|
98
98
|
'x-decorator': 'FormItem',
|
|
99
99
|
'x-component': 'FieldsSelect',
|
|
100
100
|
'x-component-props': {
|
|
101
|
+
className: 'full-width',
|
|
101
102
|
mode: 'multiple',
|
|
102
103
|
placeholder: '{{t("Select field")}}',
|
|
103
104
|
filter(field) {
|
|
@@ -115,6 +116,9 @@ var _default = {
|
|
|
115
116
|
},
|
|
116
117
|
condition: _objectSpread(_objectSpread({}, _collection.filter), {}, {
|
|
117
118
|
title: `{{t("Only triggers when match conditions", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
119
|
+
'x-component-props': {
|
|
120
|
+
useProps: _collection.filter['x-component-props'].useProps
|
|
121
|
+
},
|
|
118
122
|
'x-reactions': [{
|
|
119
123
|
dependencies: ['collection'],
|
|
120
124
|
fulfill: {
|
|
@@ -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 { VariableOptions } from '../variable';
|
|
6
5
|
export interface Trigger {
|
|
7
6
|
title: string;
|
|
@@ -20,6 +19,6 @@ export interface Trigger {
|
|
|
20
19
|
useInitializers?(config: any): SchemaInitializerItemOptions | null;
|
|
21
20
|
initializers?: any;
|
|
22
21
|
}
|
|
23
|
-
export declare const triggers:
|
|
22
|
+
export declare const triggers: any;
|
|
24
23
|
export declare const TriggerConfig: () => React.JSX.Element;
|
|
25
|
-
export declare function useTrigger():
|
|
24
|
+
export declare function useTrigger(): any;
|
|
@@ -5,16 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.triggers = exports.TriggerConfig = void 0;
|
|
7
7
|
exports.useTrigger = useTrigger;
|
|
8
|
-
function
|
|
9
|
-
const data =
|
|
10
|
-
|
|
11
|
-
return data;
|
|
12
|
-
};
|
|
13
|
-
return data;
|
|
14
|
-
}
|
|
15
|
-
function _css() {
|
|
16
|
-
const data = require("@emotion/css");
|
|
17
|
-
_css = function _css() {
|
|
8
|
+
function _icons() {
|
|
9
|
+
const data = require("@ant-design/icons");
|
|
10
|
+
_icons = function _icons() {
|
|
18
11
|
return data;
|
|
19
12
|
};
|
|
20
13
|
return data;
|
|
@@ -26,46 +19,46 @@ function _core() {
|
|
|
26
19
|
};
|
|
27
20
|
return data;
|
|
28
21
|
}
|
|
29
|
-
function
|
|
22
|
+
function _react() {
|
|
30
23
|
const data = require("@formily/react");
|
|
31
|
-
|
|
24
|
+
_react = function _react() {
|
|
32
25
|
return data;
|
|
33
26
|
};
|
|
34
27
|
return data;
|
|
35
28
|
}
|
|
36
29
|
function _client() {
|
|
37
|
-
const data = require("@nocobase/
|
|
30
|
+
const data = require("@nocobase/client");
|
|
38
31
|
_client = function _client() {
|
|
39
32
|
return data;
|
|
40
33
|
};
|
|
41
34
|
return data;
|
|
42
35
|
}
|
|
43
|
-
function
|
|
44
|
-
const data = require("
|
|
45
|
-
|
|
36
|
+
function _client2() {
|
|
37
|
+
const data = require("@nocobase/utils/client");
|
|
38
|
+
_client2 = function _client2() {
|
|
46
39
|
return data;
|
|
47
40
|
};
|
|
48
41
|
return data;
|
|
49
42
|
}
|
|
50
|
-
function
|
|
51
|
-
const data = require("
|
|
52
|
-
|
|
43
|
+
function _antd() {
|
|
44
|
+
const data = require("antd");
|
|
45
|
+
_antd = function _antd() {
|
|
53
46
|
return data;
|
|
54
47
|
};
|
|
55
48
|
return data;
|
|
56
49
|
}
|
|
57
|
-
function
|
|
58
|
-
const data = require("
|
|
59
|
-
|
|
50
|
+
function _react2() {
|
|
51
|
+
const data = _interopRequireWildcard(require("react"));
|
|
52
|
+
_react2 = function _react2() {
|
|
60
53
|
return data;
|
|
61
54
|
};
|
|
62
55
|
return data;
|
|
63
56
|
}
|
|
64
|
-
var _style = require("../style");
|
|
65
57
|
var _FlowContext = require("../FlowContext");
|
|
58
|
+
var _locale = require("../locale");
|
|
59
|
+
var _style = _interopRequireDefault(require("../style"));
|
|
66
60
|
var _collection = _interopRequireDefault(require("./collection"));
|
|
67
61
|
var _schedule = _interopRequireDefault(require("./schedule/"));
|
|
68
|
-
var _locale = require("../locale");
|
|
69
62
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
70
63
|
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); }
|
|
71
64
|
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; }
|
|
@@ -84,12 +77,12 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
84
77
|
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); }); }; }
|
|
85
78
|
function useUpdateConfigAction() {
|
|
86
79
|
var _useFlowContext;
|
|
87
|
-
const form = (0,
|
|
88
|
-
const api = (0,
|
|
80
|
+
const form = (0, _react().useForm)();
|
|
81
|
+
const api = (0, _client().useAPIClient)();
|
|
89
82
|
const _ref = (_useFlowContext = (0, _FlowContext.useFlowContext)()) !== null && _useFlowContext !== void 0 ? _useFlowContext : {},
|
|
90
83
|
workflow = _ref.workflow;
|
|
91
|
-
const ctx = (0,
|
|
92
|
-
const _useResourceActionCon = (0,
|
|
84
|
+
const ctx = (0, _client().useActionContext)();
|
|
85
|
+
const _useResourceActionCon = (0, _client().useResourceActionContext)(),
|
|
93
86
|
refresh = _useResourceActionCon.refresh;
|
|
94
87
|
return {
|
|
95
88
|
run() {
|
|
@@ -112,28 +105,31 @@ function useUpdateConfigAction() {
|
|
|
112
105
|
}
|
|
113
106
|
};
|
|
114
107
|
}
|
|
115
|
-
const triggers = new (
|
|
108
|
+
const triggers = new (_client2().Registry)();
|
|
116
109
|
exports.triggers = triggers;
|
|
117
110
|
triggers.register(_collection.default.type, _collection.default);
|
|
118
111
|
triggers.register(_schedule.default.type, _schedule.default);
|
|
119
112
|
function TriggerExecution() {
|
|
120
|
-
const compile = (0,
|
|
113
|
+
const compile = (0, _client().useCompile)();
|
|
121
114
|
const _useFlowContext2 = (0, _FlowContext.useFlowContext)(),
|
|
122
115
|
workflow = _useFlowContext2.workflow,
|
|
123
116
|
execution = _useFlowContext2.execution;
|
|
117
|
+
const _useStyles = (0, _style.default)(),
|
|
118
|
+
styles = _useStyles.styles;
|
|
124
119
|
if (!execution) {
|
|
125
120
|
return null;
|
|
126
121
|
}
|
|
127
122
|
const trigger = triggers.get(workflow.type);
|
|
128
|
-
return
|
|
123
|
+
return _react2().default.createElement(_client().SchemaComponent, {
|
|
129
124
|
schema: {
|
|
130
125
|
type: 'void',
|
|
131
126
|
name: 'execution',
|
|
132
127
|
'x-component': 'Action',
|
|
133
128
|
'x-component-props': {
|
|
134
|
-
title:
|
|
129
|
+
title: _react2().default.createElement(_icons().InfoOutlined, null),
|
|
135
130
|
shape: 'circle',
|
|
136
|
-
|
|
131
|
+
size: 'small',
|
|
132
|
+
className: styles.nodeJobButtonClass,
|
|
137
133
|
type: 'primary'
|
|
138
134
|
},
|
|
139
135
|
properties: {
|
|
@@ -144,9 +140,9 @@ function TriggerExecution() {
|
|
|
144
140
|
initialValue: execution
|
|
145
141
|
},
|
|
146
142
|
'x-component': 'Action.Modal',
|
|
147
|
-
title:
|
|
148
|
-
className: (0,
|
|
149
|
-
},
|
|
143
|
+
title: _react2().default.createElement("div", {
|
|
144
|
+
className: (0, _client().cx)(styles.nodeTitleClass)
|
|
145
|
+
}, _react2().default.createElement(_antd().Tag, null, compile(trigger.title)), _react2().default.createElement("strong", null, workflow.title), _react2().default.createElement("span", {
|
|
150
146
|
className: "workflow-node-id"
|
|
151
147
|
}, "#", execution.id)),
|
|
152
148
|
properties: {
|
|
@@ -166,7 +162,7 @@ function TriggerExecution() {
|
|
|
166
162
|
'x-decorator': 'FormItem',
|
|
167
163
|
'x-component': 'Input.JSON',
|
|
168
164
|
'x-component-props': {
|
|
169
|
-
className: (0,
|
|
165
|
+
className: (0, _client().css)`
|
|
170
166
|
padding: 1em;
|
|
171
167
|
background-color: #eee;
|
|
172
168
|
`
|
|
@@ -180,27 +176,29 @@ function TriggerExecution() {
|
|
|
180
176
|
});
|
|
181
177
|
}
|
|
182
178
|
const TriggerConfig = () => {
|
|
183
|
-
const api = (0,
|
|
184
|
-
const compile = (0,
|
|
179
|
+
const api = (0, _client().useAPIClient)();
|
|
180
|
+
const compile = (0, _client().useCompile)();
|
|
185
181
|
const _useFlowContext3 = (0, _FlowContext.useFlowContext)(),
|
|
186
182
|
workflow = _useFlowContext3.workflow,
|
|
187
183
|
refresh = _useFlowContext3.refresh;
|
|
188
|
-
const _useState = (0,
|
|
184
|
+
const _useState = (0, _react2().useState)(''),
|
|
189
185
|
_useState2 = _slicedToArray(_useState, 2),
|
|
190
186
|
editingTitle = _useState2[0],
|
|
191
187
|
setEditingTitle = _useState2[1];
|
|
192
|
-
const _useState3 = (0,
|
|
188
|
+
const _useState3 = (0, _react2().useState)(false),
|
|
193
189
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
194
190
|
editingConfig = _useState4[0],
|
|
195
191
|
setEditingConfig = _useState4[1];
|
|
192
|
+
const _useStyles2 = (0, _style.default)(),
|
|
193
|
+
styles = _useStyles2.styles;
|
|
196
194
|
let typeTitle = '';
|
|
197
|
-
(0,
|
|
195
|
+
(0, _react2().useEffect)(() => {
|
|
198
196
|
if (workflow) {
|
|
199
197
|
var _workflow$title;
|
|
200
198
|
setEditingTitle((_workflow$title = workflow.title) !== null && _workflow$title !== void 0 ? _workflow$title : typeTitle);
|
|
201
199
|
}
|
|
202
200
|
}, [workflow]);
|
|
203
|
-
const form = (0,
|
|
201
|
+
const form = (0, _react2().useMemo)(() => (0, _core().createForm)({
|
|
204
202
|
initialValues: workflow === null || workflow === void 0 ? void 0 : workflow.config,
|
|
205
203
|
values: workflow === null || workflow === void 0 ? void 0 : workflow.config,
|
|
206
204
|
disabled: workflow === null || workflow === void 0 ? void 0 : workflow.executed
|
|
@@ -254,24 +252,24 @@ const TriggerConfig = () => {
|
|
|
254
252
|
}
|
|
255
253
|
}
|
|
256
254
|
}
|
|
257
|
-
return
|
|
258
|
-
className: (0,
|
|
255
|
+
return _react2().default.createElement("div", {
|
|
256
|
+
className: (0, _client().cx)(styles.nodeCardClass),
|
|
259
257
|
onClick: onOpenDrawer
|
|
260
|
-
},
|
|
261
|
-
className: (0,
|
|
262
|
-
},
|
|
258
|
+
}, _react2().default.createElement("div", {
|
|
259
|
+
className: (0, _client().cx)(styles.nodeMetaClass, 'workflow-node-meta')
|
|
260
|
+
}, _react2().default.createElement(_antd().Tag, {
|
|
263
261
|
color: "gold"
|
|
264
|
-
}, titleText)),
|
|
262
|
+
}, titleText)), _react2().default.createElement("div", null, _react2().default.createElement(_antd().Input.TextArea, {
|
|
265
263
|
value: editingTitle,
|
|
266
264
|
onChange: ev => setEditingTitle(ev.target.value),
|
|
267
265
|
onBlur: ev => onChangeTitle(ev.target.value),
|
|
268
266
|
autoSize: true
|
|
269
|
-
})),
|
|
267
|
+
})), _react2().default.createElement(TriggerExecution, null), _react2().default.createElement(_client().ActionContextProvider, {
|
|
270
268
|
value: {
|
|
271
269
|
visible: editingConfig,
|
|
272
270
|
setVisible: setEditingConfig
|
|
273
271
|
}
|
|
274
|
-
},
|
|
272
|
+
}, _react2().default.createElement(_client().SchemaComponent, {
|
|
275
273
|
schema: {
|
|
276
274
|
name: `workflow-trigger-${workflow.id}`,
|
|
277
275
|
type: 'void',
|
|
@@ -300,7 +298,7 @@ const TriggerConfig = () => {
|
|
|
300
298
|
type: 'warning',
|
|
301
299
|
showIcon: true,
|
|
302
300
|
message: `{{t("Trigger in executed workflow cannot be modified", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
303
|
-
className: (0,
|
|
301
|
+
className: (0, _client().css)`
|
|
304
302
|
width: 100%;
|
|
305
303
|
font-size: 85%;
|
|
306
304
|
margin-bottom: 2em;
|
|
@@ -312,7 +310,7 @@ const TriggerConfig = () => {
|
|
|
312
310
|
type: 'void',
|
|
313
311
|
'x-component': 'fieldset',
|
|
314
312
|
'x-component-props': {
|
|
315
|
-
className: (0,
|
|
313
|
+
className: (0, _client().css)`
|
|
316
314
|
.ant-select:not(.full-width) {
|
|
317
315
|
width: auto;
|
|
318
316
|
min-width: 6em;
|
|
@@ -4,23 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.EndsByField = EndsByField;
|
|
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;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = require("
|
|
16
|
-
|
|
14
|
+
function _client2() {
|
|
15
|
+
const data = require("@nocobase/utils/client");
|
|
16
|
+
_client2 = function _client2() {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const data =
|
|
23
|
-
|
|
21
|
+
function _antd() {
|
|
22
|
+
const data = require("antd");
|
|
23
|
+
_antd = function _antd() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
@@ -43,7 +43,7 @@ function EndsByField({
|
|
|
43
43
|
t = _useWorkflowTranslati.t;
|
|
44
44
|
const type = value != null ? typeof value === 'object' && !(value instanceof Date) ? 'field' : 'date' : null;
|
|
45
45
|
return _react().default.createElement("fieldset", {
|
|
46
|
-
className: (0,
|
|
46
|
+
className: (0, _client().css)`
|
|
47
47
|
display: flex;
|
|
48
48
|
gap: 0.5em;
|
|
49
49
|
`
|
|
@@ -63,7 +63,7 @@ function EndsByField({
|
|
|
63
63
|
onChange: _onChange
|
|
64
64
|
}) : null, type === 'date' ? _react().default.createElement(_antd().DatePicker, {
|
|
65
65
|
showTime: true,
|
|
66
|
-
value: (0,
|
|
66
|
+
value: (0, _client2().dayjs)(value),
|
|
67
67
|
onChange: v => {
|
|
68
68
|
_onChange(v ? v.toDate() : null);
|
|
69
69
|
}
|
|
@@ -4,23 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.OnField = OnField;
|
|
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 = _interopRequireWildcard(require("react"));
|
|
23
|
+
_react = function _react() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
@@ -32,7 +32,7 @@ function _reactI18next() {
|
|
|
32
32
|
};
|
|
33
33
|
return data;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var _FieldsSelect = require("../../components/FieldsSelect");
|
|
36
36
|
var _locale = require("../../locale");
|
|
37
37
|
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); }
|
|
38
38
|
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; }
|
|
@@ -47,28 +47,31 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
47
47
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
48
48
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
49
49
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
50
|
+
function dateFieldFilter(field) {
|
|
51
|
+
return !field.hidden && (field.uiSchema ? field.type === 'date' : false);
|
|
52
|
+
}
|
|
50
53
|
function OnField({
|
|
51
54
|
value,
|
|
52
55
|
onChange: _onChange
|
|
53
56
|
}) {
|
|
54
57
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
55
58
|
t = _useTranslation.t;
|
|
56
|
-
const _useWorkflowTranslati = (0, _locale.useWorkflowTranslation)(),
|
|
57
|
-
localT = _useWorkflowTranslati.t;
|
|
58
59
|
const _useState = (0, _react().useState)(value.offset ? value.offset / Math.abs(value.offset) : 0),
|
|
59
60
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
61
|
dir = _useState2[0],
|
|
61
62
|
setDir = _useState2[1];
|
|
62
63
|
return _react().default.createElement("fieldset", {
|
|
63
|
-
className: (0,
|
|
64
|
+
className: (0, _client().css)`
|
|
64
65
|
display: flex;
|
|
65
66
|
gap: 0.5em;
|
|
66
67
|
`
|
|
67
|
-
}, _react().default.createElement(
|
|
68
|
+
}, _react().default.createElement(_FieldsSelect.FieldsSelect, {
|
|
68
69
|
value: value.field,
|
|
69
70
|
onChange: field => _onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
70
71
|
field
|
|
71
|
-
}))
|
|
72
|
+
})),
|
|
73
|
+
filter: dateFieldFilter,
|
|
74
|
+
placeholder: t('Select field')
|
|
72
75
|
}), value.field ? _react().default.createElement(_antd().Select, {
|
|
73
76
|
value: dir,
|
|
74
77
|
onChange: v => {
|
|
@@ -76,14 +79,18 @@ function OnField({
|
|
|
76
79
|
_onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
77
80
|
offset: Math.abs(value.offset) * v
|
|
78
81
|
}));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
},
|
|
83
|
+
options: [{
|
|
84
|
+
value: 0,
|
|
85
|
+
label: (0, _locale.lang)('Exactly at')
|
|
86
|
+
}, {
|
|
87
|
+
value: -1,
|
|
88
|
+
label: t('Before')
|
|
89
|
+
}, {
|
|
90
|
+
value: 1,
|
|
91
|
+
label: t('After')
|
|
92
|
+
}]
|
|
93
|
+
}) : null, dir ? _react().default.createElement(_react().default.Fragment, null, _react().default.createElement(_antd().InputNumber, {
|
|
87
94
|
value: Math.abs(value.offset),
|
|
88
95
|
onChange: v => _onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
89
96
|
offset: (v !== null && v !== void 0 ? v : 0) * dir
|
|
@@ -92,14 +99,19 @@ function OnField({
|
|
|
92
99
|
value: value.unit || 86400000,
|
|
93
100
|
onChange: unit => _onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
94
101
|
unit
|
|
95
|
-
}))
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
})),
|
|
103
|
+
options: [{
|
|
104
|
+
value: 86400000,
|
|
105
|
+
label: (0, _locale.lang)('Days')
|
|
106
|
+
}, {
|
|
107
|
+
value: 3600000,
|
|
108
|
+
label: (0, _locale.lang)('Hours')
|
|
109
|
+
}, {
|
|
110
|
+
value: 60000,
|
|
111
|
+
label: (0, _locale.lang)('Minutes')
|
|
112
|
+
}, {
|
|
113
|
+
value: 1000,
|
|
114
|
+
label: (0, _locale.lang)('Seconds')
|
|
115
|
+
}]
|
|
116
|
+
})) : null);
|
|
105
117
|
}
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.RepeatField = RepeatField;
|
|
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;
|
|
@@ -114,7 +114,7 @@ function RepeatField({
|
|
|
114
114
|
}
|
|
115
115
|
const locale = languages[localStorage.getItem('NOCOBASE_LOCALE') || 'en-US'];
|
|
116
116
|
return _react().default.createElement("fieldset", {
|
|
117
|
-
className: (0,
|
|
117
|
+
className: (0, _client().css)`
|
|
118
118
|
display: flex;
|
|
119
119
|
flex-direction: ${typeValue === 'cron' ? 'column' : 'row'};
|
|
120
120
|
align-items: flex-start;
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ScheduleConfig = void 0;
|
|
7
|
-
function _react() {
|
|
8
|
-
const data = _interopRequireWildcard(require("react"));
|
|
9
|
-
_react = function _react() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _core() {
|
|
15
8
|
const data = require("@formily/core");
|
|
16
9
|
_core = function _core() {
|
|
@@ -18,33 +11,33 @@ function _core() {
|
|
|
18
11
|
};
|
|
19
12
|
return data;
|
|
20
13
|
}
|
|
21
|
-
function
|
|
14
|
+
function _react() {
|
|
22
15
|
const data = require("@formily/react");
|
|
23
|
-
|
|
16
|
+
_react = function _react() {
|
|
24
17
|
return data;
|
|
25
18
|
};
|
|
26
19
|
return data;
|
|
27
20
|
}
|
|
28
|
-
function
|
|
29
|
-
const data = require("@
|
|
30
|
-
|
|
21
|
+
function _client() {
|
|
22
|
+
const data = require("@nocobase/client");
|
|
23
|
+
_client = function _client() {
|
|
31
24
|
return data;
|
|
32
25
|
};
|
|
33
26
|
return data;
|
|
34
27
|
}
|
|
35
|
-
function
|
|
36
|
-
const data = require("
|
|
37
|
-
|
|
28
|
+
function _react2() {
|
|
29
|
+
const data = _interopRequireWildcard(require("react"));
|
|
30
|
+
_react2 = function _react2() {
|
|
38
31
|
return data;
|
|
39
32
|
};
|
|
40
33
|
return data;
|
|
41
34
|
}
|
|
35
|
+
var _locale = require("../../locale");
|
|
42
36
|
var _collection = require("../../schemas/collection");
|
|
43
|
-
var
|
|
37
|
+
var _constants = require("./constants");
|
|
44
38
|
var _EndsByField = require("./EndsByField");
|
|
39
|
+
var _OnField = require("./OnField");
|
|
45
40
|
var _RepeatField = require("./RepeatField");
|
|
46
|
-
var _constants = require("./constants");
|
|
47
|
-
var _locale = require("../../locale");
|
|
48
41
|
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); }
|
|
49
42
|
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; }
|
|
50
43
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -195,15 +188,15 @@ const scheduleModeOptions = [{
|
|
|
195
188
|
label: `{{t("Based on date field of collection", { ns: "${_locale.NAMESPACE}" })}}`
|
|
196
189
|
}];
|
|
197
190
|
const ScheduleConfig = () => {
|
|
198
|
-
const _useForm = (0,
|
|
191
|
+
const _useForm = (0, _react().useForm)(),
|
|
199
192
|
_useForm$values = _useForm.values,
|
|
200
193
|
values = _useForm$values === void 0 ? {} : _useForm$values,
|
|
201
194
|
clearFormGraph = _useForm.clearFormGraph;
|
|
202
|
-
const _useState = (0,
|
|
195
|
+
const _useState = (0, _react2().useState)(values.mode),
|
|
203
196
|
_useState2 = _slicedToArray(_useState, 2),
|
|
204
197
|
mode = _useState2[0],
|
|
205
198
|
setMode = _useState2[1];
|
|
206
|
-
(0,
|
|
199
|
+
(0, _react().useFormEffects)(() => {
|
|
207
200
|
(0, _core().onFieldValueChange)('mode', field => {
|
|
208
201
|
setMode(field.value);
|
|
209
202
|
clearFormGraph('collection');
|
|
@@ -213,7 +206,7 @@ const ScheduleConfig = () => {
|
|
|
213
206
|
clearFormGraph('limit');
|
|
214
207
|
});
|
|
215
208
|
});
|
|
216
|
-
return
|
|
209
|
+
return _react2().default.createElement(_react2().default.Fragment, null, _react2().default.createElement(_client().SchemaComponent, {
|
|
217
210
|
schema: {
|
|
218
211
|
type: 'number',
|
|
219
212
|
title: `{{t("Trigger mode", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
@@ -226,7 +219,7 @@ const ScheduleConfig = () => {
|
|
|
226
219
|
required: true,
|
|
227
220
|
default: _constants.SCHEDULE_MODE.STATIC
|
|
228
221
|
}
|
|
229
|
-
}),
|
|
222
|
+
}), _react2().default.createElement(_client().SchemaComponent, {
|
|
230
223
|
schema: {
|
|
231
224
|
type: 'void',
|
|
232
225
|
properties: {
|
|
@@ -234,15 +227,15 @@ const ScheduleConfig = () => {
|
|
|
234
227
|
type: 'void',
|
|
235
228
|
'x-component': 'fieldset',
|
|
236
229
|
'x-component-props': {
|
|
237
|
-
className: (0,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
230
|
+
className: (0, _client().css)`
|
|
231
|
+
.ant-input-number {
|
|
232
|
+
width: 4em;
|
|
233
|
+
}
|
|
241
234
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
235
|
+
.ant-picker {
|
|
236
|
+
width: auto;
|
|
237
|
+
}
|
|
238
|
+
`
|
|
246
239
|
},
|
|
247
240
|
properties: ModeFieldsets[mode]
|
|
248
241
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { useCollectionDataSource, SchemaInitializerItemOptions } from '@nocobase/client';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
@@ -14,7 +15,6 @@ declare const _default: {
|
|
|
14
15
|
};
|
|
15
16
|
components: {
|
|
16
17
|
ScheduleConfig: () => import("react").JSX.Element;
|
|
17
|
-
FieldsSelect: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Pick<any, string | number | symbol>>>;
|
|
18
18
|
};
|
|
19
19
|
useVariables(config: any, opts: any): any[];
|
|
20
20
|
useInitializers(config: any): SchemaInitializerItemOptions | null;
|