@nocobase/client 0.9.2-alpha.2 → 0.9.2-alpha.3

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 (315) hide show
  1. package/es/acl/Configuration/FilterDynamicComponent.d.ts +2 -0
  2. package/es/{schema-component/antd/table-v2/hooks/useUserVariable.js → acl/Configuration/FilterDynamicComponent.js} +32 -4
  3. package/es/acl/Configuration/schemas/scopes.js +3 -0
  4. package/es/application/Application.d.ts +1 -0
  5. package/es/application/Application.js +12 -2
  6. package/es/block-provider/FormFieldProvider.js +9 -1
  7. package/es/block-provider/TableSelectorProvider.js +3 -2
  8. package/es/block-provider/hooks/index.js +18 -13
  9. package/es/board/CardAdder.js +1 -1
  10. package/es/board/ColumnForm.js +4 -4
  11. package/es/board/DefaultColumnHeader.d.ts +1 -1
  12. package/es/board/DefaultColumnHeader.js +6 -6
  13. package/es/collection-manager/CollectionField.js +16 -13
  14. package/es/collection-manager/CollectionManagerProvider.js +10 -2
  15. package/es/collection-manager/Configuration/AddCollectionAction.js +1 -1
  16. package/es/collection-manager/Configuration/CollectionFields.d.ts +2 -0
  17. package/es/collection-manager/Configuration/CollectionFields.js +458 -0
  18. package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +3 -3
  19. package/es/collection-manager/Configuration/ConfigurationTable.js +4 -2
  20. package/es/collection-manager/Configuration/ConfigurationTabs.js +6 -2
  21. package/es/collection-manager/Configuration/EditCollectionAction.js +4 -4
  22. package/es/collection-manager/Configuration/EditFieldAction.js +1 -1
  23. package/es/collection-manager/Configuration/OverridingCollectionField.js +1 -1
  24. package/es/collection-manager/Configuration/schemas/collectionFields.d.ts +2 -0
  25. package/es/collection-manager/Configuration/schemas/collectionFields.js +1 -1
  26. package/es/collection-manager/Configuration/schemas/collections.js +8 -5
  27. package/es/collection-manager/action-hooks.d.ts +2 -1
  28. package/es/collection-manager/action-hooks.js +10 -7
  29. package/es/collection-manager/hooks/useCollectionDataSource.js +2 -2
  30. package/es/collection-manager/hooks/useCollectionManager.d.ts +1 -0
  31. package/es/collection-manager/hooks/useCollectionManager.js +2 -0
  32. package/es/collection-manager/interfaces/checkbox.js +7 -0
  33. package/es/collection-manager/interfaces/checkboxGroup.js +7 -0
  34. package/es/collection-manager/interfaces/components/index.js +1 -1
  35. package/es/collection-manager/interfaces/createdBy.js +5 -1
  36. package/es/collection-manager/interfaces/email.js +7 -0
  37. package/es/collection-manager/interfaces/linkTo.js +6 -0
  38. package/es/collection-manager/interfaces/m2m.js +6 -0
  39. package/es/collection-manager/interfaces/m2o.js +6 -0
  40. package/es/collection-manager/interfaces/multipleSelect.js +10 -0
  41. package/es/collection-manager/interfaces/o2m.js +8 -1
  42. package/es/collection-manager/interfaces/o2o.js +6 -0
  43. package/es/collection-manager/interfaces/percent.js +10 -0
  44. package/es/collection-manager/interfaces/select.js +10 -0
  45. package/es/collection-manager/interfaces/updatedBy.js +5 -1
  46. package/es/collection-manager/types.d.ts +1 -0
  47. package/es/filter-provider/utils.d.ts +8 -3
  48. package/es/filter-provider/utils.js +42 -27
  49. package/es/locale/en_US.d.ts +7 -0
  50. package/es/locale/en_US.js +8 -1
  51. package/es/locale/ja_JP.d.ts +15 -0
  52. package/es/locale/ja_JP.js +17 -2
  53. package/es/locale/pt_BR.d.ts +16 -0
  54. package/es/locale/pt_BR.js +18 -2
  55. package/es/locale/ru_RU.d.ts +15 -0
  56. package/es/locale/ru_RU.js +17 -2
  57. package/es/locale/tr_TR.d.ts +16 -1
  58. package/es/locale/tr_TR.js +18 -3
  59. package/es/locale/zh_CN.d.ts +16 -0
  60. package/es/locale/zh_CN.js +17 -1
  61. package/es/pm/PluginManagerLink.js +5 -3
  62. package/es/pm/index.js +1 -1
  63. package/es/schema-component/antd/action/Action.js +1 -1
  64. package/es/schema-component/antd/association-select/AssociationSelect.js +56 -35
  65. package/es/schema-component/antd/association-select/useServiceOptions.js +3 -2
  66. package/es/schema-component/antd/checkbox/Checkbox.js +4 -3
  67. package/es/schema-component/antd/collection-select/CollectionSelect.d.ts +2 -2
  68. package/es/schema-component/antd/collection-select/CollectionSelect.js +6 -6
  69. package/es/schema-component/antd/error-fallback/ErrorFallback.d.ts +3 -0
  70. package/es/schema-component/antd/error-fallback/ErrorFallback.js +47 -0
  71. package/es/schema-component/antd/error-fallback/index.d.ts +1 -0
  72. package/es/schema-component/antd/error-fallback/index.js +1 -0
  73. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +2 -0
  74. package/es/schema-component/antd/filter/useFilterActionProps.js +127 -7
  75. package/es/schema-component/antd/filter/useValues.js +7 -8
  76. package/es/schema-component/antd/form-item/FormItem.d.ts +3 -0
  77. package/es/schema-component/antd/form-item/FormItem.js +81 -16
  78. package/es/schema-component/antd/form-item/SchemaSettingOptions.js +2 -3
  79. package/es/schema-component/antd/form-v2/Templates.js +24 -18
  80. package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +1 -1
  81. package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +3 -3
  82. package/es/schema-component/antd/gantt/components/gantt/style.js +1 -1
  83. package/es/schema-component/antd/gantt/components/grid/grid.d.ts +2 -2
  84. package/es/schema-component/antd/gantt/components/grid/grid.js +2 -2
  85. package/es/schema-component/antd/gantt/components/grid/style.js +1 -1
  86. package/es/schema-component/antd/gantt/components/other/arrow.d.ts +2 -2
  87. package/es/schema-component/antd/gantt/components/other/arrow.js +3 -3
  88. package/es/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +1 -1
  89. package/es/schema-component/antd/gantt/components/other/horizontal-scroll.js +1 -1
  90. package/es/schema-component/antd/gantt/components/other/style.js +1 -1
  91. package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +1 -1
  92. package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.js +1 -1
  93. package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +2 -2
  94. package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.js +6 -6
  95. package/es/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +2 -2
  96. package/es/schema-component/antd/gantt/components/task-item/bar/bar.js +9 -9
  97. package/es/schema-component/antd/gantt/components/task-item/bar/style.js +2 -2
  98. package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +2 -2
  99. package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.js +2 -2
  100. package/es/schema-component/antd/gantt/types/bar-task.d.ts +2 -2
  101. package/es/schema-component/antd/gantt/types/date-setup.d.ts +1 -1
  102. package/es/schema-component/antd/gantt/types/gantt-task-actions.d.ts +3 -3
  103. package/es/schema-component/antd/gantt/types/public-types.d.ts +1 -1
  104. package/es/schema-component/antd/grid/Grid.js +23 -9
  105. package/es/schema-component/antd/icon-picker/IconPicker.js +1 -1
  106. package/es/schema-component/antd/input/EllipsisWithTooltip.js +21 -2
  107. package/es/schema-component/antd/menu/util.js +0 -1
  108. package/es/schema-component/antd/page/Page.js +10 -2
  109. package/es/schema-component/antd/pagination/index.js +1 -1
  110. package/es/schema-component/antd/record-picker/InputRecordPicker.js +3 -4
  111. package/es/schema-component/antd/record-picker/useFieldNames.js +1 -1
  112. package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  113. package/es/schema-component/antd/remote-select/RemoteSelect.js +75 -13
  114. package/es/schema-component/antd/select/ReadPretty.js +5 -2
  115. package/es/schema-component/antd/select/Select.js +3 -9
  116. package/es/schema-component/antd/table/Table.Array.js +2 -2
  117. package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +2 -138
  118. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +6 -5
  119. package/es/schema-component/antd/table-v2/Table.js +2 -2
  120. package/es/schema-component/antd/upload/ReadPretty.js +2 -1
  121. package/es/schema-component/antd/variable/Input.js +11 -5
  122. package/es/schema-component/antd/variable/JSONInput.js +4 -4
  123. package/es/schema-component/antd/variable/TextArea.js +1 -1
  124. package/es/schema-component/antd/variable/Variable.js +3 -3
  125. package/es/schema-component/antd/variable/VariableSelect.js +8 -8
  126. package/es/schema-component/antd/variable/XButton.d.ts +1 -1
  127. package/es/schema-component/antd/variable/XButton.js +4 -4
  128. package/es/schema-component/common/utils/uitls.d.ts +9 -0
  129. package/es/schema-component/common/utils/uitls.js +37 -3
  130. package/es/schema-component/core/DesignableSwitch.js +5 -3
  131. package/es/schema-component/hooks/useComponent.js +2 -2
  132. package/es/schema-component/hooks/useDesignable.js +2 -2
  133. package/es/schema-component/hooks/useFieldTitle.js +4 -4
  134. package/es/schema-initializer/SchemaInitializer.js +2 -2
  135. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +14 -7
  136. package/es/schema-initializer/items/DestroyActionInitializer.js +2 -2
  137. package/es/schema-initializer/items/FilterActionInitializer.js +2 -2
  138. package/es/schema-initializer/items/FormBlockInitializer.js +3 -3
  139. package/es/schema-initializer/items/G2PlotInitializer.js +1 -1
  140. package/es/schema-initializer/items/KanbanBlockInitializer.js +9 -9
  141. package/es/schema-initializer/items/MarkdownBlockInitializer.js +3 -3
  142. package/es/schema-initializer/items/PrintActionInitializer.js +2 -2
  143. package/es/schema-initializer/items/RecordAssociationBlockInitializer.js +5 -5
  144. package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +9 -9
  145. package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +5 -5
  146. package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.js +4 -4
  147. package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +5 -5
  148. package/es/schema-initializer/items/RefreshActionInitializer.js +2 -2
  149. package/es/schema-initializer/items/SubmitActionInitializer.js +2 -2
  150. package/es/schema-initializer/items/TableActionColumnInitializer.js +2 -2
  151. package/es/schema-initializer/items/TableCollectionFieldInitializer.js +2 -2
  152. package/es/schema-initializer/items/TableSelectorInitializer.js +5 -5
  153. package/es/schema-initializer/items/UpdateActionInitializer.js +2 -2
  154. package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +2 -2
  155. package/es/schema-initializer/items/ViewActionInitializer.js +2 -2
  156. package/es/schema-initializer/utils.js +17 -10
  157. package/es/schema-settings/DataTemplates/FormDataTemplates.js +28 -12
  158. package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -1
  159. package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +9 -2
  160. package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +2 -1
  161. package/es/schema-settings/SchemaSettings.d.ts +4 -1
  162. package/es/schema-settings/SchemaSettings.js +32 -19
  163. package/es/schema-settings/VariableInput/VariableInput.d.ts +13 -0
  164. package/es/schema-settings/VariableInput/VariableInput.js +37 -0
  165. package/es/schema-settings/VariableInput/hooks/useDateVariable.d.ts +4 -0
  166. package/es/schema-settings/VariableInput/hooks/useDateVariable.js +129 -0
  167. package/es/schema-settings/VariableInput/hooks/useUserVariable.d.ts +5 -0
  168. package/es/schema-settings/VariableInput/hooks/useUserVariable.js +68 -0
  169. package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -0
  170. package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +18 -0
  171. package/es/user/VerificationCode.js +7 -8
  172. package/lib/acl/Configuration/FilterDynamicComponent.d.ts +2 -0
  173. package/lib/{schema-component/antd/table-v2/hooks/useUserVariable.js → acl/Configuration/FilterDynamicComponent.js} +32 -4
  174. package/lib/acl/Configuration/schemas/scopes.js +3 -0
  175. package/lib/application/Application.d.ts +1 -0
  176. package/lib/application/Application.js +12 -2
  177. package/lib/block-provider/FormFieldProvider.js +9 -1
  178. package/lib/block-provider/TableSelectorProvider.js +3 -2
  179. package/lib/block-provider/hooks/index.js +17 -12
  180. package/lib/board/CardAdder.js +1 -1
  181. package/lib/board/ColumnForm.js +4 -4
  182. package/lib/board/DefaultColumnHeader.d.ts +1 -1
  183. package/lib/board/DefaultColumnHeader.js +6 -6
  184. package/lib/collection-manager/CollectionField.js +16 -13
  185. package/lib/collection-manager/CollectionManagerProvider.js +10 -2
  186. package/lib/collection-manager/Configuration/AddCollectionAction.js +1 -1
  187. package/lib/collection-manager/Configuration/CollectionFields.d.ts +2 -0
  188. package/lib/collection-manager/Configuration/CollectionFields.js +468 -0
  189. package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +3 -3
  190. package/lib/collection-manager/Configuration/ConfigurationTable.js +4 -2
  191. package/lib/collection-manager/Configuration/ConfigurationTabs.js +5 -1
  192. package/lib/collection-manager/Configuration/EditCollectionAction.js +4 -4
  193. package/lib/collection-manager/Configuration/EditFieldAction.js +1 -1
  194. package/lib/collection-manager/Configuration/OverridingCollectionField.js +1 -1
  195. package/lib/collection-manager/Configuration/schemas/collectionFields.d.ts +2 -0
  196. package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -1
  197. package/lib/collection-manager/Configuration/schemas/collections.js +8 -5
  198. package/lib/collection-manager/action-hooks.d.ts +2 -1
  199. package/lib/collection-manager/action-hooks.js +13 -9
  200. package/lib/collection-manager/hooks/useCollectionManager.d.ts +1 -0
  201. package/lib/collection-manager/hooks/useCollectionManager.js +2 -0
  202. package/lib/collection-manager/interfaces/checkbox.js +7 -0
  203. package/lib/collection-manager/interfaces/checkboxGroup.js +7 -0
  204. package/lib/collection-manager/interfaces/components/index.js +1 -1
  205. package/lib/collection-manager/interfaces/createdBy.js +5 -1
  206. package/lib/collection-manager/interfaces/email.js +7 -0
  207. package/lib/collection-manager/interfaces/linkTo.js +6 -0
  208. package/lib/collection-manager/interfaces/m2m.js +6 -0
  209. package/lib/collection-manager/interfaces/m2o.js +6 -0
  210. package/lib/collection-manager/interfaces/multipleSelect.js +10 -0
  211. package/lib/collection-manager/interfaces/o2m.js +8 -1
  212. package/lib/collection-manager/interfaces/o2o.js +6 -0
  213. package/lib/collection-manager/interfaces/percent.js +10 -0
  214. package/lib/collection-manager/interfaces/select.js +10 -0
  215. package/lib/collection-manager/interfaces/updatedBy.js +5 -1
  216. package/lib/collection-manager/types.d.ts +1 -0
  217. package/lib/filter-provider/utils.d.ts +8 -3
  218. package/lib/filter-provider/utils.js +44 -28
  219. package/lib/locale/en_US.d.ts +7 -0
  220. package/lib/locale/en_US.js +8 -1
  221. package/lib/locale/ja_JP.d.ts +15 -0
  222. package/lib/locale/ja_JP.js +17 -2
  223. package/lib/locale/pt_BR.d.ts +16 -0
  224. package/lib/locale/pt_BR.js +18 -2
  225. package/lib/locale/ru_RU.d.ts +15 -0
  226. package/lib/locale/ru_RU.js +17 -2
  227. package/lib/locale/tr_TR.d.ts +16 -1
  228. package/lib/locale/tr_TR.js +18 -3
  229. package/lib/locale/zh_CN.d.ts +16 -0
  230. package/lib/locale/zh_CN.js +17 -1
  231. package/lib/pm/PluginManagerLink.js +4 -2
  232. package/lib/pm/index.js +1 -1
  233. package/lib/schema-component/antd/action/Action.js +1 -1
  234. package/lib/schema-component/antd/association-select/AssociationSelect.js +55 -34
  235. package/lib/schema-component/antd/association-select/useServiceOptions.js +3 -2
  236. package/lib/schema-component/antd/checkbox/Checkbox.js +4 -3
  237. package/lib/schema-component/antd/collection-select/CollectionSelect.d.ts +2 -2
  238. package/lib/schema-component/antd/error-fallback/ErrorFallback.d.ts +3 -0
  239. package/lib/schema-component/antd/error-fallback/ErrorFallback.js +55 -0
  240. package/lib/schema-component/antd/error-fallback/index.d.ts +1 -0
  241. package/lib/schema-component/antd/error-fallback/index.js +16 -0
  242. package/lib/schema-component/antd/filter/useFilterActionProps.d.ts +2 -0
  243. package/lib/schema-component/antd/filter/useFilterActionProps.js +130 -8
  244. package/lib/schema-component/antd/filter/useValues.js +6 -7
  245. package/lib/schema-component/antd/form-item/FormItem.d.ts +3 -0
  246. package/lib/schema-component/antd/form-item/FormItem.js +81 -15
  247. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +1 -2
  248. package/lib/schema-component/antd/form-v2/Templates.js +24 -18
  249. package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +1 -1
  250. package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +2 -2
  251. package/lib/schema-component/antd/gantt/components/gantt/style.js +1 -1
  252. package/lib/schema-component/antd/gantt/components/grid/grid.d.ts +2 -2
  253. package/lib/schema-component/antd/gantt/components/grid/style.js +1 -1
  254. package/lib/schema-component/antd/gantt/components/other/arrow.d.ts +2 -2
  255. package/lib/schema-component/antd/gantt/components/other/arrow.js +2 -2
  256. package/lib/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +1 -1
  257. package/lib/schema-component/antd/gantt/components/other/style.js +1 -1
  258. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +1 -1
  259. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +2 -2
  260. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.js +2 -2
  261. package/lib/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +2 -2
  262. package/lib/schema-component/antd/gantt/components/task-item/bar/bar.js +4 -4
  263. package/lib/schema-component/antd/gantt/components/task-item/bar/style.js +2 -2
  264. package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +2 -2
  265. package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.js +1 -1
  266. package/lib/schema-component/antd/gantt/types/bar-task.d.ts +2 -2
  267. package/lib/schema-component/antd/gantt/types/date-setup.d.ts +1 -1
  268. package/lib/schema-component/antd/gantt/types/gantt-task-actions.d.ts +3 -3
  269. package/lib/schema-component/antd/gantt/types/public-types.d.ts +1 -1
  270. package/lib/schema-component/antd/grid/Grid.js +23 -9
  271. package/lib/schema-component/antd/input/EllipsisWithTooltip.js +20 -1
  272. package/lib/schema-component/antd/menu/util.js +0 -1
  273. package/lib/schema-component/antd/page/Page.js +9 -1
  274. package/lib/schema-component/antd/pagination/index.js +1 -1
  275. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +3 -4
  276. package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  277. package/lib/schema-component/antd/remote-select/RemoteSelect.js +75 -12
  278. package/lib/schema-component/antd/select/ReadPretty.js +5 -2
  279. package/lib/schema-component/antd/select/Select.js +3 -9
  280. package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +3 -139
  281. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +6 -5
  282. package/lib/schema-component/antd/table-v2/Table.js +2 -2
  283. package/lib/schema-component/antd/upload/ReadPretty.js +2 -1
  284. package/lib/schema-component/antd/variable/Input.js +10 -4
  285. package/lib/schema-component/antd/variable/JSONInput.js +2 -2
  286. package/lib/schema-component/antd/variable/TextArea.js +1 -1
  287. package/lib/schema-component/antd/variable/VariableSelect.js +4 -4
  288. package/lib/schema-component/antd/variable/XButton.d.ts +1 -1
  289. package/lib/schema-component/antd/variable/XButton.js +1 -1
  290. package/lib/schema-component/common/utils/uitls.d.ts +9 -0
  291. package/lib/schema-component/common/utils/uitls.js +43 -4
  292. package/lib/schema-component/core/DesignableSwitch.js +4 -2
  293. package/lib/schema-component/hooks/useComponent.js +2 -2
  294. package/lib/schema-component/hooks/useDesignable.js +2 -2
  295. package/lib/schema-initializer/SchemaInitializer.js +2 -2
  296. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +14 -7
  297. package/lib/schema-initializer/utils.js +17 -10
  298. package/lib/schema-settings/DataTemplates/FormDataTemplates.js +28 -12
  299. package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -1
  300. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +9 -2
  301. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +2 -1
  302. package/lib/schema-settings/SchemaSettings.d.ts +4 -1
  303. package/lib/schema-settings/SchemaSettings.js +37 -21
  304. package/lib/schema-settings/VariableInput/VariableInput.d.ts +13 -0
  305. package/lib/schema-settings/VariableInput/VariableInput.js +47 -0
  306. package/lib/schema-settings/VariableInput/hooks/useDateVariable.d.ts +4 -0
  307. package/lib/schema-settings/VariableInput/hooks/useDateVariable.js +136 -0
  308. package/lib/schema-settings/VariableInput/hooks/useUserVariable.d.ts +5 -0
  309. package/lib/schema-settings/VariableInput/hooks/useUserVariable.js +75 -0
  310. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -0
  311. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +25 -0
  312. package/lib/user/VerificationCode.js +1 -2
  313. package/package.json +6 -5
  314. package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +0 -10
  315. package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +0 -10
