@nocobase/client 0.9.2-alpha.1 → 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 +8 -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 +8 -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
@@ -7,16 +7,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
8
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
9
  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); }
10
- import React, { useContext } from "react";
11
- import { FormDialog, FormLayout } from "@formily/antd";
10
+ import React, { useContext } from 'react';
11
+ import { FormDialog, FormLayout } from '@formily/antd';
12
12
  import { FormOutlined } from '@ant-design/icons';
13
- import { SchemaOptionsContext } from "@formily/react";
14
- import { useTranslation } from "react-i18next";
15
- import { useAPIClient } from "../../api-client";
16
- import { useCollectionManager } from "../../collection-manager";
17
- import { createKanbanBlockSchema } from "../utils";
18
- import { DataBlockInitializer } from "./DataBlockInitializer";
19
- import { SchemaComponent, SchemaComponentOptions } from "../../schema-component";
13
+ import { SchemaOptionsContext } from '@formily/react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { useAPIClient } from '../../api-client';
16
+ import { useCollectionManager } from '../../collection-manager';
17
+ import { createKanbanBlockSchema } from '../utils';
18
+ import { DataBlockInitializer } from './DataBlockInitializer';
19
+ import { SchemaComponent, SchemaComponentOptions } from '../../schema-component';
20
20
  export var KanbanBlockInitializer = function KanbanBlockInitializer(props) {
21
21
  var insert = props.insert;
22
22
  var _useTranslation = useTranslation(),
@@ -4,10 +4,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
7
+ import React from 'react';
8
8
  import { FormOutlined } from '@ant-design/icons';
9
- import { useTranslation } from "react-i18next";
10
- import { SchemaInitializer } from "../SchemaInitializer";
9
+ import { useTranslation } from 'react-i18next';
10
+ import { SchemaInitializer } from '../SchemaInitializer';
11
11
  export var MarkdownBlockInitializer = function MarkdownBlockInitializer(props) {
12
12
  var insert = props.insert;
13
13
  var _useTranslation = useTranslation(),
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
8
- import { ActionInitializer } from "./ActionInitializer";
7
+ import React from 'react';
8
+ import { ActionInitializer } from './ActionInitializer';
9
9
  export var PrintActionInitializer = function PrintActionInitializer(props) {
10
10
  var schema = {
11
11
  title: '{{ t("Print") }}',
@@ -10,12 +10,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  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); }
11
11
  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; }
12
12
  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; }
13
- import React from "react";
13
+ import React from 'react';
14
14
  import { TableOutlined } from '@ant-design/icons';
15
- import { useCollectionManager } from "../../collection-manager";
16
- import { useSchemaTemplateManager } from "../../schema-templates";
17
- import { SchemaInitializer } from "../SchemaInitializer";
18
- import { createTableBlockSchema, useRecordCollectionDataSourceItems } from "../utils";
15
+ import { useCollectionManager } from '../../collection-manager';
16
+ import { useSchemaTemplateManager } from '../../schema-templates';
17
+ import { SchemaInitializer } from '../SchemaInitializer';
18
+ import { createTableBlockSchema, useRecordCollectionDataSourceItems } from '../utils';
19
19
  export var RecordAssociationBlockInitializer = function RecordAssociationBlockInitializer(props) {
20
20
  var item = props.item,
21
21
  onCreateBlockSchema = props.onCreateBlockSchema,
@@ -10,16 +10,16 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  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); }
11
11
  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; }
12
12
  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; }
13
- import React, { useContext } from "react";
14
- import { FormDialog, FormLayout } from "@formily/antd";
15
- import { SchemaOptionsContext } from "@formily/react";
16
- import { useTranslation } from "react-i18next";
13
+ import React, { useContext } from 'react';
14
+ import { FormDialog, FormLayout } from '@formily/antd';
15
+ import { SchemaOptionsContext } from '@formily/react';
16
+ import { useTranslation } from 'react-i18next';
17
17
  import { TableOutlined } from '@ant-design/icons';
