@nocobase/client 0.8.0-alpha.9 → 0.8.1-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 (524) hide show
  1. package/es/acl/Configuration/MenuConfigure.js +129 -56
  2. package/es/acl/Configuration/MenuItemsProvider.d.ts +3 -0
  3. package/es/acl/Configuration/MenuItemsProvider.js +51 -0
  4. package/es/acl/Configuration/RoleTable.d.ts +0 -1
  5. package/es/acl/Configuration/RoleTable.js +7 -53
  6. package/es/acl/Configuration/RolesResourcesActions.js +16 -14
  7. package/es/acl/Configuration/schemas/roleCollections.js +3 -1
  8. package/es/acl/Configuration/schemas/roles.js +1 -0
  9. package/es/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -1
  10. package/es/api-client/APIClient.js +35 -9
  11. package/es/api-client/hooks/useRequest.d.ts +2 -2
  12. package/es/api-client/index.d.ts +1 -0
  13. package/es/api-client/index.js +2 -1
  14. package/es/appInfo/CurrentAppInfoProvider.d.ts +4 -0
  15. package/es/appInfo/CurrentAppInfoProvider.js +20 -0
  16. package/es/appInfo/index.d.ts +1 -0
  17. package/es/appInfo/index.js +1 -0
  18. package/es/application/Application.js +2 -0
  19. package/es/block-provider/BlockProvider.d.ts +3 -0
  20. package/es/block-provider/BlockProvider.js +89 -9
  21. package/es/block-provider/CalendarBlockProvider.js +3 -5
  22. package/es/block-provider/FormBlockProvider.js +16 -2
  23. package/es/block-provider/KanbanBlockProvider.js +8 -3
  24. package/es/block-provider/SharedFilterProvider.d.ts +24 -0
  25. package/es/block-provider/SharedFilterProvider.js +76 -0
  26. package/es/block-provider/TableBlockProvider.js +11 -9
  27. package/es/block-provider/TableSelectorProvider.js +109 -11
  28. package/es/block-provider/hooks/index.js +1 -0
  29. package/es/board/Board.js +3 -1
  30. package/es/board/Column.js +43 -11
  31. package/es/board/style.less +2 -1
  32. package/es/collection-manager/CollectionField.d.ts +1 -0
  33. package/es/collection-manager/CollectionField.js +37 -4
  34. package/es/collection-manager/CollectionFieldProvider.d.ts +1 -0
  35. package/es/collection-manager/CollectionFieldProvider.js +3 -2
  36. package/es/collection-manager/CollectionHistoryProvider.d.ts +8 -0
  37. package/es/collection-manager/CollectionHistoryProvider.js +82 -0
  38. package/es/collection-manager/CollectionManagerProvider.js +60 -45
  39. package/es/collection-manager/CollectionManagerShortcut.js +15 -3
  40. package/es/collection-manager/Configuration/AddCollectionAction.d.ts +2 -0
  41. package/es/collection-manager/Configuration/AddCollectionAction.js +385 -0
  42. package/es/collection-manager/Configuration/AddFieldAction.js +85 -18
  43. package/es/collection-manager/Configuration/AddSubFieldAction.js +18 -11
  44. package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +144 -78
  45. package/es/collection-manager/Configuration/ConfigurationTable.js +36 -118
  46. package/es/collection-manager/Configuration/EditCollectionAction.d.ts +19 -0
  47. package/es/collection-manager/Configuration/EditCollectionAction.js +248 -0
  48. package/es/collection-manager/Configuration/OverridingCollectionField.d.ts +2 -0
  49. package/es/collection-manager/Configuration/OverridingCollectionField.js +297 -0
  50. package/es/collection-manager/Configuration/ViewInheritedField.d.ts +2 -0
  51. package/es/collection-manager/Configuration/ViewInheritedField.js +184 -0
  52. package/es/collection-manager/Configuration/components/CollectionFieldInterface.d.ts +2 -0
  53. package/es/collection-manager/Configuration/components/CollectionFieldInterface.js +16 -0
  54. package/es/collection-manager/Configuration/components/CollectionTemplate.d.ts +2 -0
  55. package/es/collection-manager/Configuration/components/CollectionTemplate.js +15 -0
  56. package/es/collection-manager/Configuration/index.d.ts +6 -1
  57. package/es/collection-manager/Configuration/index.js +6 -1
  58. package/es/collection-manager/Configuration/interfaces.d.ts +17 -2
  59. package/es/collection-manager/Configuration/interfaces.js +45 -26
  60. package/es/collection-manager/Configuration/schemas/collectionFields.d.ts +1 -0
  61. package/es/collection-manager/Configuration/schemas/collectionFields.js +37 -7
  62. package/es/collection-manager/Configuration/schemas/collections.js +85 -104
  63. package/es/collection-manager/Configuration/templates.d.ts +58 -0
  64. package/es/collection-manager/Configuration/templates.js +25 -0
  65. package/es/collection-manager/action-hooks.d.ts +20 -20
  66. package/es/collection-manager/action-hooks.js +51 -106
  67. package/es/collection-manager/hooks/useCollection.d.ts +4 -1
  68. package/es/collection-manager/hooks/useCollection.js +22 -4
  69. package/es/collection-manager/hooks/useCollectionManager.d.ts +9 -2
  70. package/es/collection-manager/hooks/useCollectionManager.js +120 -10
  71. package/es/collection-manager/hooks/useOptions.d.ts +5 -0
  72. package/es/collection-manager/hooks/useOptions.js +52 -0
  73. package/es/collection-manager/index.d.ts +7 -1
  74. package/es/collection-manager/index.js +8 -1
  75. package/es/collection-manager/interfaces/id.js +1 -1
  76. package/es/collection-manager/interfaces/index.d.ts +0 -1
  77. package/es/collection-manager/interfaces/index.js +0 -1
  78. package/es/collection-manager/interfaces/integer.js +3 -3
  79. package/es/collection-manager/interfaces/json.js +2 -2
  80. package/es/collection-manager/interfaces/linkTo.js +14 -4
  81. package/es/collection-manager/interfaces/m2m.js +19 -9
  82. package/es/collection-manager/interfaces/m2o.js +22 -54
  83. package/es/collection-manager/interfaces/o2m.js +58 -61
  84. package/es/collection-manager/interfaces/o2o.js +55 -47
  85. package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
  86. package/es/collection-manager/interfaces/properties/index.js +7 -0
  87. package/es/collection-manager/sub-table.d.ts +1 -1
  88. package/es/collection-manager/sub-table.js +1 -2
  89. package/es/collection-manager/templates/calendar.d.ts +2 -0
  90. package/es/collection-manager/templates/calendar.js +39 -0
  91. package/es/collection-manager/templates/general.d.ts +2 -0
  92. package/es/collection-manager/templates/general.js +11 -0
  93. package/es/collection-manager/templates/index.d.ts +2 -0
  94. package/es/collection-manager/templates/index.js +2 -0
  95. package/es/collection-manager/templates/properties/index.d.ts +174 -0
  96. package/es/collection-manager/templates/properties/index.js +137 -0
  97. package/es/collection-manager/templates/treeCollection.d.ts +1 -0
  98. package/es/collection-manager/templates/treeCollection.js +0 -0
  99. package/es/collection-manager/templates/types.d.ts +44 -0
  100. package/es/collection-manager/templates/types.js +1 -0
  101. package/es/collection-manager/types.d.ts +2 -0
  102. package/es/index.d.ts +1 -0
  103. package/es/index.js +2 -1
  104. package/es/locale/en_US.d.ts +28 -89
  105. package/es/locale/en_US.js +29 -90
  106. package/es/locale/ja_JP.d.ts +17 -90
  107. package/es/locale/ja_JP.js +17 -90
  108. package/es/locale/ru_RU.d.ts +5 -89
  109. package/es/locale/ru_RU.js +6 -90
  110. package/es/locale/tr_TR.d.ts +5 -89
  111. package/es/locale/tr_TR.js +6 -90
  112. package/es/locale/zh_CN.d.ts +30 -125
  113. package/es/locale/zh_CN.js +32 -128
  114. package/es/pm/PluginManagerLink.js +3 -2
  115. package/es/pm/index.js +31 -17
  116. package/es/route-switch/antd/admin-layout/index.js +51 -24
  117. package/es/schema-component/antd/action/Action.Designer.js +40 -4
  118. package/es/schema-component/antd/action/Action.Drawer.js +7 -4
  119. package/es/schema-component/antd/action/Action.Modal.js +9 -6
  120. package/es/schema-component/antd/action/Action.js +3 -1
  121. package/es/schema-component/antd/action/ActionBar.js +11 -3
  122. package/es/schema-component/antd/action/context.d.ts +3 -0
  123. package/es/schema-component/antd/action/hooks.d.ts +2 -0
  124. package/es/schema-component/antd/association-filter/ActionBarAssociationFilterAction.d.ts +1 -0
  125. package/es/schema-component/antd/association-filter/ActionBarAssociationFilterAction.js +53 -0
  126. package/es/schema-component/antd/association-filter/AssociationFilter.Initializer.d.ts +1 -0
  127. package/es/schema-component/antd/association-filter/AssociationFilter.Initializer.js +60 -0
  128. package/es/schema-component/antd/association-filter/AssociationFilter.Item.Designer.d.ts +1 -0
  129. package/es/schema-component/antd/association-filter/AssociationFilter.Item.Designer.js +103 -0
  130. package/es/schema-component/antd/association-filter/AssociationFilter.Item.d.ts +1 -0
  131. package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +208 -0
  132. package/es/schema-component/antd/association-filter/AssociationFilter.d.ts +9 -0
  133. package/es/schema-component/antd/association-filter/AssociationFilter.js +41 -0
  134. package/es/schema-component/antd/association-filter/AssociationFilterDesignerDelete.d.ts +1 -0
  135. package/es/schema-component/antd/association-filter/AssociationFilterDesignerDelete.js +32 -0
  136. package/es/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.d.ts +1 -0
  137. package/es/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.js +29 -0
  138. package/es/schema-component/antd/association-select/AssociationSelect.d.ts +12 -0
  139. package/es/schema-component/antd/association-select/AssociationSelect.js +689 -0
  140. package/es/schema-component/antd/association-select/ReadPretty.d.ts +2 -0
  141. package/es/schema-component/antd/association-select/ReadPretty.js +18 -0
  142. package/es/schema-component/antd/association-select/index.d.ts +1 -0
  143. package/es/schema-component/antd/association-select/index.js +1 -0
  144. package/es/schema-component/antd/association-select/useServiceOptions.d.ts +1 -0
  145. package/es/schema-component/antd/association-select/useServiceOptions.js +28 -0
  146. package/es/schema-component/antd/calendar/Calendar.d.ts +4 -0
  147. package/es/schema-component/antd/calendar/Calendar.js +65 -58
  148. package/es/schema-component/antd/calendar/DeleteEvent.js +9 -3
  149. package/es/schema-component/antd/calendar/context.d.ts +2 -0
  150. package/es/schema-component/antd/calendar/context.js +6 -2
  151. package/es/schema-component/antd/calendar/utils.d.ts +1 -0
  152. package/es/schema-component/antd/calendar/utils.js +3 -0
  153. package/es/schema-component/antd/card-item/CardItem.js +16 -2
  154. package/es/schema-component/antd/filter/Filter.Action.Designer.d.ts +1 -1
  155. package/es/schema-component/antd/filter/FilterItem.js +1 -1
  156. package/es/schema-component/antd/filter/FilterItems.js +1 -0
  157. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +0 -1
  158. package/es/schema-component/antd/filter/useFilterActionProps.js +20 -22
  159. package/es/schema-component/antd/form-item/FormItem.js +19 -27
  160. package/es/schema-component/antd/formula-input/FormulaInput.js +9 -6
  161. package/es/schema-component/antd/index.d.ts +2 -0
  162. package/es/schema-component/antd/index.js +2 -0
  163. package/es/schema-component/antd/input/index.d.ts +1 -0
  164. package/es/schema-component/antd/input/index.js +2 -1
  165. package/es/schema-component/antd/kanban/Kanban.Designer.js +3 -1
  166. package/es/schema-component/antd/kanban/index.less +1 -1
  167. package/es/schema-component/antd/menu/Menu.Designer.js +2 -0
  168. package/es/schema-component/antd/menu/Menu.js +2 -1
  169. package/es/schema-component/antd/menu/MenuItemInitializers/index.js +7 -8
  170. package/es/schema-component/antd/page/FixedBlock.d.ts +14 -0
  171. package/es/schema-component/antd/page/FixedBlock.js +126 -0
  172. package/es/schema-component/antd/page/Page.js +189 -9
  173. package/es/schema-component/antd/page/PageTabDesigner.d.ts +6 -0
  174. package/es/schema-component/antd/page/PageTabDesigner.js +197 -0
  175. package/es/schema-component/antd/page/index.d.ts +1 -0
  176. package/es/schema-component/antd/page/index.js +2 -1
  177. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +23 -8
  178. package/es/schema-component/antd/record-picker/index.d.ts +4 -0
  179. package/es/schema-component/antd/record-picker/index.js +5 -1
  180. package/es/schema-component/antd/remote-select/ReadPretty.d.ts +2 -0
  181. package/es/schema-component/antd/remote-select/ReadPretty.js +60 -0
  182. package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +21 -0
  183. package/es/schema-component/antd/remote-select/RemoteSelect.js +114 -0
  184. package/es/schema-component/antd/remote-select/index.d.ts +1 -0
  185. package/es/schema-component/antd/remote-select/index.js +1 -0
  186. package/es/schema-component/antd/remote-select/shared.d.ts +1 -0
  187. package/es/schema-component/antd/remote-select/shared.js +10 -0
  188. package/es/schema-component/antd/select/ReadPretty.js +3 -1
  189. package/es/schema-component/antd/select/Select.d.ts +5 -1
  190. package/es/schema-component/antd/select/Select.js +39 -7
  191. package/es/schema-component/antd/select/index.d.ts +1 -0
  192. package/es/schema-component/antd/select/index.js +2 -1
  193. package/es/schema-component/antd/select/shared.js +44 -19
  194. package/es/schema-component/antd/table-v2/Table.Column.Decorator.js +2 -1
  195. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +32 -3
  196. package/es/schema-component/antd/table-v2/Table.js +84 -25
  197. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +4 -2
  198. package/es/schema-component/antd/table-v2/utils.d.ts +3 -0
  199. package/es/schema-component/antd/table-v2/utils.js +8 -0
  200. package/es/schema-component/antd/upload/ReadPretty.js +6 -5
  201. package/es/schema-component/antd/upload/shared.d.ts +1 -0
  202. package/es/schema-component/common/dnd-context/index.js +6 -0
  203. package/es/schema-component/common/sortable-item/SortableItem.js +2 -1
  204. package/es/schema-component/hooks/index.d.ts +2 -0
  205. package/es/schema-component/hooks/index.js +3 -1
  206. package/es/schema-component/hooks/useDesignable.js +1 -1
  207. package/es/schema-component/hooks/useFieldComponentOptions.d.ts +4 -0
  208. package/es/schema-component/hooks/useFieldComponentOptions.js +64 -0
  209. package/es/schema-component/hooks/useFieldTitle.d.ts +1 -0
  210. package/es/schema-component/hooks/useFieldTitle.js +24 -0
  211. package/es/schema-initializer/SchemaInitializer.d.ts +1 -0
  212. package/es/schema-initializer/SchemaInitializer.js +26 -5
  213. package/es/schema-initializer/SchemaInitializerProvider.d.ts +1 -1
  214. package/es/schema-initializer/SchemaInitializerProvider.js +9 -3
  215. package/es/schema-initializer/SelectCollection.d.ts +5 -0
  216. package/es/schema-initializer/SelectCollection.js +47 -0
  217. package/es/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +12 -0
  218. package/es/schema-initializer/buttons/CalendarFormActionInitializers.js +2 -2
  219. package/es/schema-initializer/buttons/CustomFormItemInitializers.js +23 -6
  220. package/es/schema-initializer/buttons/FormItemInitializers.js +47 -29
  221. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +12 -0
  222. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +2 -2
  223. package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +49 -29
  224. package/es/schema-initializer/buttons/RecordBlockInitializers.js +28 -2
  225. package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +2 -2
  226. package/es/schema-initializer/buttons/TabPaneInitializers.js +22 -12
  227. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +56 -5
  228. package/es/schema-initializer/buttons/TableActionInitializers.d.ts +31 -0
  229. package/es/schema-initializer/buttons/TableActionInitializers.js +37 -9
  230. package/es/schema-initializer/buttons/TableColumnInitializers.js +16 -1
  231. package/es/schema-initializer/buttons/TableSelectorInitializers.js +6 -2
  232. package/es/schema-initializer/buttons/index.d.ts +1 -0
  233. package/es/schema-initializer/buttons/index.js +3 -1
  234. package/es/schema-initializer/index.d.ts +2 -0
  235. package/es/schema-initializer/index.js +3 -1
  236. package/es/schema-initializer/items/BulkDestroyActionInitializer.js +13 -2
  237. package/es/schema-initializer/items/CalendarBlockInitializer.js +8 -8
  238. package/es/schema-initializer/items/CustomizeActionInitializer.js +12 -1
  239. package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +2 -1
  240. package/es/schema-initializer/items/DataBlockInitializer.js +10 -4
  241. package/es/schema-initializer/items/InitializerWithSwitch.js +1 -1
  242. package/es/schema-initializer/items/KanbanBlockInitializer.js +7 -6
  243. package/es/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +6 -3
  244. package/es/schema-initializer/items/index.d.ts +5 -1
  245. package/es/schema-initializer/items/index.js +7 -2
  246. package/es/schema-initializer/style.less +1 -1
  247. package/es/schema-initializer/utils.d.ts +17 -1
  248. package/es/schema-initializer/utils.js +258 -84
  249. package/es/schema-settings/SchemaSettings.js +67 -24
  250. package/es/schema-templates/BlockTemplate.js +6 -2
  251. package/es/schema-templates/schemas/uiSchemaTemplates.js +63 -3
  252. package/es/user/ChangePassword.js +5 -1
  253. package/es/user/CurrentUser.js +2 -11
  254. package/es/user/EditProfile.js +16 -0
  255. package/es/user/SigninPage.d.ts +1 -0
  256. package/es/user/SigninPage.js +14 -6
  257. package/es/user/SigninPageExtension.d.ts +10 -0
  258. package/es/user/SigninPageExtension.js +37 -0
  259. package/es/user/index.d.ts +1 -0
  260. package/es/user/index.js +2 -1
  261. package/lib/acl/Configuration/MenuConfigure.js +129 -56
  262. package/lib/acl/Configuration/MenuItemsProvider.d.ts +3 -0
  263. package/lib/acl/Configuration/MenuItemsProvider.js +77 -0
  264. package/lib/acl/Configuration/RoleTable.d.ts +0 -1
  265. package/lib/acl/Configuration/RoleTable.js +9 -57
  266. package/lib/acl/Configuration/RolesResourcesActions.js +16 -14
  267. package/lib/acl/Configuration/schemas/roleCollections.js +3 -1
  268. package/lib/acl/Configuration/schemas/roles.js +1 -0
  269. package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -1
  270. package/lib/api-client/APIClient.js +34 -9
  271. package/lib/api-client/hooks/useRequest.d.ts +2 -2
  272. package/lib/api-client/index.d.ts +1 -0
  273. package/lib/api-client/index.js +13 -0
  274. package/lib/appInfo/CurrentAppInfoProvider.d.ts +4 -0
  275. package/lib/appInfo/CurrentAppInfoProvider.js +43 -0
  276. package/lib/appInfo/index.d.ts +1 -0
  277. package/lib/appInfo/index.js +18 -0
  278. package/lib/application/Application.js +3 -0
  279. package/lib/block-provider/BlockProvider.d.ts +3 -0
  280. package/lib/block-provider/BlockProvider.js +97 -5
  281. package/lib/block-provider/CalendarBlockProvider.js +3 -6
  282. package/lib/block-provider/FormBlockProvider.js +17 -1
  283. package/lib/block-provider/KanbanBlockProvider.js +9 -3
  284. package/lib/block-provider/SharedFilterProvider.d.ts +24 -0
  285. package/lib/block-provider/SharedFilterProvider.js +100 -0
  286. package/lib/block-provider/TableBlockProvider.js +11 -8
  287. package/lib/block-provider/TableSelectorProvider.js +109 -8
  288. package/lib/block-provider/hooks/index.js +1 -0
  289. package/lib/board/Board.js +3 -1
  290. package/lib/board/Column.js +43 -10
  291. package/lib/board/style.less +2 -1
  292. package/lib/collection-manager/CollectionField.d.ts +1 -0
  293. package/lib/collection-manager/CollectionField.js +39 -6
  294. package/lib/collection-manager/CollectionFieldProvider.d.ts +1 -0
  295. package/lib/collection-manager/CollectionFieldProvider.js +3 -2
  296. package/lib/collection-manager/CollectionHistoryProvider.d.ts +8 -0
  297. package/lib/collection-manager/CollectionHistoryProvider.js +107 -0
  298. package/lib/collection-manager/CollectionManagerProvider.js +62 -44
  299. package/lib/collection-manager/CollectionManagerShortcut.js +14 -2
  300. package/lib/collection-manager/Configuration/AddCollectionAction.d.ts +2 -0
  301. package/lib/collection-manager/Configuration/AddCollectionAction.js +418 -0
  302. package/lib/collection-manager/Configuration/AddFieldAction.js +84 -16
  303. package/lib/collection-manager/Configuration/AddSubFieldAction.js +19 -12
  304. package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +145 -77
  305. package/lib/collection-manager/Configuration/ConfigurationTable.js +36 -117
  306. package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +19 -0
  307. package/lib/collection-manager/Configuration/EditCollectionAction.js +287 -0
  308. package/lib/collection-manager/Configuration/OverridingCollectionField.d.ts +2 -0
  309. package/lib/collection-manager/Configuration/OverridingCollectionField.js +329 -0
  310. package/lib/collection-manager/Configuration/ViewInheritedField.d.ts +2 -0
  311. package/lib/collection-manager/Configuration/ViewInheritedField.js +214 -0
  312. package/lib/collection-manager/Configuration/components/CollectionFieldInterface.d.ts +2 -0
  313. package/lib/collection-manager/Configuration/components/CollectionFieldInterface.js +31 -0
  314. package/lib/collection-manager/Configuration/components/CollectionTemplate.d.ts +2 -0
  315. package/lib/collection-manager/Configuration/components/CollectionTemplate.js +30 -0
  316. package/lib/collection-manager/Configuration/index.d.ts +6 -1
  317. package/lib/collection-manager/Configuration/index.js +73 -8
  318. package/lib/collection-manager/Configuration/interfaces.d.ts +17 -2
  319. package/lib/collection-manager/Configuration/interfaces.js +52 -28
  320. package/lib/collection-manager/Configuration/schemas/collectionFields.d.ts +1 -0
  321. package/lib/collection-manager/Configuration/schemas/collectionFields.js +40 -9
  322. package/lib/collection-manager/Configuration/schemas/collections.js +89 -104
  323. package/lib/collection-manager/Configuration/templates.d.ts +58 -0
  324. package/lib/collection-manager/Configuration/templates.js +46 -0
  325. package/lib/collection-manager/action-hooks.d.ts +20 -20
  326. package/lib/collection-manager/action-hooks.js +69 -130
  327. package/lib/collection-manager/hooks/useCollection.d.ts +4 -1
  328. package/lib/collection-manager/hooks/useCollection.js +24 -4
  329. package/lib/collection-manager/hooks/useCollectionManager.d.ts +9 -2
  330. package/lib/collection-manager/hooks/useCollectionManager.js +121 -10
  331. package/lib/collection-manager/hooks/useOptions.d.ts +5 -0
  332. package/lib/collection-manager/hooks/useOptions.js +65 -0
  333. package/lib/collection-manager/index.d.ts +7 -1
  334. package/lib/collection-manager/index.js +96 -10
  335. package/lib/collection-manager/interfaces/id.js +1 -1
  336. package/lib/collection-manager/interfaces/index.d.ts +0 -1
  337. package/lib/collection-manager/interfaces/index.js +0 -13
  338. package/lib/collection-manager/interfaces/integer.js +3 -3
  339. package/lib/collection-manager/interfaces/json.js +3 -3
  340. package/lib/collection-manager/interfaces/linkTo.js +14 -4
  341. package/lib/collection-manager/interfaces/m2m.js +19 -9
  342. package/lib/collection-manager/interfaces/m2o.js +27 -59
  343. package/lib/collection-manager/interfaces/o2m.js +58 -61
  344. package/lib/collection-manager/interfaces/o2o.js +55 -47
  345. package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
  346. package/lib/collection-manager/interfaces/properties/index.js +7 -0
  347. package/lib/collection-manager/sub-table.d.ts +1 -1
  348. package/lib/collection-manager/sub-table.js +1 -3
  349. package/lib/collection-manager/templates/calendar.d.ts +2 -0
  350. package/lib/collection-manager/templates/calendar.js +48 -0
  351. package/lib/collection-manager/templates/general.d.ts +2 -0
  352. package/lib/collection-manager/templates/general.js +20 -0
  353. package/lib/collection-manager/templates/index.d.ts +2 -0
  354. package/lib/collection-manager/templates/index.js +31 -0
  355. package/lib/collection-manager/templates/properties/index.d.ts +174 -0
  356. package/lib/collection-manager/templates/properties/index.js +151 -0
  357. package/lib/collection-manager/templates/treeCollection.d.ts +1 -0
  358. package/lib/collection-manager/templates/treeCollection.js +1 -0
  359. package/lib/collection-manager/templates/types.d.ts +44 -0
  360. package/lib/collection-manager/templates/types.js +5 -0
  361. package/lib/collection-manager/types.d.ts +2 -0
  362. package/lib/index.d.ts +1 -0
  363. package/lib/index.js +13 -0
  364. package/lib/locale/en_US.d.ts +28 -89
  365. package/lib/locale/en_US.js +29 -90
  366. package/lib/locale/ja_JP.d.ts +17 -90
  367. package/lib/locale/ja_JP.js +17 -90
  368. package/lib/locale/ru_RU.d.ts +5 -89
  369. package/lib/locale/ru_RU.js +6 -90
  370. package/lib/locale/tr_TR.d.ts +5 -89
  371. package/lib/locale/tr_TR.js +6 -90
  372. package/lib/locale/zh_CN.d.ts +30 -125
  373. package/lib/locale/zh_CN.js +32 -128
  374. package/lib/pm/PluginManagerLink.js +3 -2
  375. package/lib/pm/index.js +31 -17
  376. package/lib/route-switch/antd/admin-layout/index.js +49 -22
  377. package/lib/schema-component/antd/action/Action.Designer.js +39 -3
  378. package/lib/schema-component/antd/action/Action.Drawer.js +7 -4
  379. package/lib/schema-component/antd/action/Action.Modal.js +9 -6
  380. package/lib/schema-component/antd/action/Action.js +3 -1
  381. package/lib/schema-component/antd/action/ActionBar.js +12 -3
  382. package/lib/schema-component/antd/action/context.d.ts +3 -0
  383. package/lib/schema-component/antd/action/hooks.d.ts +2 -0
  384. package/lib/schema-component/antd/association-filter/ActionBarAssociationFilterAction.d.ts +1 -0
  385. package/lib/schema-component/antd/association-filter/ActionBarAssociationFilterAction.js +74 -0
  386. package/lib/schema-component/antd/association-filter/AssociationFilter.Initializer.d.ts +1 -0
  387. package/lib/schema-component/antd/association-filter/AssociationFilter.Initializer.js +76 -0
  388. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.Designer.d.ts +1 -0
  389. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.Designer.js +121 -0
  390. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.d.ts +1 -0
  391. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +238 -0
  392. package/lib/schema-component/antd/association-filter/AssociationFilter.d.ts +9 -0
  393. package/lib/schema-component/antd/association-filter/AssociationFilter.js +63 -0
  394. package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDelete.d.ts +1 -0
  395. package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDelete.js +53 -0
  396. package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.d.ts +1 -0
  397. package/lib/schema-component/antd/association-filter/AssociationFilterDesignerDisplayField.js +44 -0
  398. package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +12 -0
  399. package/lib/schema-component/antd/association-select/AssociationSelect.js +718 -0
  400. package/lib/schema-component/antd/association-select/ReadPretty.d.ts +2 -0
  401. package/lib/schema-component/antd/association-select/ReadPretty.js +33 -0
  402. package/lib/schema-component/antd/association-select/index.d.ts +1 -0
  403. package/lib/schema-component/antd/association-select/index.js +18 -0
  404. package/lib/schema-component/antd/association-select/useServiceOptions.d.ts +1 -0
  405. package/lib/schema-component/antd/association-select/useServiceOptions.js +38 -0
  406. package/lib/schema-component/antd/calendar/Calendar.d.ts +4 -0
  407. package/lib/schema-component/antd/calendar/Calendar.js +70 -59
  408. package/lib/schema-component/antd/calendar/DeleteEvent.js +13 -2
  409. package/lib/schema-component/antd/calendar/context.d.ts +2 -0
  410. package/lib/schema-component/antd/calendar/context.js +10 -2
  411. package/lib/schema-component/antd/calendar/utils.d.ts +1 -0
  412. package/lib/schema-component/antd/calendar/utils.js +8 -2
  413. package/lib/schema-component/antd/card-item/CardItem.js +20 -4
  414. package/lib/schema-component/antd/filter/Filter.Action.Designer.d.ts +1 -1
  415. package/lib/schema-component/antd/filter/FilterItem.js +1 -1
  416. package/lib/schema-component/antd/filter/FilterItems.js +1 -0
  417. package/lib/schema-component/antd/filter/useFilterActionProps.d.ts +0 -1
  418. package/lib/schema-component/antd/filter/useFilterActionProps.js +23 -26
  419. package/lib/schema-component/antd/form-item/FormItem.js +21 -29
  420. package/lib/schema-component/antd/formula-input/FormulaInput.js +9 -6
  421. package/lib/schema-component/antd/index.d.ts +2 -0
  422. package/lib/schema-component/antd/index.js +26 -0
  423. package/lib/schema-component/antd/input/index.d.ts +1 -0
  424. package/lib/schema-component/antd/input/index.js +13 -0
  425. package/lib/schema-component/antd/kanban/Kanban.Designer.js +4 -1
  426. package/lib/schema-component/antd/kanban/index.less +1 -1
  427. package/lib/schema-component/antd/menu/Menu.Designer.js +2 -0
  428. package/lib/schema-component/antd/menu/Menu.js +2 -1
  429. package/lib/schema-component/antd/menu/MenuItemInitializers/index.js +8 -8
  430. package/lib/schema-component/antd/page/FixedBlock.d.ts +14 -0
  431. package/lib/schema-component/antd/page/FixedBlock.js +156 -0
  432. package/lib/schema-component/antd/page/Page.js +204 -11
  433. package/lib/schema-component/antd/page/PageTabDesigner.d.ts +6 -0
  434. package/lib/schema-component/antd/page/PageTabDesigner.js +218 -0
  435. package/lib/schema-component/antd/page/index.d.ts +1 -0
  436. package/lib/schema-component/antd/page/index.js +13 -0
  437. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +20 -6
  438. package/lib/schema-component/antd/record-picker/index.d.ts +4 -0
  439. package/lib/schema-component/antd/record-picker/index.js +58 -0
  440. package/lib/schema-component/antd/remote-select/ReadPretty.d.ts +2 -0
  441. package/lib/schema-component/antd/remote-select/ReadPretty.js +77 -0
  442. package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +21 -0
  443. package/lib/schema-component/antd/remote-select/RemoteSelect.js +131 -0
  444. package/lib/schema-component/antd/remote-select/index.d.ts +1 -0
  445. package/lib/schema-component/antd/remote-select/index.js +18 -0
  446. package/lib/schema-component/antd/remote-select/shared.d.ts +1 -0
  447. package/lib/schema-component/antd/remote-select/shared.js +20 -0
  448. package/lib/schema-component/antd/select/ReadPretty.js +4 -1
  449. package/lib/schema-component/antd/select/Select.d.ts +5 -1
  450. package/lib/schema-component/antd/select/Select.js +39 -7
  451. package/lib/schema-component/antd/select/index.d.ts +1 -0
  452. package/lib/schema-component/antd/select/index.js +13 -0
  453. package/lib/schema-component/antd/select/shared.js +44 -19
  454. package/lib/schema-component/antd/table-v2/Table.Column.Decorator.js +3 -1
  455. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +32 -3
  456. package/lib/schema-component/antd/table-v2/Table.js +84 -24
  457. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +5 -2
  458. package/lib/schema-component/antd/table-v2/utils.d.ts +3 -0
  459. package/lib/schema-component/antd/table-v2/utils.js +20 -0
  460. package/lib/schema-component/antd/upload/ReadPretty.js +6 -5
  461. package/lib/schema-component/antd/upload/shared.d.ts +1 -0
  462. package/lib/schema-component/common/dnd-context/index.js +6 -0
  463. package/lib/schema-component/common/sortable-item/SortableItem.js +2 -1
  464. package/lib/schema-component/hooks/index.d.ts +2 -0
  465. package/lib/schema-component/hooks/index.js +26 -0
  466. package/lib/schema-component/hooks/useDesignable.js +1 -1
  467. package/lib/schema-component/hooks/useFieldComponentOptions.d.ts +4 -0
  468. package/lib/schema-component/hooks/useFieldComponentOptions.js +77 -0
  469. package/lib/schema-component/hooks/useFieldTitle.d.ts +1 -0
  470. package/lib/schema-component/hooks/useFieldTitle.js +36 -0
  471. package/lib/schema-initializer/SchemaInitializer.d.ts +1 -0
  472. package/lib/schema-initializer/SchemaInitializer.js +28 -6
  473. package/lib/schema-initializer/SchemaInitializerProvider.d.ts +1 -1
  474. package/lib/schema-initializer/SchemaInitializerProvider.js +20 -10
  475. package/lib/schema-initializer/SelectCollection.d.ts +5 -0
  476. package/lib/schema-initializer/SelectCollection.js +62 -0
  477. package/lib/schema-initializer/buttons/CalendarFormActionInitializers.d.ts +12 -0
  478. package/lib/schema-initializer/buttons/CalendarFormActionInitializers.js +2 -2
  479. package/lib/schema-initializer/buttons/CustomFormItemInitializers.js +23 -5
  480. package/lib/schema-initializer/buttons/FormItemInitializers.js +47 -29
  481. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +12 -0
  482. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +2 -2
  483. package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +49 -29
  484. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +28 -2
  485. package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +2 -2
  486. package/lib/schema-initializer/buttons/TabPaneInitializers.js +22 -12
  487. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +54 -4
  488. package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +31 -0
  489. package/lib/schema-initializer/buttons/TableActionInitializers.js +38 -9
  490. package/lib/schema-initializer/buttons/TableColumnInitializers.js +16 -0
  491. package/lib/schema-initializer/buttons/TableSelectorInitializers.js +6 -2
  492. package/lib/schema-initializer/buttons/index.d.ts +1 -0
  493. package/lib/schema-initializer/buttons/index.js +13 -0
  494. package/lib/schema-initializer/index.d.ts +2 -0
  495. package/lib/schema-initializer/index.js +36 -1
  496. package/lib/schema-initializer/items/BulkDestroyActionInitializer.js +12 -0
  497. package/lib/schema-initializer/items/CalendarBlockInitializer.js +8 -8
  498. package/lib/schema-initializer/items/CustomizeActionInitializer.js +13 -1
  499. package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +2 -1
  500. package/lib/schema-initializer/items/DataBlockInitializer.js +13 -3
  501. package/lib/schema-initializer/items/KanbanBlockInitializer.js +7 -6
  502. package/lib/schema-initializer/items/RecordReadPrettyFormBlockInitializer.js +6 -3
  503. package/lib/schema-initializer/items/index.d.ts +5 -1
  504. package/lib/schema-initializer/items/index.js +60 -8
  505. package/lib/schema-initializer/style.less +1 -1
  506. package/lib/schema-initializer/utils.d.ts +17 -1
  507. package/lib/schema-initializer/utils.js +272 -84
  508. package/lib/schema-settings/SchemaSettings.js +67 -24
  509. package/lib/schema-templates/BlockTemplate.js +7 -2
  510. package/lib/schema-templates/schemas/uiSchemaTemplates.js +62 -2
  511. package/lib/user/ChangePassword.js +5 -1
  512. package/lib/user/CurrentUser.js +3 -12
  513. package/lib/user/EditProfile.js +16 -0
  514. package/lib/user/SigninPage.d.ts +1 -0
  515. package/lib/user/SigninPage.js +15 -2
  516. package/lib/user/SigninPageExtension.d.ts +10 -0
  517. package/lib/user/SigninPageExtension.js +58 -0
  518. package/lib/user/index.d.ts +1 -0
  519. package/lib/user/index.js +13 -0
  520. package/package.json +7 -6
  521. package/es/collection-manager/interfaces/sequence.d.ts +0 -2
  522. package/es/collection-manager/interfaces/sequence.js +0 -435
  523. package/lib/collection-manager/interfaces/sequence.d.ts +0 -2
  524. package/lib/collection-manager/interfaces/sequence.js +0 -459
