@nocobase/client 0.11.0-alpha.1 → 0.11.1-alpha.1

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 (555) hide show
  1. package/es/acl/ACLProvider.js +10 -8
  2. package/es/acl/Configuration/MenuConfigure.js +20 -1
  3. package/es/acl/Configuration/schemas/useRoleResourceValues.d.ts +32 -1
  4. package/es/api-client/APIClient.d.ts +3 -1
  5. package/es/api-client/APIClient.js +10 -8
  6. package/es/api-client/hooks/useRequest.d.ts +15 -1
  7. package/es/api-client/hooks/useRequest.js +4 -5
  8. package/es/api-client/hooks/useResource.js +2 -3
  9. package/es/application/hooks/useAppPluginLoad.js +4 -3
  10. package/es/async-data-provider/index.js +1 -1
  11. package/es/auth/SigninPage.js +8 -3
  12. package/es/block-provider/FormBlockProvider.js +10 -3
  13. package/es/block-provider/GanttBlockProvider.js +3 -2
  14. package/es/block-provider/TableBlockProvider.js +1 -51
  15. package/es/block-provider/hooks/index.d.ts +5 -3
  16. package/es/block-provider/hooks/index.js +38 -21
  17. package/es/board/style.js +3 -2
  18. package/es/china-region/index.js +3 -0
  19. package/es/collection-manager/CollectionFieldProvider.js +10 -2
  20. package/es/collection-manager/CollectionHistoryProvider.js +2 -2
  21. package/es/collection-manager/CollectionManagerProvider.js +39 -1
  22. package/es/collection-manager/Configuration/AddCollectionAction.js +8 -5
  23. package/es/collection-manager/Configuration/AddFieldAction.js +6 -2
  24. package/es/collection-manager/Configuration/CollectionFields.d.ts +1 -1
  25. package/es/collection-manager/Configuration/CollectionFields.js +27 -32
  26. package/es/collection-manager/Configuration/CollectionFieldsTable.js +5 -1
  27. package/es/collection-manager/Configuration/ConfigurationTable.js +6 -3
  28. package/es/collection-manager/Configuration/ConfigurationTabs.js +11 -4
  29. package/es/collection-manager/Configuration/EditCategoryAction.js +1 -1
  30. package/es/collection-manager/Configuration/EditCollectionAction.d.ts +14 -1
  31. package/es/collection-manager/Configuration/EditFieldAction.js +3 -1
  32. package/es/collection-manager/Configuration/ViewInheritedField.js +13 -3
  33. package/es/collection-manager/Configuration/components/FieldSummary.d.ts +4 -1
  34. package/es/collection-manager/Configuration/components/FieldSummary.js +14 -24
  35. package/es/collection-manager/Configuration/components/Summary.d.ts +6 -0
  36. package/es/collection-manager/Configuration/components/Summary.js +44 -0
  37. package/es/collection-manager/Configuration/components/TemplateSummary.d.ts +7 -0
  38. package/es/collection-manager/Configuration/components/TemplateSummary.js +18 -0
  39. package/es/collection-manager/ResourceActionProvider.js +5 -4
  40. package/es/collection-manager/action-hooks.d.ts +43 -4
  41. package/es/collection-manager/action-hooks.js +18 -11
  42. package/es/collection-manager/hooks/useCollection.d.ts +2 -1
  43. package/es/collection-manager/hooks/useCollectionManager.d.ts +1 -1
  44. package/es/collection-manager/hooks/useCollectionManager.js +7 -9
  45. package/es/collection-manager/interfaces/createdAt.js +2 -1
  46. package/es/collection-manager/interfaces/datetime.js +2 -1
  47. package/es/collection-manager/interfaces/email.js +1 -0
  48. package/es/collection-manager/interfaces/id.js +2 -1
  49. package/es/collection-manager/interfaces/input.js +1 -0
  50. package/es/collection-manager/interfaces/integer.js +1 -0
  51. package/es/collection-manager/interfaces/markdown.js +2 -2
  52. package/es/collection-manager/interfaces/number.js +1 -0
  53. package/es/collection-manager/interfaces/percent.js +1 -0
  54. package/es/collection-manager/interfaces/phone.js +2 -1
  55. package/es/collection-manager/interfaces/radioGroup.js +2 -1
  56. package/es/collection-manager/interfaces/select.js +1 -0
  57. package/es/collection-manager/interfaces/time.js +2 -1
  58. package/es/collection-manager/interfaces/types.d.ts +1 -0
  59. package/es/collection-manager/interfaces/updatedAt.js +2 -1
  60. package/es/collection-manager/interfaces/url.js +2 -1
  61. package/es/collection-manager/sub-table.d.ts +14 -1
  62. package/es/collection-manager/templates/view.js +8 -1
  63. package/es/collection-manager/types.d.ts +1 -0
  64. package/es/css-variable/CSSVariableProvider.d.ts +7 -0
  65. package/es/css-variable/CSSVariableProvider.js +46 -0
  66. package/es/css-variable/index.d.ts +1 -0
  67. package/es/css-variable/index.js +1 -0
  68. package/es/document-title/index.js +4 -1
  69. package/es/global-theme/AntdAppProvider.d.ts +8 -0
  70. package/es/global-theme/AntdAppProvider.js +19 -0
  71. package/es/global-theme/compatOldTheme.d.ts +3 -0
  72. package/es/global-theme/compatOldTheme.js +16 -0
  73. package/es/global-theme/defaultTheme.d.ts +3 -0
  74. package/es/global-theme/defaultTheme.js +18 -0
  75. package/es/global-theme/index.d.ts +28 -0
  76. package/es/global-theme/index.js +64 -0
  77. package/es/global-theme/type.d.ts +33 -0
  78. package/es/global-theme/type.js +1 -0
  79. package/es/global.less +14 -4
  80. package/es/i18n/i18n.js +1 -0
  81. package/es/index.d.ts +3 -0
  82. package/es/index.js +3 -0
  83. package/es/locale/en_US.d.ts +1 -0
  84. package/es/locale/en_US.js +2 -1
  85. package/es/locale/index.d.ts +68 -0
  86. package/es/locale/index.js +69 -0
  87. package/es/locale/ja_JP.d.ts +1 -0
  88. package/es/locale/ja_JP.js +2 -1
  89. package/es/locale/zh_CN.d.ts +1 -0
  90. package/es/locale/zh_CN.js +2 -1
  91. package/es/nocobase-buildin-plugin/index.js +13 -8
  92. package/es/nocobase-buildin-plugin/plugins/LocalePlugin.d.ts +5 -0
  93. package/es/nocobase-buildin-plugin/plugins/LocalePlugin.js +97 -0
  94. package/es/pm/Card.js +23 -21
  95. package/es/pm/index.js +7 -7
  96. package/es/pm/style.d.ts +52 -1
  97. package/es/pm/style.js +55 -3
  98. package/es/powered-by/index.js +4 -1
  99. package/es/route-switch/antd/admin-layout/index.d.ts +1 -1
  100. package/es/route-switch/antd/admin-layout/index.js +10 -8
  101. package/es/schema-component/antd/__builtins__/hooks/useToken.d.ts +6 -1
  102. package/es/schema-component/antd/__builtins__/hooks/useToken.js +5 -1
  103. package/es/schema-component/antd/__builtins__/index.d.ts +2 -0
  104. package/es/schema-component/antd/__builtins__/index.js +2 -0
  105. package/es/schema-component/antd/__builtins__/loading.d.ts +1 -0
  106. package/es/schema-component/antd/__builtins__/loading.js +42 -0
  107. package/es/schema-component/antd/__builtins__/portal.d.ts +10 -0
  108. package/es/schema-component/antd/__builtins__/portal.js +48 -0
  109. package/es/schema-component/antd/__builtins__/render.d.ts +9 -0
  110. package/es/schema-component/antd/__builtins__/render.js +80 -0
  111. package/es/schema-component/antd/__builtins__/style.d.ts +2 -1
  112. package/es/schema-component/antd/action/Action.Designer.d.ts +6 -1
  113. package/es/schema-component/antd/action/Action.Designer.js +158 -73
  114. package/es/schema-component/antd/action/Action.Drawer.js +6 -11
  115. package/es/schema-component/antd/action/Action.Drawer.style.d.ts +1 -0
  116. package/es/schema-component/antd/action/Action.Drawer.style.js +44 -0
  117. package/es/schema-component/antd/action/Action.d.ts +0 -1
  118. package/es/schema-component/antd/action/Action.js +22 -11
  119. package/es/schema-component/antd/action/Action.style.d.ts +2 -0
  120. package/es/schema-component/antd/action/Action.style.js +59 -0
  121. package/es/schema-component/antd/action/ActionBar.js +3 -1
  122. package/es/schema-component/antd/action/hooks.js +6 -4
  123. package/es/schema-component/antd/appends-tree-select/AppendsTreeSelect.d.ts +8 -0
  124. package/es/schema-component/antd/appends-tree-select/AppendsTreeSelect.js +223 -0
  125. package/es/schema-component/antd/appends-tree-select/index.d.ts +1 -0
  126. package/es/schema-component/antd/appends-tree-select/index.js +1 -0
  127. package/es/schema-component/antd/association-field/FileManager.d.ts +1 -1
  128. package/es/schema-component/antd/association-field/FileManager.js +3 -3
  129. package/es/schema-component/antd/association-field/InternalViewer.js +1 -1
  130. package/es/schema-component/antd/association-field/SubTable.js +1 -1
  131. package/es/schema-component/antd/association-field/util.d.ts +1 -2
  132. package/es/schema-component/antd/association-field/util.js +3 -3
  133. package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +25 -18
  134. package/es/schema-component/antd/association-filter/AssociationFilter.Item.style.d.ts +2 -0
  135. package/es/schema-component/antd/association-filter/AssociationFilter.Item.style.js +102 -0
  136. package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -1
  137. package/es/schema-component/antd/block-item/BlockItem.js +1 -1
  138. package/es/schema-component/antd/calendar/Calendar.js +20 -20
  139. package/es/schema-component/antd/calendar/global.style.js +58 -1
  140. package/es/schema-component/antd/calendar/style.js +31 -31
  141. package/es/schema-component/antd/calendar/utils.d.ts +1 -1
  142. package/es/schema-component/antd/card-item/CardItem.js +9 -6
  143. package/es/schema-component/antd/card-item/style.d.ts +2 -0
  144. package/es/schema-component/antd/card-item/style.js +14 -0
  145. package/es/schema-component/antd/cascader/Cascader.js +1 -1
  146. package/es/schema-component/antd/date-picker/util.d.ts +20 -21
  147. package/es/schema-component/antd/date-picker/util.js +1 -1
  148. package/es/schema-component/antd/expand-action/Expand.Action.js +1 -1
  149. package/es/schema-component/antd/filter/FilterAction.js +1 -1
  150. package/es/schema-component/antd/filter/FilterGroup.js +9 -5
  151. package/es/schema-component/antd/filter/SaveDefaultValue.js +1 -1
  152. package/es/schema-component/antd/form/Form.js +1 -1
  153. package/es/schema-component/antd/form-dialog/index.d.ts +29 -0
  154. package/es/schema-component/antd/form-dialog/index.js +258 -0
  155. package/es/schema-component/antd/form-v2/Templates.js +25 -17
  156. package/es/schema-component/antd/gantt/components/calendar/calendar.js +18 -14
  157. package/es/schema-component/antd/gantt/components/calendar/style.d.ts +2 -4
  158. package/es/schema-component/antd/gantt/components/calendar/style.js +46 -7
  159. package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +3 -4
  160. package/es/schema-component/antd/gantt/components/gantt/gantt.js +26 -17
  161. package/es/schema-component/antd/gantt/components/gantt/style.d.ts +2 -3
  162. package/es/schema-component/antd/gantt/components/gantt/style.js +47 -6
  163. package/es/schema-component/antd/gantt/components/gantt/task-gantt.d.ts +1 -1
  164. package/es/schema-component/antd/gantt/components/gantt/task-gantt.js +6 -13
  165. package/es/schema-component/antd/gantt/components/grid/grid-body.js +12 -8
  166. package/es/schema-component/antd/gantt/components/grid/style.d.ts +2 -4
  167. package/es/schema-component/antd/gantt/components/grid/style.js +26 -7
  168. package/es/schema-component/antd/gantt/components/other/horizontal-scroll.js +10 -7
  169. package/es/schema-component/antd/gantt/components/other/style.d.ts +2 -7
  170. package/es/schema-component/antd/gantt/components/other/style.js +101 -10
  171. package/es/schema-component/antd/gantt/components/other/tooltip.js +18 -10
  172. package/es/schema-component/antd/gantt/components/other/vertical-scroll.js +9 -5
  173. package/es/schema-component/antd/gantt/components/task-item/style.d.ts +2 -3
  174. package/es/schema-component/antd/gantt/components/task-item/style.js +45 -6
  175. package/es/schema-component/antd/gantt/components/task-item/task-item.js +9 -4
  176. package/es/schema-component/antd/grid/Grid.js +45 -30
  177. package/es/schema-component/antd/grid/Grid.style.d.ts +2 -0
  178. package/es/schema-component/antd/grid/Grid.style.js +46 -0
  179. package/es/schema-component/antd/grid-card/GridCard.Decorator.js +8 -6
  180. package/es/schema-component/antd/grid-card/GridCard.Decorator.style.d.ts +2 -0
  181. package/es/schema-component/antd/grid-card/GridCard.Decorator.style.js +25 -0
  182. package/es/schema-component/antd/grid-card/GridCard.d.ts +1 -1
  183. package/es/schema-component/antd/grid-card/GridCard.js +6 -6
  184. package/es/schema-component/antd/index.d.ts +2 -0
  185. package/es/schema-component/antd/index.js +2 -0
  186. package/es/schema-component/antd/index.less +0 -16
  187. package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +1 -1
  188. package/es/schema-component/antd/list/List.Item.js +1 -5
  189. package/es/schema-component/antd/list/List.js +10 -8
  190. package/es/schema-component/antd/list/List.style.d.ts +2 -0
  191. package/es/schema-component/antd/list/List.style.js +54 -0
  192. package/es/schema-component/antd/markdown/Markdown.Void.js +7 -2
  193. package/es/schema-component/antd/markdown/Markdown.js +1 -1
  194. package/es/schema-component/antd/markdown/md.d.ts +0 -2
  195. package/es/schema-component/antd/markdown/md.js +0 -2
  196. package/es/schema-component/antd/markdown/style.js +212 -4
  197. package/es/schema-component/antd/menu/Menu.Designer.js +15 -13
  198. package/es/schema-component/antd/menu/Menu.js +13 -6
  199. package/es/schema-component/antd/menu/MenuItemInitializers/index.js +198 -197
  200. package/es/schema-component/antd/page/Page.d.ts +4 -1
  201. package/es/schema-component/antd/page/Page.js +37 -32
  202. package/es/schema-component/antd/page/PageTabDesigner.js +4 -2
  203. package/es/schema-component/antd/page/style.d.ts +1 -0
  204. package/es/schema-component/antd/page/style.js +127 -0
  205. package/es/schema-component/antd/remote-select/ReadPretty.js +2 -2
  206. package/es/schema-component/antd/rich-text/style.js +20 -20
  207. package/es/schema-component/antd/select/Select.js +5 -2
  208. package/es/schema-component/antd/table/Table.Array.js +7 -7
  209. package/es/schema-component/antd/table/Table.Column.ActionBar.js +1 -1
  210. package/es/schema-component/antd/table-v2/Table.Column.ActionBar.js +1 -1
  211. package/es/schema-component/antd/table-v2/Table.js +21 -6
  212. package/es/schema-component/antd/table-v2/components/ColumnFieldProvider.d.ts +6 -0
  213. package/es/schema-component/antd/table-v2/components/ColumnFieldProvider.js +37 -0
  214. package/es/schema-component/antd/tabs/Tabs.js +3 -3
  215. package/es/schema-component/antd/upload/ReadPretty.js +6 -1
  216. package/es/schema-component/antd/upload/style.js +11 -1
  217. package/es/schema-component/antd/variable/Input.js +2 -3
  218. package/es/schema-component/antd/variable/Variable.d.ts +10 -5
  219. package/es/schema-component/antd/variable/Variable.js +13 -0
  220. package/es/schema-component/antd/variable/VariableSelect.js +19 -9
  221. package/es/schema-component/antd/variable/VariableSelect.style.d.ts +2 -0
  222. package/es/schema-component/antd/variable/VariableSelect.style.js +31 -0
  223. package/es/schema-component/antd/variable/XButton.js +8 -5
  224. package/es/schema-component/antd/variable/style.js +12 -3
  225. package/es/schema-component/common/sortable-item/SortableItem.js +5 -1
  226. package/es/schema-component/common/utils/logic.js +46 -0
  227. package/es/schema-component/common/utils/uitls.d.ts +1 -1
  228. package/es/schema-component/common/utils/uitls.js +6 -1
  229. package/es/schema-component/core/DesignableSwitch.js +1 -1
  230. package/es/schema-initializer/SchemaInitializer.js +21 -21
  231. package/es/schema-initializer/SelectCollection.js +17 -1
  232. package/es/schema-initializer/buttons/CalendarActionInitializers.js +2 -2
  233. package/es/schema-initializer/buttons/CalendarFormActionInitializers.js +9 -9
  234. package/es/schema-initializer/buttons/GridCardActionInitializers.js +4 -4
  235. package/es/schema-initializer/buttons/KanbanActionInitializers.js +2 -2
  236. package/es/schema-initializer/buttons/ListActionInitializers.js +8 -8
  237. package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -1
  238. package/es/schema-initializer/buttons/RecordBlockInitializers.js +1 -1
  239. package/es/schema-initializer/buttons/TabPaneInitializers.js +2 -2
  240. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +8 -6
  241. package/es/schema-initializer/buttons/TableActionInitializers.js +4 -4
  242. package/es/schema-initializer/buttons/index.d.ts +6 -7
  243. package/es/schema-initializer/buttons/index.js +6 -7
  244. package/es/schema-initializer/components/CreateRecordAction.js +1 -1
  245. package/es/schema-initializer/components/DuplicateAction.js +8 -6
  246. package/es/schema-initializer/components/assigned-field/AssignedField.js +6 -4
  247. package/es/schema-initializer/items/CalendarBlockInitializer.js +6 -4
  248. package/es/schema-initializer/items/DetailsBlockInitializer.js +2 -2
  249. package/es/schema-initializer/items/GanttBlockInitializer.js +6 -3
  250. package/es/schema-initializer/items/KanbanBlockInitializer.js +7 -5
  251. package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +6 -3
  252. package/es/schema-initializer/items/index.d.ts +1 -1
  253. package/es/schema-initializer/items/index.js +1 -1
  254. package/es/schema-initializer/style.d.ts +7 -1
  255. package/es/schema-initializer/style.js +9 -2
  256. package/es/schema-initializer/utils.js +1 -1
  257. package/es/schema-settings/GeneralSchemaDesigner.js +1 -1
  258. package/es/schema-settings/LinkageRules/components/LinkageHeader.js +5 -2
  259. package/es/schema-settings/SchemaSettings.js +16 -14
  260. package/es/style/index.d.ts +2 -0
  261. package/es/style/index.js +2 -0
  262. package/es/style/useToken.d.ts +11 -0
  263. package/es/style/useToken.js +7 -0
  264. package/es/system-settings/SystemSettingsShortcut.js +2 -110
  265. package/es/test/AppContextProvider.d.ts +11 -0
  266. package/es/test/AppContextProvider.js +15 -0
  267. package/es/user/CurrentUser.js +39 -16
  268. package/es/user/CurrentUserProvider.d.ts +6 -2
  269. package/es/user/CurrentUserProvider.js +12 -7
  270. package/es/user/CurrentUserSettingsMenuProvider.d.ts +21 -0
  271. package/es/user/CurrentUserSettingsMenuProvider.js +81 -0
  272. package/es/user/index.d.ts +1 -0
  273. package/es/user/index.js +1 -0
  274. package/lib/acl/ACLProvider.js +10 -8
  275. package/lib/acl/Configuration/MenuConfigure.js +20 -1
  276. package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +32 -1
  277. package/lib/api-client/APIClient.d.ts +3 -1
  278. package/lib/api-client/APIClient.js +9 -7
  279. package/lib/api-client/hooks/useRequest.d.ts +15 -1
  280. package/lib/api-client/hooks/useRequest.js +4 -5
  281. package/lib/api-client/hooks/useResource.js +2 -3
  282. package/lib/application/hooks/useAppPluginLoad.js +4 -3
  283. package/lib/async-data-provider/index.js +1 -1
  284. package/lib/auth/SigninPage.js +7 -2
  285. package/lib/block-provider/FormBlockProvider.js +10 -3
  286. package/lib/block-provider/GanttBlockProvider.js +3 -2
  287. package/lib/block-provider/TableBlockProvider.js +1 -51
  288. package/lib/block-provider/hooks/index.d.ts +5 -3
  289. package/lib/block-provider/hooks/index.js +36 -19
  290. package/lib/board/style.js +3 -2
  291. package/lib/china-region/index.js +3 -0
  292. package/lib/collection-manager/CollectionFieldProvider.js +10 -2
  293. package/lib/collection-manager/CollectionHistoryProvider.js +1 -1
  294. package/lib/collection-manager/CollectionManagerProvider.js +39 -1
  295. package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -5
  296. package/lib/collection-manager/Configuration/AddFieldAction.js +6 -2
  297. package/lib/collection-manager/Configuration/CollectionFields.d.ts +1 -1
  298. package/lib/collection-manager/Configuration/CollectionFields.js +28 -33
  299. package/lib/collection-manager/Configuration/CollectionFieldsTable.js +5 -1
  300. package/lib/collection-manager/Configuration/ConfigurationTable.js +6 -3
  301. package/lib/collection-manager/Configuration/ConfigurationTabs.js +10 -3
  302. package/lib/collection-manager/Configuration/EditCategoryAction.js +1 -1
  303. package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +14 -1
  304. package/lib/collection-manager/Configuration/EditFieldAction.js +3 -1
  305. package/lib/collection-manager/Configuration/ViewInheritedField.js +12 -2
  306. package/lib/collection-manager/Configuration/components/FieldSummary.d.ts +4 -1
  307. package/lib/collection-manager/Configuration/components/FieldSummary.js +18 -25
  308. package/lib/collection-manager/Configuration/components/Summary.d.ts +6 -0
  309. package/lib/collection-manager/Configuration/components/Summary.js +54 -0
  310. package/lib/collection-manager/Configuration/components/TemplateSummary.d.ts +7 -0
  311. package/lib/collection-manager/Configuration/components/TemplateSummary.js +29 -0
  312. package/lib/collection-manager/ResourceActionProvider.js +5 -4
  313. package/lib/collection-manager/action-hooks.d.ts +43 -4
  314. package/lib/collection-manager/action-hooks.js +18 -11
  315. package/lib/collection-manager/hooks/useCollection.d.ts +2 -1
  316. package/lib/collection-manager/hooks/useCollectionManager.d.ts +1 -1
  317. package/lib/collection-manager/hooks/useCollectionManager.js +7 -9
  318. package/lib/collection-manager/interfaces/createdAt.js +2 -1
  319. package/lib/collection-manager/interfaces/datetime.js +2 -1
  320. package/lib/collection-manager/interfaces/email.js +1 -0
  321. package/lib/collection-manager/interfaces/id.js +2 -1
  322. package/lib/collection-manager/interfaces/input.js +1 -0
  323. package/lib/collection-manager/interfaces/integer.js +1 -0
  324. package/lib/collection-manager/interfaces/markdown.js +2 -2
  325. package/lib/collection-manager/interfaces/number.js +1 -0
  326. package/lib/collection-manager/interfaces/percent.js +1 -0
  327. package/lib/collection-manager/interfaces/phone.js +2 -1
  328. package/lib/collection-manager/interfaces/radioGroup.js +2 -1
  329. package/lib/collection-manager/interfaces/select.js +1 -0
  330. package/lib/collection-manager/interfaces/time.js +2 -1
  331. package/lib/collection-manager/interfaces/types.d.ts +1 -0
  332. package/lib/collection-manager/interfaces/updatedAt.js +2 -1
  333. package/lib/collection-manager/interfaces/url.js +2 -1
  334. package/lib/collection-manager/sub-table.d.ts +14 -1
  335. package/lib/collection-manager/templates/view.js +8 -1
  336. package/lib/collection-manager/types.d.ts +1 -0
  337. package/lib/css-variable/CSSVariableProvider.d.ts +7 -0
  338. package/lib/css-variable/CSSVariableProvider.js +53 -0
  339. package/lib/css-variable/index.d.ts +1 -0
  340. package/lib/css-variable/index.js +13 -0
  341. package/lib/document-title/index.js +4 -1
  342. package/lib/global-theme/AntdAppProvider.d.ts +8 -0
  343. package/lib/global-theme/AntdAppProvider.js +29 -0
  344. package/lib/global-theme/compatOldTheme.d.ts +3 -0
  345. package/lib/global-theme/compatOldTheme.js +24 -0
  346. package/lib/global-theme/defaultTheme.d.ts +3 -0
  347. package/lib/global-theme/defaultTheme.js +25 -0
  348. package/lib/global-theme/index.d.ts +28 -0
  349. package/lib/global-theme/index.js +111 -0
  350. package/lib/global-theme/type.d.ts +33 -0
  351. package/lib/global-theme/type.js +5 -0
  352. package/lib/global.less +14 -4
  353. package/lib/i18n/i18n.js +1 -0
  354. package/lib/index.d.ts +3 -0
  355. package/lib/index.js +67 -1
  356. package/lib/locale/en_US.d.ts +1 -0
  357. package/lib/locale/en_US.js +2 -1
  358. package/lib/locale/index.d.ts +68 -0
  359. package/lib/locale/index.js +71 -1
  360. package/lib/locale/ja_JP.d.ts +1 -0
  361. package/lib/locale/ja_JP.js +2 -1
  362. package/lib/locale/zh_CN.d.ts +1 -0
  363. package/lib/locale/zh_CN.js +2 -1
  364. package/lib/nocobase-buildin-plugin/index.js +13 -8
  365. package/lib/nocobase-buildin-plugin/plugins/LocalePlugin.d.ts +5 -0
  366. package/lib/nocobase-buildin-plugin/plugins/LocalePlugin.js +112 -0
  367. package/lib/pm/Card.js +22 -20
  368. package/lib/pm/index.js +10 -10
  369. package/lib/pm/style.d.ts +52 -1
  370. package/lib/pm/style.js +55 -3
  371. package/lib/powered-by/index.js +4 -1
  372. package/lib/route-switch/antd/admin-layout/index.d.ts +1 -1
  373. package/lib/route-switch/antd/admin-layout/index.js +9 -7
  374. package/lib/schema-component/antd/__builtins__/hooks/useToken.d.ts +6 -1
  375. package/lib/schema-component/antd/__builtins__/hooks/useToken.js +5 -1
  376. package/lib/schema-component/antd/__builtins__/index.d.ts +2 -0
  377. package/lib/schema-component/antd/__builtins__/index.js +22 -0
  378. package/lib/schema-component/antd/__builtins__/loading.d.ts +1 -0
  379. package/lib/schema-component/antd/__builtins__/loading.js +49 -0
  380. package/lib/schema-component/antd/__builtins__/portal.d.ts +10 -0
  381. package/lib/schema-component/antd/__builtins__/portal.js +59 -0
  382. package/lib/schema-component/antd/__builtins__/render.d.ts +9 -0
  383. package/lib/schema-component/antd/__builtins__/render.js +89 -0
  384. package/lib/schema-component/antd/__builtins__/style.d.ts +2 -1
  385. package/lib/schema-component/antd/action/Action.Designer.d.ts +6 -1
  386. package/lib/schema-component/antd/action/Action.Designer.js +159 -74
  387. package/lib/schema-component/antd/action/Action.Drawer.js +6 -11
  388. package/lib/schema-component/antd/action/Action.Drawer.style.d.ts +1 -0
  389. package/lib/schema-component/antd/action/Action.Drawer.style.js +51 -0
  390. package/lib/schema-component/antd/action/Action.d.ts +0 -1
  391. package/lib/schema-component/antd/action/Action.js +22 -12
  392. package/lib/schema-component/antd/action/Action.style.d.ts +2 -0
  393. package/lib/schema-component/antd/action/Action.style.js +66 -0
  394. package/lib/schema-component/antd/action/ActionBar.js +3 -1
  395. package/lib/schema-component/antd/action/hooks.js +4 -2
  396. package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.d.ts +8 -0
  397. package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelect.js +232 -0
  398. package/lib/schema-component/antd/appends-tree-select/index.d.ts +1 -0
  399. package/lib/schema-component/antd/appends-tree-select/index.js +16 -0
  400. package/lib/schema-component/antd/association-field/FileManager.d.ts +1 -1
  401. package/lib/schema-component/antd/association-field/FileManager.js +2 -2
  402. package/lib/schema-component/antd/association-field/InternalViewer.js +1 -1
  403. package/lib/schema-component/antd/association-field/SubTable.js +1 -1
  404. package/lib/schema-component/antd/association-field/util.d.ts +1 -2
  405. package/lib/schema-component/antd/association-field/util.js +3 -3
  406. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +25 -18
  407. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.style.d.ts +2 -0
  408. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.style.js +109 -0
  409. package/lib/schema-component/antd/association-filter/AssociationFilter.js +4 -1
  410. package/lib/schema-component/antd/block-item/BlockItem.js +1 -1
  411. package/lib/schema-component/antd/calendar/Calendar.js +20 -20
  412. package/lib/schema-component/antd/calendar/global.style.js +58 -1
  413. package/lib/schema-component/antd/calendar/style.js +31 -31
  414. package/lib/schema-component/antd/calendar/utils.d.ts +1 -1
  415. package/lib/schema-component/antd/card-item/CardItem.js +9 -6
  416. package/lib/schema-component/antd/card-item/style.d.ts +2 -0
  417. package/lib/schema-component/antd/card-item/style.js +21 -0
  418. package/lib/schema-component/antd/cascader/Cascader.js +1 -1
  419. package/lib/schema-component/antd/date-picker/util.d.ts +20 -21
  420. package/lib/schema-component/antd/date-picker/util.js +1 -1
  421. package/lib/schema-component/antd/expand-action/Expand.Action.js +1 -1
  422. package/lib/schema-component/antd/filter/FilterAction.js +1 -1
  423. package/lib/schema-component/antd/filter/FilterGroup.js +9 -5
  424. package/lib/schema-component/antd/filter/SaveDefaultValue.js +1 -1
  425. package/lib/schema-component/antd/form/Form.js +1 -1
  426. package/lib/schema-component/antd/form-dialog/index.d.ts +29 -0
  427. package/lib/schema-component/antd/form-dialog/index.js +268 -0
  428. package/lib/schema-component/antd/form-v2/Templates.js +24 -16
  429. package/lib/schema-component/antd/gantt/components/calendar/calendar.js +18 -14
  430. package/lib/schema-component/antd/gantt/components/calendar/style.d.ts +2 -4
  431. package/lib/schema-component/antd/gantt/components/calendar/style.js +48 -12
  432. package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +3 -4
  433. package/lib/schema-component/antd/gantt/components/gantt/gantt.js +27 -17
  434. package/lib/schema-component/antd/gantt/components/gantt/style.d.ts +2 -3
  435. package/lib/schema-component/antd/gantt/components/gantt/style.js +49 -10
  436. package/lib/schema-component/antd/gantt/components/gantt/task-gantt.d.ts +1 -1
  437. package/lib/schema-component/antd/gantt/components/gantt/task-gantt.js +5 -12
  438. package/lib/schema-component/antd/gantt/components/grid/grid-body.js +12 -8
  439. package/lib/schema-component/antd/gantt/components/grid/style.d.ts +2 -4
  440. package/lib/schema-component/antd/gantt/components/grid/style.js +28 -12
  441. package/lib/schema-component/antd/gantt/components/other/horizontal-scroll.js +10 -6
  442. package/lib/schema-component/antd/gantt/components/other/style.d.ts +2 -7
  443. package/lib/schema-component/antd/gantt/components/other/style.js +103 -18
  444. package/lib/schema-component/antd/gantt/components/other/tooltip.js +19 -10
  445. package/lib/schema-component/antd/gantt/components/other/vertical-scroll.js +10 -5
  446. package/lib/schema-component/antd/gantt/components/task-item/style.d.ts +2 -3
  447. package/lib/schema-component/antd/gantt/components/task-item/style.js +47 -10
  448. package/lib/schema-component/antd/gantt/components/task-item/task-item.js +10 -4
  449. package/lib/schema-component/antd/grid/Grid.js +45 -30
  450. package/lib/schema-component/antd/grid/Grid.style.d.ts +2 -0
  451. package/lib/schema-component/antd/grid/Grid.style.js +53 -0
  452. package/lib/schema-component/antd/grid-card/GridCard.Decorator.js +10 -7
  453. package/lib/schema-component/antd/grid-card/GridCard.Decorator.style.d.ts +2 -0
  454. package/lib/schema-component/antd/grid-card/GridCard.Decorator.style.js +32 -0
  455. package/lib/schema-component/antd/grid-card/GridCard.d.ts +1 -1
  456. package/lib/schema-component/antd/grid-card/GridCard.js +28 -28
  457. package/lib/schema-component/antd/index.d.ts +2 -0
  458. package/lib/schema-component/antd/index.js +22 -0
  459. package/lib/schema-component/antd/index.less +0 -16
  460. package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +1 -1
  461. package/lib/schema-component/antd/list/List.Item.js +1 -5
  462. package/lib/schema-component/antd/list/List.js +10 -7
  463. package/lib/schema-component/antd/list/List.style.d.ts +2 -0
  464. package/lib/schema-component/antd/list/List.style.js +61 -0
  465. package/lib/schema-component/antd/markdown/Markdown.Void.js +6 -1
  466. package/lib/schema-component/antd/markdown/Markdown.js +1 -1
  467. package/lib/schema-component/antd/markdown/md.d.ts +0 -2
  468. package/lib/schema-component/antd/markdown/md.js +0 -2
  469. package/lib/schema-component/antd/markdown/style.js +212 -4
  470. package/lib/schema-component/antd/menu/Menu.Designer.js +15 -13
  471. package/lib/schema-component/antd/menu/Menu.js +13 -6
  472. package/lib/schema-component/antd/menu/MenuItemInitializers/index.js +195 -194
  473. package/lib/schema-component/antd/page/Page.d.ts +4 -1
  474. package/lib/schema-component/antd/page/Page.js +38 -33
  475. package/lib/schema-component/antd/page/PageTabDesigner.js +3 -1
  476. package/lib/schema-component/antd/page/style.d.ts +1 -0
  477. package/lib/schema-component/antd/page/style.js +134 -0
  478. package/lib/schema-component/antd/remote-select/ReadPretty.js +2 -2
  479. package/lib/schema-component/antd/rich-text/style.js +20 -20
  480. package/lib/schema-component/antd/select/Select.js +5 -2
  481. package/lib/schema-component/antd/table/Table.Array.js +7 -7
  482. package/lib/schema-component/antd/table/Table.Column.ActionBar.js +1 -1
  483. package/lib/schema-component/antd/table-v2/Table.Column.ActionBar.js +1 -1
  484. package/lib/schema-component/antd/table-v2/Table.js +20 -5
  485. package/lib/schema-component/antd/table-v2/components/ColumnFieldProvider.d.ts +6 -0
  486. package/lib/schema-component/antd/table-v2/components/ColumnFieldProvider.js +45 -0
  487. package/lib/schema-component/antd/tabs/Tabs.js +3 -3
  488. package/lib/schema-component/antd/upload/ReadPretty.js +8 -3
  489. package/lib/schema-component/antd/upload/style.js +11 -1
  490. package/lib/schema-component/antd/variable/Input.js +1 -2
  491. package/lib/schema-component/antd/variable/Variable.d.ts +10 -5
  492. package/lib/schema-component/antd/variable/Variable.js +23 -5
  493. package/lib/schema-component/antd/variable/VariableSelect.js +19 -8
  494. package/lib/schema-component/antd/variable/VariableSelect.style.d.ts +2 -0
  495. package/lib/schema-component/antd/variable/VariableSelect.style.js +38 -0
  496. package/lib/schema-component/antd/variable/XButton.js +8 -5
  497. package/lib/schema-component/antd/variable/style.js +12 -3
  498. package/lib/schema-component/common/sortable-item/SortableItem.js +5 -1
  499. package/lib/schema-component/common/utils/logic.js +46 -0
  500. package/lib/schema-component/common/utils/uitls.d.ts +1 -1
  501. package/lib/schema-component/common/utils/uitls.js +6 -1
  502. package/lib/schema-component/core/DesignableSwitch.js +1 -1
  503. package/lib/schema-initializer/SchemaInitializer.js +22 -22
  504. package/lib/schema-initializer/SelectCollection.js +17 -1
  505. package/lib/schema-initializer/buttons/CalendarActionInitializers.js +2 -2
  506. package/lib/schema-initializer/buttons/CalendarFormActionInitializers.js +9 -9
  507. package/lib/schema-initializer/buttons/GridCardActionInitializers.js +4 -4
  508. package/lib/schema-initializer/buttons/KanbanActionInitializers.js +2 -2
  509. package/lib/schema-initializer/buttons/ListActionInitializers.js +8 -8
  510. package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +1 -1
  511. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +1 -1
  512. package/lib/schema-initializer/buttons/TabPaneInitializers.js +2 -2
  513. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +8 -6
  514. package/lib/schema-initializer/buttons/TableActionInitializers.js +4 -4
  515. package/lib/schema-initializer/buttons/index.d.ts +6 -7
  516. package/lib/schema-initializer/buttons/index.js +60 -60
  517. package/lib/schema-initializer/components/CreateRecordAction.js +1 -1
  518. package/lib/schema-initializer/components/DuplicateAction.js +7 -5
  519. package/lib/schema-initializer/components/assigned-field/AssignedField.js +5 -3
  520. package/lib/schema-initializer/items/CalendarBlockInitializer.js +5 -3
  521. package/lib/schema-initializer/items/DetailsBlockInitializer.js +2 -2
  522. package/lib/schema-initializer/items/GanttBlockInitializer.js +5 -2
  523. package/lib/schema-initializer/items/KanbanBlockInitializer.js +6 -4
  524. package/lib/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +5 -2
  525. package/lib/schema-initializer/items/index.d.ts +1 -1
  526. package/lib/schema-initializer/items/index.js +11 -11
  527. package/lib/schema-initializer/style.d.ts +7 -1
  528. package/lib/schema-initializer/style.js +9 -2
  529. package/lib/schema-initializer/utils.js +1 -1
  530. package/lib/schema-settings/GeneralSchemaDesigner.js +1 -1
  531. package/lib/schema-settings/LinkageRules/components/LinkageHeader.js +5 -2
  532. package/lib/schema-settings/SchemaSettings.js +16 -15
  533. package/lib/style/index.d.ts +2 -0
  534. package/lib/style/index.js +27 -0
  535. package/lib/style/useToken.d.ts +11 -0
  536. package/lib/style/useToken.js +13 -0
  537. package/lib/system-settings/SystemSettingsShortcut.js +2 -110
  538. package/lib/test/AppContextProvider.d.ts +11 -0
  539. package/lib/test/AppContextProvider.js +25 -0
  540. package/lib/user/CurrentUser.js +35 -12
  541. package/lib/user/CurrentUserProvider.d.ts +6 -2
  542. package/lib/user/CurrentUserProvider.js +15 -9
  543. package/lib/user/CurrentUserSettingsMenuProvider.d.ts +21 -0
  544. package/lib/user/CurrentUserSettingsMenuProvider.js +92 -0
  545. package/lib/user/index.d.ts +1 -0
  546. package/lib/user/index.js +11 -0
  547. package/package.json +7 -6
  548. package/es/collection-manager/Configuration/components/TemplateSummay.d.ts +0 -2
  549. package/es/collection-manager/Configuration/components/TemplateSummay.js +0 -28
  550. package/es/schema-component/antd/markdown/highlight-theme/default.less +0 -98
  551. package/es/schema-component/antd/markdown/highlight-theme/table.less +0 -36
  552. package/lib/collection-manager/Configuration/components/TemplateSummay.d.ts +0 -2
  553. package/lib/collection-manager/Configuration/components/TemplateSummay.js +0 -36
  554. package/lib/schema-component/antd/markdown/highlight-theme/default.less +0 -98
  555. package/lib/schema-component/antd/markdown/highlight-theme/table.less +0 -36
