@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
@@ -15,7 +15,7 @@ var _apiClient = require("../api-client");
15
15
 
16
16
  var _CollectionManagerSchemaComponentProvider = require("./CollectionManagerSchemaComponentProvider");
17
17
 
18
- var _context3 = require("./context");
18
+ var _context2 = require("./context");
19
19
 
20
20
  var defaultInterfaces = _interopRequireWildcard(require("./interfaces"));
21
21
 
@@ -23,6 +23,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
23
23
 
24
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
25
 
26
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
27
+
28
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
29
+
26
30
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
31
 
28
32
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -35,10 +39,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
35
39
 
36
40
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
41
 
38
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
39
-
40
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
41
-
42
42
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
43
43
 
44
44
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -50,40 +50,13 @@ var CollectionManagerProvider = function CollectionManagerProvider(props) {
50
50
  interfaces = props.interfaces,
51
51
  _props$collections = props.collections,
52
52
  collections = _props$collections === void 0 ? [] : _props$collections,
53
- _refreshCM = props.refreshCM;
54
- return /*#__PURE__*/_react.default.createElement(_context3.CollectionManagerContext.Provider, {
53
+ refreshCM = props.refreshCM;
54
+ return /*#__PURE__*/_react.default.createElement(_context2.CollectionManagerContext.Provider, {
55
55
  value: {
56
56
  service: service,
57
57
  interfaces: _objectSpread(_objectSpread({}, defaultInterfaces), interfaces),
58
58
  collections: collections,
59
- refreshCM: function () {
60
- var _refreshCM2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
61
- return regeneratorRuntime.wrap(function _callee$(_context) {
62
- while (1) {
63
- switch (_context.prev = _context.next) {
64
- case 0:
65
- if (!_refreshCM) {
66
- _context.next = 3;
67
- break;
68
- }
69
-
70
- _context.next = 3;
71
- return _refreshCM();
72
-
73
- case 3:
74
- case "end":
75
- return _context.stop();
76
- }
77
- }
78
- }, _callee);
79
- }));
80
-
81
- function refreshCM() {
82
- return _refreshCM2.apply(this, arguments);
83
- }
84
-
85
- return refreshCM;
86
- }()
59
+ refreshCM: refreshCM
87
60
  }
88
61
  }, /*#__PURE__*/_react.default.createElement(_CollectionManagerSchemaComponentProvider.CollectionManagerSchemaComponentProvider, null, props.children));
89
62
  };
@@ -124,33 +97,41 @@ var RemoteCollectionManagerProvider = function RemoteCollectionManagerProvider(p
124
97
  }),
125
98
  collections: service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.data,
126
99
  refreshCM: function () {
127
- var _refreshCM3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
100
+ var _refreshCM = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(opts) {
128
101
  var _yield$api$request, data;
129
102
 
130
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
103
+ return regeneratorRuntime.wrap(function _callee$(_context) {
131
104
  while (1) {
132
- switch (_context2.prev = _context2.next) {
105
+ switch (_context.prev = _context.next) {
133
106
  case 0:
134
- setContentLoading(true);
135
- _context2.next = 3;
107
+ if (opts === null || opts === void 0 ? void 0 : opts.reload) {
108
+ setContentLoading(true);
109
+ }
110
+
111
+ _context.next = 3;
136
112
  return api.request(options);
137
113
 
138
114
  case 3:
139
- _yield$api$request = _context2.sent;
115
+ _yield$api$request = _context.sent;
140
116
  data = _yield$api$request.data;
141
117
  service.mutate(data);
142
- setContentLoading(false);
143
118
 
144
- case 7:
119
+ if (opts === null || opts === void 0 ? void 0 : opts.reload) {
120
+ setContentLoading(false);
121
+ }
122
+
123
+ return _context.abrupt("return", (data === null || data === void 0 ? void 0 : data.data) || []);
124
+
125
+ case 8:
145
126
  case "end":
146
- return _context2.stop();
127
+ return _context.stop();
147
128
  }
148
129
  }
149
- }, _callee2);
130
+ }, _callee);
150
131
  }));
