@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
@@ -221,9 +221,10 @@ export default {
221
221
  "Association fields filter": "关系筛选",
222
222
  "PK & FK fields": "主外键字段",
223
223
  "Association fields": "关系字段",
224
- "Optional fields": "可选字段",
224
+ "Choices fields": "选项字段",
225
225
  "System fields": "系统字段",
226
226
  "General fields": "普通字段",
227
+ "Inherited fields": "继承字段",
227
228
  "Parent collection fields": "父表字段",
228
229
  "Basic": "基本类型",
229
230
  "Single line text": "单行文本",
@@ -509,11 +510,13 @@ export default {
509
510
  'Dialog': '对话框',
510
511
  'Delete action': '删除操作',
511
512
  'Custom column title': '自定义列标题',
513
+ 'Column title': '列标题',
512
514
  'Original title: ': '原始标题: ',
513
515
  'Delete table column': '删除列',
514
516
  'Skip required validation': '跳过必填校验',
515
517
  'Form values': '表单值',
516
518
  'Fields values': '字段值',
519
+ 'The field has bee deleted': '字段已删除',
517
520
  'When submitting the following fields, the saved values are': '提交以下字段时,保存的值为',
518
521
  'After successful submission': '提交成功后',
519
522
  'Then': '然后',
@@ -709,6 +712,19 @@ export default {
709
712
  'Theme': '主题',
710
713
  'Default theme': '默认主题',
711
714
  'Compact theme': '紧凑主题',
715
+ "This is likely a NocoBase internals bug. Please open an issue at <1>here</1>": "这可能是 NocoBase 内部的问题,你可以在<1>这里</1>将该错误反馈给我们,我们会尽快修复",
716
+ "Render Failed": "渲染失败",
717
+ "Feedback": "反馈问题",
718
+ "Try again": "重试一下",
712
719
  'Click or drag file to this area to upload': '点击或拖拽文件到此区域上传',
713
- 'Support for a single or bulk upload, file size should not exceed': '支持单个或批量上传,文件大小不能超过'
720
+ 'Support for a single or bulk upload, file size should not exceed': '支持单个或批量上传,文件大小不能超过',
721
+ 'Default title for each record': '用作数据的默认标题',
722
+ 'If collection inherits, choose inherited collections as templates': '当前表有继承关系时,可选择继承链路上的表作为模板来源',
723
+ 'Select an existing piece of data as the initialization data for the form': '选择一条已有的数据作为表单的初始化数据',
724
+ 'Only the selected fields will be used as the initialization data for the form': '仅选择的字段才会作为表单的初始化数据',
725
+ 'Template Data': '模板数据',
726
+ 'Data fields': '数据字段',
727
+ 'Add template': '添加模板',
728
+ 'Display data template selector': '显示数据模板选择框',
729
+ 'Form data templates': '表单数据模板'
714
730
  };
@@ -11,7 +11,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
11
11
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
12
  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); }
13
13
  import { ApiOutlined, SettingOutlined } from '@ant-design/icons';
14
- import { Button, Dropdown, Menu } from 'antd';
14
+ import { Button, Dropdown, Menu, Tooltip } from 'antd';
15
15
  import React, { useContext, useState } from 'react';
16
16
  import { useTranslation } from 'react-i18next';
17
17
  import { useHistory } from 'react-router-dom';
@@ -22,13 +22,15 @@ export var PluginManagerLink = function PluginManagerLink() {
22
22
  var _useTranslation = useTranslation(),
23
23
  t = _useTranslation.t;
24
24
  var history = useHistory();
25
- return /*#__PURE__*/React.createElement(Button, {
25
+ return /*#__PURE__*/React.createElement(Tooltip, {
26
+ title: t('Plugin manager')
27
+ }, /*#__PURE__*/React.createElement(Button, {
26
28
  icon: /*#__PURE__*/React.createElement(ApiOutlined, null),
27
29
  title: t('Plugin manager'),
28
30
  onClick: function onClick() {
29
31
  history.push('/admin/pm/list');
30
32
  }
31
- });
33
+ }));
32
34
  };
