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

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 (338) 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/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
  5. package/es/api-client/hooks/useRequest.d.ts +1 -14
  6. package/es/api-client/hooks/useRequest.js +48 -53
  7. package/es/application/Application.d.ts +1 -0
  8. package/es/application/Application.js +12 -2
  9. package/es/block-provider/FormFieldProvider.js +9 -1
  10. package/es/block-provider/TableSelectorProvider.js +3 -2
  11. package/es/block-provider/hooks/index.d.ts +1 -1
  12. package/es/block-provider/hooks/index.js +49 -35
  13. package/es/board/CardAdder.js +1 -1
  14. package/es/board/ColumnForm.js +4 -4
  15. package/es/board/DefaultColumnHeader.d.ts +1 -1
  16. package/es/board/DefaultColumnHeader.js +6 -6
  17. package/es/collection-manager/CollectionField.js +16 -13
  18. package/es/collection-manager/CollectionManagerProvider.js +10 -2
  19. package/es/collection-manager/Configuration/AddCollectionAction.js +1 -1
  20. package/es/collection-manager/Configuration/CollectionFields.d.ts +2 -0
  21. package/es/collection-manager/Configuration/CollectionFields.js +458 -0
  22. package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +3 -3
  23. package/es/collection-manager/Configuration/ConfigurationTable.js +4 -2
  24. package/es/collection-manager/Configuration/ConfigurationTabs.js +6 -2
  25. package/es/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
  26. package/es/collection-manager/Configuration/EditCollectionAction.js +4 -4
  27. package/es/collection-manager/Configuration/EditFieldAction.js +2 -1
  28. package/es/collection-manager/Configuration/OverridingCollectionField.js +2 -1
  29. package/es/collection-manager/Configuration/schemas/collectionFields.d.ts +2 -0
  30. package/es/collection-manager/Configuration/schemas/collectionFields.js +1 -1
  31. package/es/collection-manager/Configuration/schemas/collections.js +8 -5
  32. package/es/collection-manager/action-hooks.d.ts +5 -43
  33. package/es/collection-manager/action-hooks.js +10 -7
  34. package/es/collection-manager/hooks/useCollectionDataSource.js +2 -2
  35. package/es/collection-manager/hooks/useCollectionManager.d.ts +1 -0
  36. package/es/collection-manager/hooks/useCollectionManager.js +2 -0
  37. package/es/collection-manager/interfaces/checkbox.js +7 -0
  38. package/es/collection-manager/interfaces/checkboxGroup.js +7 -0
  39. package/es/collection-manager/interfaces/components/index.js +1 -1
  40. package/es/collection-manager/interfaces/createdBy.js +5 -1
  41. package/es/collection-manager/interfaces/email.js +7 -0
  42. package/es/collection-manager/interfaces/linkTo.js +8 -1
  43. package/es/collection-manager/interfaces/m2m.js +8 -1
  44. package/es/collection-manager/interfaces/m2o.js +8 -1
  45. package/es/collection-manager/interfaces/multipleSelect.js +10 -0
  46. package/es/collection-manager/interfaces/o2m.js +10 -2
  47. package/es/collection-manager/interfaces/o2o.js +12 -3
  48. package/es/collection-manager/interfaces/percent.js +10 -0
  49. package/es/collection-manager/interfaces/select.js +10 -0
  50. package/es/collection-manager/interfaces/types.d.ts +2 -0
  51. package/es/collection-manager/interfaces/updatedBy.js +5 -1
  52. package/es/collection-manager/sub-table.d.ts +1 -14
  53. package/es/collection-manager/types.d.ts +1 -0
  54. package/es/filter-provider/utils.d.ts +8 -3
  55. package/es/filter-provider/utils.js +42 -27
  56. package/es/locale/en_US.d.ts +8 -1
  57. package/es/locale/en_US.js +9 -2
  58. package/es/locale/ja_JP.d.ts +16 -1
  59. package/es/locale/ja_JP.js +18 -3
  60. package/es/locale/pt_BR.d.ts +17 -1
  61. package/es/locale/pt_BR.js +19 -3
  62. package/es/locale/ru_RU.d.ts +15 -0
  63. package/es/locale/ru_RU.js +17 -2
  64. package/es/locale/tr_TR.d.ts +16 -1
  65. package/es/locale/tr_TR.js +18 -3
  66. package/es/locale/zh_CN.d.ts +17 -1
  67. package/es/locale/zh_CN.js +18 -2
  68. package/es/pm/PluginManagerLink.js +5 -3
  69. package/es/pm/index.js +1 -1
  70. package/es/schema-component/antd/action/Action.js +1 -1
  71. package/es/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
  72. package/es/schema-component/antd/association-select/AssociationSelect.js +67 -37
  73. package/es/schema-component/antd/association-select/useServiceOptions.js +3 -2
  74. package/es/schema-component/antd/checkbox/Checkbox.js +4 -3
  75. package/es/schema-component/antd/collection-select/CollectionSelect.d.ts +2 -2
  76. package/es/schema-component/antd/collection-select/CollectionSelect.js +6 -6
  77. package/es/schema-component/antd/error-fallback/ErrorFallback.d.ts +3 -0
  78. package/es/schema-component/antd/error-fallback/ErrorFallback.js +47 -0
  79. package/es/schema-component/antd/error-fallback/index.d.ts +1 -0
  80. package/es/schema-component/antd/error-fallback/index.js +1 -0
  81. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +2 -0
  82. package/es/schema-component/antd/filter/useFilterActionProps.js +127 -7
  83. package/es/schema-component/antd/filter/useValues.js +7 -8
  84. package/es/schema-component/antd/form-item/FormItem.d.ts +3 -0
  85. package/es/schema-component/antd/form-item/FormItem.js +101 -19
  86. package/es/schema-component/antd/form-item/SchemaSettingOptions.js +2 -3
  87. package/es/schema-component/antd/form-v2/Templates.js +24 -18
  88. package/es/schema-component/antd/form-v2/utils.js +3 -3
  89. package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +1 -1
  90. package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +3 -3
  91. package/es/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
  92. package/es/schema-component/antd/gantt/components/gantt/style.js +1 -1
  93. package/es/schema-component/antd/gantt/components/grid/grid.d.ts +2 -2
  94. package/es/schema-component/antd/gantt/components/grid/grid.js +2 -2
  95. package/es/schema-component/antd/gantt/components/grid/style.js +1 -1
  96. package/es/schema-component/antd/gantt/components/other/arrow.d.ts +2 -2
  97. package/es/schema-component/antd/gantt/components/other/arrow.js +3 -3
  98. package/es/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +1 -1
  99. package/es/schema-component/antd/gantt/components/other/horizontal-scroll.js +1 -1
  100. package/es/schema-component/antd/gantt/components/other/style.js +1 -1
  101. package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +1 -1
  102. package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.js +1 -1
  103. package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +2 -2
  104. package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.js +6 -6
  105. package/es/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +2 -2
  106. package/es/schema-component/antd/gantt/components/task-item/bar/bar.js +9 -9
  107. package/es/schema-component/antd/gantt/components/task-item/bar/style.js +2 -2
  108. package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +2 -2
  109. package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.js +2 -2
  110. package/es/schema-component/antd/gantt/types/bar-task.d.ts +2 -2
  111. package/es/schema-component/antd/gantt/types/date-setup.d.ts +1 -1
  112. package/es/schema-component/antd/gantt/types/gantt-task-actions.d.ts +3 -3
  113. package/es/schema-component/antd/gantt/types/public-types.d.ts +1 -1
  114. package/es/schema-component/antd/grid/Grid.js +23 -9
  115. package/es/schema-component/antd/icon-picker/IconPicker.js +1 -1
  116. package/es/schema-component/antd/input/EllipsisWithTooltip.js +21 -2
  117. package/es/schema-component/antd/menu/util.js +0 -1
  118. package/es/schema-component/antd/page/Page.js +10 -2
  119. package/es/schema-component/antd/pagination/index.js +1 -1
  120. package/es/schema-component/antd/record-picker/InputRecordPicker.js +11 -9
  121. package/es/schema-component/antd/record-picker/useFieldNames.js +1 -1
  122. package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  123. package/es/schema-component/antd/remote-select/RemoteSelect.js +75 -13
  124. package/es/schema-component/antd/select/ReadPretty.js +5 -2
  125. package/es/schema-component/antd/select/Select.js +3 -9
  126. package/es/schema-component/antd/table/Table.Array.js +2 -2
  127. package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +2 -138
  128. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +6 -5
  129. package/es/schema-component/antd/table-v2/Table.js +2 -2
  130. package/es/schema-component/antd/upload/ReadPretty.js +2 -1
  131. package/es/schema-component/antd/variable/Input.js +12 -7
  132. package/es/schema-component/antd/variable/JSONInput.js +4 -4
  133. package/es/schema-component/antd/variable/TextArea.js +1 -1
  134. package/es/schema-component/antd/variable/Variable.d.ts +2 -0
  135. package/es/schema-component/antd/variable/Variable.js +7 -4
  136. package/es/schema-component/antd/variable/VariableSelect.js +8 -8
  137. package/es/schema-component/antd/variable/XButton.d.ts +1 -1
  138. package/es/schema-component/antd/variable/XButton.js +4 -4
  139. package/es/schema-component/common/utils/uitls.d.ts +9 -0
  140. package/es/schema-component/common/utils/uitls.js +37 -3
  141. package/es/schema-component/core/DesignableSwitch.js +5 -3
  142. package/es/schema-component/hooks/useComponent.js +2 -2
  143. package/es/schema-component/hooks/useDesignable.js +2 -2
  144. package/es/schema-component/hooks/useFieldTitle.js +4 -4
  145. package/es/schema-initializer/SchemaInitializer.js +2 -2
  146. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +14 -7
  147. package/es/schema-initializer/items/DestroyActionInitializer.js +2 -2
  148. package/es/schema-initializer/items/FilterActionInitializer.js +2 -2
  149. package/es/schema-initializer/items/FormBlockInitializer.js +3 -3
  150. package/es/schema-initializer/items/G2PlotInitializer.js +1 -1
  151. package/es/schema-initializer/items/KanbanBlockInitializer.js +9 -9
  152. package/es/schema-initializer/items/MarkdownBlockInitializer.js +3 -3
  153. package/es/schema-initializer/items/PrintActionInitializer.js +2 -2
  154. package/es/schema-initializer/items/RecordAssociationBlockInitializer.js +5 -5
  155. package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +9 -9
  156. package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +5 -5
  157. package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.js +4 -4
  158. package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +5 -5
  159. package/es/schema-initializer/items/RefreshActionInitializer.js +2 -2
  160. package/es/schema-initializer/items/SubmitActionInitializer.js +2 -2
  161. package/es/schema-initializer/items/TableActionColumnInitializer.js +2 -2
  162. package/es/schema-initializer/items/TableCollectionFieldInitializer.js +2 -2
  163. package/es/schema-initializer/items/TableSelectorInitializer.js +5 -5
  164. package/es/schema-initializer/items/UpdateActionInitializer.js +2 -2
  165. package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +2 -2
  166. package/es/schema-initializer/items/ViewActionInitializer.js +2 -2
  167. package/es/schema-initializer/utils.js +54 -45
  168. package/es/schema-settings/DataTemplates/FormDataTemplates.js +28 -12
  169. package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -1
  170. package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +9 -2
  171. package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +2 -1
  172. package/es/schema-settings/SchemaSettings.d.ts +4 -1
  173. package/es/schema-settings/SchemaSettings.js +32 -19
  174. package/es/schema-settings/VariableInput/VariableInput.d.ts +14 -0
  175. package/es/schema-settings/VariableInput/VariableInput.js +39 -0
  176. package/es/schema-settings/VariableInput/hooks/useDateVariable.d.ts +4 -0
  177. package/es/schema-settings/VariableInput/hooks/useDateVariable.js +129 -0
  178. package/es/schema-settings/VariableInput/hooks/useUserVariable.d.ts +5 -0
  179. package/es/schema-settings/VariableInput/hooks/useUserVariable.js +68 -0
  180. package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -0
  181. package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +18 -0
  182. package/es/user/VerificationCode.js +7 -8
  183. package/lib/acl/Configuration/FilterDynamicComponent.d.ts +2 -0
  184. package/lib/{schema-component/antd/table-v2/hooks/useUserVariable.js → acl/Configuration/FilterDynamicComponent.js} +32 -4
  185. package/lib/acl/Configuration/schemas/scopes.js +3 -0
  186. package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
  187. package/lib/api-client/hooks/useRequest.d.ts +1 -14
  188. package/lib/api-client/hooks/useRequest.js +48 -53
  189. package/lib/application/Application.d.ts +1 -0
  190. package/lib/application/Application.js +12 -2
  191. package/lib/block-provider/FormFieldProvider.js +9 -1
  192. package/lib/block-provider/TableSelectorProvider.js +3 -2
  193. package/lib/block-provider/hooks/index.d.ts +1 -1
  194. package/lib/block-provider/hooks/index.js +47 -33
  195. package/lib/board/CardAdder.js +1 -1
  196. package/lib/board/ColumnForm.js +4 -4
  197. package/lib/board/DefaultColumnHeader.d.ts +1 -1
  198. package/lib/board/DefaultColumnHeader.js +6 -6
  199. package/lib/collection-manager/CollectionField.js +16 -13
  200. package/lib/collection-manager/CollectionManagerProvider.js +10 -2
  201. package/lib/collection-manager/Configuration/AddCollectionAction.js +1 -1
  202. package/lib/collection-manager/Configuration/CollectionFields.d.ts +2 -0
  203. package/lib/collection-manager/Configuration/CollectionFields.js +468 -0
  204. package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +3 -3
  205. package/lib/collection-manager/Configuration/ConfigurationTable.js +4 -2
  206. package/lib/collection-manager/Configuration/ConfigurationTabs.js +5 -1
  207. package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
  208. package/lib/collection-manager/Configuration/EditCollectionAction.js +4 -4
  209. package/lib/collection-manager/Configuration/EditFieldAction.js +2 -1
  210. package/lib/collection-manager/Configuration/OverridingCollectionField.js +2 -1
  211. package/lib/collection-manager/Configuration/schemas/collectionFields.d.ts +2 -0
  212. package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -1
  213. package/lib/collection-manager/Configuration/schemas/collections.js +8 -5
  214. package/lib/collection-manager/action-hooks.d.ts +5 -43
  215. package/lib/collection-manager/action-hooks.js +13 -9
  216. package/lib/collection-manager/hooks/useCollectionManager.d.ts +1 -0
  217. package/lib/collection-manager/hooks/useCollectionManager.js +2 -0
  218. package/lib/collection-manager/interfaces/checkbox.js +7 -0
  219. package/lib/collection-manager/interfaces/checkboxGroup.js +7 -0
  220. package/lib/collection-manager/interfaces/components/index.js +1 -1
  221. package/lib/collection-manager/interfaces/createdBy.js +5 -1
  222. package/lib/collection-manager/interfaces/email.js +7 -0
  223. package/lib/collection-manager/interfaces/linkTo.js +8 -1
  224. package/lib/collection-manager/interfaces/m2m.js +8 -1
  225. package/lib/collection-manager/interfaces/m2o.js +8 -1
  226. package/lib/collection-manager/interfaces/multipleSelect.js +10 -0
  227. package/lib/collection-manager/interfaces/o2m.js +10 -2
  228. package/lib/collection-manager/interfaces/o2o.js +12 -3
  229. package/lib/collection-manager/interfaces/percent.js +10 -0
  230. package/lib/collection-manager/interfaces/select.js +10 -0
  231. package/lib/collection-manager/interfaces/types.d.ts +2 -0
  232. package/lib/collection-manager/interfaces/updatedBy.js +5 -1
  233. package/lib/collection-manager/sub-table.d.ts +1 -14
  234. package/lib/collection-manager/types.d.ts +1 -0
  235. package/lib/filter-provider/utils.d.ts +8 -3
  236. package/lib/filter-provider/utils.js +44 -28
  237. package/lib/locale/en_US.d.ts +8 -1
  238. package/lib/locale/en_US.js +9 -2
  239. package/lib/locale/ja_JP.d.ts +16 -1
  240. package/lib/locale/ja_JP.js +18 -3
  241. package/lib/locale/pt_BR.d.ts +17 -1
  242. package/lib/locale/pt_BR.js +19 -3
  243. package/lib/locale/ru_RU.d.ts +15 -0
  244. package/lib/locale/ru_RU.js +17 -2
  245. package/lib/locale/tr_TR.d.ts +16 -1
  246. package/lib/locale/tr_TR.js +18 -3
  247. package/lib/locale/zh_CN.d.ts +17 -1
  248. package/lib/locale/zh_CN.js +18 -2
  249. package/lib/pm/PluginManagerLink.js +4 -2
  250. package/lib/pm/index.js +1 -1
  251. package/lib/schema-component/antd/action/Action.js +1 -1
  252. package/lib/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
  253. package/lib/schema-component/antd/association-select/AssociationSelect.js +65 -35
  254. package/lib/schema-component/antd/association-select/useServiceOptions.js +3 -2
  255. package/lib/schema-component/antd/checkbox/Checkbox.js +4 -3
  256. package/lib/schema-component/antd/collection-select/CollectionSelect.d.ts +2 -2
  257. package/lib/schema-component/antd/error-fallback/ErrorFallback.d.ts +3 -0
  258. package/lib/schema-component/antd/error-fallback/ErrorFallback.js +55 -0
  259. package/lib/schema-component/antd/error-fallback/index.d.ts +1 -0
  260. package/lib/schema-component/antd/error-fallback/index.js +16 -0
  261. package/lib/schema-component/antd/filter/useFilterActionProps.d.ts +2 -0
  262. package/lib/schema-component/antd/filter/useFilterActionProps.js +130 -8
  263. package/lib/schema-component/antd/filter/useValues.js +6 -7
  264. package/lib/schema-component/antd/form-item/FormItem.d.ts +3 -0
  265. package/lib/schema-component/antd/form-item/FormItem.js +102 -19
  266. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +1 -2
  267. package/lib/schema-component/antd/form-v2/Templates.js +24 -18
  268. package/lib/schema-component/antd/form-v2/utils.js +3 -4
  269. package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +1 -1
  270. package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +2 -2
  271. package/lib/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
  272. package/lib/schema-component/antd/gantt/components/gantt/style.js +1 -1
  273. package/lib/schema-component/antd/gantt/components/grid/grid.d.ts +2 -2
  274. package/lib/schema-component/antd/gantt/components/grid/style.js +1 -1
  275. package/lib/schema-component/antd/gantt/components/other/arrow.d.ts +2 -2
  276. package/lib/schema-component/antd/gantt/components/other/arrow.js +2 -2
  277. package/lib/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +1 -1
  278. package/lib/schema-component/antd/gantt/components/other/style.js +1 -1
  279. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +1 -1
  280. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +2 -2
  281. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.js +2 -2
  282. package/lib/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +2 -2
  283. package/lib/schema-component/antd/gantt/components/task-item/bar/bar.js +4 -4
  284. package/lib/schema-component/antd/gantt/components/task-item/bar/style.js +2 -2
  285. package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +2 -2
  286. package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.js +1 -1
  287. package/lib/schema-component/antd/gantt/types/bar-task.d.ts +2 -2
  288. package/lib/schema-component/antd/gantt/types/date-setup.d.ts +1 -1
  289. package/lib/schema-component/antd/gantt/types/gantt-task-actions.d.ts +3 -3
  290. package/lib/schema-component/antd/gantt/types/public-types.d.ts +1 -1
  291. package/lib/schema-component/antd/grid/Grid.js +23 -9
  292. package/lib/schema-component/antd/input/EllipsisWithTooltip.js +20 -1
  293. package/lib/schema-component/antd/menu/util.js +0 -1
  294. package/lib/schema-component/antd/page/Page.js +9 -1
  295. package/lib/schema-component/antd/pagination/index.js +1 -1
  296. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +11 -9
  297. package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  298. package/lib/schema-component/antd/remote-select/RemoteSelect.js +75 -12
  299. package/lib/schema-component/antd/select/ReadPretty.js +5 -2
  300. package/lib/schema-component/antd/select/Select.js +3 -9
  301. package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +3 -139
  302. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +6 -5
  303. package/lib/schema-component/antd/table-v2/Table.js +2 -2
  304. package/lib/schema-component/antd/upload/ReadPretty.js +2 -1
  305. package/lib/schema-component/antd/variable/Input.js +11 -6
  306. package/lib/schema-component/antd/variable/JSONInput.js +2 -2
  307. package/lib/schema-component/antd/variable/TextArea.js +1 -1
  308. package/lib/schema-component/antd/variable/Variable.d.ts +2 -0
  309. package/lib/schema-component/antd/variable/Variable.js +6 -2
  310. package/lib/schema-component/antd/variable/VariableSelect.js +4 -4
  311. package/lib/schema-component/antd/variable/XButton.d.ts +1 -1
  312. package/lib/schema-component/antd/variable/XButton.js +1 -1
  313. package/lib/schema-component/common/utils/uitls.d.ts +9 -0
  314. package/lib/schema-component/common/utils/uitls.js +43 -4
  315. package/lib/schema-component/core/DesignableSwitch.js +4 -2
  316. package/lib/schema-component/hooks/useComponent.js +2 -2
  317. package/lib/schema-component/hooks/useDesignable.js +2 -2
  318. package/lib/schema-initializer/SchemaInitializer.js +2 -2
  319. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +14 -7
  320. package/lib/schema-initializer/utils.js +53 -44
  321. package/lib/schema-settings/DataTemplates/FormDataTemplates.js +28 -12
  322. package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -1
  323. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +9 -2
  324. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +2 -1
  325. package/lib/schema-settings/SchemaSettings.d.ts +4 -1
  326. package/lib/schema-settings/SchemaSettings.js +37 -21
  327. package/lib/schema-settings/VariableInput/VariableInput.d.ts +14 -0
  328. package/lib/schema-settings/VariableInput/VariableInput.js +49 -0
  329. package/lib/schema-settings/VariableInput/hooks/useDateVariable.d.ts +4 -0
  330. package/lib/schema-settings/VariableInput/hooks/useDateVariable.js +136 -0
  331. package/lib/schema-settings/VariableInput/hooks/useUserVariable.d.ts +5 -0
  332. package/lib/schema-settings/VariableInput/hooks/useUserVariable.js +75 -0
  333. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -0
  334. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +25 -0
  335. package/lib/user/VerificationCode.js +1 -2
  336. package/package.json +6 -5
  337. package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +0 -10
  338. package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +0 -10
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function FilterDynamicComponent(props: any): JSX.Element;
@@ -1,4 +1,8 @@
1
- import { useFilterOptions } from '../../filter';
1
+ import React from 'react';
2
+ import { useCompile } from '../../schema-component';
3
+ import { useFilterOptions } from '../../schema-component/antd/filter';
4
+ import { useValues } from '../../schema-component/antd/filter/useValues';
5
+ import { Variable } from '../../schema-component/antd/variable';
2
6
  var useOptions = function useOptions(collectionName, _ref) {
3
7
  var schema = _ref.schema,
4
8
  operator = _ref.operator,
@@ -36,13 +40,13 @@ var useOptions = function useOptions(collectionName, _ref) {
36
40
  });
