@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
@@ -13,10 +13,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
13
13
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
14
  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); }
15
15
  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); }
16
- import { SchemaExpressionScopeContext, useField, useFieldSchema, useForm } from '@formily/react';
16
+ import { Schema, SchemaExpressionScopeContext, useField, useFieldSchema, useForm } from '@formily/react';
17
+ import { parse } from '@nocobase/utils/client';
17
18
  import { Modal, message } from 'antd';
18
- import parse from 'json-templates';
19
- import { cloneDeep } from 'lodash';
19
+ import { cloneDeep, uniq } from 'lodash';
20
20
  import get from 'lodash/get';
21
21
  import omit from 'lodash/omit';
22
22
  import { useContext, useEffect } from 'react';
@@ -31,6 +31,7 @@ import { transformToFilter } from '../../filter-provider/utils';
31
31
  import { useRecord } from '../../record-provider';
32
32
  import { removeNullCondition, useActionContext, useCompile } from '../../schema-component';
33
33
  import { BulkEditFormItemValueType } from '../../schema-initializer/components';
34
+ import { useSchemaTemplateManager } from '../../schema-templates';
34
35
  import { useCurrentUserContext } from '../../user';
35
36
  import { useBlockRequestContext, useFilterByTk } from '../BlockProvider';
36
37
  import { useDetailsBlockContext } from '../DetailsBlockProvider';
@@ -173,7 +174,7 @@ export var useCreateActionProps = function useCreateActionProps() {
173
174
  onClick: function onClick() {
174
175
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
175
176
  var _actionSchema$xActio, _fieldSchema$xCompon;
176
- var fieldNames, _ref, _ref$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, addChild, assignedValues, values, _treeParentField$name, _treeParentField$fore, treeParentField, _parent$service, _parent$service$refre;
177
+ var fieldNames, _ref, _ref$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, addChild, assignedValues, values, _treeParentField$name, _treeParentField$fore, treeParentField, _parent$service, _parent$service$refre, data;
177
178
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
178
179
  while (1) switch (_context2.prev = _context2.next) {
179
180
  case 0:
@@ -194,7 +195,7 @@ export var useCreateActionProps = function useCreateActionProps() {
194
195
  _context2.next = 7;
195
196
  return form.submit();
196
197
  case 7:
197
- values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
198
+ values = getFormValues(filterByTk, field, form, fieldNames, getField, resource); // const values = omitBy(formValues, (value) => isEqual(JSON.stringify(value), '[{}]'));
198
199
  if (addChild) {
199
200
  treeParentField = getTreeParentField();
200
201
  values[(_treeParentField$name = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.name) !== null && _treeParentField$name !== void 0 ? _treeParentField$name : 'parent'] = currentRecord;
@@ -208,15 +209,17 @@ export var useCreateActionProps = function useCreateActionProps() {
208
209
  values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues)
209
210
  });
210
211
  case 14:
212
+ data = _context2.sent;
211
213
  actionField.data.loading = false;
214
+ actionField.data.data = data;
212
215
  __parent === null || __parent === void 0 ? void 0 : (_parent$service = __parent.service) === null || _parent$service === void 0 ? void 0 : (_parent$service$refre = _parent$service.refresh) === null || _parent$service$refre === void 0 ? void 0 : _parent$service$refre.call(_parent$service);
213
216
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
214
217
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
215
- _context2.next = 19;
218
+ _context2.next = 21;
216
219
  break;
217
220
  }
218
221
  return _context2.abrupt("return");
219
- case 19:
222
+ case 21:
220
223
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
221
224
  Modal.success({
222
225
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
@@ -250,17 +253,103 @@ export var useCreateActionProps = function useCreateActionProps() {
250
253
  } else {
251
254
  message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
252
255
  }
253
- _context2.next = 25;
256
+ _context2.next = 27;
254
257
  break;
255
- case 22:
256
- _context2.prev = 22;
258
+ case 24:
259
+ _context2.prev = 24;
257
260
  _context2.t0 = _context2["catch"](11);
258
261
  actionField.data.loading = false;
259
- case 25:
262
+ case 27:
260
263
  case "end":
261
264
  return _context2.stop();
262
265
  }
263
- }, _callee2, null, [[11, 22]]);
266
+ }, _callee2, null, [[11, 24]]);
267
+ }))();
268
+ }
269
+ };
270
+ };
271
+ export var useAssociationCreateActionProps = function useAssociationCreateActionProps() {
272
+ var _currentUserContext$d2;
273
+ var form = useForm();
274
+ var _useBlockRequestConte2 = useBlockRequestContext(),
275
+ field = _useBlockRequestConte2.field,
276
+ resource = _useBlockRequestConte2.resource;
277
+ var _useActionContext2 = useActionContext(),
278
+ setVisible = _useActionContext2.setVisible,
279
+ fieldSchema = _useActionContext2.fieldSchema;
280
+ var actionSchema = useFieldSchema();
281
+ var actionField = useField();
282
+ var _useCollection2 = useCollection(),
283
+ fields = _useCollection2.fields,
284
+ getField = _useCollection2.getField,
285
+ getTreeParentField = _useCollection2.getTreeParentField;
286
+ var compile = useCompile();
287
+ var filterByTk = useFilterByTk();
288
+ var currentRecord = useRecord();
289
+ var currentUserContext = useCurrentUserContext();
290
+ var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d2 = currentUserContext.data) === null || _currentUserContext$d2 === void 0 ? void 0 : _currentUserContext$d2.data;
291
+ return {
292
+ onClick: function onClick() {
293
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
294
+ var _actionSchema$xActio2, _fieldSchema$xCompon2;
295
+ var fieldNames, _ref2, _ref2$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, addChild, assignedValues, values, _treeParentField$name2, _treeParentField$fore2, treeParentField, data;
296
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
297
+ while (1) switch (_context3.prev = _context3.next) {
298
+ case 0:
299
+ fieldNames = fields.map(function (field) {
300
+ return field.name;
301
+ });
302
+ _ref2 = (_actionSchema$xActio2 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio2 !== void 0 ? _actionSchema$xActio2 : {}, _ref2$assignedValues = _ref2.assignedValues, originalAssignedValues = _ref2$assignedValues === void 0 ? {} : _ref2$assignedValues, onSuccess = _ref2.onSuccess, overwriteValues = _ref2.overwriteValues, skipValidator = _ref2.skipValidator;
303
+ addChild = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2.addChild;
304
+ assignedValues = parse(originalAssignedValues)({
305
+ currentTime: new Date(),
306
+ currentRecord: currentRecord,
307
+ currentUser: currentUser
308
+ });
309
+ if (skipValidator) {
310
+ _context3.next = 7;
311
+ break;
312
+ }
313
+ _context3.next = 7;
314
+ return form.submit();
315
+ case 7:
316
+ values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
317
+ if (addChild) {
318
+ treeParentField = getTreeParentField();
319
+ values[(_treeParentField$name2 = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.name) !== null && _treeParentField$name2 !== void 0 ? _treeParentField$name2 : 'parent'] = currentRecord;
320
+ values[(_treeParentField$fore2 = treeParentField === null || treeParentField === void 0 ? void 0 : treeParentField.foreignKey) !== null && _treeParentField$fore2 !== void 0 ? _treeParentField$fore2 : 'parentId'] = currentRecord.id;
321
+ }
322
+ actionField.data = field.data || {};
323
+ actionField.data.loading = true;
324
+ _context3.prev = 11;
325
+ _context3.next = 14;
326
+ return resource.create({
327
+ values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues)
328
+ });
329
+ case 14:
330
+ data = _context3.sent;
331
+ actionField.data.loading = false;
332
+ actionField.data.data = data;
333
+ setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
334
+ if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
335
+ _context3.next = 20;
336
+ break;
337
+ }
338
+ return _context3.abrupt("return");
339
+ case 20:
340
+ message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
341
+ _context3.next = 27;
342
+ break;
343
+ case 23:
344
+ _context3.prev = 23;
345
+ _context3.t0 = _context3["catch"](11);
346
+ actionField.data.data = null;
347
+ actionField.data.loading = false;
348
+ case 27:
349
+ case "end":
350
+ return _context3.stop();
351
+ }
352
+ }, _callee3, null, [[11, 23]]);
264
353
  }))();
265
354
  }
266
355
  };
@@ -292,37 +381,37 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
292
381
  var fieldSchema = useFieldSchema();
293
382
  var _useFilterBlock = useFilterBlock(),
294
383
  getDataBlocks = _useFilterBlock.getDataBlocks;
295
- var _useCollection2 = useCollection(),
296
- name = _useCollection2.name;
384
+ var _useCollection3 = useCollection(),
385
+ name = _useCollection3.name;
297
386
  var _useCollectionManager = useCollectionManager(),
298
387
  getCollectionJoinField = _useCollectionManager.getCollectionJoinField;
299
388
  actionField.data = actionField.data || {};