151
132
 
152
- function refreshCM() {
153
- return _refreshCM3.apply(this, arguments);
133
+ function refreshCM(_x) {
134
+ return _refreshCM.apply(this, arguments);
154
135
  }
155
136
 
156
137
  return refreshCM;
@@ -1 +1,3 @@
1
+ export declare const CollectionManagerPane: () => JSX.Element;
1
2
  export declare const CollectionManagerShortcut: () => JSX.Element;
3
+ export declare const CollectionManagerShortcut2: () => JSX.Element;
@@ -5,16 +5,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.CollectionManagerShortcut = void 0;
8
+ exports.CollectionManagerShortcut2 = exports.CollectionManagerShortcut = exports.CollectionManagerPane = void 0;
9
9
 
10
10
  var _icons = require("@ant-design/icons");
11
11
 
12
12
  var _shared = require("@formily/shared");
13
13
 
14
+ var _antd = require("antd");
15
+
14
16
  var _react = _interopRequireWildcard(require("react"));
15
17
 
16
18
  var _reactI18next = require("react-i18next");
17
19
 
20
+ var _reactRouterDom = require("react-router-dom");
21
+
18
22
  var _pluginManager = require("../plugin-manager");
19
23
 
20
24
  var _schemaComponent = require("../schema-component");
@@ -52,15 +56,54 @@ var schema = {
52
56
  }
53
57
  })
54
58
  };
59
+ var schema2 = {
60
+ type: 'object',
61
+ properties: _defineProperty({}, (0, _shared.uid)(), {
62
+ 'x-component': 'ConfigurationTable'
63
+ })
64
+ };
65
+
66
+ var CollectionManagerPane = function CollectionManagerPane() {
67
+ return /*#__PURE__*/_react.default.createElement(_antd.Card, {
68
+ bordered: false
69
+ }, /*#__PURE__*/_react.default.createElement(_schemaComponent.SchemaComponent, {
70
+ schema: schema2,
71
+ components: {
72
+ ConfigurationTable: _Configuration.ConfigurationTable,
73
+ AddFieldAction: _Configuration.AddFieldAction,
74
+ AddCollectionField: _Configuration.AddCollectionField,
75
+ EditFieldAction: _Configuration.EditFieldAction,
76
+ EditCollectionField: _Configuration.EditCollectionField
77
+ }
78
+ }));
79
+ };
80
+
81
+ exports.CollectionManagerPane = CollectionManagerPane;
55
82
 
