@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
@@ -93,7 +93,7 @@ export var useTableColumnInitializerFields = function useTableColumnInitializerF
93
93
  getInterface = _useCollectionManager.getInterface;
94
94
 
95
95
  return fields.filter(function (field) {
96
- return (field === null || field === void 0 ? void 0 : field.interface) && (field === null || field === void 0 ? void 0 : field.interface) !== 'subTable';
96
+ return (field === null || field === void 0 ? void 0 : field.interface) && (field === null || field === void 0 ? void 0 : field.interface) !== 'subTable' && !(field === null || field === void 0 ? void 0 : field.isForeignKey);
97
97
  }).map(function (field) {
98
98
  var _field$uiSchema;
99
99
 
@@ -207,9 +207,9 @@ export var useFormItemInitializerFields = function useFormItemInitializerFields(
207
207
  block = _ref$block === void 0 ? 'Form' : _ref$block;
208
208
 
209
209
  return fields === null || fields === void 0 ? void 0 : (_fields$filter2 = fields.filter(function (field) {
210
- return field === null || field === void 0 ? void 0 : field.interface;
210
+ return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : field.isForeignKey);
211
211
  })) === null || _fields$filter2 === void 0 ? void 0 : _fields$filter2.map(function (field) {
212
- var _field$uiSchema3;
212
+ var _field$uiSchema3, _field$uiSchema4;
213
213
 
214
214
  var interfaceConfig = getInterface(field.interface);
215
215
  var schema = {
@@ -220,12 +220,13 @@ export var useFormItemInitializerFields = function useFormItemInitializerFields(
220
220
  'x-component': field.interface === 'o2m' ? 'TableField' : 'CollectionField',
221
221
  'x-decorator': 'FormItem',
222
222
  'x-collection-field': "".concat(name, ".").concat(field.name),
223
- 'x-component-props': {}
223
+ 'x-component-props': {},
224
+ 'x-read-pretty': field === null || field === void 0 ? void 0 : (_field$uiSchema3 = field.uiSchema) === null || _field$uiSchema3 === void 0 ? void 0 : _field$uiSchema3['x-read-pretty']
224
225
  }; // interfaceConfig?.schemaInitialize?.(schema, { field, block: 'Form', readPretty: form.readPretty });
225
226
 
226
227
  return {
227
228
  type: 'item',
228
- title: (field === null || field === void 0 ? void 0 : (_field$uiSchema3 = field.uiSchema) === null || _field$uiSchema3 === void 0 ? void 0 : _field$uiSchema3.title) || field.name,
229
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema4 = field.uiSchema) === null || _field$uiSchema4 === void 0 ? void 0 : _field$uiSchema4.title) || field.name,
229
230
  component: 'CollectionFieldInitializer',
230
231
  remove: removeGridFormItem,
231
232
  schemaInitialize: function schemaInitialize(s) {
@@ -264,7 +265,7 @@ export var useAssociatedFormItemInitializerFields = function useAssociatedFormIt
264
265
  var groups = fields === null || fields === void 0 ? void 0 : (_fields$filter3 = fields.filter(function (field) {
265
266
  return interfaces.includes(field.interface);
266
267
  })) === null || _fields$filter3 === void 0 ? void 0 : _fields$filter3.map(function (field) {
267
- var _subFields$filter2, _field$uiSchema4;
268
+ var _subFields$filter2, _field$uiSchema5;
268
269
 
269
270
  var subFields = getCollectionFields(field.target);
270
271
  var items = subFields === null || subFields === void 0 ? void 0 : (_subFields$filter2 = subFields.filter(function (subField) {
@@ -306,7 +307,7 @@ export var useAssociatedFormItemInitializerFields = function useAssociatedFormIt
306
307
  });
307
308
  return {
308
309
  type: 'subMenu',
309
- title: (_field$uiSchema4 = field.uiSchema) === null || _field$uiSchema4 === void 0 ? void 0 : _field$uiSchema4.title,
310
+ title: (_field$uiSchema5 = field.uiSchema) === null || _field$uiSchema5 === void 0 ? void 0 : _field$uiSchema5.title,
310
311
  children: items
311
312
  };
312
313
  });
@@ -332,17 +333,17 @@ export var useCustomFormItemInitializerFields = function useCustomFormItemInitia
332
333
 
333
334
  var remove = useRemoveGridFormItem();
334
335
  return fields === null || fields === void 0 ? void 0 : (_fields$filter4 = fields.filter(function (field) {
335
- var _field$uiSchema5;
336
+ var _field$uiSchema6;
336
337
 
337
- return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : (_field$uiSchema5 = field.uiSchema) === null || _field$uiSchema5 === void 0 ? void 0 : _field$uiSchema5['x-read-pretty']);
338
+ return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : (_field$uiSchema6 = field.uiSchema) === null || _field$uiSchema6 === void 0 ? void 0 : _field$uiSchema6['x-read-pretty']);
338
339
  })) === null || _fields$filter4 === void 0 ? void 0 : _fields$filter4.map(function (field) {
339
- var _field$uiSchema6, _field$uiSchema7;
340
+ var _field$uiSchema7, _field$uiSchema8;
340
341
 
341
342
  var interfaceConfig = getInterface(field.interface);
342
343
  var schema = {
343
344
  type: 'string',
344
345
  name: field.name,
345
- title: (field === null || field === void 0 ? void 0 : (_field$uiSchema6 = field.uiSchema) === null || _field$uiSchema6 === void 0 ? void 0 : _field$uiSchema6.title) || field.name,
346
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema7 = field.uiSchema) === null || _field$uiSchema7 === void 0 ? void 0 : _field$uiSchema7.title) || field.name,
346
347
  'x-designer': 'FormItem.Designer',
347
348
  'x-component': 'AssignedField',
348
349
  'x-decorator': 'FormItem',
@@ -350,7 +351,7 @@ export var useCustomFormItemInitializerFields = function useCustomFormItemInitia
350
351
  };
351
352
  return {
352
353
  type: 'item',
353
- title: (field === null || field === void 0 ? void 0 : (_field$uiSchema7 = field.uiSchema) === null || _field$uiSchema7 === void 0 ? void 0 : _field$uiSchema7.title) || field.name,
354
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema8 = field.uiSchema) === null || _field$uiSchema8 === void 0 ? void 0 : _field$uiSchema8.title) || field.name,
354
355
  component: 'CollectionFieldInitializer',
355
356
  remove: remove,
356
357
  schemaInitialize: function schemaInitialize(s) {
@@ -366,6 +367,60 @@ export var useCustomFormItemInitializerFields = function useCustomFormItemInitia
366
367
  };
367
368
  });
368
369
  };