37
41
  return result;
38
42
  };
39
- export var useUserVariable = function useUserVariable(_ref2) {
43
+ var useUserVariable = function useUserVariable(_ref2) {
40
44
  var schema = _ref2.schema,
41
45
  operator = _ref2.operator;
42
46
  var options = useOptions('users', {
43
47
  schema: schema,
44
48
  operator: operator,
45
- maxDepth: 3
49
+ maxDepth: 1
46
50
  }) || [];
47
51
  return {
48
52
  label: "{{t(\"Current user\")}}",
@@ -53,4 +57,28 @@ export var useUserVariable = function useUserVariable(_ref2) {
53
57
  }),
54
58
  children: options
55
59
  };
56
- };
60
+ };
61
+ var useVariableOptions = function useVariableOptions() {
62
+ var _useValues = useValues(),
63
+ operator = _useValues.operator,
64
+ schema = _useValues.schema;
65
+ var userVariable = useUserVariable({
66
+ schema: schema,
67
+ operator: operator
68
+ });
69
+ if (!operator || !schema) return [];
70
+ return [userVariable];
71
+ };
72
+ export function FilterDynamicComponent(props) {
73
+ var value = props.value,
74
+ onChange = props.onChange,
75
+ renderSchemaComponent = props.renderSchemaComponent;
76
+ var options = useVariableOptions();
77
+ var compile = useCompile();
78
+ var scope = compile(options);
79
+ return /*#__PURE__*/React.createElement(Variable.Input, {
80
+ value: value,
81
+ onChange: onChange,
82
+ scope: scope
83
+ }, renderSchemaComponent());
84
+ }
@@ -1,6 +1,7 @@
1
1
  import { useContext, useEffect } from 'react';
