@nocobase/client 0.9.0-alpha.2 → 0.9.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 (291) hide show
  1. package/es/acl/ACLProvider.js +4 -7
  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 +3 -1
  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.js +3 -1
  33. package/es/collection-manager/context.d.ts +4 -0
  34. package/es/collection-manager/context.js +5 -1
  35. package/es/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  36. package/es/collection-manager/hooks/useCollectionManager.js +51 -6
  37. package/es/collection-manager/interfaces/m2m.js +2 -2
  38. package/es/collection-manager/interfaces/properties/index.d.ts +0 -56
  39. package/es/collection-manager/interfaces/properties/index.js +1 -2
  40. package/es/collection-manager/templates/calendar.js +1 -1
  41. package/es/collection-manager/templates/general.js +1 -1
  42. package/es/collection-manager/templates/properties/index.d.ts +12 -1
  43. package/es/collection-manager/templates/properties/index.js +11 -0
  44. package/es/i18n/i18n.js +3 -1
  45. package/es/locale/en_US.d.ts +23 -0
  46. package/es/locale/en_US.js +23 -0
  47. package/es/locale/ja_JP.d.ts +23 -0
  48. package/es/locale/ja_JP.js +24 -1
  49. package/es/locale/ru_RU.d.ts +1 -0
  50. package/es/locale/ru_RU.js +1 -0
  51. package/es/locale/zh_CN.d.ts +43 -4
  52. package/es/locale/zh_CN.js +44 -5
  53. package/es/route-switch/antd/admin-layout/index.js +13 -33
  54. package/es/schema-component/antd/action/Action.Designer.js +22 -15
  55. package/es/schema-component/antd/action/Action.js +25 -3
  56. package/es/schema-component/antd/action/utils.d.ts +1 -0
  57. package/es/schema-component/antd/action/utils.js +49 -0
  58. package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -4
  59. package/es/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  60. package/es/schema-component/antd/association-select/useServiceOptions.js +47 -6
  61. package/es/schema-component/antd/calendar/Calendar.Designer.js +17 -36
  62. package/es/schema-component/antd/checkbox/Checkbox.js +9 -8
  63. package/es/schema-component/antd/date-picker/util.d.ts +1 -1
  64. package/es/schema-component/antd/date-picker/util.js +1 -1
  65. package/es/schema-component/antd/filter/DynamicComponent.js +3 -1
  66. package/es/schema-component/antd/filter/Filter.js +2 -1
  67. package/es/schema-component/antd/filter/FilterGroup.js +7 -4
  68. package/es/schema-component/antd/filter/FilterItem.js +3 -2
  69. package/es/schema-component/antd/filter/context.d.ts +1 -0
  70. package/es/schema-component/antd/filter/useValues.js +14 -11
  71. package/es/schema-component/antd/form/Form.js +11 -5
  72. package/es/schema-component/antd/form-item/FormItem.js +17 -8
  73. package/es/schema-component/antd/form-v2/Form.Designer.js +2 -0
  74. package/es/schema-component/antd/form-v2/Form.js +90 -7
  75. package/es/schema-component/antd/form-v2/utils.d.ts +5 -0
  76. package/es/schema-component/antd/form-v2/utils.js +161 -0
  77. package/es/schema-component/antd/grid/Grid.js +10 -5
  78. package/es/schema-component/antd/icon-picker/IconPicker.js +1 -0
  79. package/es/schema-component/antd/index.d.ts +1 -0
  80. package/es/schema-component/antd/index.js +1 -0
  81. package/es/schema-component/antd/input/Input.d.ts +2 -1
  82. package/es/schema-component/antd/input/Json.d.ts +5 -3
  83. package/es/schema-component/antd/input/Json.js +3 -2
  84. package/es/schema-component/antd/input-number/InputNumber.js +3 -1
  85. package/es/schema-component/antd/page/FixedBlock.js +3 -1
  86. package/es/schema-component/antd/page/Page.js +11 -5
  87. package/es/schema-component/antd/page/PageTabDesigner.js +3 -3
  88. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  89. package/es/schema-component/antd/record-picker/RecordPicker.js +1 -2
  90. package/es/schema-component/antd/record-picker/util.js +7 -0
  91. package/es/schema-component/antd/remote-select/RemoteSelect.js +76 -36
  92. package/es/schema-component/antd/rich-text/RichText.js +4 -2
  93. package/es/schema-component/antd/select/Select.js +14 -4
  94. package/es/schema-component/antd/table/Table.Array.js +10 -3
  95. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  96. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  97. package/es/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  98. package/es/schema-component/antd/time-picker/TimePicker.js +1 -1
  99. package/es/schema-component/antd/variable/Input.d.ts +2 -0
  100. package/es/schema-component/antd/variable/Input.js +244 -0
  101. package/es/schema-component/antd/variable/JSONInput.d.ts +2 -0
  102. package/es/schema-component/antd/variable/JSONInput.js +82 -0
  103. package/es/schema-component/antd/variable/TextArea.d.ts +2 -0
  104. package/es/schema-component/antd/variable/TextArea.js +322 -0
  105. package/es/schema-component/antd/variable/Variable.d.ts +8 -0
  106. package/es/schema-component/antd/variable/Variable.js +11 -0
  107. package/es/schema-component/antd/variable/index.d.ts +1 -0
  108. package/es/schema-component/antd/variable/index.js +1 -0
  109. package/es/schema-component/common/sortable-item/SortableItem.js +36 -6
  110. package/es/schema-component/common/utils/logic.js +523 -0
  111. package/es/schema-component/common/utils/uitls.d.ts +1 -0
  112. package/es/schema-component/common/utils/uitls.js +89 -0
  113. package/es/schema-initializer/SchemaInitializer.js +0 -1
  114. package/es/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  115. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -3
  116. package/es/schema-initializer/index.d.ts +2 -1
  117. package/es/schema-initializer/index.js +2 -1
  118. package/es/schema-initializer/items/CalendarBlockInitializer.js +24 -41
  119. package/es/schema-initializer/utils.js +22 -7
  120. package/es/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  121. package/es/schema-settings/LinkageRules/DynamicComponent.js +113 -0
  122. package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  123. package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +15 -0
  124. package/es/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  125. package/es/schema-settings/LinkageRules/LinkageRuleAction.js +162 -0
  126. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  127. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.js +71 -0
  128. package/es/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  129. package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +82 -0
  130. package/es/schema-settings/LinkageRules/Variables.d.ts +7 -0
  131. package/es/schema-settings/LinkageRules/Variables.js +115 -0
  132. package/es/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  133. package/es/schema-settings/LinkageRules/action-hooks.js +115 -0
  134. package/es/schema-settings/LinkageRules/context.d.ts +13 -0
  135. package/es/schema-settings/LinkageRules/context.js +4 -0
  136. package/es/schema-settings/LinkageRules/index.d.ts +2 -0
  137. package/es/schema-settings/LinkageRules/index.js +132 -0
  138. package/es/schema-settings/LinkageRules/type.d.ts +13 -0
  139. package/es/schema-settings/LinkageRules/type.js +15 -0
  140. package/es/schema-settings/LinkageRules/useValues.d.ts +1 -0
  141. package/es/schema-settings/LinkageRules/useValues.js +84 -0
  142. package/es/schema-settings/SchemaSettings.d.ts +4 -1
  143. package/es/schema-settings/SchemaSettings.js +153 -26
  144. package/es/schema-templates/BlockTemplate.js +9 -1
  145. package/es/system-settings/SystemSettingsShortcut.js +1 -1
  146. package/lib/acl/ACLProvider.js +4 -7
  147. package/lib/api-client/APIClient.js +6 -0
  148. package/lib/block-provider/BlockProvider.js +9 -6
  149. package/lib/block-provider/FormBlockProvider.js +3 -1
  150. package/lib/block-provider/KanbanBlockProvider.js +1 -1
  151. package/lib/block-provider/SharedFilterProvider.js +9 -3
  152. package/lib/block-provider/TableBlockProvider.js +1 -1
  153. package/lib/block-provider/TableSelectorProvider.js +2 -2
  154. package/lib/block-provider/hooks/index.js +23 -7
  155. package/lib/collection-manager/CollectionManagerProvider.d.ts +1 -0
  156. package/lib/collection-manager/CollectionManagerProvider.js +81 -16
  157. package/lib/collection-manager/CollectionManagerShortcut.js +36 -23
  158. package/lib/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  159. package/lib/collection-manager/Configuration/AddCategoryAction.js +145 -0
  160. package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -3
  161. package/lib/collection-manager/Configuration/AddFieldAction.js +1 -0
  162. package/lib/collection-manager/Configuration/ConfigurationTable.js +34 -4
  163. package/lib/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  164. package/lib/collection-manager/Configuration/ConfigurationTabs.js +407 -0
  165. package/lib/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  166. package/lib/collection-manager/Configuration/EditCategoryAction.js +178 -0
  167. package/lib/collection-manager/Configuration/EditCollectionAction.js +6 -2
  168. package/lib/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  169. package/lib/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  170. package/lib/collection-manager/Configuration/components/CollectionCategory.js +27 -0
  171. package/lib/collection-manager/Configuration/index.d.ts +3 -0
  172. package/lib/collection-manager/Configuration/index.js +39 -0
  173. package/lib/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  174. package/lib/collection-manager/Configuration/schemas/collections.js +316 -178
  175. package/lib/collection-manager/Configuration/templates.d.ts +1 -0
  176. package/lib/collection-manager/Configuration/templates.js +2 -0
  177. package/lib/collection-manager/action-hooks.js +3 -1
  178. package/lib/collection-manager/context.d.ts +4 -0
  179. package/lib/collection-manager/context.js +7 -2
  180. package/lib/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  181. package/lib/collection-manager/hooks/useCollectionManager.js +52 -6
  182. package/lib/collection-manager/interfaces/m2m.js +2 -2
  183. package/lib/collection-manager/interfaces/properties/index.d.ts +0 -56
  184. package/lib/collection-manager/interfaces/properties/index.js +1 -2
  185. package/lib/collection-manager/templates/calendar.js +1 -1
  186. package/lib/collection-manager/templates/general.js +1 -1
  187. package/lib/collection-manager/templates/properties/index.d.ts +12 -1
  188. package/lib/collection-manager/templates/properties/index.js +11 -0
  189. package/lib/i18n/i18n.js +3 -1
  190. package/lib/locale/en_US.d.ts +23 -0
  191. package/lib/locale/en_US.js +23 -0
  192. package/lib/locale/ja_JP.d.ts +23 -0
  193. package/lib/locale/ja_JP.js +24 -1
  194. package/lib/locale/ru_RU.d.ts +1 -0
  195. package/lib/locale/ru_RU.js +1 -0
  196. package/lib/locale/zh_CN.d.ts +43 -4
  197. package/lib/locale/zh_CN.js +44 -5
  198. package/lib/route-switch/antd/admin-layout/index.js +13 -33
  199. package/lib/schema-component/antd/action/Action.Designer.js +24 -14
  200. package/lib/schema-component/antd/action/Action.js +27 -2
  201. package/lib/schema-component/antd/action/utils.d.ts +1 -0
  202. package/lib/schema-component/antd/action/utils.js +58 -2
  203. package/lib/schema-component/antd/association-filter/AssociationFilter.js +3 -3
  204. package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  205. package/lib/schema-component/antd/association-select/useServiceOptions.js +47 -4
  206. package/lib/schema-component/antd/calendar/Calendar.Designer.js +15 -33
  207. package/lib/schema-component/antd/checkbox/Checkbox.js +8 -7
  208. package/lib/schema-component/antd/date-picker/util.d.ts +1 -1
  209. package/lib/schema-component/antd/date-picker/util.js +1 -1
  210. package/lib/schema-component/antd/filter/DynamicComponent.js +3 -1
  211. package/lib/schema-component/antd/filter/Filter.js +2 -1
  212. package/lib/schema-component/antd/filter/FilterGroup.js +7 -4
  213. package/lib/schema-component/antd/filter/FilterItem.js +3 -2
  214. package/lib/schema-component/antd/filter/context.d.ts +1 -0
  215. package/lib/schema-component/antd/filter/useValues.js +15 -11
  216. package/lib/schema-component/antd/form/Form.js +9 -3
  217. package/lib/schema-component/antd/form-item/FormItem.js +21 -7
  218. package/lib/schema-component/antd/form-v2/Form.Designer.js +2 -0
  219. package/lib/schema-component/antd/form-v2/Form.js +89 -5
  220. package/lib/schema-component/antd/form-v2/utils.d.ts +5 -0
  221. package/lib/schema-component/antd/form-v2/utils.js +181 -0
  222. package/lib/schema-component/antd/grid/Grid.js +10 -5
  223. package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -0
  224. package/lib/schema-component/antd/index.d.ts +1 -0
  225. package/lib/schema-component/antd/index.js +13 -0
  226. package/lib/schema-component/antd/input/Input.d.ts +2 -1
  227. package/lib/schema-component/antd/input/Json.d.ts +5 -3
  228. package/lib/schema-component/antd/input/Json.js +6 -3
  229. package/lib/schema-component/antd/input-number/InputNumber.js +2 -0
  230. package/lib/schema-component/antd/page/FixedBlock.js +3 -1
  231. package/lib/schema-component/antd/page/Page.js +14 -5
  232. package/lib/schema-component/antd/page/PageTabDesigner.js +1 -1
  233. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  234. package/lib/schema-component/antd/record-picker/RecordPicker.js +1 -2
  235. package/lib/schema-component/antd/record-picker/util.js +7 -0
  236. package/lib/schema-component/antd/remote-select/RemoteSelect.js +76 -37
  237. package/lib/schema-component/antd/rich-text/RichText.js +4 -2
  238. package/lib/schema-component/antd/select/Select.js +14 -4
  239. package/lib/schema-component/antd/table/Table.Array.js +8 -1
  240. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  241. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  242. package/lib/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  243. package/lib/schema-component/antd/time-picker/TimePicker.js +1 -1
  244. package/lib/schema-component/antd/variable/Input.d.ts +2 -0
  245. package/lib/schema-component/antd/variable/Input.js +262 -0
  246. package/lib/schema-component/antd/variable/JSONInput.d.ts +2 -0
  247. package/lib/schema-component/antd/variable/JSONInput.js +100 -0
  248. package/lib/schema-component/antd/variable/TextArea.d.ts +2 -0
  249. package/lib/schema-component/antd/variable/TextArea.js +341 -0
  250. package/lib/schema-component/antd/variable/Variable.d.ts +8 -0
  251. package/lib/schema-component/antd/variable/Variable.js +25 -0
  252. package/lib/schema-component/antd/variable/index.d.ts +1 -0
  253. package/lib/schema-component/antd/variable/index.js +18 -0
  254. package/lib/schema-component/common/sortable-item/SortableItem.js +36 -6
  255. package/lib/schema-component/common/utils/logic.js +525 -0
  256. package/lib/schema-component/common/utils/uitls.d.ts +1 -0
  257. package/lib/schema-component/common/utils/uitls.js +103 -0
  258. package/lib/schema-initializer/SchemaInitializer.js +0 -1
  259. package/lib/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  260. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +3 -1
  261. package/lib/schema-initializer/index.d.ts +2 -1
  262. package/lib/schema-initializer/index.js +51 -2
  263. package/lib/schema-initializer/items/CalendarBlockInitializer.js +16 -33
  264. package/lib/schema-initializer/utils.js +22 -6
  265. package/lib/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  266. package/lib/schema-settings/LinkageRules/DynamicComponent.js +139 -0
  267. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  268. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +27 -0
  269. package/lib/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  270. package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +190 -0
  271. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  272. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.js +90 -0
  273. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  274. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +104 -0
  275. package/lib/schema-settings/LinkageRules/Variables.d.ts +7 -0
  276. package/lib/schema-settings/LinkageRules/Variables.js +124 -0
  277. package/lib/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  278. package/lib/schema-settings/LinkageRules/action-hooks.js +127 -0
  279. package/lib/schema-settings/LinkageRules/context.d.ts +13 -0
  280. package/lib/schema-settings/LinkageRules/context.js +15 -0
  281. package/lib/schema-settings/LinkageRules/index.d.ts +2 -0
  282. package/lib/schema-settings/LinkageRules/index.js +149 -0
  283. package/lib/schema-settings/LinkageRules/type.d.ts +13 -0
  284. package/lib/schema-settings/LinkageRules/type.js +22 -0
  285. package/lib/schema-settings/LinkageRules/useValues.d.ts +1 -0
  286. package/lib/schema-settings/LinkageRules/useValues.js +95 -0
  287. package/lib/schema-settings/SchemaSettings.d.ts +4 -1
  288. package/lib/schema-settings/SchemaSettings.js +176 -48
  289. package/lib/schema-templates/BlockTemplate.js +9 -1
  290. package/lib/system-settings/SystemSettingsShortcut.js +1 -1
  291. 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
  }
