@nocobase/client 0.9.2-alpha.4 → 0.9.4-alpha.1

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 (441) 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/DetailsBlockProvider.js +13 -1
  7. package/es/block-provider/FormBlockProvider.js +30 -13
  8. package/es/block-provider/hooks/index.d.ts +10 -0
  9. package/es/block-provider/hooks/index.js +521 -283
  10. package/es/collection-manager/CollectionField.js +3 -3
  11. package/es/collection-manager/CollectionFieldProvider.js +2 -1
  12. package/es/collection-manager/Configuration/AddFieldAction.js +3 -3
  13. package/es/collection-manager/Configuration/CollectionFields.d.ts +1 -1
  14. package/es/collection-manager/Configuration/CollectionFields.js +2 -5
  15. package/es/collection-manager/Configuration/ConfigurationTabs.js +7 -6
  16. package/es/collection-manager/Configuration/EditFieldAction.js +0 -1
  17. package/es/collection-manager/Configuration/OverridingCollectionField.js +0 -1
  18. package/es/collection-manager/action-hooks.d.ts +1 -1
  19. package/es/collection-manager/action-hooks.js +18 -7
  20. package/es/collection-manager/hooks/useCollection.d.ts +1 -1
  21. package/es/collection-manager/hooks/useCollectionDataSource.js +4 -4
  22. package/es/collection-manager/interfaces/createdBy.js +1 -1
  23. package/es/collection-manager/interfaces/linkTo.js +3 -39
  24. package/es/collection-manager/interfaces/m2m.js +4 -38
  25. package/es/collection-manager/interfaces/m2o.js +4 -38
  26. package/es/collection-manager/interfaces/o2m.js +4 -68
  27. package/es/collection-manager/interfaces/o2o.js +25 -119
  28. package/es/collection-manager/interfaces/updatedBy.js +1 -1
  29. package/es/collection-manager/templates/expression.js +1 -1
  30. package/es/collection-manager/templates/tree.js +2 -2
  31. package/es/filter-provider/FilterProvider.js +3 -1
  32. package/es/filter-provider/utils.js +1 -1
  33. package/es/index.d.ts +1 -0
  34. package/es/index.js +1 -0
  35. package/es/locale/en_US.d.ts +19 -1
  36. package/es/locale/en_US.js +22 -4
  37. package/es/locale/es_ES.d.ts +692 -0
  38. package/es/locale/es_ES.js +691 -0
  39. package/es/locale/ja_JP.d.ts +8 -1
  40. package/es/locale/ja_JP.js +9 -2
  41. package/es/locale/pt_BR.d.ts +5 -1
  42. package/es/locale/pt_BR.js +6 -2
  43. package/es/locale/ru_RU.d.ts +5 -1
  44. package/es/locale/ru_RU.js +6 -2
  45. package/es/locale/tr_TR.d.ts +5 -1
  46. package/es/locale/tr_TR.js +6 -2
  47. package/es/locale/zh_CN.d.ts +27 -1
  48. package/es/locale/zh_CN.js +28 -2
  49. package/es/record-provider/index.d.ts +4 -0
  50. package/es/record-provider/index.js +3 -0
  51. package/es/schema-component/antd/action/Action.Designer.js +10 -8
  52. package/es/schema-component/antd/action/Action.Drawer.js +4 -1
  53. package/es/schema-component/antd/action/ActionBar.js +25 -18
  54. package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
  55. package/es/schema-component/antd/association-field/AssociationFieldProvider.js +30 -0
  56. package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
  57. package/es/schema-component/antd/association-field/AssociationSelect.js +63 -0
  58. package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
  59. package/es/schema-component/antd/association-field/Editable.js +112 -0
  60. package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
  61. package/es/schema-component/antd/association-field/FileManager.js +243 -0
  62. package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
  63. package/es/schema-component/antd/association-field/InternalNester.js +29 -0
  64. package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
  65. package/es/schema-component/antd/association-field/InternalPicker.js +236 -0
  66. package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
  67. package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
  68. package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
  69. package/es/schema-component/antd/association-field/InternalViewer.js +112 -0
  70. package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
  71. package/es/schema-component/antd/association-field/Nester.js +71 -0
  72. package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
  73. package/es/schema-component/antd/association-field/ReadPretty.js +22 -0
  74. package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
  75. package/es/schema-component/antd/association-field/SubTable.js +25 -0
  76. package/es/schema-component/antd/association-field/components/CreateRecordAction.d.ts +2 -0
  77. package/es/schema-component/antd/association-field/components/CreateRecordAction.js +61 -0
  78. package/es/schema-component/antd/association-field/context.d.ts +8 -0
  79. package/es/schema-component/antd/association-field/context.js +2 -0
  80. package/es/schema-component/antd/association-field/hooks.d.ts +9 -0
  81. package/es/schema-component/antd/association-field/hooks.js +96 -0
  82. package/es/schema-component/antd/association-field/index.d.ts +1 -0
  83. package/es/schema-component/antd/association-field/index.js +14 -0
  84. package/es/schema-component/antd/association-field/schema.d.ts +142 -0
  85. package/es/schema-component/antd/association-field/schema.js +141 -0
  86. package/es/schema-component/antd/association-field/util.d.ts +8 -0
  87. package/es/schema-component/antd/association-field/util.js +84 -0
  88. package/es/schema-component/antd/association-filter/AssociationFilter.Item.js +3 -3
  89. package/es/schema-component/antd/association-select/AssociationSelect.js +49 -231
  90. package/es/schema-component/antd/association-select/useServiceOptions.js +2 -2
  91. package/es/schema-component/antd/collection-select/CollectionSelect.js +5 -0
  92. package/es/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
  93. package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
  94. package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
  95. package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
  96. package/es/schema-component/antd/expand-action/index.d.ts +1 -0
  97. package/es/schema-component/antd/expand-action/index.js +5 -0
  98. package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
  99. package/es/schema-component/antd/filter/FilterItem.js +1 -1
  100. package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
  101. package/es/schema-component/antd/form/Form.js +4 -4
  102. package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
  103. package/es/schema-component/antd/form-item/FormItem.js +263 -168
  104. package/es/schema-component/antd/form-item/SchemaSettingOptions.js +39 -61
  105. package/es/schema-component/antd/form-v2/Form.Designer.js +1 -0
  106. package/es/schema-component/antd/form-v2/Templates.d.ts +20 -0
  107. package/es/schema-component/antd/form-v2/Templates.js +40 -12
  108. package/es/schema-component/antd/form-v2/utils.js +3 -1
  109. package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
  110. package/es/schema-component/antd/grid/Grid.js +34 -24
  111. package/es/schema-component/antd/grid-card/GridCard.Decorator.d.ts +5 -0
  112. package/es/schema-component/antd/grid-card/GridCard.Decorator.js +65 -0
  113. package/es/schema-component/antd/grid-card/GridCard.Designer.d.ts +1 -0
  114. package/es/schema-component/antd/grid-card/GridCard.Designer.js +243 -0
  115. package/es/schema-component/antd/grid-card/GridCard.Item.d.ts +1 -0
  116. package/es/schema-component/antd/grid-card/GridCard.Item.js +18 -0
  117. package/es/schema-component/antd/grid-card/GridCard.d.ts +8 -0
  118. package/es/schema-component/antd/grid-card/GridCard.js +103 -0
  119. package/es/schema-component/antd/grid-card/hooks.d.ts +4 -0
  120. package/es/schema-component/antd/grid-card/hooks.js +9 -0
  121. package/es/schema-component/antd/grid-card/index.d.ts +1 -0
  122. package/es/schema-component/antd/grid-card/index.js +1 -0
  123. package/es/schema-component/antd/grid-card/options.d.ts +20 -0
  124. package/es/schema-component/antd/grid-card/options.js +20 -0
  125. package/es/schema-component/antd/index.d.ts +5 -1
  126. package/es/schema-component/antd/index.js +5 -1
  127. package/es/schema-component/antd/list/List.Decorator.d.ts +5 -0
  128. package/es/schema-component/antd/list/List.Decorator.js +59 -0
  129. package/es/schema-component/antd/list/List.Designer.d.ts +1 -0
  130. package/es/schema-component/antd/list/List.Designer.js +205 -0
  131. package/es/schema-component/antd/list/List.Item.d.ts +1 -0
  132. package/es/schema-component/antd/list/List.Item.js +15 -0
  133. package/es/schema-component/antd/list/List.d.ts +8 -0
  134. package/es/schema-component/antd/list/List.js +83 -0
  135. package/es/schema-component/antd/list/hooks.d.ts +4 -0
  136. package/es/schema-component/antd/list/hooks.js +9 -0
  137. package/es/schema-component/antd/list/index.d.ts +1 -0
  138. package/es/schema-component/antd/list/index.js +1 -0
  139. package/es/schema-component/antd/menu/Menu.js +6 -3
  140. package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
  141. package/es/schema-component/antd/record-picker/InputRecordPicker.js +32 -12
  142. package/es/schema-component/antd/remote-select/RemoteSelect.js +23 -23
  143. package/es/schema-component/antd/select/Select.js +2 -0
  144. package/es/schema-component/antd/table/Table.Void.Designer.js +1 -0
  145. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
  146. package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
  147. package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
  148. package/es/schema-component/antd/table-v2/Table.js +9 -5
  149. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
  150. package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -0
  151. package/es/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +22 -0
  152. package/es/schema-component/antd/table-v2/hooks/useUserVariable.js +65 -0
  153. package/es/schema-component/antd/table-v2/index.js +3 -1
  154. package/es/schema-component/antd/table-v2/utils.js +1 -1
  155. package/es/schema-component/antd/variable/Input.js +11 -8
  156. package/es/schema-component/antd/variable/TextArea.js +2 -5
  157. package/es/schema-component/common/dnd-context/index.js +3 -2
  158. package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
  159. package/es/schema-component/common/utils/uitls.js +1 -1
  160. package/es/schema-component/core/SchemaComponentProvider.js +2 -2
  161. package/es/schema-component/hooks/index.d.ts +1 -0
  162. package/es/schema-component/hooks/index.js +2 -1
  163. package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
  164. package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
  165. package/es/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
  166. package/es/schema-initializer/SchemaInitializerProvider.js +23 -10
  167. package/es/schema-initializer/buttons/BlockInitializers.js +10 -0
  168. package/es/schema-initializer/buttons/CustomFormItemInitializers.js +4 -2
  169. package/es/schema-initializer/buttons/FormActionInitializers.d.ts +0 -116
  170. package/es/schema-initializer/buttons/FormActionInitializers.js +106 -100
  171. package/es/schema-initializer/buttons/GanttActionInitializers.d.ts +0 -19
  172. package/es/schema-initializer/buttons/GridCardActionInitializers.d.ts +195 -0
  173. package/es/schema-initializer/buttons/GridCardActionInitializers.js +278 -0
  174. package/es/schema-initializer/buttons/ListActionInitializers.d.ts +195 -0
  175. package/es/schema-initializer/buttons/ListActionInitializers.js +278 -0
  176. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
  177. package/es/schema-initializer/buttons/TableActionInitializers.d.ts +0 -20
  178. package/es/schema-initializer/buttons/TableActionInitializers.js +29 -35
  179. package/es/schema-initializer/buttons/TableColumnInitializers.js +4 -1
  180. package/es/schema-initializer/buttons/index.d.ts +3 -0
  181. package/es/schema-initializer/buttons/index.js +3 -0
  182. package/es/schema-initializer/components/BulkEditField.js +7 -5
  183. package/es/schema-initializer/components/CreateRecordAction.d.ts +2 -1
  184. package/es/schema-initializer/components/CreateRecordAction.js +55 -33
  185. package/es/schema-initializer/components/DeletedField.d.ts +1 -0
  186. package/es/schema-initializer/components/DeletedField.js +11 -0
  187. package/es/schema-initializer/components/assigned-field/AssignedField.js +35 -23
  188. package/es/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
  189. package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
  190. package/es/schema-initializer/items/GridCardBlockInitializer.d.ts +1 -0
  191. package/es/schema-initializer/items/GridCardBlockInitializer.js +47 -0
  192. package/es/schema-initializer/items/ListBlockInitializer.d.ts +1 -0
  193. package/es/schema-initializer/items/ListBlockInitializer.js +47 -0
  194. package/es/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
  195. package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
  196. package/es/schema-initializer/items/index.d.ts +3 -0
  197. package/es/schema-initializer/items/index.js +3 -0
  198. package/es/schema-initializer/utils.d.ts +112 -0
  199. package/es/schema-initializer/utils.js +224 -38
  200. package/es/schema-items/GeneralSchemaItems.d.ts +4 -0
  201. package/es/schema-items/GeneralSchemaItems.js +148 -0
  202. package/es/schema-items/index.d.ts +1 -0
  203. package/es/schema-items/index.js +2 -1
  204. package/es/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -0
  205. package/es/schema-settings/DataTemplates/FormDataTemplates.js +117 -42
  206. package/es/schema-settings/DataTemplates/components/Designer.d.ts +7 -0
  207. package/es/schema-settings/DataTemplates/components/Designer.js +179 -0
  208. package/es/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +6 -1
  209. package/es/schema-settings/DataTemplates/hooks/useCollectionState.js +204 -96
  210. package/es/schema-settings/GeneralSchemaDesigner.js +19 -15
  211. package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
  212. package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
  213. package/es/schema-settings/LinkageRules/Variables.js +7 -4
  214. package/es/schema-settings/SchemaSettings.d.ts +1 -1
  215. package/es/schema-settings/SchemaSettings.js +53 -29
  216. package/es/schema-settings/VariableInput/hooks/useUserVariable.js +1 -1
  217. package/es/schema-settings/hooks/useIsShowMultipleSwitch.d.ts +4 -0
  218. package/es/schema-settings/hooks/useIsShowMultipleSwitch.js +18 -0
  219. package/es/schema-templates/BlockTemplateDetails.js +1 -1
  220. package/es/user/CurrentUser.js +118 -10
  221. package/lib/acl/ACLProvider.js +2 -2
  222. package/lib/acl/Configuration/RoleConfigure.js +15 -8
  223. package/lib/api-client/APIClient.d.ts +2 -0
  224. package/lib/api-client/APIClient.js +11 -0
  225. package/lib/block-provider/BlockProvider.js +57 -16
  226. package/lib/block-provider/DetailsBlockProvider.js +13 -1
  227. package/lib/block-provider/FormBlockProvider.js +31 -15
  228. package/lib/block-provider/hooks/index.d.ts +10 -0
  229. package/lib/block-provider/hooks/index.js +531 -290
  230. package/lib/collection-manager/CollectionField.js +3 -3
  231. package/lib/collection-manager/CollectionFieldProvider.js +2 -1
  232. package/lib/collection-manager/Configuration/AddFieldAction.js +2 -2
  233. package/lib/collection-manager/Configuration/CollectionFields.d.ts +1 -1
  234. package/lib/collection-manager/Configuration/CollectionFields.js +2 -5
  235. package/lib/collection-manager/Configuration/ConfigurationTabs.js +7 -6
  236. package/lib/collection-manager/Configuration/EditFieldAction.js +0 -1
  237. package/lib/collection-manager/Configuration/OverridingCollectionField.js +0 -1
  238. package/lib/collection-manager/action-hooks.d.ts +1 -1
  239. package/lib/collection-manager/action-hooks.js +18 -7
  240. package/lib/collection-manager/hooks/useCollection.d.ts +1 -1
  241. package/lib/collection-manager/hooks/useCollectionDataSource.js +4 -4
  242. package/lib/collection-manager/interfaces/createdBy.js +1 -1
  243. package/lib/collection-manager/interfaces/linkTo.js +2 -38
  244. package/lib/collection-manager/interfaces/m2m.js +3 -37
  245. package/lib/collection-manager/interfaces/m2o.js +3 -37
  246. package/lib/collection-manager/interfaces/o2m.js +6 -70
  247. package/lib/collection-manager/interfaces/o2o.js +30 -124
  248. package/lib/collection-manager/interfaces/updatedBy.js +1 -1
  249. package/lib/collection-manager/templates/expression.js +1 -1
  250. package/lib/collection-manager/templates/tree.js +2 -2
  251. package/lib/filter-provider/FilterProvider.js +3 -1
  252. package/lib/filter-provider/utils.js +1 -1
  253. package/lib/index.d.ts +1 -0
  254. package/lib/index.js +11 -0
  255. package/lib/locale/en_US.d.ts +19 -1
  256. package/lib/locale/en_US.js +22 -4
  257. package/lib/locale/es_ES.d.ts +692 -0
  258. package/lib/locale/es_ES.js +698 -0
  259. package/lib/locale/ja_JP.d.ts +8 -1
  260. package/lib/locale/ja_JP.js +9 -2
  261. package/lib/locale/pt_BR.d.ts +5 -1
  262. package/lib/locale/pt_BR.js +6 -2
  263. package/lib/locale/ru_RU.d.ts +5 -1
  264. package/lib/locale/ru_RU.js +6 -2
  265. package/lib/locale/tr_TR.d.ts +5 -1
  266. package/lib/locale/tr_TR.js +6 -2
  267. package/lib/locale/zh_CN.d.ts +27 -1
  268. package/lib/locale/zh_CN.js +28 -2
  269. package/lib/record-provider/index.d.ts +4 -0
  270. package/lib/record-provider/index.js +5 -1
  271. package/lib/schema-component/antd/action/Action.Designer.js +10 -8
  272. package/lib/schema-component/antd/action/Action.Drawer.js +4 -1
  273. package/lib/schema-component/antd/action/ActionBar.js +23 -16
  274. package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
  275. package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +40 -0
  276. package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
  277. package/lib/schema-component/antd/association-field/AssociationSelect.js +72 -0
  278. package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
  279. package/lib/schema-component/antd/association-field/Editable.js +121 -0
  280. package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
  281. package/lib/schema-component/antd/association-field/FileManager.js +253 -0
  282. package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
  283. package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
  284. package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
  285. package/lib/schema-component/antd/association-field/InternalPicker.js +246 -0
  286. package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
  287. package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
  288. package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
  289. package/lib/schema-component/antd/association-field/InternalViewer.js +123 -0
  290. package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
  291. package/lib/schema-component/antd/association-field/Nester.js +80 -0
  292. package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
  293. package/lib/schema-component/antd/association-field/ReadPretty.js +30 -0
  294. package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
  295. package/lib/schema-component/antd/association-field/SubTable.js +33 -0
  296. package/lib/schema-component/antd/association-field/components/CreateRecordAction.d.ts +2 -0
  297. package/lib/schema-component/antd/association-field/components/CreateRecordAction.js +71 -0
  298. package/lib/schema-component/antd/association-field/context.d.ts +8 -0
  299. package/lib/schema-component/antd/association-field/context.js +9 -0
  300. package/lib/schema-component/antd/association-field/hooks.d.ts +9 -0
  301. package/lib/schema-component/antd/association-field/hooks.js +107 -0
  302. package/lib/schema-component/antd/association-field/index.d.ts +1 -0
  303. package/lib/schema-component/antd/association-field/index.js +21 -0
  304. package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
  305. package/lib/schema-component/antd/association-field/schema.js +148 -0
  306. package/lib/schema-component/antd/association-field/util.d.ts +8 -0
  307. package/lib/schema-component/antd/association-field/util.js +98 -0
  308. package/lib/schema-component/antd/association-filter/AssociationFilter.Item.js +3 -3
  309. package/lib/schema-component/antd/association-select/AssociationSelect.js +49 -231
  310. package/lib/schema-component/antd/association-select/useServiceOptions.js +2 -2
  311. package/lib/schema-component/antd/collection-select/CollectionSelect.js +5 -0
  312. package/lib/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
  313. package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
  314. package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
  315. package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
  316. package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
  317. package/lib/schema-component/antd/expand-action/index.js +12 -0
  318. package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
  319. package/lib/schema-component/antd/filter/FilterItem.js +1 -1
  320. package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
  321. package/lib/schema-component/antd/form/Form.js +4 -4
  322. package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
  323. package/lib/schema-component/antd/form-item/FormItem.js +258 -162
  324. package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +37 -59
  325. package/lib/schema-component/antd/form-v2/Form.Designer.js +1 -0
  326. package/lib/schema-component/antd/form-v2/Templates.d.ts +20 -0
  327. package/lib/schema-component/antd/form-v2/Templates.js +39 -11
  328. package/lib/schema-component/antd/form-v2/utils.js +3 -1
  329. package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
  330. package/lib/schema-component/antd/grid/Grid.js +33 -23
  331. package/lib/schema-component/antd/grid-card/GridCard.Decorator.d.ts +5 -0
  332. package/lib/schema-component/antd/grid-card/GridCard.Decorator.js +77 -0
  333. package/lib/schema-component/antd/grid-card/GridCard.Designer.d.ts +1 -0
  334. package/lib/schema-component/antd/grid-card/GridCard.Designer.js +253 -0
  335. package/lib/schema-component/antd/grid-card/GridCard.Item.d.ts +1 -0
  336. package/lib/schema-component/antd/grid-card/GridCard.Item.js +26 -0
  337. package/lib/schema-component/antd/grid-card/GridCard.d.ts +8 -0
  338. package/lib/schema-component/antd/grid-card/GridCard.js +112 -0
  339. package/lib/schema-component/antd/grid-card/hooks.d.ts +4 -0
  340. package/lib/schema-component/antd/grid-card/hooks.js +16 -0
  341. package/lib/schema-component/antd/grid-card/index.d.ts +1 -0
  342. package/lib/schema-component/antd/grid-card/index.js +16 -0
  343. package/lib/schema-component/antd/grid-card/options.d.ts +20 -0
  344. package/lib/schema-component/antd/grid-card/options.js +31 -0
  345. package/lib/schema-component/antd/index.d.ts +5 -1
  346. package/lib/schema-component/antd/index.js +55 -11
  347. package/lib/schema-component/antd/list/List.Decorator.d.ts +5 -0
  348. package/lib/schema-component/antd/list/List.Decorator.js +71 -0
  349. package/lib/schema-component/antd/list/List.Designer.d.ts +1 -0
  350. package/lib/schema-component/antd/list/List.Designer.js +213 -0
  351. package/lib/schema-component/antd/list/List.Item.d.ts +1 -0
  352. package/lib/schema-component/antd/list/List.Item.js +23 -0
  353. package/lib/schema-component/antd/list/List.d.ts +8 -0
  354. package/lib/schema-component/antd/list/List.js +92 -0
  355. package/lib/schema-component/antd/list/hooks.d.ts +4 -0
  356. package/lib/schema-component/antd/list/hooks.js +16 -0
  357. package/lib/schema-component/antd/list/index.d.ts +1 -0
  358. package/lib/schema-component/antd/list/index.js +16 -0
  359. package/lib/schema-component/antd/menu/Menu.js +6 -3
  360. package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
  361. package/lib/schema-component/antd/record-picker/InputRecordPicker.js +34 -13
  362. package/lib/schema-component/antd/remote-select/RemoteSelect.js +22 -22
  363. package/lib/schema-component/antd/select/Select.js +2 -0
  364. package/lib/schema-component/antd/table/Table.Void.Designer.js +1 -0
  365. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
  366. package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
  367. package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
  368. package/lib/schema-component/antd/table-v2/Table.js +9 -5
  369. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
  370. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +1 -0
  371. package/lib/schema-component/antd/table-v2/hooks/useUserVariable.d.ts +22 -0
  372. package/lib/schema-component/antd/table-v2/hooks/useUserVariable.js +73 -0
  373. package/lib/schema-component/antd/table-v2/index.js +3 -1
  374. package/lib/schema-component/antd/table-v2/utils.js +1 -1
  375. package/lib/schema-component/antd/variable/Input.js +11 -8
  376. package/lib/schema-component/antd/variable/TextArea.js +2 -5
  377. package/lib/schema-component/common/dnd-context/index.js +3 -2
  378. package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
  379. package/lib/schema-component/common/utils/uitls.js +1 -1
  380. package/lib/schema-component/core/SchemaComponentProvider.js +2 -2
  381. package/lib/schema-component/hooks/index.d.ts +1 -0
  382. package/lib/schema-component/hooks/index.js +11 -0
  383. package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
  384. package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
  385. package/lib/schema-initializer/SchemaInitializerProvider.d.ts +1 -0
  386. package/lib/schema-initializer/SchemaInitializerProvider.js +22 -9
  387. package/lib/schema-initializer/buttons/BlockInitializers.js +10 -0
  388. package/lib/schema-initializer/buttons/CustomFormItemInitializers.js +4 -2
  389. package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +0 -116
  390. package/lib/schema-initializer/buttons/FormActionInitializers.js +106 -100
  391. package/lib/schema-initializer/buttons/GanttActionInitializers.d.ts +0 -19
  392. package/lib/schema-initializer/buttons/GridCardActionInitializers.d.ts +195 -0
  393. package/lib/schema-initializer/buttons/GridCardActionInitializers.js +285 -0
  394. package/lib/schema-initializer/buttons/ListActionInitializers.d.ts +195 -0
  395. package/lib/schema-initializer/buttons/ListActionInitializers.js +285 -0
  396. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
  397. package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +0 -20
  398. package/lib/schema-initializer/buttons/TableActionInitializers.js +29 -35
  399. package/lib/schema-initializer/buttons/TableColumnInitializers.js +4 -1
  400. package/lib/schema-initializer/buttons/index.d.ts +3 -0
  401. package/lib/schema-initializer/buttons/index.js +22 -0
  402. package/lib/schema-initializer/components/BulkEditField.js +7 -5
  403. package/lib/schema-initializer/components/CreateRecordAction.d.ts +2 -1
  404. package/lib/schema-initializer/components/CreateRecordAction.js +58 -35
  405. package/lib/schema-initializer/components/DeletedField.d.ts +1 -0
  406. package/lib/schema-initializer/components/DeletedField.js +19 -0
  407. package/lib/schema-initializer/components/assigned-field/AssignedField.js +34 -22
  408. package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
  409. package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
  410. package/lib/schema-initializer/items/GridCardBlockInitializer.d.ts +1 -0
  411. package/lib/schema-initializer/items/GridCardBlockInitializer.js +55 -0
  412. package/lib/schema-initializer/items/ListBlockInitializer.d.ts +1 -0
  413. package/lib/schema-initializer/items/ListBlockInitializer.js +55 -0
  414. package/lib/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
  415. package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
  416. package/lib/schema-initializer/items/index.d.ts +3 -0
  417. package/lib/schema-initializer/items/index.js +33 -0
  418. package/lib/schema-initializer/utils.d.ts +112 -0
  419. package/lib/schema-initializer/utils.js +227 -39
  420. package/lib/schema-items/GeneralSchemaItems.d.ts +4 -0
  421. package/lib/schema-items/GeneralSchemaItems.js +156 -0
  422. package/lib/schema-items/index.d.ts +1 -0
  423. package/lib/schema-items/index.js +11 -0
  424. package/lib/schema-settings/DataTemplates/FormDataTemplates.d.ts +1 -0
  425. package/lib/schema-settings/DataTemplates/FormDataTemplates.js +119 -41
  426. package/lib/schema-settings/DataTemplates/components/Designer.d.ts +7 -0
  427. package/lib/schema-settings/DataTemplates/components/Designer.js +188 -0
  428. package/lib/schema-settings/DataTemplates/hooks/useCollectionState.d.ts +6 -1
  429. package/lib/schema-settings/DataTemplates/hooks/useCollectionState.js +204 -95
  430. package/lib/schema-settings/GeneralSchemaDesigner.js +21 -15
  431. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
  432. package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
  433. package/lib/schema-settings/LinkageRules/Variables.js +7 -4
  434. package/lib/schema-settings/SchemaSettings.d.ts +1 -1
  435. package/lib/schema-settings/SchemaSettings.js +53 -29
  436. package/lib/schema-settings/VariableInput/hooks/useUserVariable.js +1 -1
  437. package/lib/schema-settings/hooks/useIsShowMultipleSwitch.d.ts +4 -0
  438. package/lib/schema-settings/hooks/useIsShowMultipleSwitch.js +24 -0
  439. package/lib/user/CurrentUser.js +116 -8
  440. package/package.json +5 -6
  441. package/tsconfig.json +8 -0