@@ -145,15 +145,17 @@ var getIgnoreScope = function getIgnoreScope() {
145
145
  };
146
146
  var useAllowedActions = function useAllowedActions() {
147
147
  var _result$allowedAction, _result$service, _result$service$data, _result$service$data$;
148
+ var service = useResourceActionContext();
148
149
  var result = useBlockRequestContext() || {
149
- service: useResourceActionContext()
150
+ service: service
150
151
  };
151
152
  return (_result$allowedAction = result === null || result === void 0 ? void 0 : result.allowedActions) !== null && _result$allowedAction !== void 0 ? _result$allowedAction : result === null || result === void 0 ? void 0 : (_result$service = result.service) === null || _result$service === void 0 ? void 0 : (_result$service$data = _result$service.data) === null || _result$service$data === void 0 ? void 0 : (_result$service$data$ = _result$service$data.meta) === null || _result$service$data$ === void 0 ? void 0 : _result$service$data$.allowedActions;
152
153
  };
153
154
  var useResourceName = function useResourceName() {
154
155
  var _result$props, _result$service2, _result$service2$defa;
156
+ var service = useResourceActionContext();
155
157
  var result = useBlockRequestContext() || {
156
- service: useResourceActionContext()
158
+ service: service
157
159
  };
158
160
  return (result === null || result === void 0 ? void 0 : (_result$props = result.props) === null || _result$props === void 0 ? void 0 : _result$props.resource) || (result === null || result === void 0 ? void 0 : (_result$service2 = result.service) === null || _result$service2 === void 0 ? void 0 : (_result$service2$defa = _result$service2.defaultRequest) === null || _result$service2$defa === void 0 ? void 0 : _result$service2$defa.resource);
159
161
  };
