@nocobase/plugin-workflow 0.7.1-alpha.7 → 0.7.2-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/client.d.ts +4 -0
  2. package/client.js +30 -0
  3. package/lib/client/ExecutionResourceProvider.d.ts +4 -0
  4. package/lib/client/ExecutionResourceProvider.js +64 -0
  5. package/lib/client/WorkflowCanvas.d.ts +15 -0
  6. package/lib/client/WorkflowCanvas.js +393 -0
  7. package/lib/client/WorkflowLink.d.ts +1 -0
  8. package/lib/client/WorkflowLink.js +66 -0
  9. package/lib/client/WorkflowPage.d.ts +1 -0
  10. package/lib/client/WorkflowPage.js +92 -0
  11. package/lib/client/WorkflowProvider.d.ts +1 -0
  12. package/lib/client/WorkflowProvider.js +78 -0
  13. package/lib/client/WorkflowShortcut.d.ts +1 -0
  14. package/lib/client/WorkflowShortcut.js +123 -0
  15. package/lib/client/calculators.d.ts +101 -0
  16. package/lib/client/calculators.js +739 -0
  17. package/lib/client/components/CollectionFieldSelect.d.ts +2 -0
  18. package/lib/client/components/CollectionFieldSelect.js +106 -0
  19. package/lib/client/components/Duration.d.ts +5 -0
  20. package/lib/client/components/Duration.js +96 -0
  21. package/lib/client/index.d.ts +3 -0
  22. package/lib/client/index.js +38 -0
  23. package/lib/client/nodes/calculation.d.ts +25 -0
  24. package/lib/client/nodes/calculation.js +85 -0
  25. package/lib/client/nodes/condition.d.ts +46 -0
  26. package/lib/client/nodes/condition.js +346 -0
  27. package/lib/client/nodes/create.d.ts +42 -0
  28. package/lib/client/nodes/create.js +99 -0
  29. package/lib/client/nodes/delay.d.ts +36 -0
  30. package/lib/client/nodes/delay.js +49 -0
  31. package/lib/client/nodes/destroy.d.ts +55 -0
  32. package/lib/client/nodes/destroy.js +46 -0
  33. package/lib/client/nodes/index.d.ts +33 -0
  34. package/lib/client/nodes/index.js +390 -0
  35. package/lib/client/nodes/parallel.d.ts +24 -0
  36. package/lib/client/nodes/parallel.js +216 -0
  37. package/lib/client/nodes/query.d.ts +66 -0
  38. package/lib/client/nodes/query.js +105 -0
  39. package/lib/client/nodes/update.d.ts +60 -0
  40. package/lib/client/nodes/update.js +48 -0
  41. package/lib/client/schemas/collection.d.ts +42 -0
  42. package/lib/client/schemas/collection.js +98 -0
  43. package/lib/client/schemas/executions.d.ts +209 -0
  44. package/lib/client/schemas/executions.js +164 -0
  45. package/lib/client/schemas/workflows.d.ts +2 -0
  46. package/lib/client/schemas/workflows.js +328 -0
  47. package/lib/client/style.d.ts +12 -0
  48. package/lib/client/style.js +216 -0
  49. package/lib/client/triggers/collection.d.ts +88 -0
  50. package/lib/client/triggers/collection.js +225 -0
  51. package/lib/client/triggers/index.d.ts +26 -0
  52. package/lib/client/triggers/index.js +238 -0
  53. package/lib/client/triggers/schedule/DateFieldsSelect.d.ts +2 -0
  54. package/lib/client/triggers/schedule/DateFieldsSelect.js +92 -0
  55. package/lib/client/triggers/schedule/EndsByField.d.ts +5 -0
  56. package/lib/client/triggers/schedule/EndsByField.js +102 -0
  57. package/lib/client/triggers/schedule/OnField.d.ts +5 -0
  58. package/lib/client/triggers/schedule/OnField.js +128 -0
  59. package/lib/client/triggers/schedule/RepeatField.d.ts +5 -0
  60. package/lib/client/triggers/schedule/RepeatField.js +191 -0
  61. package/lib/client/triggers/schedule/ScheduleConfig.d.ts +1 -0
  62. package/lib/client/triggers/schedule/ScheduleConfig.js +286 -0
  63. package/lib/client/triggers/schedule/index.d.ts +25 -0
  64. package/lib/client/triggers/schedule/index.js +124 -0
  65. package/lib/client/triggers/schedule/locale/Cron.zh-CN.d.ts +34 -0
  66. package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +44 -0
  67. package/lib/index.d.ts +1 -6
  68. package/lib/index.js +2 -73
  69. package/lib/{Plugin.d.ts → server/Plugin.d.ts} +0 -0
  70. package/lib/{Plugin.js → server/Plugin.js} +0 -0
  71. package/lib/{Processor.d.ts → server/Processor.d.ts} +4 -3
  72. package/lib/{Processor.js → server/Processor.js} +40 -24
  73. package/lib/{actions → server/actions}/index.d.ts +0 -0
  74. package/lib/{actions → server/actions}/index.js +0 -0
  75. package/lib/{actions → server/actions}/nodes.d.ts +0 -0
  76. package/lib/{actions → server/actions}/nodes.js +1 -0
  77. package/lib/{actions → server/actions}/workflows.d.ts +0 -0
  78. package/lib/{actions → server/actions}/workflows.js +10 -0
  79. package/lib/{calculators → server/calculators}/index.d.ts +0 -0
  80. package/lib/{calculators → server/calculators}/index.js +0 -0
  81. package/lib/{collections → server/collections}/executions.d.ts +0 -0
  82. package/lib/{collections → server/collections}/executions.js +0 -0
  83. package/lib/{collections → server/collections}/flow_nodes.d.ts +0 -0
  84. package/lib/{collections → server/collections}/flow_nodes.js +0 -0
  85. package/lib/{collections → server/collections}/jobs.d.ts +0 -0
  86. package/lib/{collections → server/collections}/jobs.js +0 -0
  87. package/lib/{collections → server/collections}/workflows.d.ts +0 -0
  88. package/lib/{collections → server/collections}/workflows.js +0 -0
  89. package/lib/{constants.d.ts → server/constants.d.ts} +0 -0
  90. package/lib/{constants.js → server/constants.js} +0 -0
  91. package/lib/server/index.d.ts +6 -0
  92. package/lib/server/index.js +86 -0
  93. package/lib/{instructions → server/instructions}/calculation.d.ts +0 -0
  94. package/lib/{instructions → server/instructions}/calculation.js +0 -0
  95. package/lib/{instructions → server/instructions}/condition.d.ts +0 -0
  96. package/lib/{instructions → server/instructions}/condition.js +0 -0
  97. package/lib/{instructions → server/instructions}/create.d.ts +0 -0
  98. package/lib/{instructions → server/instructions}/create.js +0 -0
  99. package/lib/{instructions → server/instructions}/delay.d.ts +0 -0
  100. package/lib/{instructions → server/instructions}/delay.js +12 -5
  101. package/lib/{instructions → server/instructions}/destroy.d.ts +0 -0
  102. package/lib/{instructions → server/instructions}/destroy.js +0 -0
  103. package/lib/{instructions → server/instructions}/index.d.ts +0 -0
  104. package/lib/{instructions → server/instructions}/index.js +0 -0
  105. package/lib/{instructions → server/instructions}/parallel.d.ts +0 -0
  106. package/lib/{instructions → server/instructions}/parallel.js +62 -20
  107. package/lib/{instructions → server/instructions}/prompt.d.ts +0 -0
  108. package/lib/{instructions → server/instructions}/prompt.js +0 -0
  109. package/lib/{instructions → server/instructions}/query.d.ts +0 -0
  110. package/lib/{instructions → server/instructions}/query.js +0 -0
  111. package/lib/{instructions → server/instructions}/update.d.ts +0 -0
  112. package/lib/{instructions → server/instructions}/update.js +0 -0
  113. package/lib/{models → server/models}/Execution.d.ts +0 -0
  114. package/lib/{models → server/models}/Execution.js +0 -0
  115. package/lib/{models → server/models}/FlowNode.d.ts +0 -0
  116. package/lib/{models → server/models}/FlowNode.js +0 -0
  117. package/lib/{models → server/models}/Job.d.ts +0 -0
  118. package/lib/{models → server/models}/Job.js +0 -0
  119. package/lib/{models → server/models}/Workflow.d.ts +0 -0
  120. package/lib/{models → server/models}/Workflow.js +0 -0
  121. package/lib/{triggers → server/triggers}/collection.d.ts +0 -0
  122. package/lib/{triggers → server/triggers}/collection.js +0 -0
  123. package/lib/{triggers → server/triggers}/index.d.ts +0 -0
  124. package/lib/{triggers → server/triggers}/index.js +0 -0
  125. package/lib/{triggers → server/triggers}/schedule.d.ts +0 -0
  126. package/lib/{triggers → server/triggers}/schedule.js +2 -2
  127. package/package.json +10 -8
  128. package/server.d.ts +4 -0
  129. package/server.js +30 -0