300
389
  return {
301
390
  onClick: function onClick() {
302
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
391
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
303
392
  var _findFilterTargets, _findFilterTargets$ta, targets, uid;
304
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
305
- while (1) switch (_context4.prev = _context4.next) {
393
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
394
+ while (1) switch (_context5.prev = _context5.next) {
306
395
  case 0:
307
396
  _findFilterTargets = findFilterTargets(fieldSchema), _findFilterTargets$ta = _findFilterTargets.targets, targets = _findFilterTargets$ta === void 0 ? [] : _findFilterTargets$ta, uid = _findFilterTargets.uid;
308
397
  actionField.data.loading = true;
309
- _context4.prev = 2;
310
- _context4.next = 5;
398
+ _context5.prev = 2;
399
+ _context5.next = 5;
311
400
  return Promise.all(getDataBlocks().map( /*#__PURE__*/function () {
312
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(block) {
401
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(block) {
313
402
  var _block$service$params, _block$service$params2, _block$service$params3;
314
403
  var target, param, storedFilter, mergedFilter;
315
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
316
- while (1) switch (_context3.prev = _context3.next) {
404
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
405
+ while (1) switch (_context4.prev = _context4.next) {
317
406
  case 0:
318
407
  target = targets.find(function (target) {
319
408
  return target.uid === block.uid;
320
409
  });
321
410
  if (target) {
322
- _context3.next = 3;
411
+ _context4.next = 3;
323
412
  break;
324
413
  }
325
- return _context3.abrupt("return");
414
+ return _context4.abrupt("return");
326
415
  case 3:
327
416
  param = ((_block$service$params = block.service.params) === null || _block$service$params === void 0 ? void 0 : _block$service$params[0]) || {}; // 保留原有的 filter
328
417
  storedFilter = ((_block$service$params2 = block.service.params) === null || _block$service$params2 === void 0 ? void 0 : (_block$service$params3 = _block$service$params2[1]) === null || _block$service$params3 === void 0 ? void 0 : _block$service$params3.filters) || {};
@@ -330,7 +419,7 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
330
419
  mergedFilter = mergeFilter([].concat(_toConsumableArray(Object.values(storedFilter).map(function (filter) {
331
420
  return removeNullCondition(filter);
332
421
  })), [block.defaultFilter]));
333
- return _context3.abrupt("return", block.doFilter(_objectSpread(_objectSpread({}, param), {}, {
422
+ return _context4.abrupt("return", block.doFilter(_objectSpread(_objectSpread({}, param), {}, {
334
423
  page: 1,
335
424
  filter: mergedFilter
336
425
  }), {
@@ -338,28 +427,28 @@ export var useFilterBlockActionProps = function useFilterBlockActionProps() {
338
427
  }));
339
428
  case 8:
340
429
  case "end":
341
- return _context3.stop();
430
+ return _context4.stop();
342
431
  }
343
- }, _callee3);
432
+ }, _callee4);
344
433
  }));
345
434
  return function (_x) {
346
- return _ref2.apply(this, arguments);
435
+ return _ref3.apply(this, arguments);
347
436
  };
348
437
  }()));
349
438
  case 5:
350
439
  actionField.data.loading = false;
351
- _context4.next = 12;
440
+ _context5.next = 12;
352
441
  break;
353
442
  case 8:
354
- _context4.prev = 8;
355
- _context4.t0 = _context4["catch"](2);
356
- console.error(_context4.t0);
443
+ _context5.prev = 8;
444
+ _context5.t0 = _context5["catch"](2);
445
+ console.error(_context5.t0);
357
446
  actionField.data.loading = false;
358
447
  case 12:
359
448
  case "end":
360
- return _context4.stop();
449
+ return _context5.stop();
361
450
  }
362
- }, _callee4, null, [[2, 8]]);
451
+ }, _callee5, null, [[2, 8]]);
363
452
  }))();
364
453
  }
365
454
  };
@@ -373,37 +462,37 @@ export var useResetBlockActionProps = function useResetBlockActionProps() {
373
462
  actionField.data = actionField.data || {};
374
463
  return {
375
464
  onClick: function onClick() {
376
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
465
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
377
466
  var _findFilterTargets2, targets, uid;
378
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
379
- while (1) switch (_context6.prev = _context6.next) {
467
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
468
+ while (1) switch (_context7.prev = _context7.next) {
380
469
  case 0:
381
470
  _findFilterTargets2 = findFilterTargets(fieldSchema), targets = _findFilterTargets2.targets, uid = _findFilterTargets2.uid;
382
471
  form.reset();
383
472
  actionField.data.loading = true;
384
- _context6.prev = 3;
385
- _context6.next = 6;
473
+ _context7.prev = 3;
474
+ _context7.next = 6;
386
475
  return Promise.all(getDataBlocks().map( /*#__PURE__*/function () {
387
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(block) {
476
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(block) {
388
477
  var _block$service$params4, _block$service$params5, _block$service$params6;
389
478
  var target, param, storedFilter, mergedFilter;
390
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
391
- while (1) switch (_context5.prev = _context5.next) {
479
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
480
+ while (1) switch (_context6.prev = _context6.next) {
392
481
  case 0:
393
482
  target = targets.find(function (target) {
394
483
  return target.uid === block.uid;
395
484
  });
396
485
  if (target) {
397
- _context5.next = 3;
486
+ _context6.next = 3;
398
487
  break;
399
488
  }
400
- return _context5.abrupt("return");
489
+ return _context6.abrupt("return");
401
490
  case 3:
402
491
  param = ((_block$service$params4 = block.service.params) === null || _block$service$params4 === void 0 ? void 0 : _block$service$params4[0]) || {}; // 保留原有的 filter
403
492
  storedFilter = ((_block$service$params5 = block.service.params) === null || _block$service$params5 === void 0 ? void 0 : (_block$service$params6 = _block$service$params5[1]) === null || _block$service$params6 === void 0 ? void 0 : _block$service$params6.filters) || {};
404
493
  delete storedFilter[uid];
405
494
  mergedFilter = mergeFilter([].concat(_toConsumableArray(Object.values(storedFilter)), [block.defaultFilter]));
406
- return _context5.abrupt("return", block.doFilter(_objectSpread(_objectSpread({}, param), {}, {
495
+ return _context6.abrupt("return", block.doFilter(_objectSpread(_objectSpread({}, param), {}, {
407
496
  page: 1,
408
497
  filter: mergedFilter
409
498
  }), {
@@ -411,67 +500,67 @@ export var useResetBlockActionProps = function useResetBlockActionProps() {
411
500
  }));
412
501
  case 8:
413
502
  case "end":
414
- return _context5.stop();
503
+ return _context6.stop();
415
504
  }
416
- }, _callee5);
505
+ }, _callee6);
417
506
  }));
418
507
  return function (_x2) {
419
- return _ref3.apply(this, arguments);
508
+ return _ref4.apply(this, arguments);
420
509
  };
421
510
  }()));
422
511
  case 6:
423
512
  actionField.data.loading = false;
424
- _context6.next = 12;
513
+ _context7.next = 12;
425
514
  break;
426
515
  case 9:
427
- _context6.prev = 9;
428
- _context6.t0 = _context6["catch"](3);
516
+ _context7.prev = 9;
517
+ _context7.t0 = _context7["catch"](3);
429
518
  actionField.data.loading = false;
430
519
  case 12:
431
520
  case "end":
432
- return _context6.stop();
521
+ return _context7.stop();
433
522
  }
434
- }, _callee6, null, [[3, 9]]);
523
+ }, _callee7, null, [[3, 9]]);
435
524
  }))();
436
525
  }
437
526
  };
438
527
  };
439
528
  export var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProps() {
440
- var _currentUserContext$d2;
441
- var _useBlockRequestConte2 = useBlockRequestContext(),
442
- resource = _useBlockRequestConte2.resource,
443
- __parent = _useBlockRequestConte2.__parent,
444
- service = _useBlockRequestConte2.service;
529
+ var _currentUserContext$d3;
530
+ var _useBlockRequestConte3 = useBlockRequestContext(),
531
+ resource = _useBlockRequestConte3.resource,
532
+ __parent = _useBlockRequestConte3.__parent,
533
+ service = _useBlockRequestConte3.service;
445
534
  var filterByTk = useFilterByTk();
446
535
  var actionSchema = useFieldSchema();
447
536
  var currentRecord = useRecord();
448
537
  var currentUserContext = useCurrentUserContext();
449
- var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d2 = currentUserContext.data) === null || _currentUserContext$d2 === void 0 ? void 0 : _currentUserContext$d2.data;
538
+ var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d3 = currentUserContext.data) === null || _currentUserContext$d3 === void 0 ? void 0 : _currentUserContext$d3.data;
450
539
  var history = useHistory();
451
540
  var compile = useCompile();
452
541
  var form = useForm();