@@ -283,12 +285,6 @@ export var ACLCollectionFieldProvider = function ACLCollectionFieldProvider(prop
283
285
  var field = useField();
284
286
  var _useACLRoleContext4 = useACLRoleContext(),
285
287
  allowAll = _useACLRoleContext4.allowAll;
286
- if (allowAll) {
287
- return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
288
- }
289
- if (!fieldSchema['x-collection-field']) {
290
- return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
291
- }
292
288
  var _useACLFieldWhitelist = useACLFieldWhitelist(),
293
289
  whitelist = _useACLFieldWhitelist.whitelist;
294
290
  var allowed = whitelist.length > 0 ? whitelist.includes(fieldSchema.name) : true;
@@ -298,6 +294,12 @@ export var ACLCollectionFieldProvider = function ACLCollectionFieldProvider(prop
298
294
  field.display = 'hidden';
299
295
  }
300
296
  }, [allowed]);
297
+ if (allowAll) {
298
+ return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
299
+ }
300
+ if (!fieldSchema['x-collection-field']) {
301
+ return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
302
+ }
301
303
  if (!allowed) {
302
304
  return null;
303
305
  }
@@ -1,4 +1,9 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
7
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
9
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -162,6 +167,20 @@ export var MenuConfigure = function MenuConfigure() {
162
167
  return _ref.apply(this, arguments);
163
168
  };
