@nocobase/client 0.7.6-alpha.2 → 0.8.0-alpha.10

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 (267) hide show
  1. package/es/acl/ACLShortcut.d.ts +2 -0
  2. package/es/acl/ACLShortcut.js +31 -2
  3. package/es/api-client/APIClient.d.ts +1 -0
  4. package/es/api-client/APIClient.js +6 -1
  5. package/es/application/Application.d.ts +3 -1
  6. package/es/application/Application.js +131 -39
  7. package/es/block-provider/BlockProvider.js +12 -1
  8. package/es/block-provider/CalendarBlockProvider.d.ts +1 -0
  9. package/es/block-provider/CalendarBlockProvider.js +6 -3
  10. package/es/block-provider/TableSelectorProvider.js +21 -6
  11. package/es/block-provider/hooks/index.d.ts +6 -0
  12. package/es/block-provider/hooks/index.js +485 -115
  13. package/es/collection-manager/CollectionManagerProvider.js +26 -45
  14. package/es/collection-manager/CollectionManagerShortcut.d.ts +2 -0
  15. package/es/collection-manager/CollectionManagerShortcut.js +38 -3
  16. package/es/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
  17. package/es/collection-manager/Configuration/AddFieldAction.js +48 -13
  18. package/es/collection-manager/Configuration/CollectionFieldsTable.d.ts +15 -0
  19. package/es/collection-manager/Configuration/CollectionFieldsTable.js +73 -0
  20. package/es/collection-manager/Configuration/CollectionFieldsTableArray.d.ts +8 -0
  21. package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +250 -0
  22. package/es/collection-manager/Configuration/ConfigurationTable.js +6 -2
  23. package/es/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
  24. package/es/collection-manager/Configuration/EditFieldAction.js +24 -11
  25. package/es/collection-manager/Configuration/index.d.ts +3 -0
  26. package/es/collection-manager/Configuration/index.js +3 -0
  27. package/es/collection-manager/Configuration/schemas/collectionFields.js +4 -4
  28. package/es/collection-manager/Configuration/schemas/collections.js +1 -1
  29. package/es/collection-manager/index.d.ts +1 -0
  30. package/es/collection-manager/index.js +2 -1
  31. package/es/collection-manager/interfaces/index.d.ts +1 -0
  32. package/es/collection-manager/interfaces/index.js +1 -0
  33. package/es/collection-manager/interfaces/json.d.ts +2 -0
  34. package/es/collection-manager/interfaces/json.js +48 -0
  35. package/es/collection-manager/interfaces/m2o.js +3 -3
  36. package/es/collection-manager/interfaces/o2m.js +5 -6
  37. package/es/collection-manager/interfaces/o2o.js +5 -5
  38. package/es/collection-manager/interfaces/properties/index.d.ts +14 -0
  39. package/es/collection-manager/interfaces/properties/index.js +24 -1
  40. package/es/collection-manager/interfaces/sequence.js +13 -9
  41. package/es/index.d.ts +1 -0
  42. package/es/index.js +1 -0
  43. package/es/locale/en_US.d.ts +24 -1
  44. package/es/locale/en_US.js +25 -2
  45. package/es/locale/ja_JP.d.ts +2 -1
  46. package/es/locale/ja_JP.js +2 -1
  47. package/es/locale/ru_RU.d.ts +2 -1
  48. package/es/locale/ru_RU.js +2 -1
  49. package/es/locale/tr_TR.d.ts +1 -1
  50. package/es/locale/tr_TR.js +1 -1
  51. package/es/locale/zh_CN.d.ts +50 -1
  52. package/es/locale/zh_CN.js +51 -2
  53. package/es/plugin-manager/PluginManager.js +35 -23
  54. package/es/pm/PluginManagerLink.d.ts +2 -0
  55. package/es/pm/PluginManagerLink.js +112 -0
  56. package/es/pm/index.d.ts +6 -0
  57. package/es/pm/index.js +422 -0
  58. package/es/route-switch/antd/admin-layout/index.js +1 -1
  59. package/es/schema-component/antd/action/Action.Designer.js +35 -12
  60. package/es/schema-component/antd/action/Action.Modal.js +4 -2
  61. package/es/schema-component/antd/action/Action.js +3 -3
  62. package/es/schema-component/antd/action/context.d.ts +2 -0
  63. package/es/schema-component/antd/action/hooks.d.ts +1 -0
  64. package/es/schema-component/antd/calendar/Calendar.Designer.js +19 -6
  65. package/es/schema-component/antd/calendar/Calendar.js +137 -23
  66. package/es/schema-component/antd/calendar/DeleteEvent.d.ts +3 -0
  67. package/es/schema-component/antd/calendar/DeleteEvent.js +147 -0
  68. package/es/schema-component/antd/calendar/Title.js +18 -3
  69. package/es/schema-component/antd/calendar/components/Header.d.ts +10 -0
  70. package/es/schema-component/antd/calendar/components/Header.js +43 -0
  71. package/es/schema-component/antd/calendar/index.js +2 -0
  72. package/es/schema-component/antd/calendar/style.less +53 -9
  73. package/es/schema-component/antd/calendar/types.d.ts +6 -0
  74. package/es/schema-component/antd/calendar/utils.d.ts +2 -0
  75. package/es/schema-component/antd/calendar/utils.js +7 -0
  76. package/es/schema-component/antd/checkbox/Checkbox.js +13 -4
  77. package/es/schema-component/antd/formula-input/FormulaInput.js +28 -37
  78. package/es/schema-component/antd/input/Input.d.ts +1 -0
  79. package/es/schema-component/antd/input/Input.js +2 -0
  80. package/es/schema-component/antd/input/Json.d.ts +6 -0
  81. package/es/schema-component/antd/input/Json.js +41 -0
  82. package/es/schema-component/antd/input/ReadPretty.d.ts +3 -0
  83. package/es/schema-component/antd/input/ReadPretty.js +15 -0
  84. package/es/schema-component/antd/input/index.d.ts +1 -0
  85. package/es/schema-component/antd/input/index.js +2 -1
  86. package/es/schema-component/antd/markdown/Markdown.Void.js +5 -2
  87. package/es/schema-component/antd/radio/Radio.js +2 -1
  88. package/es/schema-component/antd/select/ReadPretty.js +2 -1
  89. package/es/schema-component/antd/select/Select.js +25 -1
  90. package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +16 -2
  91. package/es/schema-component/antd/upload/Upload.js +2 -1
  92. package/es/schema-component/antd/upload/shared.js +5 -6
  93. package/es/schema-component/antd/upload/type.d.ts +2 -0
  94. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
  95. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +50 -0
  96. package/es/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +143 -0
  97. package/es/schema-initializer/buttons/CalendarFormActionInitializers.js +146 -0
  98. package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
  99. package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +35 -0
  100. package/es/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
  101. package/es/schema-initializer/buttons/FormActionInitializers.js +118 -0
  102. package/es/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
  103. package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
  104. package/es/schema-initializer/buttons/TabPaneInitializers.js +13 -0
  105. package/es/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
  106. package/es/schema-initializer/buttons/TableActionInitializers.js +45 -0
  107. package/es/schema-initializer/buttons/index.d.ts +3 -0
  108. package/es/schema-initializer/buttons/index.js +3 -0
  109. package/es/schema-initializer/components/BulkEditField.d.ts +7 -0
  110. package/es/schema-initializer/components/BulkEditField.js +187 -0
  111. package/es/schema-initializer/components/index.d.ts +1 -0
  112. package/es/schema-initializer/components/index.js +2 -1
  113. package/es/schema-initializer/items/BlockInitializer.js +8 -8
  114. package/es/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
  115. package/es/schema-initializer/items/BulkEditSubmitActionInitializer.js +24 -0
  116. package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
  117. package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +103 -0
  118. package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
  119. package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +61 -0
  120. package/es/schema-initializer/items/DeleteEventActionInitializer.d.ts +1 -0
  121. package/es/schema-initializer/items/DeleteEventActionInitializer.js +27 -0
  122. package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +7 -7
  123. package/es/schema-initializer/items/index.d.ts +4 -0
  124. package/es/schema-initializer/items/index.js +4 -0
  125. package/es/schema-initializer/utils.d.ts +1 -0
  126. package/es/schema-initializer/utils.js +74 -15
  127. package/es/schema-settings/SchemaSettings.d.ts +6 -0
  128. package/es/schema-settings/SchemaSettings.js +4 -1
  129. package/es/schema-templates/BlockTemplatePage.d.ts +1 -0
  130. package/es/schema-templates/BlockTemplatePage.js +7 -0
  131. package/es/schema-templates/SchemaTemplateShortcut.js +1 -1
  132. package/es/system-settings/SystemSettingsShortcut.d.ts +2 -0
  133. package/es/system-settings/SystemSettingsShortcut.js +134 -5
  134. package/lib/acl/ACLShortcut.d.ts +2 -0
  135. package/lib/acl/ACLShortcut.js +41 -4
  136. package/lib/api-client/APIClient.d.ts +1 -0
  137. package/lib/api-client/APIClient.js +6 -1
  138. package/lib/application/Application.d.ts +3 -1
  139. package/lib/application/Application.js +139 -39
  140. package/lib/block-provider/BlockProvider.js +11 -0
  141. package/lib/block-provider/CalendarBlockProvider.d.ts +1 -0
  142. package/lib/block-provider/CalendarBlockProvider.js +6 -3
  143. package/lib/block-provider/TableSelectorProvider.js +21 -6
  144. package/lib/block-provider/hooks/index.d.ts +6 -0
  145. package/lib/block-provider/hooks/index.js +496 -115
  146. package/lib/collection-manager/CollectionManagerProvider.js +28 -47
  147. package/lib/collection-manager/CollectionManagerShortcut.d.ts +2 -0
  148. package/lib/collection-manager/CollectionManagerShortcut.js +47 -4
  149. package/lib/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
  150. package/lib/collection-manager/Configuration/AddFieldAction.js +52 -12
  151. package/lib/collection-manager/Configuration/CollectionFieldsTable.d.ts +15 -0
  152. package/lib/collection-manager/Configuration/CollectionFieldsTable.js +92 -0
  153. package/lib/collection-manager/Configuration/CollectionFieldsTableArray.d.ts +8 -0
  154. package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +273 -0
  155. package/lib/collection-manager/Configuration/ConfigurationTable.js +7 -2
  156. package/lib/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
  157. package/lib/collection-manager/Configuration/EditFieldAction.js +26 -10
  158. package/lib/collection-manager/Configuration/index.d.ts +3 -0
  159. package/lib/collection-manager/Configuration/index.js +39 -0
  160. package/lib/collection-manager/Configuration/schemas/collectionFields.js +4 -4
  161. package/lib/collection-manager/Configuration/schemas/collections.js +1 -1
  162. package/lib/collection-manager/index.d.ts +1 -0
  163. package/lib/collection-manager/index.js +14 -0
  164. package/lib/collection-manager/interfaces/index.d.ts +1 -0
  165. package/lib/collection-manager/interfaces/index.js +13 -0
  166. package/lib/collection-manager/interfaces/json.d.ts +2 -0
  167. package/lib/collection-manager/interfaces/json.js +58 -0
  168. package/lib/collection-manager/interfaces/m2o.js +2 -2
  169. package/lib/collection-manager/interfaces/o2m.js +4 -5
  170. package/lib/collection-manager/interfaces/o2o.js +4 -4
  171. package/lib/collection-manager/interfaces/properties/index.d.ts +14 -0
  172. package/lib/collection-manager/interfaces/properties/index.js +26 -2
  173. package/lib/collection-manager/interfaces/sequence.js +13 -9
  174. package/lib/index.d.ts +1 -0
  175. package/lib/index.js +13 -0
  176. package/lib/locale/en_US.d.ts +24 -1
  177. package/lib/locale/en_US.js +25 -2
  178. package/lib/locale/ja_JP.d.ts +2 -1
  179. package/lib/locale/ja_JP.js +2 -1
  180. package/lib/locale/ru_RU.d.ts +2 -1
  181. package/lib/locale/ru_RU.js +2 -1
  182. package/lib/locale/tr_TR.d.ts +1 -1
  183. package/lib/locale/tr_TR.js +1 -1
  184. package/lib/locale/zh_CN.d.ts +50 -1
  185. package/lib/locale/zh_CN.js +51 -2
  186. package/lib/plugin-manager/PluginManager.js +33 -21
  187. package/lib/pm/PluginManagerLink.d.ts +2 -0
  188. package/lib/pm/PluginManagerLink.js +139 -0
  189. package/lib/pm/index.d.ts +6 -0
  190. package/lib/pm/index.js +476 -0
  191. package/lib/route-switch/antd/admin-layout/index.js +1 -1
  192. package/lib/schema-component/antd/action/Action.Designer.js +35 -12
  193. package/lib/schema-component/antd/action/Action.Modal.js +4 -2
  194. package/lib/schema-component/antd/action/Action.js +3 -3
  195. package/lib/schema-component/antd/action/context.d.ts +2 -0
  196. package/lib/schema-component/antd/action/hooks.d.ts +1 -0
  197. package/lib/schema-component/antd/calendar/Calendar.Designer.js +19 -6
  198. package/lib/schema-component/antd/calendar/Calendar.js +139 -23
  199. package/lib/schema-component/antd/calendar/DeleteEvent.d.ts +3 -0
  200. package/lib/schema-component/antd/calendar/DeleteEvent.js +173 -0
  201. package/lib/schema-component/antd/calendar/Title.js +18 -2
  202. package/lib/schema-component/antd/calendar/components/Header.d.ts +10 -0
  203. package/lib/schema-component/antd/calendar/components/Header.js +57 -0
  204. package/lib/schema-component/antd/calendar/index.js +5 -0
  205. package/lib/schema-component/antd/calendar/style.less +53 -9
  206. package/lib/schema-component/antd/calendar/types.d.ts +6 -0
  207. package/lib/schema-component/antd/calendar/utils.d.ts +2 -0
  208. package/lib/schema-component/antd/calendar/utils.js +18 -2
  209. package/lib/schema-component/antd/checkbox/Checkbox.js +13 -4
  210. package/lib/schema-component/antd/formula-input/FormulaInput.js +28 -37
  211. package/lib/schema-component/antd/input/Input.d.ts +1 -0
  212. package/lib/schema-component/antd/input/Input.js +3 -0
  213. package/lib/schema-component/antd/input/Json.d.ts +6 -0
  214. package/lib/schema-component/antd/input/Json.js +53 -0
  215. package/lib/schema-component/antd/input/ReadPretty.d.ts +3 -0
  216. package/lib/schema-component/antd/input/ReadPretty.js +16 -0
  217. package/lib/schema-component/antd/input/index.d.ts +1 -0
  218. package/lib/schema-component/antd/input/index.js +13 -0
  219. package/lib/schema-component/antd/markdown/Markdown.Void.js +8 -2
  220. package/lib/schema-component/antd/radio/Radio.js +2 -1
  221. package/lib/schema-component/antd/select/ReadPretty.js +2 -1
  222. package/lib/schema-component/antd/select/Select.js +25 -1
  223. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +17 -2
  224. package/lib/schema-component/antd/upload/Upload.js +2 -1
  225. package/lib/schema-component/antd/upload/shared.js +4 -5
  226. package/lib/schema-component/antd/upload/type.d.ts +2 -0
  227. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
  228. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +66 -0
  229. package/lib/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +143 -0
  230. package/lib/schema-initializer/buttons/CalendarFormActionInitializers.js +153 -0
  231. package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
  232. package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +50 -0
  233. package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
  234. package/lib/schema-initializer/buttons/FormActionInitializers.js +121 -2
  235. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +2 -1
  236. package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
  237. package/lib/schema-initializer/buttons/TabPaneInitializers.js +18 -2
  238. package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
  239. package/lib/schema-initializer/buttons/TableActionInitializers.js +45 -0
  240. package/lib/schema-initializer/buttons/index.d.ts +3 -0
  241. package/lib/schema-initializer/buttons/index.js +39 -0
  242. package/lib/schema-initializer/components/BulkEditField.d.ts +7 -0
  243. package/lib/schema-initializer/components/BulkEditField.js +210 -0
  244. package/lib/schema-initializer/components/index.d.ts +1 -0
  245. package/lib/schema-initializer/components/index.js +13 -0
  246. package/lib/schema-initializer/items/BlockInitializer.js +8 -7
  247. package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
  248. package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.js +37 -0
  249. package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
  250. package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +121 -0
  251. package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
  252. package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +74 -0
  253. package/lib/schema-initializer/items/DeleteEventActionInitializer.d.ts +1 -0
  254. package/lib/schema-initializer/items/DeleteEventActionInitializer.js +40 -0
  255. package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +1 -1
  256. package/lib/schema-initializer/items/index.d.ts +4 -0
  257. package/lib/schema-initializer/items/index.js +52 -0
  258. package/lib/schema-initializer/utils.d.ts +1 -0
  259. package/lib/schema-initializer/utils.js +78 -16
  260. package/lib/schema-settings/SchemaSettings.d.ts +6 -0
  261. package/lib/schema-settings/SchemaSettings.js +3 -0
  262. package/lib/schema-templates/BlockTemplatePage.d.ts +1 -0
  263. package/lib/schema-templates/BlockTemplatePage.js +12 -2
  264. package/lib/schema-templates/SchemaTemplateShortcut.js +1 -1
  265. package/lib/system-settings/SystemSettingsShortcut.d.ts +2 -0
  266. package/lib/system-settings/SystemSettingsShortcut.js +145 -7
  267. package/package.json +6 -4
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useUpdateActionProps = exports.useRefreshActionProps = exports.usePickActionProps = exports.useDetailsPaginationProps = exports.useDetailPrintActionProps = exports.useDestroyActionProps = exports.useCustomizeUpdateActionProps = exports.useCustomizeRequestActionProps = exports.useCreateActionProps = exports.useBulkDestroyActionProps = void 0;
6
+ exports.useUpdateActionProps = exports.useRefreshActionProps = exports.usePickActionProps = exports.useDetailsPaginationProps = exports.useDetailPrintActionProps = exports.useDestroyActionProps = exports.useCustomizeUpdateActionProps = exports.useCustomizeRequestActionProps = exports.useCustomizeBulkUpdateActionProps = exports.useCustomizeBulkEditActionProps = exports.useCreateActionProps = exports.useBulkDestroyActionProps = void 0;
7
7
 