453
542
  return {
454
543
  onClick: function onClick() {
455
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
456
- var _actionSchema$xActio2, _service$refresh;
457
- var _ref4, _ref4$assignedValues, originalAssignedValues, onSuccess, skipValidator, assignedValues, _parent$service2, _parent$service2$refr;
458
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
459
- while (1) switch (_context8.prev = _context8.next) {
544
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
545
+ var _actionSchema$xActio3, _service$refresh;
546
+ var _ref5, _ref5$assignedValues, originalAssignedValues, onSuccess, skipValidator, assignedValues, _parent$service2, _parent$service2$refr;
547
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
548
+ while (1) switch (_context9.prev = _context9.next) {
460
549
  case 0:
461
- _ref4 = (_actionSchema$xActio2 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio2 !== void 0 ? _actionSchema$xActio2 : {}, _ref4$assignedValues = _ref4.assignedValues, originalAssignedValues = _ref4$assignedValues === void 0 ? {} : _ref4$assignedValues, onSuccess = _ref4.onSuccess, skipValidator = _ref4.skipValidator;
550
+ _ref5 = (_actionSchema$xActio3 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio3 !== void 0 ? _actionSchema$xActio3 : {}, _ref5$assignedValues = _ref5.assignedValues, originalAssignedValues = _ref5$assignedValues === void 0 ? {} : _ref5$assignedValues, onSuccess = _ref5.onSuccess, skipValidator = _ref5.skipValidator;
462
551
  assignedValues = parse(originalAssignedValues)({
463
552
  currentTime: new Date(),
464
553
  currentRecord: currentRecord,
465
554
  currentUser: currentUser
466
555
  });
467
556
  if (!(skipValidator === false)) {
468
- _context8.next = 5;
557
+ _context9.next = 5;
469
558
  break;
470
559
  }
471
- _context8.next = 5;
560
+ _context9.next = 5;
472
561
  return form.submit();
473
562
  case 5:
474
- _context8.next = 7;
563
+ _context9.next = 7;
475
564
  return resource.update({
476
565
  filterByTk: filterByTk,
477
566
  values: _objectSpread({}, assignedValues)
@@ -482,18 +571,18 @@ export var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProp
482
571
  __parent === null || __parent === void 0 ? void 0 : (_parent$service2 = __parent.service) === null || _parent$service2 === void 0 ? void 0 : (_parent$service2$refr = _parent$service2.refresh) === null || _parent$service2$refr === void 0 ? void 0 : _parent$service2$refr.call(_parent$service2);
483
572
  }
484
573
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
485
- _context8.next = 11;
574
+ _context9.next = 11;
486
575
  break;
487
576
  }
488
- return _context8.abrupt("return");
577
+ return _context9.abrupt("return");
489
578
  case 11:
490
579
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
491
580
  Modal.success({
492
581
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
493
582
  onOk: function () {
494
- var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
495
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
496
- while (1) switch (_context7.prev = _context7.next) {
583
+ var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
584
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
585
+ while (1) switch (_context8.prev = _context8.next) {
497
586
  case 0:
498
587
  if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
499
588
  if (isURL(onSuccess.redirectTo)) {
@@ -504,9 +593,9 @@ export var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProp
504
593
  }
505
594
  case 1:
506
595
  case "end":
507
- return _context7.stop();
596
+ return _context8.stop();
508
597
  }
509
- }, _callee7);
598
+ }, _callee8);
510
599
  }));
511
600
  function onOk() {
512
601
  return _onOk2.apply(this, arguments);
@@ -519,27 +608,27 @@ export var useCustomizeUpdateActionProps = function useCustomizeUpdateActionProp
519
608
  }
520
609
  case 12:
521
610
  case "end":
522
- return _context8.stop();
611
+ return _context9.stop();
523
612
  }
524
- }, _callee8);
613
+ }, _callee9);
525
614
  }))();
526
615
  }
527
616
  };
528
617
  };
529
618
  export var useCustomizeBulkUpdateActionProps = function useCustomizeBulkUpdateActionProps() {
530
- var _ref5, _tableBlockContext$fi, _tableBlockContext$fi2, _tableBlockContext$fi3, _currentUserContext$d3;
531
- var _useBlockRequestConte3 = useBlockRequestContext(),
532
- field = _useBlockRequestConte3.field,
533
- resource = _useBlockRequestConte3.resource,
534
- __parent = _useBlockRequestConte3.__parent,
535
- service = _useBlockRequestConte3.service;
619
+ var _ref6, _tableBlockContext$fi, _tableBlockContext$fi2, _tableBlockContext$fi3, _currentUserContext$d4;
620
+ var _useBlockRequestConte4 = useBlockRequestContext(),
621
+ field = _useBlockRequestConte4.field,
622
+ resource = _useBlockRequestConte4.resource,
623
+ __parent = _useBlockRequestConte4.__parent,
624
+ service = _useBlockRequestConte4.service;
536
625
  var expressionScope = useContext(SchemaExpressionScopeContext);
537
626
  var actionSchema = useFieldSchema();
538
627
  var tableBlockContext = useTableBlockContext();
539
628
  var rowKey = tableBlockContext.rowKey;
540
- var selectedRecordKeys = (_ref5 = (_tableBlockContext$fi = (_tableBlockContext$fi2 = tableBlockContext.field) === null || _tableBlockContext$fi2 === void 0 ? void 0 : (_tableBlockContext$fi3 = _tableBlockContext$fi2.data) === null || _tableBlockContext$fi3 === void 0 ? void 0 : _tableBlockContext$fi3.selectedRowKeys) !== null && _tableBlockContext$fi !== void 0 ? _tableBlockContext$fi : expressionScope === null || expressionScope === void 0 ? void 0 : expressionScope.selectedRecordKeys) !== null && _ref5 !== void 0 ? _ref5 : {};
629
+ var selectedRecordKeys = (_ref6 = (_tableBlockContext$fi = (_tableBlockContext$fi2 = tableBlockContext.field) === null || _tableBlockContext$fi2 === void 0 ? void 0 : (_tableBlockContext$fi3 = _tableBlockContext$fi2.data) === null || _tableBlockContext$fi3 === void 0 ? void 0 : _tableBlockContext$fi3.selectedRowKeys) !== null && _tableBlockContext$fi !== void 0 ? _tableBlockContext$fi : expressionScope === null || expressionScope === void 0 ? void 0 : expressionScope.selectedRecordKeys) !== null && _ref6 !== void 0 ? _ref6 : {};
541
630
  var currentUserContext = useCurrentUserContext();
542
- var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d3 = currentUserContext.data) === null || _currentUserContext$d3 === void 0 ? void 0 : _currentUserContext$d3.data;
631
+ var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d4 = currentUserContext.data) === null || _currentUserContext$d4 === void 0 ? void 0 : _currentUserContext$d4.data;
543
632
  var history = useHistory();
544
633
  var compile = useCompile();
545
634
  var _useTranslation2 = useTranslation(),
@@ -547,13 +636,13 @@ export var useCustomizeBulkUpdateActionProps = function useCustomizeBulkUpdateAc
547
636
  var actionField = useField();
548
637
  return {
549
638
  onClick: function onClick() {
550
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
551
- var _actionSchema$xActio3;
552
- var _ref6, _ref6$assignedValues, originalAssignedValues, onSuccess, updateMode, assignedValues;
553
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
554
- while (1) switch (_context12.prev = _context12.next) {
639
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
640
+ var _actionSchema$xActio4;
641
+ var _ref7, _ref7$assignedValues, originalAssignedValues, onSuccess, updateMode, assignedValues;
642
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
643
+ while (1) switch (_context13.prev = _context13.next) {
555
644
  case 0:
556
- _ref6 = (_actionSchema$xActio3 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio3 !== void 0 ? _actionSchema$xActio3 : {}, _ref6$assignedValues = _ref6.assignedValues, originalAssignedValues = _ref6$assignedValues === void 0 ? {} : _ref6$assignedValues, onSuccess = _ref6.onSuccess, updateMode = _ref6.updateMode;
645
+ _ref7 = (_actionSchema$xActio4 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio4 !== void 0 ? _actionSchema$xActio4 : {}, _ref7$assignedValues = _ref7.assignedValues, originalAssignedValues = _ref7$assignedValues === void 0 ? {} : _ref7$assignedValues, onSuccess = _ref7.onSuccess, updateMode = _ref7.updateMode;
557
646
  actionField.data = field.data || {};
558
647
  actionField.data.loading = true;
559
648
  assignedValues = parse(originalAssignedValues)({
@@ -564,29 +653,29 @@ export var useCustomizeBulkUpdateActionProps = function useCustomizeBulkUpdateAc
564
653
  title: t('Bulk update'),
565
654
  content: updateMode === 'selected' ? t('Update selected data?') : t('Update all data?'),
566
655
  onOk: function onOk() {
567
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
656
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
568
657
  var _service$params$, _service$params, _service$refresh2;
569
- var _ref7, filter, updateData, _parent$service3, _parent$service3$refr;
570
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
571
- while (1) switch (_context10.prev = _context10.next) {
658
+ var _ref8, filter, updateData, _parent$service3, _parent$service3$refr;
659
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
660
+ while (1) switch (_context11.prev = _context11.next) {
572
661
  case 0:
573
- _ref7 = (_service$params$ = (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params[0]) !== null && _service$params$ !== void 0 ? _service$params$ : {}, filter = _ref7.filter;
662
+ _ref8 = (_service$params$ = (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params[0]) !== null && _service$params$ !== void 0 ? _service$params$ : {}, filter = _ref8.filter;
574
663
  updateData = {
575
664
  values: _objectSpread({}, assignedValues),
576
665
  filter: filter,
577
666
  forceUpdate: false
578
667
  };
579
668
  if (!(updateMode === 'selected')) {
580
- _context10.next = 8;
669
+ _context11.next = 8;
581
670
  break;
582
671
  }
583
672
  if (selectedRecordKeys === null || selectedRecordKeys === void 0 ? void 0 : selectedRecordKeys.length) {
584
- _context10.next = 7;
673
+ _context11.next = 7;
585
674
  break;
586
675
  }
587
676
  message.error(t('Please select the records to be updated'));
588
677
  actionField.data.loading = false;
589
- return _context10.abrupt("return");
678
+ return _context11.abrupt("return");
590
679
  case 7:
591
680
  updateData.filter = {
592
681
  $and: [_defineProperty({}, rowKey || 'id', {
@@ -597,37 +686,37 @@ export var useCustomizeBulkUpdateActionProps = function useCustomizeBulkUpdateAc
597
686
  if (!updateData.filter) {
598
687
  updateData.forceUpdate = true;
599
688
  }
600
- _context10.prev = 9;
601
- _context10.next = 12;
689
+ _context11.prev = 9;
690
+ _context11.next = 12;
602
691
  return resource.update(updateData);
603
692
  case 12:
604
- _context10.next = 16;
693
+ _context11.next = 16;
605
694
  break;
606
695
  case 14:
607
- _context10.prev = 14;
608
- _context10.t0 = _context10["catch"](9);
696
+ _context11.prev = 14;
697
+ _context11.t0 = _context11["catch"](9);
609
698
  case 16:
610
- _context10.prev = 16;
699
+ _context11.prev = 16;
611
700
  actionField.data.loading = false;
612
- return _context10.finish(16);
701
+ return _context11.finish(16);
613
702
  case 19:
614
703
  service === null || service === void 0 ? void 0 : (_service$refresh2 = service.refresh) === null || _service$refresh2 === void 0 ? void 0 : _service$refresh2.call(service);
615
704
  if (!(resource instanceof TableFieldResource)) {
616
705
  __parent === null || __parent === void 0 ? void 0 : (_parent$service3 = __parent.service) === null || _parent$service3 === void 0 ? void 0 : (_parent$service3$refr = _parent$service3.refresh) === null || _parent$service3$refr === void 0 ? void 0 : _parent$service3$refr.call(_parent$service3);
617
706
  }
618
707
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
619
- _context10.next = 23;
708
+ _context11.next = 23;
620
709
  break;
621
710
  }
622
- return _context10.abrupt("return");
711
+ return _context11.abrupt("return");
623
712
  case 23:
624
713
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
625
714
  Modal.success({
626
715
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
627
716
  onOk: function () {
628
- var _onOk3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
629
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
630
- while (1) switch (_context9.prev = _context9.next) {
717
+ var _onOk3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
718
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
719
+ while (1) switch (_context10.prev = _context10.next) {
631
720
  case 0:
632
721
  if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
633
722
  if (isURL(onSuccess.redirectTo)) {
@@ -638,9 +727,9 @@ export var useCustomizeBulkUpdateActionProps = function useCustomizeBulkUpdateAc
638
727
  }
639
728
  case 1:
640
729
  case "end":
641
- return _context9.stop();
730
+ return _context10.stop();
642
731
  }
643
- }, _callee9);
732
+ }, _callee10);
644
733
  }));
645
734
  function onOk() {
646
735
  return _onOk3.apply(this, arguments);
@@ -653,43 +742,43 @@ export var useCustomizeBulkUpdateActionProps = function useCustomizeBulkUpdateAc
653
742
  }
654
743
  case 24:
655
744
  case "end":
656
- return _context10.stop();
745
+ return _context11.stop();
657
746
  }
658
- }, _callee10, null, [[9, 14, 16, 19]]);
747
+ }, _callee11, null, [[9, 14, 16, 19]]);
659
748
  }))();
660
749
  },
661
750
  onCancel: function onCancel() {
662
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
663
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
664
- while (1) switch (_context11.prev = _context11.next) {
751
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
752
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
753
+ while (1) switch (_context12.prev = _context12.next) {
665
754
  case 0:
666
755
  actionField.data.loading = false;
667
756
  case 1:
668
757
  case "end":
669
- return _context11.stop();
758
+ return _context12.stop();
670
759
  }
671
- }, _callee11);
760
+ }, _callee12);
672
761
  }))();