@@ -718,6 +718,8 @@ export var useBulkDestroyActionAndRefreshCM = function useBulkDestroyActionAndRe
718
718
  };
719
719
  };
720
720
  export var useFilterActionProps = function useFilterActionProps() {
721
+ var _service$state, _service$state$params;
722
+
721
723
  var _useResourceContext8 = useResourceContext(),
722
724
  collection = _useResourceContext8.collection;
723
725
 
@@ -725,7 +727,7 @@ export var useFilterActionProps = function useFilterActionProps() {
725
727
  var service = useResourceActionContext();
726
728
  return useFilterFieldProps({
727
729
  options: options,
728
- params: service.params,
730
+ params: ((_service$state = service.state) === null || _service$state === void 0 ? void 0 : (_service$state$params = _service$state.params) === null || _service$state$params === void 0 ? void 0 : _service$state$params[0]) || service.params,
729
731
  service: service
730
732
  });
731
733
  };
@@ -3,3 +3,7 @@ import { CollectionFieldOptions, CollectionManagerOptions, CollectionOptions } f
3
3
  export declare const CollectionManagerContext: import("react").Context<CollectionManagerOptions>;
4
4
  export declare const CollectionContext: import("react").Context<CollectionOptions>;
5
5
  export declare const CollectionFieldContext: import("react").Context<CollectionFieldOptions>;
6
+ export declare const CollectionCategroriesContext: import("react").Context<{
7
+ data: any[];
8
+ refresh: () => void;
9
+ }>;