33
35
  var getBookmarkTabs = function getBookmarkTabs(data) {
34
36
  var bookmarkTabs = [];
package/es/pm/index.js CHANGED
@@ -140,7 +140,7 @@ var PluginTable = function PluginTable(props) {
140
140
  case 0:
141
141
  checked = !data.enabled;
142
142
  Modal.warn({
143
- title: checked ? t('Plugin staring') : t('Plugin stopping'),
143
+ title: checked ? t('Plugin starting') : t('Plugin stopping'),
144
144
  content: t('The application is reloading, please do not close the page.'),
145
145
  okButtonProps: {
146
146
  style: {
@@ -70,7 +70,7 @@ export var Action = observer(function (props) {
70
70
  var values = useRecord();
71
71
  var designerProps = fieldSchema['x-designer-props'];
72
72
  var openMode = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon['openMode'];
73
- var disabled = form.disabled || field.disabled;
73
+ var disabled = form.disabled || field.disabled || props.disabled;
74
74
  var openSize = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2['openSize'];
75
75
  var linkageRules = (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-linkage-rules']) || [];
76
76
  var _useDesignable = useDesignable(),
@@ -63,10 +63,10 @@ export var AssociationFilterFilterBlockInitializer = function AssociationFilterF
63
63
  title: t('Association fields'),
64
64
  children: children
65
65
  };
66
- // 可选项字段
66
+ // 选项字段
67
67
  var optionalFieldGroup = {
68
68
  type: 'itemGroup',
69
- title: t('Optional fields'),
69
+ title: t('Choices fields'),
70
70
  children: optionalChildren
71
71
  };
72
72
  var dividerItem = {
@@ -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); }
@@ -13,11 +12,12 @@ import { ArrayCollapse, ArrayItems, FormLayout } from '@formily/antd';
13
12
  import { connect, mapProps, mapReadPretty, useField, useFieldSchema } from '@formily/react';
14
13
  import { uid } from '@formily/shared';
15
14
  import _ from 'lodash';
16
- import React, { useCallback, useMemo } from 'react';
15
+ import React, { useCallback, useEffect, 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,
@@ -106,6 +104,13 @@ AssociationSelect.Designer = function () {
106
104
  var defaultSort = ((_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : (_field$componentProps2 = _field$componentProps.service) === null || _field$componentProps2 === void 0 ? void 0 : (_field$componentProps3 = _field$componentProps2.params) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.sort) || [];
107
105
  var defaultFilter = ((_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : (_field$componentProps5 = _field$componentProps4.service) === null || _field$componentProps5 === void 0 ? void 0 : (_field$componentProps6 = _field$componentProps5.params) === null || _field$componentProps6 === void 0 ? void 0 : _field$componentProps6.filter) || {};
108
106
  var dataSource = useCollectionFilterOptions(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
107
+ // TODO: 这里 fieldSchema['x-read-pretty'] 的值为 true,但是 field.readPretty 的值却为 false,不知道什么原因
108
+ useEffect(function () {
109
+ // 没有这一步判断会出现禁用状态失效的情况
110
+ if (field.readPretty !== fieldSchema['x-read-pretty']) {
111
+ field.readPretty = !!fieldSchema['x-read-pretty'];
112
+ }
113
+ }, [fieldSchema['x-read-pretty']]);
109
114
  var sort = defaultSort === null || defaultSort === void 0 ? void 0 : defaultSort.map(function (item) {
110
115
  return item.startsWith('-') ? {
111
116
  field: item.substring(1),
@@ -119,7 +124,7 @@ AssociationSelect.Designer = function () {
119
124
  initialValue['required'] = field.required;
120
125
  }
121
126
  var options = targetFields.filter(function (field) {
122
- return !(field === null || field === void 0 ? void 0 : field.target) && field.type !== 'boolean';
127
+ return isTitleField(field);
123
128
  }).map(function (field) {
124
129
  var _field$uiSchema;
125
130
  return {
@@ -370,21 +375,30 @@ AssociationSelect.Designer = function () {
370
375
  });
371
376
  refresh();
372
377
  }
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, {
378
+ }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && isShowDefaultValue(collectionField, getInterface) && !isPatternDisabled(fieldSchema) && /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
374
379
  title: t('Set default value'),
375
380
  components: {
376
381
  ArrayCollapse: ArrayCollapse,
377
382
  FormLayout: FormLayout
378
383
  },
384
+ width: 800,
379
385
  schema: {
380
386
  type: 'object',
381
387
  title: t('Set default value'),
382
388
  properties: {
383
- default: _objectSpread(_objectSpread({}, collectionField.uiSchema), {}, {
389
+ default: _objectSpread(_objectSpread({}, fieldSchema || {}), {}, {
390
+ 'x-decorator': 'FormItem',
391
+ 'x-component-props': _objectSpread(_objectSpread({}, fieldSchema['x-component-props']), {}, {
392
+ component: (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? 'AssociationSelect' : undefined,
393
+ service: {
394
+ resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target
395
+ }
396
+ }),
384
397
  name: 'default',
385
398
  title: t('Default value'),
386
- 'x-decorator': 'FormItem',
387
- default: fieldSchema.default || collectionField.defaultValue
399
+ default: fieldSchema.default || collectionField.defaultValue,
400
+ 'x-read-pretty': false,
401
+ 'x-disabled': false
388
402
  })
389
403
  }
390
404
  },
@@ -405,7 +419,7 @@ AssociationSelect.Designer = function () {
405
419
  options: fieldComponentOptions,
406
420
  value: fieldSchema['x-component'],
407
421
  onChange: function onChange(type) {
408
- var _collectionField$uiSc5, _interfaceConfig$sche;
422
+ var _collectionField$uiSc4, _interfaceConfig$sche;
409
423
  var schema = {
410
424
  name: collectionField.name,
411
425
  type: 'void',
@@ -418,7 +432,7 @@ AssociationSelect.Designer = function () {
418
432
  'x-validator': fieldSchema['x-validator'],
419
433
  'x-collection-field': fieldSchema['x-collection-field'],
420
434
  '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'])
435
+ '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
436
  };
423
437
  interfaceConfig === null || interfaceConfig === void 0 ? void 0 : (_interfaceConfig$sche = interfaceConfig.schemaInitialize) === null || _interfaceConfig$sche === void 0 ? void 0 : _interfaceConfig$sche.call(interfaceConfig, schema, {
424
438
  field: collectionField,
@@ -441,6 +455,22 @@ AssociationSelect.Designer = function () {
441
455
  }
442
456
  });
443
457
  }
458
+ }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && ['o2m', 'm2m'].includes(collectionField.interface) && fieldSchema['x-component'] !== 'TableField' && /*#__PURE__*/React.createElement(SchemaSettings.SwitchItem, {
459
+ key: "multiple",
460
+ title: t('Multiple'),
461
+ checked: ((_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.multiple) === undefined ? true : fieldSchema['x-component-props'].multiple,
462
+ onChange: function onChange(value) {
463
+ var schema = _defineProperty({}, 'x-uid', fieldSchema['x-uid']);
464
+ fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
465
+ field.componentProps = field.componentProps || {};
466
+ fieldSchema['x-component-props'].multiple = value;
467
+ field.componentProps.multiple = value;
468
+ schema['x-component-props'] = fieldSchema['x-component-props'];
469
+ dn.emit('patch', {
470
+ schema: schema
471
+ });
472
+ refresh();
473
+ }
444
474
  }), /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
445
475
  title: t('Set the data scope'),
446
476
  schema: {
@@ -461,13 +491,13 @@ AssociationSelect.Designer = function () {
461
491
  }
462
492
  },
463
493
  onSubmit: function onSubmit(_ref4) {
464
- var _schema4;
494
+ var _schema5;
465
495
  var filter = _ref4.filter;
466
496
  filter = removeNullCondition(filter);
467
497
  _.set(field.componentProps, 'service.params.filter', filter);
468
498
  fieldSchema['x-component-props'] = field.componentProps;
469
499
  dn.emit('patch', {
470
- schema: (_schema4 = {}, _defineProperty(_schema4, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema4, 'x-component-props', field.componentProps), _schema4)
500
+ schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-component-props', field.componentProps), _schema5)
471
501
  });
472
502
  }
473
503
  }), /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
@@ -542,7 +572,7 @@ AssociationSelect.Designer = function () {
542
572
  }
543
573
  },
544
574
  onSubmit: function onSubmit(_ref5) {
545
- var _schema5;
575
+ var _schema6;
546
576
  var sort = _ref5.sort;
547
577
  var sortArr = sort.map(function (item) {
548
578
  return item.direction === 'desc' ? "-".concat(item.field) : item.field;
@@ -550,10 +580,10 @@ AssociationSelect.Designer = function () {
550
580
  _.set(field.componentProps, 'service.params.sort', sortArr);
551
581
  fieldSchema['x-component-props'] = field.componentProps;
552
582
  dn.emit('patch', {
553
- schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-component-props', field.componentProps), _schema5)
583
+ schema: (_schema6 = {}, _defineProperty(_schema6, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema6, 'x-component-props', field.componentProps), _schema6)
554
584
  });
555
585
  }
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, {
586
+ }), form && !(form === null || form === void 0 ? void 0 : form.readPretty) && !isPatternDisabled(fieldSchema) && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
557
587
  key: "pattern",
558
588
  title: t('Pattern'),
559
589
  options: [{
@@ -611,9 +641,9 @@ AssociationSelect.Designer = function () {
611
641
  options: options,
612
642
  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
643
  onChange: function onChange(label) {
614
- var _collectionField$uiSc6, _collectionField$uiSc7;
644
+ var _collectionField$uiSc5, _collectionField$uiSc6;
615
645
  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), {}, {
646
+ 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
647
  label: label
618
648
  });
619
649
  field.componentProps.fieldNames = fieldNames;
@@ -640,14 +670,14 @@ AssociationSelect.Designer = function () {
640
670
  * 用于筛选表单区块
641
671
  * @returns
642
672
  */
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;
673
+ AssociationSelect.FilterDesigner = function FilterDesigner() {
674
+ 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
675
  var _useCollectionManager2 = useCollectionManager(),
646
676
  getCollectionFields = _useCollectionManager2.getCollectionFields,
647
677
  getInterface = _useCollectionManager2.getInterface,
648
678
  getCollectionJoinField = _useCollectionManager2.getCollectionJoinField;
649
- var _useCollection3 = useCollection(),
650
- getField = _useCollection3.getField;
679
+ var _useCollection2 = useCollection(),
680
+ getField = _useCollection2.getField;
651
681
  var _useFormBlockContext2 = useFormBlockContext(),
652
682
  form = _useFormBlockContext2.form;
653
683
  var field = useField();
@@ -661,7 +691,7 @@ AssociationSelect.FilterDesigner = function () {
661
691
  var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
662
692
  var interfaceConfig = getInterface(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
663
693
  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;
694
+ var originalTitle = collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc7 = collectionField.uiSchema) === null || _collectionField$uiSc7 === void 0 ? void 0 : _collectionField$uiSc7.title;
665
695
  var targetFields = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) ? getCollectionFields(collectionField.target) : [];
666
696
  var initialValue = {
667
697
  title: field.title === originalTitle ? undefined : field.title
@@ -708,7 +738,7 @@ AssociationSelect.FilterDesigner = function () {
708
738
  title: {
709
739
  title: t('Field title'),
710
740
  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),
741
+ 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
742
  'x-decorator': 'FormItem',
713
743
  'x-component': 'Input',
714
744
  'x-component-props': {}
@@ -873,7 +903,7 @@ AssociationSelect.FilterDesigner = function () {
873
903
  }
874
904
  },
875
905
  onSubmit: function onSubmit(v) {
876
- var _collectionField$uiSc10;
906
+ var _collectionField$uiSc9;
877
907
  var rules = [];
878
908
  var _iterator3 = _createForOfIteratorHelper(v.rules),
879
909
  _step3;
@@ -911,7 +941,7 @@ AssociationSelect.FilterDesigner = function () {
911
941
  _iterator4.f();
912
942
  }
913
943
  }
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);
944
+ 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
945
  field.validator = concatValidator;
916
946
  fieldSchema['x-validator'] = rules;
917
947
  schema['x-validator'] = rules;
@@ -920,7 +950,7 @@ AssociationSelect.FilterDesigner = function () {
920
950
  });
921
951
  refresh();
922
952
  }
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, {
953
+ }), 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
954
  title: t('Set default value'),
925
955
  components: {
926
956
  ArrayCollapse: ArrayCollapse,
@@ -970,13 +1000,13 @@ AssociationSelect.FilterDesigner = function () {
970
1000
  }
971
1001
  },
972
1002
  onSubmit: function onSubmit(_ref9) {
973
- var _schema10;
1003
+ var _schema11;
974
1004
  var filter = _ref9.filter;
975
1005
  filter = removeNullCondition(filter);
976
1006
  _.set(field.componentProps, 'service.params.filter', filter);
977
1007
  fieldSchema['x-component-props'] = field.componentProps;
978
1008
  dn.emit('patch', {
979
- schema: (_schema10 = {}, _defineProperty(_schema10, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema10, 'x-component-props', field.componentProps), _schema10)
1009
+ schema: (_schema11 = {}, _defineProperty(_schema11, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema11, 'x-component-props', field.componentProps), _schema11)
980
1010
  });
981
1011
  }
982
1012
  }), /*#__PURE__*/React.createElement(SchemaSettings.ModalItem, {
@@ -1051,7 +1081,7 @@ AssociationSelect.FilterDesigner = function () {
1051
1081
  }
1052
1082
  },
1053
1083
  onSubmit: function onSubmit(_ref10) {
1054
- var _schema11;
1084
+ var _schema12;
1055
1085
  var sort = _ref10.sort;
1056
1086
  var sortArr = sort.map(function (item) {
1057
1087
  return item.direction === 'desc' ? "-".concat(item.field) : item.field;
@@ -1059,7 +1089,7 @@ AssociationSelect.FilterDesigner = function () {
1059
1089
  _.set(field.componentProps, 'service.params.sort', sortArr);
1060
1090
  fieldSchema['x-component-props'] = field.componentProps;
1061
1091
  dn.emit('patch', {
1062
- schema: (_schema11 = {}, _defineProperty(_schema11, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema11, 'x-component-props', field.componentProps), _schema11)
1092
+ schema: (_schema12 = {}, _defineProperty(_schema12, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema12, 'x-component-props', field.componentProps), _schema12)
1063
1093
  });
1064
1094
  }
1065
1095
  }), (collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) && ['CollectionField', 'AssociationSelect'].includes(fieldSchema['x-component']) && /*#__PURE__*/React.createElement(SchemaSettings.SelectItem, {
@@ -1068,9 +1098,9 @@ AssociationSelect.FilterDesigner = function () {
1068
1098
  options: options,
1069
1099
  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
1100
  onChange: function onChange(label) {
1071
- var _collectionField$uiSc12, _collectionField$uiSc13;
1101
+ var _collectionField$uiSc11, _collectionField$uiSc12;
1072
1102
  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), {}, {
1103
+ 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
1104
  label: label
1075
1105
  });
1076
1106
  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: () => {