8
8
  var _react = require("@formily/react");
9
9
 
@@ -11,6 +11,8 @@ var _antd = require("antd");
11
11
 
12
12
  var _jsonTemplates = _interopRequireDefault(require("json-templates"));
13
13
 
14
+ var _lodash = require("lodash");
15
+
14
16
  var _get = _interopRequireDefault(require("lodash/get"));
15
17
 
16
18
  var _reactI18next = require("react-i18next");
@@ -29,6 +31,8 @@ var _recordProvider = require("../../record-provider");
29
31
 
30
32
  var _schemaComponent = require("../../schema-component");
31
33
 
34
+ var _components = require("../../schema-initializer/components");
35
+
32
36
  var _user = require("../../user");
33
37
 
34
38
  var _BlockProvider = require("../BlockProvider");
@@ -425,8 +429,385 @@ var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
425
429
 
426
430
  exports.useCustomizeUpdateActionProps = useCustomizeUpdateActionProps;
427
431
 
432
+ var useCustomizeBulkUpdateActionProps = function useCustomizeBulkUpdateActionProps() {
433
+ var _tableBlockContext$fi, _tableBlockContext$fi2, _currentUserContext$d3;
434
+
435
+ var _useBlockRequestConte3 = (0, _BlockProvider.useBlockRequestContext)(),
436
+ field = _useBlockRequestConte3.field,
437
+ resource = _useBlockRequestConte3.resource,
438
+ __parent = _useBlockRequestConte3.__parent,
439
+ service = _useBlockRequestConte3.service;
440
+
441
+ var actionSchema = (0, _react.useFieldSchema)();
442
+ var currentRecord = (0, _recordProvider.useRecord)();
443
+ var tableBlockContext = (0, _2.useTableBlockContext)();
444
+ var rowKey = tableBlockContext.rowKey;
445
+
446
+ var _ref3 = (_tableBlockContext$fi = (_tableBlockContext$fi2 = tableBlockContext.field) === null || _tableBlockContext$fi2 === void 0 ? void 0 : _tableBlockContext$fi2.data) !== null && _tableBlockContext$fi !== void 0 ? _tableBlockContext$fi : {},
447
+ selectedRowKeys = _ref3.selectedRowKeys;
448
+
449
+ var currentUserContext = (0, _user.useCurrentUserContext)();
450
+ var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d3 = currentUserContext.data) === null || _currentUserContext$d3 === void 0 ? void 0 : _currentUserContext$d3.data;
451
+ var history = (0, _reactRouterDom.useHistory)();
452
+ var compile = (0, _schemaComponent.useCompile)();
453
+
454
+ var _useTranslation2 = (0, _reactI18next.useTranslation)(),
455
+ t = _useTranslation2.t;
456
+
457
+ var actionField = (0, _react.useField)();
458
+ return {
459
+ onClick: function onClick() {
460
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
461
+ var _actionSchema$xActio3;
462
+
463
+ var _ref4, _ref4$assignedValues, originalAssignedValues, onSuccess, updateMode, assignedValues;
464
+
465
+ return regeneratorRuntime.wrap(function _callee8$(_context8) {
466
+ while (1) {
467
+ switch (_context8.prev = _context8.next) {
468
+ case 0:
469
+ _ref4 = (_actionSchema$xActio3 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio3 !== void 0 ? _actionSchema$xActio3 : {}, _ref4$assignedValues = _ref4.assignedValues, originalAssignedValues = _ref4$assignedValues === void 0 ? {} : _ref4$assignedValues, onSuccess = _ref4.onSuccess, updateMode = _ref4.updateMode;
470
+ actionField.data = field.data || {};
471
+ actionField.data.loading = true;
472
+ assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
473
+ currentTime: new Date(),
474
+ currentUser: currentUser
475
+ });
476
+
477
+ _antd.Modal.confirm({
478
+ title: t('Bulk update'),
479
+ content: updateMode === 'selected' ? t('Update selected data?') : t('Update all data?'),
480
+ onOk: function onOk() {
481
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
482
+ var _service$params$, _service$params, _service$refresh2;
483
+
484
+ var _ref5, filter, updateData, _parent$service3, _parent$service3$refr;
485
+
486
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
487
+ while (1) {
488
+ switch (_context6.prev = _context6.next) {
489
+ case 0:
490
+ _ref5 = (_service$params$ = (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params[0]) !== null && _service$params$ !== void 0 ? _service$params$ : {}, filter = _ref5.filter;
491
+ updateData = {
492
+ values: _objectSpread({}, assignedValues),
493
+ filter: filter,
494
+ forceUpdate: false
495
+ };
496
+
497
+ if (!(updateMode === 'selected')) {
498
+ _context6.next = 8;
499
+ break;
500
+ }
501
+
502
+ if (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) {
503
+ _context6.next = 7;
504
+ break;
505
+ }
506
+
507
+ _antd.message.error(t('Please select the records to be updated'));
508
+
509
+ actionField.data.loading = false;
510
+ return _context6.abrupt("return");
511
+
512
+ case 7:
513
+ updateData.filter = {
514
+ $and: [_defineProperty({}, rowKey || 'id', {
515
+ $in: selectedRowKeys
516
+ })]
517
+ };
518
+
519
+ case 8:
520
+ if (!updateData.filter) {
521
+ updateData.forceUpdate = true;
522
+ }
523
+
524
+ _context6.prev = 9;
525
+ _context6.next = 12;
526
+ return resource.update(updateData);
527
+
528
+ case 12:
529
+ _context6.next = 16;
530
+ break;
531
+
532
+ case 14:
533
+ _context6.prev = 14;
534
+ _context6.t0 = _context6["catch"](9);
535
+
536
+ case 16:
537
+ _context6.prev = 16;
538
+ actionField.data.loading = false;
539
+ return _context6.finish(16);
540
+
541
+ case 19:
542
+ service === null || service === void 0 ? void 0 : (_service$refresh2 = service.refresh) === null || _service$refresh2 === void 0 ? void 0 : _service$refresh2.call(service);
543
+
544
+ if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
545
+ __parent === null || __parent === void 0 ? void 0 : (_parent$service3 = __parent.service) === null || _parent$service3 === void 0 ? void 0 : (_parent$service3$refr = _parent$service3.refresh) === null || _parent$service3$refr === void 0 ? void 0 : _parent$service3$refr.call(_parent$service3);
546
+ }
547
+
548
+ if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
549
+ _context6.next = 23;
550
+ break;
551
+ }
552
+
553
+ return _context6.abrupt("return");
554
+
555
+ case 23:
556
+ if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
557
+ _antd.Modal.success({
558
+ title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
559
+ onOk: function () {
560
+ var _onOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
561
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
562
+ while (1) {
563
+ switch (_context5.prev = _context5.next) {
564
+ case 0:
565
+ if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
566
+ if (isURL(onSuccess.redirectTo)) {
567
+ window.location.href = onSuccess.redirectTo;
568
+ } else {
569
+ history.push(onSuccess.redirectTo);
570
+ }
571
+ }
572
+
573
+ case 1:
574
+ case "end":
575
+ return _context5.stop();
576
+ }
577
+ }
578
+ }, _callee5);
579
+ }));
580
+
581
+ function onOk() {
582
+ return _onOk3.apply(this, arguments);
583
+ }
584
+
585
+ return onOk;
586
+ }()
587
+ });
588
+ } else {
589
+ _antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
590
+ }
591
+
592
+ case 24:
593
+ case "end":
594
+ return _context6.stop();
595
+ }
596
+ }
597
+ }, _callee6, null, [[9, 14, 16, 19]]);
598
+ }))();
599
+ },
600
+ onCancel: function onCancel() {
601
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
602
+ return regeneratorRuntime.wrap(function _callee7$(_context7) {
603
+ while (1) {
604
+ switch (_context7.prev = _context7.next) {
605
+ case 0:
606
+ actionField.data.loading = false;
607
+
608
+ case 1:
609
+ case "end":
610
+ return _context7.stop();
611
+ }
612
+ }
613
+ }, _callee7);
614
+ }))();
615
+ }
616
+ });
617
+
618
+ case 5:
619
+ case "end":
620
+ return _context8.stop();
621
+ }
622
+ }
623
+ }, _callee8);
624
+ }))();
625
+ }
626
+ };
627
+ };
628
+
629
+ exports.useCustomizeBulkUpdateActionProps = useCustomizeBulkUpdateActionProps;
630
+
631
+ var useCustomizeBulkEditActionProps = function useCustomizeBulkEditActionProps() {
632
+ var _tableBlockContext$fi3, _tableBlockContext$fi4;
633
+
634
+ var form = (0, _react.useForm)();
635
+
636
+ var _useTranslation3 = (0, _reactI18next.useTranslation)(),
637
+ t = _useTranslation3.t;
638
+
639
+ var _useBlockRequestConte4 = (0, _BlockProvider.useBlockRequestContext)(),
640
+ field = _useBlockRequestConte4.field,
641
+ resource = _useBlockRequestConte4.resource,
642
+ __parent = _useBlockRequestConte4.__parent;
643
+
644
+ var actionContext = (0, _schemaComponent.useActionContext)();
645
+ var history = (0, _reactRouterDom.useHistory)();
646
+ var compile = (0, _schemaComponent.useCompile)();
647
+ var actionField = (0, _react.useField)();
648
+ var tableBlockContext = (0, _2.useTableBlockContext)();
649
+ var rowKey = tableBlockContext.rowKey;
650
+
651
+ var _ref7 = (_tableBlockContext$fi3 = (_tableBlockContext$fi4 = tableBlockContext.field) === null || _tableBlockContext$fi4 === void 0 ? void 0 : _tableBlockContext$fi4.data) !== null && _tableBlockContext$fi3 !== void 0 ? _tableBlockContext$fi3 : {},
652
+ selectedRowKeys = _ref7.selectedRowKeys;
653
+
654
+ var setVisible = actionContext.setVisible,
655
+ actionSchema = actionContext.fieldSchema;
656
+ return {
657
+ onClick: function onClick() {
658
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
659
+ var _actionSchema$xActio4, _parent$service$para, _parent$service$para2;
660
+
661
+ var _ref8, onSuccess, skipValidator, updateMode, _ref9, filter, values, key, value, _parent$service4, _parent$service4$refr, updateData, _parent$__parent, _parent$__parent$serv, _parent$__parent$serv2;
662
+
663
+ return regeneratorRuntime.wrap(function _callee10$(_context10) {
664
+ while (1) {
665
+ switch (_context10.prev = _context10.next) {
666
+ case 0:
667
+ _ref8 = (_actionSchema$xActio4 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio4 !== void 0 ? _actionSchema$xActio4 : {}, onSuccess = _ref8.onSuccess, skipValidator = _ref8.skipValidator, updateMode = _ref8.updateMode;
668
+ _ref9 = (_parent$service$para = (_parent$service$para2 = __parent.service.params) === null || _parent$service$para2 === void 0 ? void 0 : _parent$service$para2[0]) !== null && _parent$service$para !== void 0 ? _parent$service$para : {}, filter = _ref9.filter;
669
+
670
+ if (skipValidator) {
671
+ _context10.next = 5;
672
+ break;
673
+ }
674
+
675
+ _context10.next = 5;
676
+ return form.submit();
677
+
678
+ case 5:
679
+ values = (0, _lodash.cloneDeep)(form.values);
680
+ actionField.data = field.data || {};
681
+ actionField.data.loading = true;
682
+
683
+ for (key in values) {
684
+ if (Object.prototype.hasOwnProperty.call(values, key)) {
685
+ value = values[key];
686
+
687
+ if (_components.BulkEditFormItemValueType.Clear in value) {
688
+ values[key] = null;
689
+ } else if (_components.BulkEditFormItemValueType.ChangedTo in value) {
690
+ values[key] = value[_components.BulkEditFormItemValueType.ChangedTo];
691
+ } else if (_components.BulkEditFormItemValueType.RemainsTheSame in value) {
692
+ delete values[key];
693
+ }
694
+ }
695
+ }
696
+
697
+ _context10.prev = 9;
698
+ updateData = {
699
+ values: values,
700
+ filter: filter,
701
+ forceUpdate: false
702
+ };
703
+
704
+ if (!(updateMode === 'selected')) {
705
+ _context10.next = 16;
706
+ break;
707
+ }
708
+
709
+ if (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) {
710
+ _context10.next = 15;
711
+ break;
712
+ }
713
+
714
+ _antd.message.error(t('Please select the records to be updated'));
715
+
716
+ return _context10.abrupt("return");
717
+
718
+ case 15:
719
+ updateData.filter = {
720
+ $and: [_defineProperty({}, rowKey || 'id', {
721
+ $in: selectedRowKeys
722
+ })]
723
+ };
724
+
725
+ case 16:
726
+ if (!updateData.filter) {
727
+ updateData.forceUpdate = true;
728
+ }
729
+
730
+ _context10.next = 19;
731
+ return resource.update(updateData);
732
+
733
+ case 19:
734
+ actionField.data.loading = false;
735
+
736
+ if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
737
+ __parent === null || __parent === void 0 ? void 0 : (_parent$__parent = __parent.__parent) === null || _parent$__parent === void 0 ? void 0 : (_parent$__parent$serv = _parent$__parent.service) === null || _parent$__parent$serv === void 0 ? void 0 : (_parent$__parent$serv2 = _parent$__parent$serv.refresh) === null || _parent$__parent$serv2 === void 0 ? void 0 : _parent$__parent$serv2.call(_parent$__parent$serv);
738
+ }
739
+
740
+ __parent === null || __parent === void 0 ? void 0 : (_parent$service4 = __parent.service) === null || _parent$service4 === void 0 ? void 0 : (_parent$service4$refr = _parent$service4.refresh) === null || _parent$service4$refr === void 0 ? void 0 : _parent$service4$refr.call(_parent$service4);
741
+ setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
742
+
743
+ if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
744
+ _context10.next = 25;
745
+ break;
746
+ }
747
+
748
+ return _context10.abrupt("return");
749
+
750
+ case 25:
751
+ if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
752
+ _antd.Modal.success({
753
+ title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
754
+ onOk: function () {
755
+ var _onOk4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
756
+ return regeneratorRuntime.wrap(function _callee9$(_context9) {
757
+ while (1) {
758
+ switch (_context9.prev = _context9.next) {
759
+ case 0:
760
+ _context9.next = 2;
761
+ return form.reset();
762
+
763
+ case 2:
764
+ if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
765
+ if (isURL(onSuccess.redirectTo)) {
766
+ window.location.href = onSuccess.redirectTo;
767
+ } else {
768
+ history.push(onSuccess.redirectTo);
769
+ }
770
+ }
771
+
772
+ case 3:
773
+ case "end":
774
+ return _context9.stop();
775
+ }
776
+ }
777
+ }, _callee9);
778
+ }));
779
+
780
+ function onOk() {
781
+ return _onOk4.apply(this, arguments);
782
+ }
783
+
784
+ return onOk;
785
+ }()
786
+ });
787
+ } else {
788
+ _antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
789
+ }
790
+
791
+ case 26:
792
+ _context10.prev = 26;
793
+ actionField.data.loading = false;
794
+ return _context10.finish(26);
795
+
796
+ case 29:
797
+ case "end":
798
+ return _context10.stop();
799
+ }
800
+ }
801
+ }, _callee10, null, [[9,, 26, 29]]);
802
+ }))();
803
+ }
804
+ };
805
+ };
806
+
807
+ exports.useCustomizeBulkEditActionProps = useCustomizeBulkEditActionProps;
808
+
428
809
  var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
