@nocobase/client 0.9.3-alpha.1 → 0.9.4-alpha.2

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 (331) hide show
  1. package/es/acl/ACLProvider.js +2 -2
  2. package/es/acl/Configuration/RoleConfigure.js +15 -8
  3. package/es/api-client/APIClient.d.ts +2 -0
  4. package/es/api-client/APIClient.js +11 -0
  5. package/es/block-provider/BlockProvider.js +58 -17
  6. package/es/block-provider/hooks/index.js +81 -60
  7. package/es/collection-manager/CollectionField.js +3 -3
  8. package/es/collection-manager/CollectionFieldProvider.js +2 -1
  9. package/es/collection-manager/Configuration/AddFieldAction.js +3 -3
  10. package/es/collection-manager/Configuration/CollectionFields.d.ts +1 -1
  11. package/es/collection-manager/Configuration/CollectionFields.js +1 -3
  12. package/es/collection-manager/Configuration/ConfigurationTabs.js +7 -6
  13. package/es/collection-manager/hooks/useCollection.d.ts +1 -1
  14. package/es/collection-manager/hooks/useCollectionDataSource.js +4 -4
  15. package/es/collection-manager/interfaces/m2m.js +1 -1
  16. package/es/collection-manager/interfaces/m2o.js +1 -1
  17. package/es/collection-manager/interfaces/o2m.js +1 -1
  18. package/es/collection-manager/interfaces/o2o.js +2 -2
  19. package/es/collection-manager/templates/expression.js +1 -1
  20. package/es/filter-provider/utils.js +1 -1
  21. package/es/index.d.ts +1 -0
  22. package/es/index.js +1 -0
  23. package/es/locale/en_US.d.ts +16 -1
  24. package/es/locale/en_US.js +17 -2
  25. package/es/locale/es_ES.d.ts +692 -0
  26. package/es/locale/es_ES.js +691 -0
  27. package/es/locale/ja_JP.d.ts +5 -1
  28. package/es/locale/ja_JP.js +6 -2
  29. package/es/locale/pt_BR.d.ts +5 -1
  30. package/es/locale/pt_BR.js +6 -2
  31. package/es/locale/ru_RU.d.ts +5 -1
  32. package/es/locale/ru_RU.js +6 -2
  33. package/es/locale/tr_TR.d.ts +5 -1
  34. package/es/locale/tr_TR.js +6 -2
  35. package/es/locale/zh_CN.d.ts +25 -2
  36. package/es/locale/zh_CN.js +26 -3
  37. package/es/pm/PluginManagerLink.js +22 -14
  38. package/es/record-provider/index.d.ts +4 -0
  39. package/es/record-provider/index.js +3 -0
  40. package/es/schema-component/antd/action/Action.Designer.js +6 -3
  41. package/es/schema-component/antd/action/Action.Drawer.js +5 -2
  42. package/es/schema-component/antd/action/Action.js +2 -2
  43. package/es/schema-component/antd/action/ActionBar.js +25 -18
  44. package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -2
  45. package/es/schema-component/antd/association-field/AssociationFieldProvider.js +62 -9
  46. package/es/schema-component/antd/association-field/AssociationSelect.js +10 -65
  47. package/es/schema-component/antd/association-field/Editable.d.ts +1 -1
  48. package/es/schema-component/antd/association-field/Editable.js +32 -40
  49. package/es/schema-component/antd/association-field/InternalNester.js +4 -3
  50. package/es/schema-component/antd/association-field/InternalPicker.js +29 -60
  51. package/es/schema-component/antd/association-field/InternalViewer.js +9 -12
  52. package/es/schema-component/antd/association-field/Nester.js +19 -21
  53. package/es/schema-component/antd/association-field/ReadPretty.d.ts +1 -1
  54. package/es/schema-component/antd/association-field/ReadPretty.js +9 -25
  55. package/es/schema-component/antd/association-field/components/CreateRecordAction.d.ts +2 -0
  56. package/es/schema-component/antd/association-field/components/CreateRecordAction.js +61 -0
  57. package/es/schema-component/antd/association-field/context.d.ts +5 -2
  58. package/es/schema-component/antd/association-field/context.js +1 -1
  59. package/es/schema-component/antd/association-field/hooks.d.ts +3 -0
  60. package/es/schema-component/antd/association-field/hooks.js +10 -10
  61. package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +3 -3
  62. package/es/schema-component/antd/association-select/AssociationSelect.js +49 -231
  63. package/es/schema-component/antd/association-select/useServiceOptions.js +2 -2
  64. package/es/schema-component/antd/collection-select/CollectionSelect.js +5 -0
  65. package/es/schema-component/antd/filter/FilterAction.js +2 -2
  66. package/es/schema-component/antd/form/Form.js +4 -4
  67. package/es/schema-component/antd/form-item/FormItem.js +126 -145
  68. package/es/schema-component/antd/form-item/SchemaSettingOptions.js +3 -3
  69. package/es/schema-component/antd/form-v2/Form.Designer.js +1 -0
  70. package/es/schema-component/antd/form-v2/Templates.d.ts +20 -0
  71. package/es/schema-component/antd/form-v2/Templates.js +42 -12
  72. package/es/schema-component/antd/grid/Grid.js +34 -24
  73. package/es/schema-component/antd/grid-card/GridCard.Decorator.d.ts +5 -0
  74. package/es/schema-component/antd/grid-card/GridCard.Decorator.js +65 -0
  75. package/es/schema-component/antd/grid-card/GridCard.Designer.d.ts +1 -0
  76. package/es/schema-component/antd/grid-card/GridCard.Designer.js +243 -0
  77. package/es/schema-component/antd/grid-card/GridCard.Item.d.ts +1 -0
  78. package/es/schema-component/antd/grid-card/GridCard.Item.js +18 -0
  79. package/es/schema-component/antd/grid-card/GridCard.d.ts +8 -0
  80. package/es/schema-component/antd/grid-card/GridCard.js +103 -0
  81. package/es/schema-component/antd/grid-card/hooks.d.ts +4 -0
  82. package/es/schema-component/antd/grid-card/hooks.js +9 -0
  83. package/es/schema-component/antd/grid-card/index.d.ts +1 -0
  84. package/es/schema-component/antd/grid-card/index.js +1 -0
  85. package/es/schema-component/antd/grid-card/options.d.ts +20 -0
  86. package/es/schema-component/antd/grid-card/options.js +20 -0
  87. package/es/schema-component/antd/icon-picker/IconPicker.js +2 -2
  88. package/es/schema-component/antd/index.d.ts +2 -0
  89. package/es/schema-component/antd/index.js +2 -0
  90. package/es/schema-component/antd/input/EllipsisWithTooltip.js +2 -2
  91. package/es/schema-component/antd/list/List.Decorator.d.ts +5 -0
  92. package/es/schema-component/antd/list/List.Decorator.js +59 -0
  93. package/es/schema-component/antd/list/List.Designer.d.ts +1 -0
  94. package/es/schema-component/antd/list/List.Designer.js +205 -0
  95. package/es/schema-component/antd/list/List.Item.d.ts +1 -0
  96. package/es/schema-component/antd/list/List.Item.js +15 -0
  97. package/es/schema-component/antd/list/List.d.ts +8 -0
  98. package/es/schema-component/antd/list/List.js +83 -0
  99. package/es/schema-component/antd/list/hooks.d.ts +4 -0
  100. package/es/schema-component/antd/list/hooks.js +9 -0
  101. package/es/schema-component/antd/list/index.d.ts +1 -0
  102. package/es/schema-component/antd/list/index.js +1 -0
  103. package/es/schema-component/antd/remote-select/RemoteSelect.js +12 -10
  104. package/es/schema-component/antd/select/Select.js +15 -4
  105. package/es/schema-component/antd/table/Table.Void.Designer.js +1 -0
  106. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
  107. package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -0
  108. package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +22 -0
  109. package/es/schema-component/antd/table-v2/hooks/useUserVariable.js +65 -0
  110. package/es/schema-component/antd/variable/Input.js +6 -3
  111. package/es/schema-component/common/dnd-context/index.js +2 -2
  112. package/es/schema-component/common/sortable-item/SortableItem.js +3 -4
  113. package/es/schema-component/core/SchemaComponentProvider.js +2 -2
  114. package/es/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
  115. package/es/schema-initializer/SchemaInitializerProvider.js +23 -10
  116. package/es/schema-initializer/buttons/BlockInitializers.js +10 -0
  117. package/es/schema-initializer/buttons/CustomFormItemInitializers.js +4 -2
  118. package/es/schema-initializer/buttons/FormActionInitializers.d.ts +0 -116
  119. package/es/schema-initializer/buttons/FormActionInitializers.js +106 -100
  120. package/es/schema-initializer/buttons/GanttActionInitializers.d.ts +0 -19
  121. package/es/schema-initializer/buttons/GridCardActionInitializers.d.ts +195 -0
  122. package/es/schema-initializer/buttons/GridCardActionInitializers.js +278 -0
  123. package/es/schema-initializer/buttons/ListActionInitializers.d.ts +195 -0
  124. package/es/schema-initializer/buttons/ListActionInitializers.js +278 -0
  125. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
  126. package/es/schema-initializer/buttons/TableActionInitializers.d.ts +0 -20
  127. package/es/schema-initializer/buttons/TableActionInitializers.js +29 -35
  128. package/es/schema-initializer/buttons/TableColumnInitializers.js +4 -1
  129. package/es/schema-initializer/buttons/index.d.ts +3 -0
  130. package/es/schema-initializer/buttons/index.js +3 -0
  131. package/es/schema-initializer/components/BulkEditField.js +7 -5
  132. package/es/schema-initializer/components/CreateRecordAction.d.ts +1 -0
  133. package/es/schema-initializer/components/CreateRecordAction.js +51 -30
  134. package/es/schema-initializer/components/DeletedField.d.ts +1 -0
  135. package/es/schema-initializer/components/DeletedField.js +11 -0
  136. package/es/schema-initializer/components/assigned-field/AssignedField.js +35 -23
  137. package/es/schema-initializer/items/GridCardBlockInitializer.d.ts +1 -0
  138. package/es/schema-initializer/items/GridCardBlockInitializer.js +47 -0
  139. package/es/schema-initializer/items/ListBlockInitializer.d.ts +1 -0
  140. package/es/schema-initializer/items/ListBlockInitializer.js +47 -0
  141. package/es/schema-initializer/items/index.d.ts +3 -1
  142. package/es/schema-initializer/items/index.js +4 -2
  143. package/es/schema-initializer/utils.d.ts +112 -0
  144. package/es/schema-initializer/utils.js +206 -32
  145. package/es/schema-items/GeneralSchemaItems.d.ts +4 -0
  146. package/es/schema-items/GeneralSchemaItems.js +148 -0
  147. package/es/schema-items/index.d.ts +1 -0
  148. package/es/schema-items/index.js +2 -1
  149. package/es/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -0
  150. package/es/schema-settings/DataTemplates/FormDataTemplates.js +117 -42
  151. package/es/schema-settings/DataTemplates/components/AsDefaultTemplate.js +1 -1
  152. package/es/schema-settings/DataTemplates/components/DataTemplateTitle.js +9 -13
  153. package/es/schema-settings/DataTemplates/components/Designer.d.ts +7 -0
  154. package/es/schema-settings/DataTemplates/components/Designer.js +179 -0
  155. package/es/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +6 -1
  156. package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +204 -96
  157. package/es/schema-settings/GeneralSchemaDesigner.js +19 -15
  158. package/es/schema-settings/SchemaSettings.d.ts +1 -1
  159. package/es/schema-settings/SchemaSettings.js +54 -30
  160. package/es/schema-settings/VariableInput/hooks/useUserVariable.js +1 -1
  161. package/es/schema-settings/hooks/useIsShowMultipleSwitch.d.ts +4 -0
  162. package/es/schema-settings/hooks/useIsShowMultipleSwitch.js +18 -0
  163. package/es/schema-templates/BlockTemplateDetails.js +1 -1
  164. package/es/settings-form/SettingsForm.js +2 -2
  165. package/es/user/CurrentUser.js +120 -12
  166. package/lib/acl/ACLProvider.js +2 -2
  167. package/lib/acl/Configuration/RoleConfigure.js +15 -8
  168. package/lib/api-client/APIClient.d.ts +2 -0
  169. package/lib/api-client/APIClient.js +11 -0
  170. package/lib/block-provider/BlockProvider.js +57 -16
  171. package/lib/block-provider/hooks/index.js +80 -59
  172. package/lib/collection-manager/CollectionField.js +3 -3
  173. package/lib/collection-manager/CollectionFieldProvider.js +2 -1
  174. package/lib/collection-manager/Configuration/AddFieldAction.js +2 -2
  175. package/lib/collection-manager/Configuration/CollectionFields.d.ts +1 -1
  176. package/lib/collection-manager/Configuration/CollectionFields.js +1 -3
  177. package/lib/collection-manager/Configuration/ConfigurationTabs.js +7 -6
  178. package/lib/collection-manager/hooks/useCollection.d.ts +1 -1
  179. package/lib/collection-manager/hooks/useCollectionDataSource.js +4 -4
  180. package/lib/collection-manager/interfaces/m2m.js +1 -1
  181. package/lib/collection-manager/interfaces/m2o.js +1 -1
  182. package/lib/collection-manager/interfaces/o2m.js +1 -1
  183. package/lib/collection-manager/interfaces/o2o.js +2 -2
  184. package/lib/collection-manager/templates/expression.js +1 -1
  185. package/lib/filter-provider/utils.js +1 -1
  186. package/lib/index.d.ts +1 -0
  187. package/lib/index.js +11 -0
  188. package/lib/locale/en_US.d.ts +16 -1
  189. package/lib/locale/en_US.js +17 -2
  190. package/lib/locale/es_ES.d.ts +692 -0
  191. package/lib/locale/es_ES.js +698 -0
  192. package/lib/locale/ja_JP.d.ts +5 -1
  193. package/lib/locale/ja_JP.js +6 -2
  194. package/lib/locale/pt_BR.d.ts +5 -1
  195. package/lib/locale/pt_BR.js +6 -2
  196. package/lib/locale/ru_RU.d.ts +5 -1
  197. package/lib/locale/ru_RU.js +6 -2
  198. package/lib/locale/tr_TR.d.ts +5 -1
  199. package/lib/locale/tr_TR.js +6 -2
  200. package/lib/locale/zh_CN.d.ts +25 -2
  201. package/lib/locale/zh_CN.js +26 -3
  202. package/lib/pm/PluginManagerLink.js +21 -13
  203. package/lib/record-provider/index.d.ts +4 -0
  204. package/lib/record-provider/index.js +5 -1
  205. package/lib/schema-component/antd/action/Action.Designer.js +6 -3
  206. package/lib/schema-component/antd/action/Action.Drawer.js +5 -2
  207. package/lib/schema-component/antd/action/Action.js +2 -2
  208. package/lib/schema-component/antd/action/ActionBar.js +23 -16
  209. package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -2
  210. package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +62 -8
  211. package/lib/schema-component/antd/association-field/AssociationSelect.js +9 -66
  212. package/lib/schema-component/antd/association-field/Editable.d.ts +1 -1
  213. package/lib/schema-component/antd/association-field/Editable.js +33 -42
  214. package/lib/schema-component/antd/association-field/InternalNester.js +2 -2
  215. package/lib/schema-component/antd/association-field/InternalPicker.js +25 -56
  216. package/lib/schema-component/antd/association-field/InternalViewer.js +7 -10
  217. package/lib/schema-component/antd/association-field/Nester.js +19 -21
  218. package/lib/schema-component/antd/association-field/ReadPretty.d.ts +1 -1
  219. package/lib/schema-component/antd/association-field/ReadPretty.js +10 -27
  220. package/lib/schema-component/antd/association-field/components/CreateRecordAction.d.ts +2 -0
  221. package/lib/schema-component/antd/association-field/components/CreateRecordAction.js +71 -0
  222. package/lib/schema-component/antd/association-field/context.d.ts +5 -2
  223. package/lib/schema-component/antd/association-field/context.js +1 -1
  224. package/lib/schema-component/antd/association-field/hooks.d.ts +3 -0
  225. package/lib/schema-component/antd/association-field/hooks.js +10 -10
  226. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +3 -3
  227. package/lib/schema-component/antd/association-select/AssociationSelect.js +49 -231
  228. package/lib/schema-component/antd/association-select/useServiceOptions.js +2 -2
  229. package/lib/schema-component/antd/collection-select/CollectionSelect.js +5 -0
  230. package/lib/schema-component/antd/filter/FilterAction.js +2 -2
  231. package/lib/schema-component/antd/form/Form.js +4 -4
  232. package/lib/schema-component/antd/form-item/FormItem.js +122 -141
  233. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +3 -3
  234. package/lib/schema-component/antd/form-v2/Form.Designer.js +1 -0
  235. package/lib/schema-component/antd/form-v2/Templates.d.ts +20 -0
  236. package/lib/schema-component/antd/form-v2/Templates.js +41 -11
  237. package/lib/schema-component/antd/grid/Grid.js +33 -23
  238. package/lib/schema-component/antd/grid-card/GridCard.Decorator.d.ts +5 -0
  239. package/lib/schema-component/antd/grid-card/GridCard.Decorator.js +77 -0
  240. package/lib/schema-component/antd/grid-card/GridCard.Designer.d.ts +1 -0
  241. package/lib/schema-component/antd/grid-card/GridCard.Designer.js +253 -0
  242. package/lib/schema-component/antd/grid-card/GridCard.Item.d.ts +1 -0
  243. package/lib/schema-component/antd/grid-card/GridCard.Item.js +26 -0
  244. package/lib/schema-component/antd/grid-card/GridCard.d.ts +8 -0
  245. package/lib/schema-component/antd/grid-card/GridCard.js +112 -0
  246. package/lib/schema-component/antd/grid-card/hooks.d.ts +4 -0
  247. package/lib/schema-component/antd/grid-card/hooks.js +16 -0
  248. package/lib/schema-component/antd/grid-card/index.d.ts +1 -0
  249. package/lib/schema-component/antd/grid-card/index.js +16 -0
  250. package/lib/schema-component/antd/grid-card/options.d.ts +20 -0
  251. package/lib/schema-component/antd/grid-card/options.js +31 -0
  252. package/lib/schema-component/antd/icon-picker/IconPicker.js +2 -2
  253. package/lib/schema-component/antd/index.d.ts +2 -0
  254. package/lib/schema-component/antd/index.js +22 -0
  255. package/lib/schema-component/antd/input/EllipsisWithTooltip.js +2 -2
  256. package/lib/schema-component/antd/list/List.Decorator.d.ts +5 -0
  257. package/lib/schema-component/antd/list/List.Decorator.js +71 -0
  258. package/lib/schema-component/antd/list/List.Designer.d.ts +1 -0
  259. package/lib/schema-component/antd/list/List.Designer.js +213 -0
  260. package/lib/schema-component/antd/list/List.Item.d.ts +1 -0
  261. package/lib/schema-component/antd/list/List.Item.js +23 -0
  262. package/lib/schema-component/antd/list/List.d.ts +8 -0
  263. package/lib/schema-component/antd/list/List.js +92 -0
  264. package/lib/schema-component/antd/list/hooks.d.ts +4 -0
  265. package/lib/schema-component/antd/list/hooks.js +16 -0
  266. package/lib/schema-component/antd/list/index.d.ts +1 -0
  267. package/lib/schema-component/antd/list/index.js +16 -0
  268. package/lib/schema-component/antd/remote-select/RemoteSelect.js +11 -9
  269. package/lib/schema-component/antd/select/Select.js +14 -3
  270. package/lib/schema-component/antd/table/Table.Void.Designer.js +1 -0
  271. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
  272. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -0
  273. package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +22 -0
  274. package/lib/schema-component/antd/table-v2/hooks/useUserVariable.js +73 -0
  275. package/lib/schema-component/antd/variable/Input.js +6 -3
  276. package/lib/schema-component/common/dnd-context/index.js +2 -2
  277. package/lib/schema-component/common/sortable-item/SortableItem.js +3 -4
  278. package/lib/schema-component/core/SchemaComponentProvider.js +2 -2
  279. package/lib/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
  280. package/lib/schema-initializer/SchemaInitializerProvider.js +22 -9
  281. package/lib/schema-initializer/buttons/BlockInitializers.js +10 -0
  282. package/lib/schema-initializer/buttons/CustomFormItemInitializers.js +4 -2
  283. package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +0 -116
  284. package/lib/schema-initializer/buttons/FormActionInitializers.js +106 -100
  285. package/lib/schema-initializer/buttons/GanttActionInitializers.d.ts +0 -19
  286. package/lib/schema-initializer/buttons/GridCardActionInitializers.d.ts +195 -0
  287. package/lib/schema-initializer/buttons/GridCardActionInitializers.js +285 -0
  288. package/lib/schema-initializer/buttons/ListActionInitializers.d.ts +195 -0
  289. package/lib/schema-initializer/buttons/ListActionInitializers.js +285 -0
  290. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
  291. package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +0 -20
  292. package/lib/schema-initializer/buttons/TableActionInitializers.js +29 -35
  293. package/lib/schema-initializer/buttons/TableColumnInitializers.js +4 -1
  294. package/lib/schema-initializer/buttons/index.d.ts +3 -0
  295. package/lib/schema-initializer/buttons/index.js +22 -0
  296. package/lib/schema-initializer/components/BulkEditField.js +7 -5
  297. package/lib/schema-initializer/components/CreateRecordAction.d.ts +1 -0
  298. package/lib/schema-initializer/components/CreateRecordAction.js +54 -32
  299. package/lib/schema-initializer/components/DeletedField.d.ts +1 -0
  300. package/lib/schema-initializer/components/DeletedField.js +19 -0
  301. package/lib/schema-initializer/components/assigned-field/AssignedField.js +34 -22
  302. package/lib/schema-initializer/items/GridCardBlockInitializer.d.ts +1 -0
  303. package/lib/schema-initializer/items/GridCardBlockInitializer.js +55 -0
  304. package/lib/schema-initializer/items/ListBlockInitializer.d.ts +1 -0
  305. package/lib/schema-initializer/items/ListBlockInitializer.js +55 -0
  306. package/lib/schema-initializer/items/index.d.ts +3 -1
  307. package/lib/schema-initializer/items/index.js +33 -11
  308. package/lib/schema-initializer/utils.d.ts +112 -0
  309. package/lib/schema-initializer/utils.js +209 -33
  310. package/lib/schema-items/GeneralSchemaItems.d.ts +4 -0
  311. package/lib/schema-items/GeneralSchemaItems.js +156 -0
  312. package/lib/schema-items/index.d.ts +1 -0
  313. package/lib/schema-items/index.js +11 -0
  314. package/lib/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -0
  315. package/lib/schema-settings/DataTemplates/FormDataTemplates.js +119 -41
  316. package/lib/schema-settings/DataTemplates/components/AsDefaultTemplate.js +1 -1
  317. package/lib/schema-settings/DataTemplates/components/DataTemplateTitle.js +10 -14
  318. package/lib/schema-settings/DataTemplates/components/Designer.d.ts +7 -0
  319. package/lib/schema-settings/DataTemplates/components/Designer.js +188 -0
  320. package/lib/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +6 -1
  321. package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +204 -95
  322. package/lib/schema-settings/GeneralSchemaDesigner.js +21 -15
  323. package/lib/schema-settings/SchemaSettings.d.ts +1 -1
  324. package/lib/schema-settings/SchemaSettings.js +53 -29
  325. package/lib/schema-settings/VariableInput/hooks/useUserVariable.js +1 -1
  326. package/lib/schema-settings/hooks/useIsShowMultipleSwitch.d.ts +4 -0
  327. package/lib/schema-settings/hooks/useIsShowMultipleSwitch.js +24 -0
  328. package/lib/settings-form/SettingsForm.js +2 -2
  329. package/lib/user/CurrentUser.js +118 -10
  330. package/package.json +5 -5
  331. package/tsconfig.json +8 -0
