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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/es/acl/ACLProvider.js +7 -8
  2. package/es/api-client/APIClient.js +6 -0
  3. package/es/block-provider/BlockProvider.js +9 -6
  4. package/es/block-provider/FormBlockProvider.js +18 -9
  5. package/es/block-provider/KanbanBlockProvider.js +1 -1
  6. package/es/block-provider/SharedFilterProvider.js +9 -1
  7. package/es/block-provider/TableBlockProvider.js +1 -1
  8. package/es/block-provider/TableSelectorProvider.js +2 -2
  9. package/es/block-provider/hooks/index.js +22 -7
  10. package/es/collection-manager/CollectionManagerProvider.d.ts +1 -0
  11. package/es/collection-manager/CollectionManagerProvider.js +71 -9
  12. package/es/collection-manager/CollectionManagerShortcut.js +36 -23
  13. package/es/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  14. package/es/collection-manager/Configuration/AddCategoryAction.js +117 -0
  15. package/es/collection-manager/Configuration/AddCollectionAction.js +8 -3
  16. package/es/collection-manager/Configuration/AddFieldAction.js +1 -0
  17. package/es/collection-manager/Configuration/ConfigurationTable.js +33 -4
  18. package/es/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  19. package/es/collection-manager/Configuration/ConfigurationTabs.js +381 -0
  20. package/es/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  21. package/es/collection-manager/Configuration/EditCategoryAction.js +150 -0
  22. package/es/collection-manager/Configuration/EditCollectionAction.js +6 -2
  23. package/es/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  24. package/es/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  25. package/es/collection-manager/Configuration/components/CollectionCategory.js +13 -0
  26. package/es/collection-manager/Configuration/index.d.ts +3 -0
  27. package/es/collection-manager/Configuration/index.js +3 -0
  28. package/es/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  29. package/es/collection-manager/Configuration/schemas/collections.js +309 -176
  30. package/es/collection-manager/Configuration/templates.d.ts +1 -0
  31. package/es/collection-manager/Configuration/templates.js +1 -1
  32. package/es/collection-manager/action-hooks.d.ts +4 -0
  33. package/es/collection-manager/action-hooks.js +26 -12
  34. package/es/collection-manager/context.d.ts +4 -0
  35. package/es/collection-manager/context.js +5 -1
  36. package/es/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  37. package/es/collection-manager/hooks/useCollectionManager.js +52 -7
  38. package/es/collection-manager/interfaces/m2m.js +2 -2
  39. package/es/collection-manager/interfaces/properties/index.d.ts +0 -56
  40. package/es/collection-manager/interfaces/properties/index.js +1 -2
  41. package/es/collection-manager/templates/calendar.js +1 -1
  42. package/es/collection-manager/templates/general.js +1 -1
  43. package/es/collection-manager/templates/properties/index.d.ts +12 -1
  44. package/es/collection-manager/templates/properties/index.js +11 -0
  45. package/es/i18n/i18n.js +3 -1
  46. package/es/locale/en_US.d.ts +23 -0
  47. package/es/locale/en_US.js +23 -0
  48. package/es/locale/ja_JP.d.ts +23 -0
  49. package/es/locale/ja_JP.js +24 -1
  50. package/es/locale/ru_RU.d.ts +1 -0
  51. package/es/locale/ru_RU.js +1 -0
  52. package/es/locale/zh_CN.d.ts +43 -4
  53. package/es/locale/zh_CN.js +44 -5
  54. package/es/route-switch/antd/admin-layout/index.js +13 -33
  55. package/es/schema-component/antd/action/Action.Designer.js +28 -15
  56. package/es/schema-component/antd/action/Action.js +28 -5
  57. package/es/schema-component/antd/action/utils.d.ts +1 -0
  58. package/es/schema-component/antd/action/utils.js +49 -0
  59. package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -4
  60. package/es/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  61. package/es/schema-component/antd/association-select/useServiceOptions.js +47 -6
  62. package/es/schema-component/antd/calendar/Calendar.Designer.js +17 -36
  63. package/es/schema-component/antd/checkbox/Checkbox.js +9 -8
  64. package/es/schema-component/antd/date-picker/util.d.ts +1 -1
  65. package/es/schema-component/antd/date-picker/util.js +1 -1
  66. package/es/schema-component/antd/filter/DynamicComponent.js +3 -1
  67. package/es/schema-component/antd/filter/Filter.js +2 -1
  68. package/es/schema-component/antd/filter/FilterGroup.js +7 -4
  69. package/es/schema-component/antd/filter/FilterItem.js +3 -2
  70. package/es/schema-component/antd/filter/context.d.ts +1 -0
  71. package/es/schema-component/antd/filter/useValues.js +14 -11
  72. package/es/schema-component/antd/form/Form.js +11 -5
  73. package/es/schema-component/antd/form-item/FormItem.js +17 -8
  74. package/es/schema-component/antd/form-v2/Form.Designer.js +2 -0
  75. package/es/schema-component/antd/form-v2/Form.js +94 -7
  76. package/es/schema-component/antd/form-v2/utils.d.ts +5 -0
  77. package/es/schema-component/antd/form-v2/utils.js +161 -0
  78. package/es/schema-component/antd/g2plot/G2Plot.js +3 -1
  79. package/es/schema-component/antd/grid/Grid.js +10 -5
  80. package/es/schema-component/antd/icon-picker/IconPicker.js +1 -0
  81. package/es/schema-component/antd/index.d.ts +1 -0
  82. package/es/schema-component/antd/index.js +1 -0
  83. package/es/schema-component/antd/input/Input.d.ts +2 -1
  84. package/es/schema-component/antd/input/Json.d.ts +5 -3
  85. package/es/schema-component/antd/input/Json.js +3 -2
  86. package/es/schema-component/antd/input/ReadPretty.js +1 -1
  87. package/es/schema-component/antd/input-number/InputNumber.js +3 -1
  88. package/es/schema-component/antd/page/FixedBlock.js +3 -1
  89. package/es/schema-component/antd/page/Page.js +11 -5
  90. package/es/schema-component/antd/page/PageTabDesigner.js +3 -3
  91. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  92. package/es/schema-component/antd/record-picker/RecordPicker.js +1 -2
  93. package/es/schema-component/antd/record-picker/util.js +7 -0
  94. package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  95. package/es/schema-component/antd/remote-select/RemoteSelect.js +78 -36
  96. package/es/schema-component/antd/rich-text/RichText.js +4 -2
  97. package/es/schema-component/antd/select/Select.js +14 -4
  98. package/es/schema-component/antd/table/Table.Array.js +10 -3
  99. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  100. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  101. package/es/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  102. package/es/schema-component/antd/tabs/Tabs.js +1 -0
  103. package/es/schema-component/antd/time-picker/TimePicker.js +1 -1
  104. package/es/schema-component/antd/variable/Input.d.ts +2 -0
  105. package/es/schema-component/antd/variable/Input.js +244 -0
  106. package/es/schema-component/antd/variable/JSONInput.d.ts +2 -0
  107. package/es/schema-component/antd/variable/JSONInput.js +82 -0
  108. package/es/schema-component/antd/variable/TextArea.d.ts +2 -0
  109. package/es/schema-component/antd/variable/TextArea.js +322 -0
  110. package/es/schema-component/antd/variable/Variable.d.ts +8 -0
  111. package/es/schema-component/antd/variable/Variable.js +11 -0
  112. package/es/schema-component/antd/variable/index.d.ts +1 -0
  113. package/es/schema-component/antd/variable/index.js +1 -0
  114. package/es/schema-component/common/sortable-item/SortableItem.js +36 -6
  115. package/es/schema-component/common/utils/logic.js +523 -0
  116. package/es/schema-component/common/utils/uitls.d.ts +1 -0
  117. package/es/schema-component/common/utils/uitls.js +89 -0
  118. package/es/schema-initializer/SchemaInitializer.js +9 -4
  119. package/es/schema-initializer/buttons/BlockInitializers.d.ts +2 -184
  120. package/es/schema-initializer/buttons/BlockInitializers.js +1 -102
  121. package/es/schema-initializer/buttons/RecordBlockInitializers.js +72 -16
  122. package/es/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  123. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -3
  124. package/es/schema-initializer/components/CreateRecordAction.d.ts +3 -0
  125. package/es/schema-initializer/components/CreateRecordAction.js +174 -0
  126. package/es/schema-initializer/components/index.d.ts +1 -0
  127. package/es/schema-initializer/components/index.js +2 -1
  128. package/es/schema-initializer/index.d.ts +2 -1
  129. package/es/schema-initializer/index.js +2 -1
  130. package/es/schema-initializer/items/CalendarBlockInitializer.js +24 -41
  131. package/es/schema-initializer/items/CreateActionInitializer.js +3 -3
  132. package/es/schema-initializer/items/RecordFormBlockInitializer.js +9 -9
  133. package/es/schema-initializer/items/index.d.ts +4 -4
  134. package/es/schema-initializer/items/index.js +6 -6
  135. package/es/schema-initializer/utils.js +22 -7
  136. package/es/schema-settings/EnableChildCollections/index.d.ts +2 -0
  137. package/es/schema-settings/EnableChildCollections/index.js +141 -0
  138. package/es/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  139. package/es/schema-settings/LinkageRules/DynamicComponent.js +113 -0
  140. package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  141. package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +15 -0
  142. package/es/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  143. package/es/schema-settings/LinkageRules/LinkageRuleAction.js +162 -0
  144. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  145. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.js +71 -0
  146. package/es/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  147. package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +82 -0
  148. package/es/schema-settings/LinkageRules/Variables.d.ts +7 -0
  149. package/es/schema-settings/LinkageRules/Variables.js +115 -0
  150. package/es/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  151. package/es/schema-settings/LinkageRules/action-hooks.js +115 -0
  152. package/es/schema-settings/LinkageRules/context.d.ts +13 -0
  153. package/es/schema-settings/LinkageRules/context.js +4 -0
  154. package/es/schema-settings/LinkageRules/index.d.ts +2 -0
  155. package/es/schema-settings/LinkageRules/index.js +132 -0
  156. package/es/schema-settings/LinkageRules/type.d.ts +13 -0
  157. package/es/schema-settings/LinkageRules/type.js +15 -0
  158. package/es/schema-settings/LinkageRules/useValues.d.ts +1 -0
  159. package/es/schema-settings/LinkageRules/useValues.js +84 -0
  160. package/es/schema-settings/SchemaSettings.d.ts +4 -1
  161. package/es/schema-settings/SchemaSettings.js +219 -26
  162. package/es/schema-templates/BlockTemplate.js +9 -1
  163. package/es/system-settings/SystemSettingsShortcut.js +1 -1
  164. package/lib/acl/ACLProvider.js +7 -8
  165. package/lib/api-client/APIClient.js +6 -0
  166. package/lib/block-provider/BlockProvider.js +9 -6
  167. package/lib/block-provider/FormBlockProvider.js +17 -8
  168. package/lib/block-provider/KanbanBlockProvider.js +1 -1
  169. package/lib/block-provider/SharedFilterProvider.js +9 -3
  170. package/lib/block-provider/TableBlockProvider.js +1 -1
  171. package/lib/block-provider/TableSelectorProvider.js +2 -2
  172. package/lib/block-provider/hooks/index.js +23 -7
  173. package/lib/collection-manager/CollectionManagerProvider.d.ts +1 -0
  174. package/lib/collection-manager/CollectionManagerProvider.js +81 -16
  175. package/lib/collection-manager/CollectionManagerShortcut.js +36 -23
  176. package/lib/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  177. package/lib/collection-manager/Configuration/AddCategoryAction.js +145 -0
  178. package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -3
  179. package/lib/collection-manager/Configuration/AddFieldAction.js +1 -0
  180. package/lib/collection-manager/Configuration/ConfigurationTable.js +34 -4
  181. package/lib/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  182. package/lib/collection-manager/Configuration/ConfigurationTabs.js +407 -0
  183. package/lib/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  184. package/lib/collection-manager/Configuration/EditCategoryAction.js +178 -0
  185. package/lib/collection-manager/Configuration/EditCollectionAction.js +6 -2
  186. package/lib/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  187. package/lib/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  188. package/lib/collection-manager/Configuration/components/CollectionCategory.js +27 -0
  189. package/lib/collection-manager/Configuration/index.d.ts +3 -0
  190. package/lib/collection-manager/Configuration/index.js +39 -0
  191. package/lib/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  192. package/lib/collection-manager/Configuration/schemas/collections.js +316 -178
  193. package/lib/collection-manager/Configuration/templates.d.ts +1 -0
  194. package/lib/collection-manager/Configuration/templates.js +2 -0
  195. package/lib/collection-manager/action-hooks.d.ts +4 -0
  196. package/lib/collection-manager/action-hooks.js +30 -13
  197. package/lib/collection-manager/context.d.ts +4 -0
  198. package/lib/collection-manager/context.js +7 -2
  199. package/lib/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  200. package/lib/collection-manager/hooks/useCollectionManager.js +52 -6
  201. package/lib/collection-manager/interfaces/m2m.js +2 -2
  202. package/lib/collection-manager/interfaces/properties/index.d.ts +0 -56
  203. package/lib/collection-manager/interfaces/properties/index.js +1 -2
  204. package/lib/collection-manager/templates/calendar.js +1 -1
  205. package/lib/collection-manager/templates/general.js +1 -1
  206. package/lib/collection-manager/templates/properties/index.d.ts +12 -1
  207. package/lib/collection-manager/templates/properties/index.js +11 -0
  208. package/lib/i18n/i18n.js +3 -1
  209. package/lib/locale/en_US.d.ts +23 -0
  210. package/lib/locale/en_US.js +23 -0
  211. package/lib/locale/ja_JP.d.ts +23 -0
  212. package/lib/locale/ja_JP.js +24 -1
  213. package/lib/locale/ru_RU.d.ts +1 -0
  214. package/lib/locale/ru_RU.js +1 -0
  215. package/lib/locale/zh_CN.d.ts +43 -4
  216. package/lib/locale/zh_CN.js +44 -5
  217. package/lib/route-switch/antd/admin-layout/index.js +13 -33
  218. package/lib/schema-component/antd/action/Action.Designer.js +30 -14
  219. package/lib/schema-component/antd/action/Action.js +29 -3
  220. package/lib/schema-component/antd/action/utils.d.ts +1 -0
  221. package/lib/schema-component/antd/action/utils.js +58 -2
  222. package/lib/schema-component/antd/association-filter/AssociationFilter.js +3 -3
  223. package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  224. package/lib/schema-component/antd/association-select/useServiceOptions.js +47 -4
  225. package/lib/schema-component/antd/calendar/Calendar.Designer.js +15 -33
  226. package/lib/schema-component/antd/checkbox/Checkbox.js +8 -7
  227. package/lib/schema-component/antd/date-picker/util.d.ts +1 -1
  228. package/lib/schema-component/antd/date-picker/util.js +1 -1
  229. package/lib/schema-component/antd/filter/DynamicComponent.js +3 -1
  230. package/lib/schema-component/antd/filter/Filter.js +2 -1
  231. package/lib/schema-component/antd/filter/FilterGroup.js +7 -4
  232. package/lib/schema-component/antd/filter/FilterItem.js +3 -2
  233. package/lib/schema-component/antd/filter/context.d.ts +1 -0
  234. package/lib/schema-component/antd/filter/useValues.js +15 -11
  235. package/lib/schema-component/antd/form/Form.js +9 -3
  236. package/lib/schema-component/antd/form-item/FormItem.js +21 -7
  237. package/lib/schema-component/antd/form-v2/Form.Designer.js +2 -0
  238. package/lib/schema-component/antd/form-v2/Form.js +93 -5
  239. package/lib/schema-component/antd/form-v2/utils.d.ts +5 -0
  240. package/lib/schema-component/antd/form-v2/utils.js +181 -0
  241. package/lib/schema-component/antd/g2plot/G2Plot.js +3 -1
  242. package/lib/schema-component/antd/grid/Grid.js +10 -5
  243. package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -0
  244. package/lib/schema-component/antd/index.d.ts +1 -0
  245. package/lib/schema-component/antd/index.js +13 -0
  246. package/lib/schema-component/antd/input/Input.d.ts +2 -1
  247. package/lib/schema-component/antd/input/Json.d.ts +5 -3
  248. package/lib/schema-component/antd/input/Json.js +6 -3
  249. package/lib/schema-component/antd/input/ReadPretty.js +1 -1
  250. package/lib/schema-component/antd/input-number/InputNumber.js +2 -0
  251. package/lib/schema-component/antd/page/FixedBlock.js +3 -1
  252. package/lib/schema-component/antd/page/Page.js +14 -5
  253. package/lib/schema-component/antd/page/PageTabDesigner.js +1 -1
  254. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  255. package/lib/schema-component/antd/record-picker/RecordPicker.js +1 -2
  256. package/lib/schema-component/antd/record-picker/util.js +7 -0
  257. package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  258. package/lib/schema-component/antd/remote-select/RemoteSelect.js +78 -37
  259. package/lib/schema-component/antd/rich-text/RichText.js +4 -2
  260. package/lib/schema-component/antd/select/Select.js +14 -4
  261. package/lib/schema-component/antd/table/Table.Array.js +8 -1
  262. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  263. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  264. package/lib/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  265. package/lib/schema-component/antd/tabs/Tabs.js +1 -0
  266. package/lib/schema-component/antd/time-picker/TimePicker.js +1 -1
  267. package/lib/schema-component/antd/variable/Input.d.ts +2 -0
  268. package/lib/schema-component/antd/variable/Input.js +262 -0
  269. package/lib/schema-component/antd/variable/JSONInput.d.ts +2 -0
  270. package/lib/schema-component/antd/variable/JSONInput.js +100 -0
  271. package/lib/schema-component/antd/variable/TextArea.d.ts +2 -0
  272. package/lib/schema-component/antd/variable/TextArea.js +341 -0
  273. package/lib/schema-component/antd/variable/Variable.d.ts +8 -0
  274. package/lib/schema-component/antd/variable/Variable.js +25 -0
  275. package/lib/schema-component/antd/variable/index.d.ts +1 -0
  276. package/lib/schema-component/antd/variable/index.js +18 -0
  277. package/lib/schema-component/common/sortable-item/SortableItem.js +36 -6
  278. package/lib/schema-component/common/utils/logic.js +525 -0
  279. package/lib/schema-component/common/utils/uitls.d.ts +1 -0
  280. package/lib/schema-component/common/utils/uitls.js +103 -0
  281. package/lib/schema-initializer/SchemaInitializer.js +9 -4
  282. package/lib/schema-initializer/buttons/BlockInitializers.d.ts +2 -184
  283. package/lib/schema-initializer/buttons/BlockInitializers.js +0 -108
  284. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +72 -16
  285. package/lib/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  286. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +3 -1
  287. package/lib/schema-initializer/components/CreateRecordAction.d.ts +3 -0
  288. package/lib/schema-initializer/components/CreateRecordAction.js +199 -0
  289. package/lib/schema-initializer/components/index.d.ts +1 -0
  290. package/lib/schema-initializer/components/index.js +13 -0
  291. package/lib/schema-initializer/index.d.ts +2 -1
  292. package/lib/schema-initializer/index.js +51 -2
  293. package/lib/schema-initializer/items/CalendarBlockInitializer.js +16 -33
  294. package/lib/schema-initializer/items/CreateActionInitializer.js +3 -3
  295. package/lib/schema-initializer/items/RecordFormBlockInitializer.js +3 -3
  296. package/lib/schema-initializer/items/index.d.ts +4 -4
  297. package/lib/schema-initializer/items/index.js +52 -52
  298. package/lib/schema-initializer/utils.js +22 -6
  299. package/lib/schema-settings/EnableChildCollections/index.d.ts +2 -0
  300. package/lib/schema-settings/EnableChildCollections/index.js +156 -0
  301. package/lib/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  302. package/lib/schema-settings/LinkageRules/DynamicComponent.js +139 -0
  303. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  304. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +27 -0
  305. package/lib/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  306. package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +190 -0
  307. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  308. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.js +90 -0
  309. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  310. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +104 -0
  311. package/lib/schema-settings/LinkageRules/Variables.d.ts +7 -0
  312. package/lib/schema-settings/LinkageRules/Variables.js +124 -0
  313. package/lib/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  314. package/lib/schema-settings/LinkageRules/action-hooks.js +127 -0
  315. package/lib/schema-settings/LinkageRules/context.d.ts +13 -0
  316. package/lib/schema-settings/LinkageRules/context.js +15 -0
  317. package/lib/schema-settings/LinkageRules/index.d.ts +2 -0
  318. package/lib/schema-settings/LinkageRules/index.js +149 -0
  319. package/lib/schema-settings/LinkageRules/type.d.ts +13 -0
  320. package/lib/schema-settings/LinkageRules/type.js +22 -0
  321. package/lib/schema-settings/LinkageRules/useValues.d.ts +1 -0
  322. package/lib/schema-settings/LinkageRules/useValues.js +95 -0
  323. package/lib/schema-settings/SchemaSettings.d.ts +4 -1
  324. package/lib/schema-settings/SchemaSettings.js +243 -48
  325. package/lib/schema-templates/BlockTemplate.js +9 -1
  326. package/lib/system-settings/SystemSettingsShortcut.js +1 -1
  327. package/package.json +4 -4