370
+ export var useCustomBulkEditFormItemInitializerFields = function useCustomBulkEditFormItemInitializerFields(options) {
371
+ var _fields$filter5;
372
+
373
+ var _useCollection6 = useCollection(),
374
+ name = _useCollection6.name,
375
+ fields = _useCollection6.fields;
376
+
377
+ var _useCollectionManager6 = useCollectionManager(),
378
+ getInterface = _useCollectionManager6.getInterface;
379
+
380
+ var form = useForm();
381
+
382
+ var _ref4 = options || {},
383
+ _ref4$readPretty = _ref4.readPretty,
384
+ readPretty = _ref4$readPretty === void 0 ? form.readPretty : _ref4$readPretty,
385
+ _ref4$block = _ref4.block,
386
+ block = _ref4$block === void 0 ? 'Form' : _ref4$block;
387
+
388
+ var remove = useRemoveGridFormItem();
389
+ return fields === null || fields === void 0 ? void 0 : (_fields$filter5 = fields.filter(function (field) {
390
+ var _field$uiSchema9;
391
+
392
+ return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : (_field$uiSchema9 = field.uiSchema) === null || _field$uiSchema9 === void 0 ? void 0 : _field$uiSchema9['x-read-pretty']);
393
+ })) === null || _fields$filter5 === void 0 ? void 0 : _fields$filter5.map(function (field) {
394
+ var _field$uiSchema10, _field$uiSchema11;
395
+
396
+ var interfaceConfig = getInterface(field.interface);
397
+ var schema = {
398
+ type: 'string',
399
+ name: field.name,
400
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema10 = field.uiSchema) === null || _field$uiSchema10 === void 0 ? void 0 : _field$uiSchema10.title) || field.name,
401
+ 'x-designer': 'FormItem.Designer',
402
+ 'x-component': 'BulkEditField',
403
+ 'x-decorator': 'FormItem',
404
+ 'x-collection-field': "".concat(name, ".").concat(field.name)
405
+ };
406
+ return {
407
+ type: 'item',
408
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema11 = field.uiSchema) === null || _field$uiSchema11 === void 0 ? void 0 : _field$uiSchema11.title) || field.name,
409
+ component: 'CollectionFieldInitializer',
410
+ remove: remove,
411
+ schemaInitialize: function schemaInitialize(s) {
412
+ var _interfaceConfig$sche6;
413
+
414
+ interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$sche6 = interfaceConfig.schemaInitialize) === null || _interfaceConfig$sche6 === void 0 ? void 0 : _interfaceConfig$sche6.call(interfaceConfig, s, {
415
+ field: field,
416
+ block: block,
417
+ readPretty: readPretty
418
+ });
419
+ },
420
+ schema: schema
421
+ };
422
+ });
423
+ };
369
424
 