@@ -22,13 +22,13 @@ var _utils = require("../../filter-provider/utils");
22
22
  var _recordProvider = require("../../record-provider");
23
23
  var _schemaComponent = require("../../schema-component");
24
24
  var _components = require("../../schema-initializer/components");
25
+ var _schemaTemplates = require("../../schema-templates");
25
26
  var _user = require("../../user");
26
27
  var _BlockProvider = require("../BlockProvider");
27
28
  var _DetailsBlockProvider = require("../DetailsBlockProvider");
28
29
  var _SharedFilterProvider = require("../SharedFilterProvider");
29
30
  var _TableFieldProvider = require("../TableFieldProvider");
30
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
32
32
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
33
33
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
34
34
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -203,7 +203,7 @@ var useCreateActionProps = function useCreateActionProps() {
203
203
  _context2.next = 7;
204
204
  return form.submit();
205
205
  case 7:
206
- values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
206
+ values = getFormValues(filterByTk, field, form, fieldNames, getField, resource); // const values = omitBy(formValues, (value) => isEqual(JSON.stringify(value), '[{}]'));
207
207
  if (addChild) {
208
208
  treeParentField = getTreeParentField();
209
209
  values[(_treeParentField$name = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.name) !== null && _treeParentField$name !== void 0 ? _treeParentField$name : 'parent'] = currentRecord;
@@ -347,13 +347,14 @@ var useAssociationCreateActionProps = function useAssociationCreateActionProps()
347
347
  return _context3.abrupt("return");
348
348
  case 20:
349
349
  _antd.message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
350
- _context3.next = 26;
350
+ _context3.next = 27;
351
351
  break;
352
352
  case 23:
353
353
  _context3.prev = 23;
354
354
  _context3.t0 = _context3["catch"](11);
355
+ actionField.data.data = null;
355
356
  actionField.data.loading = false;
356
- case 26:
357
+ case 27:
357
358
  case "end":
358
359
  return _context3.stop();
359
360
  }
@@ -1549,74 +1550,70 @@ var useAssociationFilterBlockProps = function useAssociationFilterBlockProps() {
1549
1550
  };
1550
1551
  };