2
2
  import { useFormBlockContext } from '../../../block-provider';
3
3
  import { useFilterOptions } from '../../../schema-component';
4
+ import { FilterDynamicComponent } from '../FilterDynamicComponent';
4
5
  import { RoleResourceCollectionContext } from '../RolesResourcesActions';
5
6
  export var rolesResourcesScopesCollection = {
6
7
  name: 'rolesResourcesScopes',
@@ -139,6 +140,7 @@ export var scopesSchema = {
139
140
  'x-decorator': 'FormItem',
140
141
  'x-component': 'Filter',
141
142
  'x-component-props': {
143
+ dynamicComponent: FilterDynamicComponent,
142
144
  useProps: function useProps() {
143
145
  var ctx = useContext(RoleResourceCollectionContext);
144
146
  var options = useFilterOptions(ctx.name);
@@ -267,6 +269,7 @@ export var scopesSchema = {
267
269
  'x-decorator': 'FormItem',
268
270
  'x-component': 'Filter',
269
271
  'x-component-props': {
272
+ dynamicComponent: FilterDynamicComponent,
270
273
  useProps: function useProps() {
271
274
  var ctx = useContext(RoleResourceCollectionContext);
272
275
  var options = useFilterOptions(ctx.name);
@@ -1,14 +1 @@
1
- export declare const useRoleResourceValues: (options: any) => {
2
- state: {};
3
- setState: import("ahooks/lib/useSetState").SetState<{}>;
4
- loading: boolean;
5
- data?: any;
6
- error?: Error;
7
- params: any;
8
- cancel: () => void;
9
- refresh: () => void;
10
- refreshAsync: () => Promise<any>;
11
- run: (...params: any) => void;
12
- runAsync: (...params: any) => Promise<any>;
13
- mutate: (data?: any) => void;
14
- };
1
+ export declare const useRoleResourceValues: (options: any) => any;
@@ -9,18 +9,5 @@ export declare type ResourceActionOptions<P = any> = {
9
9
  };
10
10
  export declare function useRequest<P>(service: AxiosRequestConfig<P> | ResourceActionOptions<P> | FunctionService, options?: Options<any, any> & {
11
11
  uid?: string;
12
- }): {
13
- state: {};
14
- setState: import("ahooks/lib/useSetState").SetState<{}>;
15
- loading: boolean;
16
- data?: any;
17
- error?: Error;
18
- params: any;
19
- cancel: () => void;
20
- refresh: () => void;
21
- refreshAsync: () => Promise<any>;
22
- run: (...params: any) => void;
23
- runAsync: (...params: any) => Promise<any>;
24
- mutate: (data?: any) => void;
25
- };
12
+ }): any;
26
13
  export {};
@@ -1,12 +1,12 @@
1
1
  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); }
2
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
2
  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
3
  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
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
6
  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); }
7
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
8
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
10
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
11
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
12
  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); }