@@ -29,8 +29,8 @@ import React, { useState } from 'react';
29
29
  import { useTranslation } from 'react-i18next';
30
30
  import { useAPIClient, useRequest } from '../../api-client';
31
31
  import { useRecord } from '../../record-provider';
32
- import { useCompile } from '../../schema-component';
33
- import { useMenuItems } from './RoleTable';
32
+ import { uniq } from 'lodash';
33
+ import { useMenuItems } from './MenuItemsProvider';
34
34
 
35
35
  var findUids = function findUids(items) {
36
36
  if (!Array.isArray(items)) {
@@ -57,11 +57,63 @@ var findUids = function findUids(items) {
57
57
  return uids;
58
58
  };
59
59
 
60
+ var getParentUids = function getParentUids(tree, func) {
61
+ var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
62
+ if (!tree) return [];
63
+
64
+ var _iterator2 = _createForOfIteratorHelper(tree),
65
+ _step2;
66
+
67
+ try {
68
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
69
+ var data = _step2.value;
70
+ path.push(data.uid);
71
+ if (func(data)) return path;
72
+
73
+ if (data.children) {
74
+ var findChildren = getParentUids(data.children, func, path);
75
+ if (findChildren.length) return findChildren;
76
+ }
77
+
78
+ path.pop();
79
+ }
80
+ } catch (err) {
81
+ _iterator2.e(err);
82
+ } finally {
83
+ _iterator2.f();
84
+ }
85
+
86
+ return [];
87
+ };
88
+
89
+ var getChildrenUids = function getChildrenUids() {
90
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
91
+ var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
92
+
93
+ var _iterator3 = _createForOfIteratorHelper(data),
94
+ _step3;
95
+
96
+ try {
97
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
98
+ var item = _step3.value;
99
+ arr.push(item.uid);
100
+ if (item.children && item.children.length) getChildrenUids(item.children, arr);
101
+ }
102
+ } catch (err) {
103
+ _iterator3.e(err);
104
+ } finally {
105
+ _iterator3.f();
106
+ }
107
+
108
+ return arr;
109
+ };
110
+
60
111
  export var MenuConfigure = function MenuConfigure() {
61
112
  var record = useRecord();
62
113
  var api = useAPIClient();
63
- var items = useMenuItems();
64
- var compile = useCompile();
114
+
115
+ var _useMenuItems = useMenuItems(),
116
+ items = _useMenuItems.items;
65
117
 
66
118
  var _useTranslation = useTranslation(),
67
119
  t = _useTranslation.t;
@@ -94,6 +146,65 @@ export var MenuConfigure = function MenuConfigure() {
94
146
 
95
147
  var resource = api.resource('roles.menuUiSchemas', record.name);
96
148
  var allChecked = allUids.length === uids.length;
149
+
150
+ var handleChange = /*#__PURE__*/function () {
151
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(checked, schema) {
152
+ var parentUids, childrenUids, totalUids, newUids, _totalUids;
153
+
154
+ return regeneratorRuntime.wrap(function _callee$(_context) {
155
+ while (1) {
156
+ switch (_context.prev = _context.next) {
157
+ case 0:
158
+ parentUids = getParentUids(items, function (data) {
159
+ return data.uid === schema.uid;
160
+ });
161
+ childrenUids = getChildrenUids(schema === null || schema === void 0 ? void 0 : schema.children, []);
162
+
163
+ if (!checked) {
164
+ _context.next = 10;
165
+ break;
166
+ }
167
+
168
+ totalUids = childrenUids.concat(schema.uid);
169
+ newUids = uids.filter(function (v) {
170
+ return !totalUids.includes(v);
171
+ });
172
+ setUids(_toConsumableArray(newUids));
173
+ _context.next = 8;
174
+ return resource.remove({
175
+ values: totalUids
176
+ });
177
+
178
+ case 8:
179
+ _context.next = 14;
180
+ break;
181
+
182
+ case 10:
183
+ _totalUids = childrenUids.concat(parentUids);
184
+ setUids(function (prev) {
185
+ return uniq([].concat(_toConsumableArray(prev), _toConsumableArray(_totalUids)));
186
+ });
187
+ _context.next = 14;
188
+ return resource.add({
189
+ values: _totalUids
190
+ });
191
+
192
+ case 14:
193
+ message.success(t('Saved successfully'));
194
+
195
+ case 15:
196
+ case "end":
197
+ return _context.stop();
198
+ }
199
+ }
200
+ }, _callee);
201
+ }));
202
+
203
+ return function handleChange(_x, _x2) {
204
+ return _ref.apply(this, arguments);
205
+ };
206
+ }();
207
+
97
208
  return /*#__PURE__*/React.createElement(Table, {
98
209
  loading: loading,
99
210
  rowKey: 'uid',
@@ -109,27 +220,27 @@ export var MenuConfigure = function MenuConfigure() {
109
220
  title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
110
221
  checked: allChecked,
111
222
  onChange: function () {
112
- var _onChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(value) {
113
- return regeneratorRuntime.wrap(function _callee$(_context) {
223
+ var _onChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(value) {
224
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
114
225
  while (1) {
115
- switch (_context.prev = _context.next) {
226
+ switch (_context2.prev = _context2.next) {
116
227
  case 0:
117
228
  if (!allChecked) {
118
- _context.next = 5;
229
+ _context2.next = 5;
119
230
  break;
120
231
  }
121
232
 
122
- _context.next = 3;
233
+ _context2.next = 3;
123
234
  return resource.set({
124
235
  values: []
125
236
  });
126
237
 
127
238
  case 3:
128
- _context.next = 7;
239
+ _context2.next = 7;
129
240
  break;
130
241
 
131
242
  case 5:
132
- _context.next = 7;
243
+ _context2.next = 7;
133
244
  return resource.set({
134
245
  values: allUids
135
246
  });
@@ -140,64 +251,26 @@ export var MenuConfigure = function MenuConfigure() {
140
251
 
141
252
  case 9:
142
253
  case "end":
143
- return _context.stop();
254
+ return _context2.stop();
144
255
  }
145
256
  }
146
- }, _callee);
257
+ }, _callee2);
147
258
  }));
148
259
 
149
- function onChange(_x) {
260
+ function onChange(_x3) {
150
261
  return _onChange.apply(this, arguments);
151
262
  }
152
263
 
153
264
  return onChange;
154
265
  }()
155
- }), ' ', t('Accessible')),
266
+ }), t('Accessible')),
156
267
  render: function render(_, schema) {
157
268
  var checked = uids.includes(schema.uid);
158
269
  return /*#__PURE__*/React.createElement(Checkbox, {
159
270
  checked: checked,
160
- onChange: function () {
161
- var _onChange2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(e) {
162
- var index;
163
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
164
- while (1) {
165
- switch (_context2.prev = _context2.next) {
166
- case 0:
167
- if (checked) {
168
- index = uids.indexOf(schema.uid);
169
- uids.splice(index, 1);
170
- setUids(_toConsumableArray(uids));
171
- } else {
172
- setUids(function (prev) {
173
- return [].concat(_toConsumableArray(prev), [schema.uid]);
174
- });
175
- }
176
-
177
- _context2.next = 3;
178
- return resource.toggle({
179
- values: {
180
- tk: schema.uid
181
- }
182
- });
183
-
184
- case 3:
185
- message.success(t('Saved successfully'));
186
-
187
- case 4:
188
- case "end":
189
- return _context2.stop();
190
- }
191
- }
192
- }, _callee2);
193
- }));
194
-
195
- function onChange(_x2) {
196
- return _onChange2.apply(this, arguments);
197
- }
198
-
199
- return onChange;
200
- }()
271
+ onChange: function onChange() {
272
+ return handleChange(checked, schema);
273
+ }
201
274
  });