@@ -7,12 +7,12 @@ exports.default = exports.RemoteSelect = void 0;
7
7
  var _icons = require("@ant-design/icons");
8
8
  var _react = require("@formily/react");
9
9
  var _antd = require("antd");
10
+ var _lodash = require("lodash");
10
11
  var _moment = _interopRequireDefault(require("moment"));
11
12
  var _react2 = _interopRequireWildcard(require("react"));
12
13
  var _apiClient = require("../../../api-client");
13
14
  var _SharedFilterProvider = require("../../../block-provider/SharedFilterProvider");
14
15
  var _collectionManager = require("../../../collection-manager");
15
- var _hooks = require("../../hooks");
16
16
  var _select = require("../select");
17
17
  var _ReadPretty = require("./ReadPretty");
18
18
  var _excluded = ["fieldNames", "service", "wait", "value", "objectValue", "manual", "mapOptions", "targetField"];
@@ -30,8 +30,9 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
30
30
  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); }
31
31
  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; }
32
32
  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; }
33
+ var EMPTY = 'N/A';
33
34
  var InternalRemoteSelect = (0, _react.connect)(function (props) {
34
- var _service$params;
35
+ var _field$componentProps, _field$componentProps2, _field$componentProps3, _service$params;
35
36
  var _props$fieldNames = props.fieldNames,
36
37
  fieldNames = _props$fieldNames === void 0 ? {} : _props$fieldNames,
37
38
  _props$service = props.service,
@@ -45,9 +46,9 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
45
46
  mapOptions = props.mapOptions,
46
47
  _targetField = props.targetField,
47
48
  others = _objectWithoutProperties(props, _excluded);
48
- var compile = (0, _hooks.useCompile)();
49
49
  var firstRun = (0, _react2.useRef)(false);
50
50
  var fieldSchema = (0, _react.useFieldSchema)();
51
+ var field = (0, _react.useField)();
51
52
  var _useCollection = (0, _collectionManager.useCollection)(),
52
53
  getField = _useCollection.getField;
53
54
  var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
@@ -65,7 +66,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
65
66
  var mapOptionsToTags = (0, _react2.useCallback)(function (options) {
66
67
  try {
67
68
  return options.map(function (option) {
68
- var _targetField$uiSchema, _ref;
69
+ var _targetField$uiSchema, _objectSpread2;
69
70
  var label = option[fieldNames.label];
70
71
  if (targetField === null || targetField === void 0 ? void 0 : (_targetField$uiSchema = targetField.uiSchema) === null || _targetField$uiSchema === void 0 ? void 0 : _targetField$uiSchema.enum) {
71
72
  if (Array.isArray(label)) {
@@ -82,7 +83,9 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
82
83
  }
83
84
  }, (option === null || option === void 0 ? void 0 : option.label) || item);
84
85
  } else {
85
- return /*#__PURE__*/_react2.default.createElement(_antd.Tag, null, item);
86
+ return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
87
+ key: item
88
+ }, item);
86
89
  }
87
90
  }).reverse();
88
91
  } else {
@@ -101,10 +104,10 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
101
104
  }
