@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.
Files changed (289) hide show
  1. package/client.d.ts +2 -3
  2. package/client.js +1 -30
  3. package/lib/client/AddButton.js +13 -11
  4. package/lib/client/Branch.js +10 -8
  5. package/lib/client/CanvasContent.js +12 -10
  6. package/lib/client/ExecutionCanvas.js +37 -33
  7. package/lib/client/ExecutionPage.js +4 -9
  8. package/lib/client/WorkflowCanvas.js +18 -15
  9. package/lib/client/WorkflowPage.js +4 -9
  10. package/lib/client/WorkflowProvider.js +1 -40
  11. package/lib/client/components/CollectionBlockInitializer.js +3 -3
  12. package/lib/client/components/CollectionFieldset.d.ts +1 -1
  13. package/lib/client/components/CollectionFieldset.js +15 -16
  14. package/lib/client/components/Duration.js +5 -5
  15. package/lib/client/components/DynamicExpression.d.ts +3 -3
  16. package/lib/client/components/FieldsSelect.d.ts +1 -1
  17. package/lib/client/components/FieldsSelect.js +10 -7
  18. package/lib/client/components/NodeDescription.js +45 -31
  19. package/lib/client/components/RadioWithTooltip.js +13 -20
  20. package/lib/client/components/ValueBlock.js +14 -21
  21. package/lib/client/components/renderEngineReference.js +1 -8
  22. package/lib/client/index.d.ts +12 -4
  23. package/lib/client/index.js +78 -15
  24. package/lib/client/locale/zh-CN.d.ts +5 -1
  25. package/lib/client/locale/zh-CN.js +6 -2
  26. package/lib/client/nodes/aggregate.d.ts +8 -3
  27. package/lib/client/nodes/aggregate.js +5 -4
  28. package/lib/client/nodes/calculation.d.ts +6 -4
  29. package/lib/client/nodes/calculation.js +22 -28
  30. package/lib/client/nodes/condition.d.ts +2 -10
  31. package/lib/client/nodes/condition.js +19 -37
  32. package/lib/client/nodes/create.d.ts +5 -6
  33. package/lib/client/nodes/create.js +1 -3
  34. package/lib/client/nodes/destroy.d.ts +1 -1
  35. package/lib/client/nodes/index.d.ts +2 -3
  36. package/lib/client/nodes/index.js +95 -102
  37. package/lib/client/nodes/loop.d.ts +1 -1
  38. package/lib/client/nodes/loop.js +46 -54
  39. package/lib/client/nodes/manual/FormBlockInitializer.js +6 -5
  40. package/lib/client/nodes/manual/ModeConfig.js +23 -30
  41. package/lib/client/nodes/manual/SchemaConfig.d.ts +4 -5
  42. package/lib/client/nodes/manual/SchemaConfig.js +180 -25
  43. package/lib/client/nodes/manual/WorkflowTodo.js +95 -110
  44. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +2 -5
  45. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +6 -5
  46. package/lib/client/nodes/manual/forms/create.js +8 -1
  47. package/lib/client/nodes/manual/forms/custom.js +22 -22
  48. package/lib/client/nodes/manual/forms/update.js +8 -1
  49. package/lib/client/nodes/manual/index.d.ts +6 -1
  50. package/lib/client/nodes/manual/index.js +5 -4
  51. package/lib/client/nodes/parallel.js +23 -20
  52. package/lib/client/nodes/query.d.ts +3 -5
  53. package/lib/client/nodes/query.js +1 -3
  54. package/lib/client/nodes/request.d.ts +2 -2
  55. package/lib/client/nodes/request.js +7 -7
  56. package/lib/client/nodes/sql.d.ts +26 -0
  57. package/lib/client/{triggers/schedule/DateFieldsSelect.js → nodes/sql.js} +37 -46
  58. package/lib/client/nodes/update.d.ts +2 -2
  59. package/lib/client/nodes/update.js +1 -1
  60. package/lib/client/schemas/collection.d.ts +3 -4
  61. package/lib/client/schemas/collection.js +11 -17
  62. package/lib/client/style.d.ts +18 -13
  63. package/lib/client/style.js +315 -292
  64. package/lib/client/triggers/collection.d.ts +13 -13
  65. package/lib/client/triggers/collection.js +5 -1
  66. package/lib/client/triggers/index.d.ts +3 -4
  67. package/lib/client/triggers/index.js +51 -53
  68. package/lib/client/triggers/schedule/EndsByField.js +11 -11
  69. package/lib/client/triggers/schedule/OnField.js +45 -33
  70. package/lib/client/triggers/schedule/RepeatField.js +4 -4
  71. package/lib/client/triggers/schedule/ScheduleConfig.js +24 -31
  72. package/lib/client/triggers/schedule/index.d.ts +1 -1
  73. package/lib/client/triggers/schedule/index.js +32 -20
  74. package/lib/client/variable.d.ts +31 -13
  75. package/lib/client/variable.js +44 -29
  76. package/lib/server/Plugin.d.ts +3 -6
  77. package/lib/server/Plugin.js +15 -12
  78. package/lib/server/Processor.d.ts +3 -5
  79. package/lib/server/Processor.js +2 -2
  80. package/lib/server/actions/nodes.js +7 -7
  81. package/lib/server/fields/expression-field.d.ts +1 -2
  82. package/lib/server/fields/expression-field.js +1 -8
  83. package/lib/server/functions/index.d.ts +2 -3
  84. package/lib/server/index.d.ts +1 -0
  85. package/lib/server/index.js +12 -0
  86. package/lib/server/instructions/aggregate.d.ts +1 -1
  87. package/lib/server/instructions/aggregate.js +5 -5
  88. package/lib/server/instructions/condition.d.ts +2 -1
  89. package/lib/server/instructions/create.d.ts +2 -2
  90. package/lib/server/instructions/create.js +13 -13
  91. package/lib/server/instructions/delay.d.ts +3 -3
  92. package/lib/server/instructions/delay.js +66 -64
  93. package/lib/server/instructions/destroy.d.ts +1 -1
  94. package/lib/server/instructions/index.d.ts +5 -5
  95. package/lib/server/instructions/index.js +1 -1
  96. package/lib/server/instructions/loop.d.ts +1 -2
  97. package/lib/server/instructions/manual/actions.js +19 -7
  98. package/lib/server/instructions/manual/forms/create.js +7 -1
  99. package/lib/server/instructions/manual/forms/index.d.ts +1 -1
  100. package/lib/server/instructions/manual/forms/update.js +7 -1
  101. package/lib/server/instructions/manual/index.d.ts +1 -1
  102. package/lib/server/instructions/parallel.d.ts +1 -2
  103. package/lib/server/instructions/query.d.ts +1 -1
  104. package/lib/server/instructions/query.js +8 -1
  105. package/lib/server/instructions/request.d.ts +3 -3
  106. package/lib/server/instructions/request.js +5 -2
  107. package/lib/server/instructions/sql.d.ts +12 -0
  108. package/lib/server/instructions/sql.js +34 -0
  109. package/lib/server/instructions/update.d.ts +1 -1
  110. package/lib/server/migrations/20230221071831-calculation-expression.js +1 -1
  111. package/lib/server/migrations/20230221121203-condition-calculation.js +1 -1
  112. package/lib/server/migrations/20230221162902-jsonb-to-json.js +7 -7
  113. package/lib/server/migrations/20230411034722-manual-multi-form.js +1 -8
  114. package/lib/server/migrations/20230710115902-manual-action-values.d.ts +4 -0
  115. package/lib/server/migrations/20230710115902-manual-action-values.js +97 -0
  116. package/lib/server/triggers/collection.d.ts +1 -1
  117. package/lib/server/triggers/collection.js +15 -13
  118. package/lib/server/triggers/index.d.ts +1 -1
  119. package/lib/server/triggers/schedule.d.ts +1 -1
  120. package/lib/server/triggers/schedule.js +18 -18
  121. package/lib/server/{models → types}/Execution.d.ts +2 -3
  122. package/lib/server/{models → types}/FlowNode.d.ts +1 -2
  123. package/lib/server/{models → types}/Job.d.ts +1 -2
  124. package/lib/server/{models → types}/Workflow.d.ts +1 -2
  125. package/lib/server/types/index.d.ts +4 -0
  126. package/lib/server/types/index.js +5 -0
  127. package/lib/server/utils.d.ts +2 -0
  128. package/lib/server/utils.js +21 -0
  129. package/package.json +39 -18
  130. package/server.d.ts +2 -3
  131. package/server.js +1 -30
  132. package/src/client/AddButton.tsx +111 -0
  133. package/src/client/Branch.tsx +37 -0
  134. package/src/client/CanvasContent.tsx +25 -0
  135. package/src/client/ExecutionCanvas.tsx +166 -0
  136. package/src/client/ExecutionLink.tsx +16 -0
  137. package/src/client/ExecutionPage.tsx +45 -0
  138. package/src/client/ExecutionResourceProvider.tsx +21 -0
  139. package/src/client/FlowContext.ts +7 -0
  140. package/src/client/WorkflowCanvas.tsx +221 -0
  141. package/src/client/WorkflowLink.tsx +16 -0
  142. package/src/client/WorkflowPage.tsx +52 -0
  143. package/src/client/WorkflowProvider.tsx +84 -0
  144. package/src/client/components/CollectionBlockInitializer.tsx +71 -0
  145. package/src/client/components/CollectionFieldset.tsx +160 -0
  146. package/src/client/components/Duration.tsx +45 -0
  147. package/src/client/components/DynamicExpression.tsx +53 -0
  148. package/src/client/components/FieldsSelect.tsx +32 -0
  149. package/src/client/components/FilterDynamicComponent.tsx +15 -0
  150. package/src/client/components/NodeDescription.tsx +51 -0
  151. package/src/client/components/NullRender.tsx +3 -0
  152. package/src/client/components/OpenDrawer.tsx +24 -0
  153. package/src/client/components/RadioWithTooltip.tsx +38 -0
  154. package/src/client/components/ValueBlock.tsx +67 -0
  155. package/src/client/components/renderEngineReference.tsx +30 -0
  156. package/src/client/constants.tsx +91 -0
  157. package/src/client/index.tsx +51 -0
  158. package/src/client/interfaces/expression.tsx +25 -0
  159. package/src/client/locale/en-US.ts +136 -0
  160. package/src/client/locale/es-ES.ts +129 -0
  161. package/src/client/locale/index.ts +18 -0
  162. package/src/client/locale/ja-JP.ts +90 -0
  163. package/src/client/locale/pt-BR.ts +136 -0
  164. package/src/client/locale/ru-RU.ts +90 -0
  165. package/src/client/locale/tr-TR.ts +90 -0
  166. package/src/client/locale/zh-CN.ts +248 -0
  167. package/src/client/nodes/aggregate.tsx +327 -0
  168. package/src/client/nodes/calculation.tsx +216 -0
  169. package/src/client/nodes/condition.tsx +463 -0
  170. package/src/client/nodes/create.tsx +85 -0
  171. package/src/client/nodes/delay.tsx +37 -0
  172. package/src/client/nodes/destroy.tsx +34 -0
  173. package/src/client/nodes/index.tsx +485 -0
  174. package/src/client/nodes/loop.tsx +144 -0
  175. package/src/client/nodes/manual/AssigneesSelect.tsx +33 -0
  176. package/src/client/nodes/manual/DetailsBlockProvider.tsx +80 -0
  177. package/src/client/nodes/manual/FormBlockInitializer.tsx +69 -0
  178. package/src/client/nodes/manual/FormBlockProvider.tsx +75 -0
  179. package/src/client/nodes/manual/ModeConfig.tsx +84 -0
  180. package/src/client/nodes/manual/SchemaConfig.tsx +509 -0
  181. package/src/client/nodes/manual/WorkflowTodo.tsx +607 -0
  182. package/src/client/nodes/manual/WorkflowTodoBlockInitializer.tsx +28 -0
  183. package/src/client/nodes/manual/forms/create.tsx +92 -0
  184. package/src/client/nodes/manual/forms/custom.tsx +392 -0
  185. package/src/client/nodes/manual/forms/update.tsx +134 -0
  186. package/src/client/nodes/manual/index.tsx +162 -0
  187. package/src/client/nodes/manual/utils.ts +28 -0
  188. package/src/client/nodes/parallel.tsx +138 -0
  189. package/src/client/nodes/query.tsx +88 -0
  190. package/src/client/nodes/request.tsx +185 -0
  191. package/src/client/nodes/sql.tsx +37 -0
  192. package/src/client/nodes/update.tsx +99 -0
  193. package/src/client/schemas/collection.ts +75 -0
  194. package/src/client/schemas/executions.tsx +169 -0
  195. package/src/client/schemas/workflows.ts +364 -0
  196. package/src/client/style.tsx +347 -0
  197. package/src/client/triggers/collection.tsx +190 -0
  198. package/src/client/triggers/index.tsx +311 -0
  199. package/src/client/triggers/schedule/EndsByField.tsx +40 -0
  200. package/src/client/triggers/schedule/OnField.tsx +64 -0
  201. package/src/client/triggers/schedule/RepeatField.tsx +116 -0
  202. package/src/client/triggers/schedule/ScheduleConfig.tsx +227 -0
  203. package/src/client/triggers/schedule/constants.ts +4 -0
  204. package/src/client/triggers/schedule/index.tsx +78 -0
  205. package/src/client/triggers/schedule/locale/Cron.zh-CN.ts +79 -0
  206. package/src/client/utils.ts +36 -0
  207. package/src/client/variable.tsx +318 -0
  208. package/src/index.ts +1 -0
  209. package/src/server/Plugin.ts +355 -0
  210. package/src/server/Processor.ts +354 -0
  211. package/src/server/__tests__/Plugin.test.ts +398 -0
  212. package/src/server/__tests__/Processor.test.ts +474 -0
  213. package/src/server/__tests__/actions/workflows.test.ts +419 -0
  214. package/src/server/__tests__/collections/categories.ts +27 -0
  215. package/src/server/__tests__/collections/comments.ts +24 -0
  216. package/src/server/__tests__/collections/posts.ts +42 -0
  217. package/src/server/__tests__/collections/replies.ts +9 -0
  218. package/src/server/__tests__/collections/tags.ts +15 -0
  219. package/src/server/__tests__/index.ts +89 -0
  220. package/src/server/__tests__/instructions/aggregate.test.ts +294 -0
  221. package/src/server/__tests__/instructions/calculation.test.ts +265 -0
  222. package/src/server/__tests__/instructions/condition.test.ts +335 -0
  223. package/src/server/__tests__/instructions/create.test.ts +129 -0
  224. package/src/server/__tests__/instructions/delay.test.ts +182 -0
  225. package/src/server/__tests__/instructions/destroy.test.ts +58 -0
  226. package/src/server/__tests__/instructions/loop.test.ts +331 -0
  227. package/src/server/__tests__/instructions/manual.test.ts +1173 -0
  228. package/src/server/__tests__/instructions/parallel.test.ts +445 -0
  229. package/src/server/__tests__/instructions/query.test.ts +359 -0
  230. package/src/server/__tests__/instructions/request.test.ts +247 -0
  231. package/src/server/__tests__/instructions/sql.test.ts +162 -0
  232. package/src/server/__tests__/instructions/update.test.ts +189 -0
  233. package/src/server/__tests__/triggers/collection.test.ts +333 -0
  234. package/src/server/__tests__/triggers/schedule.test.ts +369 -0
  235. package/src/server/actions/index.ts +25 -0
  236. package/src/server/actions/nodes.ts +214 -0
  237. package/src/server/actions/workflows.ts +178 -0
  238. package/src/server/collections/executions.ts +35 -0
  239. package/src/server/collections/flow_nodes.ts +54 -0
  240. package/src/server/collections/jobs.ts +31 -0
  241. package/src/server/collections/workflows.ts +88 -0
  242. package/src/server/constants.ts +26 -0
  243. package/src/server/fields/expression-field.ts +11 -0
  244. package/src/server/fields/index.ts +7 -0
  245. package/src/server/functions/index.ts +16 -0
  246. package/src/server/index.ts +6 -0
  247. package/src/server/instructions/aggregate.ts +42 -0
  248. package/src/server/instructions/calculation.ts +41 -0
  249. package/src/server/instructions/condition.ts +172 -0
  250. package/src/server/instructions/create.ts +39 -0
  251. package/src/server/instructions/delay.ts +105 -0
  252. package/src/server/instructions/destroy.ts +23 -0
  253. package/src/server/instructions/index.ts +64 -0
  254. package/src/server/instructions/loop.ts +99 -0
  255. package/src/server/instructions/manual/actions.ts +91 -0
  256. package/src/server/instructions/manual/collecions/jobs.ts +17 -0
  257. package/src/server/instructions/manual/collecions/users.ts +15 -0
  258. package/src/server/instructions/manual/collecions/users_jobs.ts +50 -0
  259. package/src/server/instructions/manual/forms/create.ts +23 -0
  260. package/src/server/instructions/manual/forms/index.ts +12 -0
  261. package/src/server/instructions/manual/forms/update.ts +23 -0
  262. package/src/server/instructions/manual/index.ts +184 -0
  263. package/src/server/instructions/parallel.ts +121 -0
  264. package/src/server/instructions/query.ts +42 -0
  265. package/src/server/instructions/request.ts +88 -0
  266. package/src/server/instructions/sql.ts +25 -0
  267. package/src/server/instructions/update.ts +24 -0
  268. package/src/server/migrations/20221129153547-calculation-variables.ts +64 -0
  269. package/src/server/migrations/20230221032941-change-request-body-type.ts +76 -0
  270. package/src/server/migrations/20230221071831-calculation-expression.ts +102 -0
  271. package/src/server/migrations/20230221121203-condition-calculation.ts +82 -0
  272. package/src/server/migrations/20230221162902-jsonb-to-json.ts +51 -0
  273. package/src/server/migrations/20230411034722-manual-multi-form.ts +282 -0
  274. package/src/server/migrations/20230612021134-manual-collection-block.ts +138 -0
  275. package/src/server/migrations/20230710115902-manual-action-values.ts +78 -0
  276. package/src/server/triggers/collection.ts +146 -0
  277. package/src/server/triggers/index.ts +22 -0
  278. package/src/server/triggers/schedule.ts +567 -0
  279. package/src/server/types/Execution.ts +26 -0
  280. package/src/server/types/FlowNode.ts +21 -0
  281. package/src/server/types/Job.ts +18 -0
  282. package/src/server/types/Workflow.ts +36 -0
  283. package/src/server/types/index.ts +4 -0
  284. package/src/server/utils.ts +17 -0
  285. package/lib/client/triggers/schedule/DateFieldsSelect.d.ts +0 -2
  286. /package/lib/server/{models → types}/Execution.js +0 -0
  287. /package/lib/server/{models → types}/FlowNode.js +0 -0
  288. /package/lib/server/{models → types}/Job.js +0 -0
  289. /package/lib/server/{models → types}/Workflow.js +0 -0
