@nocobase/client 0.9.0-alpha.2 → 0.9.1-alpha.2

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 (327) hide show
  1. package/es/acl/ACLProvider.js +7 -8
  2. package/es/api-client/APIClient.js +6 -0
  3. package/es/block-provider/BlockProvider.js +9 -6
  4. package/es/block-provider/FormBlockProvider.js +18 -9
  5. package/es/block-provider/KanbanBlockProvider.js +1 -1
  6. package/es/block-provider/SharedFilterProvider.js +9 -1
  7. package/es/block-provider/TableBlockProvider.js +1 -1
  8. package/es/block-provider/TableSelectorProvider.js +2 -2
  9. package/es/block-provider/hooks/index.js +22 -7
  10. package/es/collection-manager/CollectionManagerProvider.d.ts +1 -0
  11. package/es/collection-manager/CollectionManagerProvider.js +71 -9
  12. package/es/collection-manager/CollectionManagerShortcut.js +36 -23
  13. package/es/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  14. package/es/collection-manager/Configuration/AddCategoryAction.js +117 -0
  15. package/es/collection-manager/Configuration/AddCollectionAction.js +8 -3
  16. package/es/collection-manager/Configuration/AddFieldAction.js +1 -0
  17. package/es/collection-manager/Configuration/ConfigurationTable.js +33 -4
  18. package/es/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  19. package/es/collection-manager/Configuration/ConfigurationTabs.js +381 -0
  20. package/es/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  21. package/es/collection-manager/Configuration/EditCategoryAction.js +150 -0
  22. package/es/collection-manager/Configuration/EditCollectionAction.js +6 -2
  23. package/es/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  24. package/es/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  25. package/es/collection-manager/Configuration/components/CollectionCategory.js +13 -0
  26. package/es/collection-manager/Configuration/index.d.ts +3 -0
  27. package/es/collection-manager/Configuration/index.js +3 -0
  28. package/es/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  29. package/es/collection-manager/Configuration/schemas/collections.js +309 -176
  30. package/es/collection-manager/Configuration/templates.d.ts +1 -0
  31. package/es/collection-manager/Configuration/templates.js +1 -1
  32. package/es/collection-manager/action-hooks.d.ts +4 -0
  33. package/es/collection-manager/action-hooks.js +26 -12
  34. package/es/collection-manager/context.d.ts +4 -0
  35. package/es/collection-manager/context.js +5 -1
  36. package/es/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  37. package/es/collection-manager/hooks/useCollectionManager.js +52 -7
  38. package/es/collection-manager/interfaces/m2m.js +2 -2
  39. package/es/collection-manager/interfaces/properties/index.d.ts +0 -56
  40. package/es/collection-manager/interfaces/properties/index.js +1 -2
  41. package/es/collection-manager/templates/calendar.js +1 -1
  42. package/es/collection-manager/templates/general.js +1 -1
  43. package/es/collection-manager/templates/properties/index.d.ts +12 -1
  44. package/es/collection-manager/templates/properties/index.js +11 -0
  45. package/es/i18n/i18n.js +3 -1
  46. package/es/locale/en_US.d.ts +23 -0
  47. package/es/locale/en_US.js +23 -0
  48. package/es/locale/ja_JP.d.ts +23 -0
  49. package/es/locale/ja_JP.js +24 -1
  50. package/es/locale/ru_RU.d.ts +1 -0
  51. package/es/locale/ru_RU.js +1 -0
  52. package/es/locale/zh_CN.d.ts +43 -4
  53. package/es/locale/zh_CN.js +44 -5
  54. package/es/route-switch/antd/admin-layout/index.js +13 -33
  55. package/es/schema-component/antd/action/Action.Designer.js +28 -15
  56. package/es/schema-component/antd/action/Action.js +28 -5
  57. package/es/schema-component/antd/action/utils.d.ts +1 -0
  58. package/es/schema-component/antd/action/utils.js +49 -0
  59. package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -4
  60. package/es/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  61. package/es/schema-component/antd/association-select/useServiceOptions.js +47 -6
  62. package/es/schema-component/antd/calendar/Calendar.Designer.js +17 -36
  63. package/es/schema-component/antd/checkbox/Checkbox.js +9 -8
  64. package/es/schema-component/antd/date-picker/util.d.ts +1 -1
  65. package/es/schema-component/antd/date-picker/util.js +1 -1
  66. package/es/schema-component/antd/filter/DynamicComponent.js +3 -1
  67. package/es/schema-component/antd/filter/Filter.js +2 -1
  68. package/es/schema-component/antd/filter/FilterGroup.js +7 -4
  69. package/es/schema-component/antd/filter/FilterItem.js +3 -2
  70. package/es/schema-component/antd/filter/context.d.ts +1 -0
  71. package/es/schema-component/antd/filter/useValues.js +14 -11
  72. package/es/schema-component/antd/form/Form.js +11 -5
  73. package/es/schema-component/antd/form-item/FormItem.js +17 -8
  74. package/es/schema-component/antd/form-v2/Form.Designer.js +2 -0
  75. package/es/schema-component/antd/form-v2/Form.js +94 -7
  76. package/es/schema-component/antd/form-v2/utils.d.ts +5 -0
  77. package/es/schema-component/antd/form-v2/utils.js +161 -0
  78. package/es/schema-component/antd/g2plot/G2Plot.js +3 -1
  79. package/es/schema-component/antd/grid/Grid.js +10 -5
  80. package/es/schema-component/antd/icon-picker/IconPicker.js +1 -0
  81. package/es/schema-component/antd/index.d.ts +1 -0
  82. package/es/schema-component/antd/index.js +1 -0
  83. package/es/schema-component/antd/input/Input.d.ts +2 -1
  84. package/es/schema-component/antd/input/Json.d.ts +5 -3
  85. package/es/schema-component/antd/input/Json.js +3 -2
  86. package/es/schema-component/antd/input/ReadPretty.js +1 -1
  87. package/es/schema-component/antd/input-number/InputNumber.js +3 -1
  88. package/es/schema-component/antd/page/FixedBlock.js +3 -1
  89. package/es/schema-component/antd/page/Page.js +11 -5
  90. package/es/schema-component/antd/page/PageTabDesigner.js +3 -3
  91. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  92. package/es/schema-component/antd/record-picker/RecordPicker.js +1 -2
  93. package/es/schema-component/antd/record-picker/util.js +7 -0
  94. package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  95. package/es/schema-component/antd/remote-select/RemoteSelect.js +78 -36
  96. package/es/schema-component/antd/rich-text/RichText.js +4 -2
  97. package/es/schema-component/antd/select/Select.js +14 -4
  98. package/es/schema-component/antd/table/Table.Array.js +10 -3
  99. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  100. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  101. package/es/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  102. package/es/schema-component/antd/tabs/Tabs.js +1 -0
  103. package/es/schema-component/antd/time-picker/TimePicker.js +1 -1
  104. package/es/schema-component/antd/variable/Input.d.ts +2 -0
  105. package/es/schema-component/antd/variable/Input.js +244 -0
  106. package/es/schema-component/antd/variable/JSONInput.d.ts +2 -0
  107. package/es/schema-component/antd/variable/JSONInput.js +82 -0
  108. package/es/schema-component/antd/variable/TextArea.d.ts +2 -0
  109. package/es/schema-component/antd/variable/TextArea.js +322 -0
  110. package/es/schema-component/antd/variable/Variable.d.ts +8 -0
  111. package/es/schema-component/antd/variable/Variable.js +11 -0
  112. package/es/schema-component/antd/variable/index.d.ts +1 -0
  113. package/es/schema-component/antd/variable/index.js +1 -0
  114. package/es/schema-component/common/sortable-item/SortableItem.js +36 -6
  115. package/es/schema-component/common/utils/logic.js +523 -0
  116. package/es/schema-component/common/utils/uitls.d.ts +1 -0
  117. package/es/schema-component/common/utils/uitls.js +89 -0
  118. package/es/schema-initializer/SchemaInitializer.js +9 -4
  119. package/es/schema-initializer/buttons/BlockInitializers.d.ts +2 -184
  120. package/es/schema-initializer/buttons/BlockInitializers.js +1 -102
  121. package/es/schema-initializer/buttons/RecordBlockInitializers.js +72 -16
  122. package/es/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  123. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -3
  124. package/es/schema-initializer/components/CreateRecordAction.d.ts +3 -0
  125. package/es/schema-initializer/components/CreateRecordAction.js +174 -0
  126. package/es/schema-initializer/components/index.d.ts +1 -0
  127. package/es/schema-initializer/components/index.js +2 -1
  128. package/es/schema-initializer/index.d.ts +2 -1
  129. package/es/schema-initializer/index.js +2 -1
  130. package/es/schema-initializer/items/CalendarBlockInitializer.js +24 -41
  131. package/es/schema-initializer/items/CreateActionInitializer.js +3 -3
  132. package/es/schema-initializer/items/RecordFormBlockInitializer.js +9 -9
  133. package/es/schema-initializer/items/index.d.ts +4 -4
  134. package/es/schema-initializer/items/index.js +6 -6
  135. package/es/schema-initializer/utils.js +22 -7
  136. package/es/schema-settings/EnableChildCollections/index.d.ts +2 -0
  137. package/es/schema-settings/EnableChildCollections/index.js +141 -0
  138. package/es/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  139. package/es/schema-settings/LinkageRules/DynamicComponent.js +113 -0
  140. package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  141. package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +15 -0
  142. package/es/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  143. package/es/schema-settings/LinkageRules/LinkageRuleAction.js +162 -0
  144. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  145. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.js +71 -0
  146. package/es/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  147. package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +82 -0
  148. package/es/schema-settings/LinkageRules/Variables.d.ts +7 -0
  149. package/es/schema-settings/LinkageRules/Variables.js +115 -0
  150. package/es/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  151. package/es/schema-settings/LinkageRules/action-hooks.js +115 -0
  152. package/es/schema-settings/LinkageRules/context.d.ts +13 -0
  153. package/es/schema-settings/LinkageRules/context.js +4 -0
  154. package/es/schema-settings/LinkageRules/index.d.ts +2 -0
  155. package/es/schema-settings/LinkageRules/index.js +132 -0
  156. package/es/schema-settings/LinkageRules/type.d.ts +13 -0
  157. package/es/schema-settings/LinkageRules/type.js +15 -0
  158. package/es/schema-settings/LinkageRules/useValues.d.ts +1 -0
  159. package/es/schema-settings/LinkageRules/useValues.js +84 -0
  160. package/es/schema-settings/SchemaSettings.d.ts +4 -1
  161. package/es/schema-settings/SchemaSettings.js +219 -26
  162. package/es/schema-templates/BlockTemplate.js +9 -1
  163. package/es/system-settings/SystemSettingsShortcut.js +1 -1
  164. package/lib/acl/ACLProvider.js +7 -8
  165. package/lib/api-client/APIClient.js +6 -0
  166. package/lib/block-provider/BlockProvider.js +9 -6
  167. package/lib/block-provider/FormBlockProvider.js +17 -8
  168. package/lib/block-provider/KanbanBlockProvider.js +1 -1
  169. package/lib/block-provider/SharedFilterProvider.js +9 -3
  170. package/lib/block-provider/TableBlockProvider.js +1 -1
  171. package/lib/block-provider/TableSelectorProvider.js +2 -2
  172. package/lib/block-provider/hooks/index.js +23 -7
  173. package/lib/collection-manager/CollectionManagerProvider.d.ts +1 -0
  174. package/lib/collection-manager/CollectionManagerProvider.js +81 -16
  175. package/lib/collection-manager/CollectionManagerShortcut.js +36 -23
  176. package/lib/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  177. package/lib/collection-manager/Configuration/AddCategoryAction.js +145 -0
  178. package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -3
  179. package/lib/collection-manager/Configuration/AddFieldAction.js +1 -0
  180. package/lib/collection-manager/Configuration/ConfigurationTable.js +34 -4
  181. package/lib/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  182. package/lib/collection-manager/Configuration/ConfigurationTabs.js +407 -0
  183. package/lib/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  184. package/lib/collection-manager/Configuration/EditCategoryAction.js +178 -0
  185. package/lib/collection-manager/Configuration/EditCollectionAction.js +6 -2
  186. package/lib/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  187. package/lib/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  188. package/lib/collection-manager/Configuration/components/CollectionCategory.js +27 -0
  189. package/lib/collection-manager/Configuration/index.d.ts +3 -0
  190. package/lib/collection-manager/Configuration/index.js +39 -0
  191. package/lib/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  192. package/lib/collection-manager/Configuration/schemas/collections.js +316 -178
  193. package/lib/collection-manager/Configuration/templates.d.ts +1 -0
  194. package/lib/collection-manager/Configuration/templates.js +2 -0
  195. package/lib/collection-manager/action-hooks.d.ts +4 -0
  196. package/lib/collection-manager/action-hooks.js +30 -13
  197. package/lib/collection-manager/context.d.ts +4 -0
  198. package/lib/collection-manager/context.js +7 -2
  199. package/lib/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  200. package/lib/collection-manager/hooks/useCollectionManager.js +52 -6
  201. package/lib/collection-manager/interfaces/m2m.js +2 -2
  202. package/lib/collection-manager/interfaces/properties/index.d.ts +0 -56
  203. package/lib/collection-manager/interfaces/properties/index.js +1 -2
  204. package/lib/collection-manager/templates/calendar.js +1 -1
  205. package/lib/collection-manager/templates/general.js +1 -1
  206. package/lib/collection-manager/templates/properties/index.d.ts +12 -1
  207. package/lib/collection-manager/templates/properties/index.js +11 -0
  208. package/lib/i18n/i18n.js +3 -1
  209. package/lib/locale/en_US.d.ts +23 -0
  210. package/lib/locale/en_US.js +23 -0
  211. package/lib/locale/ja_JP.d.ts +23 -0
  212. package/lib/locale/ja_JP.js +24 -1
  213. package/lib/locale/ru_RU.d.ts +1 -0
  214. package/lib/locale/ru_RU.js +1 -0
  215. package/lib/locale/zh_CN.d.ts +43 -4
  216. package/lib/locale/zh_CN.js +44 -5
  217. package/lib/route-switch/antd/admin-layout/index.js +13 -33
  218. package/lib/schema-component/antd/action/Action.Designer.js +30 -14
  219. package/lib/schema-component/antd/action/Action.js +29 -3
  220. package/lib/schema-component/antd/action/utils.d.ts +1 -0
  221. package/lib/schema-component/antd/action/utils.js +58 -2
  222. package/lib/schema-component/antd/association-filter/AssociationFilter.js +3 -3
  223. package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  224. package/lib/schema-component/antd/association-select/useServiceOptions.js +47 -4
  225. package/lib/schema-component/antd/calendar/Calendar.Designer.js +15 -33
  226. package/lib/schema-component/antd/checkbox/Checkbox.js +8 -7
  227. package/lib/schema-component/antd/date-picker/util.d.ts +1 -1
  228. package/lib/schema-component/antd/date-picker/util.js +1 -1
  229. package/lib/schema-component/antd/filter/DynamicComponent.js +3 -1
  230. package/lib/schema-component/antd/filter/Filter.js +2 -1
  231. package/lib/schema-component/antd/filter/FilterGroup.js +7 -4
  232. package/lib/schema-component/antd/filter/FilterItem.js +3 -2
  233. package/lib/schema-component/antd/filter/context.d.ts +1 -0
  234. package/lib/schema-component/antd/filter/useValues.js +15 -11
  235. package/lib/schema-component/antd/form/Form.js +9 -3
  236. package/lib/schema-component/antd/form-item/FormItem.js +21 -7
  237. package/lib/schema-component/antd/form-v2/Form.Designer.js +2 -0
  238. package/lib/schema-component/antd/form-v2/Form.js +93 -5
  239. package/lib/schema-component/antd/form-v2/utils.d.ts +5 -0
  240. package/lib/schema-component/antd/form-v2/utils.js +181 -0
  241. package/lib/schema-component/antd/g2plot/G2Plot.js +3 -1
  242. package/lib/schema-component/antd/grid/Grid.js +10 -5
  243. package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -0
  244. package/lib/schema-component/antd/index.d.ts +1 -0
  245. package/lib/schema-component/antd/index.js +13 -0
  246. package/lib/schema-component/antd/input/Input.d.ts +2 -1
  247. package/lib/schema-component/antd/input/Json.d.ts +5 -3
  248. package/lib/schema-component/antd/input/Json.js +6 -3
  249. package/lib/schema-component/antd/input/ReadPretty.js +1 -1
  250. package/lib/schema-component/antd/input-number/InputNumber.js +2 -0
  251. package/lib/schema-component/antd/page/FixedBlock.js +3 -1
  252. package/lib/schema-component/antd/page/Page.js +14 -5
  253. package/lib/schema-component/antd/page/PageTabDesigner.js +1 -1
  254. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  255. package/lib/schema-component/antd/record-picker/RecordPicker.js +1 -2
  256. package/lib/schema-component/antd/record-picker/util.js +7 -0
  257. package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  258. package/lib/schema-component/antd/remote-select/RemoteSelect.js +78 -37
  259. package/lib/schema-component/antd/rich-text/RichText.js +4 -2
  260. package/lib/schema-component/antd/select/Select.js +14 -4
  261. package/lib/schema-component/antd/table/Table.Array.js +8 -1
  262. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  263. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  264. package/lib/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  265. package/lib/schema-component/antd/tabs/Tabs.js +1 -0
  266. package/lib/schema-component/antd/time-picker/TimePicker.js +1 -1
  267. package/lib/schema-component/antd/variable/Input.d.ts +2 -0
  268. package/lib/schema-component/antd/variable/Input.js +262 -0
  269. package/lib/schema-component/antd/variable/JSONInput.d.ts +2 -0
  270. package/lib/schema-component/antd/variable/JSONInput.js +100 -0
  271. package/lib/schema-component/antd/variable/TextArea.d.ts +2 -0
  272. package/lib/schema-component/antd/variable/TextArea.js +341 -0
  273. package/lib/schema-component/antd/variable/Variable.d.ts +8 -0
  274. package/lib/schema-component/antd/variable/Variable.js +25 -0
  275. package/lib/schema-component/antd/variable/index.d.ts +1 -0
  276. package/lib/schema-component/antd/variable/index.js +18 -0
  277. package/lib/schema-component/common/sortable-item/SortableItem.js +36 -6
  278. package/lib/schema-component/common/utils/logic.js +525 -0
  279. package/lib/schema-component/common/utils/uitls.d.ts +1 -0
  280. package/lib/schema-component/common/utils/uitls.js +103 -0
  281. package/lib/schema-initializer/SchemaInitializer.js +9 -4
  282. package/lib/schema-initializer/buttons/BlockInitializers.d.ts +2 -184
  283. package/lib/schema-initializer/buttons/BlockInitializers.js +0 -108
  284. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +72 -16
  285. package/lib/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  286. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +3 -1
  287. package/lib/schema-initializer/components/CreateRecordAction.d.ts +3 -0
  288. package/lib/schema-initializer/components/CreateRecordAction.js +199 -0
  289. package/lib/schema-initializer/components/index.d.ts +1 -0
  290. package/lib/schema-initializer/components/index.js +13 -0
  291. package/lib/schema-initializer/index.d.ts +2 -1
  292. package/lib/schema-initializer/index.js +51 -2
  293. package/lib/schema-initializer/items/CalendarBlockInitializer.js +16 -33
  294. package/lib/schema-initializer/items/CreateActionInitializer.js +3 -3
  295. package/lib/schema-initializer/items/RecordFormBlockInitializer.js +3 -3
  296. package/lib/schema-initializer/items/index.d.ts +4 -4
  297. package/lib/schema-initializer/items/index.js +52 -52
  298. package/lib/schema-initializer/utils.js +22 -6
  299. package/lib/schema-settings/EnableChildCollections/index.d.ts +2 -0
  300. package/lib/schema-settings/EnableChildCollections/index.js +156 -0
  301. package/lib/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  302. package/lib/schema-settings/LinkageRules/DynamicComponent.js +139 -0
  303. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  304. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +27 -0
  305. package/lib/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  306. package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +190 -0
  307. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  308. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.js +90 -0
  309. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  310. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +104 -0
  311. package/lib/schema-settings/LinkageRules/Variables.d.ts +7 -0
  312. package/lib/schema-settings/LinkageRules/Variables.js +124 -0
  313. package/lib/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  314. package/lib/schema-settings/LinkageRules/action-hooks.js +127 -0
  315. package/lib/schema-settings/LinkageRules/context.d.ts +13 -0
  316. package/lib/schema-settings/LinkageRules/context.js +15 -0
  317. package/lib/schema-settings/LinkageRules/index.d.ts +2 -0
  318. package/lib/schema-settings/LinkageRules/index.js +149 -0
  319. package/lib/schema-settings/LinkageRules/type.d.ts +13 -0
  320. package/lib/schema-settings/LinkageRules/type.js +22 -0
  321. package/lib/schema-settings/LinkageRules/useValues.d.ts +1 -0
  322. package/lib/schema-settings/LinkageRules/useValues.js +95 -0
  323. package/lib/schema-settings/SchemaSettings.d.ts +4 -1
  324. package/lib/schema-settings/SchemaSettings.js +243 -48
  325. package/lib/schema-templates/BlockTemplate.js +9 -1
  326. package/lib/system-settings/SystemSettingsShortcut.js +1 -1
  327. package/package.json +4 -4
