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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/es/acl/Configuration/FilterDynamicComponent.d.ts +2 -0
  2. package/es/{schema-component/antd/table-v2/hooks/useUserVariable.js → acl/Configuration/FilterDynamicComponent.js} +32 -4
  3. package/es/acl/Configuration/schemas/scopes.js +3 -0
  4. package/es/application/Application.d.ts +1 -0
  5. package/es/application/Application.js +12 -2
  6. package/es/block-provider/FormFieldProvider.js +9 -1
  7. package/es/block-provider/TableSelectorProvider.js +3 -2
  8. package/es/block-provider/hooks/index.js +18 -13
  9. package/es/board/CardAdder.js +1 -1
  10. package/es/board/ColumnForm.js +4 -4
  11. package/es/board/DefaultColumnHeader.d.ts +1 -1
  12. package/es/board/DefaultColumnHeader.js +6 -6
  13. package/es/collection-manager/CollectionField.js +16 -13
  14. package/es/collection-manager/CollectionManagerProvider.js +10 -2
  15. package/es/collection-manager/Configuration/AddCollectionAction.js +1 -1
  16. package/es/collection-manager/Configuration/CollectionFields.d.ts +2 -0
  17. package/es/collection-manager/Configuration/CollectionFields.js +458 -0
  18. package/es/collection-manager/Configuration/CollectionFieldsTableArray.js +3 -3
  19. package/es/collection-manager/Configuration/ConfigurationTable.js +4 -2
  20. package/es/collection-manager/Configuration/ConfigurationTabs.js +6 -2
  21. package/es/collection-manager/Configuration/EditCollectionAction.js +4 -4
  22. package/es/collection-manager/Configuration/EditFieldAction.js +1 -1
  23. package/es/collection-manager/Configuration/OverridingCollectionField.js +1 -1
  24. package/es/collection-manager/Configuration/schemas/collectionFields.d.ts +2 -0
  25. package/es/collection-manager/Configuration/schemas/collectionFields.js +1 -1
  26. package/es/collection-manager/Configuration/schemas/collections.js +8 -5
  27. package/es/collection-manager/action-hooks.d.ts +2 -1
  28. package/es/collection-manager/action-hooks.js +10 -7
  29. package/es/collection-manager/hooks/useCollectionDataSource.js +2 -2
  30. package/es/collection-manager/hooks/useCollectionManager.d.ts +1 -0
  31. package/es/collection-manager/hooks/useCollectionManager.js +2 -0
  32. package/es/collection-manager/interfaces/checkbox.js +7 -0
  33. package/es/collection-manager/interfaces/checkboxGroup.js +7 -0
  34. package/es/collection-manager/interfaces/components/index.js +1 -1
  35. package/es/collection-manager/interfaces/createdBy.js +5 -1
  36. package/es/collection-manager/interfaces/email.js +7 -0
  37. package/es/collection-manager/interfaces/linkTo.js +6 -0
  38. package/es/collection-manager/interfaces/m2m.js +6 -0
  39. package/es/collection-manager/interfaces/m2o.js +6 -0
  40. package/es/collection-manager/interfaces/multipleSelect.js +10 -0
  41. package/es/collection-manager/interfaces/o2m.js +8 -1
  42. package/es/collection-manager/interfaces/o2o.js +6 -0
  43. package/es/collection-manager/interfaces/percent.js +10 -0
  44. package/es/collection-manager/interfaces/select.js +10 -0
  45. package/es/collection-manager/interfaces/updatedBy.js +5 -1
  46. package/es/collection-manager/types.d.ts +1 -0
  47. package/es/filter-provider/utils.d.ts +8 -3
  48. package/es/filter-provider/utils.js +42 -27
  49. package/es/locale/en_US.d.ts +7 -0
  50. package/es/locale/en_US.js +8 -1
  51. package/es/locale/ja_JP.d.ts +15 -0
  52. package/es/locale/ja_JP.js +17 -2
  53. package/es/locale/pt_BR.d.ts +16 -0
  54. package/es/locale/pt_BR.js +18 -2
  55. package/es/locale/ru_RU.d.ts +15 -0
  56. package/es/locale/ru_RU.js +17 -2
  57. package/es/locale/tr_TR.d.ts +16 -1
  58. package/es/locale/tr_TR.js +18 -3
  59. package/es/locale/zh_CN.d.ts +16 -0
  60. package/es/locale/zh_CN.js +17 -1
  61. package/es/pm/PluginManagerLink.js +5 -3
  62. package/es/pm/index.js +1 -1
  63. package/es/schema-component/antd/action/Action.js +1 -1
  64. package/es/schema-component/antd/association-select/AssociationSelect.js +56 -35
  65. package/es/schema-component/antd/association-select/useServiceOptions.js +3 -2
  66. package/es/schema-component/antd/checkbox/Checkbox.js +4 -3
  67. package/es/schema-component/antd/collection-select/CollectionSelect.d.ts +2 -2
  68. package/es/schema-component/antd/collection-select/CollectionSelect.js +6 -6
  69. package/es/schema-component/antd/error-fallback/ErrorFallback.d.ts +3 -0
  70. package/es/schema-component/antd/error-fallback/ErrorFallback.js +47 -0
  71. package/es/schema-component/antd/error-fallback/index.d.ts +1 -0
  72. package/es/schema-component/antd/error-fallback/index.js +1 -0
  73. package/es/schema-component/antd/filter/useFilterActionProps.d.ts +2 -0
  74. package/es/schema-component/antd/filter/useFilterActionProps.js +127 -7
  75. package/es/schema-component/antd/filter/useValues.js +7 -8
  76. package/es/schema-component/antd/form-item/FormItem.d.ts +3 -0
  77. package/es/schema-component/antd/form-item/FormItem.js +81 -16
  78. package/es/schema-component/antd/form-item/SchemaSettingOptions.js +2 -3
  79. package/es/schema-component/antd/form-v2/Templates.js +24 -18
  80. package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +1 -1
  81. package/es/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +3 -3
  82. package/es/schema-component/antd/gantt/components/gantt/style.js +1 -1
  83. package/es/schema-component/antd/gantt/components/grid/grid.d.ts +2 -2
  84. package/es/schema-component/antd/gantt/components/grid/grid.js +2 -2
  85. package/es/schema-component/antd/gantt/components/grid/style.js +1 -1
  86. package/es/schema-component/antd/gantt/components/other/arrow.d.ts +2 -2
  87. package/es/schema-component/antd/gantt/components/other/arrow.js +3 -3
  88. package/es/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +1 -1
  89. package/es/schema-component/antd/gantt/components/other/horizontal-scroll.js +1 -1
  90. package/es/schema-component/antd/gantt/components/other/style.js +1 -1
  91. package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +1 -1
  92. package/es/schema-component/antd/gantt/components/task-item/bar/bar-display.js +1 -1
  93. package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +2 -2
  94. package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.js +6 -6
  95. package/es/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +2 -2
  96. package/es/schema-component/antd/gantt/components/task-item/bar/bar.js +9 -9
  97. package/es/schema-component/antd/gantt/components/task-item/bar/style.js +2 -2
  98. package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +2 -2
  99. package/es/schema-component/antd/gantt/components/task-item/milestone/milestone.js +2 -2
  100. package/es/schema-component/antd/gantt/types/bar-task.d.ts +2 -2
  101. package/es/schema-component/antd/gantt/types/date-setup.d.ts +1 -1
  102. package/es/schema-component/antd/gantt/types/gantt-task-actions.d.ts +3 -3
  103. package/es/schema-component/antd/gantt/types/public-types.d.ts +1 -1
  104. package/es/schema-component/antd/grid/Grid.js +23 -9
  105. package/es/schema-component/antd/icon-picker/IconPicker.js +1 -1
  106. package/es/schema-component/antd/input/EllipsisWithTooltip.js +21 -2
  107. package/es/schema-component/antd/menu/util.js +0 -1
  108. package/es/schema-component/antd/page/Page.js +10 -2
  109. package/es/schema-component/antd/pagination/index.js +1 -1
  110. package/es/schema-component/antd/record-picker/InputRecordPicker.js +3 -4
  111. package/es/schema-component/antd/record-picker/useFieldNames.js +1 -1
  112. package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  113. package/es/schema-component/antd/remote-select/RemoteSelect.js +75 -13
  114. package/es/schema-component/antd/select/ReadPretty.js +5 -2
  115. package/es/schema-component/antd/select/Select.js +3 -9
  116. package/es/schema-component/antd/table/Table.Array.js +2 -2
  117. package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +2 -138
  118. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +6 -5
  119. package/es/schema-component/antd/table-v2/Table.js +2 -2
  120. package/es/schema-component/antd/upload/ReadPretty.js +2 -1
  121. package/es/schema-component/antd/variable/Input.js +11 -5
  122. package/es/schema-component/antd/variable/JSONInput.js +4 -4
  123. package/es/schema-component/antd/variable/TextArea.js +1 -1
  124. package/es/schema-component/antd/variable/Variable.js +3 -3
  125. package/es/schema-component/antd/variable/VariableSelect.js +8 -8
  126. package/es/schema-component/antd/variable/XButton.d.ts +1 -1
  127. package/es/schema-component/antd/variable/XButton.js +4 -4
  128. package/es/schema-component/common/utils/uitls.d.ts +9 -0
  129. package/es/schema-component/common/utils/uitls.js +37 -3
  130. package/es/schema-component/core/DesignableSwitch.js +5 -3
  131. package/es/schema-component/hooks/useComponent.js +2 -2
  132. package/es/schema-component/hooks/useDesignable.js +2 -2
  133. package/es/schema-component/hooks/useFieldTitle.js +4 -4
  134. package/es/schema-initializer/SchemaInitializer.js +2 -2
  135. package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +14 -7
  136. package/es/schema-initializer/items/DestroyActionInitializer.js +2 -2
  137. package/es/schema-initializer/items/FilterActionInitializer.js +2 -2
  138. package/es/schema-initializer/items/FormBlockInitializer.js +3 -3
  139. package/es/schema-initializer/items/G2PlotInitializer.js +1 -1
  140. package/es/schema-initializer/items/KanbanBlockInitializer.js +9 -9
  141. package/es/schema-initializer/items/MarkdownBlockInitializer.js +3 -3
  142. package/es/schema-initializer/items/PrintActionInitializer.js +2 -2
  143. package/es/schema-initializer/items/RecordAssociationBlockInitializer.js +5 -5
  144. package/es/schema-initializer/items/RecordAssociationCalendarBlockInitializer.js +9 -9
  145. package/es/schema-initializer/items/RecordAssociationDetailsBlockInitializer.js +5 -5
  146. package/es/schema-initializer/items/RecordAssociationFormBlockInitializer.js +4 -4
  147. package/es/schema-initializer/items/RecordReadPrettyAssociationFormBlockInitializer.js +5 -5
  148. package/es/schema-initializer/items/RefreshActionInitializer.js +2 -2
  149. package/es/schema-initializer/items/SubmitActionInitializer.js +2 -2
  150. package/es/schema-initializer/items/TableActionColumnInitializer.js +2 -2
  151. package/es/schema-initializer/items/TableCollectionFieldInitializer.js +2 -2
  152. package/es/schema-initializer/items/TableSelectorInitializer.js +5 -5
  153. package/es/schema-initializer/items/UpdateActionInitializer.js +2 -2
  154. package/es/schema-initializer/items/UpdateSubmitActionInitializer.js +2 -2
  155. package/es/schema-initializer/items/ViewActionInitializer.js +2 -2
  156. package/es/schema-initializer/utils.js +17 -10
  157. package/es/schema-settings/DataTemplates/FormDataTemplates.js +28 -12
  158. package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -1
  159. package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +9 -2
  160. package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +2 -1
  161. package/es/schema-settings/SchemaSettings.d.ts +4 -1
  162. package/es/schema-settings/SchemaSettings.js +32 -19
  163. package/es/schema-settings/VariableInput/VariableInput.d.ts +13 -0
  164. package/es/schema-settings/VariableInput/VariableInput.js +37 -0
  165. package/es/schema-settings/VariableInput/hooks/useDateVariable.d.ts +4 -0
  166. package/es/schema-settings/VariableInput/hooks/useDateVariable.js +129 -0
  167. package/es/schema-settings/VariableInput/hooks/useUserVariable.d.ts +5 -0
  168. package/es/schema-settings/VariableInput/hooks/useUserVariable.js +68 -0
  169. package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -0
  170. package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +18 -0
  171. package/es/user/VerificationCode.js +7 -8
  172. package/lib/acl/Configuration/FilterDynamicComponent.d.ts +2 -0
  173. package/lib/{schema-component/antd/table-v2/hooks/useUserVariable.js → acl/Configuration/FilterDynamicComponent.js} +32 -4
  174. package/lib/acl/Configuration/schemas/scopes.js +3 -0
  175. package/lib/application/Application.d.ts +1 -0
  176. package/lib/application/Application.js +12 -2
  177. package/lib/block-provider/FormFieldProvider.js +9 -1
  178. package/lib/block-provider/TableSelectorProvider.js +3 -2
  179. package/lib/block-provider/hooks/index.js +17 -12
  180. package/lib/board/CardAdder.js +1 -1
  181. package/lib/board/ColumnForm.js +4 -4
  182. package/lib/board/DefaultColumnHeader.d.ts +1 -1
  183. package/lib/board/DefaultColumnHeader.js +6 -6
  184. package/lib/collection-manager/CollectionField.js +16 -13
  185. package/lib/collection-manager/CollectionManagerProvider.js +10 -2
  186. package/lib/collection-manager/Configuration/AddCollectionAction.js +1 -1
  187. package/lib/collection-manager/Configuration/CollectionFields.d.ts +2 -0
  188. package/lib/collection-manager/Configuration/CollectionFields.js +468 -0
  189. package/lib/collection-manager/Configuration/CollectionFieldsTableArray.js +3 -3
  190. package/lib/collection-manager/Configuration/ConfigurationTable.js +4 -2
  191. package/lib/collection-manager/Configuration/ConfigurationTabs.js +5 -1
  192. package/lib/collection-manager/Configuration/EditCollectionAction.js +4 -4
  193. package/lib/collection-manager/Configuration/EditFieldAction.js +1 -1
  194. package/lib/collection-manager/Configuration/OverridingCollectionField.js +1 -1
  195. package/lib/collection-manager/Configuration/schemas/collectionFields.d.ts +2 -0
  196. package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -1
  197. package/lib/collection-manager/Configuration/schemas/collections.js +8 -5
  198. package/lib/collection-manager/action-hooks.d.ts +2 -1
  199. package/lib/collection-manager/action-hooks.js +13 -9
  200. package/lib/collection-manager/hooks/useCollectionManager.d.ts +1 -0
  201. package/lib/collection-manager/hooks/useCollectionManager.js +2 -0
  202. package/lib/collection-manager/interfaces/checkbox.js +7 -0
  203. package/lib/collection-manager/interfaces/checkboxGroup.js +7 -0
  204. package/lib/collection-manager/interfaces/components/index.js +1 -1
  205. package/lib/collection-manager/interfaces/createdBy.js +5 -1
  206. package/lib/collection-manager/interfaces/email.js +7 -0
  207. package/lib/collection-manager/interfaces/linkTo.js +6 -0
  208. package/lib/collection-manager/interfaces/m2m.js +6 -0
  209. package/lib/collection-manager/interfaces/m2o.js +6 -0
  210. package/lib/collection-manager/interfaces/multipleSelect.js +10 -0
  211. package/lib/collection-manager/interfaces/o2m.js +8 -1
  212. package/lib/collection-manager/interfaces/o2o.js +6 -0
  213. package/lib/collection-manager/interfaces/percent.js +10 -0
  214. package/lib/collection-manager/interfaces/select.js +10 -0
  215. package/lib/collection-manager/interfaces/updatedBy.js +5 -1
  216. package/lib/collection-manager/types.d.ts +1 -0
  217. package/lib/filter-provider/utils.d.ts +8 -3
  218. package/lib/filter-provider/utils.js +44 -28
  219. package/lib/locale/en_US.d.ts +7 -0
  220. package/lib/locale/en_US.js +8 -1
  221. package/lib/locale/ja_JP.d.ts +15 -0
  222. package/lib/locale/ja_JP.js +17 -2
  223. package/lib/locale/pt_BR.d.ts +16 -0
  224. package/lib/locale/pt_BR.js +18 -2
  225. package/lib/locale/ru_RU.d.ts +15 -0
  226. package/lib/locale/ru_RU.js +17 -2
  227. package/lib/locale/tr_TR.d.ts +16 -1
  228. package/lib/locale/tr_TR.js +18 -3
  229. package/lib/locale/zh_CN.d.ts +16 -0
  230. package/lib/locale/zh_CN.js +17 -1
  231. package/lib/pm/PluginManagerLink.js +4 -2
  232. package/lib/pm/index.js +1 -1
  233. package/lib/schema-component/antd/action/Action.js +1 -1
  234. package/lib/schema-component/antd/association-select/AssociationSelect.js +55 -34
  235. package/lib/schema-component/antd/association-select/useServiceOptions.js +3 -2
  236. package/lib/schema-component/antd/checkbox/Checkbox.js +4 -3
  237. package/lib/schema-component/antd/collection-select/CollectionSelect.d.ts +2 -2
  238. package/lib/schema-component/antd/error-fallback/ErrorFallback.d.ts +3 -0
  239. package/lib/schema-component/antd/error-fallback/ErrorFallback.js +55 -0
  240. package/lib/schema-component/antd/error-fallback/index.d.ts +1 -0
  241. package/lib/schema-component/antd/error-fallback/index.js +16 -0
  242. package/lib/schema-component/antd/filter/useFilterActionProps.d.ts +2 -0
  243. package/lib/schema-component/antd/filter/useFilterActionProps.js +130 -8
  244. package/lib/schema-component/antd/filter/useValues.js +6 -7
  245. package/lib/schema-component/antd/form-item/FormItem.d.ts +3 -0
  246. package/lib/schema-component/antd/form-item/FormItem.js +81 -15
  247. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +1 -2
  248. package/lib/schema-component/antd/form-v2/Templates.js +24 -18
  249. package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.d.ts +1 -1
  250. package/lib/schema-component/antd/gantt/components/calendar/top-part-of-calendar.js +2 -2
  251. package/lib/schema-component/antd/gantt/components/gantt/style.js +1 -1
  252. package/lib/schema-component/antd/gantt/components/grid/grid.d.ts +2 -2
  253. package/lib/schema-component/antd/gantt/components/grid/style.js +1 -1
  254. package/lib/schema-component/antd/gantt/components/other/arrow.d.ts +2 -2
  255. package/lib/schema-component/antd/gantt/components/other/arrow.js +2 -2
  256. package/lib/schema-component/antd/gantt/components/other/horizontal-scroll.d.ts +1 -1
  257. package/lib/schema-component/antd/gantt/components/other/style.js +1 -1
  258. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-display.d.ts +1 -1
  259. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.d.ts +2 -2
  260. package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.js +2 -2
  261. package/lib/schema-component/antd/gantt/components/task-item/bar/bar.d.ts +2 -2
  262. package/lib/schema-component/antd/gantt/components/task-item/bar/bar.js +4 -4
  263. package/lib/schema-component/antd/gantt/components/task-item/bar/style.js +2 -2
  264. package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.d.ts +2 -2
  265. package/lib/schema-component/antd/gantt/components/task-item/milestone/milestone.js +1 -1
  266. package/lib/schema-component/antd/gantt/types/bar-task.d.ts +2 -2
  267. package/lib/schema-component/antd/gantt/types/date-setup.d.ts +1 -1
  268. package/lib/schema-component/antd/gantt/types/gantt-task-actions.d.ts +3 -3
  269. package/lib/schema-component/antd/gantt/types/public-types.d.ts +1 -1
  270. package/lib/schema-component/antd/grid/Grid.js +23 -9
  271. package/lib/schema-component/antd/input/EllipsisWithTooltip.js +20 -1
  272. package/lib/schema-component/antd/menu/util.js +0 -1
  273. package/lib/schema-component/antd/page/Page.js +9 -1
  274. package/lib/schema-component/antd/pagination/index.js +1 -1
  275. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +3 -4
  276. package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  277. package/lib/schema-component/antd/remote-select/RemoteSelect.js +75 -12
  278. package/lib/schema-component/antd/select/ReadPretty.js +5 -2
  279. package/lib/schema-component/antd/select/Select.js +3 -9
  280. package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +3 -139
  281. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +6 -5
  282. package/lib/schema-component/antd/table-v2/Table.js +2 -2
  283. package/lib/schema-component/antd/upload/ReadPretty.js +2 -1
  284. package/lib/schema-component/antd/variable/Input.js +10 -4
  285. package/lib/schema-component/antd/variable/JSONInput.js +2 -2
  286. package/lib/schema-component/antd/variable/TextArea.js +1 -1
  287. package/lib/schema-component/antd/variable/VariableSelect.js +4 -4
  288. package/lib/schema-component/antd/variable/XButton.d.ts +1 -1
  289. package/lib/schema-component/antd/variable/XButton.js +1 -1
  290. package/lib/schema-component/common/utils/uitls.d.ts +9 -0
  291. package/lib/schema-component/common/utils/uitls.js +43 -4
  292. package/lib/schema-component/core/DesignableSwitch.js +4 -2
  293. package/lib/schema-component/hooks/useComponent.js +2 -2
  294. package/lib/schema-component/hooks/useDesignable.js +2 -2
  295. package/lib/schema-initializer/SchemaInitializer.js +2 -2
  296. package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +14 -7
  297. package/lib/schema-initializer/utils.js +17 -10
  298. package/lib/schema-settings/DataTemplates/FormDataTemplates.js +28 -12
  299. package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +2 -1
  300. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +9 -2
  301. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +2 -1
  302. package/lib/schema-settings/SchemaSettings.d.ts +4 -1
  303. package/lib/schema-settings/SchemaSettings.js +37 -21
  304. package/lib/schema-settings/VariableInput/VariableInput.d.ts +13 -0
  305. package/lib/schema-settings/VariableInput/VariableInput.js +47 -0
  306. package/lib/schema-settings/VariableInput/hooks/useDateVariable.d.ts +4 -0
  307. package/lib/schema-settings/VariableInput/hooks/useDateVariable.js +136 -0
  308. package/lib/schema-settings/VariableInput/hooks/useUserVariable.d.ts +5 -0
  309. package/lib/schema-settings/VariableInput/hooks/useUserVariable.js +75 -0
  310. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -0
  311. package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +25 -0
  312. package/lib/user/VerificationCode.js +1 -2
  313. package/package.json +6 -5
  314. package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +0 -10
  315. package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +0 -10