673
762
  }
674
763
  });
675
764
  case 5:
676
765
  case "end":
677
- return _context12.stop();
766
+ return _context13.stop();
678
767
  }
679
- }, _callee12);
768
+ }, _callee13);
680
769
  }))();
681
770
  }
682
771
  };
683
772
  };
684
773
  export var useCustomizeBulkEditActionProps = function useCustomizeBulkEditActionProps() {
685
- var _ref9, _tableBlockContext$fi4, _tableBlockContext$fi5, _tableBlockContext$fi6;
774
+ var _ref10, _tableBlockContext$fi4, _tableBlockContext$fi5, _tableBlockContext$fi6;
686
775
  var form = useForm();
687
776
  var _useTranslation3 = useTranslation(),
688
777
  t = _useTranslation3.t;
689
- var _useBlockRequestConte4 = useBlockRequestContext(),
690
- field = _useBlockRequestConte4.field,
691
- resource = _useBlockRequestConte4.resource,
692
- __parent = _useBlockRequestConte4.__parent;
778
+ var _useBlockRequestConte5 = useBlockRequestContext(),
779
+ field = _useBlockRequestConte5.field,
780
+ resource = _useBlockRequestConte5.resource,
781
+ __parent = _useBlockRequestConte5.__parent;
693
782
  var expressionScope = useContext(SchemaExpressionScopeContext);
694
783
  var actionContext = useActionContext();
695
784
  var history = useHistory();
@@ -697,24 +786,24 @@ export var useCustomizeBulkEditActionProps = function useCustomizeBulkEditAction
697
786
  var actionField = useField();
698
787
  var tableBlockContext = useTableBlockContext();
699
788
  var rowKey = tableBlockContext.rowKey;
700
- var selectedRecordKeys = (_ref9 = (_tableBlockContext$fi4 = (_tableBlockContext$fi5 = tableBlockContext.field) === null || _tableBlockContext$fi5 === void 0 ? void 0 : (_tableBlockContext$fi6 = _tableBlockContext$fi5.data) === null || _tableBlockContext$fi6 === void 0 ? void 0 : _tableBlockContext$fi6.selectedRowKeys) !== null && _tableBlockContext$fi4 !== void 0 ? _tableBlockContext$fi4 : expressionScope === null || expressionScope === void 0 ? void 0 : expressionScope.selectedRecordKeys) !== null && _ref9 !== void 0 ? _ref9 : {};
789
+ var selectedRecordKeys = (_ref10 = (_tableBlockContext$fi4 = (_tableBlockContext$fi5 = tableBlockContext.field) === null || _tableBlockContext$fi5 === void 0 ? void 0 : (_tableBlockContext$fi6 = _tableBlockContext$fi5.data) === null || _tableBlockContext$fi6 === void 0 ? void 0 : _tableBlockContext$fi6.selectedRowKeys) !== null && _tableBlockContext$fi4 !== void 0 ? _tableBlockContext$fi4 : expressionScope === null || expressionScope === void 0 ? void 0 : expressionScope.selectedRecordKeys) !== null && _ref10 !== void 0 ? _ref10 : {};
701
790
  var setVisible = actionContext.setVisible,
702
791
  actionSchema = actionContext.fieldSchema;
703
792
  return {
704
793
  onClick: function onClick() {
705
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
706
- var _actionSchema$xActio4, _parent$service$para, _parent$service$para2;
707
- var _ref10, onSuccess, skipValidator, updateMode, _ref11, filter, values, key, value, _parent$service4, _parent$service4$refr, updateData, _parent$__parent, _parent$__parent$serv, _parent$__parent$serv2;
708
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
709
- while (1) switch (_context14.prev = _context14.next) {
794
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
795
+ var _actionSchema$xActio5, _parent$service$para, _parent$service$para2;
796
+ var _ref11, onSuccess, skipValidator, updateMode, _ref12, filter, values, key, value, _parent$service4, _parent$service4$refr, updateData, _parent$__parent, _parent$__parent$serv, _parent$__parent$serv2;
797
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
798
+ while (1) switch (_context15.prev = _context15.next) {
710
799
  case 0:
711
- _ref10 = (_actionSchema$xActio4 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio4 !== void 0 ? _actionSchema$xActio4 : {}, onSuccess = _ref10.onSuccess, skipValidator = _ref10.skipValidator, updateMode = _ref10.updateMode;
712
- _ref11 = (_parent$service$para = (_parent$service$para2 = __parent.service.params) === null || _parent$service$para2 === void 0 ? void 0 : _parent$service$para2[0]) !== null && _parent$service$para !== void 0 ? _parent$service$para : {}, filter = _ref11.filter;
800
+ _ref11 = (_actionSchema$xActio5 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio5 !== void 0 ? _actionSchema$xActio5 : {}, onSuccess = _ref11.onSuccess, skipValidator = _ref11.skipValidator, updateMode = _ref11.updateMode;
801
+ _ref12 = (_parent$service$para = (_parent$service$para2 = __parent.service.params) === null || _parent$service$para2 === void 0 ? void 0 : _parent$service$para2[0]) !== null && _parent$service$para !== void 0 ? _parent$service$para : {}, filter = _ref12.filter;
713
802
  if (skipValidator) {
714
- _context14.next = 5;
803
+ _context15.next = 5;
715
804
  break;
716
805
  }
717
- _context14.next = 5;
806
+ _context15.next = 5;
718
807
  return form.submit();
719
808
  case 5:
720
809
  values = cloneDeep(form.values);
@@ -732,22 +821,22 @@ export var useCustomizeBulkEditActionProps = function useCustomizeBulkEditAction
732
821
  }
733
822
  }
734
823
  }
735
- _context14.prev = 9;
824
+ _context15.prev = 9;
736
825
  updateData = {
737
826
  values: values,
738
827
  filter: filter,
739
828
  forceUpdate: false
740
829
  };
741
830
  if (!(updateMode === 'selected')) {
742
- _context14.next = 16;
831
+ _context15.next = 16;
743
832
  break;
744
833
  }
745
834
  if (selectedRecordKeys === null || selectedRecordKeys === void 0 ? void 0 : selectedRecordKeys.length) {
746
- _context14.next = 15;
835
+ _context15.next = 15;
747
836
  break;
748
837
  }
749
838
  message.error(t('Please select the records to be updated'));
750
- return _context14.abrupt("return");
839
+ return _context15.abrupt("return");
751
840
  case 15:
752
841
  updateData.filter = {
753
842
  $and: [_defineProperty({}, rowKey || 'id', {
@@ -758,7 +847,7 @@ export var useCustomizeBulkEditActionProps = function useCustomizeBulkEditAction
758
847
  if (!updateData.filter) {
759
848
  updateData.forceUpdate = true;
760
849
  }
761
- _context14.next = 19;
850
+ _context15.next = 19;
762
851
  return resource.update(updateData);
763
852
  case 19:
764
853
  actionField.data.loading = false;
@@ -768,20 +857,20 @@ export var useCustomizeBulkEditActionProps = function useCustomizeBulkEditAction
768
857
  __parent === null || __parent === void 0 ? void 0 : (_parent$service4 = __parent.service) === null || _parent$service4 === void 0 ? void 0 : (_parent$service4$refr = _parent$service4.refresh) === null || _parent$service4$refr === void 0 ? void 0 : _parent$service4$refr.call(_parent$service4);
769
858
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
770
859
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
771
- _context14.next = 25;
860
+ _context15.next = 25;
772
861
  break;
773
862
  }
774
- return _context14.abrupt("return");
863
+ return _context15.abrupt("return");
775
864
  case 25:
776
865
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
777
866
  Modal.success({
778
867
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
779
868
  onOk: function () {
780
- var _onOk4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
781
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
782
- while (1) switch (_context13.prev = _context13.next) {
869
+ var _onOk4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
870
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
871
+ while (1) switch (_context14.prev = _context14.next) {
783
872
  case 0:
784
- _context13.next = 2;
873
+ _context14.next = 2;
785
874
  return form.reset();
786
875
  case 2:
787
876
  if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
@@ -793,9 +882,9 @@ export var useCustomizeBulkEditActionProps = function useCustomizeBulkEditAction
793
882
  }
794
883
  case 3:
795
884
  case "end":
796
- return _context13.stop();
885
+ return _context14.stop();
797
886
  }
798
- }, _callee13);
887
+ }, _callee14);
799
888
  }));
800
889
  function onOk() {
801
890
  return _onOk4.apply(this, arguments);
@@ -807,61 +896,61 @@ export var useCustomizeBulkEditActionProps = function useCustomizeBulkEditAction
807
896
  message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
808
897
  }
809
898
  case 26:
810
- _context14.prev = 26;
899
+ _context15.prev = 26;
811
900
  actionField.data.loading = false;
812
- return _context14.finish(26);
901
+ return _context15.finish(26);
813
902
  case 29:
814
903
  case "end":
815
- return _context14.stop();
904
+ return _context15.stop();
816
905
  }
817
- }, _callee14, null, [[9,, 26, 29]]);
906
+ }, _callee15, null, [[9,, 26, 29]]);
818
907
  }))();