@@ -173,14 +173,13 @@ var getIsOverriding = function getIsOverriding(currentFields, record) {
173
173
  };
174
174
 
175
175
  export var OverridingFieldAction = function OverridingFieldAction(props) {
176
- var _getChildrenCollectio;
177
-
178
176
  var scope = props.scope,
179
177
  getContainer = props.getContainer,
180
178
  record = props.item,
181
179
  children = props.children,
182
180
  currentCollection = props.currentCollection;
183
- var target = record.target;
181
+ var target = record.target,
182
+ through = record.through;
184
183
 
185
184
  var _useCollectionManager2 = useCollectionManager(),
186
185
  getInterface = _useCollectionManager2.getInterface,
@@ -203,9 +202,15 @@ export var OverridingFieldAction = function OverridingFieldAction(props) {
203
202
  t = _useTranslation.t;
204
203
 
205
204
  var compile = useCompile();
206
- var childCollections = target && ((_getChildrenCollectio = getChildrenCollections(target)) === null || _getChildrenCollectio === void 0 ? void 0 : _getChildrenCollectio.map(function (v) {
207
- return v.name;
208
- }).concat([target]));
205
+
206
+ var getFilterCollections = function getFilterCollections(filterKey) {
207
+ var _getChildrenCollectio;
208
+
209
+ var childCollections = filterKey && ((_getChildrenCollectio = getChildrenCollections(filterKey)) === null || _getChildrenCollectio === void 0 ? void 0 : _getChildrenCollectio.map(function (v) {
210
+ return v.name;
211
+ }).concat([filterKey]));
212
+ return childCollections;
213
+ };
209
214
 
210
215
  var _useState5 = useState({}),
211
216
  _useState6 = _slicedToArray(_useState5, 2),
@@ -215,7 +220,9 @@ export var OverridingFieldAction = function OverridingFieldAction(props) {
215
220
  var currentFields = getCurrentCollectionFields(currentCollection);
216
221
  var disabled = getIsOverriding(currentFields, record);
217
222
  return /*#__PURE__*/React.createElement(RecordProvider, {
218
- record: record
223
+ record: _objectSpread(_objectSpread({}, record), {}, {
224
+ collectionName: record.__parent.name
225
+ })
219
226
  }, /*#__PURE__*/React.createElement(ActionContext.Provider, {
220
227
  value: {
221
228
  visible: visible,
@@ -288,9 +295,11 @@ export var OverridingFieldAction = function OverridingFieldAction(props) {
288
295
  useCancelAction: useCancelAction,
289
296
  showReverseFieldConfig: !(data === null || data === void 0 ? void 0 : data.reverseField),
290
297
  createOnly: true,
298
+ override: true,
291
299
  isOverride: true,
292
300
  targetScope: {
293
- name: childCollections
301
+ target: getFilterCollections(target),
302
+ through: getFilterCollections(through)
294
303
  }
295
304
  }, scope)
296
305
  })));
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const CollectionCategory: React.MemoExoticComponent<React.FunctionComponent<Pick<any, string | number | symbol>>>;
@@ -0,0 +1,13 @@
1
+ import { observer } from '@formily/react';
2
+ import { Tag } from 'antd';
3
+ import React from 'react';
4
+ import { useCompile } from '../../../schema-component';
5
+ export var CollectionCategory = observer(function (props) {
6
+ var value = props.value;
7
+ var compile = useCompile();
8
+ return /*#__PURE__*/React.createElement(React.Fragment, null, value.map(function (item) {
9
+ return /*#__PURE__*/React.createElement(Tag, {
10
+ color: item.color
11
+ }, compile(item === null || item === void 0 ? void 0 : item.name));
12
+ }));
13
+ });
@@ -9,3 +9,6 @@ export * from './OverridingCollectionField';
9
9
  export * from './ViewInheritedField';
10
10
  export * from './AddCollectionAction';
11
11
  export * from './EditCollectionAction';
12
+ export * from './ConfigurationTabs';
13
+ export * from './AddCategoryAction';
14
+ export * from './EditCategoryAction';
@@ -10,6 +10,9 @@ export * from './OverridingCollectionField';
10
10
  export * from './ViewInheritedField';
11
11
  export * from './AddCollectionAction';
12
12
  export * from './EditCollectionAction';
13
+ export * from './ConfigurationTabs';
14
+ export * from './AddCategoryAction';
15
+ export * from './EditCategoryAction';
13
16
  registerValidateFormats({
14
17
  uid: /^[A-Za-z0-9][A-Za-z0-9_-]*$/
15
18
  });
@@ -2,3 +2,6 @@ import { ISchema } from '@formily/react';
2
2
  import { CollectionOptions } from '../../types';
3
3
  export declare const collection: CollectionOptions;
4
4
  export declare const collectionSchema: ISchema;
5
+ export declare const collectionTableSchema: ISchema;
6
+ export declare const collectionCategorySchema: ISchema;
7
+ export declare const collectionCategoryEditSchema: ISchema;
@@ -1,13 +1,19 @@
1
+ var _properties;
2
+
3
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+
1
5
  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); } }