@@ -28,64 +28,59 @@ export function useRequest(service) {
28
28
  state = _useSetState2[0],
29
29
  setState = _useSetState2[1];
30
30
  var api = useContext(APIClientContext);
31
+ var tempOptions, tempService;
31
32
  if (typeof service === 'function') {
32
- var _result = useReq(service, _objectSpread(_objectSpread({}, options), {}, {
33
- onSuccess: function onSuccess() {
34
- var _options$onSuccess;
35
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
36
- args[_key] = arguments[_key];
37
- }
38
- (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call.apply(_options$onSuccess, [options].concat(args));
39
- if (options.uid) {
40
- api.services[options.uid] = _result;
41
- }
42
- }
43
- }));
44
- return _objectSpread(_objectSpread({}, _result), {}, {
45
- state: state,
46
- setState: setState
47
- });
48
- }
49
- var result = useReq( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
50
- var params,
51
- resource,
52
- args,
53
- response,
54
- _args = arguments;
55
- return _regeneratorRuntime().wrap(function _callee$(_context) {
56
- while (1) switch (_context.prev = _context.next) {
57
- case 0:
58
- params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
59
- resource = service.resource;
60
- args = cloneDeep(service);
61
- if (resource) {
62
- args.params = args.params || {};
63
- assign(args.params, params);
64
- } else {
65
- args = merge(args, params);
33
+ tempService = service;
34
+ } else {
35
+ tempService = /*#__PURE__*/function () {
36
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
37
+ var params,
38
+ resource,
39
+ args,
40
+ response,
41
+ _args = arguments;
42
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
43
+ while (1) switch (_context.prev = _context.next) {
44
+ case 0:
45
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
46
+ resource = service.resource;
47
+ args = cloneDeep(service);
48
+ if (resource) {
49
+ args.params = args.params || {};
50
+ assign(args.params, params);
51
+ } else {
52
+ args = merge(args, params);
53
+ }
54
+ _context.next = 6;
55
+ return api.request(args);
56
+ case 6:
57
+ response = _context.sent;
58
+ return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
59
+ case 8:
60
+ case "end":
61
+ return _context.stop();
66
62
  }
67
- _context.next = 6;
68
- return api.request(args);
69
- case 6:
70
- response = _context.sent;
71
- return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
72
- case 8:
73
- case "end":
74
- return _context.stop();
75
- }
76
- }, _callee);
77
- })), _objectSpread(_objectSpread({}, options), {}, {
63
+ }, _callee);
64
+ }));
65
+ return function tempService() {
66
+ return _ref.apply(this, arguments);
67
+ };
68
+ }();
69
+ }
70
+ tempOptions = _objectSpread(_objectSpread({}, options), {}, {
78
71
  onSuccess: function onSuccess() {
79
- var _options$onSuccess2;
80
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
81
- args[_key2] = arguments[_key2];
72
+ var _options$onSuccess;
73
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
74
+ args[_key] = arguments[_key];
82
75
  }
83
- (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 ? void 0 : _options$onSuccess2.call.apply(_options$onSuccess2, [options].concat(args));
76
+ // @ts-ignore
77
+ (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call.apply(_options$onSuccess, [options].concat(args));
84
78
  if (options.uid) {
85
79
  api.services[options.uid] = result;
86
80
  }
87
81
  }
88
- }));
82
+ });
83
+ var result = useReq(tempService, tempOptions);
89
84
  return _objectSpread(_objectSpread({}, result), {}, {
90
85
  state: state,
91
86
  setState: setState
@@ -22,5 +22,6 @@ export declare class Application {
22
22
  * TODO
23
23
  */
24
24
  plugin(plugin: PluginCallback): void;
25
+ handleErrors(error: any): void;
25
26
  render(): (props: any) => JSX.Element;
26
27
  }
@@ -23,6 +23,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
23
23
  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; }
24
24
  import { Spin } from 'antd';
25
25
  import React, { useEffect, useState } from 'react';
26
+ import { ErrorBoundary } from 'react-error-boundary';
26
27
  import { I18nextProvider } from 'react-i18next';
27
28
  import { Link, NavLink } from 'react-router-dom';
28
29
  import { ACLProvider } from '../acl';
@@ -35,6 +36,7 @@ import { PinnedPluginListProvider } from '../plugin-manager';
35
36
  import PMProvider, { PluginManagerLink, SettingsCenterDropdown } from '../pm';
36
37
  import { AdminLayout, AuthLayout, RemoteRouteSwitchProvider, RouteSchemaComponent, RouteSwitch, useRoutes } from '../route-switch';
37
38
  import { AntdSchemaComponentProvider, DesignableSwitch, MenuItemInitializers, SchemaComponentProvider } from '../schema-component';
39
+ import { ErrorFallback } from '../schema-component/antd/error-fallback';
38
40
  import { SchemaInitializerProvider } from '../schema-initializer';
39
41
  import { BlockTemplateDetails, BlockTemplatePage } from '../schema-templates';
40
42
  import { SystemSettingsProvider } from '../system-settings';
@@ -156,6 +158,11 @@ export var Application = /*#__PURE__*/function () {
156
158
  value: function plugin(_plugin) {
157
159
  this.plugins.push(_plugin);
158
160
  }
161
+ }, {
162
+ key: "handleErrors",
163
+ value: function handleErrors(error) {
164
+ console.error(error);
165
+ }
159
166
  }, {
160
167
  key: "render",
161
168
  value: function render() {
@@ -226,9 +233,12 @@ export var Application = /*#__PURE__*/function () {
226
233
  if (loading) {
227
234
  return /*#__PURE__*/React.createElement(Spin, null);
228
235
  }
229
- return /*#__PURE__*/React.createElement(App, {
236
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
237
+ FallbackComponent: ErrorFallback,
238
+ onError: _this.handleErrors
239
+ }, /*#__PURE__*/React.createElement(App, {
230
240
  providers: _this.providers
231
- });
241
+ }));
232
242
  };
233
243
  }