@@ -1,7 +1,6 @@
1
1
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
2
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3
3
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4
- function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
5
4
  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; }
6
5
  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; }
7
6
  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); }
@@ -17,7 +16,8 @@ import React, { useCallback, useMemo } from 'react';
17
16
  import { useTranslation } from 'react-i18next';
18
17
  import { useFilterByTk, useFormBlockContext } from '../../../block-provider';
19
18
  import { useCollection, useCollectionFilterOptions, useCollectionManager, useSortFields } from '../../../collection-manager';
20
- import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings';
19
+ import { isTitleField } from '../../../collection-manager/Configuration/CollectionFields';
20
+ import { GeneralSchemaDesigner, SchemaSettings, isPatternDisabled, isShowDefaultValue } from '../../../schema-settings';
21
21
  import { useCompile, useDesignable, useFieldComponentOptions, useFieldTitle } from '../../hooks';
22
22
  import { removeNullCondition } from '../filter';
23
23
  import { RemoteSelect } from '../remote-select';
@@ -69,16 +69,15 @@ var InternalAssociationSelect = connect(function (props) {
69
69
  });
70
70
  }), mapReadPretty(ReadPretty));
71
71
  export var AssociationSelect = InternalAssociationSelect;
72
- AssociationSelect.Designer = function () {
73
- var _interfaceConfig$vali, _collectionField$uiSc, _field$componentProps, _field$componentProps2, _field$componentProps3, _field$componentProps4, _field$componentProps5, _field$componentProps6, _collectionField$uiSc2, _fieldSchema$xDecora, _collectionField$uiSc4, _fieldSchema$xCompon, _field$componentProps7, _field$componentProps8;
72
+ AssociationSelect.Designer = function Designer() {
73
+ var _interfaceConfig$vali, _collectionField$uiSc, _field$componentProps, _field$componentProps2, _field$componentProps3, _field$componentProps4, _field$componentProps5, _field$componentProps6, _collectionField$uiSc2, _fieldSchema$xDecora, _fieldSchema$xCompon, _field$componentProps7, _field$componentProps8;
74
74
  var _useCollectionManager = useCollectionManager(),
75
75
  getCollectionFields = _useCollectionManager.getCollectionFields,
76
76
  getInterface = _useCollectionManager.getInterface,
77
77
  getCollectionJoinField = _useCollectionManager.getCollectionJoinField,
78
78
  getCollection = _useCollectionManager.getCollection;
79
79
  var _useCollection = useCollection(),
80
- getField = _useCollection.getField,
81
- template = _useCollection.template;
80
+ getField = _useCollection.getField;
82
81
  var _useFormBlockContext = useFormBlockContext(),
83
82
  form = _useFormBlockContext.form;
84
83
  var field = useField();
@@ -86,7 +85,6 @@ AssociationSelect.Designer = function () {
86
85
  var _useTranslation = useTranslation(),
87
86
  t = _useTranslation.t;
88
87
  var tk = useFilterByTk();
89
- _objectDestructuringEmpty(useCollection());
90
88
  var _useDesignable = useDesignable(),
91
89
  dn = _useDesignable.dn,
92
90
  refresh = _useDesignable.refresh,
@@ -119,7 +117,7 @@ AssociationSelect.Designer = function () {
119
117
  initialValue['required'] = field.required;
120
118
  }
121
119
  var options = targetFields.filter(function (field) {
122
- return !(field === null || field === void 0 ? void 0 : field.target) && field.type !== 'boolean';
120
+ return isTitleField(field);
123
121
  }).map(function (field) {
124
122
  var _field$uiSchema;
125
123
  return {
@@ -370,20 +368,27 @@ AssociationSelect.Designer = function () {
370
368
  });
371
369
  refresh();
372
370
  }
373
- }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc4 = collectionField.uiSchema) === null || _collectionField$uiSc4 === void 0 ? void 0 : _collectionField$uiSc4.type) && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
371
+ }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && isShowDefaultValue(collectionField, getInterface) && !isPatternDisabled(fieldSchema) && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
374
372
  title: t('Set default value'),