2
6
 
3
7
  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); }); }; }
4
8
 
5
9
  import { Schema } from '@formily/react';
6
10
  import { message } from 'antd';
11
+ import { uid } from '@formily/shared';
7
12
  import { useTranslation } from 'react-i18next';
8
13
  import { useAPIClient } from '../../../api-client';
9
14
  import { i18n } from '../../../i18n';
10
15
  import { CollectionTemplate } from '../components/CollectionTemplate';
16
+ import { CollectionCategory } from '../components/CollectionCategory';
11
17
  import { collectionFieldSchema } from './collectionFields';
12
18
 
13
19
  var compile = function compile(source) {
@@ -91,205 +97,332 @@ export var collectionSchema = {
91
97
  filter: {
92
98
  'hidden.$isFalsy': true
93
99
  },
94
- appends: []
100
+ appends: ['category']
95
101
  }
96
102
  }
97
103
  },
98
104
  properties: {
99
- actions: {
105
+ tabs: {
100
106
  type: 'void',
101
- 'x-component': 'ActionBar',
102
- 'x-component-props': {
103
- style: {
104
- marginBottom: 16
107
+ 'x-component': 'ConfigurationTabs'
108
+ }
109
+ }
110
+ }
111
+ }
112
+ };
113
+ export var collectionTableSchema = {
114
+ type: 'object',
115
+ properties: (_properties = {}, _defineProperty(_properties, uid(), {
116
+ type: 'void',
117
+ 'x-component': 'ActionBar',
118
+ 'x-component-props': {
119
+ style: {
120
+ marginBottom: 16
121
+ }
122
+ },
123
+ properties: {
124
+ filter: {
125
+ type: 'void',
126
+ title: '{{ t("Filter") }}',
127
+ default: {
128
+ $and: [{
129
+ title: {
130
+ $includes: ''
105
131
  }
106
- },
107
- properties: {
108
- filter: {
109
- type: 'void',
110
- title: '{{ t("Filter") }}',
111
- default: {
112
- $and: [{
113
- title: {
114
- $includes: ''
132
+ }, {
133
+ name: {
134
+ $includes: ''
135
+ }
136
+ }]
137
+ },
138
+ 'x-action': 'filter',
139
+ 'x-component': 'Filter.Action',
140
+ 'x-component-props': {
141
+ icon: 'FilterOutlined',
142
+ useProps: '{{ cm.useFilterActionProps }}'
143
+ },
144
+ 'x-align': 'left'
145
+ },
146
+ delete: {
147
+ type: 'void',
148
+ title: '{{ t("Delete") }}',
149
+ 'x-component': 'Action',
150
+ 'x-component-props': {
151
+ icon: 'DeleteOutlined',
152
+ useAction: '{{ cm.useBulkDestroyActionAndRefreshCM }}',
153
+ confirm: {
154
+ title: "{{t('Delete record')}}",
155
+ content: "{{t('Are you sure you want to delete it?')}}"
156
+ }
157
+ }
158
+ },
159
+ create: {
160
+ type: 'void',
161
+ title: '{{ t("Create collection") }}',
162
+ 'x-component': 'AddCollection',
163
+ 'x-component-props': {
164
+ type: 'primary'
165
+ }
166
+ }
167
+ }
168
+ }), _defineProperty(_properties, uid(), {
169
+ type: 'void',
170
+ 'x-uid': 'input',
171
+ 'x-component': 'Table.Void',
172
+ 'x-component-props': {
173
+ rowKey: 'name',
174
+ rowSelection: {
175
+ type: 'checkbox'
176
+ },
177
+ useDataSource: '{{ cm.useDataSourceFromRAC }}',
178
+ useAction: function useAction() {
179
+ var api = useAPIClient();
180
+
181
+ var _useTranslation = useTranslation(),
182
+ t = _useTranslation.t;
183
+
184
+ return {
185
+ move: function move(from, to) {
186
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
187
+ return regeneratorRuntime.wrap(function _callee$(_context) {
188
+ while (1) {
189
+ switch (_context.prev = _context.next) {
190
+ case 0:
191
+ _context.next = 2;
192
+ return api.resource('collections').move({
193
+ sourceId: from.key,
194
+ targetId: to.key
195
+ });
196
+
197
+ case 2:
198
+ message.success(t('Saved successfully'), 0.2);
199
+
200
+ case 3:
201
+ case "end":
202
+ return _context.stop();
115
203
  }
116
- }, {
117
- name: {
118
- $includes: ''
204
+ }
205
+ }, _callee);
206
+ }))();
207
+ }
208
+ };
209
+ }
210
+ },
211
+ properties: {
212
+ column1: {
213
+ type: 'void',
214
+ 'x-decorator': 'Table.Column.Decorator',
215
+ 'x-component': 'Table.Column',
216
+ properties: {
217
+ title: {
218
+ 'x-component': 'CollectionField',
219
+ 'x-read-pretty': true
220
+ }
221
+ }
222
+ },
223
+ column2: {
224
+ type: 'void',
225
+ 'x-decorator': 'Table.Column.Decorator',
226
+ 'x-component': 'Table.Column',
227
+ properties: {
228
+ name: {
229
+ type: 'string',
230
+ 'x-component': 'CollectionField',
231
+ 'x-read-pretty': true
232
+ }
233
+ }
234
+ },
235
+ column3: {
236
+ type: 'void',
237
+ 'x-decorator': 'Table.Column.Decorator',
238
+ 'x-component': 'Table.Column',
239
+ title: '{{t("Collection template")}}',
240
+ properties: {
241
+ template: {
242
+ 'x-component': CollectionTemplate,
243
+ 'x-read-pretty': true
244
+ }
245
+ }
246
+ },
247
+ column4: {
248
+ type: 'void',
249
+ 'x-decorator': 'Table.Column.Decorator',
250
+ 'x-component': 'Table.Column',
251
+ 'x-visible': 'categoryVisible',
252
+ title: '{{t("Collection category")}}',
253
+ properties: {
254
+ category: {
255
+ 'x-component': CollectionCategory,
256
+ 'x-read-pretty': true
257
+ }
258
+ }
259
+ },
260
+ column5: {
261
+ type: 'void',
262
+ title: '{{ t("Actions") }}',
263
+ 'x-component': 'Table.Column',
264
+ properties: {
265
+ actions: {
266
+ type: 'void',
267
+ 'x-component': 'Space',
268
+ 'x-component-props': {
269
+ split: '|'
270
+ },
271
+ properties: {
272
+ view: {
273
+ type: 'void',
274
+ title: '{{ t("Configure fields") }}',
275
+ 'x-component': 'Action.Link',
276
+ 'x-component-props': {},
277
+ properties: {
278
+ drawer: {
279
+ type: 'void',
280
+ 'x-component': 'Action.Drawer',
281
+ 'x-component-props': {
282
+ destroyOnClose: true
283
+ },
284
+ 'x-reactions': function xReactions(field) {
285
+ var i = field.path.segments[1];
286
+ var table = field.form.getValuesIn("table.".concat(i));
287
+
288
+ if (table) {
289
+ field.title = "".concat(compile(table.title), " - ").concat(compile('{{ t("Configure fields") }}'));
290
+ }
291
+ },
292
+ properties: {
293
+ collectionFieldSchema: collectionFieldSchema
294
+ }
119
295
  }
120
- }]
296
+ }
121
297
  },
122
- 'x-action': 'filter',
123
- 'x-component': 'Filter.Action',
124
- 'x-component-props': {
125
- icon: 'FilterOutlined',
126
- useProps: '{{ cm.useFilterActionProps }}'
298
+ update: {
299
+ type: 'void',
300
+ title: '{{ t("Edit") }}',
301
+ 'x-component': 'EditCollection',
302
+ 'x-component-props': {
303
+ type: 'primary'
304
+ }
127
305
  },
128
- 'x-align': 'left'
129
- },
130
- delete: {
131
- type: 'void',
132
- title: '{{ t("Delete") }}',
306
+ delete: {
307
+ type: 'void',
308
+ title: '{{ t("Delete") }}',
309
+ 'x-component': 'Action.Link',
310
+ 'x-component-props': {
311
+ confirm: {
312
+ title: "{{t('Delete record')}}",
313
+ content: "{{t('Are you sure you want to delete it?')}}"
314
+ },
315
+ useAction: '{{ cm.useDestroyActionAndRefreshCM }}'
316
+ }
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ }
323
+ }), _properties)
324
+ };
325
+ export var collectionCategorySchema = {
326
+ type: 'object',
327
+ properties: {
328
+ form: {
329
+ type: 'void',
330
+ 'x-decorator': 'Form',
331
+ 'x-component': 'Action.Modal',
332
+ title: '{{ t("Add category") }}',
333
+ 'x-component-props': {
334
+ width: 520,
335
+ getContainer: '{{ getContainer }}'
336
+ },
337
+ properties: {
338
+ name: {
339
+ type: 'string',
340
+ title: '{{t("Category name")}}',
341
+ required: true,
342
+ 'x-disabled': '{{ !createOnly }}',
343
+ 'x-decorator': 'FormItem',
344
+ 'x-component': 'Input'
345
+ },
346
+ color: {
347
+ type: 'string',
348
+ title: '{{t("Color")}}',
349
+ required: false,
350
+ 'x-decorator': 'FormItem',
351
+ 'x-component': 'ColorSelect'
352
+ },
353
+ footer: {
354
+ type: 'void',
355
+ 'x-component': 'Action.Modal.Footer',
356
+ properties: {
357
+ action1: {
358
+ title: '{{ t("Cancel") }}',
133
359
  'x-component': 'Action',
134
360
  'x-component-props': {
135
- icon: 'DeleteOutlined',
136
- useAction: '{{ cm.useBulkDestroyActionAndRefreshCM }}',
137
- confirm: {
138
- title: "{{t('Delete record')}}",
139
- content: "{{t('Are you sure you want to delete it?')}}"
140
- }
361
+ useAction: '{{ useCancelAction }}'
141
362
  }
142
363
  },
143
- create: {
144
- type: 'void',
145
- title: '{{ t("Create collection") }}',
146
- 'x-component': 'AddCollection',
364
+ action2: {
365
+ title: '{{ t("Submit") }}',
366
+ 'x-component': 'Action',
147
367
  'x-component-props': {
148
- type: 'primary'
368
+ type: 'primary',
369
+ useAction: '{{ useCreateCategry }}'
149
370
  }
150
371
  }
151
372
  }
373
+ }
374
+ }
375
+ }
376
+ }
377
+ };
378
+ export var collectionCategoryEditSchema = {
379
+ type: 'object',
380
+ properties: {
381
+ form: {
382
+ type: 'void',
383
+ 'x-decorator': 'Form',
384
+ 'x-decorator-props': {
385
+ useValues: '{{ useValuesFromRecord }}'
386
+ },
387
+ 'x-component': 'Action.Modal',
388
+ title: '{{ t("Edit category") }}',
389
+ 'x-component-props': {
390
+ width: 520,
391
+ getContainer: '{{ getContainer }}'
392
+ },
393
+ properties: {
394
+ name: {
395
+ type: 'string',
396
+ title: '{{t("Category name")}}',
397
+ required: true,
398
+ 'x-disabled': '{{ !createOnly }}',
399
+ 'x-decorator': 'FormItem',
400
+ 'x-component': 'Input'
401
+ },
402
+ color: {
403
+ type: 'string',
404
+ title: '{{t("Color")}}',
405
+ required: false,
406
+ 'x-decorator': 'FormItem',
407
+ 'x-component': 'ColorSelect'
152
408
  },
153
- table: {
409
+ footer: {
154
410
  type: 'void',
155
- 'x-uid': 'input',
156
- 'x-component': 'Table.Void',
157
- 'x-component-props': {
158
- rowKey: 'name',
159
- rowSelection: {
160
- type: 'checkbox'
161
- },
162
- useDataSource: '{{ cm.useDataSourceFromRAC }}',
163
- useAction: function useAction() {
164
- var api = useAPIClient();
165
-
166
- var _useTranslation = useTranslation(),
167
- t = _useTranslation.t;
168
-
169
- return {
170
- move: function move(from, to) {
171
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
172
- return regeneratorRuntime.wrap(function _callee$(_context) {
173
- while (1) {
174
- switch (_context.prev = _context.next) {
175
- case 0:
176
- console.log(from, to);
177
- _context.next = 3;
178
- return api.resource('collections').move({
179
- sourceId: from.key,
180
- targetId: to.key
181
- });
182
-
183
- case 3:
184
- message.success(t('Saved successfully'), 0.2);
185
-
186
- case 4:
187
- case "end":
188
- return _context.stop();
189
- }
190
- }
191
- }, _callee);
192
- }))();
193
- }
194
- };
195
- }
196
- },
411
+ 'x-component': 'Action.Modal.Footer',
197
412
  properties: {
198
- column1: {
199
- type: 'void',
200
- 'x-decorator': 'Table.Column.Decorator',
201
- 'x-component': 'Table.Column',
202
- properties: {
203
- title: {
204
- 'x-component': 'CollectionField',
205
- 'x-read-pretty': true
206
- }
207
- }
208
- },
209
- column2: {
210
- type: 'void',
211
- 'x-decorator': 'Table.Column.Decorator',
212
- 'x-component': 'Table.Column',
213
- properties: {
214
- name: {
215
- type: 'string',
216
- 'x-component': 'CollectionField',
217
- 'x-read-pretty': true
218
- }
219
- }
220
- },
221
- column3: {
222
- type: 'void',
223
- 'x-decorator': 'Table.Column.Decorator',
224
- 'x-component': 'Table.Column',
225
- title: '{{t("Collection template")}}',
226
- properties: {
227
- template: {
228
- 'x-component': CollectionTemplate,
229
- 'x-read-pretty': true
230
- }
413
+ action1: {
414
+ title: '{{ t("Cancel") }}',
415
+ 'x-component': 'Action',
416
+ 'x-component-props': {
417
+ useAction: '{{ useCancelAction }}'
231
418
  }
232
419
  },
233
- column4: {
234
- type: 'void',
235
- title: '{{ t("Actions") }}',
236
- 'x-component': 'Table.Column',
237
- properties: {
238
- actions: {
239
- type: 'void',
240
- 'x-component': 'Space',
241
- 'x-component-props': {
242
- split: '|'
243
- },
244
- properties: {
245
- view: {
246
- type: 'void',
247
- title: '{{ t("Configure fields") }}',
248
- 'x-component': 'Action.Link',
249
- 'x-component-props': {},
250
- properties: {
251
- drawer: {
252
- type: 'void',
253
- 'x-component': 'Action.Drawer',
254
- 'x-component-props': {
255
- destroyOnClose: true
256
- },
257
- 'x-reactions': function xReactions(field) {
258
- var i = field.path.segments[1];
259
- var table = field.form.getValuesIn("table.".concat(i));
260
-
261
- if (table) {
262
- field.title = "".concat(compile(table.title), " - ").concat(compile('{{ t("Configure fields") }}'));
263
- }
264
- },
265
- properties: {
266
- collectionFieldSchema: collectionFieldSchema
267
- }
268
- }
269
- }
270
- },
271
- update: {
272
- type: 'void',
273
- title: '{{ t("Edit") }}',
274
- 'x-component': 'EditCollection',
275
- 'x-component-props': {
276
- type: 'primary'
277
- }
278
- },
279
- delete: {
280
- type: 'void',
281
- title: '{{ t("Delete") }}',
282
- 'x-component': 'Action.Link',
283
- 'x-component-props': {
284
- confirm: {
285
- title: "{{t('Delete record')}}",
286
- content: "{{t('Are you sure you want to delete it?')}}"
287
- },
288
- useAction: '{{ cm.useDestroyActionAndRefreshCM }}'
289
- }
290
- }
291
- }
292
- }
420
+ action2: {
421
+ title: '{{ t("Submit") }}',
422
+ 'x-component': 'Action',
423
+ 'x-component-props': {
424
+ type: 'primary',
425
+ useAction: '{{ useEditCategry }}'
293
426
  }
294
427
  }
295
428
  }
@@ -54,5 +54,6 @@ export declare const templates: Map<string, import("@formily/react").Stringify<{
54
54
  "x-read-only"?: boolean;
55
55
  "x-read-pretty"?: boolean;
56
56
  }>>;
57
+ export declare const collectionTemplates: any;
57
58
  export declare function registerTemplate(key: string, schema: any): void;
58
59
  export declare const templateOptions: () => any[];
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
6
6
 
7
7
  import * as types from '../templates';
8
8
  export var templates = new Map();
9
- var collectionTemplates = {};
9
+ export var collectionTemplates = {};
10
10
  export function registerTemplate(key, schema) {
11
11
  collectionTemplates[key] = schema;
12
12
  }
@@ -34,6 +34,10 @@ export declare const useSortFields: (collectionName: string) => {
34
34
  value: any;
35
35
  label: any;
36
36
  }[];
37
+ export declare const useChildrenCollections: (collectionName: string) => {
38
+ value: any;
39
+ label: any;
40
+ }[];
37
41
  export declare const useCollectionFilterOptions: (collectionName: string) => any[];
38
42
  export declare const useFilterDataSource: (options: any) => {
39
43
  state: {};