819
908
  }
820
909
  };
821
910
  };
822
911
  export var useCustomizeRequestActionProps = function useCustomizeRequestActionProps() {
823
- var _currentUserContext$d4;
912
+ var _currentUserContext$d5;
824
913
  var apiClient = useAPIClient();
825
914
  var history = useHistory();
826
915
  var filterByTk = useFilterByTk();
827
916
  var actionSchema = useFieldSchema();
828
917
  var compile = useCompile();
829
918
  var form = useForm();
830
- var _useCollection3 = useCollection(),
831
- fields = _useCollection3.fields,
832
- getField = _useCollection3.getField;
833
- var _useBlockRequestConte5 = useBlockRequestContext(),
834
- field = _useBlockRequestConte5.field,
835
- resource = _useBlockRequestConte5.resource,
836
- __parent = _useBlockRequestConte5.__parent,
837
- service = _useBlockRequestConte5.service;
919
+ var _useCollection4 = useCollection(),
920
+ fields = _useCollection4.fields,
921
+ getField = _useCollection4.getField;
922
+ var _useBlockRequestConte6 = useBlockRequestContext(),
923
+ field = _useBlockRequestConte6.field,
924
+ resource = _useBlockRequestConte6.resource,
925
+ __parent = _useBlockRequestConte6.__parent,
926
+ service = _useBlockRequestConte6.service;
838
927
  var currentRecord = useRecord();
839
928
  var currentUserContext = useCurrentUserContext();
840
- var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d4 = currentUserContext.data) === null || _currentUserContext$d4 === void 0 ? void 0 : _currentUserContext$d4.data;
929
+ var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d5 = currentUserContext.data) === null || _currentUserContext$d5 === void 0 ? void 0 : _currentUserContext$d5.data;
841
930
  var actionField = useField();
842
- var _useActionContext2 = useActionContext(),
843
- setVisible = _useActionContext2.setVisible;
931
+ var _useActionContext3 = useActionContext(),
932
+ setVisible = _useActionContext3.setVisible;
844
933
  return {
845
934
  onClick: function onClick() {
846
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
847
- var _actionSchema$xActio5;
848
- var _ref13, skipValidator, onSuccess, requestSettings, xAction, headers, params, data, methods, fieldNames, values, requestBody, _service$refresh3, _parent$service5, _parent$service5$refr;
849
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
850
- while (1) switch (_context16.prev = _context16.next) {
935
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
936
+ var _actionSchema$xActio6;
937
+ var _ref14, skipValidator, onSuccess, requestSettings, xAction, headers, params, data, methods, fieldNames, values, requestBody, _service$refresh3, _parent$service5, _parent$service5$refr;
938
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
939
+ while (1) switch (_context17.prev = _context17.next) {
851
940
  case 0:
852
- _ref13 = (_actionSchema$xActio5 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio5 !== void 0 ? _actionSchema$xActio5 : {}, skipValidator = _ref13.skipValidator, onSuccess = _ref13.onSuccess, requestSettings = _ref13.requestSettings;
941
+ _ref14 = (_actionSchema$xActio6 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio6 !== void 0 ? _actionSchema$xActio6 : {}, skipValidator = _ref14.skipValidator, onSuccess = _ref14.onSuccess, requestSettings = _ref14.requestSettings;
853
942
  xAction = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action'];
854
943
  if (requestSettings['url']) {
855
- _context16.next = 4;
944
+ _context17.next = 4;
856
945
  break;
857
946
  }
858
- return _context16.abrupt("return");
947
+ return _context17.abrupt("return");
859
948
  case 4:
860
949
  if (!(skipValidator !== true && xAction === 'customize:form:request')) {
861
- _context16.next = 7;
950
+ _context17.next = 7;
862
951
  break;
863
952
  }
864
- _context16.next = 7;
953
+ _context17.next = 7;
865
954
  return form.submit();
866
955
  case 7:
867
956
  headers = requestSettings['headers'] ? JSON.parse(requestSettings['headers']) : {};
@@ -896,8 +985,8 @@ export var useCustomizeRequestActionProps = function useCustomizeRequestActionPr
896
985
  };
897
986
  actionField.data = field.data || {};
898
987
  actionField.data.loading = true;
899
- _context16.prev = 15;
900
- _context16.next = 18;
988
+ _context17.prev = 15;
989
+ _context17.next = 18;
901
990
  return apiClient.request(_objectSpread({}, requestBody));
902
991
  case 18:
903
992
  actionField.data.loading = false;
@@ -909,18 +998,18 @@ export var useCustomizeRequestActionProps = function useCustomizeRequestActionPr
909
998
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
910
999
  }
911
1000
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
912
- _context16.next = 24;
1001
+ _context17.next = 24;
913
1002
  break;
914
1003
  }
915
- return _context16.abrupt("return");
1004
+ return _context17.abrupt("return");
916
1005
  case 24:
917
1006
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
918
1007
  Modal.success({
919
1008
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
920
1009
  onOk: function () {
921
- var _onOk5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
922
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
923
- while (1) switch (_context15.prev = _context15.next) {
1010
+ var _onOk5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1011
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1012
+ while (1) switch (_context16.prev = _context16.next) {
924
1013
  case 0:
925
1014
  if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
926
1015
  if (isURL(onSuccess.redirectTo)) {
@@ -931,9 +1020,9 @@ export var useCustomizeRequestActionProps = function useCustomizeRequestActionPr
931
1020
  }
932
1021
  case 1:
933
1022
  case "end":
934
- return _context15.stop();
1023
+ return _context16.stop();
935
1024
  }
936
- }, _callee15);
1025
+ }, _callee16);
937
1026
  }));
938
1027
  function onOk() {
939
1028
  return _onOk5.apply(this, arguments);
@@ -945,59 +1034,59 @@ export var useCustomizeRequestActionProps = function useCustomizeRequestActionPr
945
1034
  message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
946
1035
  }
947
1036
  case 25:
948
- _context16.prev = 25;
1037
+ _context17.prev = 25;
949
1038
  actionField.data.loading = false;
950
- return _context16.finish(25);
1039
+ return _context17.finish(25);
951
1040
  case 28:
952
1041
  case "end":
953
- return _context16.stop();
1042
+ return _context17.stop();
954
1043
  }
955
- }, _callee16, null, [[15,, 25, 28]]);
1044
+ }, _callee17, null, [[15,, 25, 28]]);
956
1045
  }))();
957
1046
  }
958
1047
  };
959
1048
  };