375
373
  components: {
376
374
  ArrayCollapse: ArrayCollapse,
377
375
  FormLayout: FormLayout
378
376
  },
377
+ width: 800,
379
378
  schema: {
380
379
  type: 'object',
381
380
  title: t('Set default value'),
382
381
  properties: {
383
- default: _objectSpread(_objectSpread({}, collectionField.uiSchema), {}, {
382
+ default: _objectSpread(_objectSpread({}, fieldSchema || {}), {}, {
383
+ 'x-decorator': 'FormItem',
384
+ 'x-component-props': _objectSpread(_objectSpread({}, fieldSchema['x-component-props']), {}, {
385
+ component: (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? 'AssociationSelect' : undefined,
386
+ service: {
387
+ resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target
388
+ }
389
+ }),
384
390
  name: 'default',
385
391
  title: t('Default value'),
386
- 'x-decorator': 'FormItem',
387
392
  default: fieldSchema.default || collectionField.defaultValue
388
393
  })
389
394
  }
@@ -405,7 +410,7 @@ AssociationSelect.Designer = function () {
405
410
  options: fieldComponentOptions,
406
411
  value: fieldSchema['x-component'],
407
412
  onChange: function onChange(type) {
408
- var _collectionField$uiSc5, _interfaceConfig$sche;
413
+ var _collectionField$uiSc4, _interfaceConfig$sche;
409
414
  var schema = {
410
415
  name: collectionField.name,
411
416
  type: 'void',
@@ -418,7 +423,7 @@ AssociationSelect.Designer = function () {
418
423
  'x-validator': fieldSchema['x-validator'],
419
424
  'x-collection-field': fieldSchema['x-collection-field'],
420
425
  'x-decorator-props': fieldSchema['x-decorator-props'],
421
- 'x-component-props': _objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc5 = collectionField.uiSchema) === null || _collectionField$uiSc5 === void 0 ? void 0 : _collectionField$uiSc5['x-component-props']), fieldSchema['x-component-props'])
426
+ 'x-component-props': _objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc4 = collectionField.uiSchema) === null || _collectionField$uiSc4 === void 0 ? void 0 : _collectionField$uiSc4['x-component-props']), fieldSchema['x-component-props'])
422
427
  };
423
428
  interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$sche = interfaceConfig.schemaInitialize) === null || _interfaceConfig$sche === void 0 ? void 0 : _interfaceConfig$sche.call(interfaceConfig, schema, {
424
429
  field: collectionField,
@@ -441,6 +446,22 @@ AssociationSelect.Designer = function () {
441
446
  }
442
447
  });