429
- var _currentUserContext$d3;
810
+ var _currentUserContext$d4;
430
811
 
431
812
  var apiClient = (0, _apiClient.useAPIClient)();
432
813
  var history = (0, _reactRouterDom.useHistory)();
@@ -439,15 +820,15 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
439
820
  fields = _useCollection2.fields,
440
821
  getField = _useCollection2.getField;
441
822
 
442
- var _useBlockRequestConte3 = (0, _BlockProvider.useBlockRequestContext)(),
443
- field = _useBlockRequestConte3.field,
444
- resource = _useBlockRequestConte3.resource,
445
- __parent = _useBlockRequestConte3.__parent,
446
- service = _useBlockRequestConte3.service;
823
+ var _useBlockRequestConte5 = (0, _BlockProvider.useBlockRequestContext)(),
824
+ field = _useBlockRequestConte5.field,
825
+ resource = _useBlockRequestConte5.resource,
826
+ __parent = _useBlockRequestConte5.__parent,
827
+ service = _useBlockRequestConte5.service;
447
828
 
448
829
  var currentRecord = (0, _recordProvider.useRecord)();
449
830
  var currentUserContext = (0, _user.useCurrentUserContext)();
450
- var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d3 = currentUserContext.data) === null || _currentUserContext$d3 === void 0 ? void 0 : _currentUserContext$d3.data;
831
+ var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d4 = currentUserContext.data) === null || _currentUserContext$d4 === void 0 ? void 0 : _currentUserContext$d4.data;
451
832
  var actionField = (0, _react.useField)();