960
1049
  export var useUpdateActionProps = function useUpdateActionProps() {
961
- var _currentUserContext$d5;
1050
+ var _currentUserContext$d6;
962
1051
  var form = useForm();
963
1052
  var filterByTk = useFilterByTk();
964
- var _useBlockRequestConte6 = useBlockRequestContext(),
965
- field = _useBlockRequestConte6.field,
966
- resource = _useBlockRequestConte6.resource,
967
- __parent = _useBlockRequestConte6.__parent;
968
- var _useActionContext3 = useActionContext(),
969
- setVisible = _useActionContext3.setVisible;
1053
+ var _useBlockRequestConte7 = useBlockRequestContext(),
1054
+ field = _useBlockRequestConte7.field,
1055
+ resource = _useBlockRequestConte7.resource,
1056
+ __parent = _useBlockRequestConte7.__parent;
1057
+ var _useActionContext4 = useActionContext(),
1058
+ setVisible = _useActionContext4.setVisible;
970
1059
  var actionSchema = useFieldSchema();
971
1060
  var history = useHistory();
972
- var _useCollection4 = useCollection(),
973
- fields = _useCollection4.fields,
974
- getField = _useCollection4.getField;
1061
+ var _useCollection5 = useCollection(),
1062
+ fields = _useCollection5.fields,
1063
+ getField = _useCollection5.getField;
975
1064
  var compile = useCompile();
976
1065
  var actionField = useField();
977
1066
  var _useFormBlockContext = useFormBlockContext(),
978
1067
  updateAssociationValues = _useFormBlockContext.updateAssociationValues;
979
1068
  var currentRecord = useRecord();
980
1069
  var currentUserContext = useCurrentUserContext();
981
- var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d5 = currentUserContext.data) === null || _currentUserContext$d5 === void 0 ? void 0 : _currentUserContext$d5.data;
1070
+ var currentUser = currentUserContext === null || currentUserContext === void 0 ? void 0 : (_currentUserContext$d6 = currentUserContext.data) === null || _currentUserContext$d6 === void 0 ? void 0 : _currentUserContext$d6.data;
982
1071
  return {
983
1072
  onClick: function onClick() {
984
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
985
- var _actionSchema$xActio6;
986
- var _ref14, _ref14$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, assignedValues, fieldNames, values, _parent$service6, _parent$service6$refr, _parent$__parent2, _parent$__parent2$ser, _parent$__parent2$ser2;
987
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
988
- while (1) switch (_context18.prev = _context18.next) {
1073
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1074
+ var _actionSchema$xActio7;
1075
+ var _ref15, _ref15$assignedValues, originalAssignedValues, onSuccess, overwriteValues, skipValidator, assignedValues, fieldNames, values, _parent$service6, _parent$service6$refr;
1076
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1077
+ while (1) switch (_context19.prev = _context19.next) {
989
1078
  case 0:
990
- _ref14 = (_actionSchema$xActio6 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio6 !== void 0 ? _actionSchema$xActio6 : {}, _ref14$assignedValues = _ref14.assignedValues, originalAssignedValues = _ref14$assignedValues === void 0 ? {} : _ref14$assignedValues, onSuccess = _ref14.onSuccess, overwriteValues = _ref14.overwriteValues, skipValidator = _ref14.skipValidator;
1079
+ _ref15 = (_actionSchema$xActio7 = actionSchema === null || actionSchema === void 0 ? void 0 : actionSchema['x-action-settings']) !== null && _actionSchema$xActio7 !== void 0 ? _actionSchema$xActio7 : {}, _ref15$assignedValues = _ref15.assignedValues, originalAssignedValues = _ref15$assignedValues === void 0 ? {} : _ref15$assignedValues, onSuccess = _ref15.onSuccess, overwriteValues = _ref15.overwriteValues, skipValidator = _ref15.skipValidator;
991
1080
  assignedValues = parse(originalAssignedValues)({
992
1081
  currentTime: new Date(),
993
1082
  currentRecord: currentRecord,
994
1083
  currentUser: currentUser
995
1084
  });
996
1085
  if (skipValidator) {
997
- _context18.next = 5;
1086
+ _context19.next = 5;
998
1087
  break;
999
1088
  }
1000
- _context18.next = 5;
1089
+ _context19.next = 5;
1001
1090
  return form.submit();
1002
1091
  case 5:
1003
1092
  fieldNames = fields.map(function (field) {
@@ -1006,8 +1095,8 @@ export var useUpdateActionProps = function useUpdateActionProps() {
1006
1095
  values = getFormValues(filterByTk, field, form, fieldNames, getField, resource);
1007
1096
  actionField.data = field.data || {};
1008
1097
  actionField.data.loading = true;
1009
- _context18.prev = 9;
1010
- _context18.next = 12;
1098
+ _context19.prev = 9;
1099
+ _context19.next = 12;
1011
1100
  return resource.update({
1012
1101
  filterByTk: filterByTk,
1013
1102
  values: _objectSpread(_objectSpread(_objectSpread({}, values), overwriteValues), assignedValues),
@@ -1015,26 +1104,23 @@ export var useUpdateActionProps = function useUpdateActionProps() {
1015
1104
  });
1016
1105
  case 12:
1017
1106
  actionField.data.loading = false;
1018
- if (!(resource instanceof TableFieldResource)) {
1019
- __parent === null || __parent === void 0 ? void 0 : (_parent$__parent2 = __parent.__parent) === null || _parent$__parent2 === void 0 ? void 0 : (_parent$__parent2$ser = _parent$__parent2.service) === null || _parent$__parent2$ser === void 0 ? void 0 : (_parent$__parent2$ser2 = _parent$__parent2$ser.refresh) === null || _parent$__parent2$ser2 === void 0 ? void 0 : _parent$__parent2$ser2.call(_parent$__parent2$ser);
1020
- }
1021
1107
  __parent === null || __parent === void 0 ? void 0 : (_parent$service6 = __parent.service) === null || _parent$service6 === void 0 ? void 0 : (_parent$service6$refr = _parent$service6.refresh) === null || _parent$service6$refr === void 0 ? void 0 : _parent$service6$refr.call(_parent$service6);
1022
1108
  setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
1023
1109
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage) {
1024
- _context18.next = 18;
1110
+ _context19.next = 17;
1025
1111
  break;
1026
1112
  }
1027
- return _context18.abrupt("return");
1028
- case 18:
1113
+ return _context19.abrupt("return");
1114
+ case 17:
1029
1115
  if (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.manualClose) {
1030
1116
  Modal.success({
1031
1117
  title: compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage),
1032
1118
  onOk: function () {
1033
- var _onOk6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1034
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1035
- while (1) switch (_context17.prev = _context17.next) {
1119
+ var _onOk6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1120
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1121
+ while (1) switch (_context18.prev = _context18.next) {
1036
1122
  case 0:
1037
- _context17.next = 2;
1123
+ _context18.next = 2;
1038
1124
  return form.reset();
1039
1125
  case 2:
1040
1126
  if ((onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirecting) && (onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.redirectTo)) {
@@ -1046,9 +1132,9 @@ export var useUpdateActionProps = function useUpdateActionProps() {
1046
1132
  }
1047
1133
  case 3:
1048
1134
  case "end":
1049
- return _context17.stop();
1135
+ return _context18.stop();
1050
1136
  }
1051
- }, _callee17);
1137
+ }, _callee18);
1052
1138
  }));
1053
1139
  function onOk() {
1054
1140
  return _onOk6.apply(this, arguments);
@@ -1059,44 +1145,44 @@ export var useUpdateActionProps = function useUpdateActionProps() {
1059
1145
  } else {
1060
1146
  message.success(compile(onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess.successMessage));
1061
1147
  }
1062
- _context18.next = 24;
1148
+ _context19.next = 23;
1063
1149
  break;
1064
- case 21:
1065
- _context18.prev = 21;
1066
- _context18.t0 = _context18["catch"](9);
1150
+ case 20:
1151
+ _context19.prev = 20;
1152
+ _context19.t0 = _context19["catch"](9);
1067
1153
  actionField.data.loading = false;
1068
- case 24:
1154
+ case 23:
1069
1155
  case "end":
1070
- return _context18.stop();
1156
+ return _context19.stop();
1071
1157
  }
1072
- }, _callee18, null, [[9, 21]]);
1158
+ }, _callee19, null, [[9, 20]]);
1073
1159
  }))();
1074
1160
  }
1075
1161
  };
1076
1162
  };