102
105
  if (mapOptions) {
103
106
  var _mapOptions;
104
- return mapOptions((_mapOptions = {}, _defineProperty(_mapOptions, fieldNames.label, label), _defineProperty(_mapOptions, fieldNames.value, option[fieldNames.value]), _mapOptions));
107
+ return mapOptions((_mapOptions = {}, _defineProperty(_mapOptions, fieldNames.label, label || EMPTY), _defineProperty(_mapOptions, fieldNames.value, option[fieldNames.value]), _mapOptions));
105
108
  }
106
- return _ref = {}, _defineProperty(_ref, fieldNames.label, label || option[fieldNames.value]), _defineProperty(_ref, fieldNames.value, option[fieldNames.value]), _ref;
107
- });
109
+ return _objectSpread(_objectSpread({}, option), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, fieldNames.label, label || EMPTY), _defineProperty(_objectSpread2, fieldNames.value, option[fieldNames.value]), _objectSpread2));
110
+ }).filter(Boolean);
108
111
  } catch (err) {
109
112
  console.error(err);
110
113
  return options;
@@ -118,7 +121,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
118
121
  }, service === null || service === void 0 ? void 0 : service.params), {}, {
119
122
  // fields: [fieldNames.label, fieldNames.value, ...(service?.params?.fields || [])],
120
123
  // search needs
121
- filter: (0, _SharedFilterProvider.mergeFilter)([service === null || service === void 0 ? void 0 : (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params.filter])
124
+ filter: (0, _SharedFilterProvider.mergeFilter)([((_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : (_field$componentProps2 = _field$componentProps.service) === null || _field$componentProps2 === void 0 ? void 0 : (_field$componentProps3 = _field$componentProps2.params) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.filter) || (service === null || service === void 0 ? void 0 : (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params.filter)])
122
125
  })
123
126
  }), {
124
127
  manual: manual,
@@ -140,13 +143,13 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
140
143
  }