443
448
  }
449
+ }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && ['o2m', 'm2m'].includes(collectionField.interface) && fieldSchema['x-component'] !== 'TableField' && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
450
+ key: "multiple",
451
+ title: t('Multiple'),
452
+ checked: ((_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.multiple) === undefined ? true : fieldSchema['x-component-props'].multiple,
453
+ onChange: function onChange(value) {
454
+ var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
455
+ fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
456
+ field.componentProps = field.componentProps || {};
457
+ fieldSchema['x-component-props'].multiple = value;
458
+ field.componentProps.multiple = value;
459
+ schema['x-component-props'] = fieldSchema['x-component-props'];
460
+ dn.emit('patch', {
461
+ schema: schema
462
+ });
463
+ refresh();
464
+ }
444
465
  }), /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
445
466
  title: t('Set the data scope'),
446
467
  schema: {
@@ -461,13 +482,13 @@ AssociationSelect.Designer = function () {
461
482
  }
462
483
  },
463
484
  onSubmit: function onSubmit(_ref4) {
464
- var _schema4;
485
+ var _schema5;
465
486
  var filter = _ref4.filter;
466
487
  filter = removeNullCondition(filter);
467
488
  _.set(field.componentProps, 'service.params.filter', filter);
468
489
  fieldSchema['x-component-props'] = field.componentProps;
469
490
  dn.emit('patch', {
470
- schema: (_schema4 = {}, _defineProperty(_schema4, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema4, 'x-component-props', field.componentProps), _schema4)
491
+ schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-component-props', field.componentProps), _schema5)
471
492
  });
472
493
  }