1551
1552
  exports.useAssociationFilterBlockProps = useAssociationFilterBlockProps;
1553
+ var getTemplateSchema = function getTemplateSchema(schema) {
1554
+ var conf = {
1555
+ url: "/uiSchemas:getJsonSchema/".concat(schema === null || schema === void 0 ? void 0 : schema.uid)
1556
+ };
1557
+ var _useRequest3 = (0, _apiClient.useRequest)(conf, {
1558
+ manual: true
1559
+ }),
1560
+ data = _useRequest3.data,
1561
+ loading = _useRequest3.loading,
1562
+ run = _useRequest3.run;
1563
+ if (loading) {}
1564
+ (0, _react2.useEffect)(function () {
1565
+ if (schema === null || schema === void 0 ? void 0 : schema.uid) {
1566
+ run();
1567
+ }
1568
+ }, [schema === null || schema === void 0 ? void 0 : schema.uid]);
1569
+ return (schema === null || schema === void 0 ? void 0 : schema.uid) ? new _react.Schema(data === null || data === void 0 ? void 0 : data.data) : null;
1570
+ };
1552
1571
  var useAssociationNames = function useAssociationNames(collection) {
1572
+ var _templateSchema$xCom;
1553
1573
  var _useCollectionManager2 = (0, _collectionManager.useCollectionManager)(),
1554
- getCollectionFields = _useCollectionManager2.getCollectionFields,
1555
1574
  getCollectionJoinField = _useCollectionManager2.getCollectionJoinField;
1556
- var collectionFields = getCollectionFields(collection);
1557
- var associationFields = new Set();
1558
- var _iterator = _createForOfIteratorHelper(collectionFields),
1559
- _step;
1560
- try {
1561
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
1562
- var collectionField = _step.value;
1563
- if (collectionField.target) {
1564
- associationFields.add(collectionField.name);
1565
- var fields = getCollectionFields(collectionField.target);
1566
- var _iterator2 = _createForOfIteratorHelper(fields),
1567
- _step2;
1568
- try {
1569
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1570
- var field = _step2.value;
1571
- if (field.target) {
1572
- associationFields.add("".concat(collectionField.name, ".").concat(field.name));
1573
- }
1574
- }
1575
- } catch (err) {
1576
- _iterator2.e(err);
1577
- } finally {
1578
- _iterator2.f();
1579
- }
1580
- }
1581
- }
1582
- } catch (err) {
1583
- _iterator.e(err);
1584
- } finally {
1585
- _iterator.f();
1586
- }
1575
+ var _useSchemaTemplateMan = (0, _schemaTemplates.useSchemaTemplateManager)(),
1576
+ getTemplateById = _useSchemaTemplateMan.getTemplateById;
1587
1577
  var fieldSchema = (0, _react.useFieldSchema)();