202
275
  }
203
276
  }],
@@ -0,0 +1,3 @@
1
+ export declare const toItems: (properties?: {}) => any[];
2
+ export declare const useMenuItems: () => any;
3
+ export declare const MenuItemsProvider: (props: any) => JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { Spin } from 'antd';
2
+ import React, { createContext, useContext } from 'react';
3
+ import { useRequest } from '../../api-client';
4
+ import { useRoute } from '../../route-switch';
5
+ var MenuItemsContext = /*#__PURE__*/createContext(null);
6
+ export var toItems = function toItems() {
7
+ var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8
+ var items = [];
9
+
10
+ for (var key in properties) {
11
+ if (Object.prototype.hasOwnProperty.call(properties, key)) {
12
+ var element = properties[key];
13
+ var item = {
14
+ title: element.title,
15
+ uid: element['x-uid']
16
+ };
17
+
18
+ if (element.properties) {
19
+ item['children'] = toItems(element.properties);
20
+ }
21
+
22
+ items.push(item);
23
+ }
24
+ }
25
+
26
+ return items;
27
+ };
28
+ export var useMenuItems = function useMenuItems() {
29
+ return useContext(MenuItemsContext);
30
+ };
31
+ export var MenuItemsProvider = function MenuItemsProvider(props) {
32
+ var _service$data, _service$data$data;
33
+
34
+ var route = useRoute();
35
+ var options = {
36
+ url: "uiSchemas:getProperties/".concat(route.uiSchemaUid)
37
+ };
38
+ var service = useRequest(options);
39
+
40
+ if (service.loading) {
41
+ return /*#__PURE__*/React.createElement(Spin, null);
42
+ }
43
+
44
+ var items = toItems((_service$data = service.data) === null || _service$data === void 0 ? void 0 : (_service$data$data = _service$data.data) === null || _service$data$data === void 0 ? void 0 : _service$data$data.properties);
45
+ return /*#__PURE__*/React.createElement(MenuItemsContext.Provider, {
46
+ value: {
47
+ service: service,
48
+ items: items
49
+ }
50
+ }, props.children);
51
+ };
@@ -1,3 +1,2 @@
1
1
  export declare const useAvailableActions: () => any;
