@nocobase/client 0.7.7-alpha.1 → 0.8.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/es/acl/ACLShortcut.d.ts +2 -0
  2. package/es/acl/ACLShortcut.js +31 -2
  3. package/es/application/Application.d.ts +3 -1
  4. package/es/application/Application.js +131 -39
  5. package/es/block-provider/CalendarBlockProvider.d.ts +1 -0
  6. package/es/block-provider/CalendarBlockProvider.js +6 -3
  7. package/es/block-provider/TableSelectorProvider.js +21 -6
  8. package/es/block-provider/hooks/index.d.ts +6 -0
  9. package/es/block-provider/hooks/index.js +485 -115
  10. package/es/collection-manager/CollectionManagerProvider.js +26 -45
  11. package/es/collection-manager/CollectionManagerShortcut.d.ts +2 -0
  12. package/es/collection-manager/CollectionManagerShortcut.js +38 -3
  13. package/es/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
  14. package/es/collection-manager/Configuration/AddFieldAction.js +44 -13
  15. package/es/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
  16. package/es/collection-manager/Configuration/EditFieldAction.js +24 -11
  17. package/es/collection-manager/Configuration/index.d.ts +2 -0
  18. package/es/collection-manager/Configuration/index.js +2 -0
  19. package/es/collection-manager/Configuration/schemas/collectionFields.js +2 -2
  20. package/es/collection-manager/index.d.ts +1 -0
  21. package/es/collection-manager/index.js +2 -1
  22. package/es/collection-manager/interfaces/index.d.ts +1 -0
  23. package/es/collection-manager/interfaces/index.js +1 -0
  24. package/es/collection-manager/interfaces/json.d.ts +2 -0
  25. package/es/collection-manager/interfaces/json.js +48 -0
  26. package/es/collection-manager/interfaces/m2o.js +3 -3
  27. package/es/collection-manager/interfaces/o2m.js +5 -6
  28. package/es/collection-manager/interfaces/o2o.js +5 -5
  29. package/es/collection-manager/interfaces/properties/index.d.ts +14 -0
  30. package/es/collection-manager/interfaces/properties/index.js +23 -0
  31. package/es/collection-manager/interfaces/sequence.js +13 -9
  32. package/es/index.d.ts +1 -0
  33. package/es/index.js +1 -0
  34. package/es/locale/en_US.d.ts +13 -1
  35. package/es/locale/en_US.js +14 -2
  36. package/es/locale/ja_JP.d.ts +1 -1
  37. package/es/locale/ja_JP.js +1 -1
  38. package/es/locale/ru_RU.d.ts +1 -1
  39. package/es/locale/ru_RU.js +1 -1
  40. package/es/locale/tr_TR.d.ts +1 -1
  41. package/es/locale/tr_TR.js +1 -1
  42. package/es/locale/zh_CN.d.ts +39 -1
  43. package/es/locale/zh_CN.js +40 -2
  44. package/es/plugin-manager/PluginManager.js +35 -23
  45. package/es/pm/PluginManagerLink.d.ts +2 -0
  46. package/es/pm/PluginManagerLink.js +111 -0
  47. package/es/pm/index.d.ts +4 -0
  48. package/es/pm/index.js +422 -0
  49. package/es/route-switch/antd/admin-layout/index.js +1 -1
  50. package/es/schema-component/antd/action/Action.Designer.js +35 -12
  51. package/es/schema-component/antd/action/Action.Modal.js +4 -2
  52. package/es/schema-component/antd/action/Action.js +3 -3
  53. package/es/schema-component/antd/action/context.d.ts +2 -0
  54. package/es/schema-component/antd/action/hooks.d.ts +1 -0
  55. package/es/schema-component/antd/calendar/Calendar.Designer.js +19 -6
  56. package/es/schema-component/antd/calendar/Calendar.js +23 -2
  57. package/es/schema-component/antd/calendar/Title.js +18 -3
  58. package/es/schema-component/antd/calendar/components/Header.d.ts +10 -0
  59. package/es/schema-component/antd/calendar/components/Header.js +43 -0
  60. package/es/schema-component/antd/calendar/style.less +53 -9
  61. package/es/schema-component/antd/calendar/types.d.ts +6 -0
  62. package/es/schema-component/antd/calendar/utils.d.ts +2 -0
  63. package/es/schema-component/antd/calendar/utils.js +7 -0
  64. package/es/schema-component/antd/checkbox/Checkbox.js +13 -4
  65. package/es/schema-component/antd/formula-input/FormulaInput.js +28 -37
  66. package/es/schema-component/antd/input/Input.d.ts +1 -0
  67. package/es/schema-component/antd/input/Input.js +2 -0
  68. package/es/schema-component/antd/input/Json.d.ts +6 -0
  69. package/es/schema-component/antd/input/Json.js +41 -0
  70. package/es/schema-component/antd/input/ReadPretty.d.ts +3 -0
  71. package/es/schema-component/antd/input/ReadPretty.js +15 -0
  72. package/es/schema-component/antd/input/index.d.ts +1 -0
  73. package/es/schema-component/antd/input/index.js +2 -1
  74. package/es/schema-component/antd/markdown/Markdown.Void.js +5 -2
  75. package/es/schema-component/antd/radio/Radio.js +2 -1
  76. package/es/schema-component/antd/select/ReadPretty.js +2 -1
  77. package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +16 -2
  78. package/es/schema-component/antd/upload/Upload.js +2 -1
  79. package/es/schema-component/antd/upload/shared.js +5 -6
  80. package/es/schema-component/antd/upload/type.d.ts +2 -0
  81. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
  82. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +50 -0
  83. package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
  84. package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +35 -0
  85. package/es/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
  86. package/es/schema-initializer/buttons/FormActionInitializers.js +118 -0
  87. package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
  88. package/es/schema-initializer/buttons/TabPaneInitializers.js +13 -0
  89. package/es/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
  90. package/es/schema-initializer/buttons/TableActionInitializers.js +45 -0
  91. package/es/schema-initializer/buttons/index.d.ts +2 -0
  92. package/es/schema-initializer/buttons/index.js +2 -0
  93. package/es/schema-initializer/components/BulkEditField.d.ts +7 -0
  94. package/es/schema-initializer/components/BulkEditField.js +187 -0
  95. package/es/schema-initializer/components/index.d.ts +1 -0
  96. package/es/schema-initializer/components/index.js +2 -1
  97. package/es/schema-initializer/items/BlockInitializer.js +8 -8
  98. package/es/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
  99. package/es/schema-initializer/items/BulkEditSubmitActionInitializer.js +24 -0
  100. package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
  101. package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +103 -0
  102. package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
  103. package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +61 -0
  104. package/es/schema-initializer/items/index.d.ts +3 -0
  105. package/es/schema-initializer/items/index.js +3 -0
  106. package/es/schema-initializer/utils.d.ts +1 -0
  107. package/es/schema-initializer/utils.js +67 -12
  108. package/es/schema-settings/SchemaSettings.d.ts +6 -0
  109. package/es/schema-settings/SchemaSettings.js +4 -1
  110. package/es/schema-templates/BlockTemplatePage.d.ts +1 -0
  111. package/es/schema-templates/BlockTemplatePage.js +7 -0
  112. package/es/schema-templates/SchemaTemplateShortcut.js +1 -1
  113. package/es/system-settings/SystemSettingsShortcut.d.ts +2 -0
  114. package/es/system-settings/SystemSettingsShortcut.js +134 -5
  115. package/lib/acl/ACLShortcut.d.ts +2 -0
  116. package/lib/acl/ACLShortcut.js +41 -4
  117. package/lib/application/Application.d.ts +3 -1
  118. package/lib/application/Application.js +139 -39
  119. package/lib/block-provider/CalendarBlockProvider.d.ts +1 -0
  120. package/lib/block-provider/CalendarBlockProvider.js +6 -3
  121. package/lib/block-provider/TableSelectorProvider.js +21 -6
  122. package/lib/block-provider/hooks/index.d.ts +6 -0
  123. package/lib/block-provider/hooks/index.js +496 -115
  124. package/lib/collection-manager/CollectionManagerProvider.js +28 -47
  125. package/lib/collection-manager/CollectionManagerShortcut.d.ts +2 -0
  126. package/lib/collection-manager/CollectionManagerShortcut.js +47 -4
  127. package/lib/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
  128. package/lib/collection-manager/Configuration/AddFieldAction.js +48 -12
  129. package/lib/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
  130. package/lib/collection-manager/Configuration/EditFieldAction.js +26 -10
  131. package/lib/collection-manager/Configuration/index.d.ts +2 -0
  132. package/lib/collection-manager/Configuration/index.js +26 -0
  133. package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -2
  134. package/lib/collection-manager/index.d.ts +1 -0
  135. package/lib/collection-manager/index.js +14 -0
  136. package/lib/collection-manager/interfaces/index.d.ts +1 -0
  137. package/lib/collection-manager/interfaces/index.js +13 -0
  138. package/lib/collection-manager/interfaces/json.d.ts +2 -0
  139. package/lib/collection-manager/interfaces/json.js +58 -0
  140. package/lib/collection-manager/interfaces/m2o.js +2 -2
  141. package/lib/collection-manager/interfaces/o2m.js +4 -5
  142. package/lib/collection-manager/interfaces/o2o.js +4 -4
  143. package/lib/collection-manager/interfaces/properties/index.d.ts +14 -0
  144. package/lib/collection-manager/interfaces/properties/index.js +25 -1
  145. package/lib/collection-manager/interfaces/sequence.js +13 -9
  146. package/lib/index.d.ts +1 -0
  147. package/lib/index.js +13 -0
  148. package/lib/locale/en_US.d.ts +13 -1
  149. package/lib/locale/en_US.js +14 -2
  150. package/lib/locale/ja_JP.d.ts +1 -1
  151. package/lib/locale/ja_JP.js +1 -1
  152. package/lib/locale/ru_RU.d.ts +1 -1
  153. package/lib/locale/ru_RU.js +1 -1
  154. package/lib/locale/tr_TR.d.ts +1 -1
  155. package/lib/locale/tr_TR.js +1 -1
  156. package/lib/locale/zh_CN.d.ts +39 -1
  157. package/lib/locale/zh_CN.js +40 -2
  158. package/lib/plugin-manager/PluginManager.js +33 -21
  159. package/lib/pm/PluginManagerLink.d.ts +2 -0
  160. package/lib/pm/PluginManagerLink.js +138 -0
  161. package/lib/pm/index.d.ts +4 -0
  162. package/lib/pm/index.js +474 -0
  163. package/lib/route-switch/antd/admin-layout/index.js +1 -1
  164. package/lib/schema-component/antd/action/Action.Designer.js +35 -12
  165. package/lib/schema-component/antd/action/Action.Modal.js +4 -2
  166. package/lib/schema-component/antd/action/Action.js +3 -3
  167. package/lib/schema-component/antd/action/context.d.ts +2 -0
  168. package/lib/schema-component/antd/action/hooks.d.ts +1 -0
  169. package/lib/schema-component/antd/calendar/Calendar.Designer.js +19 -6
  170. package/lib/schema-component/antd/calendar/Calendar.js +24 -2
  171. package/lib/schema-component/antd/calendar/Title.js +18 -2
  172. package/lib/schema-component/antd/calendar/components/Header.d.ts +10 -0
  173. package/lib/schema-component/antd/calendar/components/Header.js +57 -0
  174. package/lib/schema-component/antd/calendar/style.less +53 -9
  175. package/lib/schema-component/antd/calendar/types.d.ts +6 -0
  176. package/lib/schema-component/antd/calendar/utils.d.ts +2 -0
  177. package/lib/schema-component/antd/calendar/utils.js +18 -2
  178. package/lib/schema-component/antd/checkbox/Checkbox.js +13 -4
  179. package/lib/schema-component/antd/formula-input/FormulaInput.js +28 -37
  180. package/lib/schema-component/antd/input/Input.d.ts +1 -0
  181. package/lib/schema-component/antd/input/Input.js +3 -0
  182. package/lib/schema-component/antd/input/Json.d.ts +6 -0
  183. package/lib/schema-component/antd/input/Json.js +53 -0
  184. package/lib/schema-component/antd/input/ReadPretty.d.ts +3 -0
  185. package/lib/schema-component/antd/input/ReadPretty.js +16 -0
  186. package/lib/schema-component/antd/input/index.d.ts +1 -0
  187. package/lib/schema-component/antd/input/index.js +13 -0
  188. package/lib/schema-component/antd/markdown/Markdown.Void.js +8 -2
  189. package/lib/schema-component/antd/radio/Radio.js +2 -1
  190. package/lib/schema-component/antd/select/ReadPretty.js +2 -1
  191. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +17 -2
  192. package/lib/schema-component/antd/upload/Upload.js +2 -1
  193. package/lib/schema-component/antd/upload/shared.js +4 -5
  194. package/lib/schema-component/antd/upload/type.d.ts +2 -0
  195. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
  196. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +66 -0
  197. package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
  198. package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +50 -0
  199. package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
  200. package/lib/schema-initializer/buttons/FormActionInitializers.js +121 -2
  201. package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
  202. package/lib/schema-initializer/buttons/TabPaneInitializers.js +18 -2
  203. package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
  204. package/lib/schema-initializer/buttons/TableActionInitializers.js +45 -0
  205. package/lib/schema-initializer/buttons/index.d.ts +2 -0
  206. package/lib/schema-initializer/buttons/index.js +26 -0
  207. package/lib/schema-initializer/components/BulkEditField.d.ts +7 -0
  208. package/lib/schema-initializer/components/BulkEditField.js +210 -0
  209. package/lib/schema-initializer/components/index.d.ts +1 -0
  210. package/lib/schema-initializer/components/index.js +13 -0
  211. package/lib/schema-initializer/items/BlockInitializer.js +8 -7
  212. package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
  213. package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.js +37 -0
  214. package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
  215. package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +121 -0
  216. package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
  217. package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +74 -0
  218. package/lib/schema-initializer/items/index.d.ts +3 -0
  219. package/lib/schema-initializer/items/index.js +39 -0
  220. package/lib/schema-initializer/utils.d.ts +1 -0
  221. package/lib/schema-initializer/utils.js +71 -13
  222. package/lib/schema-settings/SchemaSettings.d.ts +6 -0
  223. package/lib/schema-settings/SchemaSettings.js +3 -0
  224. package/lib/schema-templates/BlockTemplatePage.d.ts +1 -0
  225. package/lib/schema-templates/BlockTemplatePage.js +12 -2
  226. package/lib/schema-templates/SchemaTemplateShortcut.js +1 -1
  227. package/lib/system-settings/SystemSettingsShortcut.d.ts +2 -0
  228. package/lib/system-settings/SystemSettingsShortcut.js +145 -7
  229. package/package.json +5 -4
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useTableColumnInitializerFields = exports.useRemoveGridFormItem = exports.useRecordCollectionDataSourceItems = exports.useFormItemInitializerFields = exports.useCustomFormItemInitializerFields = exports.useCurrentSchema = exports.useCollectionDataSourceItems = exports.useAssociatedTableColumnInitializerFields = exports.useAssociatedFormItemInitializerFields = exports.removeTableColumn = exports.removeGridFormItem = exports.itemsMerge = exports.gridRowColWrap = exports.findTableColumn = exports.createTableSelectorSchema = exports.createTableBlockSchema = exports.createReadPrettyFormBlockSchema = exports.createKanbanBlockSchema = exports.createFormBlockSchema = exports.createDetailsBlockSchema = exports.createCalendarBlockSchema = void 0;
6
+ exports.useTableColumnInitializerFields = exports.useRemoveGridFormItem = exports.useRecordCollectionDataSourceItems = exports.useFormItemInitializerFields = exports.useCustomFormItemInitializerFields = exports.useCustomBulkEditFormItemInitializerFields = exports.useCurrentSchema = exports.useCollectionDataSourceItems = exports.useAssociatedTableColumnInitializerFields = exports.useAssociatedFormItemInitializerFields = exports.removeTableColumn = exports.removeGridFormItem = exports.itemsMerge = exports.gridRowColWrap = exports.findTableColumn = exports.createTableSelectorSchema = exports.createTableBlockSchema = exports.createReadPrettyFormBlockSchema = exports.createKanbanBlockSchema = exports.createFormBlockSchema = exports.createDetailsBlockSchema = exports.createCalendarBlockSchema = void 0;
7
7
 