@@ -40,6 +40,30 @@ var _default = {
40
40
  "UI editor": "界面配置",
41
41
  "Collection": "数据表",
42
42
  "Collections & Fields": "数据表配置",
43
+ "All collections": "全部数据表",
44
+ "Add category": "添加分类",
45
+ "Delete category": "删除分类",
46
+ "Edit category": "编辑分类",
47
+ "Collection category": "数据表类别",
48
+ "Visible": "显示",
49
+ "Read only": "只读(禁止编辑)",
50
+ "Easy reading": "只读(阅读模式)",
51
+ "Hidden": "隐藏",
52
+ "Hidden(reserved value)": "隐藏(保留值)",
53
+ "Not required": "非必填",
54
+ "Value": "字段值",
55
+ "Disabled": "禁用",
56
+ "Enabled": "启用",
57
+ "Linkage rule": "联动规则",
58
+ "Linkage rules": "联动规则",
59
+ "Condition": "条件",
60
+ "Properties": "属性",
61
+ "Add linkage rule": "添加联动规则",
62
+ "Add property": "添加属性",
63
+ "Expression": "表达式",
64
+ "Sort": "排序",
65
+ "Categories": "数据表类别",
66
+ "Category name": "分类名称",
43
67
  "Roles & Permissions": "角色和权限",
44
68
  "Edit profile": "个人资料",
45
69
  "Change password": "修改密码",
@@ -133,6 +157,7 @@ var _default = {
133
157
  "General collection": "普通数据表",
134
158
  "Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.": "随机生成,可修改。支持英文、数字和下划线,必须以英文字母开头。",
135
159
  "Storage type": "存储类型",
160
+ "Types will be used in database": "数据库使用的类型",
136
161
  "Edit": "编辑",
137
162
  "Edit collection": "编辑数据表",
138
163
  "Configure fields": "配置字段",
@@ -152,15 +177,22 @@ var _default = {
152
177
  "Long text": "多行文本",
153
178
  "Phone": "手机号码",
154
179
  "Email": "电子邮箱",
180
+ 'Null': '空值',
181
+ "Boolean": "逻辑值",
155
182
  "Number": "数字",
156
183
  "Integer": "整数",
157
184
  "Percent": "百分比",
185
+ "String": "字符串",
158
186
  "Password": "密码",
159
187
  "Advanced type": "高级类型",
160
188
  "Formula": "公式",
161
189
  "Formula description": "基于同一条记录中的其他字段计算出一个值。",
190
+ "Syntax references": "语法参考",
191
+ "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 包含大量内置函数和常量,并提供了集成的解决方案来处理不同的数据类型。",
192
+ "Formula.js supports most Microsoft Excel formula functions.": "Formula.js 支持大部分 Mircrosoft Excel 公式。",
162
193
  "Choices": "选择类型",
163
194
  "Checkbox": "勾选",
195
+ "Display <icon></icon> when unchecked": "未勾选时显示 <icon></icon>",
164
196
  "Single select": "下拉菜单(单选)",
165
197
  "Multiple select": "下拉菜单(多选)",
166
198
  "Radio group": "单选框",
@@ -441,10 +473,6 @@ var _default = {
441
473
  '≤': '≤',
442
474
  'Role UID': '角色标识',
443
475
  'Precision': '精确度',
444
- 'Formula mode': '计算方式',
445
- 'Expression': '表达式',
446
- 'Input +, -, *, /, ( ) to calculate, input @ to open field variables.': '英文输入+、-、*、/、( ) 进行运算,输入@打开可用字段变量。',
447
- 'Formula error.': '公式验证错误。',
448
476
  'Accept': '文件格式',
449
477
  'Rich Text': '富文本',
450
478
  'Junction collection': '中间表',
@@ -599,6 +627,17 @@ var _default = {
599
627
  'Please fill in the iframe URL': '请填写嵌入的地址',
600
628
  'Fix block': '固定区块',
601
629
  'Plugin name': '插件',
602
- 'Plugin tab name': '插件标签页'
630
+ 'Plugin tab name': '插件标签页',
631
+ 'Enable page header': '启用页眉',
632
+ 'Display page title': '显示页面标题',
633
+ 'Edit page title': '编辑页面标题',
634
+ 'Enable page tabs': '启用页面选项卡',
635
+ 'Column width': '列宽',
636
+ 'Sortable': '可排序的',
637
+ 'Constant': '常量',
638
+ 'Use variable': '使用变量',
639
+ 'True': '真',
640
+ 'False': '假',
641
+ 'Prettify': '格式化'
603
642
  };
604
643
  exports.default = _default;
@@ -9,6 +9,8 @@ exports.default = exports.InternalAdminLayout = exports.AdminLayout = void 0;
9
9
 
10
10
  var _css = require("@emotion/css");
11
11
 
12
+ var _ahooks = require("ahooks");
13
+
12
14
  var _antd = require("antd");
13
15
 
14
16
  var _react = _interopRequireWildcard(require("react"));
@@ -19,9 +21,7 @@ var _ = require("../../../");
19
21
 
20
22
  var _collectionManager = require("../../../collection-manager");
21
23
 
22
- var _ahooks = require("ahooks");
23
-
24
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
24
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
25
25
 
26
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
27
 
@@ -202,56 +202,36 @@ var InternalAdminLayout = function InternalAdminLayout(props) {
202
202
  return /*#__PURE__*/_react.default.createElement(_antd.Layout, null, /*#__PURE__*/_react.default.createElement(_antd.Layout.Header, {
203
203
  className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-menu.ant-menu-dark .ant-menu-item-selected,\n .ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected {\n background-color: rgba(255, 255, 255, 0.1);\n }\n .ant-menu-dark.ant-menu-horizontal > .ant-menu-item:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n position: fixed;\n width: 100%;\n height: 46px;\n line-height: 46px;\n padding: 0;\n z-index: 100;\n "])))
204
204
  }, /*#__PURE__*/_react.default.createElement("div", {
205
- className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 100%;\n "])))
205
+ className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n "])))
206
206
  }, /*#__PURE__*/_react.default.createElement("div", {
207
- style: {
208
- position: 'relative',
209
- zIndex: 1,
210
- display: 'flex',
211
- height: '100%',
212
- width: 'calc(100vw - 300px)'
213
- }
207
+ className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n flex: 1 1 auto;\n display: flex;\n height: 100%;\n "])))
214
208
  }, /*#__PURE__*/_react.default.createElement("div", {
215
- style: {
216
- width: 200,
217
- display: 'inline-flex',
218
- color: '#fff',
219
- padding: '0',
220
- alignItems: 'center'
221
- }
209
+ className: (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 200px;\n display: inline-flex;\n flex-shrink: 0;\n color: #fff;\n padding: 0;\n align-items: center;\n "])))
222
210
  }, /*#__PURE__*/_react.default.createElement("img", {
223
- className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 0 16px;\n object-fit: contain;\n width: 100%;\n height: 100%;\n "]))),
211
+ className: (0, _css.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 0 16px;\n object-fit: contain;\n width: 100%;\n height: 100%;\n "]))),
224
212
  src: result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : (_result$data$data = _result$data.data) === null || _result$data$data === void 0 ? void 0 : (_result$data$data$log = _result$data$data.logo) === null || _result$data$data$log === void 0 ? void 0 : _result$data$data$log.url
225
213
  })), /*#__PURE__*/_react.default.createElement("div", {
226
- style: {
227
- width: 'calc(100% - 590px)'
228
- }
214
+ className: (0, _css.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n width: 0;\n "])))
229
215
  }, /*#__PURE__*/_react.default.createElement(MenuEditor, {
230
216
  sideMenuRef: sideMenuRef
231
217
  }))), /*#__PURE__*/_react.default.createElement("div", {
232
- style: {
233
- position: 'absolute',
234
- height: '100%',
235
- zIndex: 10,
236
- top: 0,
237
- right: 0
238
- }
218
+ className: (0, _css.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n flex-shrink: 0;\n height: 100%;\n z-index: 10;\n "])))
239
219
  }, /*#__PURE__*/_react.default.createElement(_.RemotePluginManagerToolbar, null), /*#__PURE__*/_react.default.createElement(_.CurrentUser, null)))), /*#__PURE__*/_react.default.createElement("div", {
240
220
  style: {
241
221
  '--side-menu-width': "".concat(sideMenuWidth, "px")
242
222
  },
243
- className: (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: var(--side-menu-width);\n overflow: hidden;\n flex: 0 0 var(--side-menu-width);\n max-width: var(--side-menu-width);\n min-width: var(--side-menu-width);\n pointer-events: none;\n transition: background-color 0.3s ease 0s, min-width 0.3s ease 0s,\n max-width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;\n "])))
223
+ className: (0, _css.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: var(--side-menu-width);\n overflow: hidden;\n flex: 0 0 var(--side-menu-width);\n max-width: var(--side-menu-width);\n min-width: var(--side-menu-width);\n pointer-events: none;\n /* transition: background-color 0.3s ease 0s, min-width 0.3s ease 0s,\n max-width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1) 0s; */\n "])))
244
224
  }), /*#__PURE__*/_react.default.createElement(_antd.Layout.Sider, {
245
- className: (0, _css.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n height: 100%;\n position: fixed;\n padding-top: 46px;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0);\n z-index: 100;\n "]))),
225
+ className: (0, _css.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n height: 100%;\n position: fixed;\n padding-top: 46px;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0);\n z-index: 100;\n "]))),
246
226
  style: {
247
227
  display: 'none'
248
228
  },
249
229
  theme: 'light',
250
230
  ref: sideMenuRef
251
231
  }), /*#__PURE__*/_react.default.createElement(_antd.Layout.Content, {
252
- className: (0, _css.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: auto;\n height: 100vh;\n max-height: 100vh;\n > div {\n position: relative;\n // z-index: 1;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 0px 50px;\n }\n "])))
232
+ className: (0, _css.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: auto;\n height: 100vh;\n max-height: 100vh;\n > div {\n position: relative;\n // z-index: 1;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 0px 50px;\n }\n "])))
253
233
  }, /*#__PURE__*/_react.default.createElement("header", {
254
- className: (0, _css.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n height: 46px;\n line-height: 46px;\n background: transparent;\n pointer-events: none;\n "])))
234
+ className: (0, _css.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n height: 46px;\n line-height: 46px;\n background: transparent;\n pointer-events: none;\n "])))
255
235
  }), service.contentLoading ? /*#__PURE__*/_react.default.createElement(_antd.Spin, null) : props.children));
256
236
  };
257
237
 
@@ -21,6 +21,12 @@ var _ = require("../..");
21
21
 
22
22
  var _schemaSettings = require("../../../schema-settings");
23
23
 
24
+ var _collectionManager = require("../../../collection-manager");
25
+
26
+ var _recordProvider = require("../../../record-provider");
27
+
28
+ var _FormBlockProvider = require("../../../block-provider/FormBlockProvider");
29
+
24
30
  var _utils = require("./utils");
25
31
 
26
32
  var _excluded = ["modalTip"];
@@ -76,7 +82,7 @@ var MenuGroup = function MenuGroup(props) {
76
82
  };
77
83
 
78
84
  var ActionDesigner = function ActionDesigner(props) {
79
- var _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3, _fieldSchema$xCompon4, _fieldSchema$xCompon5, _fieldSchema$xCompon6, _fieldSchema$xCompon7, _fieldSchema$xCompon8, _fieldSchema$xAction, _fieldSchema$xAction2, _fieldSchema$xAction3, _fieldSchema$xAction4, _fieldSchema$xAction5, _fieldSchema$xAction6, _fieldSchema$xAction7, _fieldSchema$xAction8, _fieldSchema$xAction9, _fieldSchema$xAction10;
85
+ var _fieldSchema$xAction, _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3, _fieldSchema$xCompon4, _fieldSchema$xCompon5, _fieldSchema$xCompon6, _fieldSchema$xCompon7, _fieldSchema$xCompon8, _fieldSchema$xAction2, _fieldSchema$xAction3, _fieldSchema$xAction4, _fieldSchema$xAction5, _fieldSchema$xAction6, _fieldSchema$xAction7, _fieldSchema$xAction8, _fieldSchema$xAction9, _fieldSchema$xAction10, _fieldSchema$xAction11;
80
86
 
81
87
  var modalTip = props.modalTip,
82
88
  restProps = _objectWithoutProperties(props, _excluded);
@@ -84,23 +90,29 @@ var ActionDesigner = function ActionDesigner(props) {
84
90
  var field = (0, _react.useField)();
85
91
  var fieldSchema = (0, _react.useFieldSchema)();
86
92
 
93
+ var _useCollection = (0, _collectionManager.useCollection)(),
94
+ name = _useCollection.name;
95
+
96
+ var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
97
+ getChildrenCollections = _useCollectionManager.getChildrenCollections;
98
+
87
99
  var _useDesignable = (0, _.useDesignable)(),
88
100
  dn = _useDesignable.dn;
89
101
 
90
102
  var _useTranslation2 = (0, _reactI18next.useTranslation)(),
91
103
  t = _useTranslation2.t;
92
104
 
93
- var compile = (0, _.useCompile)();
94
105
  var isPopupAction = ['create', 'update', 'view', 'customize:popup'].includes(fieldSchema['x-action'] || '');
95
106
  var isUpdateModePopupAction = ['customize:bulkUpdate', 'customize:bulkEdit'].includes(fieldSchema['x-action']);
96
- var context = (0, _.useActionContext)();
97
107
 
98
108
  var _useState = (0, _react2.useState)(),
99
109
  _useState2 = _slicedToArray(_useState, 2),
100
110
  initialSchema = _useState2[0],
101
111
  setInitialSchema = _useState2[1];
102
112
 
103
- var actionType = fieldSchema['x-action'] || '';
113
+ var actionType = (_fieldSchema$xAction = fieldSchema['x-action']) !== null && _fieldSchema$xAction !== void 0 ? _fieldSchema$xAction : '';
114
+ var isLinkageAction = Object.keys((0, _FormBlockProvider.useFormBlockContext)()).length > 0 && Object.keys((0, _recordProvider.useRecord)()).length > 0;
115
+ var isChildCollectionAction = getChildrenCollections(name).length > 0 && fieldSchema['x-action'] === 'create';
104
116
  (0, _react2.useEffect)(function () {
105
117
  var schemaUid = (0, _shared.uid)();
106
118
  var schema = {
@@ -180,6 +192,8 @@ var ActionDesigner = function ActionDesigner(props) {
180
192
  dn.refresh();
181
193
  }
182
194
  }
195
+ }), isLinkageAction && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.LinkageRules, {
196
+ collectionName: name
183
197
  }), isPopupAction && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SelectItem, {
184
198
  title: t('Open mode'),
185
199
  options: [{
@@ -246,7 +260,7 @@ var ActionDesigner = function ActionDesigner(props) {
246
260
  label: t('All'),
247
261
  value: 'all'
248
262
  }],
249
- value: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction === void 0 ? void 0 : _fieldSchema$xAction['updateMode'],
263
+ value: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction2 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction2 === void 0 ? void 0 : _fieldSchema$xAction2['updateMode'],
250
264
  onChange: function onChange(value) {
251
265
  fieldSchema['x-action-settings']['updateMode'] = value;
252
266
  dn.emit('patch', {
@@ -257,12 +271,12 @@ var ActionDesigner = function ActionDesigner(props) {
257
271
  });
258
272
  dn.refresh();
259
273
  }
260
- }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction2 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction2 === void 0 ? void 0 : _fieldSchema$xAction2.assignedValues) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ActionModalItem, {
274
+ }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction3 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction3 === void 0 ? void 0 : _fieldSchema$xAction3.assignedValues) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ActionModalItem, {
261
275
  title: t('Assign field values'),
262
276
  initialSchema: initialSchema,
263
- initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction3 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction3 === void 0 ? void 0 : _fieldSchema$xAction3.assignedValues,
277
+ initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction4 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction4 === void 0 ? void 0 : _fieldSchema$xAction4.assignedValues,
264
278
  modalTip: tips[actionType],
265
- uid: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction4 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction4 === void 0 ? void 0 : _fieldSchema$xAction4.schemaUid,
279
+ uid: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction5 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction5 === void 0 ? void 0 : _fieldSchema$xAction5.schemaUid,
266
280
  onSubmit: function onSubmit(assignedValues) {
267
281
  var _schema2;
268
282
 
@@ -272,10 +286,10 @@ var ActionDesigner = function ActionDesigner(props) {
272
286
  });
273
287
  dn.refresh();
274
288
  }
275
- }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction5 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction5 === void 0 ? void 0 : _fieldSchema$xAction5.requestSettings) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ActionModalItem, {
289
+ }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction6 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction6 === void 0 ? void 0 : _fieldSchema$xAction6.requestSettings) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ActionModalItem, {
276
290
  title: t('Request settings'),
277
291
  schema: _utils.requestSettingsSchema,
278
- initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction6 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction6 === void 0 ? void 0 : _fieldSchema$xAction6.requestSettings,
292
+ initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction7 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction7 === void 0 ? void 0 : _fieldSchema$xAction7.requestSettings,
279
293
  onSubmit: function onSubmit(requestSettings) {
280
294
  var _schema3;
281
295
 
@@ -285,9 +299,9 @@ var ActionDesigner = function ActionDesigner(props) {
285
299
  });
286
300
  dn.refresh();
287
301
  }
288
- }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction7 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction7 === void 0 ? void 0 : _fieldSchema$xAction7.skipValidator) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
302
+ }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction8 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction8 === void 0 ? void 0 : _fieldSchema$xAction8.skipValidator) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
289
303
  title: t('Skip required validation'),
290
- checked: !!(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction8 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction8 === void 0 ? void 0 : _fieldSchema$xAction8.skipValidator),
304
+ checked: !!(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction9 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction9 === void 0 ? void 0 : _fieldSchema$xAction9.skipValidator),
291
305
  onChange: function onChange(value) {
292
306
  var _schema4;
293
307
 
@@ -296,7 +310,7 @@ var ActionDesigner = function ActionDesigner(props) {
296
310
  schema: (_schema4 = {}, _defineProperty(_schema4, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema4, 'x-action-settings', _objectSpread({}, fieldSchema['x-action-settings'])), _schema4)
297
311
  });
298
312
  }
299
- }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction9 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction9 === void 0 ? void 0 : _fieldSchema$xAction9['onSuccess']) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
313
+ }), (0, _shared.isValid)(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction10 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction10 === void 0 ? void 0 : _fieldSchema$xAction10['onSuccess']) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
300
314
  title: {
301
315
  'customize:save': t('After successful save'),
302
316
  'customize:update': t('After successful update'),
@@ -304,7 +318,7 @@ var ActionDesigner = function ActionDesigner(props) {
304
318
  'customize:form:request': t('After successful request'),
305
319
  'customize:bulkUpdate': t('After successful bulk update')
306
320
  }[actionType],
307
- initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction10 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction10 === void 0 ? void 0 : _fieldSchema$xAction10['onSuccess'],
321
+ initialValues: fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xAction11 = fieldSchema['x-action-settings']) === null || _fieldSchema$xAction11 === void 0 ? void 0 : _fieldSchema$xAction11['onSuccess'],
308
322
  schema: {
309
323
  type: 'object',
310
324
  title: {
@@ -373,6 +387,8 @@ var ActionDesigner = function ActionDesigner(props) {
373
387
  schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-action-settings', fieldSchema['x-action-settings']), _schema5)
374
388
  });
375
389
  }
390
+ }), isChildCollectionAction && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.EnableChildCollections, {
391
+ collectionName: name
376
392
  }), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Divider, null), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Remove, {
377
393
  removeParentsIfNoChildren: true,
378
394
  breakRemoveOn: function breakRemoveOn(s) {
@@ -27,6 +27,8 @@ var _hooks = require("../../hooks");
27
27
 
28
28
  var _useProps2 = require("../../hooks/useProps");
29
29
 
30
+ var _recordProvider = require("../../../record-provider");
31
+
30
32
  var _Action = _interopRequireDefault(require("./Action.Container"));
31
33
 
32
34
  var _Action2 = require("./Action.Designer");
@@ -43,7 +45,11 @@ var _context = require("./context");
43
45
 
44
46
  var _hooks2 = require("./hooks");
45
47
 
46
- var _excluded = ["popover", "confirm", "containerRefKey", "component", "useAction", "className", "icon", "title"];
48
+ var _2 = require("../../");
49
+
50
+ var _utils = require("./utils");
51
+
52
+ var _excluded = ["popover", "confirm", "openMode", "containerRefKey", "component", "useAction", "className", "icon", "title"];
47
53
 
48
54
  var _templateObject, _templateObject2;
49
55
 
@@ -84,6 +90,7 @@ var Action = (0, _react.observer)(function (props) {
84
90
 
85
91
  var popover = props.popover,
86
92
  confirm = props.confirm,
93
+ om = props.openMode,
87
94
  containerRefKey = props.containerRefKey,
88
95
  component = props.component,
89
96
  _props$useAction = props.useAction,
@@ -115,13 +122,29 @@ var Action = (0, _react.observer)(function (props) {
115
122
  var fieldSchema = (0, _react.useFieldSchema)();
116
123
  var compile = (0, _hooks.useCompile)();
117
124
  var form = (0, _react.useForm)();
125
+ var values = (0, _recordProvider.useRecord)();
118
126
  var designerProps = fieldSchema['x-designer-props'];
119
127
  var openMode = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon['openMode'];
120
128
  var disabled = form.disabled || field.disabled;
121
129
  var openSize = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2['openSize'];
130
+ var linkageRules = (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-linkage-rules']) || [];
131
+
132
+ var _useDesignable = (0, _2.useDesignable)(),
133
+ designable = _useDesignable.designable;
134
+
135
+ var tarComponent = (0, _hooks.useComponent)(component) || component;
136
+ (0, _react2.useEffect)(function () {
137
+ linkageRules.map(function (v) {
138
+ var _v$actions;
139
+
140
+ return (_v$actions = v.actions) === null || _v$actions === void 0 ? void 0 : _v$actions.map(function (h) {
141
+ (0, _utils.linkageAction)(h.operator, field, v.condition, values, designable);
142
+ });
143
+ });
144
+ }, [linkageRules]);
122
145
 
123
146
  var renderButton = function renderButton() {
124
- var _field$data;
147
+ var _field$data, _field$data2;
125
148
 
126
149
  return /*#__PURE__*/_react2.default.createElement(_common.SortableItem, _objectSpread(_objectSpread({}, others), {}, {
127
150
  loading: field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.loading,
@@ -129,6 +152,9 @@ var Action = (0, _react.observer)(function (props) {
129
152
  type: icon
130
153
  }),
131
154
  disabled: disabled,
155
+ style: {
156
+ border: (field === null || field === void 0 ? void 0 : (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : _field$data2.hidden) && '1px dashed #ede9e9'
157
+ },
132
158
  onClick: function onClick(e) {
133
159
  if (!disabled) {
134
160
  e.preventDefault();
@@ -149,7 +175,7 @@ var Action = (0, _react.observer)(function (props) {
149
175
  }
150
176
  }
151
177
  },
152
- component: component || _antd.Button,
178
+ component: tarComponent || _antd.Button,
153
179
  className: (0, _classnames.default)(className, actionDesignerCss)
154
180
  }), title || compile(fieldSchema.title), /*#__PURE__*/_react2.default.createElement(Designer, _objectSpread({}, designerProps)));
155
181
  };
@@ -1,2 +1,3 @@
1
1
  import type { ISchema } from '@formily/react';
2
2
  export declare const requestSettingsSchema: ISchema;
3
+ export declare const linkageAction: (operator: any, field: any, condition: any, values: any, designable: any) => any;
@@ -3,7 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.requestSettingsSchema = void 0;
6
+ exports.requestSettingsSchema = exports.linkageAction = void 0;
7
+
8
+ var _lodash = require("lodash");
9
+
10
+ var _uitls = require("../../common/utils/uitls");
11
+
12
+ var _type = require("../../../schema-settings/LinkageRules/type");
13
+
7
14
  var validateJSON = {
8
15
  validator: "{{(value, rule)=> {\n if (!value) {\n return '';\n }\n try {\n const val = JSON.parse(value);\n if(!isNaN(val)) {\n return false;\n }\n return true;\n } catch(error) {\n console.error(error);\n return false;\n }\n }}}",
9
16
  message: '{{t("Invalid JSON format")}}'
@@ -64,4 +71,53 @@ var requestSettingsSchema = {
64
71
  }
65
72
  }
66
73
  };
67
- exports.requestSettingsSchema = requestSettingsSchema;
74
+ exports.requestSettingsSchema = requestSettingsSchema;
75
+
76
+ var linkageAction = function linkageAction(operator, field, condition, values, designable) {
77
+ var displayResult = [field.display];
78
+ var disableResult = [field.disabled];
79
+
80
+ switch (operator) {
81
+ case _type.ActionType.Visible:
82
+ if ((0, _uitls.conditionAnalyse)(condition, values)) {
83
+ displayResult.push(operator);
84
+ }
85
+
86
+ field.display = (0, _lodash.last)(displayResult);
87
+ break;
88
+
89
+ case _type.ActionType.Hidden:
90
+ if ((0, _uitls.conditionAnalyse)(condition, values)) {
91
+ if (!designable) {
92
+ displayResult.push(operator);
93
+ } else {
94
+ field.data = field.data || {};
95
+ field.data.hidden = true;
96
+ }
97
+ }
98
+
99
+ field.display = (0, _lodash.last)(displayResult);
100
+ break;
101
+
102
+ case _type.ActionType.Disabled:
103
+ if ((0, _uitls.conditionAnalyse)(condition, values)) {
104
+ disableResult.push(true);
105
+ }
106
+
107
+ field.disabled = (0, _lodash.last)(disableResult);
108
+ break;
109
+
110
+ case _type.ActionType.Active:
111
+ if ((0, _uitls.conditionAnalyse)(condition, values)) {
112
+ disableResult.push(false);
113
+ }
114
+
115
+ field.disabled = (0, _lodash.last)(disableResult);
116
+ break;
117
+
118
+ default:
119
+ return null;
120
+ }
121
+ };
122
+
123
+ exports.linkageAction = linkageAction;
@@ -41,9 +41,9 @@ var AssociationFilter = function AssociationFilter(props) {
41
41
  exists = _useSchemaInitializer.exists,
42
42
  render = _useSchemaInitializer.render;
43
43
 
44
- return /*#__PURE__*/_react2.default.createElement(_common.SortableItem, {
45
- className: (0, _classnames.default)('nb-block-item', props.className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n > .general-schema-designer {\n display: block;\n }\n }\n &.nb-form-item:hover {\n > .general-schema-designer {\n background: rgba(241, 139, 98, 0.06) !important;\n border: 0 !important;\n top: -5px !important;\n bottom: -5px !important;\n left: -5px !important;\n right: -5px !important;\n }\n }\n > .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n border: 2px solid rgba(241, 139, 98, 0.3);\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n "]))))
46
- }, /*#__PURE__*/_react2.default.createElement(Designer, null), props.children, render());
44
+ return /*#__PURE__*/_react2.default.createElement(_common.DndContext, null, /*#__PURE__*/_react2.default.createElement(_common.SortableItem, {
45
+ className: (0, _classnames.default)('nb-block-item', props.className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n > .general-schema-designer {\n display: block;\n }\n }\n &.nb-form-item:hover {\n > .general-schema-designer {\n background: rgba(241, 139, 98, 0.06) !important;\n border: 0 !important;\n top: -5px !important;\n bottom: -5px !important;\n left: -5px !important;\n right: -5px !important;\n }\n }\n > .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n border: 2px solid rgba(241, 139, 98, 0.3);\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n "]))))
46
+ }, /*#__PURE__*/_react2.default.createElement(Designer, null), props.children, render()));
47
47
  };
48
48
 
49
49
  exports.AssociationFilter = AssociationFilter;
@@ -4,9 +4,9 @@ export declare type AssociationSelectProps<P = any> = RemoteSelectProps<P> & {
4
4
  action?: string;
5
5
  multiple?: boolean;
6
6
  };
7
- interface RemoteSelectInterface {
7
+ interface AssociationSelectInterface {
8
8
  (props: any): React.ReactElement;
9
9
  Designer: React.FC;
10
10
  }
11
- export declare const AssociationSelect: RemoteSelectInterface;
11
+ export declare const AssociationSelect: AssociationSelectInterface;
12
12
  export default AssociationSelect;
@@ -9,30 +9,73 @@ var _react = require("@formily/react");
9
9
 
10
10
  var _react2 = require("react");
11
11
 
12
+ var _SharedFilterProvider = require("../../../block-provider/SharedFilterProvider");
13
+
12
14
  var _collectionManager = require("../../../collection-manager");
13
15
 
16
+ var _recordProvider = require("../../../record-provider");
17
+
14
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
19
 
16
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
21
 
18
22
  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; }
19
23
 
24
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
25
+
20
26
  function useServiceOptions(props) {
21
27
  var _props$action = props.action,
22
28
  action = _props$action === void 0 ? 'list' : _props$action,
23
- service = props.service;
29
+ service = props.service,
30
+ fieldNames = props.fieldNames;
31
+ var params = (service === null || service === void 0 ? void 0 : service.params) || {};
24
32
  var fieldSchema = (0, _react.useFieldSchema)();
25
33
 
26
34
  var _useCollection = (0, _collectionManager.useCollection)(),
27
35
  getField = _useCollection.getField;
28
36
 
37
+ var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
38
+ getCollectionFields = _useCollectionManager.getCollectionFields;
39
+
40
+ var record = (0, _recordProvider.useRecord)();
41
+ var normalizeValues = (0, _react2.useCallback)(function (obj) {
42
+ if (obj && _typeof(obj) === 'object') {
43
+ return obj[fieldNames.value];
44
+ }
45
+
46
+ return obj;
47
+ }, [fieldNames.value]);
48
+ var value = (0, _react2.useMemo)(function () {
49
+ if (props.value === undefined || props.value === null) {
50
+ return;
51
+ }
52
+
53
+ if (Array.isArray(props.value)) {
54
+ return props.value.map(normalizeValues);
55
+ } else {
56
+ return [normalizeValues(props.value)];
57
+ }
58
+ }, [props.value, normalizeValues]);
29
59
  var collectionField = (0, _react2.useMemo)(function () {
30
60
  return getField(fieldSchema.name);
31
61
  }, [fieldSchema.name]);
62
+ var sourceValue = record === null || record === void 0 ? void 0 : record[collectionField === null || collectionField === void 0 ? void 0 : collectionField.sourceKey];
63
+ var filter = (0, _react2.useMemo)(function () {
64
+ var isOToAny = ['oho', 'o2m'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
65
+ return (0, _SharedFilterProvider.mergeFilter)([(0, _SharedFilterProvider.mergeFilter)([isOToAny ? _defineProperty({}, collectionField.foreignKey, {
66
+ $is: null
67
+ }) : null, params === null || params === void 0 ? void 0 : params.filter]), isOToAny && sourceValue !== undefined && sourceValue !== null ? _defineProperty({}, collectionField.foreignKey, {
68
+ $eq: sourceValue
69
+ }) : null, (params === null || params === void 0 ? void 0 : params.filter) && value ? _defineProperty({}, fieldNames.value, _defineProperty({}, '$in', value)) : null], '$or');
70
+ }, [params === null || params === void 0 ? void 0 : params.filter, getCollectionFields, collectionField, sourceValue, value, fieldNames.value]);
32
71
  return (0, _react2.useMemo)(function () {
33
- return _objectSpread({
72
+ return _objectSpread(_objectSpread({
34
73
  resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target,
35
74
  action: action
36
- }, service);
37
- }, [collectionField === null || collectionField === void 0 ? void 0 : collectionField.target, action, service]);
75
+ }, service), {}, {
76
+ params: _objectSpread(_objectSpread({}, service === null || service === void 0 ? void 0 : service.params), {}, {
77
+ filter: filter
78
+ })
79
+ });
80
+ }, [collectionField === null || collectionField === void 0 ? void 0 : collectionField.target, action, filter, service]);
38
81
  }