@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
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CollectionCategory = void 0;
7
+
8
+ var _react = require("@formily/react");
9
+
10
+ var _antd = require("antd");
11
+
12
+ var _react2 = _interopRequireDefault(require("react"));
13
+
14
+ var _schemaComponent = require("../../../schema-component");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ var CollectionCategory = (0, _react.observer)(function (props) {
19
+ var value = props.value;
20
+ var compile = (0, _schemaComponent.useCompile)();
21
+ return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, value.map(function (item) {
22
+ return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
23
+ color: item.color
24
+ }, compile(item === null || item === void 0 ? void 0 : item.name));
25
+ }));
26
+ });
27
+ exports.CollectionCategory = CollectionCategory;
@@ -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';
@@ -148,6 +148,45 @@ Object.keys(_EditCollectionAction).forEach(function (key) {
148
148
  }
149
149
  });
150
150
  });
151
+
152
+ var _ConfigurationTabs = require("./ConfigurationTabs");
153
+
154
+ Object.keys(_ConfigurationTabs).forEach(function (key) {
155
+ if (key === "default" || key === "__esModule") return;
156
+ if (key in exports && exports[key] === _ConfigurationTabs[key]) return;
157
+ Object.defineProperty(exports, key, {
158
+ enumerable: true,
159
+ get: function get() {
160
+ return _ConfigurationTabs[key];
161
+ }
162
+ });
163
+ });
164
+
165
+ var _AddCategoryAction = require("./AddCategoryAction");
166
+
167
+ Object.keys(_AddCategoryAction).forEach(function (key) {
168
+ if (key === "default" || key === "__esModule") return;
169
+ if (key in exports && exports[key] === _AddCategoryAction[key]) return;
170
+ Object.defineProperty(exports, key, {
171
+ enumerable: true,
172
+ get: function get() {
173
+ return _AddCategoryAction[key];
174
+ }
175
+ });
176
+ });
177
+
178
+ var _EditCategoryAction = require("./EditCategoryAction");
179
+
180
+ Object.keys(_EditCategoryAction).forEach(function (key) {
181
+ if (key === "default" || key === "__esModule") return;
182
+ if (key in exports && exports[key] === _EditCategoryAction[key]) return;
183
+ Object.defineProperty(exports, key, {
184
+ enumerable: true,
185
+ get: function get() {
186
+ return _EditCategoryAction[key];
187
+ }
188
+ });
189
+ });
151
190
  (0, _core.registerValidateFormats)({
152
191
  uid: /^[A-Za-z0-9][A-Za-z0-9_-]*$/
153
192
  });
@@ -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;
@@ -3,12 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.collectionSchema = exports.collection = void 0;
6
+ exports.collectionTableSchema = exports.collectionSchema = exports.collectionCategorySchema = exports.collectionCategoryEditSchema = exports.collection = void 0;
7
7
 
8
8
  var _react = require("@formily/react");
9
9
 
10
10
  var _antd = require("antd");
11
11
 
12
+ var _shared = require("@formily/shared");
13
+
12
14
  var _reactI18next = require("react-i18next");
13
15
 
14
16
  var _apiClient = require("../../../api-client");
@@ -17,8 +19,14 @@ var _i18n = require("../../../i18n");
17
19
 
18
20
  var _CollectionTemplate = require("../components/CollectionTemplate");
19
21
 
22
+ var _CollectionCategory = require("../components/CollectionCategory");
23
+
20
24
  var _collectionFields = require("./collectionFields");
21
25
 
26
+ var _properties;
27
+
28
+ 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; }
29
+
22
30
  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); } }
23
31
 
24
32
  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); }); }; }
@@ -105,205 +113,335 @@ var collectionSchema = {
105
113
  filter: {
106
114
  'hidden.$isFalsy': true
107
115
  },
108
- appends: []
116
+ appends: ['category']
109
117
  }
110
118
  }
111
119
  },