141
144
  }, [runDep]);
142
145
  var onSearch = /*#__PURE__*/function () {
143
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(search) {
144
- var _service$params2;
146
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(search) {
147
+ var _field$componentProps4, _field$componentProps5, _field$componentProps6, _service$params2;
145
148
  return _regeneratorRuntime().wrap(function _callee$(_context) {
146
149
  while (1) switch (_context.prev = _context.next) {
147
150
  case 0:
148
151
  run({
149
- filter: (0, _SharedFilterProvider.mergeFilter)([_defineProperty({}, fieldNames.label, _defineProperty({}, operator, search)), service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter])
152
+ filter: (0, _SharedFilterProvider.mergeFilter)([search ? _defineProperty({}, fieldNames.label, _defineProperty({}, operator, search)) : {}, ((_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : (_field$componentProps5 = _field$componentProps4.service) === null || _field$componentProps5 === void 0 ? void 0 : (_field$componentProps6 = _field$componentProps5.params) === null || _field$componentProps6 === void 0 ? void 0 : _field$componentProps6.filter) || (service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter)])
150
153
  });
151
154
  case 1:
152
155
  case "end":
@@ -155,32 +158,28 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
155
158
  }, _callee);
156
159
  }));
157
160
  return function onSearch(_x) {
158
- return _ref2.apply(this, arguments);
161
+ return _ref.apply(this, arguments);
159
162
  };
160
163
  }();
161
164
  var getOptionsByFieldNames = (0, _react2.useCallback)(function (item) {
162
165
  return Object.keys(fieldNames).reduce(function (obj, key) {
163
- var value = item[fieldNames[key]];
164
- if (value) {
165
- // support hidden, disabled, etc.
166
- obj[['label', 'value', 'options'].includes(key) ? fieldNames[key] : key] = key === 'label' ? compile(value) : value;
167
- }
168
166
  return obj;
169
167
  }, {});
170
168
  }, [fieldNames]);
171
169
  var normalizeOptions = (0, _react2.useCallback)(function (obj) {
172
- var _ref4;
170
+ var _ref3;
173
171
  if (objectValue || _typeof(obj) === 'object') {
174
172
  return getOptionsByFieldNames(obj);
175
173
  }
176
- return _ref4 = {}, _defineProperty(_ref4, fieldNames.value, obj), _defineProperty(_ref4, fieldNames.label, obj), _ref4;
174
+ return _ref3 = {}, _defineProperty(_ref3, fieldNames.value, obj), _defineProperty(_ref3, fieldNames.label, obj), _ref3;
177
175
  }, [objectValue, getOptionsByFieldNames]);
178
176
  var options = (0, _react2.useMemo)(function () {
179
177
  var _data$data, _data$data2;
180
178
  if (!(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.length)) {
181
- return value !== undefined && value !== null ? Array.isArray(value) ? value.map(normalizeOptions) : [normalizeOptions(value)] : [];
179
+ return value !== undefined && value !== null ? Array.isArray(value) ? value : [value] : [];
182
180
  }
183
- return (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.map(getOptionsByFieldNames)) || [];
181
+ var valueOptions = value !== undefined && value !== null && (Array.isArray(value) ? value : [value]) || [];
182
+ return (0, _lodash.uniqBy)((data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.concat(valueOptions)) || [], fieldNames.value);
184
183
  }, [data === null || data === void 0 ? void 0 : data.data, getOptionsByFieldNames, normalizeOptions, value]);
185
184
  var onDropdownVisibleChange = function onDropdownVisibleChange() {
186
185
  if (firstRun.current) {
@@ -190,6 +189,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
190
189
  firstRun.current = true;
191
190
  };
192
191
  return /*#__PURE__*/_react2.default.createElement(_select.Select, _objectSpread(_objectSpread({
192
+ dropdownMatchSelectWidth: false,
193
193
  autoClearSearchValue: true,
194
194
  filterOption: false,
195
195
  filterSort: null,
@@ -60,6 +60,7 @@ var ObjectSelect = function ObjectSelect(props) {
60
60
  options: options,
61
61
  fieldNames: fieldNames,
62
62
  showSearch: true,
63
+ dropdownMatchSelectWidth: false,
63
64
  filterOption: function filterOption(input, option) {
64
65
  var _option;
65
66
  return ((_option = option === null || option === void 0 ? void 0 : option[fieldNames.label || 'label']) !== null && _option !== void 0 ? _option : '').includes(input);
@@ -103,6 +104,7 @@ var InternalSelect = (0, _react.connect)(function (props) {
103
104
  showSearch: true,
104
105
  filterOption: filterOption,
105
106
  allowClear: true,
107
+ dropdownMatchSelectWidth: false,
106
108
  value: value
107
109
  }, others), {}, {
108
110
  onChange: function onChange(changed) {
@@ -121,6 +121,7 @@ var TableVoidDesigner = function TableVoidDesigner() {
121
121
  field: {
122
122
  type: 'string',
123
123
  enum: sortFields,
124
+ required: true,
124
125
  'x-decorator': 'FormItem',
125
126
  'x-component': 'Select',
126
127
  'x-component-props': {
@@ -38,12 +38,13 @@ var useLabelFields = function useLabelFields(collectionName) {
38
38
  });
39
39
  };
40
40
  var TableColumnDesigner = function TableColumnDesigner(props) {
41
- var _fieldSchema$xCompon, _uiSchema$xComponent, _collectionField$targ, _collectionField$uiSc, _columnSchema$xCompo, _fieldSchema$xCompon2, _fieldSchema$xCompon3;
41
+ var _fieldSchema$xCompon, _uiSchema$xComponent, _collectionField$targ, _collectionField$uiSc, _columnSchema$xCompo, _fieldSchema$xCompon2;
42
42
  var uiSchema = props.uiSchema,
43
43
  fieldSchema = props.fieldSchema,
44
44
  collectionField = props.collectionField;
45
45
  var _useCollectionManager2 = (0, _collectionManager.useCollectionManager)(),
46
- getInterface = _useCollectionManager2.getInterface;
46
+ getInterface = _useCollectionManager2.getInterface,
47
+ getCollection = _useCollectionManager2.getCollection;
47
48
  var field = (0, _react.useField)();
48
49
  var _useTranslation = (0, _reactI18next.useTranslation)(),
49
50
  t = _useTranslation.t;
@@ -53,6 +54,8 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
53
54
  var fieldNames = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon['fieldNames']) || (uiSchema === null || uiSchema === void 0 ? void 0 : (_uiSchema$xComponent = uiSchema['x-component-props']) === null || _uiSchema$xComponent === void 0 ? void 0 : _uiSchema$xComponent['fieldNames']);
54
55
  var options = useLabelFields((_collectionField$targ = collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) !== null && _collectionField$targ !== void 0 ? _collectionField$targ : collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetCollection);
55
56
  var intefaceCfg = getInterface(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
57
+ var targetCollection = getCollection(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
58
+ var isFileField = isFileCollection(targetCollection);
56
59
  return /*#__PURE__*/_react2.default.createElement(_schemaSettings.GeneralSchemaDesigner, {
57
60
  disableInitializer: true
58
61
  }, /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
@@ -127,17 +130,20 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
127
130
  });
128
131
  dn.refresh();
129
132
  }
130
- }), ['linkTo', 'm2m', 'm2o', 'o2m', 'obo', 'oho', 'snapshot', 'createdBy', 'updatedBy'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
133
+ }), ['linkTo', 'm2m', 'm2o', 'o2m', 'obo', 'oho', 'snapshot', 'createdBy', 'updatedBy'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface) && !isFileField && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
131
134
  title: t('Enable link'),
132
- checked: ((_fieldSchema$xCompon2 = (_fieldSchema$xCompon3 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon3 === void 0 ? void 0 : _fieldSchema$xCompon3.mode) !== null && _fieldSchema$xCompon2 !== void 0 ? _fieldSchema$xCompon2 : 'links') === 'links',
135
+ checked: ((_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2.enableLink) !== false,
133
136
  onChange: function onChange(flag) {
134
137
  fieldSchema['x-component-props'] = _objectSpread(_objectSpread({}, fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props']), {}, {
135
- mode: flag ? 'links' : 'tags'
138
+ enableLink: flag
139
+ });
140
+ field.componentProps = _objectSpread(_objectSpread({}, fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props']), {}, {
141
+ enableLink: flag
136
142
  });
137
143
  dn.emit('patch', {
138
144
  schema: {
139
145
  'x-uid': fieldSchema['x-uid'],
140
- 'x-component-props': _objectSpread({}, fieldSchema['x-component-props'])
146
+ 'x-component-props': _objectSpread({}, fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props'])
141
147
  }
142
148
  });
143
149
  dn.refresh();
@@ -147,8 +153,8 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
147
153
  options: options,
148
154
  value: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames['label'],
149
155
  onChange: function onChange(label) {
150
- var _collectionField$uiSc2, _fieldSchema$xCompon4;
151
- var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2['x-component-props']['fieldNames']), fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : _fieldSchema$xCompon4['fieldNames']), {}, {
156
+ var _collectionField$uiSc2, _fieldSchema$xCompon3;
157
+ var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2['x-component-props']['fieldNames']), fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon3 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon3 === void 0 ? void 0 : _fieldSchema$xCompon3['fieldNames']), {}, {
152
158
  label: label
153
159
  });
154
160
  fieldSchema['x-component-props']['fieldNames'] = fieldNames;
@@ -173,4 +179,7 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
173
179
  }
174
180
  }));
175
181
  };
176
- exports.TableColumnDesigner = TableColumnDesigner;
182
+ exports.TableColumnDesigner = TableColumnDesigner;
183
+ function isFileCollection(collection) {
184
+ return (collection === null || collection === void 0 ? void 0 : collection.template) === 'file';
185
+ }
@@ -0,0 +1 @@
1
+ export declare const TableIndex: (props: any) => JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TableIndex = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _recordProvider = require("../../../record-provider");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ var TableIndex = function TableIndex(props) {
11
+ var recordIndex = (0, _recordProvider.useRecordIndex)();
12
+ return /*#__PURE__*/_react.default.createElement("div", null, recordIndex + 1);
13
+ };
14
+ exports.TableIndex = TableIndex;
@@ -44,9 +44,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
44
44
  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; }
45
45
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
46
46
  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); }
47
- var useTableColumns = function useTableColumns() {
48
- var _schema$reducePropert;
47
+ var useArrayField = function useArrayField(props) {
49
48
  var field = (0, _react.useField)();
49
+ return props.field || field;
50
+ };
51
+ var useTableColumns = function useTableColumns(props) {
52
+ var _schema$reducePropert;
53
+ var field = useArrayField(props);
50
54
  var schema = (0, _react.useFieldSchema)();
51
55
  var _useACLFieldWhitelist = (0, _ACLProvider.useACLFieldWhitelist)(),
52
56
  schemaInWhitelist = _useACLFieldWhitelist.schemaInWhitelist;
@@ -87,8 +91,8 @@ var useTableColumns = function useTableColumns() {
87
91
  }, /*#__PURE__*/_react2.default.createElement(_2.RecordProvider, {
88
92
  record: record
89
93
  }, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
94
+ basePath: field.address.concat(record.__index || index),
90
95
  schema: s,
91
- name: record.__index || index,
92
96
  onlyRenderProperties: true
93
97
  })));