452
833
 
453
834
  var _useActionContext2 = (0, _schemaComponent.useActionContext)(),
@@ -456,32 +837,32 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
456
837
 
457
838
  return {
458
839
  onClick: function onClick() {
459
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
460
- var _actionSchema$xActio3;
840
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
841
+ var _actionSchema$xActio5;
461
842
 
462
- var _ref3, skipValidator, onSuccess, requestSettings, xAction, headers, params, data, methods, fieldNames, values, requestBody, _service$refresh2, _parent$service3, _parent$service3$refr;
843
+ var _ref11, skipValidator, onSuccess, requestSettings, xAction, headers, params, data, methods, fieldNames, values, requestBody, _service$refresh3, _parent$service5, _parent$service5$refr;
463
844
 
464
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
845
+ return regeneratorRuntime.wrap(function _callee12$(_context12) {
465
846
  while (1) {
466
- switch (_context6.prev = _context6.next) {
847
+ switch (_context12.prev = _context12.next) {
467
848
  case 0:
468
- _ref3 = (_actionSchema$xActio3 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio3 !== void 0 ? _actionSchema$xActio3 : {}, skipValidator = _ref3.skipValidator, onSuccess = _ref3.onSuccess, requestSettings = _ref3.requestSettings;
849
+ _ref11 = (_actionSchema$xActio5 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio5 !== void 0 ? _actionSchema$xActio5 : {}, skipValidator = _ref11.skipValidator, onSuccess = _ref11.onSuccess, requestSettings = _ref11.requestSettings;
469
850
  xAction = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action'];
470
851
 
471
852
  if (requestSettings['url']) {
472
- _context6.next = 4;
853
+ _context12.next = 4;
473
854
  break;
474
855
  }
475
856
 
476
- return _context6.abrupt("return");
857
+ return _context12.abrupt("return");
477
858
 
478
859
  case 4:
479
860
  if (!(skipValidator !== true && xAction === 'customize:form:request')) {
480
- _context6.next = 7;
861
+ _context12.next = 7;
481
862
  break;
482
863
  }
483
864
 
484
- _context6.next = 7;
865
+ _context12.next = 7;
485
866
  return form.submit();
486
867
 
487
868
  case 7:
@@ -519,39 +900,39 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
519
900
  };
520
901
  actionField.data = field.data || {};
521
902
  actionField.data.loading = true;
522
- _context6.prev = 15;
523
- _context6.next = 18;
903
+ _context12.prev = 15;
904
+ _context12.next = 18;
524
905
  return apiClient.request(_objectSpread({}, requestBody));
525
906
 
526
907
  case 18:
527
908
  actionField.data.loading = false;
528
909
 
529
910
  if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
530
- __parent === null || __parent === void 0 ? void 0 : (_parent$service3 = __parent.service) === null || _parent$service3 === void 0 ? void 0 : (_parent$service3$refr = _parent$service3.refresh) === null || _parent$service3$refr === void 0 ? void 0 : _parent$service3$refr.call(_parent$service3);
911
+ __parent === null || __parent === void 0 ? void 0 : (_parent$service5 = __parent.service) === null || _parent$service5 === void 0 ? void 0 : (_parent$service5$refr = _parent$service5.refresh) === null || _parent$service5$refr === void 0 ? void 0 : _parent$service5$refr.call(_parent$service5);
531
912
  }
532
913
 
533
- service === null || service === void 0 ? void 0 : (_service$refresh2 = service.refresh) === null || _service$refresh2 === void 0 ? void 0 : _service$refresh2.call(service);
914
+ service === null || service === void 0 ? void 0 : (_service$refresh3 = service.refresh) === null || _service$refresh3 === void 0 ? void 0 : _service$refresh3.call(service);
534
915
 
535
916
  if (xAction === 'customize:form:request') {
536
917
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
537
918
  }
538
919
 
539
920
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
540
- _context6.next = 24;
921
+ _context12.next = 24;
541
922
  break;
542
923
  }
543
924
 
544
- return _context6.abrupt("return");
925
+ return _context12.abrupt("return");
545
926
 
546
927
  case 24:
547
928
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
548
929
  _antd.Modal.success({
549
930
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
550
931
  onOk: function () {
551
- var _onOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
552
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
932
+ var _onOk5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
933
+ return regeneratorRuntime.wrap(function _callee11$(_context11) {
553
934
  while (1) {
554
- switch (_context5.prev = _context5.next) {
935
+ switch (_context11.prev = _context11.next) {
555
936
  case 0:
556
937
  if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
557
938
  if (isURL(onSuccess.redirectTo)) {
@@ -563,14 +944,14 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
563
944
 
564
945
  case 1:
565
946
  case "end":
566
- return _context5.stop();
947
+ return _context11.stop();
567
948
  }
568
949
  }
569
- }, _callee5);
950
+ }, _callee11);
570
951
  }));
571
952
 
572
953
  function onOk() {
573
- return _onOk3.apply(this, arguments);
954
+ return _onOk5.apply(this, arguments);
574
955
  }
575
956
 
576
957
  return onOk;
@@ -581,16 +962,16 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
581
962
  }
582
963
 
583
964
  case 25:
584
- _context6.prev = 25;
965
+ _context12.prev = 25;
585
966
  actionField.data.loading = false;
586
- return _context6.finish(25);
967
+ return _context12.finish(25);
587
968
 
588
969
  case 28:
589
970
  case "end":
590
- return _context6.stop();
971
+ return _context12.stop();
591
972
  }
592
973
  }
593
- }, _callee6, null, [[15,, 25, 28]]);
974
+ }, _callee12, null, [[15,, 25, 28]]);
594
975
  }))();