112
120
  properties: {
113
- actions: {
121
+ tabs: {
114
122
  type: 'void',
115
- 'x-component': 'ActionBar',
116
- 'x-component-props': {
117
- style: {
118
- marginBottom: 16
123
+ 'x-component': 'ConfigurationTabs'
124
+ }
125
+ }
126
+ }
127
+ }
128
+ };
129
+ exports.collectionSchema = collectionSchema;
130
+ var collectionTableSchema = {
131
+ type: 'object',
132
+ properties: (_properties = {}, _defineProperty(_properties, (0, _shared.uid)(), {
133
+ type: 'void',
134
+ 'x-component': 'ActionBar',
135
+ 'x-component-props': {
136
+ style: {
137
+ marginBottom: 16
138
+ }
139
+ },
140
+ properties: {
141
+ filter: {
142
+ type: 'void',
143
+ title: '{{ t("Filter") }}',
144
+ default: {
145
+ $and: [{
146
+ title: {
147
+ $includes: ''
119
148
  }
120
- },
121
- properties: {
122
- filter: {
123
- type: 'void',
124
- title: '{{ t("Filter") }}',
125
- default: {
126
- $and: [{
127
- title: {
128
- $includes: ''
149
+ }, {
150
+ name: {
151
+ $includes: ''
152
+ }
153
+ }]
154
+ },
155
+ 'x-action': 'filter',
156
+ 'x-component': 'Filter.Action',
157
+ 'x-component-props': {
158
+ icon: 'FilterOutlined',
159
+ useProps: '{{ cm.useFilterActionProps }}'
160
+ },
161
+ 'x-align': 'left'
162
+ },
163
+ delete: {
164
+ type: 'void',
165
+ title: '{{ t("Delete") }}',
166
+ 'x-component': 'Action',
167
+ 'x-component-props': {
168
+ icon: 'DeleteOutlined',
169
+ useAction: '{{ cm.useBulkDestroyActionAndRefreshCM }}',
170
+ confirm: {
171
+ title: "{{t('Delete record')}}",
172
+ content: "{{t('Are you sure you want to delete it?')}}"
173
+ }
174
+ }
175
+ },
176
+ create: {
177
+ type: 'void',
178
+ title: '{{ t("Create collection") }}',
179
+ 'x-component': 'AddCollection',
180
+ 'x-component-props': {
181
+ type: 'primary'
182
+ }
183
+ }
184
+ }
185
+ }), _defineProperty(_properties, (0, _shared.uid)(), {
186
+ type: 'void',
187
+ 'x-uid': 'input',
188
+ 'x-component': 'Table.Void',
189
+ 'x-component-props': {
190
+ rowKey: 'name',
191
+ rowSelection: {
192
+ type: 'checkbox'
193
+ },
194
+ useDataSource: '{{ cm.useDataSourceFromRAC }}',
195
+ useAction: function useAction() {
196
+ var api = (0, _apiClient.useAPIClient)();
197
+
198
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
199
+ t = _useTranslation.t;
200
+
201
+ return {
202
+ move: function move(from, to) {
203
+ return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
204
+ return regeneratorRuntime.wrap(function _callee$(_context) {
205
+ while (1) {
206
+ switch (_context.prev = _context.next) {
207
+ case 0:
208
+ _context.next = 2;
209
+ return api.resource('collections').move({
210
+ sourceId: from.key,
211
+ targetId: to.key
212
+ });
213
+
214
+ case 2:
215
+ _antd.message.success(t('Saved successfully'), 0.2);
216
+
217
+ case 3:
218
+ case "end":
219
+ return _context.stop();
129
220
  }
130
- }, {
131
- name: {
132
- $includes: ''
221
+ }
222
+ }, _callee);
223
+ }))();
224
+ }
225
+ };
226
+ }
227
+ },
228
+ properties: {
229
+ column1: {
230
+ type: 'void',
231
+ 'x-decorator': 'Table.Column.Decorator',
232
+ 'x-component': 'Table.Column',
233
+ properties: {
234
+ title: {
235
+ 'x-component': 'CollectionField',
236
+ 'x-read-pretty': true
237
+ }
238
+ }
239
+ },
240
+ column2: {
241
+ type: 'void',
242
+ 'x-decorator': 'Table.Column.Decorator',
243
+ 'x-component': 'Table.Column',
244
+ properties: {
245
+ name: {
246
+ type: 'string',
247
+ 'x-component': 'CollectionField',
248
+ 'x-read-pretty': true
249
+ }
250
+ }
251
+ },
252
+ column3: {
253
+ type: 'void',
254
+ 'x-decorator': 'Table.Column.Decorator',
255
+ 'x-component': 'Table.Column',
256
+ title: '{{t("Collection template")}}',
257
+ properties: {
258
+ template: {
259
+ 'x-component': _CollectionTemplate.CollectionTemplate,
260
+ 'x-read-pretty': true
261
+ }
262
+ }
263
+ },
264
+ column4: {
265
+ type: 'void',
266
+ 'x-decorator': 'Table.Column.Decorator',
267
+ 'x-component': 'Table.Column',
268
+ 'x-visible': 'categoryVisible',
269
+ title: '{{t("Collection category")}}',
270
+ properties: {
271
+ category: {
272
+ 'x-component': _CollectionCategory.CollectionCategory,
273
+ 'x-read-pretty': true
274
+ }
275
+ }
276
+ },
277
+ column5: {
278
+ type: 'void',
279
+ title: '{{ t("Actions") }}',
280
+ 'x-component': 'Table.Column',
281
+ properties: {
282
+ actions: {
283
+ type: 'void',
284
+ 'x-component': 'Space',
285
+ 'x-component-props': {
286
+ split: '|'
287
+ },
288
+ properties: {
289
+ view: {
290
+ type: 'void',
291
+ title: '{{ t("Configure fields") }}',
292
+ 'x-component': 'Action.Link',
293
+ 'x-component-props': {},
294
+ properties: {
295
+ drawer: {
296
+ type: 'void',
297
+ 'x-component': 'Action.Drawer',
298
+ 'x-component-props': {
299
+ destroyOnClose: true
300
+ },
301
+ 'x-reactions': function xReactions(field) {
302
+ var i = field.path.segments[1];
303
+ var table = field.form.getValuesIn("table.".concat(i));
304
+
305
+ if (table) {
306
+ field.title = "".concat(compile(table.title), " - ").concat(compile('{{ t("Configure fields") }}'));
307
+ }
308
+ },
309
+ properties: {
310
+ collectionFieldSchema: _collectionFields.collectionFieldSchema
311
+ }
133
312
  }
134
- }]
313
+ }
135
314
  },
136
- 'x-action': 'filter',
137
- 'x-component': 'Filter.Action',
138
- 'x-component-props': {
139
- icon: 'FilterOutlined',
140
- useProps: '{{ cm.useFilterActionProps }}'
315
+ update: {
316
+ type: 'void',
317
+ title: '{{ t("Edit") }}',
318
+ 'x-component': 'EditCollection',
319
+ 'x-component-props': {
320
+ type: 'primary'
321
+ }
141
322
  },
142
- 'x-align': 'left'
143
- },
144
- delete: {
145
- type: 'void',
146
- title: '{{ t("Delete") }}',
323
+ delete: {
324
+ type: 'void',
325
+ title: '{{ t("Delete") }}',
326
+ 'x-component': 'Action.Link',
327
+ 'x-component-props': {
328
+ confirm: {
329
+ title: "{{t('Delete record')}}",
330
+ content: "{{t('Are you sure you want to delete it?')}}"
331
+ },
332
+ useAction: '{{ cm.useDestroyActionAndRefreshCM }}'
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ }
340
+ }), _properties)
341
+ };
342
+ exports.collectionTableSchema = collectionTableSchema;
343
+ var collectionCategorySchema = {
344
+ type: 'object',
345
+ properties: {
346
+ form: {
347
+ type: 'void',
348
+ 'x-decorator': 'Form',
349
+ 'x-component': 'Action.Modal',
350
+ title: '{{ t("Add category") }}',
351
+ 'x-component-props': {
352
+ width: 520,
353
+ getContainer: '{{ getContainer }}'
354
+ },
355
+ properties: {
356
+ name: {
357
+ type: 'string',
358
+ title: '{{t("Category name")}}',
359
+ required: true,
360
+ 'x-disabled': '{{ !createOnly }}',
361
+ 'x-decorator': 'FormItem',
362
+ 'x-component': 'Input'
363
+ },
364
+ color: {
365
+ type: 'string',
366
+ title: '{{t("Color")}}',
367
+ required: false,
368
+ 'x-decorator': 'FormItem',
369
+ 'x-component': 'ColorSelect'
370
+ },
371
+ footer: {
372
+ type: 'void',
373
+ 'x-component': 'Action.Modal.Footer',
374
+ properties: {
375
+ action1: {
376
+ title: '{{ t("Cancel") }}',
147
377
  'x-component': 'Action',
148
378
  'x-component-props': {
149
- icon: 'DeleteOutlined',
150
- useAction: '{{ cm.useBulkDestroyActionAndRefreshCM }}',
151
- confirm: {
152
- title: "{{t('Delete record')}}",
153
- content: "{{t('Are you sure you want to delete it?')}}"
154
- }
379
+ useAction: '{{ useCancelAction }}'
155
380
  }
156
381
  },
157
- create: {
158
- type: 'void',
159
- title: '{{ t("Create collection") }}',
160
- 'x-component': 'AddCollection',
382
+ action2: {
383
+ title: '{{ t("Submit") }}',
384
+ 'x-component': 'Action',
161
385
  'x-component-props': {
162
- type: 'primary'
386
+ type: 'primary',
387
+ useAction: '{{ useCreateCategry }}'
163
388
  }
164
389
  }
165
390
  }
391
+ }
392
+ }
393
+ }
394
+ }
395
+ };
396
+ exports.collectionCategorySchema = collectionCategorySchema;
397
+ var collectionCategoryEditSchema = {
398
+ type: 'object',
399
+ properties: {
400
+ form: {
401
+ type: 'void',
402
+ 'x-decorator': 'Form',
403
+ 'x-decorator-props': {
404
+ useValues: '{{ useValuesFromRecord }}'
405
+ },
406
+ 'x-component': 'Action.Modal',
407
+ title: '{{ t("Edit category") }}',
408
+ 'x-component-props': {
409
+ width: 520,
410
+ getContainer: '{{ getContainer }}'
411
+ },
412
+ properties: {
413
+ name: {
414
+ type: 'string',
415
+ title: '{{t("Category name")}}',
416
+ required: true,
417
+ 'x-disabled': '{{ !createOnly }}',
418
+ 'x-decorator': 'FormItem',
419
+ 'x-component': 'Input'
420
+ },
421
+ color: {
422
+ type: 'string',
423
+ title: '{{t("Color")}}',
424
+ required: false,
425
+ 'x-decorator': 'FormItem',
426
+ 'x-component': 'ColorSelect'
166
427
  },
167
- table: {
428
+ footer: {
168
429
  type: 'void',
169
- 'x-uid': 'input',
170
- 'x-component': 'Table.Void',
171
- 'x-component-props': {
172
- rowKey: 'name',
173
- rowSelection: {
174
- type: 'checkbox'
175
- },
176
- useDataSource: '{{ cm.useDataSourceFromRAC }}',
177
- useAction: function useAction() {
178
- var api = (0, _apiClient.useAPIClient)();
179
-
180
- var _useTranslation = (0, _reactI18next.useTranslation)(),
181
- t = _useTranslation.t;
182
-
183
- return {
184
- move: function move(from, to) {
185
- return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
186
- return regeneratorRuntime.wrap(function _callee$(_context) {
187
- while (1) {
188
- switch (_context.prev = _context.next) {
189
- case 0:
190
- console.log(from, to);
191
- _context.next = 3;
192
- return api.resource('collections').move({
193
- sourceId: from.key,
194
- targetId: to.key
195
- });
196
-
197
- case 3:
198
- _antd.message.success(t('Saved successfully'), 0.2);
199
-
200
- case 4:
201
- case "end":
202
- return _context.stop();
203
- }
204
- }
205
- }, _callee);
206
- }))();
207
- }
208
- };
209
- }
210
- },
430
+ 'x-component': 'Action.Modal.Footer',
211
431
  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.CollectionTemplate,
243
- 'x-read-pretty': true
244
- }
432
+ action1: {
433
+ title: '{{ t("Cancel") }}',
434
+ 'x-component': 'Action',
435
+ 'x-component-props': {
436
+ useAction: '{{ useCancelAction }}'
245
437
  }
246
438
  },
247
- column4: {
248
- type: 'void',
249
- title: '{{ t("Actions") }}',
250
- 'x-component': 'Table.Column',
251
- properties: {
252
- actions: {
253
- type: 'void',
254
- 'x-component': 'Space',
255
- 'x-component-props': {
256
- split: '|'
257
- },
258
- properties: {
259
- view: {
260
- type: 'void',
261
- title: '{{ t("Configure fields") }}',
262
- 'x-component': 'Action.Link',
263
- 'x-component-props': {},
264
- properties: {
265
- drawer: {
266
- type: 'void',
267
- 'x-component': 'Action.Drawer',
268
- 'x-component-props': {
269
- destroyOnClose: true
270
- },
271
- 'x-reactions': function xReactions(field) {
272
- var i = field.path.segments[1];
273
- var table = field.form.getValuesIn("table.".concat(i));
274
-
275
- if (table) {
276
- field.title = "".concat(compile(table.title), " - ").concat(compile('{{ t("Configure fields") }}'));
277
- }
278
- },
279
- properties: {
280
- collectionFieldSchema: _collectionFields.collectionFieldSchema
281
- }
282
- }
283
- }
284
- },
285
- update: {
286
- type: 'void',
287
- title: '{{ t("Edit") }}',
288
- 'x-component': 'EditCollection',
289
- 'x-component-props': {
290
- type: 'primary'
291
- }
292
- },
293
- delete: {
294
- type: 'void',
295
- title: '{{ t("Delete") }}',
296
- 'x-component': 'Action.Link',
297
- 'x-component-props': {
298
- confirm: {
299
- title: "{{t('Delete record')}}",
300
- content: "{{t('Are you sure you want to delete it?')}}"
301
- },
302
- useAction: '{{ cm.useDestroyActionAndRefreshCM }}'
303
- }
304
- }
305
- }
306
- }
439
+ action2: {
440
+ title: '{{ t("Submit") }}',
441
+ 'x-component': 'Action',
442
+ 'x-component-props': {
443
+ type: 'primary',
444
+ useAction: '{{ useEditCategry }}'
307
445
  }
308
446
  }
309
447
  }
@@ -312,4 +450,4 @@ var collectionSchema = {
312
450
  }
313
451
  }
314
452
  };
315
- exports.collectionSchema = collectionSchema;
453
+ exports.collectionCategoryEditSchema = collectionCategoryEditSchema;
@@ -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[];
@@ -5,6 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports.collectionTemplates = void 0;
8
9
  exports.registerTemplate = registerTemplate;
9
10
  exports.templates = exports.templateOptions = void 0;
10
11
 
@@ -23,6 +24,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
23
24
  var templates = new Map();
24
25
  exports.templates = templates;
25
26
  var collectionTemplates = {};
27
+ exports.collectionTemplates = collectionTemplates;
26
28
 
27
29
  function registerTemplate(key, schema) {
28
30
  collectionTemplates[key] = schema;
@@ -794,6 +794,8 @@ var useBulkDestroyActionAndRefreshCM = function useBulkDestroyActionAndRefreshCM
794
794
  exports.useBulkDestroyActionAndRefreshCM = useBulkDestroyActionAndRefreshCM;
795
795
 
796
796
  var useFilterActionProps = function useFilterActionProps() {
797
+ var _service$state, _service$state$params;
798
+
797
799
  var _useResourceContext8 = (0, _ResourceActionProvider.useResourceContext)(),
798
800
  collection = _useResourceContext8.collection;
799
801
 
@@ -801,7 +803,7 @@ var useFilterActionProps = function useFilterActionProps() {
801
803
  var service = (0, _ResourceActionProvider.useResourceActionContext)();
802
804
  return (0, _useFilterActionProps.useFilterFieldProps)({
803
805
  options: options,
804
- params: service.params,
806
+ 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,
805
807
  service: service
806
808
  });
807
809
  };