@@ -0,0 +1,346 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function _react() {
9
+ const data = _interopRequireDefault(require("react"));
10
+
11
+ _react = function _react() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _css() {
19
+ const data = require("@emotion/css");
20
+
21
+ _css = function _css() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ function _antd() {
29
+ const data = require("antd");
30
+
31
+ _antd = function _antd() {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ function _icons() {
39
+ const data = require("@ant-design/icons");
40
+
41
+ _icons = function _icons() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ function _reactI18next() {
49
+ const data = require("react-i18next");
50
+
51
+ _reactI18next = function _reactI18next() {
52
+ return data;
53
+ };
54
+
55
+ return data;
56
+ }
57
+
58
+ function _client() {
59
+ const data = require("@nocobase/client");
60
+
61
+ _client = function _client() {
62
+ return data;
63
+ };
64
+
65
+ return data;
66
+ }
67
+
68
+ var _ = require(".");
69
+
70
+ var _WorkflowCanvas = require("../WorkflowCanvas");
71
+
72
+ var _style = require("../style");
73
+
74
+ var _calculators = require("../calculators");
75
+
76
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
77
+
78
+ 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; }
79
+
80
+ 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; }
81
+
82
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
83
+
84
+ function CalculationItem({
85
+ value,
86
+ onChange: _onChange,
87
+ onRemove
88
+ }) {
89
+ if (!value) {
90
+ return null;
91
+ }
92
+
93
+ const calculator = value.calculator,
94
+ _value$operands = value.operands,
95
+ operands = _value$operands === void 0 ? [] : _value$operands;
96
+ return _react().default.createElement("div", {
97
+ className: (0, _css().css)`
98
+ display: flex;
99
+ position: relative;
100
+ margin: .5em 0;
101
+ `
102
+ }, value.group ? _react().default.createElement(CalculationGroup, {
103
+ value: value.group,
104
+ onChange: group => _onChange(_objectSpread(_objectSpread({}, value), {}, {
105
+ group
106
+ }))
107
+ }) : _react().default.createElement(_calculators.Calculation, {
108
+ operands: operands,
109
+ calculator: calculator,
110
+ onChange: _onChange
111
+ }), _react().default.createElement(_antd().Button, {
112
+ onClick: onRemove,
113
+ type: "link",
114
+ icon: _react().default.createElement(_icons().CloseCircleOutlined, null)
115
+ }));
116
+ }
117
+
118
+ function CalculationGroup({
119
+ value,
120
+ onChange: _onChange2
121
+ }) {
122
+ const _useTranslation = (0, _reactI18next().useTranslation)(),
123
+ t = _useTranslation.t;
124
+
125
+ const _value$type = value.type,
126
+ type = _value$type === void 0 ? 'and' : _value$type,
127
+ _value$calculations = value.calculations,
128
+ calculations = _value$calculations === void 0 ? [] : _value$calculations;
129
+
130
+ function onAddSingle() {
131
+ _onChange2(_objectSpread(_objectSpread({}, value), {}, {
132
+ calculations: [...calculations, {
133
+ not: false,
134
+ calculator: 'equal'
135
+ }]
136
+ }));
137
+ }
138
+
139
+ function onAddGroup() {
140
+ _onChange2(_objectSpread(_objectSpread({}, value), {}, {
141
+ calculations: [...calculations, {
142
+ not: false,
143
+ group: {
144
+ type: 'and',
145
+ calculations: []
146
+ }
147
+ }]
148
+ }));
149
+ }
150
+
151
+ function _onRemove(i) {
152
+ calculations.splice(i, 1);
153
+
154
+ _onChange2(_objectSpread(_objectSpread({}, value), {}, {
155
+ calculations: [...calculations]
156
+ }));
157
+ }
158
+
159
+ function onItemChange(i, v) {
160
+ calculations.splice(i, 1, v);
161
+
162
+ _onChange2(_objectSpread(_objectSpread({}, value), {}, {
163
+ calculations: [...calculations]
164
+ }));
165
+ }
166
+
167
+ return _react().default.createElement("div", {
168
+ className: (0, _css().cx)('node-type-condition-group', (0, _css().css)`
169
+ position: relative;
170
+ width: 100%;
171
+
172
+ .node-type-condition-group{
173
+ padding: .5em 1em;
174
+ border: 1px dashed #ddd;
175
+ }
176
+
177
+ + button{
178
+ position: absolute;
179
+ right: 0;
180
+ }
181
+ `)
182
+ }, _react().default.createElement("div", {
183
+ className: (0, _css().css)`
184
+ display: flex;
185
+ align-items: center;
186
+ gap: .5em;
187
+
188
+ .ant-select{
189
+ width: auto;
190
+ min-width: 6em;
191
+ }
192
+ `
193
+ }, _react().default.createElement(_reactI18next().Trans, null, 'Meet ', _react().default.createElement(_antd().Select, {
194
+ value: type,
195
+ onChange: t => _onChange2(_objectSpread(_objectSpread({}, value), {}, {
196
+ type: t
197
+ }))
198
+ }, _react().default.createElement(_antd().Select.Option, {
199
+ value: "and"
200
+ }, "All"), _react().default.createElement(_antd().Select.Option, {
201
+ value: "or"
202
+ }, "Any")), ' conditions in the group')), _react().default.createElement("div", {
203
+ className: "calculation-items"
204
+ }, calculations.map((calculation, i) => _react().default.createElement(CalculationItem, {
205
+ key: `${calculation.calculator}_${i}`,
206
+ value: calculation,
207
+ onChange: onItemChange.bind(this, i),
208
+ onRemove: () => _onRemove(i)
209
+ }))), _react().default.createElement("div", {
210
+ className: (0, _css().css)`
211
+ button{
212
+ padding: 0;
213
+
214
+ &:not(:last-child){
215
+ margin-right: 1em;
216
+ }
217
+ }
218
+ `
219
+ }, _react().default.createElement(_antd().Button, {
220
+ type: "link",
221
+ onClick: onAddSingle
222
+ }, t('Add condition')), _react().default.createElement(_antd().Button, {
223
+ type: "link",
224
+ onClick: onAddGroup
225
+ }, t('Add condition group'))));
226
+ }
227
+
228
+ function CalculationConfig({
229
+ value,
230
+ onChange: _onChange3
231
+ }) {
232
+ const rule = value && Object.keys(value).length ? value : {
233
+ group: {
234
+ type: 'and',
235
+ calculations: []
236
+ }
237
+ };
238
+ return _react().default.createElement(CalculationGroup, {
239
+ value: rule.group,
240
+ onChange: group => _onChange3(_objectSpread(_objectSpread({}, rule), {}, {
241
+ group
242
+ }))
243
+ });
244
+ }
245
+
246
+ var _default = {
247
+ title: '{{t("Condition")}}',
248
+ type: 'condition',
249
+ group: 'control',
250
+ fieldset: {
251
+ 'config.rejectOnFalse': {
252
+ type: 'boolean',
253
+ name: 'config.rejectOnFalse',
254
+ title: '{{t("Mode")}}',
255
+ 'x-decorator': 'FormItem',
256
+ 'x-component': 'Radio.Group',
257
+ 'x-component-props': {
258
+ disabled: true
259
+ },
260
+ enum: [{
261
+ value: true,
262
+ label: _client().i18n.t('Continue when "Yes"')
263
+ }, {
264
+ value: false,
265
+ label: _client().i18n.t('Branch into "Yes" and "No"')
266
+ }]
267
+ },
268
+ 'config.calculation': {
269
+ type: 'string',
270
+ name: 'config.calculation',
271
+ title: '{{t("Conditions")}}',
272
+ 'x-decorator': 'FormItem',
273
+ 'x-component': 'CalculationConfig'
274
+ }
275
+ },
276
+ view: {},
277
+ options: [{
278
+ label: _client().i18n.t('Continue when "Yes"'),
279
+ key: 'rejectOnFalse',
280
+ value: {
281
+ rejectOnFalse: true
282
+ }
283
+ }, {
284
+ label: _client().i18n.t('Branch into "Yes" and "No"'),
285
+ key: 'branch',
286
+ value: {
287
+ rejectOnFalse: false
288
+ }
289
+ }],
290
+
291
+ render(data) {
292
+ const id = data.id,
293
+ rejectOnFalse = data.config.rejectOnFalse;
294
+
295
+ const _useFlowContext = (0, _WorkflowCanvas.useFlowContext)(),
296
+ nodes = _useFlowContext.nodes;
297
+
298
+ const trueEntry = nodes.find(item => item.upstreamId === id && item.branchIndex === 1);
299
+ const falseEntry = nodes.find(item => item.upstreamId === id && item.branchIndex === 0);
300
+ return _react().default.createElement(_.NodeDefaultView, {
301
+ data: data
302
+ }, rejectOnFalse ? null : _react().default.createElement("div", {
303
+ className: (0, _css().cx)(_style.nodeSubtreeClass)
304
+ }, _react().default.createElement("div", {
305
+ className: (0, _css().cx)(_style.branchBlockClass, (0, _css().css)`
306
+ > * > .workflow-branch-lines{
307
+ > button{
308
+ display: none;
309
+ }
310
+ }
311
+ `)
312
+ }, _react().default.createElement(_WorkflowCanvas.Branch, {
313
+ from: data,
314
+ entry: falseEntry,
315
+ branchIndex: 0
316
+ }), _react().default.createElement(_WorkflowCanvas.Branch, {
317
+ from: data,
318
+ entry: trueEntry,
319
+ branchIndex: 1
320
+ })), _react().default.createElement("div", {
321
+ className: (0, _css().css)`
322
+ position: relative;
323
+ height: 2em;
324
+ overflow: visible;
325
+
326
+ > span{
327
+ position: absolute;
328
+ top: calc(1.5em - 1px);
329
+ line-height: 1em;
330
+ color: #999;
331
+ background-color: #f0f2f5;
332
+ padding: 1px;
333
+ }
334
+ `
335
+ }, _react().default.createElement("span", {
336
+ className: (0, _css().css)`right: 4em;`
337
+ }, _client().i18n.t('No')), _react().default.createElement("span", {
338
+ className: (0, _css().css)`left: 4em;`
339
+ }, _client().i18n.t('Yes')))));
340
+ },
341
+
342
+ components: {
343
+ CalculationConfig
344
+ }
345
+ };
346
+ exports.default = _default;
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { useCollectionDataSource } from '@nocobase/client';
3
+ declare const _default: {
4
+ title: string;
5
+ type: string;
6
+ group: string;
7
+ fieldset: {
8
+ 'config.collection': {
9
+ name: string;
10
+ type: string;
11
+ title: string;
12
+ required: boolean;
13
+ 'x-reactions': string[];
14
+ 'x-decorator': string;
15
+ 'x-component': string;
16
+ 'x-component-props': {
17
+ placeholder: string;
18
+ };
19
+ };
20
+ 'config.params.values': {
21
+ type: string;
22
+ title: string;
23
+ name: string;
24
+ 'x-decorator': string;
25
+ 'x-decorator-props': {
26
+ labelAlign: string;
27
+ className: string;
28
+ };
29
+ 'x-component': string;
30
+ description: string;
31
+ };
32
+ };
33
+ view: {};
34
+ scope: {
35
+ useCollectionDataSource: typeof useCollectionDataSource;
36
+ };
37
+ components: {
38
+ CollectionFieldset: React.MemoExoticComponent<React.FunctionComponent<Pick<any, string | number | symbol>>>;
39
+ };
40
+ getter(props: any): JSX.Element;
41
+ };
42
+ export default _default;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function _react() {
9
+ const data = _interopRequireDefault(require("react"));
10
+
11
+ _react = function _react() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _client() {
19
+ const data = require("@nocobase/client");
20
+
21
+ _client = function _client() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ var _calculators = require("../calculators");
29
+
30
+ var _collection = require("../schemas/collection");
31
+
32
+ var _WorkflowCanvas = require("../WorkflowCanvas");
33
+
34
+ var _CollectionFieldSelect = _interopRequireDefault(require("../components/CollectionFieldSelect"));
35
+
36
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
+
38
+ 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; }
39
+
40
+ 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; }
41
+
42
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
43
+
44
+ var _default = {
45
+ title: '{{t("Create record")}}',
46
+ type: 'create',
47
+ group: 'collection',
48
+ fieldset: {
49
+ 'config.collection': _objectSpread(_objectSpread({}, _collection.collection), {}, {
50
+ name: 'config.collection'
51
+ }),
52
+ // multiple: {
53
+ // type: 'boolean',
54
+ // title: '多条数据',
55
+ // name: 'multiple',
56
+ // 'x-decorator': 'FormItem',
57
+ // 'x-component': 'Checkbox',
58
+ // 'x-component-props': {
59
+ // disabled: true
60
+ // }
61
+ // },
62
+ 'config.params.values': _collection.values
63
+ },
64
+ view: {},
65
+ scope: {
66
+ useCollectionDataSource: _client().useCollectionDataSource
67
+ },
68
+ components: {
69
+ CollectionFieldset: _calculators.CollectionFieldset
70
+ },
71
+
72
+ getter(props) {
73
+ const type = props.type,
74
+ options = props.options,
75
+ _onChange = props.onChange;
76
+
77
+ const _useFlowContext = (0, _WorkflowCanvas.useFlowContext)(),
78
+ nodes = _useFlowContext.nodes;
79
+
80
+ const _nodes$find = nodes.find(n => n.id == options.nodeId),
81
+ config = _nodes$find.config;
82
+
83
+ const value = options === null || options === void 0 ? void 0 : options.path;
84
+ return _react().default.createElement(_CollectionFieldSelect.default, {
85
+ collection: config.collection,
86
+ value: value,
87
+ onChange: path => {
88
+ _onChange({
89
+ type,
90
+ options: _objectSpread(_objectSpread({}, options), {}, {
91
+ path
92
+ })
93
+ });
94
+ }
95
+ });
96
+ }
97
+
98
+ };
99
+ exports.default = _default;
@@ -0,0 +1,36 @@
1
+ import Duration from "../components/Duration";
2
+ declare const _default: {
3
+ title: string;
4
+ type: string;
5
+ group: string;
6
+ fieldset: {
7
+ 'config.duration': {
8
+ type: string;
9
+ name: string;
10
+ title: string;
11
+ 'x-decorator': string;
12
+ 'x-component': string;
13
+ default: number;
14
+ };
15
+ 'config.endStatus': {
16
+ type: string;
17
+ name: string;
18
+ title: string;
19
+ 'x-decorator': string;
20
+ 'x-component': string;
21
+ 'x-component-props': {
22
+ placeholder: string;
23
+ };
24
+ enum: {
25
+ label: string;
26
+ value: number;
27
+ }[];
28
+ };
29
+ };
30
+ view: {};
31
+ scope: {};
32
+ components: {
33
+ Duration: typeof Duration;
34
+ };
35
+ };
36
+ export default _default;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _Duration = _interopRequireDefault(require("../components/Duration"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ var _default = {
13
+ title: '{{t("Delay")}}',
14
+ type: 'delay',
15
+ group: 'control',
16
+ fieldset: {
17
+ 'config.duration': {
18
+ type: 'number',
19
+ name: 'config.duration',
20
+ title: '{{t("Duration")}}',
21
+ 'x-decorator': 'FormItem',
22
+ 'x-component': 'Duration',
23
+ default: 60000
24
+ },
25
+ 'config.endStatus': {
26
+ type: 'number',
27
+ name: 'config.endStatus',
28
+ title: '{{t("End Status")}}',
29
+ 'x-decorator': 'FormItem',
30
+ 'x-component': 'Select',
31
+ 'x-component-props': {
32
+ placeholder: '{{t("Select status")}}'
33
+ },
34
+ enum: [{
35
+ label: '{{t("Succeed and continue")}}',
36
+ value: 1
37
+ }, {
38
+ label: '{{t("Fail and exit")}}',
39
+ value: -1
40
+ }]
41
+ }
42
+ },
43
+ view: {},
44
+ scope: {},
45
+ components: {
46
+ Duration: _Duration.default
47
+ }
48
+ };
49
+ exports.default = _default;
@@ -0,0 +1,55 @@
1
+ import { useCollectionDataSource } from '@nocobase/client';
2
+ import { VariableComponent } from '../calculators';
3
+ declare const _default: {
4
+ title: string;
5
+ type: string;
6
+ group: string;
7
+ fieldset: {
8
+ 'config.collection': {
9
+ type: string;
10
+ title: string;
11
+ name: string;
12
+ required: boolean;
13
+ 'x-reactions': string[];
14
+ 'x-decorator': string;
15
+ 'x-component': string;
16
+ 'x-component-props': {
17
+ placeholder: string;
18
+ };
19
+ };
20
+ 'config.params': {
21
+ type: string;
22
+ name: string;
23
+ title: string;
24
+ 'x-decorator': string;
25
+ properties: {
26
+ filter: {
27
+ type: string;
28
+ title: string;
29
+ name: string;
30
+ 'x-decorator': string;
31
+ 'x-decorator-props': {
32
+ labelAlign: string;
33
+ className: string;
34
+ };
35
+ 'x-component': string;
36
+ 'x-component-props': {
37
+ useProps(): {
38
+ options: any[];
39
+ className: string;
40
+ };
41
+ dynamicComponent: string;
42
+ };
43
+ };
44
+ };
45
+ };
46
+ };
47
+ view: {};
48
+ scope: {
49
+ useCollectionDataSource: typeof useCollectionDataSource;
50
+ };
51
+ components: {
52
+ VariableComponent: typeof VariableComponent;
53
+ };
54
+ };
55
+ export default _default;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function _client() {
9
+ const data = require("@nocobase/client");
10
+
11
+ _client = function _client() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ var _calculators = require("../calculators");
19
+
20
+ var _collection = require("../schemas/collection");
21
+
22
+ var _default = {
23
+ title: '{{t("Delete record")}}',
24
+ type: 'destroy',
25
+ group: 'collection',
26
+ fieldset: {
27
+ 'config.collection': _collection.collection,
28
+ 'config.params': {
29
+ type: 'object',
30
+ name: 'config.params',
31
+ title: '',
32
+ 'x-decorator': 'FormItem',
33
+ properties: {
34
+ filter: _collection.filter
35
+ }
36
+ }
37
+ },
38
+ view: {},
39
+ scope: {
40
+ useCollectionDataSource: _client().useCollectionDataSource
41
+ },
42
+ components: {
43
+ VariableComponent: _calculators.VariableComponent
44
+ }
45
+ };
46
+ exports.default = _default;
@@ -0,0 +1,33 @@
1
+ import { ISchema } from '@formily/react';
2
+ import { Registry } from '@nocobase/utils/client';
3
+ import React from 'react';
4
+ export interface Instruction {
5
+ title: string;
6
+ type: string;
7
+ group: string;
8
+ options?: {
9
+ label: string;
10
+ value: any;
11
+ key: string;
12
+ }[];
13
+ fieldset: {
14
+ [key: string]: ISchema;
15
+ };
16
+ view?: ISchema;
17
+ scope?: {
18
+ [key: string]: any;
19
+ };
20
+ components?: {
21
+ [key: string]: any;
22
+ };
23
+ render?(props: any): React.ReactElement;
24
+ endding?: boolean;
25
+ getter?(node: any): React.ReactElement;
26
+ }
27
+ export declare const instructions: Registry<Instruction>;
28
+ export declare function useNodeContext(): any;
29
+ export declare function Node({ data }: {
30
+ data: any;
31
+ }): JSX.Element;
32
+ export declare function RemoveButton(): JSX.Element;
33
+ export declare function NodeDefaultView(props: any): JSX.Element;