94
98
  }
@@ -188,8 +192,6 @@ var useValidator = function useValidator(validator) {
188
192
  };
189
193
  var Table = (0, _react.observer)(function (props) {
190
194
  var _schema$parent, _schema$parent2, _field$data, _fieldSchema$parent, _fieldSchema$parent$x, _field$value4, _field$value4$slice;
191
- var field = (0, _react.useField)();
192
- var columns = useTableColumns();
193
195
  var pagination1 = props.pagination,
194
196
  useProps = props.useProps,
195
197
  onChange = props.onChange,
@@ -210,6 +212,8 @@ var Table = (0, _react.observer)(function (props) {
210
212
  required = _others1$others.required,
211
213
  _onExpand = _others1$others.onExpand,
212
214
  others = _objectWithoutProperties(_others1$others, _excluded3);
215
+ var field = useArrayField(others);
216
+ var columns = useTableColumns(others);
213
217
  var schema = (0, _react.useFieldSchema)();
214
218
  var isTableSelector = (schema === null || schema === void 0 ? void 0 : (_schema$parent = schema.parent) === null || _schema$parent === void 0 ? void 0 : _schema$parent['x-decorator']) === 'TableSelectorProvider';
215
219
  var ctx = isTableSelector ? (0, _2.useTableSelectorContext)() : (0, _2.useTableBlockContext)();
@@ -55,7 +55,7 @@ var TableBlockDesigner = function TableBlockDesigner() {
55
55
  var defaultResource = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora4 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora4 === void 0 ? void 0 : _fieldSchema$xDecora4.resource;
56
56
  var supportTemplate = !(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora5 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora5 === void 0 ? void 0 : _fieldSchema$xDecora5.disableTemplate);
57
57
  var sort = defaultSort === null || defaultSort === void 0 ? void 0 : defaultSort.map(function (item) {
58
- return item.startsWith('-') ? {
58
+ return (item === null || item === void 0 ? void 0 : item.startsWith('-')) ? {
59
59
  field: item.substring(1),
60
60
  direction: 'desc'
61
61
  } : {
@@ -170,6 +170,7 @@ var TableBlockDesigner = function TableBlockDesigner() {
170
170
  field: {
171
171
  type: 'string',
172
172
  enum: sortFields,
173
+ required: true,
173
174
  'x-decorator': 'FormItem',
174
175
  'x-component': 'Select',
175
176
  'x-component-props': {
@@ -150,6 +150,7 @@ var TableSelectorDesigner = function TableSelectorDesigner() {
150
150
  field: {
151
151
  type: 'string',
152
152
  enum: sortFields,
153
+ required: true,
153
154
  'x-decorator': 'FormItem',
154
155
  'x-component': 'Select',
155
156
  'x-component-props': {
@@ -0,0 +1,22 @@
1
+ interface Operator {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ interface GetOptionsParams {
6
+ schema: any;
7
+ operator: Operator;
8
+ maxDepth: number;
9
+ count?: number;
10
+ }
11
+ export declare const useOptions: (collectionName: string, { schema, operator, maxDepth, count }: GetOptionsParams) => any;
12
+ export declare const useUserVariable: ({ schema, operator }: {
13
+ schema: any;
14
+ operator: any;
15
+ }) => {
16
+ label: string;
17
+ value: string;
18
+ key: string;
19
+ disabled: any;
20
+ children: any;
21
+ };
22
+ export {};
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useUserVariable = exports.useOptions = void 0;
7
+ var _filter = require("../../filter");
8
+ var isOperatorSupportMultiRelation = function isOperatorSupportMultiRelation(operator) {
9
+ if (!operator) return false;
10
+ return ['$eq', '$ne'].includes(operator.value);
11
+ };
12
+ var isSingleRelationField = function isSingleRelationField(field) {
13
+ if (!field) return false;
14
+ return field.type === 'belongsTo' || field.type === 'hasOne';
15
+ };
16
+ var useOptions = function useOptions(collectionName, _ref) {
17
+ var schema = _ref.schema,
18
+ operator = _ref.operator,
19
+ maxDepth = _ref.maxDepth,
20
+ _ref$count = _ref.count,
21
+ count = _ref$count === void 0 ? 1 : _ref$count;
22
+ if (count > maxDepth) {
23
+ return [];
24
+ }
25
+ var result = (0, _filter.useFilterOptions)(collectionName).map(function (option) {
26
+ if (!option.target) {
27
+ var _option$schema;
28
+ return {
29
+ key: option.name,
30
+ value: option.name,
31
+ label: option.title,
32
+ // TODO: 现在是通过组件的名称来过滤能够被选择的选项,这样的坏处是不够精确,后续可以优化
33
+ disabled: (schema === null || schema === void 0 ? void 0 : schema['x-component']) !== ((_option$schema = option.schema) === null || _option$schema === void 0 ? void 0 : _option$schema['x-component'])
34
+ };
35
+ }
36
+ var children = useOptions(option.target, {
37
+ schema: schema,
38
+ operator: operator,
39
+ maxDepth: maxDepth,
40
+ count: count + 1
41
+ }) || [];
42
+ return {
43
+ key: option.name,
44
+ value: option.name,
45
+ label: option.title,
46
+ children: children,
47
+ disabled: !isSingleRelationField(option) && !isOperatorSupportMultiRelation(operator) || children.every(function (child) {
48
+ return child.disabled;
49
+ })
50
+ };
51
+ });
52
+ return result;
53
+ };
54
+ exports.useOptions = useOptions;
55
+ var useUserVariable = function useUserVariable(_ref2) {
56
+ var schema = _ref2.schema,
57
+ operator = _ref2.operator;
58
+ var options = useOptions('users', {
59
+ schema: schema,
60
+ operator: operator,
61
+ maxDepth: 3
62
+ }) || [];
63
+ return {
64
+ label: "{{t(\"Current user\")}}",
65
+ value: '$user',
66
+ key: '$user',
67
+ disabled: options.every(function (option) {
68
+ return option.disabled;
69
+ }),
70
+ children: options
71
+ };
72
+ };
73
+ exports.useUserVariable = useUserVariable;
@@ -13,6 +13,7 @@ var _Table3 = require("./Table.Column");
13
13
  var _TableColumn = require("./Table.Column.ActionBar");
14
14
  var _TableColumn2 = require("./Table.Column.Decorator");
15
15
  var _TableColumn3 = require("./Table.Column.Designer");
16
+ var _Table4 = require("./Table.Index");
16
17
  var _TableSelector = require("./TableSelector");
17
18
  var _TableBlockDesigner = require("./TableBlockDesigner");
18
19
  Object.keys(_TableBlockDesigner).forEach(function (key) {
@@ -57,4 +58,5 @@ TableV2.Column.ActionBar = _TableColumn.TableColumnActionBar;
57
58
  TableV2.Column.Decorator = _TableColumn2.TableColumnDecorator;
58
59
  TableV2.Column.Designer = _TableColumn3.TableColumnDesigner;
59
60
  TableV2.ActionColumnDesigner = _Table2.TableActionColumnDesigner;
60
- TableV2.Selector = _TableSelector.TableSelector;
61
+ TableV2.Selector = _TableSelector.TableSelector;
62
+ TableV2.Index = _Table4.TableIndex;
@@ -41,7 +41,7 @@ function getIdsWithChildren(nodes) {
41
41
  var node = _step.value;
42
42
  if (node.children && node.children.length > 0) {
43
43
  ids.push(node.id);
44
- ids.push.apply(ids, _toConsumableArray(getIdsWithChildren(node.children)));
44
+ ids.push.apply(ids, _toConsumableArray(getIdsWithChildren(node === null || node === void 0 ? void 0 : node.children)));
45
45
  }
46
46
  }
47
47
  } catch (err) {
@@ -52,7 +52,7 @@ var ConstantTypes = {
52
52
  string: {
53
53
  label: "{{t(\"String\")}}",
54
54
  value: 'string',
55
- component: function component(_ref) {
55
+ component: function StringComponent(_ref) {
56
56
  var _onChange = _ref.onChange,
57
57
  value = _ref.value;
58
58
  return /*#__PURE__*/_react2.default.createElement(_antd.Input, {
@@ -67,7 +67,7 @@ var ConstantTypes = {
67
67
  number: {
68
68
  label: '{{t("Number")}}',
69
69
  value: 'number',
70
- component: function component(_ref2) {
70
+ component: function NumberComponent(_ref2) {
71
71
  var onChange = _ref2.onChange,
72
72
  value = _ref2.value;
73
73
  return /*#__PURE__*/_react2.default.createElement(_antd.InputNumber, {
@@ -80,7 +80,7 @@ var ConstantTypes = {
80
80
  boolean: {
81
81
  label: "{{t(\"Boolean\")}}",
82
82
  value: 'boolean',
83
- component: function Com(_ref3) {
83
+ component: function BooleanComponent(_ref3) {
84
84
  var onChange = _ref3.onChange,
85
85
  value = _ref3.value;
86
86
  var _useTranslation = (0, _reactI18next.useTranslation)(),
@@ -103,7 +103,7 @@ var ConstantTypes = {
103
103
  date: {
104
104
  label: '{{t("Date")}}',
105
105
  value: 'date',
106
- component: function component(_ref4) {
106
+ component: function DateComponent(_ref4) {
107
107
  var _onChange2 = _ref4.onChange,
108
108
  value = _ref4.value;
109
109
  return /*#__PURE__*/_react2.default.createElement(_antd.DatePicker, {
@@ -123,7 +123,7 @@ var ConstantTypes = {
123
123
  null: {
124
124
  label: "{{t(\"Null\")}}",
125
125
  value: 'null',
126
- component: function Com() {
126
+ component: function NullComponent() {
127
127
  var _useTranslation2 = (0, _reactI18next.useTranslation)(),
128
128
  t = _useTranslation2.t;
129
129
  return /*#__PURE__*/_react2.default.createElement(_antd.Input, {
@@ -135,12 +135,15 @@ var ConstantTypes = {
135
135
  default: null
136
136
  }
137
137
  };
138
- function getTypedConstantOption(type) {
138
+ function getTypedConstantOption(type, types) {
139
139
  var _ConstantTypes$type;
140
+ var allTypes = Object.values(ConstantTypes);
140
141
  return {
141
142
  value: '',
142
143
  label: '{{t("Constant")}}',
143
- children: Object.values(ConstantTypes),
144
+ children: types ? allTypes.filter(function (item) {
145
+ return Array.isArray(types) && types.includes(item.value) || types === true;
146
+ }) : allTypes,
144
147
  component: (_ConstantTypes$type = ConstantTypes[type]) === null || _ConstantTypes$type === void 0 ? void 0 : _ConstantTypes$type.component
145
148
  };
146
149
  }
@@ -165,7 +168,7 @@ function Input(props) {
165
168
  var _ref5 = children ? {
166
169
  value: '',
167
170
  label: '{{t("Constant")}}'
168
- } : useTypedConstant ? getTypedConstantOption(type) : {
171
+ } : useTypedConstant ? getTypedConstantOption(type, useTypedConstant) : {
169
172
  value: '',
170
173
  label: '{{t("Null")}}',
171
174
  component: ConstantTypes.null.component
@@ -9,7 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _antd = require("antd");
10
10
  var _react2 = require("@formily/react");
11
11
  var _css = require("@emotion/css");
12
- var _reactI18next = require("react-i18next");
13
12
  var sanitizeHTML = _interopRequireWildcard(require("sanitize-html"));
14
13
  var _2 = require("../..");
15
14
  var _VariableSelect = require("./VariableSelect");
@@ -224,8 +223,6 @@ function TextArea(props) {
224
223
  _props$multiline = props.multiline,
225
224
  multiline = _props$multiline === void 0 ? true : _props$multiline;
226
225
  var compile = (0, _2.useCompile)();
227
- var _useTranslation = (0, _reactI18next.useTranslation)(),
228
- t = _useTranslation.t;
229
226
  var inputRef = (0, _react.useRef)(null);
230
227
  var options = compile((_ref2 = typeof scope === 'function' ? scope() : scope) !== null && _ref2 !== void 0 ? _ref2 : []);
231
228
  var form = (0, _react2.useForm)();
@@ -343,7 +340,7 @@ function TextArea(props) {
343
340
  if (ev.key === 'Enter') {
344
341
  ev.preventDefault();
345
342
  }
346
- setIME(ev.keyCode === 229);
343
+ setIME(ev.keyCode === 229 && ![' ', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'Enter'].includes(ev.key));
347
344
  // if (ev.key === 'Control') {
348
345
  // console.debug(getSelection().getRangeAt(0));
349
346
  // }
@@ -401,7 +398,7 @@ function TextArea(props) {
401
398
  onInsert: onInsert
402
399
  }) : null);
403
400
  }
404
- TextArea.ReadPretty = function (props) {
401
+ TextArea.ReadPretty = function ReadPretty(props) {
405
402
  var _ref5;
406
403
  var value = props.value,
407
404
  _props$multiline2 = props.multiline,
@@ -31,7 +31,7 @@ var useDragEnd = function useDragEnd(props) {
31
31
  var _useTranslation = (0, _reactI18next.useTranslation)(),
32
32
  t = _useTranslation.t;
33
33
  return function (event) {
34
- var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current;
34
+ var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current, _over$data$current$re, _over$data6, _over$data6$current;
35
35
  var active = event.active,
36
36
  over = event.over;
37
37
  var activeSchema = active === null || active === void 0 ? void 0 : (_active$data = active.data) === null || _active$data === void 0 ? void 0 : (_active$data$current = _active$data.current) === null || _active$data$current === void 0 ? void 0 : _active$data$current.schema;
@@ -40,6 +40,7 @@ var useDragEnd = function useDragEnd(props) {
40
40
  var breakRemoveOn = over === null || over === void 0 ? void 0 : (_over$data3 = over.data) === null || _over$data3 === void 0 ? void 0 : (_over$data3$current = _over$data3.current) === null || _over$data3$current === void 0 ? void 0 : _over$data3$current.breakRemoveOn;
41
41
  var wrapSchema = over === null || over === void 0 ? void 0 : (_over$data4 = over.data) === null || _over$data4 === void 0 ? void 0 : (_over$data4$current = _over$data4.current) === null || _over$data4$current === void 0 ? void 0 : _over$data4$current.wrapSchema;
42
42
  var onSuccess = over === null || over === void 0 ? void 0 : (_over$data5 = over.data) === null || _over$data5 === void 0 ? void 0 : (_over$data5$current = _over$data5.current) === null || _over$data5$current === void 0 ? void 0 : _over$data5$current.onSuccess;
43
+ var removeParentsIfNoChildren = (_over$data$current$re = over === null || over === void 0 ? void 0 : (_over$data6 = over.data) === null || _over$data6 === void 0 ? void 0 : (_over$data6$current = _over$data6.current) === null || _over$data6$current === void 0 ? void 0 : _over$data6$current.removeParentsIfNoChildren) !== null && _over$data$current$re !== void 0 ? _over$data$current$re : true;
43
44
  if (!activeSchema || !overSchema) {
44
45
  var _props$onDragEnd;
45
46
  props === null || props === void 0 ? void 0 : (_props$onDragEnd = props.onDragEnd) === null || _props$onDragEnd === void 0 ? void 0 : _props$onDragEnd.call(props, event);
@@ -68,7 +69,7 @@ var useDragEnd = function useDragEnd(props) {
68
69
  dn.insertAdjacent(insertAdjacent, activeSchema, {
69
70
  wrap: wrapSchema,
70
71
  breakRemoveOn: breakRemoveOn,
71
- removeParentsIfNoChildren: true,
72
+ removeParentsIfNoChildren: removeParentsIfNoChildren,
72
73
  onSuccess: onSuccess
73
74
  });
74
75
  props === null || props === void 0 ? void 0 : (_props$onDragEnd4 = props.onDragEnd) === null || _props$onDragEnd4 === void 0 ? void 0 : _props$onDragEnd4.call(props, event);
@@ -84,15 +84,18 @@ var useSortableItemId = function useSortableItemId(props) {
84
84
  return field.address.toString();
85
85
  };
86
86
  var SortableItem = (0, _react.observer)(function (props) {
87
+ var _others$removeParents;
87
88
  var _useSortableItemProps = useSortableItemProps(props),
88
89
  schema = _useSortableItemProps.schema,
89
90
  id = _useSortableItemProps.id,
90
91
  others = _objectWithoutProperties(_useSortableItemProps, _excluded2);
92
+ var removeParentsIfNoChildren = (_others$removeParents = others.removeParentsIfNoChildren) !== null && _others$removeParents !== void 0 ? _others$removeParents : true;
91
93
  return /*#__PURE__*/_react2.default.createElement(SortableProvider, {
92
94
  id: id,
93
95
  data: {
94
96
  insertAdjacent: 'afterEnd',
95
- schema: schema
97
+ schema: schema,
98
+ removeParentsIfNoChildren: removeParentsIfNoChildren
96
99
  }
97
100
  }, /*#__PURE__*/_react2.default.createElement(Sortable, _objectSpread({}, others), props.children));
98
101
  });
@@ -74,7 +74,7 @@ var getValue = function getValue(str, values) {
74
74
  var regex = /{{(.*?)}}/;
75
75
  var matches = str === null || str === void 0 ? void 0 : (_str$match3 = str.match) === null || _str$match3 === void 0 ? void 0 : _str$match3.call(str, regex);
76
76
  if (matches) {
77
- return getVariableValue(str, values);
77
+ return getVariableValue(str, (0, _flat2.default)(values));
78
78
  } else {
79
79
  return str;
80
80
  }
@@ -58,8 +58,8 @@ var SchemaComponentProvider = function SchemaComponentProvider(props) {
58
58
  _useState4 = _slicedToArray(_useState3, 2),
59
59
  formId = _useState4[0],
60
60
  setFormId = _useState4[1];
61
- var form = props.form || (0, _react2.useMemo)(function () {
62
- return (0, _core.createForm)();
61
+ var form = (0, _react2.useMemo)(function () {
62
+ return props.form || (0, _core.createForm)();
63
63
  }, [formId]);
64
64
  var _useTranslation = (0, _reactI18next.useTranslation)(),
65
65
  t = _useTranslation.t;
@@ -9,3 +9,4 @@ export * from './useFieldComponentOptions';
9
9
  export * from './useFieldTitle';
10
10
  export * from './useProps';
11
11
  export * from './useTableSize';
12
+ export * from './useFieldModeOptions';