8
8
  var _react = require("@formily/react");
9
9
 
@@ -246,7 +246,7 @@ var useFormItemInitializerFields = function useFormItemInitializerFields(options
246
246
  return fields === null || fields === void 0 ? void 0 : (_fields$filter2 = fields.filter(function (field) {
247
247
  return field === null || field === void 0 ? void 0 : field.interface;
248
248
  })) === null || _fields$filter2 === void 0 ? void 0 : _fields$filter2.map(function (field) {
249
- var _field$uiSchema3;
249
+ var _field$uiSchema3, _field$uiSchema4;
250
250
 
251
251
  var interfaceConfig = getInterface(field.interface);
252
252
  var schema = {
@@ -257,12 +257,13 @@ var useFormItemInitializerFields = function useFormItemInitializerFields(options
257
257
  'x-component': field.interface === 'o2m' ? 'TableField' : 'CollectionField',
258
258
  'x-decorator': 'FormItem',
259
259
  'x-collection-field': "".concat(name, ".").concat(field.name),
260
- 'x-component-props': {}
260
+ 'x-component-props': {},
261
+ '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']
261
262
  }; // interfaceConfig?.schemaInitialize?.(schema, { field, block: 'Form', readPretty: form.readPretty });
262
263
 
263
264
  return {
264
265
  type: 'item',
265
- title: (field === null || field === void 0 ? void 0 : (_field$uiSchema3 = field.uiSchema) === null || _field$uiSchema3 === void 0 ? void 0 : _field$uiSchema3.title) || field.name,
266
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema4 = field.uiSchema) === null || _field$uiSchema4 === void 0 ? void 0 : _field$uiSchema4.title) || field.name,
266
267
  component: 'CollectionFieldInitializer',
267
268
  remove: removeGridFormItem,
268
269
  schemaInitialize: function schemaInitialize(s) {
@@ -304,7 +305,7 @@ var useAssociatedFormItemInitializerFields = function useAssociatedFormItemIniti
304
305
  var groups = fields === null || fields === void 0 ? void 0 : (_fields$filter3 = fields.filter(function (field) {
305
306
  return interfaces.includes(field.interface);
306
307
  })) === null || _fields$filter3 === void 0 ? void 0 : _fields$filter3.map(function (field) {
307
- var _subFields$filter2, _field$uiSchema4;
308
+ var _subFields$filter2, _field$uiSchema5;
308
309
 
309
310
  var subFields = getCollectionFields(field.target);
310
311
  var items = subFields === null || subFields === void 0 ? void 0 : (_subFields$filter2 = subFields.filter(function (subField) {
@@ -346,7 +347,7 @@ var useAssociatedFormItemInitializerFields = function useAssociatedFormItemIniti
346
347
  });
347
348
  return {
348
349
  type: 'subMenu',
349
- title: (_field$uiSchema4 = field.uiSchema) === null || _field$uiSchema4 === void 0 ? void 0 : _field$uiSchema4.title,
350
+ title: (_field$uiSchema5 = field.uiSchema) === null || _field$uiSchema5 === void 0 ? void 0 : _field$uiSchema5.title,
350
351
  children: items
351
352
  };
352
353
  });
@@ -375,17 +376,17 @@ var useCustomFormItemInitializerFields = function useCustomFormItemInitializerFi
375
376
 
376
377
  var remove = useRemoveGridFormItem();
377
378
  return fields === null || fields === void 0 ? void 0 : (_fields$filter4 = fields.filter(function (field) {
378
- var _field$uiSchema5;
379
+ var _field$uiSchema6;
379
380
 
380
- 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']);
381
+ 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']);
381
382
  })) === null || _fields$filter4 === void 0 ? void 0 : _fields$filter4.map(function (field) {
382
- var _field$uiSchema6, _field$uiSchema7;
383
+ var _field$uiSchema7, _field$uiSchema8;
383
384
 
384
385
  var interfaceConfig = getInterface(field.interface);
385
386
  var schema = {
386
387
  type: 'string',
387
388
  name: field.name,
388
- title: (field === null || field === void 0 ? void 0 : (_field$uiSchema6 = field.uiSchema) === null || _field$uiSchema6 === void 0 ? void 0 : _field$uiSchema6.title) || field.name,
389
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema7 = field.uiSchema) === null || _field$uiSchema7 === void 0 ? void 0 : _field$uiSchema7.title) || field.name,
389
390
  'x-designer': 'FormItem.Designer',
390
391
  'x-component': 'AssignedField',
391
392
  'x-decorator': 'FormItem',
@@ -393,7 +394,7 @@ var useCustomFormItemInitializerFields = function useCustomFormItemInitializerFi
393
394
  };
394
395
  return {
395
396
  type: 'item',
396
- title: (field === null || field === void 0 ? void 0 : (_field$uiSchema7 = field.uiSchema) === null || _field$uiSchema7 === void 0 ? void 0 : _field$uiSchema7.title) || field.name,
397
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema8 = field.uiSchema) === null || _field$uiSchema8 === void 0 ? void 0 : _field$uiSchema8.title) || field.name,
397
398
  component: 'CollectionFieldInitializer',
398
399
  remove: remove,
399
400
  schemaInitialize: function schemaInitialize(s) {
@@ -412,6 +413,63 @@ var useCustomFormItemInitializerFields = function useCustomFormItemInitializerFi
412
413
 
413
414
  exports.useCustomFormItemInitializerFields = useCustomFormItemInitializerFields;
414
415
 
416
+ var useCustomBulkEditFormItemInitializerFields = function useCustomBulkEditFormItemInitializerFields(options) {
417
+ var _fields$filter5;
418
+
419
+ var _useCollection6 = (0, _collectionManager.useCollection)(),
420
+ name = _useCollection6.name,
421
+ fields = _useCollection6.fields;
422
+
423
+ var _useCollectionManager6 = (0, _collectionManager.useCollectionManager)(),
424
+ getInterface = _useCollectionManager6.getInterface;
425
+
426
+ var form = (0, _react.useForm)();
427
+
428
+ var _ref4 = options || {},
429
+ _ref4$readPretty = _ref4.readPretty,
430
+ readPretty = _ref4$readPretty === void 0 ? form.readPretty : _ref4$readPretty,
431
+ _ref4$block = _ref4.block,
432
+ block = _ref4$block === void 0 ? 'Form' : _ref4$block;
433
+
434
+ var remove = useRemoveGridFormItem();
435
+ return fields === null || fields === void 0 ? void 0 : (_fields$filter5 = fields.filter(function (field) {
436
+ var _field$uiSchema9;
437
+
438
+ 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']);
439
+ })) === null || _fields$filter5 === void 0 ? void 0 : _fields$filter5.map(function (field) {
440
+ var _field$uiSchema10, _field$uiSchema11;
441
+
442
+ var interfaceConfig = getInterface(field.interface);
443
+ var schema = {
444
+ type: 'string',
445
+ name: field.name,
446
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema10 = field.uiSchema) === null || _field$uiSchema10 === void 0 ? void 0 : _field$uiSchema10.title) || field.name,
447
+ 'x-designer': 'FormItem.Designer',
448
+ 'x-component': 'BulkEditField',
449
+ 'x-decorator': 'FormItem',
450
+ 'x-collection-field': "".concat(name, ".").concat(field.name)
451
+ };
452
+ return {
453
+ type: 'item',
454
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema11 = field.uiSchema) === null || _field$uiSchema11 === void 0 ? void 0 : _field$uiSchema11.title) || field.name,
455
+ component: 'CollectionFieldInitializer',
456
+ remove: remove,
457
+ schemaInitialize: function schemaInitialize(s) {
458
+ var _interfaceConfig$sche6;
459
+
460
+ interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$sche6 = interfaceConfig.schemaInitialize) === null || _interfaceConfig$sche6 === void 0 ? void 0 : _interfaceConfig$sche6.call(interfaceConfig, s, {
461
+ field: field,
462
+ block: block,
463
+ readPretty: readPretty
464
+ });
465
+ },
466
+ schema: schema
467
+ };
468
+ });
469
+ };
470
+
471
+ exports.useCustomBulkEditFormItemInitializerFields = useCustomBulkEditFormItemInitializerFields;
472
+
415
473
  var findSchema = function findSchema(schema, key, action) {
416
474
  if (!_react.Schema.isSchemaInstance(schema)) return null;
417
475
  return schema.reduceProperties(function (buf, s) {
@@ -544,8 +602,8 @@ var useCollectionDataSourceItems = function useCollectionDataSourceItems(compone
544
602
  var _useTranslation2 = (0, _reactI18next.useTranslation)(),
545
603
  t = _useTranslation2.t;
546
604
 
547
- var _useCollectionManager6 = (0, _collectionManager.useCollectionManager)(),
548
- collections = _useCollectionManager6.collections;
605
+ var _useCollectionManager7 = (0, _collectionManager.useCollectionManager)(),
606
+ collections = _useCollectionManager7.collections;
549
607
 
550
608
  var _useSchemaTemplateMan2 = (0, _schemaTemplates.useSchemaTemplateManager)(),
551
609
  getTemplatesByCollection = _useSchemaTemplateMan2.getTemplatesByCollection;
@@ -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 {};
@@ -581,6 +581,7 @@ SchemaSettings.Remove = function (props) {
581
581
  var field = (0, _react.useField)();
582
582
  var fieldSchema = (0, _react.useFieldSchema)();
583
583
  var ctx = (0, _BlockTemplate.useBlockTemplateContext)();
584
+ var form = (0, _react.useForm)();
584
585
  return /*#__PURE__*/_react2.default.createElement(SchemaSettings.Item, {
585
586
  onClick: function onClick() {
586
587
  _antd2.Modal.confirm(_objectSpread(_objectSpread({
@@ -603,6 +604,8 @@ SchemaSettings.Remove = function (props) {
603
604
  } else {
604
605
  dn.remove(null, options);
605
606
  }
607
+
608
+ delete form.values[fieldSchema.name];
606
609
  }
607
610
  }));
608
611
  }
@@ -1 +1,2 @@
1
1
  export declare const BlockTemplatePage: () => JSX.Element;
2
+ export declare const BlockTemplatesPane: () => JSX.Element;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.BlockTemplatePage = void 0;
6
+ exports.BlockTemplatesPane = exports.BlockTemplatePage = void 0;
7
7
 
8
8
  var _antd = require("antd");
9
9
 
@@ -39,4 +39,14 @@ var BlockTemplatePage = function BlockTemplatePage() {
39
39
  }))));
40
40
  };
41
41
 
42
- exports.BlockTemplatePage = BlockTemplatePage;
42
+ exports.BlockTemplatePage = BlockTemplatePage;
43
+
44
+ var BlockTemplatesPane = function BlockTemplatesPane() {
45
+ return /*#__PURE__*/_react.default.createElement(_collectionManager.CollectionManagerProvider, {
46
+ collections: [_uiSchemaTemplates.uiSchemaTemplatesCollection]
47
+ }, /*#__PURE__*/_react.default.createElement(_schemaComponent.SchemaComponent, {
48
+ schema: _uiSchemaTemplates2.uiSchemaTemplatesSchema
49
+ }));
50
+ };
51
+
52
+ exports.BlockTemplatesPane = BlockTemplatesPane;
@@ -26,7 +26,7 @@ var SchemaTemplateShortcut = function SchemaTemplateShortcut() {
26
26
  icon: /*#__PURE__*/_react.default.createElement(_icons.LayoutOutlined, null),
27
27
  title: t('Block templates'),
28
28
  onClick: function onClick() {
29
- history.push('/admin/plugins/block-templates');
29
+ history.push('/admin/settings/block-templates/list');
30
30
  }
31
31
  });
32
32
  };