595
976
  }
596
977
  };
@@ -599,15 +980,15 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
599
980
  exports.useCustomizeRequestActionProps = useCustomizeRequestActionProps;
600
981
 
601
982
  var useUpdateActionProps = function useUpdateActionProps() {
602
- var _currentUserContext$d4;
983
+ var _currentUserContext$d5;
603
984
 
604
985
  var form = (0, _react.useForm)();
605
986
  var filterByTk = (0, _BlockProvider.useFilterByTk)();
606
987
 
607
- var _useBlockRequestConte4 = (0, _BlockProvider.useBlockRequestContext)(),
608
- field = _useBlockRequestConte4.field,
609
- resource = _useBlockRequestConte4.resource,
610
- __parent = _useBlockRequestConte4.__parent;
988
+ var _useBlockRequestConte6 = (0, _BlockProvider.useBlockRequestContext)(),
989
+ field = _useBlockRequestConte6.field,
990
+ resource = _useBlockRequestConte6.resource,
991
+ __parent = _useBlockRequestConte6.__parent;
611
992
 
612
993
  var _useActionContext3 = (0, _schemaComponent.useActionContext)(),
613
994
  setVisible = _useActionContext3.setVisible;
@@ -627,19 +1008,19 @@ var useUpdateActionProps = function useUpdateActionProps() {
627
1008
 
628
1009
  var currentRecord = (0, _recordProvider.useRecord)();
629
1010
  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;
1011
+ var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d5 = currentUserContext.data) === null || _currentUserContext$d5 === void 0 ? void 0 : _currentUserContext$d5.data;
631
1012
  return {
632
1013
  onClick: function onClick() {
633
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
634
- var _actionSchema$xActio4;
1014
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14() {
1015
+ var _actionSchema$xActio6;
635
1016
 
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;
1017
+ var _ref12, _ref12$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, assignedValues, fieldNames, values, _parent$service6, _parent$service6$refr, _parent$__parent2, _parent$__parent2$ser, _parent$__parent2$ser2;
637
1018
 
638
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
1019
+ return regeneratorRuntime.wrap(function _callee14$(_context14) {
639
1020
  while (1) {
640
- switch (_context8.prev = _context8.next) {
1021
+ switch (_context14.prev = _context14.next) {
641
1022
  case 0:
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;
1023
+ _ref12 = (_actionSchema$xActio6 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio6 !== void 0 ? _actionSchema$xActio6 : {}, _ref12$assignedValues = _ref12.assignedValues, originalAssignedValues = _ref12$assignedValues === void 0 ? {} : _ref12$assignedValues, onSuccess = _ref12.onSuccess, overwriteValues = _ref12.overwriteValues, skipValidator = _ref12.skipValidator;
643
1024
  assignedValues = (0, _jsonTemplates.default)(originalAssignedValues)({
644
1025
  currentTime: new Date(),
645
1026
  currentRecord: currentRecord,
@@ -647,11 +1028,11 @@ var useUpdateActionProps = function useUpdateActionProps() {
647
1028
  });
648
1029
 
649
1030
  if (skipValidator) {
650
- _context8.next = 5;
1031
+ _context14.next = 5;
651
1032
  break;
652
1033
  }
653
1034
 
654
- _context8.next = 5;
1035
+ _context14.next = 5;
655
1036
  return form.submit();
656
1037
 
657
1038
  case 5:
@@ -661,8 +1042,8 @@ var useUpdateActionProps = function useUpdateActionProps() {
661
1042
  values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
662
1043
  actionField.data = field.data || {};
663
1044
  actionField.data.loading = true;
664
- _context8.prev = 9;
665
- _context8.next = 12;
1045
+ _context14.prev = 9;
1046
+ _context14.next = 12;
666
1047
  return resource.update({
667
1048
  filterByTk: filterByTk,
668
1049
  values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues),
@@ -673,30 +1054,30 @@ var useUpdateActionProps = function useUpdateActionProps() {
673
1054
  actionField.data.loading = false;
674
1055
 
675
1056
  if (!(resource instanceof _TableFieldProvider.TableFieldResource)) {
676
- __parent === null || __parent === void 0 ? void 0 : (_parent$__parent = __parent.__parent) === null || _parent$__parent === void 0 ? void 0 : (_parent$__parent$serv = _parent$__parent.service) === null || _parent$__parent$serv === void 0 ? void 0 : (_parent$__parent$serv2 = _parent$__parent$serv.refresh) === null || _parent$__parent$serv2 === void 0 ? void 0 : _parent$__parent$serv2.call(_parent$__parent$serv);
1057
+ __parent === null || __parent === void 0 ? void 0 : (_parent$__parent2 = __parent.__parent) === null || _parent$__parent2 === void 0 ? void 0 : (_parent$__parent2$ser = _parent$__parent2.service) === null || _parent$__parent2$ser === void 0 ? void 0 : (_parent$__parent2$ser2 = _parent$__parent2$ser.refresh) === null || _parent$__parent2$ser2 === void 0 ? void 0 : _parent$__parent2$ser2.call(_parent$__parent2$ser);
677
1058
  }
678
1059
 
679
- __parent === null || __parent === void 0 ? void 0 : (_parent$service4 = __parent.service) === null || _parent$service4 === void 0 ? void 0 : (_parent$service4$refr = _parent$service4.refresh) === null || _parent$service4$refr === void 0 ? void 0 : _parent$service4$refr.call(_parent$service4);
1060
+ __parent === null || __parent === void 0 ? void 0 : (_parent$service6 = __parent.service) === null || _parent$service6 === void 0 ? void 0 : (_parent$service6$refr = _parent$service6.refresh) === null || _parent$service6$refr === void 0 ? void 0 : _parent$service6$refr.call(_parent$service6);
680
1061
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
681
1062
 
682
1063
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
683
- _context8.next = 18;
1064
+ _context14.next = 18;
684
1065
  break;
685
1066
  }
686
1067
 
687
- return _context8.abrupt("return");
1068
+ return _context14.abrupt("return");
688
1069
 
689
1070
  case 18:
690
1071
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
691
1072
  _antd.Modal.success({
692
1073
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
693
1074
  onOk: function () {
694
- var _onOk4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
695
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
1075
+ var _onOk6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
1076
+ return regeneratorRuntime.wrap(function _callee13$(_context13) {
696
1077
  while (1) {
697
- switch (_context7.prev = _context7.next) {
1078
+ switch (_context13.prev = _context13.next) {
698
1079
  case 0:
699
- _context7.next = 2;
1080
+ _context13.next = 2;
700
1081
  return form.reset();
701
1082
 
702
1083
  case 2:
@@ -710,14 +1091,14 @@ var useUpdateActionProps = function useUpdateActionProps() {
710
1091
 
711
1092
  case 3:
712
1093
  case "end":
713
- return _context7.stop();
1094
+ return _context13.stop();
714
1095
  }
715
1096
  }
716
- }, _callee7);
1097
+ }, _callee13);
717
1098
  }));
718
1099
 
719
1100
  function onOk() {
720
- return _onOk4.apply(this, arguments);
1101
+ return _onOk6.apply(this, arguments);
721
1102
  }
722
1103
 
723
1104
  return onOk;
@@ -727,20 +1108,20 @@ var useUpdateActionProps = function useUpdateActionProps() {
727
1108
  _antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
728
1109
  }
729
1110
 
730
- _context8.next = 24;
1111
+ _context14.next = 24;
731
1112
  break;
732
1113
 
733
1114
  case 21:
734
- _context8.prev = 21;
735
- _context8.t0 = _context8["catch"](9);
1115
+ _context14.prev = 21;
1116
+ _context14.t0 = _context14["catch"](9);
736
1117
  actionField.data.loading = false;
737
1118
 
738
1119
  case 24:
739
1120
  case "end":
740
- return _context8.stop();
1121
+ return _context14.stop();
741
1122
  }
742
1123
  }
743
- }, _callee8, null, [[9, 21]]);
1124
+ }, _callee14, null, [[9, 21]]);
744
1125
  }))();
745
1126
  }
746
1127
  };
@@ -751,45 +1132,45 @@ exports.useUpdateActionProps = useUpdateActionProps;
751
1132
  var useDestroyActionProps = function useDestroyActionProps() {
752
1133
  var filterByTk = (0, _BlockProvider.useFilterByTk)();
753
1134
 
754
- var _useBlockRequestConte5 = (0, _BlockProvider.useBlockRequestContext)(),
755
- resource = _useBlockRequestConte5.resource,
756
- service = _useBlockRequestConte5.service,
757
- block = _useBlockRequestConte5.block,
758
- __parent = _useBlockRequestConte5.__parent;
1135
+ var _useBlockRequestConte7 = (0, _BlockProvider.useBlockRequestContext)(),
1136
+ resource = _useBlockRequestConte7.resource,
1137
+ service = _useBlockRequestConte7.service,
1138
+ block = _useBlockRequestConte7.block,
1139
+ __parent = _useBlockRequestConte7.__parent;
759
1140
 
760
1141
  var _useActionContext4 = (0, _schemaComponent.useActionContext)(),
761
1142
  setVisible = _useActionContext4.setVisible;
762
1143
 
763
1144
  return {
764
1145
  onClick: function onClick() {
765
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
766
- var _service$refresh3;
1146
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15() {
1147
+ var _service$refresh4;
767
1148
 
768
- var _parent$service5, _parent$service5$refr;
1149
+ var _parent$service7, _parent$service7$refr;
769
1150
 
770
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
1151
+ return regeneratorRuntime.wrap(function _callee15$(_context15) {
771
1152
  while (1) {
772
- switch (_context9.prev = _context9.next) {
1153
+ switch (_context15.prev = _context15.next) {
773
1154
  case 0:
774
- _context9.next = 2;
1155
+ _context15.next = 2;
775
1156
  return resource.destroy({
776
1157
  filterByTk: filterByTk
777
1158
  });
778
1159
 
779
1160
  case 2:
780
- service === null || service === void 0 ? void 0 : (_service$refresh3 = service.refresh) === null || _service$refresh3 === void 0 ? void 0 : _service$refresh3.call(service);
1161
+ service === null || service === void 0 ? void 0 : (_service$refresh4 = service.refresh) === null || _service$refresh4 === void 0 ? void 0 : _service$refresh4.call(service);
781
1162
 
782
1163
  if (block !== 'TableField') {
783
- __parent === null || __parent === void 0 ? void 0 : (_parent$service5 = __parent.service) === null || _parent$service5 === void 0 ? void 0 : (_parent$service5$refr = _parent$service5.refresh) === null || _parent$service5$refr === void 0 ? void 0 : _parent$service5$refr.call(_parent$service5);
1164
+ __parent === null || __parent === void 0 ? void 0 : (_parent$service7 = __parent.service) === null || _parent$service7 === void 0 ? void 0 : (_parent$service7$refr = _parent$service7.refresh) === null || _parent$service7$refr === void 0 ? void 0 : _parent$service7$refr.call(_parent$service7);
784
1165
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
785
1166
  }
786
1167
 
787
1168
  case 4:
788
1169
  case "end":
789
- return _context9.stop();
1170
+ return _context15.stop();
790
1171
  }
791
1172
  }
792
- }, _callee9);
1173
+ }, _callee15);
793
1174
  }))();
794
1175
  }
795
1176
  };