56
83
  var CollectionManagerShortcut = function CollectionManagerShortcut() {
84
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
85
+ t = _useTranslation.t;
86
+
87
+ var history = (0, _reactRouterDom.useHistory)();
88
+ return /*#__PURE__*/_react.default.createElement(_pluginManager.PluginManager.Toolbar.Item, {
89
+ icon: /*#__PURE__*/_react.default.createElement(_icons.DatabaseOutlined, null),
90
+ title: t('Collections & Fields'),
91
+ onClick: function onClick() {
92
+ history.push('/admin/settings/collection-manager/collections');
93
+ }
94
+ });
95
+ };
96
+
97
+ exports.CollectionManagerShortcut = CollectionManagerShortcut;
98
+
99
+ var CollectionManagerShortcut2 = function CollectionManagerShortcut2() {
57
100
  var _useState = (0, _react.useState)(false),
58
101
  _useState2 = _slicedToArray(_useState, 2),
59
102
  visible = _useState2[0],
60
103
  setVisible = _useState2[1];
61
104
 
62
- var _useTranslation = (0, _reactI18next.useTranslation)(),
63
- t = _useTranslation.t;
105
+ var _useTranslation2 = (0, _reactI18next.useTranslation)(),
106
+ t = _useTranslation2.t;
64
107
 
65
108
  return /*#__PURE__*/_react.default.createElement(_schemaComponent.ActionContext.Provider, {
66
109
  value: {
@@ -83,4 +126,4 @@ var CollectionManagerShortcut = function CollectionManagerShortcut() {
83
126
  }));
84
127
  };
85
128
 
86
- exports.CollectionManagerShortcut = CollectionManagerShortcut;
129
+ exports.CollectionManagerShortcut2 = CollectionManagerShortcut2;
@@ -1 +1,5 @@
1
- export declare const AddFieldAction: () => JSX.Element;
1
+ export declare const useCollectionFieldFormValues: () => {
2
+ getValues(): any;
3
+ };
4
+ export declare const AddCollectionField: (props: any) => JSX.Element;
5
+ export declare const AddFieldAction: (props: any) => JSX.Element;
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.AddFieldAction = void 0;
8
+ exports.useCollectionFieldFormValues = exports.AddFieldAction = exports.AddCollectionField = void 0;
9
9
 
10
10
  var _icons = require("@ant-design/icons");
11
11
 
@@ -94,6 +94,9 @@ var getSchema = function getSchema(schema, record, compile) {
94
94
  properties: _defineProperty({}, (0, _shared.uid)(), {
95
95
  type: 'void',
96
96
  'x-component': 'Action.Drawer',
97
+ 'x-component-props': {
98
+ getContainer: '{{ getContainer }}'
99
+ },
97
100
  'x-decorator': 'Form',
98
101
  'x-decorator-props': {
99
102
  useValues: function useValues(options) {
@@ -122,7 +125,7 @@ var getSchema = function getSchema(schema, record, compile) {
122
125
  title: '{{ t("Cancel") }}',
123
126
  'x-component': 'Action',
124
127
  'x-component-props': {
125
- useAction: '{{ cm.useCancelAction }}'
128
+ useAction: '{{ useCancelAction }}'
126
129
  }
127
130
  },
128
131
  action2: {
@@ -140,6 +143,24 @@ var getSchema = function getSchema(schema, record, compile) {
140
143
  };
141
144
  };
142
145
 
146
+ var useCollectionFieldFormValues = function useCollectionFieldFormValues() {
147
+ var form = (0, _react.useForm)();
148
+ return {
149
+ getValues: function getValues() {
150
+ var values = (0, _lodash.cloneDeep)(form.values);
151
+
152
+ if (values.autoCreateReverseField) {} else {
153
+ delete values.reverseField;
154
+ }
155
+
156
+ delete values.autoCreateReverseField;
157
+ return values;
158
+ }
159
+ };
160
+ };
161
+
162
+ exports.useCollectionFieldFormValues = useCollectionFieldFormValues;
163
+
143
164
  var useCreateCollectionField = function useCreateCollectionField() {
144
165
  var form = (0, _react.useForm)();
145
166
 
@@ -149,9 +170,6 @@ var useCreateCollectionField = function useCreateCollectionField() {
149
170
  var _useCollectionManager = (0, _hooks.useCollectionManager)(),
150
171
  refreshCM = _useCollectionManager.refreshCM;
151
172
 
152
- var _useRecord = (0, _recordProvider.useRecord)(),
153
- title = _useRecord.title;
154
-
155
173
  var ctx = (0, _schemaComponent.useActionContext)();
156
174
 
157
175
  var _useResourceActionCon = (0, _ResourceActionProvider.useResourceActionContext)(),
@@ -205,7 +223,23 @@ var useCreateCollectionField = function useCreateCollectionField() {
205
223
  };
206
224
  };
207
225
 
208
- var AddFieldAction = function AddFieldAction() {
226
+ var AddCollectionField = function AddCollectionField(props) {
227
+ var record = (0, _recordProvider.useRecord)();
228
+ return /*#__PURE__*/_react2.default.createElement(AddFieldAction, _objectSpread({
229
+ item: record
230
+ }, props));
231
+ };
232
+
233
+ exports.AddCollectionField = AddCollectionField;
234
+
235
+ var AddFieldAction = function AddFieldAction(props) {
236
+ var scope = props.scope,
237
+ getContainer = props.getContainer,
238
+ record = props.item,
239
+ children = props.children,
240
+ trigger = props.trigger,
241
+ align = props.align;
242
+
209
243
  var _useCollectionManager2 = (0, _hooks.useCollectionManager)(),
210
244
  getInterface = _useCollectionManager2.getInterface;
211
245
 
@@ -224,13 +258,17 @@ var AddFieldAction = function AddFieldAction() {
224
258
  var _useTranslation = (0, _reactI18next.useTranslation)(),
225
259
  t = _useTranslation.t;
226
260
 
227
- var record = (0, _recordProvider.useRecord)();
228
- return /*#__PURE__*/_react2.default.createElement(_schemaComponent.ActionContext.Provider, {
261
+ return /*#__PURE__*/_react2.default.createElement(_recordProvider.RecordProvider, {
262
+ record: record
263
+ }, /*#__PURE__*/_react2.default.createElement(_schemaComponent.ActionContext.Provider, {
229
264
  value: {
230
265
  visible: visible,
231
266
  setVisible: setVisible
232
267
  }
233
268
  }, /*#__PURE__*/_react2.default.createElement(_antd2.Dropdown, {
269
+ getPopupContainer: getContainer,
270
+ trigger: trigger,
271
+ align: align,
234
272
  overlay: /*#__PURE__*/_react2.default.createElement(_antd2.Menu, {
235
273
  style: {
236
274
  maxHeight: '60vh',
@@ -253,7 +291,7 @@ var AddFieldAction = function AddFieldAction() {
253
291
  }, compile(child.title));
254
292
  }));
255
293
  }))
256
- }, /*#__PURE__*/_react2.default.createElement(_antd2.Button, {
294
+ }, children || /*#__PURE__*/_react2.default.createElement(_antd2.Button, {
257
295
  icon: /*#__PURE__*/_react2.default.createElement(_icons.PlusOutlined, null),
258
296
  type: 'primary'
259
297
  }, t('Add field'))), /*#__PURE__*/_react2.default.createElement(_schemaComponent.SchemaComponent, {
@@ -261,13 +299,15 @@ var AddFieldAction = function AddFieldAction() {
261
299
  components: _objectSpread(_objectSpread({}, components), {}, {
262
300
  ArrayTable: _antd.ArrayTable
263
301
  }),
264
- scope: {
302
+ scope: _objectSpread({
303
+ getContainer: getContainer,
304
+ useCancelAction: _actionHooks.useCancelAction,
265
305
  createOnly: true,
266
306
  useCreateCollectionField: useCreateCollectionField,
267
307
  record: record,
268
308
  showReverseFieldConfig: true
269
- }
270
- }));
309
+ }, scope)
310
+ })));
271
311
  };
272
312
 
273
313
  exports.AddFieldAction = AddFieldAction;
@@ -0,0 +1,15 @@
1
+ import { Options, Result } from 'ahooks/lib/useRequest/src/types';
2
+ import React from 'react';
3
+ import { TableProps } from 'antd';
4
+ declare type TableVoidProps = TableProps<any> & {
5
+ request?: any;
6
+ useSelectedRowKeys?: any;
7
+ useDataSource?: (options?: Options<any, any> & {
8
+ uid?: string;
9
+ }, props?: any) => Result<any, any> & {
10
+ state?: any;
11
+ setState?: any;
12
+ };
13
+ };
14
+ export declare const CollectionFieldsTable: React.FC<TableVoidProps>;
15
+ export {};
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.CollectionFieldsTable = void 0;
9
+
10
+ var _core = require("@formily/core");
11
+
12
+ var _react = require("@formily/react");
13
+
14
+ var _react2 = _interopRequireWildcard(require("react"));
15
+
16
+ var _ = require("../..");
17
+
18
+ var _useAttach = require("@formily/react/lib/hooks/useAttach");
19
+
20
+ var _CollectionFieldsTableArray = require("./CollectionFieldsTableArray");
21
+
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
+
28
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
29
+
30
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
+
32
+ var useDefSelectedRowKeys = function useDefSelectedRowKeys() {
33
+ var _result$state;
34
+
35
+ var result = (0, _.useAsyncData)();
36
+ return [result === null || result === void 0 ? void 0 : (_result$state = result.state) === null || _result$state === void 0 ? void 0 : _result$state.selectedRowKeys, function (selectedRowKeys) {
37
+ var _result$setState;
38
+
39
+ return result === null || result === void 0 ? void 0 : (_result$setState = result.setState) === null || _result$setState === void 0 ? void 0 : _result$setState.call(result, {
40
+ selectedRowKeys: selectedRowKeys
41
+ });
42
+ }];
43
+ };
44
+
45
+ var useDef = function useDef(options, props) {
46
+ var request = props.request,
47
+ dataSource = props.dataSource;
48
+
49
+ if (request) {
50
+ return (0, _.useRequest)(request(props), options);
51
+ } else {
52
+ return Promise.resolve({
53
+ data: dataSource
54
+ });
55
+ }
56
+ };
57
+
58
+ var CollectionFieldsTable = (0, _react.observer)(function (props) {
59
+ var _props$rowKey = props.rowKey,
60
+ rowKey = _props$rowKey === void 0 ? 'id' : _props$rowKey,
61
+ _props$useDataSource = props.useDataSource,
62
+ useDataSource = _props$useDataSource === void 0 ? useDef : _props$useDataSource,
63
+ _props$useSelectedRow = props.useSelectedRowKeys,
64
+ useSelectedRowKeys = _props$useSelectedRow === void 0 ? useDefSelectedRowKeys : _props$useSelectedRow;
65
+ var field = (0, _react.useField)();
66
+ var fieldSchema = (0, _react.useFieldSchema)();
67
+ var form = (0, _react2.useMemo)(function () {
68
+ return (0, _core.createForm)();
69
+ }, []);
70
+ var f = (0, _useAttach.useAttach)(form.createArrayField(_objectSpread(_objectSpread({}, field.props), {}, {
71
+ basePath: ''
72
+ })));
73
+ var result = useDataSource({
74
+ uid: fieldSchema['x-uid'],
75
+ onSuccess: function onSuccess(data) {
76
+ form.setValues(_defineProperty({}, fieldSchema.name, data === null || data === void 0 ? void 0 : data.data));
77
+ }
78
+ }, props);
79
+ return /*#__PURE__*/_react2.default.createElement(_.AsyncDataProvider, {
80
+ value: result
81
+ }, /*#__PURE__*/_react2.default.createElement(_react.FormContext.Provider, {
82
+ value: form
83
+ }, /*#__PURE__*/_react2.default.createElement(_react.FieldContext.Provider, {
84
+ value: f
85
+ }, /*#__PURE__*/_react2.default.createElement(_CollectionFieldsTableArray.CollectionFieldsTableArray, _objectSpread(_objectSpread({}, props), {}, {
86
+ rowKey: rowKey,
87
+ loading: result === null || result === void 0 ? void 0 : result['loading'],
88
+ useSelectedRowKeys: useSelectedRowKeys,
89
+ pagination: false
90
+ })))));
91
+ });
92
+ exports.CollectionFieldsTable = CollectionFieldsTable;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const components: {
3
+ body: {
4
+ row: (props: any) => JSX.Element;
5
+ cell: (props: any) => JSX.Element;
6
+ };
7
+ };
8
+ export declare const CollectionFieldsTableArray: React.FC<any>;