@@ -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;
@@ -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.SystemSettingsShortcut = void 0;
8
+ exports.SystemSettingsShortcut2 = exports.SystemSettingsShortcut = exports.SystemSettingsPane = void 0;
9
9
 
10
10
  var _icons = require("@ant-design/icons");
11
11
 
@@ -13,12 +13,16 @@ var _react = require("@formily/react");
13
13
 
14
14
  var _shared = require("@formily/shared");
15
15
 
16
+ var _antd = require("antd");
17
+
16
18
  var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
17
19
 
18
20
  var _react2 = _interopRequireWildcard(require("react"));
19
21
 
20
22
  var _reactI18next = require("react-i18next");
21
23
 
24
+ var _reactRouterDom = require("react-router-dom");
25
+
22
26
  var _ = require(".");
23
27
 
24
28
  var _2 = require("..");
@@ -109,6 +113,10 @@ var useSaveSystemSettingsValues = function useSaveSystemSettingsValues() {
109
113
  data = _useSystemSettings.data;
110
114
 
111
115
  var api = (0, _2.useAPIClient)();
116
+
117
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
118
+ t = _useTranslation.t;
119
+
112
120
  return {
113
121
  run: function run() {
114
122
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
@@ -135,6 +143,8 @@ var useSaveSystemSettingsValues = function useSaveSystemSettingsValues() {
135
143
  });
136
144
 
137
145
  case 6:
146
+ _antd.message.success(t('Saved successfully'));
147
+
138
148
  lang = ((_values$enabledLangua = values.enabledLanguages) === null || _values$enabledLangua === void 0 ? void 0 : _values$enabledLangua[0]) || 'en-US';
139
149
 
140
150
  if (values.enabledLanguages.length < 2 && api.auth.getLocale() !== lang) {
@@ -144,7 +154,7 @@ var useSaveSystemSettingsValues = function useSaveSystemSettingsValues() {
144
154
  setVisible(false);
145
155
  }
146
156
 
147
- case 8:
157
+ case 9:
148
158
  case "end":
149
159
  return _context2.stop();
150
160
  }
@@ -228,13 +238,103 @@ var schema = {
228
238
  type: 'void',
229
239
  'x-component': 'Action.Drawer.Footer',
230
240
  properties: {
241
+ submit: {
242
+ title: 'Submit',
243
+ 'x-component': 'Action',
244
+ 'x-component-props': {
245
+ type: 'primary',
246
+ htmlType: 'submit',
247
+ useAction: '{{ useSaveSystemSettingsValues }}'
248
+ }
249
+ },
231
250
  cancel: {
232
251
  title: 'Cancel',
233
252
  'x-component': 'Action',
234
253
  'x-component-props': {
235
254
  useAction: '{{ useCloseAction }}'
236
255
  }
237
- },
256
+ }
257
+ }
258
+ }
259
+ }
260
+ })
261
+ };
262
+ var schema2 = {
263
+ type: 'object',
264
+ properties: _defineProperty({}, (0, _shared.uid)(), {
265
+ 'x-decorator': 'Form',
266
+ 'x-decorator-props': {
267
+ useValues: '{{ useSystemSettingsValues }}'
268
+ },
269
+ 'x-component': 'div',
270
+ type: 'void',
271
+ title: '{{t("System settings")}}',
272
+ properties: {
273
+ title: {
274
+ type: 'string',
275
+ title: "{{t('System title')}}",
276
+ 'x-decorator': 'FormItem',
277
+ 'x-component': 'Input',
278
+ required: true
279
+ },
280
+ logo: {
281
+ type: 'string',
282
+ title: "{{t('Logo')}}",
283
+ 'x-decorator': 'FormItem',
284
+ 'x-component': 'Upload.Attachment',
285
+ 'x-component-props': {
286
+ action: 'attachments:upload',
287
+ multiple: false // accept: 'jpg,png'
288
+
289
+ }
290
+ },
291
+ enabledLanguages: {
292
+ type: 'array',
293
+ title: '{{t("Enabled languages")}}',
294
+ 'x-component': 'Select',
295
+ 'x-component-props': {
296
+ mode: 'multiple'
297
+ },
298
+ 'x-decorator': 'FormItem',
299
+ enum: langs,
300
+ 'x-reactions': function xReactions(field) {
301
+ field.dataSource = langs.map(function (item) {
302
+ var _field$value2;
303
+
304
+ var label = item.label;
305
+
306
+ if (((_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : _field$value2[0]) === item.value) {
307
+ label += "(".concat(_2.i18n.t('Default'), ")");
308
+ }
309
+
310
+ return {
311
+ label: label,
312
+ value: item.value
313
+ };
314
+ });
315
+ }
316
+ },
317
+ allowSignUp: {
318
+ type: 'boolean',
319
+ default: true,
320
+ 'x-content': '{{t("Allow sign up")}}',
321
+ 'x-component': 'Checkbox',
322
+ 'x-decorator': 'FormItem'
323
+ },
324
+ smsAuthEnabled: {
325
+ type: 'boolean',
326
+ default: false,
327
+ 'x-content': '{{t("Enable SMS authentication")}}',
328
+ 'x-component': 'Checkbox',
329
+ 'x-decorator': 'FormItem'
330
+ },
331
+ footer1: {
332
+ type: 'void',
333
+ 'x-component': 'ActionBar',
334
+ 'x-component-props': {
335
+ layout: 'one-column'
336
+ },
337
+ properties: {
238
338
  submit: {
239
339
  title: 'Submit',
240
340
  'x-component': 'Action',
@@ -243,21 +343,59 @@ var schema = {
243
343
  htmlType: 'submit',
244
344
  useAction: '{{ useSaveSystemSettingsValues }}'
245
345
  }
246
- }
346
+ } // cancel: {
347
+ // title: 'Cancel',
348
+ // 'x-component': 'Action',
349
+ // 'x-component-props': {
350
+ // useAction: '{{ useCloseAction }}',
351
+ // },
352
+ // },
353
+
247
354
  }
248
355
  }
249
356
  }
250
357
  })
251
358
  };