473
494
  }), /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
@@ -542,7 +563,7 @@ AssociationSelect.Designer = function () {
542
563
  }
543
564
  },
544
565
  onSubmit: function onSubmit(_ref5) {
545
- var _schema5;
566
+ var _schema6;
546
567
  var sort = _ref5.sort;
547
568
  var sortArr = sort.map(function (item) {
548
569
  return item.direction === 'desc' ? "-".concat(item.field) : item.field;
@@ -550,10 +571,10 @@ AssociationSelect.Designer = function () {
550
571
  _.set(field.componentProps, 'service.params.sort', sortArr);
551
572
  fieldSchema['x-component-props'] = field.componentProps;
552
573
  dn.emit('patch', {
553
- schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-component-props', field.componentProps), _schema5)
574
+ schema: (_schema6 = {}, _defineProperty(_schema6, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema6, 'x-component-props', field.componentProps), _schema6)
554
575
  });
555
576
  }
556
- }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon['pattern-disable']) != true && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
577
+ }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && !isPatternDisabled(fieldSchema) && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
557
578
  key: "pattern",
558
579
  title: t('Pattern'),
559
580
  options: [{
@@ -611,9 +632,9 @@ AssociationSelect.Designer = function () {
611
632
  options: options,
612
633
  value: field === null || field === void 0 ? void 0 : (_field$componentProps7 = field.componentProps) === null || _field$componentProps7 === void 0 ? void 0 : (_field$componentProps8 = _field$componentProps7.fieldNames) === null || _field$componentProps8 === void 0 ? void 0 : _field$componentProps8.label,
613
634
  onChange: function onChange(label) {
614
- var _collectionField$uiSc6, _collectionField$uiSc7;
635
+ var _collectionField$uiSc5, _collectionField$uiSc6;
615
636
  var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
616
- var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc6 = collectionField.uiSchema) === null || _collectionField$uiSc6 === void 0 ? void 0 : (_collectionField$uiSc7 = _collectionField$uiSc6['x-component-props']) === null || _collectionField$uiSc7 === void 0 ? void 0 : _collectionField$uiSc7['fieldNames']), field.componentProps.fieldNames), {}, {
637
+ var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc5 = collectionField.uiSchema) === null || _collectionField$uiSc5 === void 0 ? void 0 : (_collectionField$uiSc6 = _collectionField$uiSc5['x-component-props']) === null || _collectionField$uiSc6 === void 0 ? void 0 : _collectionField$uiSc6['fieldNames']), field.componentProps.fieldNames), {}, {
617
638
  label: label
618
639
  });
619
640
  field.componentProps.fieldNames = fieldNames;
@@ -640,14 +661,14 @@ AssociationSelect.Designer = function () {
640
661
  * 用于筛选表单区块
641
662
  * @returns
642
663
  */
643
- AssociationSelect.FilterDesigner = function () {
644
- var _interfaceConfig$vali2, _collectionField$uiSc8, _field$componentProps9, _field$componentProps10, _field$componentProps11, _field$componentProps12, _field$componentProps13, _field$componentProps14, _collectionField$uiSc9, _fieldSchema$xDecora2, _collectionField$uiSc11, _field$componentProps15, _field$componentProps16;
664
+ AssociationSelect.FilterDesigner = function FilterDesigner() {
665
+ var _interfaceConfig$vali2, _collectionField$uiSc7, _field$componentProps9, _field$componentProps10, _field$componentProps11, _field$componentProps12, _field$componentProps13, _field$componentProps14, _collectionField$uiSc8, _fieldSchema$xDecora2, _collectionField$uiSc10, _field$componentProps15, _field$componentProps16;
645
666
  var _useCollectionManager2 = useCollectionManager(),
646
667
  getCollectionFields = _useCollectionManager2.getCollectionFields,
647
668
  getInterface = _useCollectionManager2.getInterface,
648
669
  getCollectionJoinField = _useCollectionManager2.getCollectionJoinField;
649
- var _useCollection3 = useCollection(),
650
- getField = _useCollection3.getField;
670
+ var _useCollection2 = useCollection(),
671
+ getField = _useCollection2.getField;
651
672
  var _useFormBlockContext2 = useFormBlockContext(),
652
673
  form = _useFormBlockContext2.form;
653
674
  var field = useField();
@@ -661,7 +682,7 @@ AssociationSelect.FilterDesigner = function () {
661
682
  var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
662
683
  var interfaceConfig = getInterface(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
663
684
  var validateSchema = interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$vali2 = interfaceConfig['validateSchema']) === null || _interfaceConfig$vali2 === void 0 ? void 0 : _interfaceConfig$vali2.call(interfaceConfig, fieldSchema);
664
- var originalTitle = collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc8 = collectionField.uiSchema) === null || _collectionField$uiSc8 === void 0 ? void 0 : _collectionField$uiSc8.title;
685
+ var originalTitle = collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc7 = collectionField.uiSchema) === null || _collectionField$uiSc7 === void 0 ? void 0 : _collectionField$uiSc7.title;
665
686
  var targetFields = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? getCollectionFields(collectionField.target) : [];
666
687
  var initialValue = {
667
688
  title: field.title === originalTitle ? undefined : field.title
@@ -708,7 +729,7 @@ AssociationSelect.FilterDesigner = function () {
708
729
  title: {
709
730
  title: t('Field title'),
710
731
  default: field === null || field === void 0 ? void 0 : field.title,
711
- description: "".concat(t('Original field title: ')).concat(collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc9 = collectionField.uiSchema) === null || _collectionField$uiSc9 === void 0 ? void 0 : _collectionField$uiSc9.title),
732
+ description: "".concat(t('Original field title: ')).concat(collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc8 = collectionField.uiSchema) === null || _collectionField$uiSc8 === void 0 ? void 0 : _collectionField$uiSc8.title),
712
733
  'x-decorator': 'FormItem',
713
734
  'x-component': 'Input',
714
735
  'x-component-props': {}
@@ -873,7 +894,7 @@ AssociationSelect.FilterDesigner = function () {
873
894
  }
874
895
  },
875
896
  onSubmit: function onSubmit(v) {
876
- var _collectionField$uiSc10;
897
+ var _collectionField$uiSc9;
877
898
  var rules = [];
878
899
  var _iterator3 = _createForOfIteratorHelper(v.rules),
879
900
  _step3;
@@ -911,7 +932,7 @@ AssociationSelect.FilterDesigner = function () {
911
932
  _iterator4.f();
912
933
  }
913
934
  }
914
- var concatValidator = _.concat([], (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc10 = collectionField.uiSchema) === null || _collectionField$uiSc10 === void 0 ? void 0 : _collectionField$uiSc10['x-validator']) || [], rules);
935
+ var concatValidator = _.concat([], (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc9 = collectionField.uiSchema) === null || _collectionField$uiSc9 === void 0 ? void 0 : _collectionField$uiSc9['x-validator']) || [], rules);
915
936
  field.validator = concatValidator;
