@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.
Files changed (161) hide show
  1. package/es/api-client/hooks/useRequest.js +16 -1
  2. package/es/block-provider/BlockProvider.js +2 -2
  3. package/es/block-provider/hooks/index.js +16 -18
  4. package/es/collection-manager/Configuration/AddCollectionAction.js +2 -2
  5. package/es/collection-manager/Configuration/AddFieldAction.js +2 -1
  6. package/es/collection-manager/Configuration/EditFieldAction.js +2 -1
  7. package/es/collection-manager/action-hooks.js +3 -1
  8. package/es/global-theme/AntdAppProvider.js +5 -1
  9. package/es/locale/en_US.d.ts +4 -0
  10. package/es/locale/en_US.js +4 -0
  11. package/es/locale/ja_JP.d.ts +1 -0
  12. package/es/locale/ja_JP.js +1 -0
  13. package/es/locale/zh_CN.d.ts +6 -0
  14. package/es/locale/zh_CN.js +7 -1
  15. package/es/pm/Card.js +6 -1
  16. package/es/schema-component/antd/action/Action.Designer.js +243 -54
  17. package/es/schema-component/antd/action/Action.Drawer.js +2 -2
  18. package/es/schema-component/antd/action/Action.Modal.js +1 -1
  19. package/es/schema-component/antd/action/Action.js +15 -19
  20. package/es/schema-component/antd/appends-tree-select/AppendsTreeSelect.d.ts +8 -2
  21. package/es/schema-component/antd/appends-tree-select/AppendsTreeSelect.js +67 -36
  22. package/es/schema-component/antd/association-field/AssociationFieldProvider.js +3 -15
  23. package/es/schema-component/antd/association-field/Editable.js +2 -1
  24. package/es/schema-component/antd/association-field/FileManager.js +4 -3
  25. package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -1
  26. package/es/schema-component/antd/association-field/InternalNester.js +6 -4
  27. package/es/schema-component/antd/association-field/InternalPicker.js +2 -1
  28. package/es/schema-component/antd/association-field/InternalPopoverNester.d.ts +2 -0
  29. package/es/schema-component/antd/association-field/InternalPopoverNester.js +95 -0
  30. package/es/schema-component/antd/association-field/InternalSubTable.js +2 -5
  31. package/es/schema-component/antd/association-field/InternalViewer.js +1 -1
  32. package/es/schema-component/antd/association-field/hooks.js +77 -5
  33. package/es/schema-component/antd/association-field/util.d.ts +4 -0
  34. package/es/schema-component/antd/association-field/util.js +32 -1
  35. package/es/schema-component/antd/color-picker/ReadPretty.js +1 -1
  36. package/es/schema-component/antd/form-item/FormItem.js +36 -112
  37. package/es/schema-component/antd/form-v2/Templates.js +12 -5
  38. package/es/schema-component/antd/grid-card/GridCard.Item.js +4 -4
  39. package/es/schema-component/antd/input/EllipsisWithTooltip.js +2 -1
  40. package/es/schema-component/antd/list/List.Item.js +3 -3
  41. package/es/schema-component/antd/markdown/Markdown.Void.js +6 -1
  42. package/es/schema-component/antd/markdown/Markdown.js +6 -1
  43. package/es/schema-component/antd/markdown/style.js +2 -4
  44. package/es/schema-component/antd/quick-edit/QuickEdit.js +5 -3
  45. package/es/schema-component/antd/remote-select/RemoteSelect.js +11 -79
  46. package/es/schema-component/antd/rich-text/RichText.js +7 -2
  47. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +45 -35
  48. package/es/schema-component/antd/table-v2/Table.js +12 -10
  49. package/es/schema-component/antd/table-v2/utils.d.ts +5 -0
  50. package/es/schema-component/antd/table-v2/utils.js +14 -1
  51. package/es/schema-component/antd/variable/Input.js +2 -1
  52. package/es/schema-component/antd/variable/TextArea.js +1 -1
  53. package/es/schema-component/common/utils/uitls.js +19 -2
  54. package/es/schema-component/hooks/useFieldModeOptions.d.ts +1 -1
  55. package/es/schema-component/hooks/useFieldModeOptions.js +23 -9
  56. package/es/schema-initializer/buttons/FormActionInitializers.d.ts +75 -0
  57. package/es/schema-initializer/buttons/FormActionInitializers.js +39 -11
  58. package/es/schema-initializer/buttons/RecordBlockInitializers.js +12 -0
  59. package/es/schema-initializer/items/CreateActionInitializer.js +2 -1
  60. package/es/schema-initializer/items/CreateSubmitActionInitializer.js +3 -0
  61. package/es/schema-initializer/items/RecordAssociationGridCardBlockInitializer.d.ts +2 -0
  62. package/es/schema-initializer/items/RecordAssociationGridCardBlockInitializer.js +74 -0
  63. package/es/schema-initializer/items/RecordAssociationListBlockInitializer.d.ts +2 -0
  64. package/es/schema-initializer/items/RecordAssociationListBlockInitializer.js +74 -0
  65. package/es/schema-initializer/items/RecordFormBlockInitializer.js +3 -2
  66. package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +3 -2
  67. package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +3 -0
  68. package/es/schema-initializer/items/index.d.ts +2 -0
  69. package/es/schema-initializer/items/index.js +2 -0
  70. package/es/schema-initializer/utils.js +6 -4
  71. package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -2
  72. package/es/schema-settings/DataTemplates/utils.js +1 -1
  73. package/es/schema-settings/LinkageRules/components/LinkageHeader.js +2 -2
  74. package/es/schema-settings/SchemaSettings.js +132 -19
  75. package/es/schema-settings/VariableInput/VariableInput.js +6 -3
  76. package/es/schema-settings/VariableInput/hooks/useContextAssociationFields.d.ts +4 -1
  77. package/es/schema-settings/VariableInput/hooks/useContextAssociationFields.js +22 -5
  78. package/es/schema-templates/SchemaTemplateManagerProvider.js +6 -1
  79. package/lib/api-client/hooks/useRequest.js +16 -1
  80. package/lib/block-provider/BlockProvider.js +2 -2
  81. package/lib/block-provider/hooks/index.js +21 -23
  82. package/lib/collection-manager/Configuration/AddCollectionAction.js +2 -2
  83. package/lib/collection-manager/Configuration/AddFieldAction.js +2 -1
  84. package/lib/collection-manager/Configuration/EditFieldAction.js +2 -1
  85. package/lib/collection-manager/action-hooks.js +3 -1
  86. package/lib/global-theme/AntdAppProvider.js +5 -1
  87. package/lib/locale/en_US.d.ts +4 -0
  88. package/lib/locale/en_US.js +4 -0
  89. package/lib/locale/ja_JP.d.ts +1 -0
  90. package/lib/locale/ja_JP.js +1 -0
  91. package/lib/locale/zh_CN.d.ts +6 -0
  92. package/lib/locale/zh_CN.js +7 -1
  93. package/lib/pm/Card.js +6 -1
  94. package/lib/schema-component/antd/action/Action.Designer.js +242 -53
  95. package/lib/schema-component/antd/action/Action.Drawer.js +2 -2
  96. package/lib/schema-component/antd/action/Action.Modal.js +1 -1
  97. package/lib/schema-component/antd/action/Action.js +15 -19
  98. package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.d.ts +8 -2
  99. package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.js +66 -35
  100. package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +3 -15
  101. package/lib/schema-component/antd/association-field/Editable.js +2 -1
  102. package/lib/schema-component/antd/association-field/FileManager.js +4 -3
  103. package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -1
  104. package/lib/schema-component/antd/association-field/InternalNester.js +5 -3
  105. package/lib/schema-component/antd/association-field/InternalPicker.js +2 -1
  106. package/lib/schema-component/antd/association-field/InternalPopoverNester.d.ts +2 -0
  107. package/lib/schema-component/antd/association-field/InternalPopoverNester.js +104 -0
  108. package/lib/schema-component/antd/association-field/InternalSubTable.js +1 -4
  109. package/lib/schema-component/antd/association-field/InternalViewer.js +1 -1
  110. package/lib/schema-component/antd/association-field/hooks.js +76 -4
  111. package/lib/schema-component/antd/association-field/util.d.ts +4 -0
  112. package/lib/schema-component/antd/association-field/util.js +37 -2
  113. package/lib/schema-component/antd/color-picker/ReadPretty.js +1 -1
  114. package/lib/schema-component/antd/form-item/FormItem.js +34 -110
  115. package/lib/schema-component/antd/form-v2/Templates.js +12 -5
  116. package/lib/schema-component/antd/grid-card/GridCard.Item.js +3 -3
  117. package/lib/schema-component/antd/input/EllipsisWithTooltip.js +2 -1
  118. package/lib/schema-component/antd/list/List.Item.js +2 -2
  119. package/lib/schema-component/antd/markdown/Markdown.Void.js +6 -1
  120. package/lib/schema-component/antd/markdown/Markdown.js +6 -1
  121. package/lib/schema-component/antd/markdown/style.js +2 -4
  122. package/lib/schema-component/antd/quick-edit/QuickEdit.js +5 -3
  123. package/lib/schema-component/antd/remote-select/RemoteSelect.js +11 -79
  124. package/lib/schema-component/antd/rich-text/RichText.js +6 -1
  125. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +44 -34
  126. package/lib/schema-component/antd/table-v2/Table.js +11 -9
  127. package/lib/schema-component/antd/table-v2/utils.d.ts +5 -0
  128. package/lib/schema-component/antd/table-v2/utils.js +16 -2
  129. package/lib/schema-component/antd/variable/Input.js +2 -1
  130. package/lib/schema-component/antd/variable/TextArea.js +1 -1
  131. package/lib/schema-component/common/utils/uitls.js +19 -2
  132. package/lib/schema-component/hooks/useFieldModeOptions.d.ts +1 -1
  133. package/lib/schema-component/hooks/useFieldModeOptions.js +23 -9
  134. package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +75 -0
  135. package/lib/schema-initializer/buttons/FormActionInitializers.js +39 -11
  136. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +12 -0
  137. package/lib/schema-initializer/items/CreateActionInitializer.js +2 -1
  138. package/lib/schema-initializer/items/CreateSubmitActionInitializer.js +3 -0
  139. package/lib/schema-initializer/items/RecordAssociationGridCardBlockInitializer.d.ts +2 -0
  140. package/lib/schema-initializer/items/RecordAssociationGridCardBlockInitializer.js +82 -0
  141. package/lib/schema-initializer/items/RecordAssociationListBlockInitializer.d.ts +2 -0
  142. package/lib/schema-initializer/items/RecordAssociationListBlockInitializer.js +82 -0
  143. package/lib/schema-initializer/items/RecordFormBlockInitializer.js +3 -2
  144. package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +3 -2
  145. package/lib/schema-initializer/items/UpdateSubmitActionInitializer.js +3 -0
  146. package/lib/schema-initializer/items/index.d.ts +2 -0
  147. package/lib/schema-initializer/items/index.js +22 -0
  148. package/lib/schema-initializer/utils.js +6 -4
  149. package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -2
  150. package/lib/schema-settings/DataTemplates/utils.js +1 -1
  151. package/lib/schema-settings/LinkageRules/components/LinkageHeader.js +1 -1
  152. package/lib/schema-settings/SchemaSettings.js +131 -18
  153. package/lib/schema-settings/VariableInput/VariableInput.js +5 -2
  154. package/lib/schema-settings/VariableInput/hooks/useContextAssociationFields.d.ts +4 -1
  155. package/lib/schema-settings/VariableInput/hooks/useContextAssociationFields.js +24 -6
  156. package/lib/schema-templates/SchemaTemplateManagerProvider.js +6 -1
  157. package/package.json +5 -5
  158. package/es/schema-component/antd/remote-select/utils.d.ts +0 -4
  159. package/es/schema-component/antd/remote-select/utils.js +0 -31
  160. package/lib/schema-component/antd/remote-select/utils.d.ts +0 -4
  161. 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': 'RecordPicker',
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': 'RecordPicker',
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.loading = false;
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, null, /*#__PURE__*/React.createElement(AppInner, null, children));
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;
@@ -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;
@@ -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",
@@ -222,6 +222,7 @@ declare const _default: {
222
222
  "Link to": string;
223
223
  "Link to description": string;
224
224
  "Sub-table": string;
225
+ "Sub-form(Popover)": string;
225
226
  "System info": string;
226
227
  "Created at": string;
227
228
  "Last updated at": string;
@@ -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": "最終更新日",
@@ -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;
@@ -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 _useMarkdownStyles = useMarkdownStyles(),
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(''),