@@ -809,19 +1190,19 @@ var useDetailPrintActionProps = function useDetailPrintActionProps() {
809
1190
  });
810
1191
  return {
811
1192
  onClick: function onClick() {
812
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
813
- return regeneratorRuntime.wrap(function _callee10$(_context10) {
1193
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16() {
1194
+ return regeneratorRuntime.wrap(function _callee16$(_context16) {
814
1195
  while (1) {
815
- switch (_context10.prev = _context10.next) {
1196
+ switch (_context16.prev = _context16.next) {
816
1197
  case 0:
817
1198
  printHandler();
818
1199
 
819
1200
  case 1:
820
1201
  case "end":
821
- return _context10.stop();
1202
+ return _context16.stop();
822
1203
  }
823
1204
  }
824
- }, _callee10);
1205
+ }, _callee16);
825
1206
  }))();
826
1207
  }
827
1208
  };
@@ -830,45 +1211,45 @@ var useDetailPrintActionProps = function useDetailPrintActionProps() {
830
1211
  exports.useDetailPrintActionProps = useDetailPrintActionProps;
831
1212
 
832
1213
  var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
833
- var _useBlockRequestConte6 = (0, _BlockProvider.useBlockRequestContext)(),
834
- field = _useBlockRequestConte6.field;
1214
+ var _useBlockRequestConte8 = (0, _BlockProvider.useBlockRequestContext)(),
1215
+ field = _useBlockRequestConte8.field;
835
1216
 
836
- var _useBlockRequestConte7 = (0, _BlockProvider.useBlockRequestContext)(),
837
- resource = _useBlockRequestConte7.resource,
838
- service = _useBlockRequestConte7.service;
1217
+ var _useBlockRequestConte9 = (0, _BlockProvider.useBlockRequestContext)(),
1218
+ resource = _useBlockRequestConte9.resource,
1219
+ service = _useBlockRequestConte9.service;
839
1220
 
840
1221
  return {
841
1222
  onClick: function onClick() {
842
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
843
- var _field$data, _field$data$selectedR, _field$data2, _service$refresh4;
1223
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17() {
1224
+ var _field$data, _field$data$selectedR, _field$data2, _service$refresh5;
844
1225
 
845
- return regeneratorRuntime.wrap(function _callee11$(_context11) {
1226
+ return regeneratorRuntime.wrap(function _callee17$(_context17) {
846
1227
  while (1) {
847
- switch (_context11.prev = _context11.next) {
1228
+ switch (_context17.prev = _context17.next) {
848
1229
  case 0:
849
1230
  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) {
850
- _context11.next = 2;
1231
+ _context17.next = 2;
851
1232
  break;
852
1233
  }
853
1234
 
854
- return _context11.abrupt("return");
1235
+ return _context17.abrupt("return");
855
1236
 
856
1237
  case 2:
857
- _context11.next = 4;
1238
+ _context17.next = 4;
858
1239
  return resource.destroy({
859
1240
  filterByTk: (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : _field$data2.selectedRowKeys
860
1241
  });
861
1242
 
862
1243
  case 4:
863
1244
  field.data.selectedRowKeys = [];
864
- service === null || service === void 0 ? void 0 : (_service$refresh4 = service.refresh) === null || _service$refresh4 === void 0 ? void 0 : _service$refresh4.call(service);
1245
+ service === null || service === void 0 ? void 0 : (_service$refresh5 = service.refresh) === null || _service$refresh5 === void 0 ? void 0 : _service$refresh5.call(service);
865
1246
 
866
1247
  case 6:
867
1248
  case "end":
868
- return _context11.stop();
1249
+ return _context17.stop();
869
1250
  }
870
1251
  }
871
- }, _callee11);
1252
+ }, _callee17);
872
1253
  }))();
873
1254
  }
874
1255
  };