@@ -4,30 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- function _react() {
8
- const data = _interopRequireWildcard(require("react"));
9
- _react = function _react() {
7
+ function _icons() {
8
+ const data = require("@ant-design/icons");
9
+ _icons = function _icons() {
10
10
  return data;
11
11
  };
12
12
  return data;
13
13
  }
14
- function _css() {
15
- const data = require("@emotion/css");
16
- _css = function _css() {
14
+ function _client() {
15
+ const data = require("@nocobase/client");
16
+ _client = function _client() {
17
17
  return data;
18
18
  };
19
19
  return data;
20
20
  }
21
- function _icons() {
22
- const data = require("@ant-design/icons");
23
- _icons = function _icons() {
21
+ function _antd() {
22
+ const data = require("antd");
23
+ _antd = function _antd() {
24
24
  return data;
25
25
  };
26
26
  return data;
27
27
  }
28
- function _antd() {
29
- const data = require("antd");
30
- _antd = function _antd() {
28
+ function _react() {
29
+ const data = _interopRequireWildcard(require("react"));
30
+ _react = function _react() {
31
31
  return data;
32
32
  };
33
33
  return data;
@@ -35,9 +35,10 @@ function _antd() {
35
35
  var _2 = require(".");
36
36
  var _Branch = require("../Branch");
37
37
  var _FlowContext = require("../FlowContext");
38
- var _style = require("../style");
39
- var _locale = require("../locale");
40
38
  var _RadioWithTooltip = require("../components/RadioWithTooltip");
39
+ var _locale = require("../locale");
40
+ var _style = _interopRequireDefault(require("../style"));
41
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
42
  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); }
42
43
  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; }
43
44
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -79,6 +80,8 @@ var _default = {
79
80
  component: function Component({
80
81
  data
81
82
  }) {
83
+ const _useStyles = (0, _style.default)(),
84
+ styles = _useStyles.styles;
82
85
  const id = data.id,
83
86
  mode = data.config.mode;
84
87
  const _useFlowContext = (0, _FlowContext.useFlowContext)(),
@@ -99,9 +102,9 @@ var _default = {
99
102
  return _react().default.createElement(_2.NodeDefaultView, {
100
103
  data: data
101
104
  }, _react().default.createElement("div", {
102
- className: (0, _css().cx)(_style.nodeSubtreeClass)
105
+ className: (0, _client().cx)(styles.nodeSubtreeClass)
103
106
  }, _react().default.createElement("div", {
104
- className: (0, _css().cx)(_style.branchBlockClass)
107
+ className: (0, _client().cx)(styles.branchBlockClass)
105
108
  }, branches.map(branch => _react().default.createElement(_Branch.Branch, {
106
109
  key: branch.id,
107
110
  from: data,
@@ -112,7 +115,7 @@ var _default = {
112
115
  from: data,
113
116
  branchIndex: (lastBranchHead ? lastBranchHead.branchIndex : 0) + i + 1,
114
117
  controller: branches.length + i > 1 ? _react().default.createElement("div", {
115
- className: (0, _css().css)`
118
+ className: (0, _client().css)`
116
119
  padding-top: 2em;
117
120
 
118
121
  > button {
@@ -128,18 +131,18 @@ var _default = {
128
131
  disabled: workflow.executed
129
132
  })) : null
130
133
  }))), _react().default.createElement("div", {
131
- className: (0, _css().css)`
134
+ className: (0, _client().css)`
132
135
  position: relative;
133
136
  height: 2em;
134
137
  `
135
138
  }, _react().default.createElement(_antd().Tooltip, {
136
139
  title: (0, _locale.lang)('Add branch'),
137
- className: (0, _css().css)`
140
+ className: (0, _client().css)`
138
141
  visibility: ${workflow.executed ? 'hidden' : 'visible'};
139
142
  `
140
143
  }, _react().default.createElement(_antd().Button, {
141
144
  icon: _react().default.createElement(_icons().PlusOutlined, null),
142
- className: (0, _css().css)`
145
+ className: (0, _client().css)`
143
146
  position: absolute;
144
147
  top: calc(50% - 1px);
145
148
  transform: translateX(-50%) rotate(45deg);
@@ -14,7 +14,7 @@ declare const _default: {
14
14
  'x-decorator': string;
15
15
  'x-component': string;
16
16
  'x-component-props': {
17
- dropdownMatchSelectWidth: boolean;
17
+ popupMatchSelectWidth: boolean;
18
18
  };
19
19
  };
20
20
  multiple: {
@@ -47,9 +47,8 @@ declare const _default: {
47
47
  'x-decorator': string;
48
48
  'x-component': string;
49
49
  'x-component-props': {
50
- mode: string;
51
- placeholder: string;
52
- filter(field: any): boolean;
50
+ useCollection(): any;
51
+ className: string;
53
52
  };
54
53
  'x-reactions': {
55
54
  dependencies: string[];
@@ -75,7 +74,6 @@ declare const _default: {
75
74
  };
76
75
  components: {
77
76
  FilterDynamicComponent: typeof FilterDynamicComponent;
78
- FieldsSelect: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Pick<any, string | number | symbol>>>;
79
77
  };
80
78
  useVariables({ id, title, config }: {
81
79
  id: any;
@@ -16,7 +16,6 @@ var _locale = require("../locale");
16
16
  var _CollectionBlockInitializer = require("../components/CollectionBlockInitializer");
17
17
  var _FilterDynamicComponent = require("../components/FilterDynamicComponent");
18
18
  var _variable = require("../variable");
19
- var _FieldsSelect = require("../components/FieldsSelect");
20
19
  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; }
21
20
  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; }
22
21
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -61,8 +60,7 @@ var _default = {
61
60
  useCollectionDataSource: _client().useCollectionDataSource
62
61
  },
63
62
  components: {
64
- FilterDynamicComponent: _FilterDynamicComponent.FilterDynamicComponent,
65
- FieldsSelect: _FieldsSelect.FieldsSelect
63
+ FilterDynamicComponent: _FilterDynamicComponent.FilterDynamicComponent
66
64
  },
67
65
  useVariables({
68
66
  id,
@@ -168,8 +168,8 @@ declare const _default: {
168
168
  useWorkflowVariableOptions: typeof useWorkflowVariableOptions;
169
169
  };
170
170
  components: {
171
- ArrayItems: React.FC<React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement> & import("@formily/antd").IArrayBaseProps>> & import("@formily/antd").ArrayBaseMixins & {
172
- Item?: React.FC<React.HTMLAttributes<HTMLDivElement> & {
171
+ ArrayItems: import("@formily/reactive-react").ReactFC<React.HTMLAttributes<HTMLDivElement>> & import("@formily/antd-v5").ArrayBaseMixins & {
172
+ Item: import("@formily/reactive-react").ReactFC<React.HTMLAttributes<HTMLDivElement> & {
173
173
  type?: "divide" | "card";
174
174
  }>;
175
175
  };
@@ -4,16 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- function _react() {
8
- const data = _interopRequireDefault(require("react"));
9
- _react = function _react() {
7
+ function _antdV() {
8
+ const data = require("@formily/antd-v5");
9
+ _antdV = function _antdV() {
10
10
  return data;
11
11
  };
12
12
  return data;
13
13
  }
14
- function _antd() {
15
- const data = require("@formily/antd");
16
- _antd = function _antd() {
14
+ function _react() {
15
+ const data = _interopRequireDefault(require("react"));
16
+ _react = function _react() {
17
17
  return data;
18
18
  };
19
19
  return data;
@@ -213,7 +213,7 @@ var _default = {
213
213
  useWorkflowVariableOptions: _variable.useWorkflowVariableOptions
214
214
  },
215
215
  components: {
216
- ArrayItems: _antd().ArrayItems,
216
+ ArrayItems: _antdV().ArrayItems,
217
217
  RequestBody(props) {
218
218
  const scope = (0, _variable.useWorkflowVariableOptions)();
219
219
  return _react().default.createElement(_client().Variable.JSON, _objectSpread({
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ type: string;
5
+ group: string;
6
+ description: string;
7
+ fieldset: {
8
+ sql: {
9
+ type: string;
10
+ required: boolean;
11
+ title: string;
12
+ description: string;
13
+ 'x-decorator': string;
14
+ 'x-component': string;
15
+ 'x-component-props': {
16
+ rows: number;
17
+ className: string;
18
+ };
19
+ };
20
+ };
21
+ scope: {};
22
+ components: {
23
+ SQLInput(props: any): React.JSX.Element;
24
+ };
25
+ };
26
+ export default _default;
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DateFieldsSelect = void 0;
6
+ exports.default = void 0;
7
7
  function _react() {
8
- const data = require("@formily/react");
8
+ const data = _interopRequireDefault(require("react"));
9
9
  _react = function _react() {
10
10
  return data;
11
11
  };
@@ -18,53 +18,44 @@ function _client() {
18
18
  };
19
19
  return data;
20
20
  }
21
- function _antd() {
22
- const data = require("antd");
23
- _antd = function _antd() {
24
- return data;
25
- };
26
- return data;
27
- }
28
- function _react2() {
29
- const data = _interopRequireDefault(require("react"));
30
- _react2 = function _react2() {
31
- return data;
32
- };
33
- return data;
34
- }
35
- function _reactI18next() {
36
- const data = require("react-i18next");
37
- _reactI18next = function _reactI18next() {
38
- return data;
39
- };
40
- return data;
41
- }
21
+ var _locale = require("../locale");
22
+ var _variable = require("../variable");
42
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
24
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
44
25
  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; }
45
26
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
46
27
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
47
28
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
48
- const DateFieldsSelect = (0, _react().observer)(props => {
49
- const _useTranslation = (0, _reactI18next().useTranslation)(),
50
- t = _useTranslation.t;
51
- const compile = (0, _client().useCompile)();
52
- const _useCollectionManager = (0, _client().useCollectionManager)(),
53
- getCollectionFields = _useCollectionManager.getCollectionFields;
54
- const _useForm = (0, _react().useForm)(),
55
- values = _useForm.values;
56
- const fields = getCollectionFields(values === null || values === void 0 ? void 0 : values.collection);
57
- return _react2().default.createElement(_antd().Select, _objectSpread({
58
- dropdownMatchSelectWidth: false,
59
- placeholder: t('Select field')
60
- }, props), fields.filter(field => !field.hidden && (field.uiSchema ? field.type === 'date' : false)).map(field => {
61
- var _field$uiSchema;
62
- return _react2().default.createElement(_antd().Select.Option, {
63
- key: field.name,
64
- value: field.name
65
- }, compile((_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title));
66
- }));
67
- }, {
68
- displayName: 'DateFieldsSelect'
69
- });
70
- exports.DateFieldsSelect = DateFieldsSelect;
29
+ var _default = {
30
+ title: `{{t("SQL action", { ns: "${_locale.NAMESPACE}" })}}`,
31
+ type: 'sql',
32
+ group: 'extended',
33
+ description: `{{t("Execute a SQL statement in database.", { ns: "${_locale.NAMESPACE}" })}}`,
34
+ fieldset: {
35
+ sql: {
36
+ type: 'string',
37
+ required: true,
38
+ title: 'SQL',
39
+ description: `{{t("Usage of SQL query result is not supported yet.", { ns: "${_locale.NAMESPACE}" })}}`,
40
+ 'x-decorator': 'FormItem',
41
+ 'x-component': 'SQLInput',
42
+ 'x-component-props': {
43
+ rows: 20,
44
+ className: (0, _client().css)`
45
+ font-size: 80%;
46
+ font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
47
+ `
48
+ }
49
+ }
50
+ },
51
+ scope: {},
52
+ components: {
53
+ SQLInput(props) {
54
+ const scope = (0, _variable.useWorkflowVariableOptions)();
55
+ return _react().default.createElement(_client().Variable.RawTextArea, _objectSpread({
56
+ scope: scope
57
+ }, props));
58
+ }
59
+ }
60
+ };
61
+ exports.default = _default;
@@ -19,7 +19,7 @@ declare const _default: {
19
19
  'x-decorator': string;
20
20
  'x-component': string;
21
21
  'x-component-props': {
22
- dropdownMatchSelectWidth: boolean;
22
+ popupMatchSelectWidth: boolean;
23
23
  };
24
24
  };
25
25
  params: {
@@ -76,7 +76,7 @@ declare const _default: {
76
76
  };
77
77
  components: {
78
78
  FilterDynamicComponent: typeof FilterDynamicComponent;
79
- CollectionFieldset: React.MemoExoticComponent<import("@formily/react").ReactFC<Pick<any, string | number | symbol>>>;
79
+ CollectionFieldset: React.MemoExoticComponent<import("@formily/react").ReactFC<Omit<any, "ref">>>;
80
80
  IndividualHooksRadioWithTooltip: typeof IndividualHooksRadioWithTooltip;
81
81
  };
82
82
  };
@@ -100,7 +100,7 @@ var _default = {
100
100
  filter: _objectSpread(_objectSpread({}, _collection.filter), {}, {
101
101
  title: `{{t("Only update records matching conditions", { ns: "${_locale.NAMESPACE}" })}}`,
102
102
  ['x-validator'](value) {
103
- return (0, _utils.isValidFilter)(value) ? '' : `{{t("Please add at least one condition", { ns: "${_locale.NAMESPACE}" })}}`;
103
+ return (0, _utils.isValidFilter)(value) ? '' : (0, _locale.lang)('Please add at least one condition');
104
104
  }
105
105
  }),
106
106
  values: _objectSpread(_objectSpread({}, _collection.values), {}, {
@@ -6,7 +6,7 @@ export declare const collection: {
6
6
  'x-decorator': string;
7
7
  'x-component': string;
8
8
  'x-component-props': {
9
- dropdownMatchSelectWidth: boolean;
9
+ popupMatchSelectWidth: boolean;
10
10
  };
11
11
  };
12
12
  export declare const values: {
@@ -40,9 +40,8 @@ export declare const appends: {
40
40
  'x-decorator': string;
41
41
  'x-component': string;
42
42
  'x-component-props': {
43
- mode: string;
44
- placeholder: string;
45
- filter(field: any): boolean;
43
+ useCollection(): any;
44
+ className: string;
46
45
  };
47
46
  'x-reactions': {
48
47
  dependencies: string[];
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.values = exports.filter = exports.collection = exports.appends = void 0;
7
- function _css() {
8
- const data = require("@emotion/css");
9
- _css = function _css() {
10
- return data;
11
- };
12
- return data;
13
- }
14
7
  function _react() {
15
8
  const data = require("@formily/react");
16
9
  _react = function _react() {
@@ -34,7 +27,7 @@ const collection = {
34
27
  'x-decorator': 'FormItem',
35
28
  'x-component': 'CollectionSelect',
36
29
  'x-component-props': {
37
- dropdownMatchSelectWidth: false
30
+ popupMatchSelectWidth: false
38
31
  }
39
32
  };
40
33
  exports.collection = collection;
@@ -44,7 +37,7 @@ const values = {
44
37
  'x-decorator': 'FormItem',
45
38
  'x-decorator-props': {
46
39
  labelAlign: 'left',
47
- className: (0, _css().css)`
40
+ className: (0, _client().css)`
48
41
  flex-direction: column;
49
42
  `
50
43
  },
@@ -64,7 +57,7 @@ const filter = {
64
57
  const options = (0, _client().useCollectionFilterOptions)(values === null || values === void 0 ? void 0 : values.collection);
65
58
  return {
66
59
  options,
67
- className: (0, _css().css)`
60
+ className: (0, _client().css)`
68
61
  position: relative;
69
62
  width: 100%;
70
63
  `
@@ -77,15 +70,16 @@ exports.filter = filter;
77
70
  const appends = {
78
71
  type: 'array',
79
72
  title: `{{t("Preload associations", { ns: "${_locale.NAMESPACE}" })}}`,
80
- description: `{{t("Please select the associated fields that need to be accessed in subsequent nodes", { ns: "${_locale.NAMESPACE}" })}}`,
73
+ description: `{{t("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.", { ns: "${_locale.NAMESPACE}" })}}`,
81
74
  'x-decorator': 'FormItem',
82
- 'x-component': 'FieldsSelect',
75
+ 'x-component': 'AppendsTreeSelect',
83
76
  'x-component-props': {
84
- mode: 'multiple',
85
- placeholder: '{{t("Select field")}}',
86
- filter(field) {
87
- return ['linkTo', 'belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type);
88
- }
77
+ useCollection() {
78
+ const _useForm2 = (0, _react().useForm)(),
79
+ values = _useForm2.values;
80
+ return values === null || values === void 0 ? void 0 : values.collection;
81
+ },
82
+ className: 'full-width'
89
83
  },
90
84
  'x-reactions': [{
91
85
  dependencies: ['collection'],
@@ -1,13 +1,18 @@
1
- export declare const workflowPageClass: string;
2
- export declare const workflowVersionDropdownClass: string;
3
- export declare const branchBlockClass: string;
4
- export declare const branchClass: string;
5
- export declare const nodeBlockClass: string;
6
- export declare const nodeClass: string;
7
- export declare const nodeCardClass: string;
8
- export declare const nodeJobButtonClass: string;
9
- export declare const nodeHeaderClass: string;
10
- export declare const nodeMetaClass: string;
11
- export declare const nodeTitleClass: string;
12
- export declare const nodeSubtreeClass: string;
13
- export declare const addButtonClass: string;
1
+ declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ workflowPageClass: import("antd-style").SerializedStyles;
3
+ workflowVersionDropdownClass: import("antd-style").SerializedStyles;
4
+ branchBlockClass: import("antd-style").SerializedStyles;
5
+ branchClass: import("antd-style").SerializedStyles;
6
+ nodeBlockClass: import("antd-style").SerializedStyles;
7
+ nodeClass: import("antd-style").SerializedStyles;
8
+ nodeCardClass: import("antd-style").SerializedStyles;
9
+ nodeJobButtonClass: import("antd-style").SerializedStyles;
10
+ nodeHeaderClass: import("antd-style").SerializedStyles;
11
+ nodeMetaClass: import("antd-style").SerializedStyles;
12
+ nodeTitleClass: import("antd-style").SerializedStyles;
13
+ nodeSubtreeClass: import("antd-style").SerializedStyles;
14
+ addButtonClass: import("antd-style").SerializedStyles;
15
+ conditionClass: import("antd-style").SerializedStyles;
16
+ loopLineClass: import("antd-style").SerializedStyles;
17
+ }>;
18
+ export default useStyles;