370
425
  var findSchema = function findSchema(schema, key, action) {
371
426
  if (!Schema.isSchemaInstance(schema)) return null;
@@ -493,8 +548,8 @@ export var useCollectionDataSourceItems = function useCollectionDataSourceItems(
493
548
  var _useTranslation2 = useTranslation(),
494
549
  t = _useTranslation2.t;
495
550
 
496
- var _useCollectionManager6 = useCollectionManager(),
497
- collections = _useCollectionManager6.collections;
551
+ var _useCollectionManager7 = useCollectionManager(),
552
+ collections = _useCollectionManager7.collections;
498
553
 
499
554
  var _useSchemaTemplateMan2 = useSchemaTemplateManager(),
500
555
  getTemplatesByCollection = _useSchemaTemplateMan2.getTemplatesByCollection;
@@ -504,7 +559,11 @@ export var useCollectionDataSourceItems = function useCollectionDataSourceItems(
504
559
  type: 'itemGroup',
505
560
  title: t('Select collection'),
506
561
  children: collections === null || collections === void 0 ? void 0 : (_collections$filter = collections.filter(function (item) {
507
- return !item.inherit;
562
+ if (item.inherit) {
563
+ return false;
564
+ } else {
565
+ return !((item === null || item === void 0 ? void 0 : item.isThrough) && (item === null || item === void 0 ? void 0 : item.autoCreate));
566
+ }
508
567
  })) === null || _collections$filter === void 0 ? void 0 : _collections$filter.map(function (item, index) {
509
568
  var templates = getTemplatesByCollection(item.name).filter(function (template) {
510
569
  return componentName && template.componentName === componentName && (!template.resourceName || template.resourceName === item.name);
@@ -31,6 +31,7 @@ declare type SchemaSettingsNested = {
31
31
  Popup?: React.FC<MenuItemProps & {
32
32
  schema?: ISchema;
33
33
  }>;
34
+ SwitchItem?: React.FC<SwitchItemProps>;
34
35
  [key: string]: any;
35
36
  };
36
37
  interface SchemaSettingsProviderProps {
@@ -44,4 +45,9 @@ interface SchemaSettingsProviderProps {
44
45
  }
45
46
  export declare const SchemaSettingsProvider: React.FC<SchemaSettingsProviderProps>;
46
47
  export declare const SchemaSettings: React.FC<SchemaSettingsProps> & SchemaSettingsNested;
48
+ interface SwitchItemProps extends Omit<MenuItemProps, 'onChange'> {
49
+ title: string;
50
+ checked?: boolean;
51
+ onChange?: (v: boolean) => void;
52
+ }
47
53
  export {};
@@ -39,7 +39,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
39
39
  import { css } from '@emotion/css';
40
40
  import { FormDialog, FormItem, FormLayout, Input } from '@formily/antd';
41
41
  import { createForm } from '@formily/core';
42
- import { SchemaOptionsContext, useField, useFieldSchema } from '@formily/react';
42
+ import { SchemaOptionsContext, useField, useFieldSchema, useForm } from '@formily/react';
43
43
  import { uid } from '@formily/shared';
44
44
  import { Alert, Button, Dropdown, Menu, Modal, Select, Space, Switch } from 'antd';
45
45
  import classNames from 'classnames';
@@ -543,6 +543,7 @@ SchemaSettings.Remove = function (props) {
543
543
  var field = useField();
544
544
  var fieldSchema = useFieldSchema();
545
545
  var ctx = useBlockTemplateContext();
546
+ var form = useForm();
546
547
  return /*#__PURE__*/React.createElement(SchemaSettings.Item, {
547
548
  onClick: function onClick() {
548
549
  Modal.confirm(_objectSpread(_objectSpread({
@@ -565,6 +566,8 @@ SchemaSettings.Remove = function (props) {
565
566
  } else {
566
567
  dn.remove(null, options);
567
568
  }
569
+
570
+ delete form.values[fieldSchema.name];
568
571
  }
569
572
  }));
570
573
  }
@@ -1 +1,2 @@
1
1
  export declare const BlockTemplatePage: () => JSX.Element;
2
+ export declare const BlockTemplatesPane: () => JSX.Element;
@@ -21,4 +21,11 @@ export var BlockTemplatePage = function BlockTemplatePage() {
21
21
  }, /*#__PURE__*/React.createElement(SchemaComponent, {
22
22
  schema: uiSchemaTemplatesSchema
23
23
  }))));
24
+ };
25
+ export var BlockTemplatesPane = function BlockTemplatesPane() {
26
+ return /*#__PURE__*/React.createElement(CollectionManagerProvider, {
27
+ collections: [uiSchemaTemplatesCollection]
28
+ }, /*#__PURE__*/React.createElement(SchemaComponent, {
29
+ schema: uiSchemaTemplatesSchema
30
+ }));
24
31
  };
@@ -12,7 +12,7 @@ export var SchemaTemplateShortcut = function SchemaTemplateShortcut() {
12
12
  icon: /*#__PURE__*/React.createElement(LayoutOutlined, null),
13
13
  title: t('Block templates'),
14
14
  onClick: function onClick() {
15
- history.push('/admin/plugins/block-templates');
15
+ history.push('/admin/settings/block-templates/list');
16
16
  }
17
17
  });
18
18
  };
@@ -1 +1,3 @@
1
+ export declare const SystemSettingsPane: () => JSX.Element;
1
2
  export declare const SystemSettingsShortcut: () => JSX.Element;
3
+ export declare const SystemSettingsShortcut2: () => JSX.Element;
@@ -23,9 +23,11 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
23
23
  import { SettingOutlined } from '@ant-design/icons';
24
24
  import { useForm } from '@formily/react';
25
25
  import { uid } from '@formily/shared';
26
+ import { Card, message } from 'antd';
26
27
  import cloneDeep from 'lodash/cloneDeep';
27
28
  import React, { useState } from 'react';
28
29
  import { useTranslation } from 'react-i18next';
30
+ import { useHistory } from 'react-router-dom';
29
31
  import { useSystemSettings } from '.';
30
32
  import { i18n, PluginManager, useAPIClient, useRequest } from '..';
31
33
  import locale from '../locale';
@@ -84,6 +86,10 @@ var useSaveSystemSettingsValues = function useSaveSystemSettingsValues() {
84
86
  data = _useSystemSettings.data;
85
87
 
86
88
  var api = useAPIClient();
89
+
90
+ var _useTranslation = useTranslation(),
91
+ t = _useTranslation.t;
92
+
87
93
  return {
88
94
  run: function run() {
89
95
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
@@ -110,6 +116,7 @@ var useSaveSystemSettingsValues = function useSaveSystemSettingsValues() {
110
116
  });
111
117
 
112
118
  case 6:
119
+ message.success(t('Saved successfully'));
113
120
  lang = ((_values$enabledLangua = values.enabledLanguages) === null || _values$enabledLangua === void 0 ? void 0 : _values$enabledLangua[0]) || 'en-US';
114
121
 
115
122
  if (values.enabledLanguages.length < 2 && api.auth.getLocale() !== lang) {
@@ -119,7 +126,7 @@ var useSaveSystemSettingsValues = function useSaveSystemSettingsValues() {
119
126
  setVisible(false);
120
127
  }
121
128
 
122
- case 8:
129
+ case 9:
123
130
  case "end":
124
131
  return _context2.stop();
125
132
  }
@@ -203,13 +210,103 @@ var schema = {
203
210
  type: 'void',
204
211
  'x-component': 'Action.Drawer.Footer',
205
212
  properties: {
213
+ submit: {
214
+ title: 'Submit',
215
+ 'x-component': 'Action',
216
+ 'x-component-props': {
217
+ type: 'primary',
218
+ htmlType: 'submit',
219
+ useAction: '{{ useSaveSystemSettingsValues }}'
220
+ }
221
+ },
206
222
  cancel: {
207
223
  title: 'Cancel',
208
224
  'x-component': 'Action',
209
225
  'x-component-props': {
210
226
  useAction: '{{ useCloseAction }}'
211
227
  }
212
- },
228
+ }
229
+ }
230
+ }
231
+ }
232
+ })
233
+ };
234
+ var schema2 = {
235
+ type: 'object',
236
+ properties: _defineProperty({}, uid(), {
237
+ 'x-decorator': 'Form',
238
+ 'x-decorator-props': {
239
+ useValues: '{{ useSystemSettingsValues }}'
240
+ },
241
+ 'x-component': 'div',
242
+ type: 'void',
243
+ title: '{{t("System settings")}}',
244
+ properties: {
245
+ title: {
246
+ type: 'string',
247
+ title: "{{t('System title')}}",
248
+ 'x-decorator': 'FormItem',
249
+ 'x-component': 'Input',
250
+ required: true
251
+ },
252
+ logo: {
253
+ type: 'string',
254
+ title: "{{t('Logo')}}",
255
+ 'x-decorator': 'FormItem',
256
+ 'x-component': 'Upload.Attachment',
257
+ 'x-component-props': {
258
+ action: 'attachments:upload',
259
+ multiple: false // accept: 'jpg,png'
260
+
261
+ }
262
+ },
263
+ enabledLanguages: {
264
+ type: 'array',
265
+ title: '{{t("Enabled languages")}}',
266
+ 'x-component': 'Select',
267
+ 'x-component-props': {
268
+ mode: 'multiple'
269
+ },
270
+ 'x-decorator': 'FormItem',
271
+ enum: langs,
272
+ 'x-reactions': function xReactions(field) {
273
+ field.dataSource = langs.map(function (item) {
274
+ var _field$value2;
275
+
276
+ var label = item.label;
277
+
278
+ if (((_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : _field$value2[0]) === item.value) {
279
+ label += "(".concat(i18n.t('Default'), ")");
280
+ }
281
+
282
+ return {
283
+ label: label,
284
+ value: item.value
285
+ };
286
+ });
287
+ }
288
+ },
289
+ allowSignUp: {
290
+ type: 'boolean',
291
+ default: true,
292
+ 'x-content': '{{t("Allow sign up")}}',
293
+ 'x-component': 'Checkbox',
294
+ 'x-decorator': 'FormItem'
295
+ },
296
+ smsAuthEnabled: {
297
+ type: 'boolean',
298
+ default: false,
299
+ 'x-content': '{{t("Enable SMS authentication")}}',
300
+ 'x-component': 'Checkbox',
301
+ 'x-decorator': 'FormItem'
302
+ },
303
+ footer1: {
304
+ type: 'void',
305
+ 'x-component': 'ActionBar',
306
+ 'x-component-props': {
307
+ layout: 'one-column'
308
+ },
309
+ properties: {
213
310
  submit: {
214
311
  title: 'Submit',
215
312
  'x-component': 'Action',
@@ -218,20 +315,52 @@ var schema = {
218
315
  htmlType: 'submit',
219
316
  useAction: '{{ useSaveSystemSettingsValues }}'
220
317
  }
221
- }
318
+ } // cancel: {
319
+ // title: 'Cancel',
320
+ // 'x-component': 'Action',
321
+ // 'x-component-props': {
322
+ // useAction: '{{ useCloseAction }}',
323
+ // },
324
+ // },
325
+
222
326
  }
223
327
  }
224
328
  }
225
329
  })
226
330
  };
331
+ export var SystemSettingsPane = function SystemSettingsPane() {
332
+ return /*#__PURE__*/React.createElement(Card, {
333
+ bordered: false
334
+ }, /*#__PURE__*/React.createElement(SchemaComponent, {
335
+ scope: {
336
+ useSaveSystemSettingsValues: useSaveSystemSettingsValues,
337
+ useSystemSettingsValues: useSystemSettingsValues,
338
+ useCloseAction: useCloseAction
339
+ },
340
+ schema: schema2
341
+ }));
342
+ };
227
343
  export var SystemSettingsShortcut = function SystemSettingsShortcut() {
344
+ var _useTranslation2 = useTranslation(),
345
+ t = _useTranslation2.t;
346
+
347
+ var history = useHistory();
348
+ return /*#__PURE__*/React.createElement(PluginManager.Toolbar.Item, {
349
+ icon: /*#__PURE__*/React.createElement(SettingOutlined, null),
350
+ title: t('System settings'),
351
+ onClick: function onClick() {
352
+ history.push('/admin/settings/system-settings/system-settings');
353
+ }
354
+ });
355
+ };
356
+ export var SystemSettingsShortcut2 = function SystemSettingsShortcut2() {
228
357
  var _useState = useState(false),
229
358
  _useState2 = _slicedToArray(_useState, 2),
230
359
  visible = _useState2[0],
231
360
  setVisible = _useState2[1];
232
361
 
233
- var _useTranslation = useTranslation(),
234
- t = _useTranslation.t;
362
+ var _useTranslation3 = useTranslation(),
363
+ t = _useTranslation3.t;
235
364
 
236
365
  return /*#__PURE__*/React.createElement(ActionContext.Provider, {
237
366
  value: {
@@ -1 +1,3 @@
1
+ export declare const ACLPane: () => JSX.Element;
1
2
  export declare const ACLShortcut: () => JSX.Element;
3
+ export declare const ACLShortcut2: () => 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.ACLShortcut = void 0;
8
+ exports.ACLShortcut2 = exports.ACLShortcut = exports.ACLPane = 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");
@@ -53,15 +57,48 @@ var schema = {
53
57
  }
54
58
  })
55
59
  };
60
+ var schema2 = {
61
+ type: 'object',
62
+ properties: _defineProperty({}, (0, _shared.uid)(), {
63
+ 'x-component': 'RoleTable'
64
+ })
65
+ };
66
+
67
+ var ACLPane = function ACLPane() {
68
+ return /*#__PURE__*/_react.default.createElement(_antd.Card, {
69
+ bordered: false
70
+ }, /*#__PURE__*/_react.default.createElement(_schemaComponent.SchemaComponent, {
71
+ components: components,
72
+ schema: schema2
73
+ }));
74
+ };
75
+
76
+ exports.ACLPane = ACLPane;
56
77
 
57
78
  var ACLShortcut = function ACLShortcut() {
79
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
80
+ t = _useTranslation.t;
81
+
82
+ var history = (0, _reactRouterDom.useHistory)();
83
+ return /*#__PURE__*/_react.default.createElement(_pluginManager.PluginManager.Toolbar.Item, {
84
+ icon: /*#__PURE__*/_react.default.createElement(_icons.LockOutlined, null),
85
+ title: t('Roles & Permissions'),
86
+ onClick: function onClick() {
87
+ history.push('/admin/settings/acl/roles');
88
+ }
89
+ });
90
+ };
91
+
92
+ exports.ACLShortcut = ACLShortcut;
93
+
94
+ var ACLShortcut2 = function ACLShortcut2() {
58
95
  var _useState = (0, _react.useState)(false),
59
96
  _useState2 = _slicedToArray(_useState, 2),
60
97
  visible = _useState2[0],
61
98
  setVisible = _useState2[1];
62
99
 
63
- var _useTranslation = (0, _reactI18next.useTranslation)(),
64
- t = _useTranslation.t;
100
+ var _useTranslation2 = (0, _reactI18next.useTranslation)(),
101
+ t = _useTranslation2.t;
65
102
 
66
103
  return /*#__PURE__*/_react.default.createElement(_schemaComponent.ActionContext.Provider, {
67
104
  value: {
@@ -80,4 +117,4 @@ var ACLShortcut = function ACLShortcut() {
80
117
  }));
81
118
  };
82
119
 
83
- exports.ACLShortcut = ACLShortcut;
120
+ exports.ACLShortcut2 = ACLShortcut2;
@@ -2,6 +2,7 @@ import { APIClient as APIClientSDK } from '@nocobase/sdk';
2
2
  import { Result } from 'ahooks/lib/useRequest/src/types';
3
3
  export declare class APIClient extends APIClientSDK {
4
4
  services: Record<string, Result<any, any>>;
5
+ service(uid: string): Result<any, any>;
5
6
  interceptors(): void;
6
7
  notification(): void;
7
8
  }
@@ -54,11 +54,16 @@ var APIClient = /*#__PURE__*/function (_APIClientSDK) {
54
54
  }
55
55
 
56
56
  _this = _super.call.apply(_super, [this].concat(args));
57
- _this.services = void 0;
57
+ _this.services = {};
58
58
  return _this;
59
59
  }
60
60
 
61
61
  _createClass(APIClient, [{
62
+ key: "service",
63
+ value: function service(uid) {
64
+ return this.services[uid];
65
+ }
66
+ }, {
62
67
  key: "interceptors",
63
68
  value: function interceptors() {
64
69
  _get(_getPrototypeOf(APIClient.prototype), "interceptors", this).call(this);
@@ -4,6 +4,7 @@ export interface ApplicationOptions {
4
4
  apiClient?: any;
5
5
  i18n?: any;
6
6
  plugins?: any[];
7
+ dynamicImport?: any;
7
8
  }
8
9
  export declare const getCurrentTimezone: () => string;
9
10
  export declare type PluginCallback = () => Promise<any>;
@@ -13,6 +14,7 @@ export declare class Application {
13
14
  apiClient: APIClient;
14
15
  i18n: i18next;
15
16
  plugins: PluginCallback[];
17
+ options: ApplicationOptions;
16
18
  constructor(options: ApplicationOptions);
17
19
  use(component: any, props?: any): void;
18
20
  main(mainComponent: any): void;
@@ -20,5 +22,5 @@ export declare class Application {
20
22
  * TODO
21
23
  */
22
24
  plugin(plugin: PluginCallback): void;
23
- render(): (props?: any) => JSX.Element;
25
+ render(): (props: any) => JSX.Element;
24
26
  }