2
- export declare const useMenuItems: () => any;
3
2
  export declare const RoleTable: () => JSX.Element;
@@ -1,35 +1,10 @@
1
1
  import { Spin } from 'antd';
2
2
  import React, { createContext, useContext } from 'react';
3
3
  import { useRequest } from '../../api-client';
4
- import { useRoute } from '../../route-switch';
5
4
  import { SchemaComponent } from '../../schema-component';
6
5
  import { roleSchema } from './schemas/roles';
7
-
8
- var toItems = function toItems() {
9
- var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10
- var items = [];
11
-
12
- for (var key in properties) {
13
- if (Object.prototype.hasOwnProperty.call(properties, key)) {
14
- var element = properties[key];
15
- var item = {
16
- title: element.title,
17
- uid: element['x-uid']
18
- };
19
-
20
- if (element.properties) {
21
- item['children'] = toItems(element.properties);
22
- }
23
-
24
- items.push(item);
25
- }
26
- }
27
-
28
- return items;
29
- };
30
-
6
+ import { MenuItemsProvider } from '../Configuration/MenuItemsProvider';
31
7
  var AvailableActionsContext = /*#__PURE__*/createContext(null);
32
- var MenuItemsContext = /*#__PURE__*/createContext(null);
33
8
 
34
9
  var AvailableActionsProver = function AvailableActionsProver(props) {
35
10
  var _useRequest = useRequest({
@@ -48,35 +23,14 @@ var AvailableActionsProver = function AvailableActionsProver(props) {
48
23
  }, props.children);
49
24
  };
50
25
 
51
- var MenuItemsProver = function MenuItemsProver(props) {
52
- var _data$data;
53
-
54
- var route = useRoute();
55
-
56
- var _useRequest2 = useRequest({
57
- url: "uiSchemas:getProperties/".concat(route.uiSchemaUid)
58
- }),
59
- loading = _useRequest2.loading,
60
- data = _useRequest2.data;
61
-
62
- if (loading) {
63
- return /*#__PURE__*/React.createElement(Spin, null);
64
- }
65
-
66
- var items = toItems(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.properties);
67
- return /*#__PURE__*/React.createElement(MenuItemsContext.Provider, {
68
- value: items
69
- }, props.children);
70
- };
71
-
72
26
  export var useAvailableActions = function useAvailableActions() {
73
27
  return useContext(AvailableActionsContext);
74
28
  };
75
- export var useMenuItems = function useMenuItems() {
76
- return useContext(MenuItemsContext);
77
- };
78
29
  export var RoleTable = function RoleTable() {
79
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AvailableActionsProver, null, /*#__PURE__*/React.createElement(MenuItemsProver, null, /*#__PURE__*/React.createElement(SchemaComponent, {
80
- schema: roleSchema
81
- }))));
30
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AvailableActionsProver, null, /*#__PURE__*/React.createElement(SchemaComponent, {
31
+ schema: roleSchema,
32
+ components: {
33
+ MenuItemsProvider: MenuItemsProvider
34
+ }
35
+ })));
82
36
  };