234
244
  }]);
@@ -7,6 +7,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
7
7
  import { createForm, onFormValuesChange } from '@formily/core';
8
8
  import { useField } from '@formily/react';
9
9
  import { autorun } from '@formily/reactive';
10
+ import { forEach } from '@nocobase/utils/client';
10
11
  import { Spin } from 'antd';
11
12
  import React, { createContext, useContext, useEffect, useMemo } from 'react';
12
13
  import { RecordProvider } from '../record-provider';
@@ -39,7 +40,14 @@ var InternalFormFieldProvider = function InternalFormFieldProvider(props) {
39
40
  useEffect(function () {
40
41
  var dispose = autorun(function () {
41
42
  var _formBlockCtx$form2;
42
- form.values = (formBlockCtx === null || formBlockCtx === void 0 ? void 0 : (_formBlockCtx$form2 = formBlockCtx.form) === null || _formBlockCtx$form2 === void 0 ? void 0 : _formBlockCtx$form2.values[fieldName]) || form.values;
43
+ var data = (formBlockCtx === null || formBlockCtx === void 0 ? void 0 : (_formBlockCtx$form2 = formBlockCtx.form) === null || _formBlockCtx$form2 === void 0 ? void 0 : _formBlockCtx$form2.values[fieldName]) || {};
44
+ // 先清空表单值,再赋值,避免当值为空时,表单未被清空
45
+ form.reset();
46
+ forEach(data, function (value, key) {
47
+ if (value) {
48
+ form.values[key] = value;
49
+ }
50
+ });
43
51
  });
44
52
  return dispose;
45
53
  }, []);
@@ -18,6 +18,7 @@ import { Schema, useField, useFieldSchema } from '@formily/react';
18
18
  import uniq from 'lodash/uniq';
19
19
  import React, { createContext, useContext, useEffect, useState } from 'react';
20
20
  import { useCollectionManager } from '../collection-manager';
21
+ import { isInFilterFormBlock } from '../filter-provider';
21
22
  import { RecordProvider, useRecord } from '../record-provider';
22
23
  import { SchemaComponentOptions } from '../schema-component';
23
24
  import { BlockProvider, RenderChildrenWithAssociationFilter, useBlockRequestContext } from './BlockProvider';
@@ -189,7 +190,7 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
189
190
  }