@@ -877,26 +1258,26 @@ var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
877
1258
  exports.useBulkDestroyActionProps = useBulkDestroyActionProps;
878
1259
 
879
1260
  var useRefreshActionProps = function useRefreshActionProps() {
880
- var _useBlockRequestConte8 = (0, _BlockProvider.useBlockRequestContext)(),
881
- service = _useBlockRequestConte8.service;
1261
+ var _useBlockRequestConte10 = (0, _BlockProvider.useBlockRequestContext)(),
1262
+ service = _useBlockRequestConte10.service;
882
1263
 
883
1264
  return {
884
1265
  onClick: function onClick() {
885
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12() {
886
- var _service$refresh5;
1266
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18() {
1267
+ var _service$refresh6;
887
1268
 
888
- return regeneratorRuntime.wrap(function _callee12$(_context12) {
1269
+ return regeneratorRuntime.wrap(function _callee18$(_context18) {
889
1270
  while (1) {
890
- switch (_context12.prev = _context12.next) {
1271
+ switch (_context18.prev = _context18.next) {
891
1272
  case 0:
892
- service === null || service === void 0 ? void 0 : (_service$refresh5 = service.refresh) === null || _service$refresh5 === void 0 ? void 0 : _service$refresh5.call(service);
1273
+ service === null || service === void 0 ? void 0 : (_service$refresh6 = service.refresh) === null || _service$refresh6 === void 0 ? void 0 : _service$refresh6.call(service);
893
1274
 
894
1275
  case 1:
895
1276
  case "end":
896
- return _context12.stop();
1277
+ return _context18.stop();
897
1278
  }
898
1279
  }
899
- }, _callee12);
1280
+ }, _callee18);
900
1281
  }))();
901
1282
  }
902
1283
  };
@@ -916,13 +1297,13 @@ var useDetailsPaginationProps = function useDetailsPaginationProps() {
916
1297
  total: count,
917
1298
  pageSize: 1,
918
1299
  onChange: function onChange(page) {
919
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
1300
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19() {
920
1301
  var _ctx$service3, _ctx$service3$params;
921
1302
 
922
1303
  var params;
923
- return regeneratorRuntime.wrap(function _callee13$(_context13) {
1304
+ return regeneratorRuntime.wrap(function _callee19$(_context19) {
924
1305
  while (1) {
925
- switch (_context13.prev = _context13.next) {
1306
+ switch (_context19.prev = _context19.next) {
926
1307
  case 0:
927
1308
  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];
928
1309
  ctx.service.run(_objectSpread(_objectSpread({}, params), {}, {
@@ -931,10 +1312,10 @@ var useDetailsPaginationProps = function useDetailsPaginationProps() {
931
1312
 
932
1313
  case 2:
933
1314
  case "end":
934
- return _context13.stop();
1315
+ return _context19.stop();
935
1316
  }
936
1317
  }
937
- }, _callee13);
1318
+ }, _callee19);
938
1319
  }))();
939
1320
  },
940
1321
  style: {