1588
1578
  var associationValues = [];
1589
1579
  var formSchema = fieldSchema.reduceProperties(function (buf, schema) {
1590
- if (['FormV2', 'Details'].includes(schema['x-component'])) {
1580
+ if (['FormV2', 'Details', 'List', 'GridCard'].includes(schema['x-component'])) {
1591
1581
  return schema;
1592
1582
  }
1593
1583
  return buf;
1594
1584
  }, new _react.Schema({}));
1585
+ var templateSchema = formSchema.reduceProperties(function (buf, schema) {
1586
+ if (schema['x-component'] === 'BlockTemplate') {
1587
+ return schema;
1588
+ }
1589
+ return buf;
1590
+ }, null);
1595
1591
  var getAssociationAppends = function getAssociationAppends(schema) {
1596
1592
  var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1597
- return schema.reduceProperties(function (buf, s) {
1593
+ var data = schema.reduceProperties(function (buf, s) {
1598
1594
  var collectionfield = s['x-collection-field'] && getCollectionJoinField(s['x-collection-field']);
1599
- if (collectionfield && ['createdBy', 'updatedBy', 'o2m', 'obo', 'oho', 'm2o', 'm2m'].includes(collectionfield.interface)) {
1595
+ if (collectionfield && ['hasOne', 'hasMany', 'belongsTo', 'belongsToMany'].includes(collectionfield.type) && s['x-component'] !== 'TableField') {
1600
1596
  var _s$xComponentProps;
1597
+ buf.push(s.name);
1601
1598
  if (['Nester', 'SubTable'].includes((_s$xComponentProps = s['x-component-props']) === null || _s$xComponentProps === void 0 ? void 0 : _s$xComponentProps.mode)) {
1602
1599
  associationValues.push(s.name);
1603
1600
  }
1604
- buf.push(s.name);
1605
- if (s['x-component-props'].mode === 'Nester' || s['x-component'] === 'TableField') {
1601
+ if (s['x-component-props'].mode === 'Nester') {
1606
1602
  return getAssociationAppends(s, buf);
1607
1603
  }
1608
1604
  return buf;
1609
1605
  } else {
1610
- if (s['x-component'] === 'Grid' || s['x-component'] === 'TableV2') {
1606
+ if (s['x-component'] === 'Grid.Row') {
1611
1607
  var _buf$concat;
1612
1608
  var kk = buf === null || buf === void 0 ? void 0 : (_buf$concat = buf.concat) === null || _buf$concat === void 0 ? void 0 : _buf$concat.call(buf);
1613
1609
  return getNesterAppends(s, kk || []);
1614
1610
  } else {
1615
1611
  var _s$xComponent;
1616
- return !((_s$xComponent = s['x-component']) === null || _s$xComponent === void 0 ? void 0 : _s$xComponent.includes('Action.')) && getAssociationAppends(s, buf);
1612
+ return !((_s$xComponent = s['x-component']) === null || _s$xComponent === void 0 ? void 0 : _s$xComponent.includes('Action.')) && s['x-component'] !== 'TableField' ? getAssociationAppends(s, buf) : buf;
1617
1613
  }
1618
1614
  }
1619
1615
  }, arr);
1616
+ return data || [];
1620
1617
  };
1621
1618
  function flattenNestedList(nestedList) {
1622
1619
  var flattenedList = [];
@@ -1625,17 +1622,26 @@ var useAssociationNames = function useAssociationNames(collection) {
1625
1622
  if (Array.isArray(list[i])) {
1626
1623
  "".concat(prefix) !== "".concat(list[i][0]) && flattenHelper(list[i], "".concat(prefix, ".").concat(list[i][0]));
1627
1624
  } else {
1628
- var str = prefix.replaceAll("".concat(list[i]), '').replace('..', '.').trim();
1629
- !list.includes(str) && flattenedList.push("".concat(str).concat(list[i]));
1625
+ var searchTerm = ".".concat(list[i]);
1626
+ var lastIndex = prefix.lastIndexOf(searchTerm);
1627
+ var str = '';
1628
+ if (lastIndex !== -1) {
1629
+ str = prefix.slice(0, lastIndex) + prefix.slice(lastIndex + searchTerm.length);
1630
+ }
1631
+ if (!str) {
1632
+ !list.includes(str) && flattenedList.push("".concat(list[i]));
1633
+ } else {
1634
+ !list.includes(str) ? flattenedList.push("".concat(str, ".").concat(list[i])) : flattenedList.push(str);
1635
+ }
1630
1636
  }
1631
1637
  }
1632
1638
  }
1633
1639
  for (var i = 0; i < nestedList.length; i++) {
1634
1640
  flattenHelper(nestedList[i], nestedList[i][0]);
1635
1641
  }
1636
- return flattenedList.filter(function (obj) {
1637
- return !obj.startsWith('.');
1638
- });
1642
+ return (0, _lodash.uniq)(flattenedList.filter(function (obj) {
1643
+ return !(obj === null || obj === void 0 ? void 0 : obj.startsWith('.'));
1644
+ }));
1639
1645
  }
1640
1646
  var getNesterAppends = function getNesterAppends(gridSchema, data) {
1641
1647
  gridSchema.reduceProperties(function (buf, s) {
@@ -1646,16 +1652,31 @@ var useAssociationNames = function useAssociationNames(collection) {
1646
1652
  return g.length;
1647
1653
  });
1648
1654
  };
1649
- var data = getAssociationAppends(formSchema);
1650
- var associations = data.filter(function (g) {
1651
- return g.length;
1652
- });
1653
- var appends = flattenNestedList(associations);
1654
- return {
1655
- appends: appends,
1656
- updateAssociationValues: appends.filter(function (v) {
1657
- return associationValues.includes(v);
1658
- })
1659
- };
1655
+ var template = getTemplateById(templateSchema === null || templateSchema === void 0 ? void 0 : (_templateSchema$xCom = templateSchema['x-component-props']) === null || _templateSchema$xCom === void 0 ? void 0 : _templateSchema$xCom.templateId);
1656
+ var schema = getTemplateSchema(template);
1657
+ if (schema) {
1658
+ var associations = getAssociationAppends(schema);
1659
+ var appends = flattenNestedList(associations);
1660
+ return {
1661
+ appends: appends,
1662
+ updateAssociationValues: appends.filter(function (item) {
1663
+ return associationValues.some(function (suffix) {
1664
+ return item.endsWith(suffix);
1665
+ });
1666
+ })
1667
+ };
1668
+ }
1669
+ if (!schema) {
1670
+ var _associations = getAssociationAppends(formSchema);
1671
+ var _appends = flattenNestedList(_associations);
1672
+ return {
1673
+ appends: _appends,
1674
+ updateAssociationValues: _appends.filter(function (item) {
1675
+ return associationValues.some(function (suffix) {
1676
+ return item.endsWith(suffix);
1677
+ });
1678
+ })
1679
+ };
1680
+ }
1660
1681
  };
1661
1682
  exports.useAssociationNames = useAssociationNames;
@@ -14,12 +14,12 @@ var _CollectionFieldProvider = require("./CollectionFieldProvider");
14
14
  var _hooks = require("./hooks");
15
15
  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); }
16
16
  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; }
17
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
17
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
19
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
20
  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; }
20
21
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
21
22
  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); }
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); }
23
23
  // TODO: 初步适配