916
937
  fieldSchema['x-validator'] = rules;
917
938
  schema['x-validator'] = rules;
@@ -920,7 +941,7 @@ AssociationSelect.FilterDesigner = function () {
920
941
  });
921
942
  refresh();
922
943
  }
923
- }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc11 = collectionField.uiSchema) === null || _collectionField$uiSc11 === void 0 ? void 0 : _collectionField$uiSc11.type) && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
944
+ }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc10 = collectionField.uiSchema) === null || _collectionField$uiSc10 === void 0 ? void 0 : _collectionField$uiSc10.type) && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
924
945
  title: t('Set default value'),
925
946
  components: {
926
947
  ArrayCollapse: ArrayCollapse,
@@ -970,13 +991,13 @@ AssociationSelect.FilterDesigner = function () {
970
991
  }
971
992
  },
972
993
  onSubmit: function onSubmit(_ref9) {
973
- var _schema10;
994
+ var _schema11;
974
995
  var filter = _ref9.filter;
975
996
  filter = removeNullCondition(filter);
976
997
  _.set(field.componentProps, 'service.params.filter', filter);
977
998
  fieldSchema['x-component-props'] = field.componentProps;
978
999
  dn.emit('patch', {
979
- schema: (_schema10 = {}, _defineProperty(_schema10, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema10, 'x-component-props', field.componentProps), _schema10)
1000
+ schema: (_schema11 = {}, _defineProperty(_schema11, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema11, 'x-component-props', field.componentProps), _schema11)
980
1001
  });
981
1002
  }
982
1003
  }), /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
@@ -1051,7 +1072,7 @@ AssociationSelect.FilterDesigner = function () {
1051
1072
  }
1052
1073
  },
1053
1074
  onSubmit: function onSubmit(_ref10) {
1054
- var _schema11;
1075
+ var _schema12;
1055
1076
  var sort = _ref10.sort;
1056
1077
  var sortArr = sort.map(function (item) {
1057
1078
  return item.direction === 'desc' ? "-".concat(item.field) : item.field;
@@ -1059,7 +1080,7 @@ AssociationSelect.FilterDesigner = function () {
1059
1080
  _.set(field.componentProps, 'service.params.sort', sortArr);
1060
1081
  fieldSchema['x-component-props'] = field.componentProps;
1061
1082
  dn.emit('patch', {
1062
- schema: (_schema11 = {}, _defineProperty(_schema11, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema11, 'x-component-props', field.componentProps), _schema11)
1083
+ schema: (_schema12 = {}, _defineProperty(_schema12, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema12, 'x-component-props', field.componentProps), _schema12)
1063
1084
  });
1064
1085
  }
1065
1086
  }), (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) && ['CollectionField', 'AssociationSelect'].includes(fieldSchema['x-component']) && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
@@ -1068,9 +1089,9 @@ AssociationSelect.FilterDesigner = function () {
1068
1089
  options: options,
1069
1090
  value: field === null || field === void 0 ? void 0 : (_field$componentProps15 = field.componentProps) === null || _field$componentProps15 === void 0 ? void 0 : (_field$componentProps16 = _field$componentProps15.fieldNames) === null || _field$componentProps16 === void 0 ? void 0 : _field$componentProps16.label,
1070
1091
  onChange: function onChange(label) {
1071
- var _collectionField$uiSc12, _collectionField$uiSc13;
1092
+ var _collectionField$uiSc11, _collectionField$uiSc12;
1072
1093
  var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
1073
- var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc12 = collectionField.uiSchema) === null || _collectionField$uiSc12 === void 0 ? void 0 : (_collectionField$uiSc13 = _collectionField$uiSc12['x-component-props']) === null || _collectionField$uiSc13 === void 0 ? void 0 : _collectionField$uiSc13['fieldNames']), field.componentProps.fieldNames), {}, {
1094
+ var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc11 = collectionField.uiSchema) === null || _collectionField$uiSc11 === void 0 ? void 0 : (_collectionField$uiSc12 = _collectionField$uiSc11['x-component-props']) === null || _collectionField$uiSc12 === void 0 ? void 0 : _collectionField$uiSc12['fieldNames']), field.componentProps.fieldNames), {}, {
1074
1095
  label: label
1075
1096
  });
1076
1097
  field.componentProps.fieldNames = fieldNames;
@@ -8,6 +8,7 @@ import { useFieldSchema } from '@formily/react';
8
8
  import { useCallback, useMemo } from 'react';
9
9
  import { mergeFilter } from '../../../block-provider/SharedFilterProvider';
10
10
  import { useCollection, useCollectionManager } from '../../../collection-manager';
11
+ import { isInFilterFormBlock } from '../../../filter-provider';
11
12
  import { useRecord } from '../../../record-provider';
