@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
@@ -4,4 +4,8 @@ export var CollectionManagerContext = /*#__PURE__*/createContext({
4
4
  interfaces: {}
5
5
  });
6
6
  export var CollectionContext = /*#__PURE__*/createContext({});
7
- export var CollectionFieldContext = /*#__PURE__*/createContext({});
7
+ export var CollectionFieldContext = /*#__PURE__*/createContext({});
8
+ export var CollectionCategroriesContext = /*#__PURE__*/createContext({
9
+ data: [],
10
+ refresh: function refresh() {}
11
+ });
@@ -10,6 +10,13 @@ export declare const useCollectionManager: () => {
10
10
  getInheritedFields: (name: any) => any[];
11
11
  getCollectionField: (name: string) => CollectionFieldOptions;
12
12
  getCollectionFields: (name: string) => CollectionFieldOptions[];
13
+ getCollectionFieldsOptions: (collectionName: string, type?: string | string[], opts?: {
14
+ /**
15
+ * 为 true 时允许查询所有关联字段
16
+ * 为 Array<string> 时仅允许查询指定的关联字段
17
+ */
18
+ association?: boolean | string[];
19
+ }) => any[];
13
20
  getCurrentCollectionFields: (name: string) => any;
14
21
  getCollection(name: any): any;
15
22
  getCollectionJoinField(name: string): any;
@@ -17,6 +17,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
17
  import { clone } from '@formily/shared';
18
18
  import { reduce, unionBy, uniq } from 'lodash';
19
19
  import { useContext } from 'react';
20
+ import { useCompile } from '../../schema-component';
20
21
  import { CollectionManagerContext } from '../context';
21
22
  export var useCollectionManager = function useCollectionManager() {
22
23
  var _useContext = useContext(CollectionManagerContext),
@@ -26,6 +27,8 @@ export var useCollectionManager = function useCollectionManager() {
26
27
  collections = _useContext.collections,
27
28
  templates = _useContext.templates;
28
29
 
30
+ var compile = useCompile();
31
+
29
32
  var getInheritedFields = function getInheritedFields(name) {
30
33
  var inheritKeys = getInheritCollections(name);
31
34
  var inheritedFields = reduce(inheritKeys, function (result, value) {
@@ -104,9 +107,9 @@ export var useCollectionManager = function useCollectionManager() {
104
107
  };
105
108
 
106
109
  var getChildrenCollections = function getChildrenCollections(name) {
107
- var childrens = [];
110
+ var children = [];
108
111
 
109
- var getChildrens = function getChildrens(name) {
112
+ var getChildren = function getChildren(name) {
110
113
  var inheritCollections = collections.filter(function (v) {
111
114
  var _v$inherits;
112
115
 
@@ -114,13 +117,13 @@ export var useCollectionManager = function useCollectionManager() {
114
117
  });
115
118
  inheritCollections.forEach(function (v) {
116
119
  var collectionKey = v.name;
117
- childrens.push(v);
118
- return getChildrens(collectionKey);
120
+ children.push(v);
121
+ return getChildren(collectionKey);
119
122
  });
120
- return childrens;
123
+ return children;
121
124
  };
122
125
 
123
- return getChildrens(name);
126
+ return getChildren(name);
124
127
  };
125
128
 
126
129
  var getCurrentCollectionFields = function getCurrentCollectionFields(name) {
@@ -130,6 +133,47 @@ export var useCollectionManager = function useCollectionManager() {
130
133
  return (collection === null || collection === void 0 ? void 0 : collection.fields) || [];
131
134
  };
132
135
 
136
+ var getCollectionFieldsOptions = function getCollectionFieldsOptions(collectionName) {
137
+ var _fields$filter;
138
+
139
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'string';
140
+ var opts = arguments.length > 2 ? arguments[2] : undefined;
141
+
142
+ var _ref = opts || {},
143
+ _ref$association = _ref.association,
144
+ association = _ref$association === void 0 ? false : _ref$association;
145
+
146
+ if (typeof type === 'string') {
147
+ type = [type];
148
+ }
149
+
150
+ var fields = getCollectionFields(collectionName);
151
+ var options = fields === null || fields === void 0 ? void 0 : (_fields$filter = fields.filter(function (field) {
152
+ return field.interface && (type.includes(field.type) || (association && field.target && field.target !== collectionName && Array.isArray(association) ? association.includes(field.interface) : false));
153
+ })) === null || _fields$filter === void 0 ? void 0 : _fields$filter.map(function (field) {
154
+ var _field$uiSchema;
155
+
156
+ var result = {
157
+ value: field.name,
158
+ label: compile(field === null || field === void 0 ? void 0 : (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title) || field.name
159
+ };
160
+
161
+ if (association && field.target) {
162
+ var _result$children;
163
+
164
+ result.children = getCollectionFieldsOptions(field.target, type, opts);
165
+
166
+ if (!((_result$children = result.children) === null || _result$children === void 0 ? void 0 : _result$children.length)) {
167
+ return null;
168
+ }
169
+ }
170
+
171
+ return result;
172
+ }) // 过滤 map 产生为 null 的数据
173
+ .filter(Boolean);
174
+ return options;
175
+ };
176
+
133
177
  return {
134
178
  service: service,
135
179
  interfaces: interfaces,
@@ -147,6 +191,7 @@ export var useCollectionManager = function useCollectionManager() {
147
191
  getInheritedFields: getInheritedFields,
148
192
  getCollectionField: getCollectionField,
149
193
  getCollectionFields: getCollectionFields,
194
+ getCollectionFieldsOptions: getCollectionFieldsOptions,
150
195
  getCurrentCollectionFields: getCurrentCollectionFields,
151
196
  getCollection: function getCollection(name) {
152
197
  if (typeof name !== 'string') {
@@ -195,7 +195,7 @@ export var m2m = {
195
195
  'x-decorator': 'FormItem',
196
196
  'x-component': 'Input',
197
197
  'x-validator': 'uid',
198
- 'x-disabled': '{{ !createOnly }}'
198
+ 'x-disabled': '{{ !createOnly||override }}'
199
199
  }
200
200
  }
201
201
  },
@@ -228,7 +228,7 @@ export var m2m = {
228
228
  'x-decorator': 'FormItem',
229
229
  'x-component': 'Input',
230
230
  'x-validator': 'uid',
231
- 'x-disabled': '{{ !createOnly }}'
231
+ 'x-disabled': '{{ !createOnly||override }}'
232
232
  }
233
233
  }
234
234
  },
@@ -46,62 +46,6 @@ export declare const defaultProps: {
46
46
  'x-validator': string;
47
47
  description: string;
48
48
  };
49
- type: import("@formily/react").Stringify<{
50
- [key: symbol]: any;
51
- [key: `x-${string}`]: any;
52
- [key: `x-${number}`]: any;
53
- version?: string;
54
- name?: import("@formily/react").SchemaKey;
55
- title?: any;
56
- description?: any;
57
- default?: any;
58
- readOnly?: boolean;
59
- writeOnly?: boolean;
60
- type?: import("@formily/react").SchemaTypes;
61
- enum?: import("@formily/react").SchemaEnum<any>;
62
- const?: any;
63
- multipleOf?: number;
64
- maximum?: number;
65
- exclusiveMaximum?: number;
66
- minimum?: number;
67
- exclusiveMinimum?: number;
68
- maxLength?: number;
69
- minLength?: number;
70
- pattern?: string | RegExp;
71
- maxItems?: number;
72
- minItems?: number;
73
- uniqueItems?: boolean;
74
- maxProperties?: number;
75
- minProperties?: number;
76
- required?: string | boolean | string[];
77
- format?: string;
78
- $ref?: string;
79
- $namespace?: string;
80
- definitions?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
81
- properties?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
82
- items?: import("@formily/react").SchemaItems<any, any, any, any, any, any, any, any>;
83
- additionalItems?: import("@formily/react").Stringify<any>;
84
- patternProperties?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
85
- additionalProperties?: import("@formily/react").Stringify<any>;
86
- "x-value"?: any;
87
- "x-index"?: number;
88
- "x-pattern"?: any;
89
- "x-display"?: any;
90
- "x-validator"?: any;
91
- "x-decorator"?: any;
92
- "x-decorator-props"?: any;
93
- "x-component"?: any;
94
- "x-component-props"?: any;
95
- "x-reactions"?: import("@formily/react").SchemaReactions<any>;
96
- "x-content"?: any;
97
- "x-data"?: any;
98
- "x-visible"?: boolean;
99
- "x-hidden"?: boolean;
100
- "x-disabled"?: boolean;
101
- "x-editable"?: boolean;
102
- "x-read-only"?: boolean;
103
- "x-read-pretty"?: boolean;
104
- }>;
105
49
  };
106
50
  export declare const recordPickerSelector: ISchema;
107
51
  export declare const recordPickerViewer: {
@@ -370,8 +370,7 @@ export var defaultProps = {
370
370
  'x-component': 'Input',
371
371
  'x-validator': 'uid',
372
372
  description: "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"
373
- },
374
- type: type
373
+ }
375
374
  };
376
375
  export var recordPickerSelector = {
377
376
  type: 'void',
@@ -40,5 +40,5 @@ export var calendar = {
40
40
  availableFieldInterfaces: {
41
41
  include: []
42
42
  },
43
- configurableProperties: getConfigurableProperties('title', 'name', 'inherits')
43
+ configurableProperties: getConfigurableProperties('title', 'name', 'inherits', 'category')
44
44
  };
@@ -7,5 +7,5 @@ export var general = {
7
7
  default: {
8
8
  fields: []
9
9
  },
10
- configurableProperties: getConfigurableProperties('title', 'name', 'inherits', 'moreOptions')
10
+ configurableProperties: getConfigurableProperties('title', 'name', 'inherits', 'category', 'moreOptions')
11
11
  };
@@ -169,6 +169,17 @@ export declare const defaultConfigurableProperties: {
169
169
  'x-visible': string;
170
170
  'x-reactions': string[];
171
171
  };
172
+ category: {
173
+ title: string;
174
+ type: string;
175
+ name: string;
176
+ 'x-decorator': string;
177
+ 'x-component': string;
178
+ 'x-component-props': {
179
+ mode: string;
180
+ };
181
+ 'x-reactions': string[];
182
+ };
172
183
  };
173
- export declare type DefaultConfigurableKeys = 'name' | 'title' | 'inherits' | 'autoGenId' | 'createdBy' | 'updatedBy' | 'createdAt' | 'updatedAt' | 'sortable' | 'moreOptions';
184
+ export declare type DefaultConfigurableKeys = 'name' | 'title' | 'inherits' | 'category' | 'autoGenId' | 'createdBy' | 'updatedBy' | 'createdAt' | 'updatedAt' | 'sortable' | 'moreOptions';
174
185
  export declare const getConfigurableProperties: (...keys: DefaultConfigurableKeys[]) => {};
@@ -106,6 +106,17 @@ export var defaultConfigurableProperties = _objectSpread(_objectSpread({
106
106
  'x-disabled': '{{ !createOnly }}',
107
107
  'x-visible': '{{ enableInherits}}',
108
108
  'x-reactions': ['{{useAsyncDataSource(loadCollections)}}']
109
+ },
110
+ category: {
111
+ title: '{{t("Categories")}}',
112
+ type: 'hasMany',
113
+ name: 'category',
114
+ 'x-decorator': 'FormItem',
115
+ 'x-component': 'Select',
116
+ 'x-component-props': {
117
+ mode: 'multiple'
118
+ },
119
+ 'x-reactions': ['{{useAsyncDataSource(loadCategories)}}']
109
120
  }
110
121
  }, moreOptions), {}, {
111
122
  moreOptions: {
package/es/i18n/i18n.js CHANGED
@@ -23,7 +23,9 @@ i18n // .use(Backend)
23
23
  // return key;
24
24
  // },
25
25
  // ns: ['client'],
26
- resources: {}
26
+ resources: {},
27
+ keySeparator: false,
28
+ nsSeparator: false
27
29
  });
28
30
  i18n.on('languageChanged', function (lng) {
29
31
  localStorage.setItem('NOCOBASE_LOCALE', lng);
@@ -34,6 +34,29 @@ declare const _default: {
34
34
  "UI editor": string;
35
35
  Collection: string;
36
36
  "Collections & Fields": string;
37
+ "All collections": string;
38
+ "Add category": string;
39
+ "Delete category": string;
40
+ "Edit category": string;
41
+ "Collection category": string;
42
+ Sort: string;
43
+ Categories: string;
44
+ Visible: string;
45
+ "Read only": string;
46
+ "Easy reading": string;
47
+ Hidden: string;
48
+ "Hidden(reserved value)": string;
49
+ "Not required": string;
50
+ Value: string;
51
+ Disabled: string;
52
+ Enabled: string;
53
+ "Linkage rule": string;
54
+ "Linkage rules": string;
55
+ Condition: string;
56
+ Properties: string;
57
+ "Add linkage rule": string;
58
+ "Add property": string;
59
+ "Category name": string;
37
60
  "Roles & Permissions": string;
38
61
  "Edit profile": string;
39
62
  "Change password": string;
@@ -34,6 +34,29 @@ export default {
34
34
  "UI editor": "UI editor",
35
35
  "Collection": "Collection",
36
36
  "Collections & Fields": "Collections & Fields",
37
+ "All collections": "All collections",
38
+ "Add category": "Add category",
39
+ "Delete category": "Delete category",
40
+ "Edit category": "Edit category",
41
+ "Collection category": "Collection category",
42
+ "Sort": "Sort",
43
+ "Categories": "Categories",
44
+ "Visible": "Visible",
45
+ "Read only": "Read only",
46
+ "Easy reading": "Easy reading",
47
+ "Hidden": "Hidden",
48
+ "Hidden(reserved value)": "Hidden(reserved value)",
49
+ "Not required": "Not required",
50
+ "Value": "Value",
51
+ "Disabled": "Disabled",
52
+ "Enabled": "Enabled",
53
+ "Linkage rule": "Linkage rule",
54
+ "Linkage rules": "Linkage rules",
55
+ "Condition": "Condition",
56
+ "Properties": "Properties",
57
+ "Add linkage rule": "Add linkage rule",
58
+ "Add property": "Add property",
59
+ "Category name": "Category name",
37
60
  "Roles & Permissions": "Roles & Permissions",
38
61
  "Edit profile": "Edit profile",
39
62
  "Change password": "Change password",
@@ -34,6 +34,29 @@ declare const _default: {
34
34
  "UI editor": string;
35
35
  Collection: string;
36
36
  "Collections & Fields": string;
37
+ "All collections": string;
38
+ "Add category": string;
39
+ "Edit category": string;
40
+ Sort: string;
41
+ Categories: string;
42
+ "Category name": string;
43
+ "Delete category": string;
44
+ "Collection category": string;
45
+ Visible: string;
46
+ "Read only": string;
47
+ "Easy reading": string;
48
+ Hidden: string;
49
+ "Hidden(reserved value)": string;
50
+ "Not required": string;
51
+ Value: string;
52
+ Disabled: string;
53
+ Enabled: string;
54
+ "Linkage rule": string;
55
+ "Linkage rules": string;
56
+ Condition: string;
57
+ Properties: string;
58
+ "Add linkage rule": string;
59
+ "Add property": string;
37
60
  "Roles & Permissions": string;
38
61
  "Edit profile": string;
39
62
  "Change password": string;
@@ -34,6 +34,29 @@ export default {
34
34
  "UI editor": "UI エディタ",
35
35
  "Collection": "コレクション",
36
36
  "Collections & Fields": "コレクションとフィールド",
37
+ "All collections": "すべてのデータテーブル",
38
+ "Add category": "分類の追加",
39
+ "Edit category": "分類の編集",
40
+ "Sort": "ソート#ソート#",
41
+ "Categories": "データテーブルカテゴリ",
42
+ "Category name": "分類名",
43
+ "Delete category": "分類の削除",
44
+ "Collection category": "Collection category",
45
+ "Visible": "表示",
46
+ "Read only": "読み取り専用(編集不可)",
47
+ "Easy reading": "読み取り専用(読取りモード)",
48
+ "Hidden": "非表示",
49
+ "Hidden(reserved value)": "非表示(値の保持)",
50
+ "Not required": "必須ではありません",
51
+ "Value": "フィールド値",
52
+ "Disabled": "無効化",
53
+ "Enabled": "有効化",
54
+ "Linkage rule": "連動規則",
55
+ "Linkage rules": "連動規則",
56
+ "Condition": "条件#ジョウケン#",
57
+ "Properties": "属性#ゾクセイ#",
58
+ "Add linkage rule": "連動規則の追加",
59
+ "Add property": "属性の追加",
37
60
  "Roles & Permissions": "役割と権限",
38
61
  "Edit profile": "プロフィール",
39
62
  "Change password": "パスワード変更",
@@ -369,7 +392,7 @@ export default {
369
392
  "Role UID": "役割ID",
370
393
  "Precision": "精度",
371
394
  "Formula mode": "数式モード",
372
- "Expression": "表示",
395
+ "Expression": "表达式",
373
396
  "Input +, -, *, /, ( ) to calculate, input @ to open field variables.": "+、-、*、/、( ) で算術演算、@でフィールド変数を開くことができます。",
374
397
  "Formula error.": "式の検証エラーです。",
375
398
  "Accept": "ファイル形式",
@@ -107,6 +107,7 @@ declare const _default: {
107
107
  "Create collection": string;
108
108
  "Collection display name": string;
109
109
  "Collection name": string;
110
+ Categories: string;
110
111
  "Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.": string;
111
112
  "Storage type": string;
112
113
  Edit: string;
@@ -107,6 +107,7 @@ export default {
107
107
  "Create collection": "Создать Коллекцию",
108
108
  "Collection display name": "Отображение имени Коллекции",
109
109
  "Collection name": "Имя Коллекции",
110
+ "Categories": "Категории таблиц данных",
110
111
  "Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.": "Случайно сгенерированный и может быть изменен. Поддерживает буквы, цифры и подчеркивания, должно начинаться с буквы.",
111
112
  "Storage type": "Тип Хранилища",
112
113
  "Edit": "Изменить",
@@ -34,6 +34,30 @@ declare const _default: {
34
34
  "UI editor": string;
35
35
  Collection: string;
36
36
  "Collections & Fields": string;
37
+ "All collections": string;
38
+ "Add category": string;
39
+ "Delete category": string;
40
+ "Edit category": string;
41
+ "Collection category": string;
42
+ Visible: string;
43
+ "Read only": string;
44
+ "Easy reading": string;
45
+ Hidden: string;
46
+ "Hidden(reserved value)": string;
47
+ "Not required": string;
48
+ Value: string;
49
+ Disabled: string;
50
+ Enabled: string;
51
+ "Linkage rule": string;
52
+ "Linkage rules": string;
53
+ Condition: string;
54
+ Properties: string;
55
+ "Add linkage rule": string;
56
+ "Add property": string;
57
+ Expression: string;
58
+ Sort: string;
59
+ Categories: string;
60
+ "Category name": string;
37
61
  "Roles & Permissions": string;
38
62
  "Edit profile": string;
39
63
  "Change password": string;
@@ -127,6 +151,7 @@ declare const _default: {
127
151
  "General collection": string;
128
152
  "Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.": string;
129
153
  "Storage type": string;
154
+ "Types will be used in database": string;
130
155
  Edit: string;
131
156
  "Edit collection": string;
132
157
  "Configure fields": string;
@@ -146,15 +171,22 @@ declare const _default: {
146
171
  "Long text": string;
147
172
  Phone: string;
148
173
  Email: string;
174
+ Null: string;
175
+ Boolean: string;
149
176
  Number: string;
150
177
  Integer: string;
151
178
  Percent: string;
179
+ String: string;
152
180
  Password: string;
153
181
  "Advanced type": string;
154
182
  Formula: string;
155
183
  "Formula description": string;
184
+ "Syntax references": string;
185
+ "Math.js comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types": string;
186
+ "Formula.js supports most Microsoft Excel formula functions.": string;
156
187
  Choices: string;
157
188
  Checkbox: string;
189
+ "Display <icon></icon> when unchecked": string;
158
190
  "Single select": string;
159
191
  "Multiple select": string;
160
192
  "Radio group": string;
@@ -435,10 +467,6 @@ declare const _default: {
435
467
  '\u2264': string;
436
468
  'Role UID': string;
437
469
  Precision: string;
438
- 'Formula mode': string;
439
- Expression: string;
440
- 'Input +, -, *, /, ( ) to calculate, input @ to open field variables.': string;
441
- 'Formula error.': string;
442
470
  Accept: string;
443
471
  'Rich Text': string;
444
472
  'Junction collection': string;
@@ -593,5 +621,16 @@ declare const _default: {
593
621
  'Fix block': string;
594
622
  'Plugin name': string;
595
623
  'Plugin tab name': string;
624
+ 'Enable page header': string;
625
+ 'Display page title': string;
626
+ 'Edit page title': string;
627
+ 'Enable page tabs': string;
628
+ 'Column width': string;
629
+ Sortable: string;
630
+ Constant: string;
631
+ 'Use variable': string;
632
+ True: string;
633
+ False: string;
634
+ Prettify: string;
596
635
  };
597
636
  export default _default;
@@ -34,6 +34,30 @@ export default {
34
34
  "UI editor": "界面配置",
35
35
  "Collection": "数据表",
36
36
  "Collections & Fields": "数据表配置",
37
+ "All collections": "全部数据表",
38
+ "Add category": "添加分类",
39
+ "Delete category": "删除分类",
40
+ "Edit category": "编辑分类",
41
+ "Collection category": "数据表类别",
42
+ "Visible": "显示",
43
+ "Read only": "只读(禁止编辑)",
44
+ "Easy reading": "只读(阅读模式)",
45
+ "Hidden": "隐藏",
46
+ "Hidden(reserved value)": "隐藏(保留值)",
47
+ "Not required": "非必填",
48
+ "Value": "字段值",
49
+ "Disabled": "禁用",
50
+ "Enabled": "启用",
51
+ "Linkage rule": "联动规则",
52
+ "Linkage rules": "联动规则",
53
+ "Condition": "条件",
54
+ "Properties": "属性",
55
+ "Add linkage rule": "添加联动规则",
56
+ "Add property": "添加属性",
57
+ "Expression": "表达式",
58
+ "Sort": "排序",
59
+ "Categories": "数据表类别",
60
+ "Category name": "分类名称",
37
61
  "Roles & Permissions": "角色和权限",
38
62
  "Edit profile": "个人资料",
39
63
  "Change password": "修改密码",
@@ -127,6 +151,7 @@ export default {
127
151
  "General collection": "普通数据表",
128
152
  "Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.": "随机生成,可修改。支持英文、数字和下划线,必须以英文字母开头。",
129
153
  "Storage type": "存储类型",
154
+ "Types will be used in database": "数据库使用的类型",
130
155
  "Edit": "编辑",
131
156
  "Edit collection": "编辑数据表",
132
157
  "Configure fields": "配置字段",
@@ -146,15 +171,22 @@ export default {
146
171
  "Long text": "多行文本",
147
172
  "Phone": "手机号码",
148
173
  "Email": "电子邮箱",
174
+ 'Null': '空值',
175
+ "Boolean": "逻辑值",
149
176
  "Number": "数字",
150
177
  "Integer": "整数",
151
178
  "Percent": "百分比",
179
+ "String": "字符串",
152
180
  "Password": "密码",
153
181
  "Advanced type": "高级类型",
154
182
  "Formula": "公式",
155
183
  "Formula description": "基于同一条记录中的其他字段计算出一个值。",
184
+ "Syntax references": "语法参考",
185
+ "Math.js comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types": "Math.js 包含大量内置函数和常量,并提供了集成的解决方案来处理不同的数据类型。",
186
+ "Formula.js supports most Microsoft Excel formula functions.": "Formula.js 支持大部分 Mircrosoft Excel 公式。",
156
187
  "Choices": "选择类型",
157
188
  "Checkbox": "勾选",
189
+ "Display <icon></icon> when unchecked": "未勾选时显示 <icon></icon>",
158
190
  "Single select": "下拉菜单(单选)",
159
191
  "Multiple select": "下拉菜单(多选)",
160
192
  "Radio group": "单选框",
@@ -435,10 +467,6 @@ export default {
435
467
  '≤': '≤',
436
468
  'Role UID': '角色标识',
437
469
  'Precision': '精确度',
438
- 'Formula mode': '计算方式',
439
- 'Expression': '表达式',
440
- 'Input +, -, *, /, ( ) to calculate, input @ to open field variables.': '英文输入+、-、*、/、( ) 进行运算,输入@打开可用字段变量。',
441
- 'Formula error.': '公式验证错误。',
442
470
  'Accept': '文件格式',
443
471
  'Rich Text': '富文本',
444
472
  'Junction collection': '中间表',
@@ -593,5 +621,16 @@ export default {
593
621
  'Please fill in the iframe URL': '请填写嵌入的地址',
594
622
  'Fix block': '固定区块',
595
623
  'Plugin name': '插件',
596
- 'Plugin tab name': '插件标签页'
624
+ 'Plugin tab name': '插件标签页',
625
+ 'Enable page header': '启用页眉',
626
+ 'Display page title': '显示页面标题',
627
+ 'Edit page title': '编辑页面标题',
628
+ 'Enable page tabs': '启用页面选项卡',
629
+ 'Column width': '列宽',
630
+ 'Sortable': '可排序的',
631
+ 'Constant': '常量',
632
+ 'Use variable': '使用变量',
633
+ 'True': '真',
634
+ 'False': '假',
635
+ 'Prettify': '格式化'
597
636
  };