1077
1163
  export var useDestroyActionProps = function useDestroyActionProps() {
1078
1164
  var filterByTk = useFilterByTk();
1079
- var _useBlockRequestConte7 = useBlockRequestContext(),
1080
- resource = _useBlockRequestConte7.resource,
1081
- service = _useBlockRequestConte7.service,
1082
- block = _useBlockRequestConte7.block,
1083
- __parent = _useBlockRequestConte7.__parent;
1084
- var _useActionContext4 = useActionContext(),
1085
- setVisible = _useActionContext4.setVisible;
1165
+ var _useBlockRequestConte8 = useBlockRequestContext(),
1166
+ resource = _useBlockRequestConte8.resource,
1167
+ service = _useBlockRequestConte8.service,
1168
+ block = _useBlockRequestConte8.block,
1169
+ __parent = _useBlockRequestConte8.__parent;
1170
+ var _useActionContext5 = useActionContext(),
1171
+ setVisible = _useActionContext5.setVisible;
1086
1172
  return {
1087
1173
  onClick: function onClick() {
1088
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1174
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1089
1175
  var _service$data;
1090
- var _ref15, _ref15$count, count, _ref15$page, page, _ref15$pageSize, pageSize, _service$params2, _service$refresh4, _parent$service7, _parent$service7$refr;
1091
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1092
- while (1) switch (_context19.prev = _context19.next) {
1176
+ var _ref16, _ref16$count, count, _ref16$page, page, _ref16$pageSize, pageSize, _service$params2, _service$refresh4, _parent$service7, _parent$service7$refr;
1177
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1178
+ while (1) switch (_context20.prev = _context20.next) {
1093
1179
  case 0:
1094
- _context19.next = 2;
1180
+ _context20.next = 2;
1095
1181
  return resource.destroy({
1096
1182
  filterByTk: filterByTk
1097
1183
  });
1098
1184
  case 2:
1099
- _ref15 = (service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.meta) || {}, _ref15$count = _ref15.count, count = _ref15$count === void 0 ? 0 : _ref15$count, _ref15$page = _ref15.page, page = _ref15$page === void 0 ? 0 : _ref15$page, _ref15$pageSize = _ref15.pageSize, pageSize = _ref15$pageSize === void 0 ? 0 : _ref15$pageSize;
1185
+ _ref16 = (service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.meta) || {}, _ref16$count = _ref16.count, count = _ref16$count === void 0 ? 0 : _ref16$count, _ref16$page = _ref16.page, page = _ref16$page === void 0 ? 0 : _ref16$page, _ref16$pageSize = _ref16.pageSize, pageSize = _ref16$pageSize === void 0 ? 0 : _ref16$pageSize;
1100
1186
  if (count % pageSize === 1) {
1101
1187
  service.run(_objectSpread(_objectSpread({}, service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2[0]), {}, {
1102
1188
  page: page - 1
@@ -1110,9 +1196,32 @@ export var useDestroyActionProps = function useDestroyActionProps() {
1110
1196
  }
1111
1197
  case 5:
1112
1198
  case "end":
1113
- return _context19.stop();
1199
+ return _context20.stop();
1114
1200
  }
1115
- }, _callee19);
1201
+ }, _callee20);
1202
+ }))();
1203
+ }
1204
+ };
1205
+ };
1206
+ export var useRemoveActionProps = function useRemoveActionProps(associationName) {
1207
+ var filterByTk = useFilterByTk();
1208
+ var api = useAPIClient();
1209
+ var resource = api.resource(associationName, filterByTk);
1210
+ return {
1211
+ onClick: function onClick(value) {
1212
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1213
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1214
+ while (1) switch (_context21.prev = _context21.next) {
1215
+ case 0:
1216
+ _context21.next = 2;
1217
+ return resource.remove({
1218
+ values: [value.id]
1219
+ });
1220
+ case 2:
1221
+ case "end":
1222
+ return _context21.stop();
1223
+ }
1224
+ }, _callee21);
1116
1225
  }))();
1117
1226
  }
1118
1227
  };
@@ -1128,40 +1237,40 @@ export var useDetailPrintActionProps = function useDetailPrintActionProps() {
1128
1237
  });
1129
1238
  return {
1130
1239
  onClick: function onClick() {
1131
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1132
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1133
- while (1) switch (_context20.prev = _context20.next) {
1240
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1241
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1242
+ while (1) switch (_context22.prev = _context22.next) {
1134
1243
  case 0:
1135
1244
  printHandler();
1136
1245
  case 1:
1137
1246
  case "end":
1138
- return _context20.stop();
1247
+ return _context22.stop();
1139
1248
  }
1140
- }, _callee20);
1249
+ }, _callee22);
1141
1250
  }))();
1142
1251
  }
1143
1252
  };
1144
1253
  };
1145
1254
  export var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
1146
- var _useBlockRequestConte8 = useBlockRequestContext(),
1147
- field = _useBlockRequestConte8.field;
1148
1255
  var _useBlockRequestConte9 = useBlockRequestContext(),
1149
- resource = _useBlockRequestConte9.resource,
1150
- service = _useBlockRequestConte9.service;
1256
+ field = _useBlockRequestConte9.field;
1257
+ var _useBlockRequestConte10 = useBlockRequestContext(),
1258
+ resource = _useBlockRequestConte10.resource,
1259
+ service = _useBlockRequestConte10.service;
1151
1260
  return {
1152
1261
  onClick: function onClick() {
1153
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1262
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1154
1263
  var _field$data2, _field$data2$selected, _field$data3, _service$refresh5;
1155
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1156
- while (1) switch (_context21.prev = _context21.next) {
1264
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1265
+ while (1) switch (_context23.prev = _context23.next) {
1157
1266
  case 0:
1158
1267
  if (field === null || field === void 0 ? void 0 : (_field$data2 = field.data) === null || _field$data2 === void 0 ? void 0 : (_field$data2$selected = _field$data2.selectedRowKeys) === null || _field$data2$selected === void 0 ? void 0 : _field$data2$selected.length) {
1159
- _context21.next = 2;
1268
+ _context23.next = 2;
1160
1269
  break;
1161
1270
  }
1162
- return _context21.abrupt("return");
1271
+ return _context23.abrupt("return");
1163
1272
  case 2:
1164
- _context21.next = 4;
1273
+ _context23.next = 4;
1165
1274
  return resource.destroy({
1166
1275
  filterByTk: (_field$data3 = field.data) === null || _field$data3 === void 0 ? void 0 : _field$data3.selectedRowKeys
1167
1276
  });
@@ -1170,29 +1279,29 @@ export var useBulkDestroyActionProps = function useBulkDestroyActionProps() {
1170
1279
  service === null || service === void 0 ? void 0 : (_service$refresh5 = service.refresh) === null || _service$refresh5 === void 0 ? void 0 : _service$refresh5.call(service);
1171
1280
  case 6:
1172
1281
  case "end":
1173
- return _context21.stop();
1282
+ return _context23.stop();
1174
1283
  }
1175
- }, _callee21);
1284
+ }, _callee23);
1176
1285
  }))();
1177
1286
  }
1178
1287
  };
1179
1288
  };
1180
1289
  export var useRefreshActionProps = function useRefreshActionProps() {
1181
- var _useBlockRequestConte10 = useBlockRequestContext(),
1182
- service = _useBlockRequestConte10.service;
1290
+ var _useBlockRequestConte11 = useBlockRequestContext(),
1291
+ service = _useBlockRequestConte11.service;
1183
1292
  return {
1184
1293
  onClick: function onClick() {
1185
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1294
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1186
1295
  var _service$refresh6;
1187
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1188
- while (1) switch (_context22.prev = _context22.next) {
1296
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1297
+ while (1) switch (_context24.prev = _context24.next) {
1189
1298
  case 0:
1190
1299
  service === null || service === void 0 ? void 0 : (_service$refresh6 = service.refresh) === null || _service$refresh6 === void 0 ? void 0 : _service$refresh6.call(service);
1191
1300
  case 1:
1192
1301
  case "end":
1193
- return _context22.stop();
1302
+ return _context24.stop();
1194
1303
  }
1195
- }, _callee22);
1304
+ }, _callee24);
1196
1305
  }))();
1197
1306
  }
1198
1307
  };
@@ -1208,11 +1317,11 @@ export var useDetailsPaginationProps = function useDetailsPaginationProps() {
1208
1317
  total: count,
1209
1318
  pageSize: 1,
1210
1319
  onChange: function onChange(page) {
1211
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1320
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1212
1321
  var _ctx$service3, _ctx$service3$params;
1213
1322
  var params;
1214
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1215
- while (1) switch (_context23.prev = _context23.next) {
1323
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1324
+ while (1) switch (_context25.prev = _context25.next) {
1216
1325
  case 0:
1217
1326
  params = (_ctx$service3 = ctx.service) === null || _ctx$service3 === void 0 ? void 0 : (_ctx$service3$params = _ctx$service3.params) === null || _ctx$service3$params === void 0 ? void 0 : _ctx$service3$params[0];
1218
1327
  ctx.service.run(_objectSpread(_objectSpread({}, params), {}, {
@@ -1220,9 +1329,9 @@ export var useDetailsPaginationProps = function useDetailsPaginationProps() {
1220
1329
  }));
1221
1330
  case 2:
1222
1331
  case "end":
1223
- return _context23.stop();
1332
+ return _context25.stop();
1224
1333
  }
1225
- }, _callee23);
1334
+ }, _callee25);
1226
1335
  }))();
1227
1336
  },
1228
1337
  style: {
@@ -1232,14 +1341,14 @@ export var useDetailsPaginationProps = function useDetailsPaginationProps() {
1232
1341
  };
1233
1342
  };