@@ -43,7 +43,7 @@ var toActionMap = function toActionMap(arr) {
43
43
 
44
44
  export var RoleResourceCollectionContext = /*#__PURE__*/createContext({});
45
45
  export var RolesResourcesActions = connect(function (props) {
46
- var _collection$fields, _collection$fields$fi;
46
+ var _collectionFields$fil;
47
47
 
48
48
  // const { onChange } = props;
49
49
  var _onChange = function onChange(values) {
@@ -60,9 +60,11 @@ export var RolesResourcesActions = connect(function (props) {
60
60
  var availableActions = useAvailableActions();
61
61
 
62
62
  var _useCollectionManager = useCollectionManager(),
63
- getCollection = _useCollectionManager.getCollection;
63
+ getCollection = _useCollectionManager.getCollection,
64
+ getCollectionFields = _useCollectionManager.getCollectionFields;
64
65
 
65
66
  var collection = getCollection(roleCollection.name);
67
+ var collectionFields = getCollectionFields(roleCollection.name);
66
68
  var compile = useCompile();
67
69
 
68
70
  var _useTranslation = useTranslation(),
@@ -86,9 +88,9 @@ export var RolesResourcesActions = connect(function (props) {
86
88
  var availableActionsWithFields = availableActions.filter(function (action) {
87
89
  return action.allowConfigureFields;
88
90
  });
89
- var fieldPermissions = collection === null || collection === void 0 ? void 0 : (_collection$fields = collection.fields) === null || _collection$fields === void 0 ? void 0 : (_collection$fields$fi = _collection$fields.filter(function (field) {
91
+ var fieldPermissions = collectionFields === null || collectionFields === void 0 ? void 0 : (_collectionFields$fil = collectionFields.filter(function (field) {
90
92
  return field.interface;
91
- })) === null || _collection$fields$fi === void 0 ? void 0 : _collection$fields$fi.map(function (field) {
93
+ })) === null || _collectionFields$fil === void 0 ? void 0 : _collectionFields$fil.map(function (field) {
92
94
  var permission = _objectSpread({}, field);
93
95
 
94
96
  var _iterator = _createForOfIteratorHelper(availableActionsWithFields),
@@ -112,13 +114,13 @@ export var RolesResourcesActions = connect(function (props) {
112
114
  if (actionMap[actionName]) {
113
115
  delete actionMap[actionName];
114
116
  } else {
115
- var _collection$fields2, _collection$fields2$f, _collection$fields2$f2;
117
+ var _collectionFields$fil2, _collectionFields$fil3;
116
118
 
117
119
  actionMap[actionName] = {
118
120
  name: actionName,
119
- fields: collection === null || collection === void 0 ? void 0 : (_collection$fields2 = collection.fields) === null || _collection$fields2 === void 0 ? void 0 : (_collection$fields2$f = _collection$fields2.filter(function (field) {
121
+ fields: collectionFields === null || collectionFields === void 0 ? void 0 : (_collectionFields$fil2 = collectionFields.filter(function (field) {
120
122
  return field.interface;
121
- })) === null || _collection$fields2$f === void 0 ? void 0 : (_collection$fields2$f2 = _collection$fields2$f.map) === null || _collection$fields2$f2 === void 0 ? void 0 : _collection$fields2$f2.call(_collection$fields2$f, function (item) {
123
+ })) === null || _collectionFields$fil2 === void 0 ? void 0 : (_collectionFields$fil3 = _collectionFields$fil2.map) === null || _collectionFields$fil3 === void 0 ? void 0 : _collectionFields$fil3.call(_collectionFields$fil2, function (item) {
122
124
  return item.name;
123
125
  })
124
126
  };
@@ -145,12 +147,12 @@ export var RolesResourcesActions = connect(function (props) {
145
147
 
146
148
  try {
147
149
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
148
- var _collection$fields4, _collection$fields4$f, _actionMap$action$nam, _actionMap$action$nam2;
150
+ var _collectionFields$fil4, _actionMap$action$nam, _actionMap$action$nam2;
149
151
 
150
152
  var action = _step2.value;
151
- allChecked[action.name] = (collection === null || collection === void 0 ? void 0 : (_collection$fields4 = collection.fields) === null || _collection$fields4 === void 0 ? void 0 : (_collection$fields4$f = _collection$fields4.filter(function (field) {
153
+ allChecked[action.name] = (collectionFields === null || collectionFields === void 0 ? void 0 : (_collectionFields$fil4 = collectionFields.filter(function (field) {
152
154
  return field.interface;
153
- })) === null || _collection$fields4$f === void 0 ? void 0 : _collection$fields4$f.length) === (actionMap === null || actionMap === void 0 ? void 0 : (_actionMap$action$nam = actionMap[action.name]) === null || _actionMap$action$nam === void 0 ? void 0 : (_actionMap$action$nam2 = _actionMap$action$nam.fields) === null || _actionMap$action$nam2 === void 0 ? void 0 : _actionMap$action$nam2.length);
155
+ })) === null || _collectionFields$fil4 === void 0 ? void 0 : _collectionFields$fil4.length) === (actionMap === null || actionMap === void 0 ? void 0 : (_actionMap$action$nam = actionMap[action.name]) === null || _actionMap$action$nam === void 0 ? void 0 : (_actionMap$action$nam2 = _actionMap$action$nam.fields) === null || _actionMap$action$nam2 === void 0 ? void 0 : _actionMap$action$nam2.length);
154
156
  }
155
157
  } catch (err) {
156
158
  _iterator2.e(err);
@@ -185,7 +187,7 @@ export var RolesResourcesActions = connect(function (props) {
185
187
  }
186
188
  }, {
187
189
  dataIndex: 'enabled',
188
- title: t("Allow"),
190
+ title: t('Allow'),
189
191
  render: function render(enabled, action) {
190
192
  return /*#__PURE__*/React.createElement(Checkbox, {
191
193
  checked: enabled,
@@ -196,7 +198,7 @@ export var RolesResourcesActions = connect(function (props) {
196
198
  }
197
199
  }, {
198
200
  dataIndex: 'scope',
199
- title: t("Data scope"),
201
+ title: t('Data scope'),
200
202
  render: function render(value, action) {
201
203
  return !action.onNewRecord && /*#__PURE__*/React.createElement(ScopeSelect, {
202
204
  value: value,
@@ -248,9 +250,9 @@ export var RolesResourcesActions = connect(function (props) {
248
250
  if (checked) {
249
251
  item.fields = [];
250
252
  } else {
251
- var _collection$fields3, _collection$fields3$m;
253
+ var _collectionFields$map;
252
254
 
253
- item.fields = collection === null || collection === void 0 ? void 0 : (_collection$fields3 = collection.fields) === null || _collection$fields3 === void 0 ? void 0 : (_collection$fields3$m = _collection$fields3.map) === null || _collection$fields3$m === void 0 ? void 0 : _collection$fields3$m.call(_collection$fields3, function (item) {
255
+ item.fields = collectionFields === null || collectionFields === void 0 ? void 0 : (_collectionFields$map = collectionFields.map) === null || _collectionFields$map === void 0 ? void 0 : _collectionFields$map.call(collectionFields, function (item) {
254
256
  return item.name;
255
257
  });
256
258
  }
@@ -69,7 +69,9 @@ export var roleCollectionsSchema = {
69
69
  params: {
70
70
  pageSize: 20,
71
71
  filter: {
72
- inherit: false
72
+ hidden: {
73
+ $isFalsy: true
74
+ }
73
75
  },
74
76
  sort: ['sort'],
75
77
  appends: []
@@ -264,6 +264,7 @@ export var roleSchema = {
264
264
  'x-component-props': {},
265
265
  properties: {
266
266
  menu: {
267
+ 'x-decorator': 'MenuItemsProvider',
267
268
  'x-component': 'MenuConfigure'
268
269
  }
269
270
  }
@@ -1,6 +1,6 @@
1
1
  export declare const useRoleResourceValues: (options: any) => {
2
2
  state: {};
3
- setState: (patch: Partial<{}> | ((prevState: {}) => Partial<{}>)) => void;
3
+ setState: import("ahooks/lib/useSetState").SetState<{}>;
4
4
  loading: boolean;
5
5
  data?: any;
6
6
  error?: Error;
@@ -27,6 +27,26 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
27
27
  import { APIClient as APIClientSDK } from '@nocobase/sdk';
28
28
  import { notification as _notification } from 'antd';
29
29
  import React from 'react';
30
+
31
+ var handleErrorMessage = function handleErrorMessage(error) {
32
+ var _error$response;
33
+
34
+ var reader = new FileReader();
35
+ reader.readAsText(error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data, 'utf-8');
36
+
37
+ reader.onload = function () {
38
+ var _JSON$parse$errors, _JSON$parse$errors$ma;
39
+
40
+ _notification.error({
41
+ message: (_JSON$parse$errors = JSON.parse(reader.result).errors) === null || _JSON$parse$errors === void 0 ? void 0 : (_JSON$parse$errors$ma = _JSON$parse$errors.map) === null || _JSON$parse$errors$ma === void 0 ? void 0 : _JSON$parse$errors$ma.call(_JSON$parse$errors, function (error) {
42
+ return /*#__PURE__*/React.createElement('div', {
43
+ children: error.message
44
+ });
45
+ })
46
+ });
47
+ };
48
+ };
49
+
30
50
  export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
31
51
  _inherits(APIClient, _APIClientSDK);
32
52
 
@@ -64,21 +84,27 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
64
84
  this.axios.interceptors.response.use(function (response) {
65
85
  return response;
66
86
  }, function (error) {
67
- var _error$response, _error$response$data, _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
87
+ var _error$response2, _error$response2$data;
68
88
 
69
- var redirectTo = error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.redirectTo;
89
+ var redirectTo = error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.redirectTo;
70
90
 
71
91
  if (redirectTo) {
72
92
  return window.location.href = redirectTo;
73
93
  }
74
94
 
75
- _notification.error({
76
- message: error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2.map) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.call(_error$response2$data2, function (error) {
77
- return /*#__PURE__*/React.createElement('div', {
78
- children: error.message
79
- });
80
- })
81
- });
95
+ if (error.response.data.type === 'application/json') {
96
+ handleErrorMessage(error);
97
+ } else {
98
+ var _error$response3, _error$response3$data, _error$response3$data2, _error$response3$data3;
99
+
100
+ _notification.error({
101
+ message: error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : (_error$response3$data2 = _error$response3$data.errors) === null || _error$response3$data2 === void 0 ? void 0 : (_error$response3$data3 = _error$response3$data2.map) === null || _error$response3$data3 === void 0 ? void 0 : _error$response3$data3.call(_error$response3$data2, function (error) {
102
+ return /*#__PURE__*/React.createElement('div', {
103
+ children: error.message
104
+ });
105
+ })
106
+ });
107
+ }
82
108
 
83
109
  throw error;
84
110
  });
@@ -1,7 +1,7 @@
1
1
  import { Options } from 'ahooks/lib/useRequest/src/types';
2
2
  import { AxiosRequestConfig } from 'axios';
3
3
  declare type FunctionService = (...args: any[]) => Promise<any>;
4
- declare type ResourceActionOptions<P = any> = {
4
+ export declare type ResourceActionOptions<P = any> = {
5
5
  resource?: string;
6
6
  resourceOf?: any;
7
7
  action?: string;
@@ -11,7 +11,7 @@ export declare function useRequest<P>(service: AxiosRequestConfig<P> | ResourceA
11
11
  uid?: string;
12
12
  }): {
13
13
  state: {};
14
- setState: (patch: Partial<{}> | ((prevState: {}) => Partial<{}>)) => void;
14
+ setState: import("ahooks/lib/useSetState").SetState<{}>;
15
15
  loading: boolean;
16
16
  data?: any;
17
17
  error?: Error;
@@ -1,3 +1,4 @@
1
1
  export * from './hooks';
2
2
  export * from './APIClient';
3
3
  export * from './APIClientProvider';
4
+ export * from './context';
@@ -1,3 +1,4 @@
1
1
  export * from './hooks';
2
2
  export * from './APIClient';
3
- export * from './APIClientProvider';
3
+ export * from './APIClientProvider';
4
+ export * from './context';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const CurrentAppInfoContext: React.Context<any>;
3
+ export declare const useCurrentAppInfo: () => any;
4
+ export declare const CurrentAppInfoProvider: (props: any) => JSX.Element;
@@ -0,0 +1,20 @@
1
+ import React, { createContext, useContext } from 'react';
2
+ import { Spin } from 'antd';
3
+ import { useRequest } from '../api-client';
4
+ export var CurrentAppInfoContext = /*#__PURE__*/createContext(null);
5
+ export var useCurrentAppInfo = function useCurrentAppInfo() {
6
+ return useContext(CurrentAppInfoContext);
7
+ };
8
+ export var CurrentAppInfoProvider = function CurrentAppInfoProvider(props) {
9
+ var result = useRequest({
10
+ url: 'app:getInfo'
11
+ });
12
+
13
+ if (result.loading) {
14
+ return /*#__PURE__*/React.createElement(Spin, null);
15
+ }
16
+
17
+ return /*#__PURE__*/React.createElement(CurrentAppInfoContext.Provider, {
18
+ value: result.data
19
+ }, props.children);
20
+ };
@@ -0,0 +1 @@
1
+ export * from './CurrentAppInfoProvider';
@@ -0,0 +1 @@
1
+ export * from './CurrentAppInfoProvider';
@@ -55,6 +55,7 @@ import { SchemaInitializerProvider } from '../schema-initializer';
55
55
  import { BlockTemplateDetails, BlockTemplatePage, SchemaTemplateShortcut } from '../schema-templates';
56
56
  import { SystemSettingsProvider, SystemSettingsShortcut } from '../system-settings';
57
57
  import { SigninPage, SignupPage } from '../user';
58
+ import { SigninPageExtensionProvider } from '../user/SigninPageExtension';
58
59
  import { compose } from './compose';
59
60
  export var getCurrentTimezone = function getCurrentTimezone() {
60
61
  var timezoneOffset = new Date().getTimezoneOffset() / -60;
@@ -136,6 +137,7 @@ export var Application = /*#__PURE__*/function () {
136
137
  });
137
138
  this.use(BlockSchemaComponentProvider);
138
139
  this.use(AntdSchemaComponentProvider);
140
+ this.use(SigninPageExtensionProvider);
139
141
  this.use(ACLProvider);
140
142
  this.use(RemoteDocumentTitleProvider);
141
143
  this.use(PMProvider);