164
169
  }();
170
+ var translateTitle = function translateTitle(menus) {
171
+ return menus.map(function (menu) {
172
+ var title = t(menu.title);
173
+ if (menu.children) {
174
+ return _objectSpread(_objectSpread({}, menu), {}, {
175
+ title: title,
176
+ children: translateTitle(menu.children)
177
+ });
178
+ }
179
+ return _objectSpread(_objectSpread({}, menu), {}, {
180
+ title: title
181
+ });
182
+ });
183
+ };
165
184
  return /*#__PURE__*/React.createElement(Table, {
166
185
  className: styles,
167
186
  loading: loading,
@@ -223,6 +242,6 @@ export var MenuConfigure = function MenuConfigure() {
223
242
  });
224
243
  }
225
244
  }],
226
- dataSource: items
245
+ dataSource: translateTitle(items)
227
246
  });
228
247
  };
@@ -1 +1,32 @@
1
- export declare const useRoleResourceValues: (options: any) => any;
1
+ export declare const useRoleResourceValues: (options: any) => {
2
+ state: {};
3
+ setState: import("ahooks/lib/useSetState").SetState<{}>;
4
+ loading: boolean;
5
+ data?: {
6
+ appends: string[];
7
+ filterByTk: any;
8
+ };
9
+ error?: Error;
10
+ params: any;
11
+ cancel: () => void;
12
+ refresh: () => void;
13
+ refreshAsync: () => Promise<{
14
+ appends: string[];
15
+ filterByTk: any;
16
+ }>;
17
+ run: (...params: any) => void;
18
+ runAsync: (...params: any) => Promise<{
19
+ appends: string[];
20
+ filterByTk: any;
21
+ }>;
22
+ mutate: (data?: {
23
+ appends: string[];
24
+ filterByTk: any;
25
+ } | ((oldData?: {
26
+ appends: string[];
27
+ filterByTk: any;
28
+ }) => {
29
+ appends: string[];
30
+ filterByTk: any;
31
+ })) => void;
32
+ };
@@ -3,8 +3,10 @@ import { Result } from 'ahooks/es/useRequest/src/types';
3
3
  export declare class APIClient extends APIClientSDK {
4
4
  services: Record<string, Result<any, any>>;
5
5
  silence: boolean;
6
+ /** 该值会在 AntdAppProvider 中被重新赋值 */
7
+ notification: any;
6
8
  service(uid: string): Result<any, any>;
7
9
  interceptors(): void;
8
- notification(): void;
10
+ useNotificationMiddleware(): void;
9
11
  silent(): this;
10
12
  }