190
191
  var extraFilter;
191
192
  if (collectionField) {
192
- if (['oho', 'o2m'].includes(collectionField.interface)) {
193
+ if (['oho', 'o2m'].includes(collectionField.interface) && !isInFilterFormBlock(fieldSchema)) {
193
194
  if (record === null || record === void 0 ? void 0 : record[collectionField.sourceKey]) {
194
195
  extraFilter = {
195
196
  $or: [_defineProperty({}, collectionField.foreignKey, {
@@ -204,7 +205,7 @@ export var TableSelectorProvider = function TableSelectorProvider(props) {
204
205
  });
205
206
  }
206
207
  }
207
- if (['obo'].includes(collectionField.interface)) {
208
+ if (['obo'].includes(collectionField.interface) && !isInFilterFormBlock(fieldSchema)) {
208
209
  var fields = getCollectionFields(collectionField.target);
209
210
  var targetField = fields.find(function (f) {
210
211
  return f.foreignKey && f.foreignKey === collectionField.foreignKey;
@@ -67,7 +67,7 @@ export declare const useAssociationFilterProps: () => {
67
67
  onSelected: (value: any) => void;
68
68
  handleSearchInput: (e: ChangeEvent<any>) => void;
69
69
  params: any;
70
- run: (...params: any) => void;
70
+ run: any;
71
71
  };
72
72
  export declare const useOptionalFieldList: () => import("../..").FieldOptions[];
73
73
  export declare const useAssociationFilterBlockProps: () => {
@@ -19,13 +19,13 @@ import parse from 'json-templates';
19
19
  import { cloneDeep } from 'lodash';
20
20
  import get from 'lodash/get';
21
21
  import omit from 'lodash/omit';
22
- import { useContext } from 'react';
22
+ import { useContext, useEffect } from 'react';
23
23
  import { useTranslation } from 'react-i18next';
24
24
  import { useHistory } from 'react-router-dom';
25
25
  import { useReactToPrint } from 'react-to-print';
26
26
  import { AssociationFilter, useFormBlockContext, useTableBlockContext } from '../..';
27
27
  import { useAPIClient, useRequest } from '../../api-client';
28
- import { useCollection } from '../../collection-manager';
28
+ import { useCollection, useCollectionManager } from '../../collection-manager';
29
29
  import { useFilterBlock } from '../../filter-provider/FilterProvider';
30
30
  import { transformToFilter } from '../../filter-provider/utils';
31
31
  import { useRecord } from '../../record-provider';
@@ -292,6 +292,10 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
292
292
  var fieldSchema = useFieldSchema();
293
293
  var _useFilterBlock = useFilterBlock(),
294
294
  getDataBlocks = _useFilterBlock.getDataBlocks;
295
+ var _useCollection2 = useCollection(),
296
+ name = _useCollection2.name;
297
+ var _useCollectionManager = useCollectionManager(),
298
+ getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
295
299
  actionField.data = actionField.data || {};
296
300
  return {
297
301
  onClick: function onClick() {
@@ -322,7 +326,7 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
322
326
  case 3:
323
327
  param = ((_block$service$params = block.service.params) === null || _block$service$params === void 0 ? void 0 : _block$service$params[0]) || {}; // 保留原有的 filter
324
328
  storedFilter = ((_block$service$params2 = block.service.params) === null || _block$service$params2 === void 0 ? void 0 : (_block$service$params3 = _block$service$params2[1]) === null || _block$service$params3 === void 0 ? void 0 : _block$service$params3.filters) || {};
325
- storedFilter[uid] = removeNullCondition(transformToFilter(form.values, fieldSchema));
329
+ storedFilter[uid] = removeNullCondition(transformToFilter(form.values, fieldSchema, getCollectionJoinField, name));
326
330
  mergedFilter = mergeFilter([].concat(_toConsumableArray(Object.values(storedFilter).map(function (filter) {
327
331
  return removeNullCondition(filter);
328
332
  })), [block.defaultFilter]));
@@ -344,13 +348,14 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
344
348
  }()));
345
349
  case 5:
346
350
  actionField.data.loading = false;
347
- _context4.next = 11;
351
+ _context4.next = 12;
348
352
  break;
349
353
  case 8:
350
354
  _context4.prev = 8;
351
355
  _context4.t0 = _context4["catch"](2);
356
+ console.error(_context4.t0);
352
357
  actionField.data.loading = false;
353
- case 11:
358
+ case 12:
354
359
  case "end":
355
360
  return _context4.stop();
356
361
  }
@@ -822,9 +827,9 @@ export var useCustomizeRequestActionProps = function useCustomizeRequestActionPr
822
827
  var actionSchema = useFieldSchema();
823
828
  var compile = useCompile();
824
829
  var form = useForm();
825
- var _useCollection2 = useCollection(),
826
- fields = _useCollection2.fields,
827
- getField = _useCollection2.getField;
830
+ var _useCollection3 = useCollection(),
831
+ fields = _useCollection3.fields,
832
+ getField = _useCollection3.getField;
828
833
  var _useBlockRequestConte5 = useBlockRequestContext(),
829
834
  field = _useBlockRequestConte5.field,
830
835
  resource = _useBlockRequestConte5.resource,
@@ -964,9 +969,9 @@ export var useUpdateActionProps = function useUpdateActionProps() {
964
969
  setVisible = _useActionContext3.setVisible;
965
970
  var actionSchema = useFieldSchema();
966
971
  var history = useHistory();
967
- var _useCollection3 = useCollection(),
968
- fields = _useCollection3.fields,
969
- getField = _useCollection3.getField;
972
+ var _useCollection4 = useCollection(),
973
+ fields = _useCollection4.fields,
974
+ getField = _useCollection4.getField;
970
975
  var compile = useCompile();
971
976
  var actionField = useField();
972
977
  var _useFormBlockContext = useFormBlockContext(),
@@ -1284,9 +1289,9 @@ export var useAssociationFilterProps = function useAssociationFilterProps() {
1284
1289
  };
1285
1290
  };
1286
1291
  export var useOptionalFieldList = function useOptionalFieldList() {
1287
- var _useCollection4 = useCollection(),
1288
- _useCollection4$curre = _useCollection4.currentFields,
1289
- currentFields = _useCollection4$curre === void 0 ? [] : _useCollection4$curre;
1292
+ var _useCollection5 = useCollection(),
1293
+ _useCollection5$curre = _useCollection5.currentFields,
1294
+ currentFields = _useCollection5$curre === void 0 ? [] : _useCollection5$curre;
1290
1295
  return currentFields.filter(function (field) {
1291
1296
  return isOptionalField(field) && field.uiSchema.enum;
1292
1297
  });
@@ -1296,16 +1301,42 @@ var isOptionalField = function isOptionalField(field) {
1296
1301
  return optionalInterfaces.includes(field.interface);
1297
1302
  };
1298
1303
  export var useAssociationFilterBlockProps = function useAssociationFilterBlockProps() {
1304
+ var _fieldSchema$xCompon4, _fieldSchema$xCompon5, _field$componentProps3, _field$componentProps4;
1299
1305
  var collectionField = AssociationFilter.useAssociationField();
1300
1306
  var fieldSchema = useFieldSchema();
1301
1307
  var optionalFieldList = useOptionalFieldList();
1302
1308
  var _useFilterBlock3 = useFilterBlock(),
1303
1309
  getDataBlocks = _useFilterBlock3.getDataBlocks;
1304
1310
  var collectionFieldName = collectionField.name;
1311
+ var field = useField();
1305
1312
  var list, onSelected, handleSearchInput, params, run, data, valueKey, labelKey, filterKey;
1313
+ valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
1314
+ labelKey = ((_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : (_fieldSchema$xCompon5 = _fieldSchema$xCompon4.fieldNames) === null || _fieldSchema$xCompon5 === void 0 ? void 0 : _fieldSchema$xCompon5.label) || valueKey;
1315
+ var _useRequest2 = useRequest({
1316
+ resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target,
1317
+ action: 'list',
1318
+ params: _objectSpread({
1319
+ fields: [labelKey, valueKey],
1320
+ pageSize: 200,
1321
+ page: 1
1322
+ }, (_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : _field$componentProps4.params)
1323
+ }, {
1324
+ // 由于 选项字段不需要触发当前请求,所以当前请求更改为手动触发
1325
+ manual: true,
1326
+ debounceWait: 300
1327
+ });
1328
+ data = _useRequest2.data;
1329
+ params = _useRequest2.params;
1330
+ run = _useRequest2.run;
1331
+ useEffect(function () {
1332
+ // 由于 选项字段不需要触发当前请求,所以请求单独在 关系字段的时候触发
1333
+ if (!isOptionalField(fieldSchema)) {
1334
+ run();
1335
+ }
1336
+ }, [labelKey, valueKey, JSON.stringify(((_field$componentProps3 = field.componentProps) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.params) || {}), isOptionalField(fieldSchema)]);
1306
1337
  if (isOptionalField(fieldSchema)) {
1307
1338
  var _field$uiSchema;
1308
- var field = optionalFieldList.find(function (field) {
1339
+ var _field = optionalFieldList.find(function (field) {
1309
1340
  return field.name === fieldSchema.name;
1310
1341
  });
1311
1342
  var operatorMap = {
@@ -1314,13 +1345,13 @@ export var useAssociationFilterBlockProps = function useAssociationFilterBlockPr
1314
1345
  checkbox: '$in',
1315
1346
  checkboxGroup: '$anyOf'
1316
1347
  };
1317
- var _list = (field === null || field === void 0 ? void 0 : (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.enum) || [];
1348
+ var _list = (_field === null || _field === void 0 ? void 0 : (_field$uiSchema = _field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.enum) || [];
1318
1349
  valueKey = 'value';
1319
1350
  labelKey = 'label';
1320
1351
  list = _list;
1321
1352
  params = {};
1322
1353
  run = function run() {};
1323
- filterKey = "".concat(field.name, ".").concat(operatorMap[field.interface]);
1354
+ filterKey = "".concat(_field.name, ".").concat(operatorMap[_field.interface]);
1324
1355
  handleSearchInput = function handleSearchInput(e) {
1325
1356
  // TODO: 列表没有刷新,在这个 hook 中使用 useState 会产生 re-render 次数过多的错误
1326
1357
  var value = e.target.value;
@@ -1333,24 +1364,7 @@ export var useAssociationFilterBlockProps = function useAssociationFilterBlockPr
1333
1364
  });
1334
1365
  };
1335
1366
  } else {
1336
- var _fieldSchema$xCompon4, _fieldSchema$xCompon5, _data;
1337
- valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
1338
- labelKey = ((_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : (_fieldSchema$xCompon5 = _fieldSchema$xCompon4.fieldNames) === null || _fieldSchema$xCompon5 === void 0 ? void 0 : _fieldSchema$xCompon5.label) || valueKey;
1339
- var _useRequest2 = useRequest({
1340
- resource: collectionField.target,
1341
- action: 'list',
1342
- params: {
1343
- fields: [labelKey, valueKey],
1344
- pageSize: 200,
1345
- page: 1
1346
- }
1347
- }, {
1348
- refreshDeps: [labelKey, valueKey],
1349
- debounceWait: 300
1350
- });
1351
- data = _useRequest2.data;
1352
- params = _useRequest2.params;
1353
- run = _useRequest2.run;
1367
+ var _data;
1354
1368
  filterKey = "".concat(collectionFieldName, ".").concat(valueKey, ".$in");
1355
1369
  list = ((_data = data) === null || _data === void 0 ? void 0 : _data.data) || [];
1356
1370
  handleSearchInput = function handleSearchInput(e) {
@@ -23,7 +23,7 @@ function CardAdder(_ref) {
23
23
  return setAddingCard(false);
24
24
  }
25
25
  }) : /*#__PURE__*/React.createElement("button", {
26
- className: 'react-kanban-card-adder-button',
26
+ className: "react-kanban-card-adder-button",
27
27
  onClick: function onClick() {
28
28
  return setAddingCard(!addingCard);
29
29
  }
@@ -10,7 +10,7 @@ function ColumnForm(_ref) {
10
10
  when(inputColumnTitle.current.value)(onConfirm);
11
11
  }
12
12
  return /*#__PURE__*/React.createElement("div", {
13
- className: 'react-kanban-column',
13
+ className: "react-kanban-column",
14
14
  style: {
15
15
  minWidth: '230px'
16
16
  }
@@ -21,13 +21,13 @@ function ColumnForm(_ref) {
21
21
  },
22
22
  onSubmit: addColumn
23
23
  }, /*#__PURE__*/React.createElement("input", {
24
- type: 'text',
24
+ type: "text",
25
25
  ref: inputColumnTitle,
26
26
  autoFocus: true
27
27
  }), /*#__PURE__*/React.createElement("button", {
28
- type: 'submit'
28
+ type: "submit"
29
29
  }, "Add"), /*#__PURE__*/React.createElement("button", {
30
- type: 'button',
30
+ type: "button",
31
31
  onClick: onCancel
32
32
  }, "Cancel")));
33
33
  }