18
- import { useCollectionManager } from "../../collection-manager";
19
- import { useSchemaTemplateManager } from "../../schema-templates";
20
- import { SchemaInitializer } from "../SchemaInitializer";
21
- import { createCalendarBlockSchema, useRecordCollectionDataSourceItems } from "../utils";
22
- import { SchemaComponent, SchemaComponentOptions } from "../../schema-component";
18
+ import { useCollectionManager } from '../../collection-manager';
19
+ import { useSchemaTemplateManager } from '../../schema-templates';
20
+ import { SchemaInitializer } from '../SchemaInitializer';
21
+ import { createCalendarBlockSchema, useRecordCollectionDataSourceItems } from '../utils';
22
+ import { SchemaComponent, SchemaComponentOptions } from '../../schema-component';
23
23
  export var RecordAssociationCalendarBlockInitializer = function RecordAssociationCalendarBlockInitializer(props) {
24
24
  var item = props.item,
25
25
  onCreateBlockSchema = props.onCreateBlockSchema,
@@ -10,12 +10,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  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); }
11
11
  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; }
12
12
  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; }
13
- import React from "react";
13
+ import React from 'react';
14
14
  import { FormOutlined } from '@ant-design/icons';
15
- import { useCollectionManager } from "../../collection-manager";
16
- import { useSchemaTemplateManager } from "../../schema-templates";
17
- import { SchemaInitializer } from "../SchemaInitializer";
18
- import { createDetailsBlockSchema, useRecordCollectionDataSourceItems } from "../utils";
15
+ import { useCollectionManager } from '../../collection-manager';
16
+ import { useSchemaTemplateManager } from '../../schema-templates';
17
+ import { SchemaInitializer } from '../SchemaInitializer';
18
+ import { createDetailsBlockSchema, useRecordCollectionDataSourceItems } from '../utils';
19
19
  export var RecordAssociationDetailsBlockInitializer = function RecordAssociationDetailsBlockInitializer(props) {
20
20
  var item = props.item,
21
21
  onCreateBlockSchema = props.onCreateBlockSchema,
@@ -10,11 +10,11 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  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); }
11
11
  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; }
12
12
  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; }
13
- import React from "react";
13
+ import React from 'react';
14
14
  import { FormOutlined } from '@ant-design/icons';
15
- import { useSchemaTemplateManager } from "../../schema-templates";
16
- import { SchemaInitializer } from "../SchemaInitializer";
17
- import { createFormBlockSchema, useRecordCollectionDataSourceItems } from "../utils";
15
+ import { useSchemaTemplateManager } from '../../schema-templates';
16
+ import { SchemaInitializer } from '../SchemaInitializer';
17
+ import { createFormBlockSchema, useRecordCollectionDataSourceItems } from '../utils';
18
18
  export var RecordAssociationFormBlockInitializer = function RecordAssociationFormBlockInitializer(props) {
19
19
  var item = props.item,
20
20
  onCreateBlockSchema = props.onCreateBlockSchema,
@@ -10,12 +10,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  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); }
11
11
  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; }
12
12
  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; }
13
- import React from "react";
13
+ import React from 'react';
14
14
  import { FormOutlined } from '@ant-design/icons';