24
24
  var InternalField = function InternalField(props) {
25
25
  var component = props.component;
@@ -76,7 +76,7 @@ var InternalField = function InternalField(props) {
76
76
  if (!uiSchema) {
77
77
  return null;
78
78
  }
79
- return /*#__PURE__*/_react2.default.createElement(Component, props, props.children);
79
+ return /*#__PURE__*/_react2.default.createElement(Component, _objectSpread({}, props));
80
80
  };
81
81
  var InternalFallbackField = function InternalFallbackField() {
82
82
  var _fieldSchema$xCompon, _fieldSchema$xCompon2, _fieldSchema$xCompon3;
@@ -108,7 +108,7 @@ var DeletedField = function DeletedField() {
108
108
  style: {
109
109
  color: '#ccc'
110
110
  }
111
- }, t('The field has bee deleted'));
111
+ }, t('The field has been deleted'));
112
112
  };
113
113
  var CollectionField = (0, _react.connect)(function (props) {
114
114
  var _fieldSchema$xCompon4;
@@ -13,7 +13,8 @@ var CollectionFieldProvider = function CollectionFieldProvider(props) {
13
13
  var name = props.name,
14
14
  field = props.field,
15
15
  children = props.children,
16
- fallback = props.fallback;
16
+ _props$fallback = props.fallback,
17
+ fallback = _props$fallback === void 0 ? null : _props$fallback;
17
18
  var fieldSchema = (0, _react.useFieldSchema)();
18
19
  var _useCollection = (0, _hooks.useCollection)(),
19
20
  getField = _useCollection.getField;
@@ -15,10 +15,10 @@ var _reactI18next = require("react-i18next");
15
15
  var _apiClient = require("../../api-client");
16
16
  var _recordProvider = require("../../record-provider");
17
17
  var _schemaComponent = require("../../schema-component");
18
+ var _ResourceActionProvider = require("../ResourceActionProvider");
18
19
  var _actionHooks = require("../action-hooks");
19
20
  var _hooks = require("../hooks");
20
21
  var _useOptions = require("../hooks/useOptions");
21
- var _ResourceActionProvider = require("../ResourceActionProvider");
22
22
  var components = _interopRequireWildcard(require("./components"));
23
23
  var _interfaces = require("./interfaces");
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); }
@@ -302,7 +302,7 @@ var AddFieldAction = function AddFieldAction(props) {
302
302
  key: option.label,
303
303
  title: compile(option.label)
304
304
  }, option.children.filter(function (child) {
305
- return !['o2o', 'subTable'].includes(child.name);
305
+ return !['o2o', 'subTable', 'linkTo'].includes(child.name);
306
306
  }).map(function (child) {
307
307
  return /*#__PURE__*/_react2.default.createElement(_antd2.Menu.Item, {
308
308
  key: child.name,
@@ -1,2 +1,2 @@
1
1
  export declare const isTitleField: (field: any) => boolean;
2
- export declare const CollectionFields: (props: any) => JSX.Element;
2
+ export declare const CollectionFields: () => JSX.Element;
@@ -76,7 +76,6 @@ var CurrentFields = function CurrentFields(props) {
76
76
  loadingRecord = _React$useState2[0],
77
77
  setLoadingRecord = _React$useState2[1];
78
78
  var _useCollectionManager2 = (0, _useCollectionManager6.useCollectionManager)(),
79
- updateCollection = _useCollectionManager2.updateCollection,
80
79
  refreshCM = _useCollectionManager2.refreshCM;
81
80
  var columns = [{
82
81
  dataIndex: ['uiSchema', 'title'],
@@ -201,7 +200,6 @@ var InheritFields = function InheritFields(props) {
201
200
  var _useTranslation2 = (0, _reactI18next.useTranslation)(),
202
201
  t = _useTranslation2.t;
203
202
  var _useCollectionManager4 = (0, _useCollectionManager6.useCollectionManager)(),
204
- updateCollection = _useCollectionManager4.updateCollection,
205
203
  refreshCM = _useCollectionManager4.refreshCM;
206
204
  var columns = [{
207
205
  dataIndex: ['uiSchema', 'title'],
@@ -295,7 +293,7 @@ var InheritFields = function InheritFields(props) {
295
293
  })
296
294
  });
297
295
  };
298
- var CollectionFields = function CollectionFields(props) {
296
+ var CollectionFields = function CollectionFields() {
299
297
  var compile = (0, _schemaComponent.useCompile)();
300
298
  var field = (0, _react.useField)();
301
299
  var _useRecord3 = (0, _recordProvider.useRecord)(),
@@ -159,6 +159,13 @@ var ConfigurationTabs = function ConfigurationTabs() {
159
159
  _useState4 = _slicedToArray(_useState3, 2),
160
160
  key = _useState4[0],
161
161
  setKey = _useState4[1];
162
+ var _useState5 = (0, _react2.useState)('all'),
163
+ _useState6 = _slicedToArray(_useState5, 2),
164
+ activeKey = _useState6[0],
165
+ setActiveKey = _useState6[1];
166
+ var compile = (0, _schemaComponent.useCompile)();
167
+ var api = (0, _apiClient.useAPIClient)();
168
+ if (!data) return null;
162
169
  var tabsItems = data.sort(function (a, b) {
163
170
  return b.sort - a.sort;
164
171
  }).concat().map(function (v) {
@@ -175,12 +182,6 @@ var ConfigurationTabs = function ConfigurationTabs() {
175
182
  closable: false,
176
183
  schema: _collections.collectionTableSchema
177
184
  });
178
- var compile = (0, _schemaComponent.useCompile)();
179
- var _useState5 = (0, _react2.useState)('all'),
180
- _useState6 = _slicedToArray(_useState5, 2),
181
- activeKey = _useState6[0],
182
- setActiveKey = _useState6[1];
183
- var api = (0, _apiClient.useAPIClient)();
184
185
  var onChange = function onChange(key) {
185
186
  setActiveKey(key);
186
187
  setKey((0, _shared.uid)());
@@ -3,7 +3,7 @@ import { CollectionFieldOptions } from '../types';
3
3
  export declare type Collection = ReturnType<typeof useCollection>;
4
4
  export declare const useCollection: () => {
5
5
  resource: import("@nocobase/sdk").IResource;
6
- getField(name: SchemaKey): CollectionFieldOptions;
6
+ getField(name: SchemaKey): CollectionFieldOptions | null;
7
7
  getTreeParentField(): import("../types").FieldOptions;
8
8
  fields: import("../types").FieldOptions[];
9
9
  getPrimaryKey: () => any;
@@ -8,11 +8,11 @@ var _reactive = require("@formily/reactive");
8
8
  var _ = require(".");
9
9
  var _schemaComponent = require("../../schema-component");
10
10
  function useCollectionDataSource(filter) {
11
+ var compile = (0, _schemaComponent.useCompile)();
12
+ var _useCollectionManager = (0, _.useCollectionManager)(),
13
+ _useCollectionManager2 = _useCollectionManager.collections,
14
+ collections = _useCollectionManager2 === void 0 ? [] : _useCollectionManager2;
11
15
  return function (field) {
12
- var compile = (0, _schemaComponent.useCompile)();
13
- var _useCollectionManager = (0, _.useCollectionManager)(),
14
- _useCollectionManager2 = _useCollectionManager.collections,
15
- collections = _useCollectionManager2 === void 0 ? [] : _useCollectionManager2;
16
16
  _reactive.action.bound(function (data) {
17
17
  var filtered = typeof filter === 'function' ? data.filter(filter) : data;
18
18
  field.dataSource = filtered.map(function (item) {
@@ -58,7 +58,7 @@ var m2m = {
58
58
  var readPretty = _ref.readPretty,
59
59
  block = _ref.block,
60
60
  targetCollection = _ref.targetCollection;
61
- schema['type'] = 'array';
61
+ // schema['type'] = 'array';
62
62
  if ((targetCollection === null || targetCollection === void 0 ? void 0 : targetCollection.titleField) && schema['x-component-props']) {
63
63
  schema['x-component-props'].fieldNames = schema['x-component-props'].fieldNames || {
64
64
  value: 'id'
@@ -57,7 +57,7 @@ var m2o = {
57
57
  var block = _ref.block,
58
58
  readPretty = _ref.readPretty,
59
59
  targetCollection = _ref.targetCollection;
60
- schema['type'] = 'object';
60
+ // schema['type'] = 'object';
61
61
  if ((targetCollection === null || targetCollection === void 0 ? void 0 : targetCollection.titleField) && schema['x-component-props']) {
62
62
  schema['x-component-props'].fieldNames = schema['x-component-props'].fieldNames || {
63
63
  value: 'id'
@@ -58,7 +58,7 @@ var o2m = {
58
58
  block = _ref.block,
59
59
  readPretty = _ref.readPretty,
60
60
  targetCollection = _ref.targetCollection;
61
- schema['type'] = 'array';
61
+ // schema['type'] = 'array';
62
62
  if ((targetCollection === null || targetCollection === void 0 ? void 0 : targetCollection.titleField) && schema['x-component-props']) {
63
63
  schema['x-component-props'].fieldNames = schema['x-component-props'].fieldNames || {
64
64
  value: 'id'
@@ -237,7 +237,7 @@ var oho = {
237
237
  block = _ref2.block,
238
238
  readPretty = _ref2.readPretty,
239
239
  action = _ref2.action;
240
- schema['type'] = 'object';
240
+ // schema['type'] = 'object';
241
241
  if (['Table', 'Kanban'].includes(block)) {
242
242
  schema['x-component-props'] = schema['x-component-props'] || {};
243
243
  schema['x-component-props']['ellipsis'] = true;
@@ -407,7 +407,7 @@ var obo = {
407
407
  readPretty = _ref3.readPretty,
408
408
  action = _ref3.action,
409
409
  targetCollection = _ref3.targetCollection;
410
- schema['type'] = 'object';
410
+ // schema['type'] = 'object';
411
411
  if (['Table', 'Kanban'].includes(block)) {
412
412
  schema['x-component-props'] = schema['x-component-props'] || {};
413
413
  schema['x-component-props']['ellipsis'] = true;
@@ -37,7 +37,7 @@ var expression = {
37
37
  title: '{{t("Collection")}}',
38
38
  'x-component': 'CollectionSelect',
39
39
  'x-component-props': {
40
- multiple: true
40
+ // multiple: true,
41
41
  }
42
42
  }
43
43
  }, {
@@ -93,7 +93,7 @@ var transformToFilter = function transformToFilter(values, fieldSchema, getColle
93
93
  value = (0, _client.getValuesByPath)(value, collectionField.targetKey || 'id');
94
94
  key = "".concat(key, ".").concat(collectionField.targetKey || 'id');
95
95
  }
96
- if (!value || value.length === 0) {
96
+ if (!value) {
97
97
  return null;
98
98
  }
99
99
  return _defineProperty({}, key, _defineProperty({}, operators[key] || '$eq', value));
package/lib/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export * from './schema-component';
23
23
  export * from './schema-initializer';
24
24
  export * from './schema-settings';
25
25
  export * from './schema-templates';
26
+ export * from './schema-items';
26
27
  export * from './settings-form';
27
28
  export * from './system-settings';
28
29
  export * from './user';
package/lib/index.js CHANGED
@@ -268,6 +268,17 @@ Object.keys(_schemaTemplates).forEach(function (key) {
268
268
  }
269
269
  });
270
270
  });
271
+ var _schemaItems = require("./schema-items");
272
+ Object.keys(_schemaItems).forEach(function (key) {
273
+ if (key === "default" || key === "__esModule") return;
274
+ if (key in exports && exports[key] === _schemaItems[key]) return;
275
+ Object.defineProperty(exports, key, {
276
+ enumerable: true,
277
+ get: function get() {
278
+ return _schemaItems[key];
279
+ }
280
+ });
281
+ });
271
282
  var _settingsForm = require("./settings-form");
272
283
  Object.keys(_settingsForm).forEach(function (key) {
273
284
  if (key === "default" || key === "__esModule") return;
@@ -104,6 +104,17 @@ declare const _default: {
104
104
  Table: string;
105
105
  "Table OID(Inheritance)": string;
106
106
  Form: string;
107
+ List: string;
108
+ "Grid Card": string;
109
+ pixels: string;
110
+ "Screen size": string;
111
+ "Display title": string;
112
+ 'Set the count of columns displayed in a row': string;
113
+ Column: string;
114
+ 'Phone device': string;
115
+ 'Tablet device': string;
116
+ 'Desktop device': string;
117
+ 'Large screen device': string;
107
118
  Collapse: string;
108
119
  "Select data source": string;
109
120
  Calendar: string;
@@ -281,6 +292,9 @@ declare const _default: {
281
292
  "Display association fields": string;
282
293
  "Display field title": string;
283
294
  "Field component": string;
295
+ "Allow multiple": string;
296
+ "Quick upload": string;
297
+ "Select file": string;
284
298
  Subtable: string;
285
299
  Subform: string;
286
300
  "Field mode": string;
@@ -501,7 +515,7 @@ declare const _default: {
501
515
  "Skip required validation": string;
502
516
  "Form values": string;
503
517
  "Fields values": string;
504
- 'The field has bee deleted': string;
518
+ 'The field has been deleted': string;
505
519
  "When submitting the following fields, the saved values are": string;
506
520
  "After successful submission": string;
507
521
  Then: string;
@@ -694,5 +708,6 @@ declare const _default: {
694
708
  "Render Failed": string;
695
709
  Feedback: string;
696
710
  "Try again": string;
711
+ "Data template": string;
697
712
  };
698
713
  export default _default;
@@ -110,6 +110,17 @@ var _default = {
110
110
  "Table": "Table",
111
111
  "Table OID(Inheritance)": "Table OID(Inheritance)",
112
112
  "Form": "Form",
113
+ "List": "List",
114
+ "Grid Card": "Grid Card",
115
+ "pixels": "pixels",
116
+ "Screen size": "Screen size",
117
+ "Display title": "Display title",
118
+ 'Set the count of columns displayed in a row': "Set the count of columns displayed in a row",
119
+ 'Column': 'Column',
120
+ 'Phone device': 'Phone device',
121
+ 'Tablet device': 'Tablet device',
122
+ 'Desktop device': 'Desktop device',
123
+ 'Large screen device': 'Large screen device',
113
124
  "Collapse": "Collapse",
114
125
  "Select data source": "Select data source",
115
126
  "Calendar": "Calendar",
@@ -287,6 +298,9 @@ var _default = {
287
298
  "Display association fields": "Display association fields",
288
299
  "Display field title": "Display field title",
289
300
  "Field component": "Field component",
301
+ "Allow multiple": "Allow multiple",
302
+ "Quick upload": "Quick upload",
303
+ "Select file": "Select file",
290
304
  "Subtable": "Subtable",
291
305
  "Subform": "Sub-form",
292
306
  "Field mode": "Field mode",
@@ -507,7 +521,7 @@ var _default = {
507
521
  "Skip required validation": "Skip required validation",
508
522
  "Form values": "Form values",
509
523
  "Fields values": "Fields values",
510
- 'The field has bee deleted': 'The field has bee deleted',
524
+ 'The field has been deleted': 'The field has been deleted',
511
525
  "When submitting the following fields, the saved values are": "When submitting the following fields, the saved values are",
512
526
  "After successful submission": "After successful submission",
513
527
  "Then": "Then",
@@ -699,6 +713,7 @@ var _default = {
699
713
  "This is likely a NocoBase internals bug. Please open an issue at <1>here</1>": "This is likely a NocoBase internals bug. Please open an issue at <1>here</1>",
700
714
  "Render Failed": "Render Failed",
701
715
  "Feedback": "Feedback",
702
- "Try again": "Try again"
716
+ "Try again": "Try again",
717
+ "Data template": "Data template"
703
718
  };
704
719
  exports.default = _default;