@nocobase/client 0.7.2-alpha.5 → 0.7.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/block-provider/FormBlockProvider.js +8 -3
- package/es/block-provider/TableSelectorProvider.js +41 -13
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +145 -63
- package/es/collection-manager/CollectionField.js +5 -3
- package/es/collection-manager/interfaces/input.js +103 -0
- package/es/collection-manager/interfaces/integer.js +63 -0
- package/es/collection-manager/interfaces/markdown.js +34 -0
- package/es/collection-manager/interfaces/number.js +55 -0
- package/es/collection-manager/interfaces/password.js +35 -1
- package/es/collection-manager/interfaces/percent.js +97 -0
- package/es/collection-manager/interfaces/richText.js +34 -0
- package/es/collection-manager/interfaces/textarea.js +34 -0
- package/es/file-manager/FileStorageShortcut.js +2 -2
- package/es/locale/en_US.d.ts +5 -0
- package/es/locale/en_US.js +6 -1
- package/es/locale/zh_CN.d.ts +23 -0
- package/es/locale/zh_CN.js +24 -1
- package/es/plugin-manager/PluginManager.js +8 -4
- package/es/schema-component/antd/action/Action.Modal.js +1 -1
- package/es/schema-component/antd/form-item/FormItem.js +156 -3
- package/es/schema-component/antd/grid/Grid.js +72 -6
- package/es/schema-component/antd/input-number/InputNumber.d.ts +1 -5
- package/es/schema-component/antd/input-number/InputNumber.js +25 -1
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/percent/Percent.js +2 -2
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +27 -13
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +4 -2
- package/es/schema-component/antd/table/Table.Array.js +2 -2
- package/es/schema-component/antd/table/Table.Void.js +11 -1
- package/es/schema-component/antd/table-v2/Table.js +1 -4
- package/es/schema-component/antd/time-picker/ReadPretty.js +11 -5
- package/es/schema-component/hooks/useDesignable.js +21 -21
- package/es/schema-component/hooks/useProps.js +1 -1
- package/es/schema-initializer/buttons/FormItemInitializers.js +14 -3
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
- package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -3
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +32 -3
- package/es/schema-initializer/buttons/TableActionInitializers.js +11 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.js +253 -69
- package/es/schema-initializer/items/index.d.ts +2 -0
- package/es/schema-initializer/items/index.js +46 -1
- package/es/schema-initializer/utils.js +6 -2
- package/es/system-settings/SystemSettingsShortcut.js +35 -12
- package/lib/block-provider/FormBlockProvider.js +7 -2
- package/lib/block-provider/TableSelectorProvider.js +41 -13
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +154 -65
- package/lib/collection-manager/CollectionField.js +5 -2
- package/lib/collection-manager/interfaces/input.js +104 -0
- package/lib/collection-manager/interfaces/integer.js +65 -0
- package/lib/collection-manager/interfaces/markdown.js +35 -0
- package/lib/collection-manager/interfaces/number.js +56 -0
- package/lib/collection-manager/interfaces/password.js +36 -1
- package/lib/collection-manager/interfaces/percent.js +99 -0
- package/lib/collection-manager/interfaces/richText.js +35 -0
- package/lib/collection-manager/interfaces/textarea.js +35 -0
- package/lib/file-manager/FileStorageShortcut.js +1 -1
- package/lib/locale/en_US.d.ts +5 -0
- package/lib/locale/en_US.js +6 -1
- package/lib/locale/zh_CN.d.ts +23 -0
- package/lib/locale/zh_CN.js +24 -1
- package/lib/plugin-manager/PluginManager.js +8 -3
- package/lib/schema-component/antd/action/Action.Modal.js +1 -1
- package/lib/schema-component/antd/form-item/FormItem.js +165 -5
- package/lib/schema-component/antd/grid/Grid.js +69 -3
- package/lib/schema-component/antd/input-number/InputNumber.d.ts +1 -5
- package/lib/schema-component/antd/input-number/InputNumber.js +29 -2
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/percent/Percent.js +2 -2
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +27 -12
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
- package/lib/schema-component/antd/table/Table.Array.js +2 -2
- package/lib/schema-component/antd/table/Table.Void.js +11 -1
- package/lib/schema-component/antd/table-v2/Table.js +1 -4
- package/lib/schema-component/antd/time-picker/ReadPretty.js +10 -3
- package/lib/schema-component/hooks/useDesignable.js +21 -21
- package/lib/schema-component/hooks/useProps.js +1 -1
- package/lib/schema-initializer/buttons/FormItemInitializers.js +14 -2
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -2
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +34 -4
- package/lib/schema-initializer/buttons/TableActionInitializers.js +11 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +254 -66
- package/lib/schema-initializer/items/index.d.ts +2 -0
- package/lib/schema-initializer/items/index.js +52 -1
- package/lib/schema-initializer/utils.js +6 -2
- package/lib/system-settings/SystemSettingsShortcut.js +37 -13
- package/package.json +6 -4
|
@@ -82,7 +82,8 @@ var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
82
82
|
var ctx = (0, _FormBlockProvider.useFormBlockContext)();
|
|
83
83
|
|
|
84
84
|
var _useCollectionManager2 = (0, _collectionManager.useCollectionManager)(),
|
|
85
|
-
getCollectionJoinField = _useCollectionManager2.getCollectionJoinField
|
|
85
|
+
getCollectionJoinField = _useCollectionManager2.getCollectionJoinField,
|
|
86
|
+
getCollectionFields = _useCollectionManager2.getCollectionFields;
|
|
86
87
|
|
|
87
88
|
var record = (0, _recordProvider.useRecord)();
|
|
88
89
|
var collectionFieldSchema = recursiveParent(fieldSchema, 'CollectionField'); // const value = ctx.form.query(collectionFieldSchema?.name).value();
|
|
@@ -104,16 +105,43 @@ var TableSelectorProvider = function TableSelectorProvider(props) {
|
|
|
104
105
|
|
|
105
106
|
if (collectionField) {
|
|
106
107
|
if (['oho', 'o2m'].includes(collectionField.interface)) {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
if (record === null || record === void 0 ? void 0 : record[collectionField.sourceKey]) {
|
|
109
|
+
params['filter'] = {
|
|
110
|
+
$or: [_defineProperty({}, collectionField.foreignKey, {
|
|
111
|
+
$is: null
|
|
112
|
+
}), _defineProperty({}, collectionField.foreignKey, {
|
|
113
|
+
$eq: record === null || record === void 0 ? void 0 : record[collectionField.sourceKey]
|
|
114
|
+
})]
|
|
115
|
+
};
|
|
116
|
+
} else {
|
|
117
|
+
params['filter'] = _defineProperty({}, collectionField.foreignKey, {
|
|
109
118
|
$is: null
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
})]
|
|
113
|
-
};
|
|
119
|
+
});
|
|
120
|
+
}
|
|
114
121
|
}
|
|
115
122
|
|
|
116
|
-
if (['obo'].includes(collectionField.interface)) {
|
|
123
|
+
if (['obo'].includes(collectionField.interface)) {
|
|
124
|
+
var fields = getCollectionFields(collectionField.target);
|
|
125
|
+
var targetField = fields.find(function (f) {
|
|
126
|
+
return f.foreignKey && f.foreignKey === collectionField.foreignKey;
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
if (targetField) {
|
|
130
|
+
if (record === null || record === void 0 ? void 0 : record[collectionField.foreignKey]) {
|
|
131
|
+
params['filter'] = {
|
|
132
|
+
$or: [_defineProperty({}, "".concat(targetField.name, ".").concat(targetField.foreignKey), {
|
|
133
|
+
$is: null
|
|
134
|
+
}), _defineProperty({}, "".concat(targetField.name, ".").concat(targetField.foreignKey), {
|
|
135
|
+
$eq: record === null || record === void 0 ? void 0 : record[collectionField.foreignKey]
|
|
136
|
+
})]
|
|
137
|
+
};
|
|
138
|
+
} else {
|
|
139
|
+
params['filter'] = _defineProperty({}, "".concat(targetField.name, ".").concat(targetField.foreignKey), {
|
|
140
|
+
$is: null
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
117
145
|
}
|
|
118
146
|
|
|
119
147
|
return /*#__PURE__*/_react2.default.createElement(_BlockProvider.BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -166,14 +194,14 @@ var useTableSelectorProps = function useTableSelectorProps() {
|
|
|
166
194
|
ctx.field.data = (ctx === null || ctx === void 0 ? void 0 : (_ctx$field2 = ctx.field) === null || _ctx$field2 === void 0 ? void 0 : _ctx$field2.data) || {};
|
|
167
195
|
ctx.field.data.selectedRowKeys = selectedRowKeys;
|
|
168
196
|
},
|
|
169
|
-
onRowDragEnd: function onRowDragEnd(
|
|
197
|
+
onRowDragEnd: function onRowDragEnd(_ref5) {
|
|
170
198
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
171
199
|
var from, to;
|
|
172
200
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
173
201
|
while (1) {
|
|
174
202
|
switch (_context.prev = _context.next) {
|
|
175
203
|
case 0:
|
|
176
|
-
from =
|
|
204
|
+
from = _ref5.from, to = _ref5.to;
|
|
177
205
|
_context.next = 3;
|
|
178
206
|
return ctx.resource.move({
|
|
179
207
|
sourceId: from[ctx.rowKey || 'id'],
|
|
@@ -191,11 +219,11 @@ var useTableSelectorProps = function useTableSelectorProps() {
|
|
|
191
219
|
}, _callee);
|
|
192
220
|
}))();
|
|
193
221
|
},
|
|
194
|
-
onChange: function onChange(
|
|
222
|
+
onChange: function onChange(_ref6) {
|
|
195
223
|
var _ctx$service$params;
|
|
196
224
|
|
|
197
|
-
var current =
|
|
198
|
-
pageSize =
|
|
225
|
+
var current = _ref6.current,
|
|
226
|
+
pageSize = _ref6.pageSize;
|
|
199
227
|
ctx.service.run(_objectSpread(_objectSpread({}, (_ctx$service$params = ctx.service.params) === null || _ctx$service$params === void 0 ? void 0 : _ctx$service$params[0]), {}, {
|
|
200
228
|
page: current,
|
|
201
229
|
pageSize: pageSize
|
|
@@ -16,9 +16,15 @@ export declare const useUpdateActionProps: () => {
|
|
|
16
16
|
export declare const useDestroyActionProps: () => {
|
|
17
17
|
onClick(): Promise<void>;
|
|
18
18
|
};
|
|
19
|
+
export declare const useDetailPrintActionProps: () => {
|
|
20
|
+
onClick(): Promise<void>;
|
|
21
|
+
};
|
|
19
22
|
export declare const useBulkDestroyActionProps: () => {
|
|
20
23
|
onClick(): Promise<void>;
|
|
21
24
|
};
|
|
25
|
+
export declare const useRefreshActionProps: () => {
|
|
26
|
+
onClick(): Promise<void>;
|
|
27
|
+
};
|
|
22
28
|
export declare const useDetailsPaginationProps: () => {
|
|
23
29
|
simple: boolean;
|
|
24
30
|
hidden: boolean;
|
|
@@ -3,20 +3,22 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useUpdateActionProps = exports.usePickActionProps = exports.useDetailsPaginationProps = exports.useDestroyActionProps = exports.useCustomizeUpdateActionProps = exports.useCustomizeRequestActionProps = exports.useCreateActionProps = exports.useBulkDestroyActionProps = void 0;
|
|
7
|
-
|
|
8
|
-
var _jsonSchema = require("@formily/json-schema");
|
|
6
|
+
exports.useUpdateActionProps = exports.useRefreshActionProps = exports.usePickActionProps = exports.useDetailsPaginationProps = exports.useDetailPrintActionProps = exports.useDestroyActionProps = exports.useCustomizeUpdateActionProps = exports.useCustomizeRequestActionProps = exports.useCreateActionProps = exports.useBulkDestroyActionProps = void 0;
|
|
9
7
|
|
|
10
8
|
var _react = require("@formily/react");
|
|
11
9
|
|
|
12
10
|
var _antd = require("antd");
|
|
13
11
|
|
|
12
|
+
var _jsonTemplates = _interopRequireDefault(require("json-templates"));
|
|
13
|
+
|
|
14
14
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
15
15
|
|
|
16
16
|
var _reactI18next = require("react-i18next");
|
|
17
17
|
|
|
18
18
|
var _reactRouterDom = require("react-router-dom");
|
|
19
19
|
|
|
20
|
+
var _reactToPrint = require("react-to-print");
|
|
21
|
+
|
|
20
22
|
var _2 = require("../..");
|
|
21
23
|
|
|
22
24
|
var _apiClient = require("../../api-client");
|
|
@@ -167,6 +169,8 @@ function getFormValues(filterByTk, field, form, fieldNames, getField, resource)
|
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
var useCreateActionProps = function useCreateActionProps() {
|
|
172
|
+
var _currentUserContext$d;
|
|
173
|
+
|
|
170
174
|
var form = (0, _react.useForm)();
|
|
171
175
|
|
|
172
176
|
var _useBlockRequestConte = (0, _BlockProvider.useBlockRequestContext)(),
|
|
@@ -192,12 +196,15 @@ var useCreateActionProps = function useCreateActionProps() {
|
|
|
192
196
|
|
|
193
197
|
var compile = (0, _schemaComponent.useCompile)();
|
|
194
198
|
var filterByTk = (0, _BlockProvider.useFilterByTk)();
|
|
199
|
+
var currentRecord = (0, _recordProvider.useRecord)();
|
|
200
|
+
var currentUserContext = (0, _user.useCurrentUserContext)();
|
|
201
|
+
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d = currentUserContext.data) === null || _currentUserContext$d === void 0 ? void 0 : _currentUserContext$d.data;
|
|
195
202
|
return {
|
|
196
203
|
onClick: function onClick() {
|
|
197
204
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
198
205
|
var _actionSchema$xActio;
|
|
199
206
|
|
|
200
|
-
var fieldNames, _ref, assignedValues, onSuccess, overwriteValues, skipValidator, values, _parent$service, _parent$service$refre;
|
|
207
|
+
var fieldNames, _ref, _ref$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, assignedValues, values, _parent$service, _parent$service$refre;
|
|
201
208
|
|
|
202
209
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
203
210
|
while (1) {
|
|
@@ -206,39 +213,44 @@ var useCreateActionProps = function useCreateActionProps() {
|
|
|
206
213
|
fieldNames = fields.map(function (field) {
|
|
207
214
|
return field.name;
|
|
208
215
|
});
|
|
209
|
-
_ref = (_actionSchema$xActio = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio !== void 0 ? _actionSchema$xActio : {}, assignedValues = _ref.assignedValues, onSuccess = _ref.onSuccess, overwriteValues = _ref.overwriteValues, skipValidator = _ref.skipValidator;
|
|
216
|
+
_ref = (_actionSchema$xActio = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio !== void 0 ? _actionSchema$xActio : {}, _ref$assignedValues = _ref.assignedValues, originalAssignedValues = _ref$assignedValues === void 0 ? {} : _ref$assignedValues, onSuccess = _ref.onSuccess, overwriteValues = _ref.overwriteValues, skipValidator = _ref.skipValidator;
|
|
217
|
+
assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
|
|
218
|
+
currentTime: new Date(),
|
|
219
|
+
currentRecord: currentRecord,
|
|
220
|
+
currentUser: currentUser
|
|
221
|
+
});
|
|
210
222
|
|
|
211
223
|
if (skipValidator) {
|
|
212
|
-
_context2.next =
|
|
224
|
+
_context2.next = 6;
|
|
213
225
|
break;
|
|
214
226
|
}
|
|
215
227
|
|
|
216
|
-
_context2.next =
|
|
228
|
+
_context2.next = 6;
|
|
217
229
|
return form.submit();
|
|
218
230
|
|
|
219
|
-
case
|
|
231
|
+
case 6:
|
|
220
232
|
values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
|
|
221
233
|
actionField.data = field.data || {};
|
|
222
234
|
actionField.data.loading = true;
|
|
223
|
-
_context2.prev =
|
|
224
|
-
_context2.next =
|
|
235
|
+
_context2.prev = 9;
|
|
236
|
+
_context2.next = 12;
|
|
225
237
|
return resource.create({
|
|
226
238
|
values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues)
|
|
227
239
|
});
|
|
228
240
|
|
|
229
|
-
case
|
|
241
|
+
case 12:
|
|
230
242
|
actionField.data.loading = false;
|
|
231
243
|
__parent === null || __parent === void 0 ? void 0 : (_parent$service = __parent.service) === null || _parent$service === void 0 ? void 0 : (_parent$service$refre = _parent$service.refresh) === null || _parent$service$refre === void 0 ? void 0 : _parent$service$refre.call(_parent$service);
|
|
232
244
|
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
233
245
|
|
|
234
246
|
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
235
|
-
_context2.next =
|
|
247
|
+
_context2.next = 17;
|
|
236
248
|
break;
|
|
237
249
|
}
|
|
238
250
|
|
|
239
251
|
return _context2.abrupt("return");
|
|
240
252
|
|
|
241
|
-
case
|
|
253
|
+
case 17:
|
|
242
254
|
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
243
255
|
_antd.Modal.success({
|
|
244
256
|
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
@@ -279,20 +291,20 @@ var useCreateActionProps = function useCreateActionProps() {
|
|
|
279
291
|
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
280
292
|
}
|
|
281
293
|
|
|
282
|
-
_context2.next =
|
|
294
|
+
_context2.next = 23;
|
|
283
295
|
break;
|
|
284
296
|
|
|
285
|
-
case
|
|
286
|
-
_context2.prev =
|
|
287
|
-
_context2.t0 = _context2["catch"](
|
|
297
|
+
case 20:
|
|
298
|
+
_context2.prev = 20;
|
|
299
|
+
_context2.t0 = _context2["catch"](9);
|
|
288
300
|
actionField.data.loading = false;
|
|
289
301
|
|
|
290
|
-
case
|
|
302
|
+
case 23:
|
|
291
303
|
case "end":
|
|
292
304
|
return _context2.stop();
|
|
293
305
|
}
|
|
294
306
|
}
|
|
295
|
-
}, _callee2, null, [[
|
|
307
|
+
}, _callee2, null, [[9, 20]]);
|
|
296
308
|
}))();
|
|
297
309
|
}
|
|
298
310
|
};
|
|
@@ -301,6 +313,8 @@ var useCreateActionProps = function useCreateActionProps() {
|
|
|
301
313
|
exports.useCreateActionProps = useCreateActionProps;
|
|
302
314
|
|
|
303
315
|
var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
|
|
316
|
+
var _currentUserContext$d2;
|
|
317
|
+
|
|
304
318
|
var _useBlockRequestConte2 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
305
319
|
resource = _useBlockRequestConte2.resource,
|
|
306
320
|
__parent = _useBlockRequestConte2.__parent,
|
|
@@ -309,7 +323,8 @@ var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
|
|
|
309
323
|
var filterByTk = (0, _BlockProvider.useFilterByTk)();
|
|
310
324
|
var actionSchema = (0, _react.useFieldSchema)();
|
|
311
325
|
var currentRecord = (0, _recordProvider.useRecord)();
|
|
312
|
-
var
|
|
326
|
+
var currentUserContext = (0, _user.useCurrentUserContext)();
|
|
327
|
+
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d2 = currentUserContext.data) === null || _currentUserContext$d2 === void 0 ? void 0 : _currentUserContext$d2.data;
|
|
313
328
|
var history = (0, _reactRouterDom.useHistory)();
|
|
314
329
|
var compile = (0, _schemaComponent.useCompile)();
|
|
315
330
|
var form = (0, _react.useForm)();
|
|
@@ -318,30 +333,35 @@ var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
|
|
|
318
333
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
319
334
|
var _actionSchema$xActio2, _service$refresh;
|
|
320
335
|
|
|
321
|
-
var _ref2, assignedValues, onSuccess, skipValidator, _parent$service2, _parent$service2$refr;
|
|
336
|
+
var _ref2, _ref2$assignedValues, originalAssignedValues, onSuccess, skipValidator, assignedValues, _parent$service2, _parent$service2$refr;
|
|
322
337
|
|
|
323
338
|
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
324
339
|
while (1) {
|
|
325
340
|
switch (_context4.prev = _context4.next) {
|
|
326
341
|
case 0:
|
|
327
|
-
_ref2 = (_actionSchema$xActio2 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio2 !== void 0 ? _actionSchema$xActio2 : {}, assignedValues = _ref2.assignedValues, onSuccess = _ref2.onSuccess, skipValidator = _ref2.skipValidator;
|
|
342
|
+
_ref2 = (_actionSchema$xActio2 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio2 !== void 0 ? _actionSchema$xActio2 : {}, _ref2$assignedValues = _ref2.assignedValues, originalAssignedValues = _ref2$assignedValues === void 0 ? {} : _ref2$assignedValues, onSuccess = _ref2.onSuccess, skipValidator = _ref2.skipValidator;
|
|
343
|
+
assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
|
|
344
|
+
currentTime: new Date(),
|
|
345
|
+
currentRecord: currentRecord,
|
|
346
|
+
currentUser: currentUser
|
|
347
|
+
});
|
|
328
348
|
|
|
329
349
|
if (!(skipValidator === false)) {
|
|
330
|
-
_context4.next =
|
|
350
|
+
_context4.next = 5;
|
|
331
351
|
break;
|
|
332
352
|
}
|
|
333
353
|
|
|
334
|
-
_context4.next =
|
|
354
|
+
_context4.next = 5;
|
|
335
355
|
return form.submit();
|
|
336
356
|
|
|
337
|
-
case
|
|
338
|
-
_context4.next =
|
|
357
|
+
case 5:
|
|
358
|
+
_context4.next = 7;
|
|
339
359
|
return resource.update({
|
|
340
360
|
filterByTk: filterByTk,
|
|
341
361
|
values: _objectSpread({}, assignedValues)
|
|
342
362
|
});
|
|
343
363
|
|
|
344
|
-
case
|
|
364
|
+
case 7:
|
|
345
365
|
service === null || service === void 0 ? void 0 : (_service$refresh = service.refresh) === null || _service$refresh === void 0 ? void 0 : _service$refresh.call(service);
|
|
346
366
|
|
|
347
367
|
if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
|
|
@@ -349,13 +369,13 @@ var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
|
|
|
349
369
|
}
|
|
350
370
|
|
|
351
371
|
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
352
|
-
_context4.next =
|
|
372
|
+
_context4.next = 11;
|
|
353
373
|
break;
|
|
354
374
|
}
|
|
355
375
|
|
|
356
376
|
return _context4.abrupt("return");
|
|
357
377
|
|
|
358
|
-
case
|
|
378
|
+
case 11:
|
|
359
379
|
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
360
380
|
_antd.Modal.success({
|
|
361
381
|
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
@@ -392,7 +412,7 @@ var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
|
|
|
392
412
|
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
393
413
|
}
|
|
394
414
|
|
|
395
|
-
case
|
|
415
|
+
case 12:
|
|
396
416
|
case "end":
|
|
397
417
|
return _context4.stop();
|
|
398
418
|
}
|
|
@@ -406,7 +426,7 @@ var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
|
|
|
406
426
|
exports.useCustomizeUpdateActionProps = useCustomizeUpdateActionProps;
|
|
407
427
|
|
|
408
428
|
var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
|
|
409
|
-
var _currentUserContext$
|
|
429
|
+
var _currentUserContext$d3;
|
|
410
430
|
|
|
411
431
|
var apiClient = (0, _apiClient.useAPIClient)();
|
|
412
432
|
var history = (0, _reactRouterDom.useHistory)();
|
|
@@ -427,7 +447,7 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
|
|
|
427
447
|
|
|
428
448
|
var currentRecord = (0, _recordProvider.useRecord)();
|
|
429
449
|
var currentUserContext = (0, _user.useCurrentUserContext)();
|
|
430
|
-
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$
|
|
450
|
+
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d3 = currentUserContext.data) === null || _currentUserContext$d3 === void 0 ? void 0 : _currentUserContext$d3.data;
|
|
431
451
|
var actionField = (0, _react.useField)();
|
|
432
452
|
|
|
433
453
|
var _useActionContext2 = (0, _schemaComponent.useActionContext)(),
|
|
@@ -484,15 +504,15 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
|
|
|
484
504
|
currentUser: currentUser
|
|
485
505
|
}),
|
|
486
506
|
method: requestSettings['method'],
|
|
487
|
-
headers:
|
|
507
|
+
headers: (0, _jsonTemplates.default)(headers)({
|
|
488
508
|
currentRecord: currentRecord,
|
|
489
509
|
currentUser: currentUser
|
|
490
510
|
}),
|
|
491
|
-
params:
|
|
511
|
+
params: (0, _jsonTemplates.default)(params)({
|
|
492
512
|
currentRecord: currentRecord,
|
|
493
513
|
currentUser: currentUser
|
|
494
514
|
}),
|
|
495
|
-
data:
|
|
515
|
+
data: (0, _jsonTemplates.default)(data)({
|
|
496
516
|
currentRecord: currentRecord,
|
|
497
517
|
currentUser: currentUser
|
|
498
518
|
})
|
|
@@ -579,6 +599,8 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
|
|
|
579
599
|
exports.useCustomizeRequestActionProps = useCustomizeRequestActionProps;
|
|
580
600
|
|
|
581
601
|
var useUpdateActionProps = function useUpdateActionProps() {
|
|
602
|
+
var _currentUserContext$d4;
|
|
603
|
+
|
|
582
604
|
var form = (0, _react.useForm)();
|
|
583
605
|
var filterByTk = (0, _BlockProvider.useFilterByTk)();
|
|
584
606
|
|
|
@@ -592,7 +614,6 @@ var useUpdateActionProps = function useUpdateActionProps() {
|
|
|
592
614
|
|
|
593
615
|
var actionSchema = (0, _react.useFieldSchema)();
|
|
594
616
|
var history = (0, _reactRouterDom.useHistory)();
|
|
595
|
-
var record = (0, _recordProvider.useRecord)();
|
|
596
617
|
|
|
597
618
|
var _useCollection3 = (0, _collectionManager.useCollection)(),
|
|
598
619
|
fields = _useCollection3.fields,
|
|
@@ -604,43 +625,51 @@ var useUpdateActionProps = function useUpdateActionProps() {
|
|
|
604
625
|
var _useFormBlockContext = (0, _2.useFormBlockContext)(),
|
|
605
626
|
updateAssociationValues = _useFormBlockContext.updateAssociationValues;
|
|
606
627
|
|
|
628
|
+
var currentRecord = (0, _recordProvider.useRecord)();
|
|
629
|
+
var currentUserContext = (0, _user.useCurrentUserContext)();
|
|
630
|
+
var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d4 = currentUserContext.data) === null || _currentUserContext$d4 === void 0 ? void 0 : _currentUserContext$d4.data;
|
|
607
631
|
return {
|
|
608
632
|
onClick: function onClick() {
|
|
609
633
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
|
|
610
634
|
var _actionSchema$xActio4;
|
|
611
635
|
|
|
612
|
-
var _ref4, assignedValues, onSuccess, overwriteValues, skipValidator, fieldNames, values, _parent$service4, _parent$service4$refr, _parent$__parent, _parent$__parent$serv, _parent$__parent$serv2;
|
|
636
|
+
var _ref4, _ref4$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, assignedValues, fieldNames, values, _parent$service4, _parent$service4$refr, _parent$__parent, _parent$__parent$serv, _parent$__parent$serv2;
|
|
613
637
|
|
|
614
638
|
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
615
639
|
while (1) {
|
|
616
640
|
switch (_context8.prev = _context8.next) {
|
|
617
641
|
case 0:
|
|
618
|
-
_ref4 = (_actionSchema$xActio4 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio4 !== void 0 ? _actionSchema$xActio4 : {}, assignedValues = _ref4.assignedValues, onSuccess = _ref4.onSuccess, overwriteValues = _ref4.overwriteValues, skipValidator = _ref4.skipValidator;
|
|
642
|
+
_ref4 = (_actionSchema$xActio4 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio4 !== void 0 ? _actionSchema$xActio4 : {}, _ref4$assignedValues = _ref4.assignedValues, originalAssignedValues = _ref4$assignedValues === void 0 ? {} : _ref4$assignedValues, onSuccess = _ref4.onSuccess, overwriteValues = _ref4.overwriteValues, skipValidator = _ref4.skipValidator;
|
|
643
|
+
assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
|
|
644
|
+
currentTime: new Date(),
|
|
645
|
+
currentRecord: currentRecord,
|
|
646
|
+
currentUser: currentUser
|
|
647
|
+
});
|
|
619
648
|
|
|
620
649
|
if (skipValidator) {
|
|
621
|
-
_context8.next =
|
|
650
|
+
_context8.next = 5;
|
|
622
651
|
break;
|
|
623
652
|
}
|
|
624
653
|
|
|
625
|
-
_context8.next =
|
|
654
|
+
_context8.next = 5;
|
|
626
655
|
return form.submit();
|
|
627
656
|
|
|
628
|
-
case
|
|
657
|
+
case 5:
|
|
629
658
|
fieldNames = fields.map(function (field) {
|
|
630
659
|
return field.name;
|
|
631
660
|
});
|
|
632
661
|
values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
|
|
633
662
|
actionField.data = field.data || {};
|
|
634
663
|
actionField.data.loading = true;
|
|
635
|
-
_context8.prev =
|
|
636
|
-
_context8.next =
|
|
664
|
+
_context8.prev = 9;
|
|
665
|
+
_context8.next = 12;
|
|
637
666
|
return resource.update({
|
|
638
667
|
filterByTk: filterByTk,
|
|
639
668
|
values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues),
|
|
640
669
|
updateAssociationValues: updateAssociationValues
|
|
641
670
|
});
|
|
642
671
|
|
|
643
|
-
case
|
|
672
|
+
case 12:
|
|
644
673
|
actionField.data.loading = false;
|
|
645
674
|
|
|
646
675
|
if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
|
|
@@ -651,13 +680,13 @@ var useUpdateActionProps = function useUpdateActionProps() {
|
|
|
651
680
|
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
652
681
|
|
|
653
682
|
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
|
|
654
|
-
_context8.next =
|
|
683
|
+
_context8.next = 18;
|
|
655
684
|
break;
|
|
656
685
|
}
|
|
657
686
|
|
|
658
687
|
return _context8.abrupt("return");
|
|
659
688
|
|
|
660
|
-
case
|
|
689
|
+
case 18:
|
|
661
690
|
if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
|
|
662
691
|
_antd.Modal.success({
|
|
663
692
|
title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
|
|
@@ -698,20 +727,20 @@ var useUpdateActionProps = function useUpdateActionProps() {
|
|
|
698
727
|
_antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
|
|
699
728
|
}
|
|
700
729
|
|
|
701
|
-
_context8.next =
|
|
730
|
+
_context8.next = 24;
|
|
702
731
|
break;
|
|
703
732
|
|
|
704
|
-
case
|
|
705
|
-
_context8.prev =
|
|
706
|
-
_context8.t0 = _context8["catch"](
|
|
733
|
+
case 21:
|
|
734
|
+
_context8.prev = 21;
|
|
735
|
+
_context8.t0 = _context8["catch"](9);
|
|
707
736
|
actionField.data.loading = false;
|
|
708
737
|
|
|
709
|
-
case
|
|
738
|
+
case 24:
|
|
710
739
|
case "end":
|
|
711
740
|
return _context8.stop();
|
|
712
741
|
}
|
|
713
742
|
}
|
|
714
|
-
}, _callee8, null, [[
|
|
743
|
+
}, _callee8, null, [[9, 21]]);
|
|
715
744
|
}))();
|
|
716
745
|
}
|
|
717
746
|
};
|
|
@@ -756,6 +785,38 @@ var useDestroyActionProps = function useDestroyActionProps() {
|
|
|
756
785
|
|
|
757
786
|
exports.useDestroyActionProps = useDestroyActionProps;
|
|
758
787
|
|
|
788
|
+
var useDetailPrintActionProps = function useDetailPrintActionProps() {
|
|
789
|
+
var _useFormBlockContext2 = (0, _2.useFormBlockContext)(),
|
|
790
|
+
formBlockRef = _useFormBlockContext2.formBlockRef;
|
|
791
|
+
|
|
792
|
+
var printHandler = (0, _reactToPrint.useReactToPrint)({
|
|
793
|
+
content: function content() {
|
|
794
|
+
return formBlockRef.current;
|
|
795
|
+
},
|
|
796
|
+
pageStyle: "@media print {\n * {\n margin: 0;\n }\n div.ant-formily-layout>div:first-child {\n overflow: hidden; height: 0;\n }\n\n }"
|
|
797
|
+
});
|
|
798
|
+
return {
|
|
799
|
+
onClick: function onClick() {
|
|
800
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
|
|
801
|
+
return regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
802
|
+
while (1) {
|
|
803
|
+
switch (_context10.prev = _context10.next) {
|
|
804
|
+
case 0:
|
|
805
|
+
printHandler();
|
|
806
|
+
|
|
807
|
+
case 1:
|
|
808
|
+
case "end":
|
|
809
|
+
return _context10.stop();
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}, _callee10);
|
|
813
|
+
}))();
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
exports.useDetailPrintActionProps = useDetailPrintActionProps;
|
|
819
|
+
|
|
759
820
|
var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
|
|
760
821
|
var _useBlockRequestConte6 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
761
822
|
field = _useBlockRequestConte6.field;
|
|
@@ -766,22 +827,22 @@ var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
|
|
|
766
827
|
|
|
767
828
|
return {
|
|
768
829
|
onClick: function onClick() {
|
|
769
|
-
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
830
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
|
|
770
831
|
var _field$data, _field$data$selectedR, _field$data2, _service$refresh4;
|
|
771
832
|
|
|
772
|
-
return regeneratorRuntime.wrap(function
|
|
833
|
+
return regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
773
834
|
while (1) {
|
|
774
|
-
switch (
|
|
835
|
+
switch (_context11.prev = _context11.next) {
|
|
775
836
|
case 0:
|
|
776
837
|
if (field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : (_field$data$selectedR = _field$data.selectedRowKeys) === null || _field$data$selectedR === void 0 ? void 0 : _field$data$selectedR.length) {
|
|
777
|
-
|
|
838
|
+
_context11.next = 2;
|
|
778
839
|
break;
|
|
779
840
|
}
|
|
780
841
|
|
|
781
|
-
return
|
|
842
|
+
return _context11.abrupt("return");
|
|
782
843
|
|
|
783
844
|
case 2:
|
|
784
|
-
|
|
845
|
+
_context11.next = 4;
|
|
785
846
|
return resource.destroy({
|
|
786
847
|
filterByTk: (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : _field$data2.selectedRowKeys
|
|
787
848
|
});
|
|
@@ -792,10 +853,10 @@ var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
|
|
|
792
853
|
|
|
793
854
|
case 6:
|
|
794
855
|
case "end":
|
|
795
|
-
return
|
|
856
|
+
return _context11.stop();
|
|
796
857
|
}
|
|
797
858
|
}
|
|
798
|
-
},
|
|
859
|
+
}, _callee11);
|
|
799
860
|
}))();
|
|
800
861
|
}
|
|
801
862
|
};
|
|
@@ -803,6 +864,34 @@ var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
|
|
|
803
864
|
|
|
804
865
|
exports.useBulkDestroyActionProps = useBulkDestroyActionProps;
|
|
805
866
|
|
|
867
|
+
var useRefreshActionProps = function useRefreshActionProps() {
|
|
868
|
+
var _useBlockRequestConte8 = (0, _BlockProvider.useBlockRequestContext)(),
|
|
869
|
+
service = _useBlockRequestConte8.service;
|
|
870
|
+
|
|
871
|
+
return {
|
|
872
|
+
onClick: function onClick() {
|
|
873
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
|
|
874
|
+
var _service$refresh5;
|
|
875
|
+
|
|
876
|
+
return regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
877
|
+
while (1) {
|
|
878
|
+
switch (_context12.prev = _context12.next) {
|
|
879
|
+
case 0:
|
|
880
|
+
service === null || service === void 0 ? void 0 : (_service$refresh5 = service.refresh) === null || _service$refresh5 === void 0 ? void 0 : _service$refresh5.call(service);
|
|
881
|
+
|
|
882
|
+
case 1:
|
|
883
|
+
case "end":
|
|
884
|
+
return _context12.stop();
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
}, _callee12);
|
|
888
|
+
}))();
|
|
889
|
+
}
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
exports.useRefreshActionProps = useRefreshActionProps;
|
|
894
|
+
|
|
806
895
|
var useDetailsPaginationProps = function useDetailsPaginationProps() {
|
|
807
896
|
var _ctx$service, _ctx$service$data, _ctx$service$data$met, _ctx$service2, _ctx$service2$data, _ctx$service2$data$me;
|
|
808
897
|
|
|
@@ -815,13 +904,13 @@ var useDetailsPaginationProps = function useDetailsPaginationProps() {
|
|
|
815
904
|
total: count,
|
|
816
905
|
pageSize: 1,
|
|
817
906
|
onChange: function onChange(page) {
|
|
818
|
-
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
907
|
+
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
|
|
819
908
|
var _ctx$service3, _ctx$service3$params;
|
|
820
909
|
|
|
821
910
|
var params;
|
|
822
|
-
return regeneratorRuntime.wrap(function
|
|
911
|
+
return regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
823
912
|
while (1) {
|
|
824
|
-
switch (
|
|
913
|
+
switch (_context13.prev = _context13.next) {
|
|
825
914
|
case 0:
|
|
826
915
|
params = (_ctx$service3 = ctx.service) === null || _ctx$service3 === void 0 ? void 0 : (_ctx$service3$params = _ctx$service3.params) === null || _ctx$service3$params === void 0 ? void 0 : _ctx$service3$params[0];
|
|
827
916
|
ctx.service.run(_objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -830,10 +919,10 @@ var useDetailsPaginationProps = function useDetailsPaginationProps() {
|
|
|
830
919
|
|
|
831
920
|
case 2:
|
|
832
921
|
case "end":
|
|
833
|
-
return
|
|
922
|
+
return _context13.stop();
|
|
834
923
|
}
|
|
835
924
|
}
|
|
836
|
-
},
|
|
925
|
+
}, _callee13);
|
|
837
926
|
}))();
|
|
838
927
|
},
|
|
839
928
|
style: {
|
|
@@ -19,6 +19,8 @@ var _CollectionFieldProvider = require("./CollectionFieldProvider");
|
|
|
19
19
|
|
|
20
20
|
var _hooks = require("./hooks");
|
|
21
21
|
|
|
22
|
+
var _lodash = require("lodash");
|
|
23
|
+
|
|
22
24
|
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); }
|
|
23
25
|
|
|
24
26
|
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; }
|
|
@@ -70,8 +72,9 @@ var InternalField = function InternalField(props) {
|
|
|
70
72
|
setFieldProps('description', uiSchema.description);
|
|
71
73
|
setFieldProps('initialValue', uiSchema.default);
|
|
72
74
|
|
|
73
|
-
if (!field.validator && uiSchema['x-validator']) {
|
|
74
|
-
|
|
75
|
+
if (!field.validator && (uiSchema['x-validator'] || fieldSchema['x-validator'])) {
|
|
76
|
+
var concatSchema = (0, _lodash.concat)([], uiSchema['x-validator'] || [], fieldSchema['x-validator'] || []);
|
|
77
|
+
field.validator = concatSchema;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
if (fieldSchema['x-disabled'] === true) {
|