@@ -8,6 +8,7 @@ var _react = require("@formily/react");
8
8
  var _uniq = _interopRequireDefault(require("lodash/uniq"));
9
9
  var _react2 = _interopRequireWildcard(require("react"));
10
10
  var _collectionManager = require("../collection-manager");
11
+ var _filterProvider = require("../filter-provider");
11
12
  var _recordProvider = require("../record-provider");
12
13
  var _schemaComponent = require("../schema-component");
13
14
  var _BlockProvider = require("./BlockProvider");
@@ -200,7 +201,7 @@ var TableSelectorProvider = function TableSelectorProvider(props) {
200
201
  }
201
202
  var extraFilter;
202
203
  if (collectionField) {
203
- if (['oho', 'o2m'].includes(collectionField.interface)) {
204
+ if (['oho', 'o2m'].includes(collectionField.interface) && !(0, _filterProvider.isInFilterFormBlock)(fieldSchema)) {
204
205
  if (record === null || record === void 0 ? void 0 : record[collectionField.sourceKey]) {
205
206
  extraFilter = {
206
207
  $or: [_defineProperty({}, collectionField.foreignKey, {
@@ -215,7 +216,7 @@ var TableSelectorProvider = function TableSelectorProvider(props) {
215
216
  });
216
217
  }
217
218
  }
218
- if (['obo'].includes(collectionField.interface)) {
219
+ if (['obo'].includes(collectionField.interface) && !(0, _filterProvider.isInFilterFormBlock)(fieldSchema)) {
219
220
  var fields = getCollectionFields(collectionField.target);
220
221
  var targetField = fields.find(function (f) {
221
222
  return f.foreignKey && f.foreignKey === collectionField.foreignKey;
@@ -303,6 +303,10 @@ var useFilterBlockActionProps = function useFilterBlockActionProps() {
303
303
  var fieldSchema = (0, _react.useFieldSchema)();
304
304
  var _useFilterBlock = (0, _FilterProvider.useFilterBlock)(),
305
305
  getDataBlocks = _useFilterBlock.getDataBlocks;
306
+ var _useCollection2 = (0, _collectionManager.useCollection)(),
307
+ name = _useCollection2.name;
308
+ var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
309
+ getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
306
310
  actionField.data = actionField.data || {};
307
311
  return {
308
312
  onClick: function onClick() {
@@ -333,7 +337,7 @@ var useFilterBlockActionProps = function useFilterBlockActionProps() {
333
337
  case 3:
334
338
  param = ((_block$service$params = block.service.params) === null || _block$service$params === void 0 ? void 0 : _block$service$params[0]) || {}; // 保留原有的 filter
335
339
  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) || {};
336
- storedFilter[uid] = (0, _schemaComponent.removeNullCondition)((0, _utils.transformToFilter)(form.values, fieldSchema));
340
+ storedFilter[uid] = (0, _schemaComponent.removeNullCondition)((0, _utils.transformToFilter)(form.values, fieldSchema, getCollectionJoinField, name));
337
341
  mergedFilter = (0, _SharedFilterProvider.mergeFilter)([].concat(_toConsumableArray(Object.values(storedFilter).map(function (filter) {
338
342
  return (0, _schemaComponent.removeNullCondition)(filter);
339
343
  })), [block.defaultFilter]));
@@ -355,13 +359,14 @@ var useFilterBlockActionProps = function useFilterBlockActionProps() {
355
359
  }()));
356
360
  case 5:
357
361
  actionField.data.loading = false;
358
- _context4.next = 11;
362
+ _context4.next = 12;
359
363
  break;
360
364
  case 8:
361
365
  _context4.prev = 8;
362
366
  _context4.t0 = _context4["catch"](2);
367
+ console.error(_context4.t0);
363
368
  actionField.data.loading = false;
364
- case 11:
369
+ case 12:
365
370
  case "end":
366
371
  return _context4.stop();
367
372
  }
@@ -838,9 +843,9 @@ var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
838
843
  var actionSchema = (0, _react.useFieldSchema)();
839
844
  var compile = (0, _schemaComponent.useCompile)();
840
845
  var form = (0, _react.useForm)();
841
- var _useCollection2 = (0, _collectionManager.useCollection)(),
842
- fields = _useCollection2.fields,
843
- getField = _useCollection2.getField;
846
+ var _useCollection3 = (0, _collectionManager.useCollection)(),
847
+ fields = _useCollection3.fields,
848
+ getField = _useCollection3.getField;
844
849
  var _useBlockRequestConte5 = (0, _BlockProvider.useBlockRequestContext)(),
845
850
  field = _useBlockRequestConte5.field,
846
851
  resource = _useBlockRequestConte5.resource,
@@ -981,9 +986,9 @@ var useUpdateActionProps = function useUpdateActionProps() {
981
986
  setVisible = _useActionContext3.setVisible;
982
987
  var actionSchema = (0, _react.useFieldSchema)();
983
988
  var history = (0, _reactRouterDom.useHistory)();
984
- var _useCollection3 = (0, _collectionManager.useCollection)(),
985
- fields = _useCollection3.fields,
986
- getField = _useCollection3.getField;
989
+ var _useCollection4 = (0, _collectionManager.useCollection)(),
990
+ fields = _useCollection4.fields,
991
+ getField = _useCollection4.getField;
987
992
  var compile = (0, _schemaComponent.useCompile)();
988
993
  var actionField = (0, _react.useField)();
989
994
  var _useFormBlockContext = (0, _2.useFormBlockContext)(),
@@ -1308,9 +1313,9 @@ var useAssociationFilterProps = function useAssociationFilterProps() {
1308
1313
  };
1309
1314
  exports.useAssociationFilterProps = useAssociationFilterProps;
1310
1315
  var useOptionalFieldList = function useOptionalFieldList() {
1311
- var _useCollection4 = (0, _collectionManager.useCollection)(),
1312
- _useCollection4$curre = _useCollection4.currentFields,
1313
- currentFields = _useCollection4$curre === void 0 ? [] : _useCollection4$curre;
1316
+ var _useCollection5 = (0, _collectionManager.useCollection)(),
1317
+ _useCollection5$curre = _useCollection5.currentFields,
1318
+ currentFields = _useCollection5$curre === void 0 ? [] : _useCollection5$curre;
1314
1319
  return currentFields.filter(function (field) {
1315
1320
  return isOptionalField(field) && field.uiSchema.enum;
1316
1321
  });
@@ -33,7 +33,7 @@ function CardAdder(_ref) {
33
33
  return setAddingCard(false);
34
34
  }
35
35
  }) : /*#__PURE__*/_react.default.createElement("button", {
36
- className: 'react-kanban-card-adder-button',
36
+ className: "react-kanban-card-adder-button",
37
37
  onClick: function onClick() {
38
38
  return setAddingCard(!addingCard);
39
39
  }
@@ -19,7 +19,7 @@ function ColumnForm(_ref) {
19
19
  (0, _utils.when)(inputColumnTitle.current.value)(onConfirm);
20
20
  }
21
21
  return /*#__PURE__*/_react.default.createElement("div", {
22
- className: 'react-kanban-column',
22
+ className: "react-kanban-column",
23
23
  style: {
24
24
  minWidth: '230px'
25
25
  }
@@ -30,13 +30,13 @@ function ColumnForm(_ref) {
30
30
  },
31
31
  onSubmit: addColumn
32
32
  }, /*#__PURE__*/_react.default.createElement("input", {
33
- type: 'text',
33
+ type: "text",
34
34
  ref: inputColumnTitle,
35
35
  autoFocus: true
36
36
  }), /*#__PURE__*/_react.default.createElement("button", {
37
- type: 'submit'
37
+ type: "submit"
38
38
  }, "Add"), /*#__PURE__*/_react.default.createElement("button", {
39
- type: 'button',
39
+ type: "button",
40
40
  onClick: onCancel
41
41
  }, "Cancel")));
42
42
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare function DefaultColumnHeader({ children: column, allowRemoveColumn, onColumnRemove, allowRenameColumn, onColumnRename }: {
2
+ declare function DefaultColumnHeader({ children: column, allowRemoveColumn, onColumnRemove, allowRenameColumn, onColumnRename, }: {
3
3
  children: any;
4
4
  allowRemoveColumn: any;
5
5
  onColumnRemove: any;
@@ -59,11 +59,11 @@ function DefaultColumnHeader(_ref2) {
59
59
  toggleRenameMode();
60
60
  }
61
61
  return /*#__PURE__*/_react.default.createElement("div", {
62
- className: 'react-kanban-column-header'
62
+ className: "react-kanban-column-header"
63
63
  }, renameMode ? /*#__PURE__*/_react.default.createElement("form", {
64
64
  onSubmit: handleRenameColumn
65
65
  }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("input", {
66
- type: 'text',
66
+ type: "text",
67
67
  value: titleInput,
68
68
  onChange: function onChange(_ref3) {
69
69
  var value = _ref3.target.value;
@@ -71,11 +71,11 @@ function DefaultColumnHeader(_ref2) {
71
71
  },
72
72
  autoFocus: true
73
73
  })), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("button", {
74
- className: 'react-kanban-column-header__button',
75
- type: 'submit'
74
+ className: "react-kanban-column-header__button",
75
+ type: "submit"
76
76
  }, "Rename"), /*#__PURE__*/_react.default.createElement("button", {
77
- className: 'react-kanban-column-header__button',
78
- type: 'button',
77
+ className: "react-kanban-column-header__button",
78
+ type: "button",
79
79
  onClick: handleRenameMode
80
80
  }, "Cancel"))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ColumnTitle, {
81
81
  allowRenameColumn: allowRenameColumn,
@@ -8,6 +8,7 @@ var _react = require("@formily/react");
8
8
  var _shared = require("@formily/shared");
9
9
  var _lodash = require("lodash");
10
10
  var _react2 = _interopRequireWildcard(require("react"));
11
+ var _reactI18next = require("react-i18next");
11
12
  var _ = require("..");
12
13
  var _CollectionFieldProvider = require("./CollectionFieldProvider");
13
14
  var _hooks = require("./hooks");
@@ -21,12 +22,13 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
21
22
  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); }
22
23
  // TODO: 初步适配
23
24
  var InternalField = function InternalField(props) {
25
+ var component = props.component;
24
26
  var field = (0, _react.useField)();
25
27
  var fieldSchema = (0, _react.useFieldSchema)();
26
28
  var _useCollectionField = (0, _hooks.useCollectionField)(),
27
29
  uiSchema = _useCollectionField.uiSchema,
28
30
  defaultValue = _useCollectionField.defaultValue;
29
- var component = (0, _.useComponent)((uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['x-component']) || 'Input');
31
+ var Component = (0, _.useComponent)(component || (uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['x-component']) || 'Input');
30
32
  var compile = (0, _.useCompile)();
31
33
  var setFieldProps = function setFieldProps(key, value) {
32
34
  field[key] = typeof field[key] === 'undefined' ? value : field[key];
@@ -69,21 +71,12 @@ var InternalField = function InternalField(props) {
69
71
  field.dataSource = uiSchema.enum;
70
72
  var originalProps = compile(uiSchema['x-component-props']) || {};
71
73
  var componentProps = (0, _shared.merge)(originalProps, field.componentProps || {});
72
- field.component = [component, componentProps];
73
- // if (interfaceType === 'input') {
74
- // field.componentProps.ellipsis = true;
75
- // } else if (interfaceType === 'textarea') {
76
- // field.componentProps.ellipsis = true;
77
- // } else if (interfaceType === 'markdown') {
78
- // field.componentProps.ellipsis = true;
79
- // } else if (interfaceType === 'attachment') {
80
- // field.componentProps.size = 'small';
81
- // }
74
+ field.component = [Component, componentProps];
82
75
  }, [JSON.stringify(uiSchema)]);
83
76
  if (!uiSchema) {
84
77
  return null;
85
78
  }
86
- return /*#__PURE__*/_react2.default.createElement(component, props, props.children);
79
+ return /*#__PURE__*/_react2.default.createElement(Component, props, props.children);
87
80
  };
88
81
  var InternalFallbackField = function InternalFallbackField() {
89
82
  var _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3;
@@ -106,7 +99,17 @@ var InternalFallbackField = function InternalFallbackField() {
106
99
  }
107
100
  return /*#__PURE__*/_react2.default.createElement("div", null, displayText);
108
101
  };
102
+ // 当字段被删除时,显示一个提示占位符
109
103
  exports.InternalFallbackField = InternalFallbackField;
104
+ var DeletedField = function DeletedField() {
105
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
106
+ t = _useTranslation.t;
107
+ return /*#__PURE__*/_react2.default.createElement("div", {
108
+ style: {
109
+ color: '#ccc'
110
+ }
111
+ }, t('The field has bee deleted'));
112
+ };
110
113
  var CollectionField = (0, _react.connect)(function (props) {
111
114
  var _fieldSchema$xCompon4;
112
115
  var fieldSchema = (0, _react.useFieldSchema)();
@@ -116,7 +119,7 @@ var CollectionField = (0, _react.connect)(function (props) {
116
119
  return /*#__PURE__*/_react2.default.createElement(_CollectionFieldProvider.CollectionFieldProvider, {
117
120
  name: fieldSchema.name,
118
121
  field: field,
119
- fallback: snapshot ? /*#__PURE__*/_react2.default.createElement(InternalFallbackField, null) : null
122
+ fallback: snapshot ? /*#__PURE__*/_react2.default.createElement(InternalFallbackField, null) : /*#__PURE__*/_react2.default.createElement(DeletedField, null)
120
123
  }, /*#__PURE__*/_react2.default.createElement(InternalField, _objectSpread({}, props)));
121
124
  });
122
125
  exports.CollectionField = CollectionField;
@@ -40,6 +40,7 @@ var CollectionManagerProvider = function CollectionManagerProvider(props) {
40
40
  _props$collections = props.collections,
41
41
  collections = _props$collections === void 0 ? [] : _props$collections,
42
42
  refreshCM = props.refreshCM,
43
+ updateCollection = props.updateCollection,
43
44
  templates = props.templates;
44
45
  var defaultTemplates = (0, _lodash.keyBy)((0, _templates.templateOptions)(), function (item) {
45
46
  return item.name;
@@ -51,7 +52,8 @@ var CollectionManagerProvider = function CollectionManagerProvider(props) {
51
52
  interfaces: _objectSpread(_objectSpread(_objectSpread({}, defaultInterfaces), ctx.interfaces), interfaces),
52
53
  templates: _objectSpread(_objectSpread({}, defaultTemplates), templates),
53
54
  collections: [].concat(_toConsumableArray(ctx.collections), _toConsumableArray(collections)),
54
- refreshCM: refreshCM
55
+ refreshCM: refreshCM,
56
+ updateCollection: updateCollection
55
57
  })
56
58
  }, /*#__PURE__*/_react.default.createElement(_CollectionManagerSchemaComponentProvider.CollectionManagerSchemaComponentProvider, null, props.children));
57
59
  };
@@ -144,6 +146,11 @@ var RemoteCollectionManagerProvider = function RemoteCollectionManagerProvider(p
144
146
  return _ref2.apply(this, arguments);
145
147
  };
146
148
  }();
149
+ var updateCollection = function updateCollection(collection) {
150
+ service.mutate({
151
+ data: collection
152
+ });
153
+ };
147
154
  return /*#__PURE__*/_react.default.createElement(CollectionCategroriesProvider, {
148
155
  service: _objectSpread({}, result),
149
156
  refreshCategory: refreshCategory
@@ -153,7 +160,8 @@ var RemoteCollectionManagerProvider = function RemoteCollectionManagerProvider(p
153
160
  setContentLoading: setContentLoading
154
161
  }),
155
162
  collections: service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.data,
156
- refreshCM: refreshCM
163
+ refreshCM: refreshCM,
164
+ updateCollection: updateCollection
157
165
  }, props)));
158
166
  };
159
167
  exports.RemoteCollectionManagerProvider = RemoteCollectionManagerProvider;
@@ -19,8 +19,8 @@ var _ResourceActionProvider = require("../ResourceActionProvider");
19
19
  var _actionHooks = require("../action-hooks");
20
20
  var _hooks = require("../hooks");
21
21
  var components = _interopRequireWildcard(require("./components"));
22
- var _templates = require("./templates");
23
22
  var _TemplateSummay = require("./components/TemplateSummay");
23
+ var _templates = require("./templates");
24
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
26
26
  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); }
@@ -0,0 +1,2 @@
1
+ export declare const isTitleField: (field: any) => boolean;
2
+ export declare const CollectionFields: (props: any) => JSX.Element;