15
- import { useBlockRequestContext } from "../../block-provider";
16
- import { useSchemaTemplateManager } from "../../schema-templates";
17
- import { SchemaInitializer } from "../SchemaInitializer";
18
- import { createReadPrettyFormBlockSchema, useRecordCollectionDataSourceItems } from "../utils";
15
+ import { useBlockRequestContext } from '../../block-provider';
16
+ import { useSchemaTemplateManager } from '../../schema-templates';
17
+ import { SchemaInitializer } from '../SchemaInitializer';
18
+ import { createReadPrettyFormBlockSchema, useRecordCollectionDataSourceItems } from '../utils';
19
19
  export var RecordReadPrettyAssociationFormBlockInitializer = function RecordReadPrettyAssociationFormBlockInitializer(props) {
20
20
  var item = props.item,
21
21
  onCreateBlockSchema = props.onCreateBlockSchema,
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
8
- import { ActionInitializer } from "./ActionInitializer";
7
+ import React from 'react';
8
+ import { ActionInitializer } from './ActionInitializer';
9
9
  export var RefreshActionInitializer = function RefreshActionInitializer(props) {
10
10
  var schema = {
11
11
  title: '{{ t("Refresh") }}',
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
8
- import { ActionInitializer } from "./ActionInitializer";
7
+ import React from 'react';
8
+ import { ActionInitializer } from './ActionInitializer';
9
9
  export var SubmitActionInitializer = function SubmitActionInitializer(props) {
10
10
  var schema = {
11
11
  title: '{{ t("Submit") }}',
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
8
- import { InitializerWithSwitch } from "./InitializerWithSwitch";
7
+ import React from 'react';
8
+ import { InitializerWithSwitch } from './InitializerWithSwitch';
9
9
  export var TableActionColumnInitializer = function TableActionColumnInitializer(props) {
10
10
  var schema = {
11
11
  type: 'void',
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
8
- import { InitializerWithSwitch } from "./InitializerWithSwitch";
7
+ import React from 'react';
8
+ import { InitializerWithSwitch } from './InitializerWithSwitch';
9
9
  export var TableCollectionFieldInitializer = function TableCollectionFieldInitializer(props) {
10
10
  var schema = {};
11
11
  return /*#__PURE__*/React.createElement(InitializerWithSwitch, _objectSpread(_objectSpread({}, props), {}, {
@@ -10,12 +10,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  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); }
11
11
  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; }
12
12
  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; }
13
- import React from "react";
13
+ import React from 'react';
14
14
  import { FormOutlined } from '@ant-design/icons';
15
- import { useCollection } from "../../collection-manager";
16
- import { useSchemaTemplateManager } from "../../schema-templates";
17
- import { SchemaInitializer } from "../SchemaInitializer";
18
- import { createTableSelectorSchema } from "../utils";
15
+ import { useCollection } from '../../collection-manager';
16
+ import { useSchemaTemplateManager } from '../../schema-templates';
17
+ import { SchemaInitializer } from '../SchemaInitializer';
18
+ import { createTableSelectorSchema } from '../utils';
19
19
  export var TableSelectorInitializer = function TableSelectorInitializer(props) {
20
20
  var onCreateBlockSchema = props.onCreateBlockSchema,
21
21
  componentType = props.componentType,
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
8
- import { ActionInitializer } from "./ActionInitializer";
7
+ import React from 'react';
8
+ import { ActionInitializer } from './ActionInitializer';
9
9
  export var UpdateActionInitializer = function UpdateActionInitializer(props) {
10
10
  var schema = {
11
11
  type: 'void',
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
8
- import { ActionInitializer } from "./ActionInitializer";
7
+ import React from 'react';
8
+ import { ActionInitializer } from './ActionInitializer';
9
9
  export var UpdateSubmitActionInitializer = function UpdateSubmitActionInitializer(props) {
10
10
  var schema = {
11
11
  title: '{{ t("Submit") }}',
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import React from "react";
8
- import { ActionInitializer } from "./ActionInitializer";
7
+ import React from 'react';
8
+ import { ActionInitializer } from './ActionInitializer';
9
9
  export var ViewActionInitializer = function ViewActionInitializer(props) {
10
10
  var schema = {
11
11
  type: 'void',
@@ -342,10 +342,10 @@ export var useFilterFormItemInitializerFields = function useFilterFormItemInitia
342
342
  var _field$uiSchema5;
343
343
  schema = {
344
344
  type: 'string',
345
- name: field.name,
345
+ name: "".concat(field.name),
346
346
  required: false,
347
- 'x-designer': 'AssociationSelect.FilterDesigner',
348
- 'x-component': 'AssociationSelect',
347
+ 'x-designer': 'FormItem.FilterFormDesigner',
348
+ 'x-component': 'CollectionField',
349
349
  'x-decorator': 'FormItem',
350
350
  'x-collection-field': "".concat(name, ".").concat(field.name),
351
351
  'x-component-props': (_field$uiSchema5 = field.uiSchema) === null || _field$uiSchema5 === void 0 ? void 0 : _field$uiSchema5['x-component-props']
@@ -444,7 +444,12 @@ var getItem = function getItem(field, schemaName, collectionName, getCollectionF
444
444
  type: 'subMenu',
445
445
  title: (_field$uiSchema8 = field.uiSchema) === null || _field$uiSchema8 === void 0 ? void 0 : _field$uiSchema8.title,
446
446
  children: subFields.map(function (subField) {
447
- return getItem(subField, "".concat(schemaName, ".").concat(subField.name), collectionName, getCollectionFields, [].concat(_toConsumableArray(processedCollections), [field.target]));
447
+ return (
448
+ // 使用 | 分隔,是为了防止 form.values 中出现 { a: { b: 1 } } 的情况
449
+ // 使用 | 分隔后,form.values 中会出现 { 'a|b': 1 } 的情况,这种情况下
450
+ // 就可以知道该字段是一个关系字段中的输入框,进而特殊处理
451
+ getItem(subField, "".concat(schemaName, ".").concat(subField.name), collectionName, getCollectionFields, [].concat(_toConsumableArray(processedCollections), [field.target]))
452
+ );
448
453
  }).filter(Boolean)
449
454
  };
450
455
  }
@@ -488,8 +493,7 @@ export var useFilterAssociatedFormItemInitializerFields = function useFilterAsso
488
493
  };
489
494
  export var useInheritsFormItemInitializerFields = function useInheritsFormItemInitializerFields(options) {
490
495
  var _useCollection8 = useCollection(),
491
- name = _useCollection8.name,
492
- template = _useCollection8.template;
496
+ name = _useCollection8.name;
493
497
  var _useCollectionManager8 = useCollectionManager(),
494
498
  getInterface = _useCollectionManager8.getInterface,
495
499
  getInheritCollections = _useCollectionManager8.getInheritCollections,
@@ -498,17 +502,17 @@ export var useInheritsFormItemInitializerFields = function useInheritsFormItemIn
498
502
  var inherits = getInheritCollections(name);
499
503
  var _useActionContext3 = useActionContext(),
500
504
  snapshot = _useActionContext3.snapshot;
505
+ var form = useForm();
501
506
  return inherits === null || inherits === void 0 ? void 0 : inherits.map(function (v) {
502
507
  var _fields$filter4;
503
508
  var fields = getParentCollectionFields(v, name);
504
- var form = useForm();
505
509
  var _ref5 = options || {},
506
510
  _ref5$readPretty = _ref5.readPretty,
507
511
  readPretty = _ref5$readPretty === void 0 ? form.readPretty : _ref5$readPretty,
508
512
  _ref5$block = _ref5.block,
509
513
  block = _ref5$block === void 0 ? 'Form' : _ref5$block;
510
514
  var targetCollection = getCollection(v);
511
- return _defineProperty({}, targetCollection.title, fields === null || fields === void 0 ? void 0 : (_fields$filter4 = fields.filter(function (field) {
515
+ return _defineProperty({}, targetCollection === null || targetCollection === void 0 ? void 0 : targetCollection.title, fields === null || fields === void 0 ? void 0 : (_fields$filter4 = fields.filter(function (field) {
512
516
  return (field === null || field === void 0 ? void 0 : field.interface) && !(field === null || field === void 0 ? void 0 : field.isForeignKey);
513
517
  })) === null || _fields$filter4 === void 0 ? void 0 : _fields$filter4.map(function (field) {
514
518
  var _field$uiSchema10, _field$uiSchema11, _field$uiSchema12;
@@ -816,7 +820,8 @@ export var useCollectionDataSourceItems = function useCollectionDataSourceItems(
816
820
  var _useTranslation2 = useTranslation(),
817
821
  t = _useTranslation2.t;
818
822
  var _useCollectionManager12 = useCollectionManager(),
819
- collections = _useCollectionManager12.collections;
823
+ collections = _useCollectionManager12.collections,
824
+ getCollectionFields = _useCollectionManager12.getCollectionFields;
820
825
  var _useSchemaTemplateMan2 = useSchemaTemplateManager(),
821
826
  getTemplatesByCollection = _useSchemaTemplateMan2.getTemplatesByCollection;
822
827
  var _useState = useState([]),
@@ -843,7 +848,9 @@ export var useCollectionDataSourceItems = function useCollectionDataSourceItems(
843
848
  var b = !value || selected.includes(item.name);
844
849
  if (item.inherit) {
845
850
  return false;
846
- } else if (item.autoGenId === false && !item.fields.find(function (v) {
851
+ }
852
+ var fields = getCollectionFields(item.name);
853
+ if (item.autoGenId === false && !fields.find(function (v) {
847
854
  return v.primaryKey;
848
855
  })) {
849
856
  return false;
@@ -1,6 +1,8 @@
1
1
  import { connect, mapProps, observer } from '@formily/react';
2
2
  import { Tree as AntdTree } from 'antd';
3
3
  import React from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { useCollectionManager } from '../../collection-manager';
4
6
  import { AssociationSelect, SchemaComponent } from '../../schema-component';
5
7
  import { AsDefaultTemplate } from './components/AsDefaultTemplate';
6
8
  import { ArrayCollapse } from './components/DataTemplateTitle';
@@ -18,6 +20,13 @@ export var FormDataTemplates = observer(function (props) {
18
20
  var _useCollectionState = useCollectionState(collectionName),
19
21
  collectionList = _useCollectionState.collectionList,
20
22
  getEnableFieldTree = _useCollectionState.getEnableFieldTree;
23
+ var _useCollectionManager = useCollectionManager(),
24
+ getCollection = _useCollectionManager.getCollection,
25
+ getCollectionField = _useCollectionManager.getCollectionField;
26
+ var collection = getCollection(collectionName);
27
+ var _useTranslation = useTranslation(),
28
+ t = _useTranslation.t;
29
+ var field = getCollectionField("".concat(collectionName, ".").concat((collection === null || collection === void 0 ? void 0 : collection.titleField) || 'id'));
21
30
  return /*#__PURE__*/React.createElement(SchemaComponent, {
22
31
  components: {
23
32
  ArrayCollapse: ArrayCollapse
@@ -55,7 +64,7 @@ export var FormDataTemplates = observer(function (props) {
55
64
  type: 'string',
56
65
  title: '{{ t("Collection") }}',
57
66
  required: true,
58
- description: '当前表有继承关系时,可选择继承链路上的表作为模板来源',
67
+ description: t('If collection inherits, choose inherited collections as templates'),
59
68
  default: collectionName,
60
69
  'x-display': collectionList.length > 1 ? 'visible' : 'hidden',
61
70
  'x-decorator': 'FormItem',
@@ -68,7 +77,7 @@ export var FormDataTemplates = observer(function (props) {
68
77
  type: 'number',
69
78
  title: '{{ t("Template Data") }}',
70
79
  required: true,
71
- description: '选择一条已有的数据作为表单的初始化数据',
80
+ description: t('Select an existing piece of data as the initialization data for the form'),
72
81
  'x-decorator': 'FormItem',
73
82
  'x-component': AssociationSelect,
74
83
  'x-component-props': {
@@ -79,16 +88,20 @@ export var FormDataTemplates = observer(function (props) {
79
88
  multiple: false,
80
89
  objectValue: false,
81
90
  manual: false,
82
- mapOptions: function mapOptions(item) {
83
- // TODO: 应该使用 item.title 字段的值作为 label
84
- return {
85
- label: item.id,
86
- value: item.id
87
- };
91
+ targetField: field,
92
+ mapOptions: function mapOptions(option) {
93
+ try {
94
+ var label = getLabel(collection);
95
+ option[label] = /*#__PURE__*/React.createElement(React.Fragment, null, "#", option.id, " ", option[label]);
96
+ return option;
97
+ } catch (error) {
98
+ console.error(error);
99
+ return option;
100
+ }
88
101
  },
89
102
  fieldNames: {
90
- label: 'label',
91
- value: 'value'
103
+ label: getLabel(collection),
104
+ value: 'id'
92
105
  }
93
106
  },
94
107
  'x-reactions': [{
@@ -109,7 +122,7 @@ export var FormDataTemplates = observer(function (props) {
109
122
  type: 'array',
110
123
  title: '{{ t("Data fields") }}',
111
124
  required: true,
112
- description: '仅选择的字段才会作为表单的初始化数据',
125
+ description: t('Only the selected fields will be used as the initialization data for the form'),
113
126
  'x-decorator': 'FormItem',
114
127
  'x-component': Tree,
115
128
  'x-component-props': {
@@ -171,4 +184,7 @@ export var FormDataTemplates = observer(function (props) {
171
184
  }
172
185
  }
173
186
  });
174
- });
187
+ });
188
+ function getLabel(collection) {
189
+ return !(collection === null || collection === void 0 ? void 0 : collection.titleField) || collection.titleField === 'id' ? 'label' : collection === null || collection === void 0 ? void 0 : collection.titleField;
190
+ }
@@ -27,8 +27,9 @@ export var useCollectionState = function useCollectionState(currentCollectionNam
27
27
  function getCollectionList() {
28
28
  var collections = getAllCollectionsInheritChain(currentCollectionName);
29
29
  return collections.map(function (name) {
30
+ var _getCollection;
30
31
  return {
31
- label: getCollection(name).title,
32
+ label: (_getCollection = getCollection(name)) === null || _getCollection === void 0 ? void 0 : _getCollection.title,
32
33
  value: name
33
34
  };
34
35
  });
@@ -1,2 +1,9 @@
1
- /// <reference types="react" />
2
- export declare function FilterDynamicComponent(props: any): JSX.Element;
1
+ import React from 'react';
2
+ declare type Props = {
3
+ value: any;
4
+ onChange: (value: any) => void;
5
+ renderSchemaComponent: () => React.ReactNode;
6
+ collectionName: string;
7
+ };
8
+ export declare function FilterDynamicComponent(props: Props): JSX.Element;
9
+ export {};
@@ -85,6 +85,7 @@ export var ValueDynamicComponent = function ValueDynamicComponent(props) {
85
85
  className: 'ant-formily-item-extra'
86
86
  }, t('Syntax references'), ":"), /*#__PURE__*/React.createElement("a", {
87
87
  href: "https://formulajs.info/functions/",
88
- target: "_blank"
88
+ target: "_blank",
89
+ rel: "noreferrer"
89
90
  }, "Formula.js"))) : null);
90
91
  };
@@ -2,7 +2,7 @@ import { GeneralField } from '@formily/core';
2
2
  import { ISchema, Schema } from '@formily/react';
3
3
  import { CascaderProps, MenuItemProps } from 'antd';
4
4
  import React from 'react';
5
- import { Designable } from '..';
5
+ import { CollectionFieldOptions, Designable } from '..';
6
6
  interface SchemaSettingsProps {
7
7
  title?: any;
8
8
  dn?: Designable;
@@ -56,4 +56,7 @@ interface SwitchItemProps extends Omit<MenuItemProps, 'onChange'> {
56
56
  export declare const useDataTemplates: () => {
57
57
  templateData: any;
58
58
  };
59
+ export declare const isShowDefaultValue: (collectionField: CollectionFieldOptions, getInterface: any) => boolean;
60
+ export declare const isSystemField: (collectionField: CollectionFieldOptions, getInterface: any) => boolean;
61
+ export declare const isPatternDisabled: (fieldSchema: Schema) => boolean;
59
62
  export {};