@nocobase/client 0.12.0-alpha.2 → 0.12.0-alpha.4
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/api-client/hooks/useRequest.js +16 -1
- package/es/block-provider/BlockProvider.js +2 -2
- package/es/block-provider/hooks/index.js +16 -18
- package/es/collection-manager/Configuration/AddCollectionAction.js +2 -2
- package/es/collection-manager/Configuration/AddFieldAction.js +2 -1
- package/es/collection-manager/Configuration/EditFieldAction.js +2 -1
- package/es/collection-manager/action-hooks.js +3 -1
- package/es/global-theme/AntdAppProvider.js +5 -1
- package/es/locale/en_US.d.ts +4 -0
- package/es/locale/en_US.js +4 -0
- package/es/locale/ja_JP.d.ts +1 -0
- package/es/locale/ja_JP.js +1 -0
- package/es/locale/zh_CN.d.ts +6 -0
- package/es/locale/zh_CN.js +7 -1
- package/es/pm/Card.js +6 -1
- package/es/schema-component/antd/action/Action.Designer.js +243 -54
- package/es/schema-component/antd/action/Action.Drawer.js +2 -2
- package/es/schema-component/antd/action/Action.Modal.js +1 -1
- package/es/schema-component/antd/action/Action.js +15 -19
- package/es/schema-component/antd/appends-tree-select/AppendsTreeSelect.d.ts +8 -2
- package/es/schema-component/antd/appends-tree-select/AppendsTreeSelect.js +67 -36
- package/es/schema-component/antd/association-field/AssociationFieldProvider.js +3 -15
- package/es/schema-component/antd/association-field/Editable.js +2 -1
- package/es/schema-component/antd/association-field/FileManager.js +4 -3
- package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -1
- package/es/schema-component/antd/association-field/InternalNester.js +6 -4
- package/es/schema-component/antd/association-field/InternalPicker.js +2 -1
- package/es/schema-component/antd/association-field/InternalPopoverNester.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalPopoverNester.js +95 -0
- package/es/schema-component/antd/association-field/InternalSubTable.js +2 -5
- package/es/schema-component/antd/association-field/InternalViewer.js +1 -1
- package/es/schema-component/antd/association-field/hooks.js +77 -5
- package/es/schema-component/antd/association-field/util.d.ts +4 -0
- package/es/schema-component/antd/association-field/util.js +32 -1
- package/es/schema-component/antd/color-picker/ReadPretty.js +1 -1
- package/es/schema-component/antd/form-item/FormItem.js +36 -112
- package/es/schema-component/antd/form-v2/Templates.js +12 -5
- package/es/schema-component/antd/grid-card/GridCard.Item.js +4 -4
- package/es/schema-component/antd/input/EllipsisWithTooltip.js +2 -1
- package/es/schema-component/antd/list/List.Item.js +3 -3
- package/es/schema-component/antd/markdown/Markdown.Void.js +6 -1
- package/es/schema-component/antd/markdown/Markdown.js +6 -1
- package/es/schema-component/antd/markdown/style.js +2 -4
- package/es/schema-component/antd/quick-edit/QuickEdit.js +5 -3
- package/es/schema-component/antd/remote-select/RemoteSelect.js +11 -79
- package/es/schema-component/antd/rich-text/RichText.js +7 -2
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +45 -35
- package/es/schema-component/antd/table-v2/Table.js +12 -10
- package/es/schema-component/antd/table-v2/utils.d.ts +5 -0
- package/es/schema-component/antd/table-v2/utils.js +14 -1
- package/es/schema-component/antd/variable/Input.js +2 -1
- package/es/schema-component/antd/variable/TextArea.js +1 -1
- package/es/schema-component/common/utils/uitls.js +19 -2
- package/es/schema-component/hooks/useFieldModeOptions.d.ts +1 -1
- package/es/schema-component/hooks/useFieldModeOptions.js +23 -9
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +75 -0
- package/es/schema-initializer/buttons/FormActionInitializers.js +39 -11
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +12 -0
- package/es/schema-initializer/items/CreateActionInitializer.js +2 -1
- package/es/schema-initializer/items/CreateSubmitActionInitializer.js +3 -0
- package/es/schema-initializer/items/RecordAssociationGridCardBlockInitializer.d.ts +2 -0
- package/es/schema-initializer/items/RecordAssociationGridCardBlockInitializer.js +74 -0
- package/es/schema-initializer/items/RecordAssociationListBlockInitializer.d.ts +2 -0
- package/es/schema-initializer/items/RecordAssociationListBlockInitializer.js +74 -0
- package/es/schema-initializer/items/RecordFormBlockInitializer.js +3 -2
- package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +3 -2
- package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +3 -0
- package/es/schema-initializer/items/index.d.ts +2 -0
- package/es/schema-initializer/items/index.js +2 -0
- package/es/schema-initializer/utils.js +6 -4
- package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -2
- package/es/schema-settings/DataTemplates/utils.js +1 -1
- package/es/schema-settings/LinkageRules/components/LinkageHeader.js +2 -2
- package/es/schema-settings/SchemaSettings.js +132 -19
- package/es/schema-settings/VariableInput/VariableInput.js +6 -3
- package/es/schema-settings/VariableInput/hooks/useContextAssociationFields.d.ts +4 -1
- package/es/schema-settings/VariableInput/hooks/useContextAssociationFields.js +22 -5
- package/es/schema-templates/SchemaTemplateManagerProvider.js +6 -1
- package/lib/api-client/hooks/useRequest.js +16 -1
- package/lib/block-provider/BlockProvider.js +2 -2
- package/lib/block-provider/hooks/index.js +21 -23
- package/lib/collection-manager/Configuration/AddCollectionAction.js +2 -2
- package/lib/collection-manager/Configuration/AddFieldAction.js +2 -1
- package/lib/collection-manager/Configuration/EditFieldAction.js +2 -1
- package/lib/collection-manager/action-hooks.js +3 -1
- package/lib/global-theme/AntdAppProvider.js +5 -1
- package/lib/locale/en_US.d.ts +4 -0
- package/lib/locale/en_US.js +4 -0
- package/lib/locale/ja_JP.d.ts +1 -0
- package/lib/locale/ja_JP.js +1 -0
- package/lib/locale/zh_CN.d.ts +6 -0
- package/lib/locale/zh_CN.js +7 -1
- package/lib/pm/Card.js +6 -1
- package/lib/schema-component/antd/action/Action.Designer.js +242 -53
- package/lib/schema-component/antd/action/Action.Drawer.js +2 -2
- package/lib/schema-component/antd/action/Action.Modal.js +1 -1
- package/lib/schema-component/antd/action/Action.js +15 -19
- package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.d.ts +8 -2
- package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.js +66 -35
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +3 -15
- package/lib/schema-component/antd/association-field/Editable.js +2 -1
- package/lib/schema-component/antd/association-field/FileManager.js +4 -3
- package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -1
- package/lib/schema-component/antd/association-field/InternalNester.js +5 -3
- package/lib/schema-component/antd/association-field/InternalPicker.js +2 -1
- package/lib/schema-component/antd/association-field/InternalPopoverNester.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalPopoverNester.js +104 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.js +1 -4
- package/lib/schema-component/antd/association-field/InternalViewer.js +1 -1
- package/lib/schema-component/antd/association-field/hooks.js +76 -4
- package/lib/schema-component/antd/association-field/util.d.ts +4 -0
- package/lib/schema-component/antd/association-field/util.js +37 -2
- package/lib/schema-component/antd/color-picker/ReadPretty.js +1 -1
- package/lib/schema-component/antd/form-item/FormItem.js +34 -110
- package/lib/schema-component/antd/form-v2/Templates.js +12 -5
- package/lib/schema-component/antd/grid-card/GridCard.Item.js +3 -3
- package/lib/schema-component/antd/input/EllipsisWithTooltip.js +2 -1
- package/lib/schema-component/antd/list/List.Item.js +2 -2
- package/lib/schema-component/antd/markdown/Markdown.Void.js +6 -1
- package/lib/schema-component/antd/markdown/Markdown.js +6 -1
- package/lib/schema-component/antd/markdown/style.js +2 -4
- package/lib/schema-component/antd/quick-edit/QuickEdit.js +5 -3
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +11 -79
- package/lib/schema-component/antd/rich-text/RichText.js +6 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +44 -34
- package/lib/schema-component/antd/table-v2/Table.js +11 -9
- package/lib/schema-component/antd/table-v2/utils.d.ts +5 -0
- package/lib/schema-component/antd/table-v2/utils.js +16 -2
- package/lib/schema-component/antd/variable/Input.js +2 -1
- package/lib/schema-component/antd/variable/TextArea.js +1 -1
- package/lib/schema-component/common/utils/uitls.js +19 -2
- package/lib/schema-component/hooks/useFieldModeOptions.d.ts +1 -1
- package/lib/schema-component/hooks/useFieldModeOptions.js +23 -9
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +75 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.js +39 -11
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +12 -0
- package/lib/schema-initializer/items/CreateActionInitializer.js +2 -1
- package/lib/schema-initializer/items/CreateSubmitActionInitializer.js +3 -0
- package/lib/schema-initializer/items/RecordAssociationGridCardBlockInitializer.d.ts +2 -0
- package/lib/schema-initializer/items/RecordAssociationGridCardBlockInitializer.js +82 -0
- package/lib/schema-initializer/items/RecordAssociationListBlockInitializer.d.ts +2 -0
- package/lib/schema-initializer/items/RecordAssociationListBlockInitializer.js +82 -0
- package/lib/schema-initializer/items/RecordFormBlockInitializer.js +3 -2
- package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +3 -2
- package/lib/schema-initializer/items/UpdateSubmitActionInitializer.js +3 -0
- package/lib/schema-initializer/items/index.d.ts +2 -0
- package/lib/schema-initializer/items/index.js +22 -0
- package/lib/schema-initializer/utils.js +6 -4
- package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -2
- package/lib/schema-settings/DataTemplates/utils.js +1 -1
- package/lib/schema-settings/LinkageRules/components/LinkageHeader.js +1 -1
- package/lib/schema-settings/SchemaSettings.js +131 -18
- package/lib/schema-settings/VariableInput/VariableInput.js +5 -2
- package/lib/schema-settings/VariableInput/hooks/useContextAssociationFields.d.ts +4 -1
- package/lib/schema-settings/VariableInput/hooks/useContextAssociationFields.js +24 -6
- package/lib/schema-templates/SchemaTemplateManagerProvider.js +6 -1
- package/package.json +5 -5
- package/es/schema-component/antd/remote-select/utils.d.ts +0 -4
- package/es/schema-component/antd/remote-select/utils.js +0 -31
- package/lib/schema-component/antd/remote-select/utils.d.ts +0 -4
- package/lib/schema-component/antd/remote-select/utils.js +0 -41
|
@@ -30,7 +30,7 @@ export function useRequest(service) {
|
|
|
30
30
|
var tempService;
|
|
31
31
|
if (typeof service === 'function') {
|
|
32
32
|
tempService = service;
|
|
33
|
-
} else {
|
|
33
|
+
} else if (service) {
|
|
34
34
|
tempService = /*#__PURE__*/function () {
|
|
35
35
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
36
36
|
var params,
|
|
@@ -65,6 +65,21 @@ export function useRequest(service) {
|
|
|
65
65
|
return _ref.apply(this, arguments);
|
|
66
66
|
};
|
|
67
67
|
}();
|
|
68
|
+
} else {
|
|
69
|
+
tempService = /*#__PURE__*/function () {
|
|
70
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
71
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
72
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
case "end":
|
|
75
|
+
return _context2.stop();
|
|
76
|
+
}
|
|
77
|
+
}, _callee2);
|
|
78
|
+
}));
|
|
79
|
+
return function tempService() {
|
|
80
|
+
return _ref2.apply(this, arguments);
|
|
81
|
+
};
|
|
82
|
+
}();
|
|
68
83
|
}
|
|
69
84
|
var tempOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
70
85
|
onSuccess: function onSuccess() {
|
|
@@ -61,6 +61,8 @@ var useResource = function useResource(props) {
|
|
|
61
61
|
var association = useAssociation(props);
|
|
62
62
|
var sourceId = useSourceId === null || useSourceId === void 0 ? void 0 : useSourceId();
|
|
63
63
|
var field = useField();
|
|
64
|
+
var withoutTableFieldResource = useContext(WithoutTableFieldResource);
|
|
65
|
+
var __parent = useContext(BlockRequestContext);
|
|
64
66
|
if (block === 'TableField') {
|
|
65
67
|
var _record$__parent;
|
|
66
68
|
var options = {
|
|
@@ -71,8 +73,6 @@ var useResource = function useResource(props) {
|
|
|
71
73
|
};
|
|
72
74
|
return new TableFieldResource(options);
|
|
73
75
|
}
|
|
74
|
-
var withoutTableFieldResource = useContext(WithoutTableFieldResource);
|
|
75
|
-
var __parent = useContext(BlockRequestContext);
|
|
76
76
|
if (!withoutTableFieldResource && (__parent === null || __parent === void 0 ? void 0 : __parent.block) === 'TableField' && (__parent === null || __parent === void 0 ? void 0 : __parent.resource) instanceof TableFieldResource) {
|
|
77
77
|
return __parent.resource;
|
|
78
78
|
}
|
|
@@ -14,7 +14,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
14
14
|
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); }
|
|
15
15
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
16
16
|
import { SchemaExpressionScopeContext, useField, useFieldSchema, useForm } from '@formily/react';
|
|
17
|
-
import { parse } from '@nocobase/utils/client';
|
|
17
|
+
import { isURL, parse } from '@nocobase/utils/client';
|
|
18
18
|
import { App, message } from 'antd';
|
|
19
19
|
import { cloneDeep } from 'lodash';
|
|
20
20
|
import get from 'lodash/get';
|
|
@@ -50,15 +50,6 @@ function renderTemplate(str, data) {
|
|
|
50
50
|
return get(data, key) || '';
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
function isURL(string) {
|
|
54
|
-
var url;
|
|
55
|
-
try {
|
|
56
|
-
url = new URL(string);
|
|
57
|
-
} catch (e) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
61
|
-
}
|
|
62
53
|
var filterValue = function filterValue(value) {
|
|
63
54
|
if (_typeof(value) !== 'object') {
|
|
64
55
|
return value;
|
|
@@ -95,7 +86,6 @@ function getFormValues(filterByTk, field, form, fieldNames, getField, resource)
|
|
|
95
86
|
return omit(_objectSpread({}, form.values), keys);
|
|
96
87
|
}
|
|
97
88
|
}
|
|
98
|
-
console.log('form.values', form.values);
|
|
99
89
|
return form.values;
|
|
100
90
|
var values = {};
|
|
101
91
|
var _loop = function _loop() {
|
|
@@ -177,14 +167,14 @@ export var useCreateActionProps = function useCreateActionProps() {
|
|
|
177
167
|
onClick: function onClick() {
|
|
178
168
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
179
169
|
var _actionSchema$xActio, _fieldSchema$xCompon;
|
|
180
|
-
var fieldNames, _ref, _ref$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, addChild, assignedValues, values, _treeParentField$name, _treeParentField$fore, treeParentField, _parent$service, _parent$service$refre, data;
|
|
170
|
+
var fieldNames, _ref, _ref$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, triggerWorkflows, addChild, assignedValues, values, _treeParentField$name, _treeParentField$fore, treeParentField, _parent$service, _parent$service$refre, data;
|
|
181
171
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
182
172
|
while (1) switch (_context2.prev = _context2.next) {
|
|
183
173
|
case 0:
|
|
184
174
|
fieldNames = fields.map(function (field) {
|
|
185
175
|
return field.name;
|
|
186
176
|
});
|
|
187
|
-
_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;
|
|
177
|
+
_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, triggerWorkflows = _ref.triggerWorkflows;
|
|
188
178
|
addChild = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.addChild;
|
|
189
179
|
assignedValues = parse(originalAssignedValues)({
|
|
190
180
|
currentTime: new Date(),
|
|
@@ -210,7 +200,11 @@ export var useCreateActionProps = function useCreateActionProps() {
|
|
|
210
200
|
_context2.next = 14;
|
|
211
201
|
return resource[action]({
|
|
212
202
|
values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues),
|
|
213
|
-
filterKeys: filterKeys
|
|
203
|
+
filterKeys: filterKeys,
|
|
204
|
+
// TODO(refactor): should change to inject by plugin
|
|
205
|
+
triggerWorkflows: triggerWorkflows !== null && triggerWorkflows !== void 0 && triggerWorkflows.length ? triggerWorkflows.map(function (row) {
|
|
206
|
+
return [row.workflowKey, row.context].filter(Boolean).join('!');
|
|
207
|
+
}).join(',') : undefined
|
|
214
208
|
});
|
|
215
209
|
case 14:
|
|
216
210
|
data = _context2.sent;
|
|
@@ -1088,11 +1082,11 @@ export var useUpdateActionProps = function useUpdateActionProps() {
|
|
|
1088
1082
|
onClick: function onClick() {
|
|
1089
1083
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1090
1084
|
var _actionSchema$xActio7;
|
|
1091
|
-
var _ref15, _ref15$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, assignedValues, fieldNames, values, _parent$service6, _parent$service6$refr;
|
|
1085
|
+
var _ref15, _ref15$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, triggerWorkflows, assignedValues, fieldNames, values, _parent$service6, _parent$service6$refr;
|
|
1092
1086
|
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1093
1087
|
while (1) switch (_context19.prev = _context19.next) {
|
|
1094
1088
|
case 0:
|
|
1095
|
-
_ref15 = (_actionSchema$xActio7 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio7 !== void 0 ? _actionSchema$xActio7 : {}, _ref15$assignedValues = _ref15.assignedValues, originalAssignedValues = _ref15$assignedValues === void 0 ? {} : _ref15$assignedValues, onSuccess = _ref15.onSuccess, overwriteValues = _ref15.overwriteValues, skipValidator = _ref15.skipValidator;
|
|
1089
|
+
_ref15 = (_actionSchema$xActio7 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio7 !== void 0 ? _actionSchema$xActio7 : {}, _ref15$assignedValues = _ref15.assignedValues, originalAssignedValues = _ref15$assignedValues === void 0 ? {} : _ref15$assignedValues, onSuccess = _ref15.onSuccess, overwriteValues = _ref15.overwriteValues, skipValidator = _ref15.skipValidator, triggerWorkflows = _ref15.triggerWorkflows;
|
|
1096
1090
|
assignedValues = parse(originalAssignedValues)({
|
|
1097
1091
|
currentTime: new Date(),
|
|
1098
1092
|
currentRecord: currentRecord,
|
|
@@ -1117,7 +1111,11 @@ export var useUpdateActionProps = function useUpdateActionProps() {
|
|
|
1117
1111
|
filterByTk: filterByTk,
|
|
1118
1112
|
values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues)
|
|
1119
1113
|
}, data), {}, {
|
|
1120
|
-
updateAssociationValues: updateAssociationValues
|
|
1114
|
+
updateAssociationValues: updateAssociationValues,
|
|
1115
|
+
// TODO(refactor): should change to inject by plugin
|
|
1116
|
+
triggerWorkflows: triggerWorkflows !== null && triggerWorkflows !== void 0 && triggerWorkflows.length ? triggerWorkflows.map(function (row) {
|
|
1117
|
+
return [row.workflowKey, row.context].filter(Boolean).join('!');
|
|
1118
|
+
}).join(',') : undefined
|
|
1121
1119
|
}));
|
|
1122
1120
|
case 12:
|
|
1123
1121
|
actionField.data.loading = false;
|
|
@@ -1568,7 +1566,7 @@ export var useAssociationNames = function useAssociationNames() {
|
|
|
1568
1566
|
var fieldPath = !isAssociationField && isAssociationSubfield ? getAssociationPath(s.name) : s.name;
|
|
1569
1567
|
var path = prefix === '' || !prefix ? fieldPath : prefix + '.' + fieldPath;
|
|
1570
1568
|
appends.add(path);
|
|
1571
|
-
if (['Nester', 'SubTable'].includes((_s$xComponentProps = s['x-component-props']) === null || _s$xComponentProps === void 0 ? void 0 : _s$xComponentProps.mode)) {
|
|
1569
|
+
if (['Nester', 'SubTable', 'PopoverNester'].includes((_s$xComponentProps = s['x-component-props']) === null || _s$xComponentProps === void 0 ? void 0 : _s$xComponentProps.mode)) {
|
|
1572
1570
|
updateAssociationValues.add(path);
|
|
1573
1571
|
var bufPrefix = prefix && prefix !== '' ? prefix + '.' + s.name : s.name;
|
|
1574
1572
|
getAssociationAppends(s, bufPrefix);
|
|
@@ -169,7 +169,7 @@ var getDefaultCollectionFields = function getDefaultCollectionFields(values) {
|
|
|
169
169
|
uiSchema: {
|
|
170
170
|
type: 'object',
|
|
171
171
|
title: '{{t("Created by")}}',
|
|
172
|
-
'x-component': '
|
|
172
|
+
'x-component': 'AssociationField',
|
|
173
173
|
'x-component-props': {
|
|
174
174
|
fieldNames: {
|
|
175
175
|
value: 'id',
|
|
@@ -205,7 +205,7 @@ var getDefaultCollectionFields = function getDefaultCollectionFields(values) {
|
|
|
205
205
|
uiSchema: {
|
|
206
206
|
type: 'object',
|
|
207
207
|
title: '{{t("Last updated by")}}',
|
|
208
|
-
'x-component': '
|
|
208
|
+
'x-component': 'AssociationField',
|
|
209
209
|
'x-component-props': {
|
|
210
210
|
fieldNames: {
|
|
211
211
|
value: 'id',
|
|
@@ -24,10 +24,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
24
24
|
import { useRequest } from '../../api-client';
|
|
25
25
|
import { RecordProvider, useRecord } from '../../record-provider';
|
|
26
26
|
import { ActionContextProvider, SchemaComponent, useActionContext, useCompile } from '../../schema-component';
|
|
27
|
-
import { useResourceActionContext, useResourceContext } from '../ResourceActionProvider';
|
|
28
27
|
import { useCancelAction } from '../action-hooks';
|
|
29
28
|
import { useCollectionManager } from '../hooks';
|
|
30
29
|
import useDialect from '../hooks/useDialect';
|
|
30
|
+
import { useResourceActionContext, useResourceContext } from '../ResourceActionProvider';
|
|
31
31
|
import * as components from './components';
|
|
32
32
|
import { getOptions } from './interfaces';
|
|
33
33
|
var getSchema = function getSchema(schema, record, compile) {
|
|
@@ -38,6 +38,7 @@ var getSchema = function getSchema(schema, record, compile) {
|
|
|
38
38
|
if (schema.hasDefaultValue === true) {
|
|
39
39
|
var _schema$default;
|
|
40
40
|
properties['defaultValue'] = cloneDeep(schema === null || schema === void 0 ? void 0 : (_schema$default = schema.default) === null || _schema$default === void 0 ? void 0 : _schema$default.uiSchema);
|
|
41
|
+
properties.defaultValue.required = false;
|
|
41
42
|
properties['defaultValue']['title'] = compile('{{ t("Default value") }}');
|
|
42
43
|
properties['defaultValue']['x-decorator'] = 'FormItem';
|
|
43
44
|
properties['defaultValue']['x-reactions'] = {
|
|
@@ -23,10 +23,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
23
23
|
import { useAPIClient, useRequest } from '../../api-client';
|
|
24
24
|
import { RecordProvider, useRecord } from '../../record-provider';
|
|
25
25
|
import { ActionContextProvider, SchemaComponent, useActionContext, useCompile } from '../../schema-component';
|
|
26
|
-
import { useResourceActionContext, useResourceContext } from '../ResourceActionProvider';
|
|
27
26
|
import { useCancelAction, useUpdateAction } from '../action-hooks';
|
|
28
27
|
import { useCollectionManager } from '../hooks';
|
|
29
28
|
import useDialect from '../hooks/useDialect';
|
|
29
|
+
import { useResourceActionContext, useResourceContext } from '../ResourceActionProvider';
|
|
30
30
|
import * as components from './components';
|
|
31
31
|
var getSchema = function getSchema(schema, record, compile, getContainer) {
|
|
32
32
|
var _record$__parent;
|
|
@@ -39,6 +39,7 @@ var getSchema = function getSchema(schema, record, compile, getContainer) {
|
|
|
39
39
|
}
|
|
40
40
|
if (schema.hasDefaultValue === true) {
|
|
41
41
|
properties['defaultValue'] = cloneDeep(schema.default.uiSchema) || {};
|
|
42
|
+
properties.defaultValue.required = false;
|
|
42
43
|
properties['defaultValue']['title'] = compile('{{ t("Default value") }}');
|
|
43
44
|
properties['defaultValue']['x-decorator'] = 'FormItem';
|
|
44
45
|
properties['defaultValue']['x-reactions'] = {
|
|
@@ -453,7 +453,9 @@ export var useCreateAction = function useCreateAction() {
|
|
|
453
453
|
case 14:
|
|
454
454
|
_context5.prev = 14;
|
|
455
455
|
_context5.t0 = _context5["catch"](0);
|
|
456
|
-
field.data
|
|
456
|
+
if (field.data) {
|
|
457
|
+
field.data.loading = false;
|
|
458
|
+
}
|
|
457
459
|
case 17:
|
|
458
460
|
case "end":
|
|
459
461
|
return _context5.stop();
|
|
@@ -13,7 +13,11 @@ var AppInner = /*#__PURE__*/memo(function (_ref) {
|
|
|
13
13
|
});
|
|
14
14
|
var AntdAppProvider = function AntdAppProvider(_ref2) {
|
|
15
15
|
var children = _ref2.children;
|
|
16
|
-
return /*#__PURE__*/React.createElement(App,
|
|
16
|
+
return /*#__PURE__*/React.createElement(App, {
|
|
17
|
+
style: {
|
|
18
|
+
height: '100%'
|
|
19
|
+
}
|
|
20
|
+
}, /*#__PURE__*/React.createElement(AppInner, null, children));
|
|
17
21
|
};
|
|
18
22
|
AntdAppProvider.displayName = 'AntdAppProvider';
|
|
19
23
|
export default AntdAppProvider;
|
package/es/locale/en_US.d.ts
CHANGED
|
@@ -182,6 +182,9 @@ declare const _default: {
|
|
|
182
182
|
"Action type": string;
|
|
183
183
|
Actions: string;
|
|
184
184
|
Insert: string;
|
|
185
|
+
"Insert if not exists": string;
|
|
186
|
+
"Insert if not exists, or update": string;
|
|
187
|
+
"Determine whether a record exists by the following fields": string;
|
|
185
188
|
Update: string;
|
|
186
189
|
View: string;
|
|
187
190
|
"View record": string;
|
|
@@ -251,6 +254,7 @@ declare const _default: {
|
|
|
251
254
|
"Link to description": string;
|
|
252
255
|
"Sub-table": string;
|
|
253
256
|
"Sub-details": string;
|
|
257
|
+
"Sub-form(Popover)": string;
|
|
254
258
|
"System info": string;
|
|
255
259
|
"Created at": string;
|
|
256
260
|
"Last updated at": string;
|
package/es/locale/en_US.js
CHANGED
|
@@ -182,6 +182,9 @@ export default {
|
|
|
182
182
|
"Action type": "Action type",
|
|
183
183
|
"Actions": "Actions",
|
|
184
184
|
"Insert": "Insert",
|
|
185
|
+
"Insert if not exists": "Insert if not exists",
|
|
186
|
+
"Insert if not exists, or update": "Insert if not exists, or update",
|
|
187
|
+
"Determine whether a record exists by the following fields": "Determine whether a record exists by the following fields",
|
|
185
188
|
"Update": "Update",
|
|
186
189
|
"View": "View",
|
|
187
190
|
"View record": "View record",
|
|
@@ -251,6 +254,7 @@ export default {
|
|
|
251
254
|
"Link to description": "Used to create collection relationships quickly and compatible with most common scenarios. Suitable for non-developer use. When present as a field, it is a drop-down selection used to select records from the target collection. Once created, it will simultaneously generate the associated fields of the current collection in the target collection.",
|
|
252
255
|
"Sub-table": "Sub-table",
|
|
253
256
|
"Sub-details": "Sub-details",
|
|
257
|
+
"Sub-form(Popover)": "Sub-form(Popover)",
|
|
254
258
|
"System info": "System info",
|
|
255
259
|
"Created at": "Created at",
|
|
256
260
|
"Last updated at": "Last updated at",
|
package/es/locale/ja_JP.d.ts
CHANGED
package/es/locale/ja_JP.js
CHANGED
|
@@ -222,6 +222,7 @@ export default {
|
|
|
222
222
|
"Link to": "リンク",
|
|
223
223
|
"Link to description": "コレクションの関連付けを素早く作成するためにしようされ、ほとんどの一般的なシナリオに対応しています。開発者以外の方のしようにも適しています。フィールドとして存在する場合、参照元コレクションのレコードを選択するために使用されるドロップダウンです。一度作成されると、参照先コレクションに現在のコレクションの関連フィールドが同時に生成されます。",
|
|
224
224
|
"Sub-table": "サブテーブル",
|
|
225
|
+
"Sub-form(Popover)": "サブフォーム(ポップアップ窓)",
|
|
225
226
|
"System info": "システム情報",
|
|
226
227
|
"Created at": "作成日",
|
|
227
228
|
"Last updated at": "最終更新日",
|
package/es/locale/zh_CN.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"Display <1><0>10</0><1>20</1><2>50</2><3>100</3></1> items per page": string;
|
|
3
|
+
"Page number": string;
|
|
4
|
+
"Page size": string;
|
|
3
5
|
"Meet <1><0>All</0><1>Any</1></1> conditions in the group": string;
|
|
4
6
|
"Open in<1><0>Modal</0><1>Drawer</1><2>Window</2></1>": string;
|
|
5
7
|
"{{count}} filter items": string;
|
|
@@ -314,6 +316,7 @@ declare const _default: {
|
|
|
314
316
|
"Select file": string;
|
|
315
317
|
Subtable: string;
|
|
316
318
|
"Sub-form": string;
|
|
319
|
+
"Sub-form(Popover)": string;
|
|
317
320
|
"Sub-details": string;
|
|
318
321
|
"Record picker": string;
|
|
319
322
|
"Toggles the subfield mode": string;
|
|
@@ -699,6 +702,8 @@ declare const _default: {
|
|
|
699
702
|
Constant: string;
|
|
700
703
|
'Select a variable': string;
|
|
701
704
|
Insert: string;
|
|
705
|
+
"Insert if not exists": string;
|
|
706
|
+
"Insert if not exists, or update": string;
|
|
702
707
|
'System variables': string;
|
|
703
708
|
'Date variables': string;
|
|
704
709
|
'Double click to choose entire object': string;
|
|
@@ -767,5 +772,6 @@ declare const _default: {
|
|
|
767
772
|
"Sync successfully": string;
|
|
768
773
|
"Sync from form fields": string;
|
|
769
774
|
"Select all": string;
|
|
775
|
+
"Determine whether a record exists by the following fields": string;
|
|
770
776
|
};
|
|
771
777
|
export default _default;
|
package/es/locale/zh_CN.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"Display <1><0>10</0><1>20</1><2>50</2><3>100</3></1> items per page": "每页显示 <1><0>10</0><1>20</1><2>50</2><3>100</3></1> 条",
|
|
3
|
+
"Page number": "页码",
|
|
4
|
+
"Page size": "每页条数",
|
|
3
5
|
"Meet <1><0>All</0><1>Any</1></1> conditions in the group": "满足组内 <1><0>全部</0><1>任意</1></1> 条件",
|
|
4
6
|
"Open in<1><0>Modal</0><1>Drawer</1><2>Window</2></1>": "在 <1><0>对话框</0><1>抽屉</1><2>窗口</2></1> 内打开",
|
|
5
7
|
"{{count}} filter items": "{{count}} 个筛选项",
|
|
@@ -314,6 +316,7 @@ export default {
|
|
|
314
316
|
"Select file": "选择文件",
|
|
315
317
|
"Subtable": "子表格",
|
|
316
318
|
"Sub-form": "子表单",
|
|
319
|
+
"Sub-form(Popover)": "子表单(弹窗)",
|
|
317
320
|
"Sub-details": "子详情",
|
|
318
321
|
"Record picker": "数据选择器",
|
|
319
322
|
"Toggles the subfield mode": "切换子字段模式",
|
|
@@ -700,6 +703,8 @@ export default {
|
|
|
700
703
|
'Constant': '常量',
|
|
701
704
|
'Select a variable': '选择变量',
|
|
702
705
|
"Insert": "插入",
|
|
706
|
+
"Insert if not exists": "不存在时插入",
|
|
707
|
+
"Insert if not exists, or update": "不存在时插入,否则更新",
|
|
703
708
|
'System variables': '系统变量',
|
|
704
709
|
'Date variables': '日期变量',
|
|
705
710
|
'Double click to choose entire object': '双击选择整个对象',
|
|
@@ -767,5 +772,6 @@ export default {
|
|
|
767
772
|
"Tag color field": "标签颜色字段",
|
|
768
773
|
"Sync successfully": "同步成功",
|
|
769
774
|
"Sync from form fields": "同步表单字段",
|
|
770
|
-
"Select all": "全选"
|
|
775
|
+
"Select all": "全选",
|
|
776
|
+
"Determine whether a record exists by the following fields": "通过以下字段判断记录是否存在"
|
|
771
777
|
};
|
package/es/pm/Card.js
CHANGED
|
@@ -14,6 +14,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useNavigate } from 'react-router-dom';
|
|
16
16
|
import { useAPIClient, useRequest } from '../api-client';
|
|
17
|
+
import { useGlobalTheme } from '../global-theme';
|
|
17
18
|
import { useStyles as useMarkdownStyles } from '../schema-component/antd/markdown/style';
|
|
18
19
|
import { useParseMarkdown } from '../schema-component/antd/markdown/util';
|
|
19
20
|
import { useStyles } from './style';
|
|
@@ -38,7 +39,11 @@ var PluginDocument = function PluginDocument(props) {
|
|
|
38
39
|
var _data$data;
|
|
39
40
|
var _useStyles = useStyles(),
|
|
40
41
|
styles = _useStyles.styles;
|
|
41
|
-
var
|
|
42
|
+
var _useGlobalTheme = useGlobalTheme(),
|
|
43
|
+
isDarkTheme = _useGlobalTheme.isDarkTheme;
|
|
44
|
+
var _useMarkdownStyles = useMarkdownStyles({
|
|
45
|
+
isDarkTheme: isDarkTheme
|
|
46
|
+
}),
|
|
42
47
|
componentCls = _useMarkdownStyles.componentCls,
|
|
43
48
|
hashId = _useMarkdownStyles.hashId;
|
|
44
49
|
var _useState = useState(''),
|