@@ -14,15 +14,15 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
14
14
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15
15
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
16
  import { APIClient as APIClientSDK } from '@nocobase/sdk';
17
- import { notification as _notification } from 'antd';
17
+ import { notification } from 'antd';
18
18
  import React from 'react';
19
- var handleErrorMessage = function handleErrorMessage(error) {
19
+ var handleErrorMessage = function handleErrorMessage(error, notification) {
20
20
  var _error$response;
21
21
  var reader = new FileReader();
22
22
  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');
23
23
  reader.onload = function () {
24
24
  var _JSON$parse$errors, _JSON$parse$errors$ma;
25
- _notification.error({
25
+ notification.error({
26
26
  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) {
27
27
  return /*#__PURE__*/React.createElement('div', {
28
28
  children: error.message
@@ -44,6 +44,8 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
44
44
  _this = _super.call.apply(_super, [this].concat(args));
45
45
  _this.services = {};
46
46
  _this.silence = false;
47
+ /** 该值会在 AntdAppProvider 中被重新赋值 */
48
+ _this.notification = notification;
47
49
  return _this;
48
50
  }
49
51
  _createClass(APIClient, [{
@@ -63,11 +65,11 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
63
65
  return config;
64
66
  });
65
67
  _get(_getPrototypeOf(APIClient.prototype), "interceptors", this).call(this);
66
- this.notification();
68
+ this.useNotificationMiddleware();
67
69
  }
68
70
  }, {
69
- key: "notification",
70
- value: function notification() {
71
+ key: "useNotificationMiddleware",
72
+ value: function useNotificationMiddleware() {
71
73
  var _this2 = this;
72
74
  this.axios.interceptors.response.use(function (response) {
73
75
  return response;
@@ -81,7 +83,7 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
81
83
  return window.location.href = redirectTo;
82
84
  }
83
85
  if ((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$data.type) === 'application/json') {
84
- handleErrorMessage(error);
86
+ handleErrorMessage(error, _this2.notification);
85
87
  } else {
86
88
  var _error$response4, _error$response4$data, _errs, _errs$map;
87
89
  if (errorCache.size > 10) {
@@ -101,7 +103,7 @@ export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
101
103
  if (errs.length === 0) {
102
104
  throw error;
103
105
  }
104
- _notification.error({
106
+ _this2.notification.error({
105
107
  message: (_errs = errs) === null || _errs === void 0 ? void 0 : (_errs$map = _errs.map) === null || _errs$map === void 0 ? void 0 : _errs$map.call(_errs, function (error) {
106
108
  return /*#__PURE__*/React.createElement('div', {}, error.message);
107
109
  })
@@ -1,6 +1,7 @@
1
1
  import { Options } from 'ahooks/es/useRequest/src/types';
2
2
  import { AxiosRequestConfig } from 'axios';
3
3
  type FunctionService = (...args: any[]) => Promise<any>;
4
+ export type ReturnTypeOfUseRequest<TData = any> = ReturnType<typeof useRequest<TData>>;
4
5
  export type ResourceActionOptions<P = any> = {
5
6
  resource?: string;
6
7
  resourceOf?: any;
@@ -9,5 +10,18 @@ export type ResourceActionOptions<P = any> = {
9
10
  };
10
11
  export declare function useRequest<P>(service: AxiosRequestConfig<P> | ResourceActionOptions<P> | FunctionService, options?: Options<any, any> & {
11
12
  uid?: string;
12
- }): any;
13
+ }): {
14
+ state: {};
15
+ setState: import("ahooks/lib/useSetState").SetState<{}>;
16
+ loading: boolean;
17
+ data?: P;
18
+ error?: Error;
19
+ params: any;
20
+ cancel: () => void;
21
+ refresh: () => void;
22
+ refreshAsync: () => Promise<P>;
23
+ run: (...params: any) => void;
24
+ runAsync: (...params: any) => Promise<P>;
25
+ mutate: (data?: P | ((oldData?: P) => P)) => void;
26
+ };
13
27
  export {};
@@ -17,9 +17,8 @@ import { merge } from '@formily/shared';
17
17
  import { useSetState } from 'ahooks';
18
18
  import { default as useReq } from 'ahooks/es/useRequest';
19
19
  import cloneDeep from 'lodash/cloneDeep';
20
- import { useContext } from 'react';
21
- import { APIClientContext } from '../context';
22
20
  import { assign } from './assign';
21
+ import { useAPIClient } from './useAPIClient';
23
22
  export function useRequest(service) {
24
23
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25
24
  // 缓存用途
@@ -27,8 +26,8 @@ export function useRequest(service) {
27
26
  _useSetState2 = _slicedToArray(_useSetState, 2),
28
27
  state = _useSetState2[0],
29
28
  setState = _useSetState2[1];
30
- var api = useContext(APIClientContext);
31
- var tempOptions, tempService;
29
+ var api = useAPIClient();
30
+ var tempService;
32
31
  if (typeof service === 'function') {
33
32
  tempService = service;
34
33
  } else {
@@ -67,7 +66,7 @@ export function useRequest(service) {
67
66
  };
68
67
  }();
69
68
  }
70
- tempOptions = _objectSpread(_objectSpread({}, options), {}, {
69
+ var tempOptions = _objectSpread(_objectSpread({}, options), {}, {
71
70
  onSuccess: function onSuccess() {
72
71
  var _options$onSuccess;
73
72
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -1,6 +1,5 @@
1
- import { useContext } from 'react';
2
- import { APIClientContext } from '../context';
1
+ import { useAPIClient } from './useAPIClient';
3
2
  export function useResource(name, of) {
4
- var apiClient = useContext(APIClientContext);
3
+ var apiClient = useAPIClient();
5
4
  return apiClient.resource(name, of);
6
5
  }
@@ -31,15 +31,16 @@ export function useAppPluginLoad(app) {
31
31
  _context.next = 3;
32
32
  return app.load();
33
33
  case 3:
34
- _context.next = 8;
34
+ _context.next = 9;
35
35
  break;
36
36
  case 5:
37
37
  _context.prev = 5;
38
38
  _context.t0 = _context["catch"](0);
39
+ console.error(_context.t0);
39
40
  setError(_context.t0);
40
- case 8:
41
- setLoading(false);
42
41
  case 9:
42
+ setLoading(false);
43
+ case 10:
43
44
  case "end":
44
45
  return _context.stop();
45
46
  }
@@ -15,12 +15,12 @@ export var AsyncDataProvider = function AsyncDataProvider(props) {
15
15
  request = props.request,
16
16
  children = props.children,
17
17
  others = _objectWithoutProperties(props, _excluded);
18
+ var result = useRequest(request, _objectSpread({}, others));
18
19
  if (value) {
19
20
  return /*#__PURE__*/React.createElement(AsyncDataContext.Provider, {
20
21
  value: value
21
22
  }, children);
22
23
  }
23
- var result = useRequest(request, _objectSpread({}, others));
24
24
  return /*#__PURE__*/React.createElement(AsyncDataContext.Provider, {
25
25
  value: result
26
26
  }, children);
@@ -21,7 +21,7 @@ import { Space, Tabs } from 'antd';
21
21
  import React, { createContext, createElement, useCallback, useContext, useState } from 'react';
22
22
  import { useTranslation } from 'react-i18next';
23
23
  import { useNavigate, useSearchParams } from 'react-router-dom';
24
- import { useAPIClient, useCurrentDocumentTitle, useRequest, useViewport } from '..';
24
+ import { useAPIClient, useCurrentDocumentTitle, useCurrentUserContext, useRequest, useViewport } from '..';
25
25
  import { useSigninPageExtension } from './SigninPageExtension';
26
26
  var SigninPageContext = /*#__PURE__*/createContext({});
27
27
  export var SigninPageProvider = function SigninPageProvider(props) {
@@ -51,6 +51,8 @@ export var useSignIn = function useSignIn(authenticator) {
51
51
  var form = useForm();
52
52
  var api = useAPIClient();
53
53
  var redirect = useRedirect();
54
+ var _useCurrentUserContex = useCurrentUserContext(),
55
+ refreshAsync = _useCurrentUserContex.refreshAsync;
54
56
  return {
55
57
  run: function run() {
56
58
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
@@ -63,8 +65,11 @@ export var useSignIn = function useSignIn(authenticator) {
63
65
  _context.next = 4;
64
66
  return api.auth.signIn(form.values, authenticator);
65
67
  case 4:
68
+ _context.next = 6;
69
+ return refreshAsync();
70
+ case 6:
66
71
  redirect();
67
- case 5:
72
+ case 7:
68
73
  case "end":
69
74
  return _context.stop();
70
75
  }
@@ -132,7 +137,7 @@ export var SigninPage = function SigninPage() {
132
137
  }, tabs.length > 1 ? /*#__PURE__*/React.createElement(Tabs, {
133
138
  items: tabs.map(function (tab) {
134
139
  return {
135
- label: tab.tabTitle,
140
+ label: t(tab.tabTitle),
136
141
  key: tab.name,
137
142
  children: tab.component
138
143
  };
@@ -6,8 +6,8 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
7
  import { createForm } from '@formily/core';
8
8
  import { RecursionField, useField, useFieldSchema } from '@formily/react';
9
- import { isEmpty } from 'lodash';
10
9
  import { Spin } from 'antd';
10
+ import { isEmpty } from 'lodash';
11
11
  import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react';
12
12
  import { useCollection } from '../collection-manager';
13
13
  import { RecordProvider, useRecord } from '../record-provider';
@@ -84,8 +84,15 @@ export var FormBlockProvider = function FormBlockProvider(props) {
84
84
  }
85
85
  var createFlag = currentCollection.name === ((collection === null || collection === void 0 ? void 0 : collection.name) || collection) && !isEmptyRecord || !currentCollection.name;
86
86
  return (detailFlag || createFlag) && /*#__PURE__*/React.createElement(BlockProvider, _objectSpread(_objectSpread({}, props), {}, {
87
- block: 'form'
88
- }), /*#__PURE__*/React.createElement(InternalFormBlockProvider, _objectSpread({}, props)));
87
+ block: 'form',
88
+ params: _objectSpread(_objectSpread({}, props === null || props === void 0 ? void 0 : props.params), {}, {
89
+ targetCollection: collection
90
+ })
91
+ }), /*#__PURE__*/React.createElement(InternalFormBlockProvider, _objectSpread(_objectSpread({}, props), {}, {
92
+ params: _objectSpread(_objectSpread({}, props === null || props === void 0 ? void 0 : props.params), {}, {
93
+ targetCollection: collection
94
+ })
95
+ })));
89
96
  };
90
97
  export var useFormBlockContext = function useFormBlockContext() {
91
98
  return useContext(FormBlockContext);
@@ -104,7 +104,8 @@ export var useGanttBlockProps = function useGanttBlockProps() {
104
104
  var _useCollection = useCollection(),
105
105
  getPrimaryKey = _useCollection.getPrimaryKey,
106
106
  name = _useCollection.name,
107
- template = _useCollection.template;
107
+ template = _useCollection.template,
108
+ writableView = _useCollection.writableView;
108
109
  var _useACLRoleContext = useACLRoleContext(),
109
110
  parseAction = _useACLRoleContext.parseAction;
110
111
  var primaryKey = getPrimaryKey();
@@ -116,7 +117,7 @@ export var useGanttBlockProps = function useGanttBlockProps() {
116
117
  schema: schema,
117
118
  recordPkValue: recordPkValue
118
119
  });
119
- return template === 'view' || !params;
120
+ return template === 'view' && !writableView || !params;
120
121
  };
121
122
  var onExpanderClick = function onExpanderClick(task) {
122
123
  var data = ctx.field.data;
@@ -23,7 +23,6 @@ import { FormContext, useField, useFieldSchema } from '@formily/react';
23
23
  import React, { createContext, useContext, useEffect, useMemo, useState } from 'react';
24
24
  import { useCollectionManager } from '../collection-manager';
25
25
  import { useFilterBlock } from '../filter-provider/FilterProvider';
26
- import { useRecord } from '../record-provider';
27
26
  import { FixedBlockWrapper, removeNullCondition, SchemaComponentOptions } from '../schema-component';
28
27
  import { BlockProvider, RenderChildrenWithAssociationFilter, useBlockRequestContext } from './BlockProvider';
29
28
  import { findFilterTargets } from './hooks';
@@ -93,59 +92,9 @@ var InternalTableBlockProvider = function InternalTableBlockProvider(props) {
93
92
  }
94
93
  }, /*#__PURE__*/React.createElement(RenderChildrenWithAssociationFilter, _objectSpread({}, props))));
95
94
  };
96
- // export const useAssociationNames = (collection) => {
97
- // const { getCollectionFields } = useCollectionManager();
98
- // const collectionFields = getCollectionFields(collection);
99
- // const associationFields = new Set();
100
- // for (const collectionField of collectionFields) {
101
- // if (collectionField.target) {
102
- // associationFields.add(collectionField.name);
103
- // const fields = getCollectionFields(collectionField.target);
104
- // for (const field of fields) {
105
- // if (field.target) {
106
- // associationFields.add(`${collectionField.name}.${field.name}`);
107
- // }
108
- // }
109
- // }
110
- // }
111
- // const fieldSchema = useFieldSchema();
112
- // const tableSchema = fieldSchema.reduceProperties((buf, schema) => {
113
- // if (schema['x-component'] === 'TableV2') {
114
- // return schema;
115
- // }
116
- // if (schema['x-component'] === 'Gantt') {
117
- // return schema.properties?.table;
118
- // }
119
- // return buf;
120
- // }, new Schema({}));
121
- // return uniq(
122
- // tableSchema.reduceProperties((buf, schema) => {
123
- // if (schema['x-component'] === 'TableV2.Column') {
124
- // const s = schema.reduceProperties((buf, s) => {
125
- // const [name] = (s.name as string).split('.');
126
- // if (s['x-collection-field'] && associationFields.has(name)) {
127
- // return s;
128
- // }
129
- // return buf;
130
- // }, null);
131
- // if (s) {
132
- // // 关联字段和关联的关联字段
133
- // const [firstName] = s.name.split('.');
134
- // if (associationFields.has(s.name)) {
135
- // buf.push(s.name);
136
- // } else if (associationFields.has(firstName)) {
137
- // buf.push(firstName);
138
- // }
139
- // }
140
- // }
141
- // return buf;
142
- // }, []),
143
- // );
144
- // };
145
95
  export var TableBlockProvider = function TableBlockProvider(props) {
146
96
  var resourceName = props.resource;
147
97
  var params = _objectSpread({}, props.params);
148
- var record = useRecord();
149
98
  var fieldSchema = useFieldSchema();
150
99
  var _useCollectionManager = useCollectionManager(),
151
100
  getCollection = _useCollectionManager.getCollection,
@@ -206,6 +155,7 @@ export var useTableBlockProps = function useTableBlockProps() {
206
155
  var _ctx$service;
207
156
  if (!(ctx !== null && ctx !== void 0 && (_ctx$service = ctx.service) !== null && _ctx$service !== void 0 && _ctx$service.loading)) {
208
157
  var _ctx$service2, _ctx$service2$data, _ctx$field, _ctx$field$data, _ctx$service3, _ctx$service3$data, _ctx$service3$data$me, _ctx$service4, _ctx$service4$data, _ctx$service4$data$me, _ctx$service5, _ctx$service5$data, _ctx$service5$data$me;
158
+ field.value = [];
209
159
  field.value = ctx === null || ctx === void 0 ? void 0 : (_ctx$service2 = ctx.service) === null || _ctx$service2 === void 0 ? void 0 : (_ctx$service2$data = _ctx$service2.data) === null || _ctx$service2$data === void 0 ? void 0 : _ctx$service2$data.data;
210
160
  field.data = field.data || {};
211
161
  field.data.selectedRowKeys = ctx === null || ctx === void 0 ? void 0 : (_ctx$field = ctx.field) === null || _ctx$field === void 0 ? void 0 : (_ctx$field$data = _ctx$field.data) === null || _ctx$field$data === void 0 ? void 0 : _ctx$field$data.selectedRowKeys;
@@ -69,11 +69,13 @@ export declare const useDetailsPaginationProps: () => {
69
69
  };
70
70
  export declare const useAssociationFilterProps: () => {
71
71
  /** 渲染 Collapse 的列表数据 */
72
- list: any;
72
+ list: {
73
+ [key: string]: any;
74
+ }[];
73
75
  onSelected: (value: any) => void;
74
76
  handleSearchInput: (e: ChangeEvent<any>) => void;
75
77
  params: any;
76
- run: any;
78
+ run: (...params: any) => void;
77
79
  };
78
80
  export declare const useOptionalFieldList: () => import("../..").FieldOptions[];
79
81
  export declare const useAssociationFilterBlockProps: () => {
@@ -88,7 +90,7 @@ export declare const useAssociationFilterBlockProps: () => {
88
90
  } | {
89
91
  /** 渲染 Collapse 的列表数据 */
90
92
  list: any;
91
- onSelected: any;
93
+ onSelected: (value: any) => void;
92
94
  handleSearchInput: any;
93
95
  params: any;
94
96
  run: any;