252
359
 
360
+ var SystemSettingsPane = function SystemSettingsPane() {
361
+ return /*#__PURE__*/_react2.default.createElement(_antd.Card, {
362
+ bordered: false
363
+ }, /*#__PURE__*/_react2.default.createElement(_schemaComponent.SchemaComponent, {
364
+ scope: {
365
+ useSaveSystemSettingsValues: useSaveSystemSettingsValues,
366
+ useSystemSettingsValues: useSystemSettingsValues,
367
+ useCloseAction: useCloseAction
368
+ },
369
+ schema: schema2
370
+ }));
371
+ };
372
+
373
+ exports.SystemSettingsPane = SystemSettingsPane;
374
+
253
375
  var SystemSettingsShortcut = function SystemSettingsShortcut() {
376
+ var _useTranslation2 = (0, _reactI18next.useTranslation)(),
377
+ t = _useTranslation2.t;
378
+
379
+ var history = (0, _reactRouterDom.useHistory)();
380
+ return /*#__PURE__*/_react2.default.createElement(_2.PluginManager.Toolbar.Item, {
381
+ icon: /*#__PURE__*/_react2.default.createElement(_icons.SettingOutlined, null),
382
+ title: t('System settings'),
383
+ onClick: function onClick() {
384
+ history.push('/admin/settings/system-settings/system-settings');
385
+ }
386
+ });
387
+ };
388
+
389
+ exports.SystemSettingsShortcut = SystemSettingsShortcut;
390
+
391
+ var SystemSettingsShortcut2 = function SystemSettingsShortcut2() {
254
392
  var _useState = (0, _react2.useState)(false),
255
393
  _useState2 = _slicedToArray(_useState, 2),
256
394
  visible = _useState2[0],
257
395
  setVisible = _useState2[1];
258
396
 
259
- var _useTranslation = (0, _reactI18next.useTranslation)(),
260
- t = _useTranslation.t;
397
+ var _useTranslation3 = (0, _reactI18next.useTranslation)(),
398
+ t = _useTranslation3.t;
261
399
 
262
400
  return /*#__PURE__*/_react2.default.createElement(_schemaComponent.ActionContext.Provider, {
263
401
  value: {
@@ -281,4 +419,4 @@ var SystemSettingsShortcut = function SystemSettingsShortcut() {
281
419
  }));
282
420
  };
283
421
 
284
- exports.SystemSettingsShortcut = SystemSettingsShortcut;
422
+ exports.SystemSettingsShortcut2 = SystemSettingsShortcut2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/client",
3
- "version": "0.7.7-alpha.1",
3
+ "version": "0.8.0-alpha.4",
4
4
  "license": "Apache-2.0",
5
5
  "licenses": [
6
6
  {
@@ -19,8 +19,8 @@
19
19
  "@formily/antd": "2.0.20",
20
20
  "@formily/core": "2.0.20",
21
21
  "@formily/react": "2.0.20",
22
- "@nocobase/sdk": "0.7.7-alpha.1",
23
- "@nocobase/utils": "0.7.7-alpha.1",
22
+ "@nocobase/sdk": "0.8.0-alpha.4",
23
+ "@nocobase/utils": "0.8.0-alpha.4",
24
24
  "ahooks": "^3.0.5",
25
25
  "antd": "~4.19.5",
26
26
  "axios": "^0.26.1",
@@ -43,6 +43,7 @@
43
43
  "react-quill": "^1.3.5",
44
44
  "react-router-dom": "^5.2.0",
45
45
  "react-to-print": "^2.14.7",
46
+ "solarlunar-es": "^1.0.9",
46
47
  "use-deep-compare-effect": "^1.8.1"
47
48
  },
48
49
  "peerDependencies": {
@@ -57,5 +58,5 @@
57
58
  "@types/marked": "^4.0.1",
58
59
  "axios-mock-adapter": "^1.20.0"
59
60
  },
60
- "gitHead": "f82374e6f9daaf71ba63eaf156468ea7ddc042da"
61
+ "gitHead": "433f068ce4479a53f51d3ceac3f22b710e7bb13e"
61
62
  }