1234
1343
  export var useAssociationFilterProps = function useAssociationFilterProps() {
1235
- var _fieldSchema$xCompon2, _fieldSchema$xCompon3, _field$componentProps, _field$componentProps2;
1344
+ var _fieldSchema$xCompon3, _fieldSchema$xCompon4, _field$componentProps, _field$componentProps2;
1236
1345
  var collectionField = AssociationFilter.useAssociationField();
1237
- var _useBlockRequestConte11 = useBlockRequestContext(),
1238
- service = _useBlockRequestConte11.service,
1239
- blockProps = _useBlockRequestConte11.props;
1346
+ var _useBlockRequestConte12 = useBlockRequestContext(),
1347
+ service = _useBlockRequestConte12.service,
1348
+ blockProps = _useBlockRequestConte12.props;
1240
1349
  var fieldSchema = useFieldSchema();
1241
1350
  var valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
1242
- var labelKey = ((_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : (_fieldSchema$xCompon3 = _fieldSchema$xCompon2.fieldNames) === null || _fieldSchema$xCompon3 === void 0 ? void 0 : _fieldSchema$xCompon3.label) || valueKey;
1351
+ var labelKey = ((_fieldSchema$xCompon3 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon3 === void 0 ? void 0 : (_fieldSchema$xCompon4 = _fieldSchema$xCompon3.fieldNames) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : _fieldSchema$xCompon4.label) || valueKey;
1243
1352
  var field = useField();
1244
1353
  var collectionFieldName = collectionField.name;
1245
1354
  var _useRequest = useRequest({
@@ -1289,9 +1398,9 @@ export var useAssociationFilterProps = function useAssociationFilterProps() {
1289
1398
  };
1290
1399
  };
1291
1400
  export var useOptionalFieldList = function useOptionalFieldList() {
1292
- var _useCollection5 = useCollection(),
1293
- _useCollection5$curre = _useCollection5.currentFields,
1294
- currentFields = _useCollection5$curre === void 0 ? [] : _useCollection5$curre;
1401
+ var _useCollection6 = useCollection(),
1402
+ _useCollection6$curre = _useCollection6.currentFields,
1403
+ currentFields = _useCollection6$curre === void 0 ? [] : _useCollection6$curre;
1295
1404
  return currentFields.filter(function (field) {
1296
1405
  return isOptionalField(field) && field.uiSchema.enum;
1297
1406
  });
@@ -1301,7 +1410,7 @@ var isOptionalField = function isOptionalField(field) {
1301
1410
  return optionalInterfaces.includes(field.interface);
1302
1411
  };
1303
1412
  export var useAssociationFilterBlockProps = function useAssociationFilterBlockProps() {
1304
- var _fieldSchema$xCompon4, _fieldSchema$xCompon5, _field$componentProps3, _field$componentProps4;
1413
+ var _fieldSchema$xCompon5, _fieldSchema$xCompon6, _field$componentProps3, _field$componentProps4;
1305
1414
  var collectionField = AssociationFilter.useAssociationField();
1306
1415
  var fieldSchema = useFieldSchema();
1307
1416
  var optionalFieldList = useOptionalFieldList();
@@ -1311,7 +1420,7 @@ export var useAssociationFilterBlockProps = function useAssociationFilterBlockPr
1311
1420
  var field = useField();
1312
1421
  var list, onSelected, handleSearchInput, params, run, data, valueKey, labelKey, filterKey;
1313
1422
  valueKey = (collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetKey) || 'id';
1314
- labelKey = ((_fieldSchema$xCompon4 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon4 === void 0 ? void 0 : (_fieldSchema$xCompon5 = _fieldSchema$xCompon4.fieldNames) === null || _fieldSchema$xCompon5 === void 0 ? void 0 : _fieldSchema$xCompon5.label) || valueKey;
1423
+ labelKey = ((_fieldSchema$xCompon5 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon5 === void 0 ? void 0 : (_fieldSchema$xCompon6 = _fieldSchema$xCompon5.fieldNames) === null || _fieldSchema$xCompon6 === void 0 ? void 0 : _fieldSchema$xCompon6.label) || valueKey;
1315
1424
  var _useRequest2 = useRequest({
1316
1425
  resource: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target,
1317
1426
  action: 'list',
@@ -1412,4 +1521,133 @@ export var useAssociationFilterBlockProps = function useAssociationFilterBlockPr
1412
1521
  valueKey: valueKey,
1413
1522
  labelKey: labelKey
1414
1523
  };
1524
+ };
1525
+ var getTemplateSchema = function getTemplateSchema(schema) {
1526
+ var conf = {
1527
+ url: "/uiSchemas:getJsonSchema/".concat(schema === null || schema === void 0 ? void 0 : schema.uid)
1528
+ };
1529
+ var _useRequest3 = useRequest(conf, {
1530
+ manual: true
1531
+ }),
1532
+ data = _useRequest3.data,
1533
+ loading = _useRequest3.loading,
1534
+ run = _useRequest3.run;
1535
+ if (loading) {}
1536
+ useEffect(function () {
1537
+ if (schema === null || schema === void 0 ? void 0 : schema.uid) {
1538
+ run();
1539
+ }
1540
+ }, [schema === null || schema === void 0 ? void 0 : schema.uid]);
1541
+ return (schema === null || schema === void 0 ? void 0 : schema.uid) ? new Schema(data === null || data === void 0 ? void 0 : data.data) : null;
1542
+ };
1543
+ export var useAssociationNames = function useAssociationNames(collection) {
1544
+ var _templateSchema$xCom;
1545
+ var _useCollectionManager2 = useCollectionManager(),
1546
+ getCollectionJoinField = _useCollectionManager2.getCollectionJoinField;
1547
+ var _useSchemaTemplateMan = useSchemaTemplateManager(),
1548
+ getTemplateById = _useSchemaTemplateMan.getTemplateById;
1549
+ var fieldSchema = useFieldSchema();
1550
+ var associationValues = [];
1551
+ var formSchema = fieldSchema.reduceProperties(function (buf, schema) {
1552
+ if (['FormV2', 'Details', 'List', 'GridCard'].includes(schema['x-component'])) {
1553
+ return schema;
1554
+ }
1555
+ return buf;
1556
+ }, new Schema({}));
1557
+ var templateSchema = formSchema.reduceProperties(function (buf, schema) {
1558
+ if (schema['x-component'] === 'BlockTemplate') {
1559
+ return schema;
1560
+ }
1561
+ return buf;
1562
+ }, null);
1563
+ var getAssociationAppends = function getAssociationAppends(schema) {
1564
+ var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1565
+ var data = schema.reduceProperties(function (buf, s) {
1566
+ var collectionfield = s['x-collection-field'] && getCollectionJoinField(s['x-collection-field']);
1567
+ if (collectionfield && ['hasOne', 'hasMany', 'belongsTo', 'belongsToMany'].includes(collectionfield.type) && s['x-component'] !== 'TableField') {
1568
+ var _s$xComponentProps;
1569
+ buf.push(s.name);
1570
+ if (['Nester', 'SubTable'].includes((_s$xComponentProps = s['x-component-props']) === null || _s$xComponentProps === void 0 ? void 0 : _s$xComponentProps.mode)) {
1571
+ associationValues.push(s.name);
1572
+ }
1573
+ if (s['x-component-props'].mode === 'Nester') {
1574
+ return getAssociationAppends(s, buf);
1575
+ }
1576
+ return buf;
1577
+ } else {
1578
+ if (s['x-component'] === 'Grid.Row') {
1579
+ var _buf$concat;
1580
+ var kk = buf === null || buf === void 0 ? void 0 : (_buf$concat = buf.concat) === null || _buf$concat === void 0 ? void 0 : _buf$concat.call(buf);
1581
+ return getNesterAppends(s, kk || []);
1582
+ } else {
1583
+ var _s$xComponent;
1584
+ 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;
1585
+ }
1586
+ }
1587
+ }, arr);
1588
+ return data || [];
1589
+ };
1590
+ function flattenNestedList(nestedList) {
1591
+ var flattenedList = [];
1592
+ function flattenHelper(list, prefix) {
1593
+ for (var i = 0; i < list.length; i++) {
1594
+ if (Array.isArray(list[i])) {
1595
+ "".concat(prefix) !== "".concat(list[i][0]) && flattenHelper(list[i], "".concat(prefix, ".").concat(list[i][0]));
1596
+ } else {
1597
+ var searchTerm = ".".concat(list[i]);
1598
+ var lastIndex = prefix.lastIndexOf(searchTerm);
1599
+ var str = '';
1600
+ if (lastIndex !== -1) {
1601
+ str = prefix.slice(0, lastIndex) + prefix.slice(lastIndex + searchTerm.length);
1602
+ }
1603
+ if (!str) {
1604
+ !list.includes(str) && flattenedList.push("".concat(list[i]));
1605
+ } else {
1606
+ !list.includes(str) ? flattenedList.push("".concat(str, ".").concat(list[i])) : flattenedList.push(str);
1607
+ }
1608
+ }
1609
+ }
1610
+ }
1611
+ for (var i = 0; i < nestedList.length; i++) {
1612
+ flattenHelper(nestedList[i], nestedList[i][0]);
1613
+ }
1614
+ return uniq(flattenedList.filter(function (obj) {
1615
+ return !(obj === null || obj === void 0 ? void 0 : obj.startsWith('.'));
1616
+ }));
1617
+ }
1618
+ var getNesterAppends = function getNesterAppends(gridSchema, data) {
1619
+ gridSchema.reduceProperties(function (buf, s) {
1620
+ buf.push(getAssociationAppends(s));
1621
+ return buf;
1622
+ }, data);
1623
+ return data.filter(function (g) {
1624
+ return g.length;
1625
+ });
1626
+ };
1627
+ 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);
1628
+ var schema = getTemplateSchema(template);
1629
+ if (schema) {
1630
+ var associations = getAssociationAppends(schema);
1631
+ var appends = flattenNestedList(associations);
1632
+ return {
1633
+ appends: appends,
1634
+ updateAssociationValues: appends.filter(function (item) {
1635
+ return associationValues.some(function (suffix) {
1636
+ return item.endsWith(suffix);
1637
+ });
1638
+ })
1639
+ };
1640
+ }
1641
+ if (!schema) {
1642
+ var _associations = getAssociationAppends(formSchema);
1643
+ var _appends = flattenNestedList(_associations);
1644
+ return {
1645
+ appends: _appends,
1646
+ updateAssociationValues: _appends.filter(function (item) {
1647
+ return associationValues.some(function (suffix) {
1648
+ return item.endsWith(suffix);
1649
+ });
1650
+ })
1651
+ };
1652
+ }
1415
1653
  };