12
13
  export default function useServiceOptions(props) {
13
14
  var _props$action = props.action,
@@ -43,9 +44,9 @@ export default function useServiceOptions(props) {
43
44
  var sourceValue = record === null || record === void 0 ? void 0 : record[collectionField === null || collectionField === void 0 ? void 0 : collectionField.sourceKey];
44
45
  var filter = useMemo(function () {
45
46
  var isOToAny = ['oho', 'o2m'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
46
- return mergeFilter([mergeFilter([isOToAny ? _defineProperty({}, collectionField.foreignKey, {
47
+ return mergeFilter([mergeFilter([isOToAny && !isInFilterFormBlock(fieldSchema) ? _defineProperty({}, collectionField.foreignKey, {
47
48
  $is: null
48
- }) : null, params === null || params === void 0 ? void 0 : params.filter]), isOToAny && sourceValue !== undefined && sourceValue !== null ? _defineProperty({}, collectionField.foreignKey, {
49
+ }) : null, params === null || params === void 0 ? void 0 : params.filter]), isOToAny && sourceValue !== undefined && sourceValue !== null && !isInFilterFormBlock(fieldSchema) ? _defineProperty({}, collectionField.foreignKey, {
49
50
  $eq: sourceValue
50
51
  }) : null, (params === null || params === void 0 ? void 0 : params.filter) && value ? _defineProperty({}, fieldNames.value, _defineProperty({}, '$in', value)) : null], '$or');
51
52
  }, [params === null || params === void 0 ? void 0 : params.filter, getCollectionFields, collectionField, sourceValue, value, fieldNames.value]);
@@ -10,6 +10,7 @@ import { isValid } from '@formily/shared';
10
10
  import { Checkbox as AntdCheckbox, Tag } from 'antd';
11
11
  import uniq from 'lodash/uniq';
12
12
  import React from 'react';
13
+ import { EllipsisWithTooltip } from '../input/EllipsisWithTooltip';
13
14
  export var Checkbox = connect(function (props) {
14
15
  var changeHandler = function changeHandler(val) {
15
16
  props === null || props === void 0 ? void 0 : props.onChange(val);
@@ -41,12 +42,12 @@ Checkbox.Group = connect(AntdCheckbox.Group, mapProps({
41
42
  if (!isValid(props.value)) {
42
43
  return null;
43
44
  }
44
- var _props$options = props.options,
45
- options = _props$options === void 0 ? [] : _props$options;
46
45
  var field = useField();
47
46
  var dataSource = field.dataSource || [];
48
47
  var value = uniq(field.value ? field.value : []);
49
- return /*#__PURE__*/React.createElement("div", null, dataSource.filter(function (option) {
48
+ return /*#__PURE__*/React.createElement(EllipsisWithTooltip, {
49
+ ellipsis: props.ellipsis
50
+ }, dataSource.filter(function (option) {
50
51
  return value.includes(option.value);
51
52
  }).map(function (option, key) {
52
53
  return /*#__PURE__*/React.createElement(Tag, {
@@ -1,5 +1,5 @@
1
- import { SelectProps } from "antd";
2
- import React from "react";
1
+ import { SelectProps } from 'antd';
2
+ import React from 'react';
3
3
  export declare type CollectionSelectProps = SelectProps<any, any> & {
4
4
  filter?: (item: any, index: number, array: any[]) => boolean;
5
5
  };
@@ -7,12 +7,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
7
7
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
8
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
- import { connect, mapReadPretty, observer } from "@formily/react";
11
- import { Select, Tag } from "antd";
12
- import React from "react";
13
- import { useTranslation } from "react-i18next";
14
- import { useCollectionManager } from "../../../collection-manager/hooks";
15
- import { useCompile } from "../../hooks";
10
+ import { connect, mapReadPretty, observer } from '@formily/react';
11
+ import { Select, Tag } from 'antd';
12
+ import React from 'react';
13
+ import { useTranslation } from 'react-i18next';
14
+ import { useCollectionManager } from '../../../collection-manager/hooks';
15
+ import { useCompile } from '../../hooks';
16
16
  function useOptions(_ref) {
17
17
  var filter = _ref.filter;
18
18
  var compile = useCompile();
@@ -0,0 +1,3 @@
1
+ export declare const ErrorFallback: ({ error }: {
2
+ error: any;
3
+ }) => JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { Button, Result, Typography } from 'antd';
2
+ import React from 'react';
3
+ import { useErrorBoundary } from 'react-error-boundary';
4
+ import { Trans, useTranslation } from 'react-i18next';
5
+ var Paragraph = Typography.Paragraph,
6
+ Text = Typography.Text,
7
+ Link = Typography.Link;
8
+ export var ErrorFallback = function ErrorFallback(_ref) {
9
+ var error = _ref.error;
10
+ var _useErrorBoundary = useErrorBoundary(),
11
+ resetBoundary = _useErrorBoundary.resetBoundary;
12
+ var _useTranslation = useTranslation(),
13
+ t = _useTranslation.t;
14
+ var subTitle = /*#__PURE__*/React.createElement(Trans, null, 'This is likely a NocoBase internals bug. Please open an issue at ', /*#__PURE__*/React.createElement(Link, {
15
+ href: "https://github.com/nocobase/nocobase/issues"
16
+ }, "here"));
17
+ return /*#__PURE__*/React.createElement("div", {
18
+ style: {
19
+ backgroundColor: 'white'
20
+ }
21
+ }, /*#__PURE__*/React.createElement(Result, {
22
+ style: {
23
+ maxWidth: '60vw',
24
+ margin: 'auto'
25
+ },
26
+ status: "error",
27
+ title: t('Render Failed'),
28
+ subTitle: subTitle,
29
+ extra: [/*#__PURE__*/React.createElement(Button, {
30
+ type: "primary",
31
+ key: "feedback"
32
+ }, /*#__PURE__*/React.createElement("a", {
33
+ href: "https://github.com/nocobase/nocobase/issues"
34
+ }, t('Feedback'))), /*#__PURE__*/React.createElement(Button, {
35
+ key: "try",
36
+ onClick: resetBoundary
37
+ }, t('Try again'))]
38
+ }, /*#__PURE__*/React.createElement(Paragraph, {
39
+ copyable: true
40
+ }, /*#__PURE__*/React.createElement(Text, {
41
+ type: "danger",
42
+ style: {
43
+ whiteSpace: 'pre-line',
44
+ textAlign: 'center'
45
+ }
46
+ }, error.stack))));
47
+ };
@@ -0,0 +1 @@
1
+ export * from './ErrorFallback';
@@ -0,0 +1 @@
1
+ export * from './ErrorFallback';
@@ -1,4 +1,6 @@
1
+ export declare const useGetFilterOptions: () => (collectionName: any) => any[];
1
2
  export declare const useFilterOptions: (collectionName: string) => any[];
3
+ export declare const useGetFilterFieldOptions: () => (fields: any) => any[];
2
4
  export declare const useFilterFieldOptions: (fields: any) => any[];
3
5
  export declare const removeNullCondition: (filter: any) => any;
4
6
  export declare const useFilterActionProps: () => {
@@ -17,15 +17,70 @@ import { useCompile } from '../..';
17
17
  import { useBlockRequestContext } from '../../../block-provider';
18
18
  import { mergeFilter } from '../../../block-provider/SharedFilterProvider';
19
19
  import { useCollection, useCollectionManager } from '../../../collection-manager';
20
- export var useFilterOptions = function useFilterOptions(collectionName) {
20
+ export var useGetFilterOptions = function useGetFilterOptions() {
21
21
  var _useCollectionManager = useCollectionManager(),
22
22
  getCollectionFields = _useCollectionManager.getCollectionFields;
23
- var fields = getCollectionFields(collectionName);
24
- var options = useFilterFieldOptions(fields);
25
23
  var compile = useCompile();
26
24
  var _useCollectionManager2 = useCollectionManager(),
27
25
  getChildrenCollections = _useCollectionManager2.getChildrenCollections;
28
26
  var collection = useCollection();
27
+ var getFilterFieldOptions = useGetFilterFieldOptions();
28
+ return function (collectionName) {
29
+ var fields = getCollectionFields(collectionName);
30
+ var options = getFilterFieldOptions(fields);
31
+ var childrenCollections = getChildrenCollections(collection.name);
32
+ if (childrenCollections.length > 0 && !options.find(function (v) {
33
+ return v.name == 'tableoid';
34
+ })) {
35
+ options.push({
36
+ name: 'tableoid',
37
+ type: 'string',
38
+ title: '{{t("Table OID(Inheritance)")}}',
39
+ schema: {
40
+ 'x-component': 'Select',
41
+ enum: [{
42
+ value: collection.name,
43
+ label: compile(collection.title)
44
+ }].concat(childrenCollections.map(function (v) {
45
+ return {
46
+ value: v.name,
47
+ label: compile(v.title)
48
+ };
49
+ }))
50
+ },
51
+ operators: [{
52
+ label: '{{t("contains")}}',
53
+ value: '$childIn',
54
+ schema: {
55
+ 'x-component': 'Select',
56
+ 'x-component-props': {
57
+ mode: 'tags'
58
+ }
59
+ }
60
+ }, {
61
+ label: '{{t("does not contain")}}',
62
+ value: '$childNotIn',
63
+ schema: {
64
+ 'x-component': 'Select',
65
+ 'x-component-props': {
66
+ mode: 'tags'
67
+ }
68
+ }
69
+ }]
70
+ });
71
+ }
72
+ return options;
73
+ };
74
+ };
75
+ export var useFilterOptions = function useFilterOptions(collectionName) {
76
+ var _useCollectionManager3 = useCollectionManager(),
77
+ getCollectionFields = _useCollectionManager3.getCollectionFields;
78
+ var compile = useCompile();
79
+ var _useCollectionManager4 = useCollectionManager(),
80
+ getChildrenCollections = _useCollectionManager4.getChildrenCollections;
81
+ var collection = useCollection();
82
+ var fields = getCollectionFields(collectionName);
83
+ var options = useFilterFieldOptions(fields);
29
84
  var childrenCollections = getChildrenCollections(collection.name);
30
85
  if (childrenCollections.length > 0 && !options.find(function (v) {
31
86
  return v.name == 'tableoid';
@@ -69,13 +124,13 @@ export var useFilterOptions = function useFilterOptions(collectionName) {
69
124
  }
70
125
  return options;
71
126
  };
72
- export var useFilterFieldOptions = function useFilterFieldOptions(fields) {
127
+ export var useGetFilterFieldOptions = function useGetFilterFieldOptions() {
73
128
  var _fieldSchema$xCompon;
74
129
  var fieldSchema = useFieldSchema();
75
130
  var nonfilterable = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.nonfilterable) || [];
76
- var _useCollectionManager3 = useCollectionManager(),
77
- getCollectionFields = _useCollectionManager3.getCollectionFields,
78
- getInterface = _useCollectionManager3.getInterface;
131
+ var _useCollectionManager5 = useCollectionManager(),
132
+ getCollectionFields = _useCollectionManager5.getCollectionFields,
133
+ getInterface = _useCollectionManager5.getInterface;
79
134
  var field2option = function field2option(field, depth) {
80
135
  var _field$uiSchema, _operators$filter;
81
136
  if (nonfilterable.length && depth === 1 && nonfilterable.includes(field.name)) {
@@ -130,6 +185,71 @@ export var useFilterFieldOptions = function useFilterFieldOptions(fields) {
130
185
  });
131
186
  return options;
132
187
  };
188
+ return function (fields) {
189
+ return getOptions(fields, 1);
190
+ };
191
+ };
192
+ export var useFilterFieldOptions = function useFilterFieldOptions(fields) {
193
+ var _fieldSchema$xCompon2;
194
+ var fieldSchema = useFieldSchema();
195
+ var nonfilterable = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2.nonfilterable) || [];
196
+ var _useCollectionManager6 = useCollectionManager(),
197
+ getCollectionFields = _useCollectionManager6.getCollectionFields,
198
+ getInterface = _useCollectionManager6.getInterface;
199
+ var field2option = function field2option(field, depth) {
200
+ var _field$uiSchema2, _operators$filter2;
201
+ if (nonfilterable.length && depth === 1 && nonfilterable.includes(field.name)) {
202
+ return;
203
+ }
204
+ if (!field.interface) {
205
+ return;
206
+ }
207
+ var fieldInterface = getInterface(field.interface);
208
+ if (!fieldInterface.filterable) {
209
+ return;
210
+ }
211
+ var _fieldInterface$filte2 = fieldInterface.filterable,
212
+ nested = _fieldInterface$filte2.nested,
213
+ children = _fieldInterface$filte2.children,
214
+ operators = _fieldInterface$filte2.operators;
215
+ var option = {
216
+ name: field.name,
217
+ type: field.type,
218
+ target: field.target,
219
+ title: (field === null || field === void 0 ? void 0 : (_field$uiSchema2 = field.uiSchema) === null || _field$uiSchema2 === void 0 ? void 0 : _field$uiSchema2.title) || field.name,
220
+ schema: field === null || field === void 0 ? void 0 : field.uiSchema,
221
+ operators: (operators === null || operators === void 0 ? void 0 : (_operators$filter2 = operators.filter) === null || _operators$filter2 === void 0 ? void 0 : _operators$filter2.call(operators, function (operator) {
222
+ return !(operator === null || operator === void 0 ? void 0 : operator.visible) || operator.visible(field);
223
+ })) || []
224
+ };
225
+ if (field.target && depth > 2) {
226
+ return;
227
+ }
228
+ if (depth > 2) {
229
+ return option;
230
+ }
231
+ if (children === null || children === void 0 ? void 0 : children.length) {
232
+ option['children'] = children;
233
+ }
234
+ if (nested) {
235
+ var _option$children2;
236
+ var targetFields = getCollectionFields(field.target);
237
+ var options = getOptions(targetFields, depth + 1).filter(Boolean);
238
+ option['children'] = option['children'] || [];
239
+ (_option$children2 = option['children']).push.apply(_option$children2, _toConsumableArray(options));
240
+ }
241
+ return option;
242
+ };
243
+ var getOptions = function getOptions(fields, depth) {
244
+ var options = [];
245
+ fields.forEach(function (field) {
246
+ var option = field2option(field, depth);
247
+ if (option) {
248
+ options.push(option);
249
+ }
250
+ });
251
+ return options;
252
+ };
133
253
  return getOptions(fields, 1);
134
254
  };
135
255
  var isEmpty = function isEmpty(obj) {