@nocobase/plugin-workflow 0.9.1-alpha.2 → 0.9.2-alpha.2
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/lib/client/AddButton.js +17 -64
- package/lib/client/Branch.js +0 -13
- package/lib/client/ExecutionCanvas.js +16 -63
- package/lib/client/ExecutionLink.js +3 -21
- package/lib/client/ExecutionPage.js +1 -19
- package/lib/client/ExecutionResourceProvider.js +6 -23
- package/lib/client/FlowContext.js +0 -8
- package/lib/client/WorkflowCanvas.js +56 -127
- package/lib/client/WorkflowLink.js +3 -21
- package/lib/client/WorkflowPage.js +1 -19
- package/lib/client/WorkflowProvider.js +24 -47
- package/lib/client/WorkflowShortcut.js +0 -16
- package/lib/client/components/CollectionBlockInitializer.js +12 -22
- package/lib/client/components/CollectionFieldInitializers.js +5 -24
- package/lib/client/components/CollectionFieldset.js +31 -79
- package/lib/client/components/Duration.js +0 -14
- package/lib/client/components/DynamicExpression.d.ts +4 -0
- package/lib/client/components/DynamicExpression.js +102 -0
- package/lib/client/components/FieldsSelect.d.ts +2 -0
- package/lib/client/components/FieldsSelect.js +66 -0
- package/lib/client/components/FilterDynamicComponent.js +1 -10
- package/lib/client/components/NullRender.js +0 -1
- package/lib/client/components/OpenDrawer.js +10 -35
- package/lib/client/components/RadioWithTooltip.js +5 -27
- package/lib/client/components/renderEngineReference.d.ts +1 -0
- package/lib/client/components/renderEngineReference.js +55 -0
- package/lib/client/constants.js +0 -9
- package/lib/client/index.js +0 -6
- package/lib/client/interfaces/expression.d.ts +3 -0
- package/lib/client/interfaces/expression.js +37 -0
- package/lib/client/locale/index.js +5 -15
- package/lib/client/locale/pt-BR.d.ts +130 -0
- package/lib/client/locale/pt-BR.js +136 -0
- package/lib/client/locale/zh-CN.d.ts +16 -1
- package/lib/client/locale/zh-CN.js +17 -2
- package/lib/client/nodes/calculation.d.ts +54 -3
- package/lib/client/nodes/calculation.js +136 -63
- package/lib/client/nodes/condition.d.ts +1 -1
- package/lib/client/nodes/condition.js +21 -76
- package/lib/client/nodes/create.d.ts +35 -9
- package/lib/client/nodes/create.js +13 -19
- package/lib/client/nodes/delay.d.ts +1 -3
- package/lib/client/nodes/delay.js +3 -10
- package/lib/client/nodes/destroy.d.ts +1 -6
- package/lib/client/nodes/destroy.js +12 -9
- package/lib/client/nodes/index.d.ts +2 -2
- package/lib/client/nodes/index.js +45 -147
- package/lib/client/nodes/manual/AssigneesSelect.js +6 -17
- package/lib/client/nodes/manual/ModeConfig.js +0 -27
- package/lib/client/nodes/manual/SchemaConfig.js +87 -449
- package/lib/client/nodes/manual/WorkflowTodo.js +99 -163
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +4 -20
- package/lib/client/nodes/manual/forms/customForm.d.ts +40 -0
- package/lib/client/nodes/manual/forms/customForm.js +411 -0
- package/lib/client/nodes/manual/index.d.ts +12 -1
- package/lib/client/nodes/manual/index.js +54 -41
- package/lib/client/nodes/parallel.js +7 -41
- package/lib/client/nodes/query.d.ts +28 -7
- package/lib/client/nodes/query.js +15 -22
- package/lib/client/nodes/request.d.ts +2 -3
- package/lib/client/nodes/request.js +5 -22
- package/lib/client/nodes/update.d.ts +1 -6
- package/lib/client/nodes/update.js +8 -16
- package/lib/client/schemas/collection.d.ts +20 -4
- package/lib/client/schemas/collection.js +26 -22
- package/lib/client/schemas/executions.js +3 -18
- package/lib/client/schemas/workflows.js +10 -33
- package/lib/client/style.js +24 -21
- package/lib/client/triggers/collection.d.ts +24 -20
- package/lib/client/triggers/collection.js +34 -123
- package/lib/client/triggers/index.d.ts +2 -5
- package/lib/client/triggers/index.js +34 -105
- package/lib/client/triggers/schedule/DateFieldsSelect.js +6 -29
- package/lib/client/triggers/schedule/EndsByField.js +1 -18
- package/lib/client/triggers/schedule/OnField.js +10 -38
- package/lib/client/triggers/schedule/RepeatField.js +4 -32
- package/lib/client/triggers/schedule/ScheduleConfig.js +10 -51
- package/lib/client/triggers/schedule/index.d.ts +21 -0
- package/lib/client/triggers/schedule/index.js +21 -22
- package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +8 -4
- package/lib/client/utils.d.ts +1 -0
- package/lib/client/utils.js +31 -10
- package/lib/client/variable.d.ts +7 -6
- package/lib/client/variable.js +132 -71
- package/lib/index.js +0 -2
- package/lib/server/Plugin.d.ts +7 -7
- package/lib/server/Plugin.js +76 -111
- package/lib/server/Processor.d.ts +2 -0
- package/lib/server/Processor.js +62 -125
- package/lib/server/actions/index.js +3 -10
- package/lib/server/actions/nodes.js +34 -87
- package/lib/server/actions/workflows.js +46 -96
- package/lib/server/collections/executions.js +1 -1
- package/lib/server/collections/flow_nodes.js +7 -4
- package/lib/server/collections/jobs.js +1 -1
- package/lib/server/collections/workflows.js +3 -4
- package/lib/server/fields/expression-field.d.ts +8 -0
- package/lib/server/fields/expression-field.js +26 -0
- package/lib/server/fields/index.d.ts +1 -0
- package/lib/server/fields/index.js +12 -0
- package/lib/server/functions/index.js +3 -14
- package/lib/server/index.js +0 -6
- package/lib/server/instructions/calculation.js +22 -17
- package/lib/server/instructions/condition.js +8 -52
- package/lib/server/instructions/create.js +31 -15
- package/lib/server/instructions/delay.js +4 -32
- package/lib/server/instructions/destroy.js +6 -12
- package/lib/server/instructions/index.js +6 -23
- package/lib/server/instructions/manual/actions.js +22 -31
- package/lib/server/instructions/manual/collecions/users_jobs.js +1 -1
- package/lib/server/instructions/manual/index.d.ts +13 -12
- package/lib/server/instructions/manual/index.js +9 -47
- package/lib/server/instructions/parallel.js +9 -36
- package/lib/server/instructions/query.js +17 -15
- package/lib/server/instructions/request.js +7 -30
- package/lib/server/instructions/update.js +8 -14
- package/lib/server/migrations/20221129153547-calculation-variables.js +3 -27
- package/lib/server/migrations/20230221032941-change-request-body-type.js +3 -26
- package/lib/server/migrations/20230221071831-calculation-expression.js +1 -33
- package/lib/server/migrations/20230221121203-condition-calculation.js +5 -28
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +3 -18
- package/lib/server/migrations/20230411034722-manual-multi-form.d.ts +4 -0
- package/lib/server/migrations/20230411034722-manual-multi-form.js +303 -0
- package/lib/server/models/Execution.js +0 -5
- package/lib/server/models/FlowNode.js +0 -5
- package/lib/server/models/Job.js +0 -5
- package/lib/server/models/Workflow.js +0 -5
- package/lib/server/triggers/collection.js +39 -61
- package/lib/server/triggers/index.js +3 -22
- package/lib/server/triggers/schedule.js +72 -194
- package/package.json +14 -11
|
@@ -5,138 +5,75 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SchemaConfig = SchemaConfig;
|
|
7
7
|
exports.SchemaConfigButton = SchemaConfigButton;
|
|
8
|
-
|
|
9
8
|
function _react() {
|
|
10
9
|
const data = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
10
|
_react = function _react() {
|
|
13
11
|
return data;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
return data;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
function _react2() {
|
|
20
16
|
const data = require("@formily/react");
|
|
21
|
-
|
|
22
17
|
_react2 = function _react2() {
|
|
23
18
|
return data;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
return data;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
|
-
function _antd() {
|
|
30
|
-
const data = require("@formily/antd");
|
|
31
|
-
|
|
32
|
-
_antd = function _antd() {
|
|
33
|
-
return data;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
22
|
function _lodash() {
|
|
40
23
|
const data = require("lodash");
|
|
41
|
-
|
|
42
24
|
_lodash = function _lodash() {
|
|
43
25
|
return data;
|
|
44
26
|
};
|
|
45
|
-
|
|
46
|
-
return data;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function _reactI18next() {
|
|
50
|
-
const data = require("react-i18next");
|
|
51
|
-
|
|
52
|
-
_reactI18next = function _reactI18next() {
|
|
53
|
-
return data;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
27
|
return data;
|
|
57
28
|
}
|
|
58
|
-
|
|
59
29
|
function _client() {
|
|
60
30
|
const data = require("@nocobase/client");
|
|
61
|
-
|
|
62
31
|
_client = function _client() {
|
|
63
32
|
return data;
|
|
64
33
|
};
|
|
65
|
-
|
|
66
|
-
return data;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _client2() {
|
|
70
|
-
const data = require("@nocobase/utils/client");
|
|
71
|
-
|
|
72
|
-
_client2 = function _client2() {
|
|
73
|
-
return data;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
34
|
return data;
|
|
77
35
|
}
|
|
78
|
-
|
|
79
36
|
var _triggers = require("../../triggers");
|
|
80
|
-
|
|
81
37
|
var _ = require("..");
|
|
82
|
-
|
|
83
38
|
var _FlowContext = require("../../FlowContext");
|
|
84
|
-
|
|
85
39
|
var _locale = require("../../locale");
|
|
86
|
-
|
|
87
40
|
var _constants = require("../../constants");
|
|
88
|
-
|
|
89
|
-
const _excluded = ["
|
|
90
|
-
|
|
91
|
-
_excluded3 = ["properties"],
|
|
92
|
-
_excluded4 = ["action", "actionProps"];
|
|
93
|
-
|
|
41
|
+
var _customForm = _interopRequireDefault(require("./forms/customForm"));
|
|
42
|
+
const _excluded = ["action", "actionProps"];
|
|
43
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
94
44
|
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); }
|
|
95
|
-
|
|
96
45
|
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; }
|
|
97
|
-
|
|
98
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
99
|
-
|
|
100
|
-
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); }); }; }
|
|
101
|
-
|
|
102
46
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
103
|
-
|
|
104
47
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
105
|
-
|
|
106
48
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
107
|
-
|
|
108
49
|
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; }
|
|
109
|
-
|
|
110
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
111
|
-
|
|
50
|
+
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; } }
|
|
112
51
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
113
|
-
|
|
114
|
-
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; }
|
|
115
|
-
|
|
116
|
-
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; }
|
|
117
|
-
|
|
118
|
-
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; }
|
|
119
|
-
|
|
120
52
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
121
|
-
|
|
122
53
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
123
|
-
|
|
54
|
+
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; }
|
|
55
|
+
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; }
|
|
56
|
+
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; }
|
|
57
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
58
|
+
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); }
|
|
124
59
|
function useTriggerInitializers() {
|
|
125
60
|
const _useFlowContext = (0, _FlowContext.useFlowContext)(),
|
|
126
|
-
|
|
127
|
-
|
|
61
|
+
workflow = _useFlowContext.workflow;
|
|
128
62
|
const trigger = (0, _triggers.useTrigger)();
|
|
129
63
|
return trigger.useInitializers ? trigger.useInitializers(workflow.config) : null;
|
|
130
64
|
}
|
|
131
|
-
|
|
132
65
|
;
|
|
133
|
-
|
|
66
|
+
const blockTypeNames = {
|
|
67
|
+
'customForm': _customForm.default.title,
|
|
68
|
+
'record': `{{t("Data record", { ns: "${_locale.NAMESPACE}" })}}`
|
|
69
|
+
};
|
|
134
70
|
function SimpleDesigner() {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
71
|
+
var _blockTypeNames$schem, _schema$xDesignerPr;
|
|
72
|
+
const schema = (0, _react2().useFieldSchema)();
|
|
73
|
+
const title = (_blockTypeNames$schem = blockTypeNames[(_schema$xDesignerPr = schema['x-designer-props']) === null || _schema$xDesignerPr === void 0 ? void 0 : _schema$xDesignerPr.type]) !== null && _blockTypeNames$schem !== void 0 ? _blockTypeNames$schem : '{{t("Block")}}';
|
|
74
|
+
const compile = (0, _client().useCompile)();
|
|
138
75
|
return _react().default.createElement(_client().GeneralSchemaDesigner, {
|
|
139
|
-
title:
|
|
76
|
+
title: compile(title)
|
|
140
77
|
}, _react().default.createElement(_client().SchemaSettings.BlockTitleItem, null), _react().default.createElement(_client().SchemaSettings.Divider, null), _react().default.createElement(_client().SchemaSettings.Remove, {
|
|
141
78
|
removeParentsIfNoChildren: true,
|
|
142
79
|
breakRemoveOn: {
|
|
@@ -144,38 +81,13 @@ function SimpleDesigner() {
|
|
|
144
81
|
}
|
|
145
82
|
}));
|
|
146
83
|
}
|
|
147
|
-
|
|
148
|
-
function FormBlockInitializer(_ref) {
|
|
149
|
-
let insert = _ref.insert,
|
|
150
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
151
|
-
|
|
152
|
-
return _react().default.createElement(_client().SchemaInitializer.Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
153
|
-
onClick: () => {
|
|
154
|
-
insert({
|
|
155
|
-
type: 'void',
|
|
156
|
-
'x-component': 'CardItem',
|
|
157
|
-
'x-designer': 'SimpleDesigner',
|
|
158
|
-
properties: {
|
|
159
|
-
grid: {
|
|
160
|
-
type: 'void',
|
|
161
|
-
'x-component': 'Grid',
|
|
162
|
-
'x-initializer': 'AddFormField'
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}));
|
|
168
|
-
}
|
|
169
|
-
|
|
170
84
|
function AddBlockButton(props) {
|
|
171
85
|
const current = (0, _.useNodeContext)();
|
|
172
86
|
const nodes = (0, _.useAvailableUpstreams)(current);
|
|
173
87
|
const triggerInitializers = [useTriggerInitializers()].filter(Boolean);
|
|
174
88
|
const nodeBlockInitializers = nodes.map(node => {
|
|
175
89
|
var _instruction$useIniti;
|
|
176
|
-
|
|
177
90
|
const instruction = _.instructions.get(node.type);
|
|
178
|
-
|
|
179
91
|
return instruction === null || instruction === void 0 ? void 0 : (_instruction$useIniti = instruction.useInitializers) === null || _instruction$useIniti === void 0 ? void 0 : _instruction$useIniti.call(instruction, node);
|
|
180
92
|
}).filter(Boolean);
|
|
181
93
|
const dataBlockInitializers = [...triggerInitializers, ...(nodeBlockInitializers.length ? [{
|
|
@@ -191,12 +103,20 @@ function AddBlockButton(props) {
|
|
|
191
103
|
}] : []), {
|
|
192
104
|
type: 'itemGroup',
|
|
193
105
|
title: '{{t("Form")}}',
|
|
194
|
-
children: [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
106
|
+
children: [_customForm.default.config.initializer
|
|
107
|
+
// {
|
|
108
|
+
// key: 'createForm',
|
|
109
|
+
// type: 'item',
|
|
110
|
+
// title: '{{t("Create record form")}}',
|
|
111
|
+
// component: CustomFormBlockInitializer,
|
|
112
|
+
// },
|
|
113
|
+
// {
|
|
114
|
+
// key: 'updateForm',
|
|
115
|
+
// type: 'item',
|
|
116
|
+
// title: '{{t("Update record form")}}',
|
|
117
|
+
// component: CustomFormBlockInitializer,
|
|
118
|
+
// }
|
|
119
|
+
]
|
|
200
120
|
}, {
|
|
201
121
|
type: 'itemGroup',
|
|
202
122
|
title: '{{t("Other blocks")}}',
|
|
@@ -212,267 +132,40 @@ function AddBlockButton(props) {
|
|
|
212
132
|
title: "{{t('Add block')}}"
|
|
213
133
|
}));
|
|
214
134
|
}
|
|
215
|
-
|
|
216
135
|
;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
datetime: '{{t("Date & Time")}}',
|
|
222
|
-
relation: '{{t("Relation")}}',
|
|
223
|
-
advanced: '{{t("Advanced type")}}',
|
|
224
|
-
systemInfo: '{{t("System info")}}',
|
|
225
|
-
others: '{{t("Others")}}'
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
function getOptions(interfaces) {
|
|
229
|
-
const fields = {};
|
|
230
|
-
Object.keys(interfaces).forEach(type => {
|
|
231
|
-
const schema = interfaces[type];
|
|
232
|
-
const _schema$group = schema.group,
|
|
233
|
-
group = _schema$group === void 0 ? 'others' : _schema$group;
|
|
234
|
-
fields[group] = fields[group] || {};
|
|
235
|
-
(0, _lodash().set)(fields, [group, type], schema);
|
|
236
|
-
});
|
|
237
|
-
return Object.keys(GroupLabels).filter(groupName => ['basic', 'choices', 'datetime', 'media'].includes(groupName)).map(groupName => ({
|
|
238
|
-
title: GroupLabels[groupName],
|
|
239
|
-
children: Object.keys(fields[groupName] || {}).map(type => {
|
|
240
|
-
const field = fields[groupName][type];
|
|
241
|
-
return _objectSpread({
|
|
242
|
-
value: type,
|
|
243
|
-
title: field.title,
|
|
244
|
-
name: type
|
|
245
|
-
}, fields[groupName][type]);
|
|
246
|
-
}).sort((a, b) => a.order - b.order)
|
|
247
|
-
}));
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function useCommonInterfaceInitializers() {
|
|
251
|
-
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
252
|
-
interfaces = _useCollectionManager.interfaces;
|
|
253
|
-
|
|
254
|
-
const options = getOptions(interfaces);
|
|
255
|
-
return options.map(group => ({
|
|
256
|
-
key: group.title,
|
|
257
|
-
type: 'itemGroup',
|
|
258
|
-
title: group.title,
|
|
259
|
-
children: group.children.map(item => ({
|
|
260
|
-
key: item.name,
|
|
261
|
-
type: 'item',
|
|
262
|
-
title: item.title,
|
|
263
|
-
component: FormFieldInitializer,
|
|
264
|
-
fieldInterface: item.name
|
|
265
|
-
}))
|
|
266
|
-
}));
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const AddFormFieldButtonContext = _react().default.createContext({});
|
|
270
|
-
|
|
271
|
-
function AddFormField(props) {
|
|
272
|
-
const _props$insertPosition = props.insertPosition,
|
|
273
|
-
insertPosition = _props$insertPosition === void 0 ? 'beforeEnd' : _props$insertPosition,
|
|
274
|
-
component = props.component;
|
|
275
|
-
const items = useCommonInterfaceInitializers();
|
|
276
|
-
const collection = (0, _react().useContext)(_client().CollectionContext);
|
|
277
|
-
|
|
278
|
-
const _useState = (0, _react().useState)(null),
|
|
279
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
280
|
-
interfaceOptions = _useState2[0],
|
|
281
|
-
setInterface = _useState2[1];
|
|
282
|
-
|
|
283
|
-
const _useState3 = (0, _react().useState)(),
|
|
284
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
285
|
-
insert = _useState4[0],
|
|
286
|
-
setCallback = _useState4[1];
|
|
287
|
-
|
|
288
|
-
return _react().default.createElement(AddFormFieldButtonContext.Provider, {
|
|
289
|
-
value: {
|
|
290
|
-
onAddField(item) {
|
|
291
|
-
const _cloneDeep = (0, _lodash().cloneDeep)(item),
|
|
292
|
-
_cloneDeep$properties = _cloneDeep.properties,
|
|
293
|
-
unique = _cloneDeep$properties.unique,
|
|
294
|
-
type = _cloneDeep$properties.type,
|
|
295
|
-
properties = _objectWithoutProperties(_cloneDeep$properties, _excluded2),
|
|
296
|
-
options = _objectWithoutProperties(_cloneDeep, _excluded3);
|
|
297
|
-
|
|
298
|
-
delete properties.name['x-disabled'];
|
|
299
|
-
setInterface(_objectSpread(_objectSpread({}, options), {}, {
|
|
300
|
-
properties
|
|
301
|
-
}));
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
setCallback
|
|
305
|
-
}
|
|
306
|
-
}, _react().default.createElement(_client().SchemaInitializer.Button, {
|
|
307
|
-
wrap: _client().gridRowColWrap,
|
|
308
|
-
insertPosition: insertPosition,
|
|
309
|
-
items: items,
|
|
310
|
-
component: component,
|
|
311
|
-
title: "{{t('Configure fields')}}"
|
|
312
|
-
}), _react().default.createElement(_client().ActionContext.Provider, {
|
|
313
|
-
value: {
|
|
314
|
-
visible: Boolean(interfaceOptions)
|
|
315
|
-
}
|
|
316
|
-
}, interfaceOptions ? _react().default.createElement(_client().SchemaComponent, {
|
|
317
|
-
schema: {
|
|
318
|
-
type: 'void',
|
|
319
|
-
name: 'drawer',
|
|
320
|
-
title: '{{t("Configure field")}}',
|
|
321
|
-
'x-decorator': 'Form',
|
|
322
|
-
'x-component': 'Action.Drawer',
|
|
323
|
-
properties: _objectSpread(_objectSpread({}, interfaceOptions.properties), {}, {
|
|
324
|
-
footer: {
|
|
325
|
-
type: 'void',
|
|
326
|
-
'x-component': 'Action.Drawer.Footer',
|
|
327
|
-
properties: {
|
|
328
|
-
cancel: {
|
|
329
|
-
type: 'void',
|
|
330
|
-
title: '{{t("Cancel")}}',
|
|
331
|
-
'x-component': 'Action',
|
|
332
|
-
'x-component-props': {
|
|
333
|
-
useAction() {
|
|
334
|
-
const form = (0, _react2().useForm)();
|
|
335
|
-
return {
|
|
336
|
-
run() {
|
|
337
|
-
return _asyncToGenerator(function* () {
|
|
338
|
-
setCallback(null);
|
|
339
|
-
setInterface(null);
|
|
340
|
-
form.reset();
|
|
341
|
-
})();
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
},
|
|
349
|
-
submit: {
|
|
350
|
-
type: 'void',
|
|
351
|
-
title: '{{t("Submit")}}',
|
|
352
|
-
'x-component': 'Action',
|
|
353
|
-
'x-component-props': {
|
|
354
|
-
type: 'primary',
|
|
355
|
-
|
|
356
|
-
useAction() {
|
|
357
|
-
const _useForm = (0, _react2().useForm)(),
|
|
358
|
-
values = _useForm.values,
|
|
359
|
-
query = _useForm.query;
|
|
360
|
-
|
|
361
|
-
return {
|
|
362
|
-
run() {
|
|
363
|
-
return _asyncToGenerator(function* () {
|
|
364
|
-
var _values$name, _values$uiSchema$titl, _values$uiSchema, _collection$fields, _collection$fields2;
|
|
365
|
-
|
|
366
|
-
const options = interfaceOptions.default;
|
|
367
|
-
const defaultName = (0, _client2().uid)();
|
|
368
|
-
options.name = (_values$name = values.name) !== null && _values$name !== void 0 ? _values$name : defaultName;
|
|
369
|
-
options.uiSchema.title = (_values$uiSchema$titl = (_values$uiSchema = values.uiSchema) === null || _values$uiSchema === void 0 ? void 0 : _values$uiSchema.title) !== null && _values$uiSchema$titl !== void 0 ? _values$uiSchema$titl : defaultName;
|
|
370
|
-
options.interface = interfaceOptions.name;
|
|
371
|
-
const existed = (_collection$fields = collection.fields) === null || _collection$fields === void 0 ? void 0 : _collection$fields.find(item => item.name === options.name);
|
|
372
|
-
|
|
373
|
-
if (existed) {
|
|
374
|
-
const field = query('name').take();
|
|
375
|
-
field.setFeedback({
|
|
376
|
-
type: 'error',
|
|
377
|
-
// code: 'FormulaError',
|
|
378
|
-
messages: [(0, _locale.lang)('Field name existed in form')]
|
|
379
|
-
});
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
(_collection$fields2 = collection.fields) === null || _collection$fields2 === void 0 ? void 0 : _collection$fields2.push((0, _client2().merge)(options, values));
|
|
384
|
-
insert({
|
|
385
|
-
name: options.name,
|
|
386
|
-
type: options.uiSchema.type,
|
|
387
|
-
'x-decorator': 'FormItem',
|
|
388
|
-
'x-component': 'CollectionField',
|
|
389
|
-
'x-component-props': {},
|
|
390
|
-
'x-collection-field': `${collection.name}.${options.name}`,
|
|
391
|
-
'x-designer': 'FormItem.Designer'
|
|
392
|
-
});
|
|
393
|
-
setCallback(null);
|
|
394
|
-
setInterface(null);
|
|
395
|
-
})();
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
})
|
|
406
|
-
},
|
|
407
|
-
components: {
|
|
408
|
-
ArrayTable: _antd().ArrayTable
|
|
409
|
-
}
|
|
410
|
-
}) : null));
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
function FormFieldInitializer(props) {
|
|
414
|
-
const item = props.item,
|
|
415
|
-
insert = props.insert;
|
|
416
|
-
|
|
417
|
-
const _useContext = (0, _react().useContext)(AddFormFieldButtonContext),
|
|
418
|
-
onAddField = _useContext.onAddField,
|
|
419
|
-
setCallback = _useContext.setCallback;
|
|
420
|
-
|
|
421
|
-
const _useCollectionManager2 = (0, _client().useCollectionManager)(),
|
|
422
|
-
getInterface = _useCollectionManager2.getInterface;
|
|
423
|
-
|
|
424
|
-
const interfaceOptions = getInterface(item.fieldInterface);
|
|
425
|
-
return _react().default.createElement(_client().SchemaInitializer.Item, {
|
|
426
|
-
key: item.fieldInterface,
|
|
427
|
-
onClick: () => {
|
|
428
|
-
setCallback(() => insert);
|
|
429
|
-
onAddField(interfaceOptions);
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
;
|
|
435
|
-
|
|
436
|
-
function findFormFields(formSchema, fields) {
|
|
437
|
-
if (!formSchema) {
|
|
438
|
-
return;
|
|
136
|
+
function findSchema(schema, filter, onlyLeaf = false) {
|
|
137
|
+
const result = [];
|
|
138
|
+
if (!schema) {
|
|
139
|
+
return result;
|
|
439
140
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
fields.push(formSchema);
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
return;
|
|
141
|
+
if (filter(schema) && (!onlyLeaf || !schema.properties)) {
|
|
142
|
+
result.push(schema);
|
|
143
|
+
return result;
|
|
447
144
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
145
|
+
if (schema.properties) {
|
|
146
|
+
Object.keys(schema.properties).forEach(key => {
|
|
147
|
+
result.push(...findSchema(schema.properties[key], filter));
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return result;
|
|
452
151
|
}
|
|
453
|
-
|
|
454
152
|
function SchemaComponentRefreshProvider(props) {
|
|
455
153
|
const ctx = (0, _client().useSchemaComponentContext)();
|
|
456
154
|
return _react().default.createElement(_client().SchemaComponentContext.Provider, {
|
|
457
155
|
value: _objectSpread(_objectSpread({}, ctx), {}, {
|
|
458
156
|
refresh() {
|
|
459
157
|
var _ctx$refresh, _props$onRefresh;
|
|
460
|
-
|
|
461
158
|
ctx === null || ctx === void 0 ? void 0 : (_ctx$refresh = ctx.refresh) === null || _ctx$refresh === void 0 ? void 0 : _ctx$refresh.call(ctx);
|
|
462
159
|
props === null || props === void 0 ? void 0 : (_props$onRefresh = props.onRefresh) === null || _props$onRefresh === void 0 ? void 0 : _props$onRefresh.call(props);
|
|
463
160
|
}
|
|
464
|
-
|
|
465
161
|
})
|
|
466
162
|
}, props.children);
|
|
467
163
|
}
|
|
468
|
-
|
|
469
164
|
;
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
props = _objectWithoutProperties(_ref2, _excluded4);
|
|
475
|
-
|
|
165
|
+
function ActionInitializer(_ref) {
|
|
166
|
+
let action = _ref.action,
|
|
167
|
+
actionProps = _ref.actionProps,
|
|
168
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
476
169
|
return _react().default.createElement(_client().InitializerWithSwitch, _objectSpread(_objectSpread({}, props), {}, {
|
|
477
170
|
schema: {
|
|
478
171
|
type: 'void',
|
|
@@ -491,7 +184,6 @@ function ActionInitializer(_ref2) {
|
|
|
491
184
|
type: "x-action"
|
|
492
185
|
}));
|
|
493
186
|
}
|
|
494
|
-
|
|
495
187
|
function AddActionButton(props) {
|
|
496
188
|
return _react().default.createElement(_client().SchemaInitializer.Button, _objectSpread(_objectSpread({}, props), {}, {
|
|
497
189
|
items: [{
|
|
@@ -521,20 +213,18 @@ function AddActionButton(props) {
|
|
|
521
213
|
}],
|
|
522
214
|
title: "{{t('Configure actions')}}"
|
|
523
215
|
}));
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
216
|
+
}
|
|
217
|
+
// NOTE: fake useAction for ui configuration
|
|
527
218
|
function useSubmit() {
|
|
219
|
+
// const { values, submit, id: formId } = useForm();
|
|
220
|
+
// const formSchema = useFieldSchema();
|
|
528
221
|
return {
|
|
529
222
|
run() {}
|
|
530
|
-
|
|
531
223
|
};
|
|
532
224
|
}
|
|
533
|
-
|
|
534
225
|
function useFlowRecordFromBlock() {
|
|
535
226
|
return {};
|
|
536
227
|
}
|
|
537
|
-
|
|
538
228
|
function SchemaConfig({
|
|
539
229
|
value,
|
|
540
230
|
onChange
|
|
@@ -544,24 +234,12 @@ function SchemaConfig({
|
|
|
544
234
|
const node = (0, _.useNodeContext)();
|
|
545
235
|
const nodes = (0, _.useAvailableUpstreams)(node);
|
|
546
236
|
const form = (0, _react2().useForm)();
|
|
547
|
-
|
|
548
237
|
const _useFlowContext2 = (0, _FlowContext.useFlowContext)(),
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
const _ref3 = value !== null && value !== void 0 ? value : {},
|
|
552
|
-
_ref3$collection = _ref3.collection,
|
|
553
|
-
collection = _ref3$collection === void 0 ? {
|
|
554
|
-
name: (0, _client2().uid)(),
|
|
555
|
-
fields: []
|
|
556
|
-
} : _ref3$collection,
|
|
557
|
-
blocks = _ref3.blocks,
|
|
558
|
-
actions = _ref3.actions;
|
|
559
|
-
|
|
238
|
+
workflow = _useFlowContext2.workflow;
|
|
560
239
|
const nodeInitializers = {};
|
|
561
240
|
const nodeComponents = {};
|
|
562
241
|
nodes.forEach(item => {
|
|
563
242
|
const instruction = _.instructions.get(item.type);
|
|
564
|
-
|
|
565
243
|
Object.assign(nodeInitializers, instruction.initializers);
|
|
566
244
|
Object.assign(nodeComponents, instruction.components);
|
|
567
245
|
});
|
|
@@ -584,7 +262,7 @@ function SchemaConfig({
|
|
|
584
262
|
'x-initializer-props': {
|
|
585
263
|
gridInitializer: 'AddBlockButton'
|
|
586
264
|
},
|
|
587
|
-
properties:
|
|
265
|
+
properties: value !== null && value !== void 0 ? value : {
|
|
588
266
|
tab1: {
|
|
589
267
|
type: 'void',
|
|
590
268
|
title: `{{t("Manual", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
@@ -600,39 +278,6 @@ function SchemaConfig({
|
|
|
600
278
|
}
|
|
601
279
|
}
|
|
602
280
|
}
|
|
603
|
-
},
|
|
604
|
-
footer: {
|
|
605
|
-
type: 'void',
|
|
606
|
-
'x-component': 'Action.Drawer.Footer',
|
|
607
|
-
'x-component-props': {
|
|
608
|
-
style: {
|
|
609
|
-
background: '#fff'
|
|
610
|
-
}
|
|
611
|
-
},
|
|
612
|
-
properties: {
|
|
613
|
-
actions: {
|
|
614
|
-
type: 'void',
|
|
615
|
-
'x-component': 'ActionBar',
|
|
616
|
-
'x-initializer': 'AddActionButton',
|
|
617
|
-
properties: actions !== null && actions !== void 0 ? actions : {
|
|
618
|
-
resolve: {
|
|
619
|
-
type: 'void',
|
|
620
|
-
title: `{{t("Continue the process", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
621
|
-
'x-decorator': 'ManualActionStatusProvider',
|
|
622
|
-
'x-decorator-props': {
|
|
623
|
-
value: _constants.JOB_STATUS.RESOLVED
|
|
624
|
-
},
|
|
625
|
-
'x-component': 'Action',
|
|
626
|
-
'x-component-props': {
|
|
627
|
-
type: 'primary',
|
|
628
|
-
useAction: '{{ useSubmit }}'
|
|
629
|
-
},
|
|
630
|
-
'x-designer': 'Action.Designer',
|
|
631
|
-
'x-action': `${_constants.JOB_STATUS.RESOLVED}`
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
281
|
}
|
|
637
282
|
}
|
|
638
283
|
}
|
|
@@ -643,66 +288,59 @@ function SchemaConfig({
|
|
|
643
288
|
designable: !workflow.executed
|
|
644
289
|
})
|
|
645
290
|
}, _react().default.createElement(_client().SchemaInitializerProvider, {
|
|
646
|
-
initializers: _objectSpread(_objectSpread({
|
|
291
|
+
initializers: _objectSpread(_objectSpread(_objectSpread({
|
|
647
292
|
AddBlockButton,
|
|
648
|
-
AddFormField,
|
|
649
293
|
AddActionButton
|
|
650
|
-
}, trigger.initializers), nodeInitializers)
|
|
294
|
+
}, trigger.initializers), nodeInitializers), _customForm.default.config.initializers)
|
|
651
295
|
}, _react().default.createElement(SchemaComponentRefreshProvider, {
|
|
652
296
|
onRefresh: () => {
|
|
653
|
-
|
|
654
|
-
|
|
297
|
+
const forms = {};
|
|
655
298
|
const _get = (0, _lodash().get)(schema.toJSON(), 'properties.drawer.properties'),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
onChange({
|
|
673
|
-
collection,
|
|
674
|
-
blocks: tabs.properties,
|
|
675
|
-
actions: footer.properties.actions.properties
|
|
299
|
+
tabs = _get.tabs;
|
|
300
|
+
const formBlocks = findSchema(tabs, item => item['x-decorator'] === 'FormCollectionProvider');
|
|
301
|
+
formBlocks.forEach(formBlock => {
|
|
302
|
+
var _formBlock$xComponen;
|
|
303
|
+
const _Object$keys = Object.keys(formBlock.properties),
|
|
304
|
+
_Object$keys2 = _slicedToArray(_Object$keys, 1),
|
|
305
|
+
formKey = _Object$keys2[0];
|
|
306
|
+
const formSchema = formBlock.properties[formKey];
|
|
307
|
+
const fields = findSchema(formSchema.properties.grid, item => item['x-component'] === 'CollectionField', true);
|
|
308
|
+
formBlock['x-decorator-props'].collection.fields = fields.map(field => field['x-interface-options']);
|
|
309
|
+
forms[formKey] = {
|
|
310
|
+
type: 'custom',
|
|
311
|
+
title: ((_formBlock$xComponen = formBlock['x-component-props']) === null || _formBlock$xComponen === void 0 ? void 0 : _formBlock$xComponen.title) || formKey,
|
|
312
|
+
actions: findSchema(formSchema.properties.actions, item => item['x-component'] === 'Action').map(item => item['x-decorator-props'].value),
|
|
313
|
+
collection: formBlock['x-decorator-props'].collection
|
|
314
|
+
};
|
|
676
315
|
});
|
|
316
|
+
form.setValuesIn('forms', forms);
|
|
317
|
+
onChange(tabs.properties);
|
|
677
318
|
}
|
|
678
|
-
}, _react().default.createElement(_client().CollectionProvider, {
|
|
679
|
-
collection: collection
|
|
680
319
|
}, _react().default.createElement(_client().SchemaComponent, {
|
|
681
320
|
schema: schema,
|
|
682
|
-
components: _objectSpread(_objectSpread({}, nodeComponents), {}, {
|
|
321
|
+
components: _objectSpread(_objectSpread(_objectSpread({}, nodeComponents), _customForm.default.config.components), {}, {
|
|
683
322
|
// NOTE: fake provider component
|
|
684
323
|
ManualActionStatusProvider(props) {
|
|
685
324
|
return props.children;
|
|
686
325
|
},
|
|
687
|
-
|
|
326
|
+
ActionBarProvider(props) {
|
|
327
|
+
return props.children;
|
|
328
|
+
},
|
|
688
329
|
SimpleDesigner
|
|
689
330
|
}),
|
|
690
331
|
scope: {
|
|
691
332
|
useSubmit,
|
|
692
333
|
useFlowRecordFromBlock
|
|
693
334
|
}
|
|
694
|
-
}))))
|
|
335
|
+
}))));
|
|
695
336
|
}
|
|
696
|
-
|
|
697
337
|
function SchemaConfigButton(props) {
|
|
698
338
|
const _useFlowContext3 = (0, _FlowContext.useFlowContext)(),
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
setVisible = _useState6[1];
|
|
705
|
-
|
|
339
|
+
workflow = _useFlowContext3.workflow;
|
|
340
|
+
const _useState = (0, _react().useState)(false),
|
|
341
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
342
|
+
visible = _useState2[0],
|
|
343
|
+
setVisible = _useState2[1];
|
|
706
344
|
return _react().default.createElement(_react().default.Fragment, null, _react().default.createElement("div", {
|
|
707
345
|
className: "ant-btn ant-btn-primary",
|
|
708
346
|
onClick: () => setVisible(true)
|