@ant-design/pro-components 3.0.2-0 → 3.1.1-0

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 (829) hide show
  1. package/README.es-PR.md +1 -3
  2. package/README.md +8 -10
  3. package/README.zh-CN.md +11 -11
  4. package/dist/pro-components.min.js +1 -1
  5. package/es/card/ProCard.js +7 -7
  6. package/es/card/components/Actions/index.js +25 -25
  7. package/es/card/components/Actions/style.d.ts +1 -1
  8. package/es/card/components/Actions/style.js +79 -71
  9. package/es/card/components/Card/index.js +160 -141
  10. package/es/card/components/Card/style.d.ts +1 -1
  11. package/es/card/components/Card/style.js +249 -192
  12. package/es/card/components/CheckCard/Group.js +94 -115
  13. package/es/card/components/CheckCard/index.d.ts +6 -0
  14. package/es/card/components/CheckCard/index.js +85 -78
  15. package/es/card/components/CheckCard/style.d.ts +1 -1
  16. package/es/card/components/CheckCard/style.js +184 -168
  17. package/es/card/components/Divider/index.js +19 -15
  18. package/es/card/components/Divider/style.d.ts +1 -1
  19. package/es/card/components/Divider/style.js +32 -29
  20. package/es/card/components/Loading/index.js +19 -16
  21. package/es/card/components/Loading/style.d.ts +1 -1
  22. package/es/card/components/Loading/style.js +34 -31
  23. package/es/card/components/Operation/index.js +16 -13
  24. package/es/card/components/Operation/style.d.ts +1 -1
  25. package/es/card/components/Operation/style.js +19 -18
  26. package/es/card/components/Statistic/index.js +46 -41
  27. package/es/card/components/Statistic/style.d.ts +1 -1
  28. package/es/card/components/Statistic/style.js +89 -70
  29. package/es/card/components/StatisticCard/index.js +45 -38
  30. package/es/card/components/StatisticCard/style.d.ts +1 -1
  31. package/es/card/components/StatisticCard/style.js +37 -35
  32. package/es/card/typing.d.ts +5 -0
  33. package/es/descriptions/index.js +214 -225
  34. package/es/descriptions/useFetchData.js +53 -91
  35. package/es/field/AllProField.js +265 -216
  36. package/es/field/FieldHOC/index.js +9 -14
  37. package/es/field/PureProField.js +82 -80
  38. package/es/field/ValueTypeToComponent.js +517 -618
  39. package/es/field/components/Cascader/index.d.ts +2 -3
  40. package/es/field/components/Cascader/index.js +65 -84
  41. package/es/field/components/Checkbox/index.d.ts +2 -3
  42. package/es/field/components/Checkbox/index.js +75 -72
  43. package/es/field/components/Code/index.js +40 -39
  44. package/es/field/components/ColorPicker/index.d.ts +1 -1
  45. package/es/field/components/ColorPicker/index.js +38 -32
  46. package/es/field/components/DatePicker/index.d.ts +2 -2
  47. package/es/field/components/DatePicker/index.js +49 -53
  48. package/es/field/components/Digit/index.js +41 -42
  49. package/es/field/components/DigitRange/index.js +71 -77
  50. package/es/field/components/FromNow/index.js +27 -25
  51. package/es/field/components/Image/index.js +28 -24
  52. package/es/field/components/IndexColumn/index.js +22 -16
  53. package/es/field/components/Money/index.js +107 -116
  54. package/es/field/components/Options/index.js +34 -33
  55. package/es/field/components/Password/index.js +35 -38
  56. package/es/field/components/Percent/index.js +40 -44
  57. package/es/field/components/Percent/util.d.ts +1 -1
  58. package/es/field/components/Percent/util.js +3 -5
  59. package/es/field/components/Progress/index.js +29 -27
  60. package/es/field/components/Radio/index.d.ts +1 -2
  61. package/es/field/components/Radio/index.js +61 -62
  62. package/es/field/components/RangePicker/index.d.ts +2 -2
  63. package/es/field/components/RangePicker/index.js +52 -63
  64. package/es/field/components/Rate/index.js +24 -21
  65. package/es/field/components/Second/index.js +36 -33
  66. package/es/field/components/Segmented/index.d.ts +1 -2
  67. package/es/field/components/Segmented/index.js +37 -46
  68. package/es/field/components/Select/LightSelect/index.d.ts +1 -1
  69. package/es/field/components/Select/LightSelect/index.js +102 -110
  70. package/es/field/components/Select/SearchSelect/index.d.ts +6 -1
  71. package/es/field/components/Select/SearchSelect/index.js +189 -129
  72. package/es/field/components/Select/index.d.ts +2 -5
  73. package/es/field/components/Select/index.js +197 -221
  74. package/es/field/components/Slider/index.js +25 -22
  75. package/es/field/components/Status/index.js +67 -78
  76. package/es/field/components/Switch/index.d.ts +1 -1
  77. package/es/field/components/Switch/index.js +32 -30
  78. package/es/field/components/Text/index.js +34 -37
  79. package/es/field/components/TextArea/index.js +26 -21
  80. package/es/field/components/TextArea/readonly.js +24 -21
  81. package/es/field/components/TimePicker/index.js +96 -105
  82. package/es/field/components/TreeSelect/index.d.ts +2 -3
  83. package/es/field/components/TreeSelect/index.js +107 -125
  84. package/es/form/BaseForm/BaseForm.d.ts +3 -0
  85. package/es/form/BaseForm/BaseForm.js +418 -498
  86. package/es/form/BaseForm/EditOrReadOnlyContext.js +1 -1
  87. package/es/form/BaseForm/LightWrapper/index.js +56 -65
  88. package/es/form/BaseForm/LightWrapper/style.d.ts +1 -1
  89. package/es/form/BaseForm/LightWrapper/style.js +17 -13
  90. package/es/form/BaseForm/Submitter/index.js +44 -43
  91. package/es/form/FieldContext.js +1 -1
  92. package/es/form/components/Captcha/index.d.ts +8 -2
  93. package/es/form/components/Captcha/index.js +76 -128
  94. package/es/form/components/Cascader/index.js +26 -28
  95. package/es/form/components/Checkbox/index.js +60 -61
  96. package/es/form/components/ColorPicker/index.js +24 -26
  97. package/es/form/components/DatePicker/BaseDatePicker.js +33 -31
  98. package/es/form/components/DatePicker/DatePicker.js +14 -13
  99. package/es/form/components/DatePicker/DateTimePicker.js +11 -12
  100. package/es/form/components/DatePicker/MonthPicker.js +14 -13
  101. package/es/form/components/DatePicker/QuarterPicker.js +14 -13
  102. package/es/form/components/DatePicker/TimePicker.js +26 -27
  103. package/es/form/components/DatePicker/WeekPicker.js +14 -13
  104. package/es/form/components/DatePicker/YearPicker.js +14 -13
  105. package/es/form/components/DatePicker/index.js +1 -1
  106. package/es/form/components/DateRangePicker/BaseDateRanger.js +35 -35
  107. package/es/form/components/DateRangePicker/DateMonthRangePicker.js +15 -16
  108. package/es/form/components/DateRangePicker/DateQuarterRangePicker.js +15 -16
  109. package/es/form/components/DateRangePicker/DateTimeRangePicker.js +15 -16
  110. package/es/form/components/DateRangePicker/DateWeekRangePicker.js +15 -16
  111. package/es/form/components/DateRangePicker/DateYearRangePicker.js +15 -16
  112. package/es/form/components/DateRangePicker/TimeRangePicker.js +26 -29
  113. package/es/form/components/DateRangePicker/index.js +15 -16
  114. package/es/form/components/Dependency/index.js +31 -34
  115. package/es/form/components/Digit/DigitRange.js +23 -24
  116. package/es/form/components/Digit/index.js +27 -29
  117. package/es/form/components/Field/index.js +55 -63
  118. package/es/form/components/FieldSet/index.js +68 -76
  119. package/es/form/components/FormItem/FormItemRender/index.js +58 -48
  120. package/es/form/components/FormItem/Group/index.js +95 -95
  121. package/es/form/components/FormItem/Group/style.d.ts +1 -1
  122. package/es/form/components/FormItem/Group/style.js +46 -40
  123. package/es/form/components/FormItem/index.js +135 -141
  124. package/es/form/components/FormItem/warpField.js +165 -149
  125. package/es/form/components/List/ListContainer.js +98 -189
  126. package/es/form/components/List/ListItem.js +151 -198
  127. package/es/form/components/List/index.d.ts +1 -1
  128. package/es/form/components/List/index.js +97 -107
  129. package/es/form/components/List/style.d.ts +1 -1
  130. package/es/form/components/List/style.js +71 -47
  131. package/es/form/components/Money/index.js +28 -30
  132. package/es/form/components/Radio/index.js +45 -49
  133. package/es/form/components/Rate/index.js +17 -20
  134. package/es/form/components/SchemaForm/index.js +58 -72
  135. package/es/form/components/SchemaForm/layoutType/Embed.js +5 -6
  136. package/es/form/components/SchemaForm/layoutType/StepsForm.js +22 -26
  137. package/es/form/components/SchemaForm/valueType/dependency.js +11 -11
  138. package/es/form/components/SchemaForm/valueType/divider.js +4 -5
  139. package/es/form/components/SchemaForm/valueType/field.js +45 -44
  140. package/es/form/components/SchemaForm/valueType/formList.js +8 -7
  141. package/es/form/components/SchemaForm/valueType/formSet.js +8 -7
  142. package/es/form/components/SchemaForm/valueType/group.js +7 -8
  143. package/es/form/components/SchemaForm/valueType/ignore.js +2 -2
  144. package/es/form/components/SchemaForm/valueType/index.js +5 -5
  145. package/es/form/components/Segmented/index.js +20 -23
  146. package/es/form/components/Select/index.js +69 -73
  147. package/es/form/components/Slider/index.js +33 -35
  148. package/es/form/components/Switch/index.js +24 -26
  149. package/es/form/components/Text/index.js +79 -88
  150. package/es/form/components/TextArea/index.js +17 -20
  151. package/es/form/components/TreeSelect/index.js +20 -23
  152. package/es/form/components/UploadButton/index.js +56 -103
  153. package/es/form/components/UploadDragger/index.js +37 -44
  154. package/es/form/helpers/grid.js +65 -67
  155. package/es/form/index.d.ts +1 -0
  156. package/es/form/layouts/DrawerForm/index.d.ts +1 -1
  157. package/es/form/layouts/DrawerForm/index.js +152 -242
  158. package/es/form/layouts/DrawerForm/style.d.ts +1 -1
  159. package/es/form/layouts/DrawerForm/style.js +26 -25
  160. package/es/form/layouts/LightFilter/index.d.ts +12 -1
  161. package/es/form/layouts/LightFilter/index.js +158 -140
  162. package/es/form/layouts/LightFilter/style.d.ts +1 -1
  163. package/es/form/layouts/LightFilter/style.js +52 -48
  164. package/es/form/layouts/LoginForm/index.d.ts +1 -1
  165. package/es/form/layouts/LoginForm/index.js +44 -47
  166. package/es/form/layouts/LoginForm/style.d.ts +1 -1
  167. package/es/form/layouts/LoginForm/style.js +71 -67
  168. package/es/form/layouts/LoginFormPage/index.d.ts +1 -1
  169. package/es/form/layouts/LoginFormPage/index.js +45 -48
  170. package/es/form/layouts/LoginFormPage/style.d.ts +1 -1
  171. package/es/form/layouts/LoginFormPage/style.js +136 -126
  172. package/es/form/layouts/ModalForm/index.js +120 -203
  173. package/es/form/layouts/ProForm/index.d.ts +2 -2
  174. package/es/form/layouts/ProForm/index.js +5 -5
  175. package/es/form/layouts/QueryFilter/Actions.js +23 -22
  176. package/es/form/layouts/QueryFilter/index.d.ts +2 -1
  177. package/es/form/layouts/QueryFilter/index.js +178 -203
  178. package/es/form/layouts/QueryFilter/style.d.ts +1 -1
  179. package/es/form/layouts/QueryFilter/style.js +45 -37
  180. package/es/form/layouts/StepsForm/StepForm.d.ts +2 -3
  181. package/es/form/layouts/StepsForm/StepForm.js +50 -71
  182. package/es/form/layouts/StepsForm/index.js +187 -216
  183. package/es/form/layouts/StepsForm/style.d.ts +1 -1
  184. package/es/form/layouts/StepsForm/style.js +30 -28
  185. package/es/form/layouts/index.js +1 -1
  186. package/es/layout/ProLayout.js +281 -292
  187. package/es/layout/WrapContent.js +16 -12
  188. package/es/layout/assert/Logo.js +95 -97
  189. package/es/layout/components/AppsLogoComponents/AppsLogo.js +10 -12
  190. package/es/layout/components/AppsLogoComponents/DefaultContent.js +17 -16
  191. package/es/layout/components/AppsLogoComponents/SimpleContent.js +19 -18
  192. package/es/layout/components/AppsLogoComponents/index.js +34 -37
  193. package/es/layout/components/AppsLogoComponents/style/default.js +2 -2
  194. package/es/layout/components/AppsLogoComponents/style/index.d.ts +1 -1
  195. package/es/layout/components/AppsLogoComponents/style/index.js +52 -50
  196. package/es/layout/components/AppsLogoComponents/style/simple.js +1 -1
  197. package/es/layout/components/CollapsedIcon/index.js +18 -15
  198. package/es/layout/components/CollapsedIcon/style.d.ts +1 -1
  199. package/es/layout/components/CollapsedIcon/style.js +40 -40
  200. package/es/layout/components/Footer.js +22 -21
  201. package/es/layout/components/FooterToolbar/index.js +58 -52
  202. package/es/layout/components/FooterToolbar/style/index.d.ts +1 -1
  203. package/es/layout/components/FooterToolbar/style/index.js +38 -37
  204. package/es/layout/components/FooterToolbar/style/stylish.d.ts +1 -1
  205. package/es/layout/components/FooterToolbar/style/stylish.js +11 -9
  206. package/es/layout/components/GlobalFooter/index.d.ts +1 -1
  207. package/es/layout/components/GlobalFooter/index.js +25 -25
  208. package/es/layout/components/GlobalFooter/style.d.ts +1 -1
  209. package/es/layout/components/GlobalFooter/style.js +31 -30
  210. package/es/layout/components/GlobalHeader/ActionsContent.js +62 -78
  211. package/es/layout/components/GlobalHeader/index.js +59 -47
  212. package/es/layout/components/GlobalHeader/rightContentStyle.d.ts +1 -1
  213. package/es/layout/components/GlobalHeader/rightContentStyle.js +49 -49
  214. package/es/layout/components/GlobalHeader/style.d.ts +1 -1
  215. package/es/layout/components/GlobalHeader/style.js +58 -54
  216. package/es/layout/components/GridContent/index.js +24 -19
  217. package/es/layout/components/GridContent/style.d.ts +1 -1
  218. package/es/layout/components/GridContent/style.js +14 -13
  219. package/es/layout/components/Header/index.js +63 -57
  220. package/es/layout/components/Header/style/header.d.ts +1 -1
  221. package/es/layout/components/Header/style/header.js +49 -47
  222. package/es/layout/components/Header/style/stylish.d.ts +1 -1
  223. package/es/layout/components/Header/style/stylish.js +15 -11
  224. package/es/layout/components/Help/AsyncContentPanel.js +13 -18
  225. package/es/layout/components/Help/HelpProvide.js +1 -1
  226. package/es/layout/components/Help/ProHelpContentPanel.js +64 -83
  227. package/es/layout/components/Help/ProHelpDrawer.d.ts +1 -1
  228. package/es/layout/components/Help/ProHelpDrawer.js +25 -29
  229. package/es/layout/components/Help/ProHelpModal.d.ts +1 -1
  230. package/es/layout/components/Help/ProHelpModal.js +24 -27
  231. package/es/layout/components/Help/ProHelpPanel.js +86 -94
  232. package/es/layout/components/Help/ProHelpPopover.js +19 -17
  233. package/es/layout/components/Help/RenderContentPanel.js +34 -24
  234. package/es/layout/components/Help/Search.js +52 -78
  235. package/es/layout/components/Help/index.js +9 -11
  236. package/es/layout/components/Help/style.d.ts +1 -1
  237. package/es/layout/components/Help/style.js +82 -75
  238. package/es/layout/components/PageContainer/index.js +168 -149
  239. package/es/layout/components/PageContainer/style/index.d.ts +1 -1
  240. package/es/layout/components/PageContainer/style/index.js +95 -78
  241. package/es/layout/components/PageContainer/style/stylish.d.ts +1 -1
  242. package/es/layout/components/PageContainer/style/stylish.js +11 -9
  243. package/es/layout/components/PageHeader/index.js +96 -97
  244. package/es/layout/components/PageHeader/style/index.d.ts +1 -1
  245. package/es/layout/components/PageHeader/style/index.js +142 -122
  246. package/es/layout/components/PageLoading/index.js +17 -20
  247. package/es/layout/components/SettingDrawer/BlockCheckbox.js +29 -32
  248. package/es/layout/components/SettingDrawer/LayoutChange.js +22 -22
  249. package/es/layout/components/SettingDrawer/RegionalChange.js +14 -15
  250. package/es/layout/components/SettingDrawer/ThemeColor.js +32 -35
  251. package/es/layout/components/SettingDrawer/index.js +139 -170
  252. package/es/layout/components/SettingDrawer/style/index.d.ts +1 -1
  253. package/es/layout/components/SettingDrawer/style/index.js +141 -137
  254. package/es/layout/components/SiderMenu/BaseMenu.d.ts +1 -1
  255. package/es/layout/components/SiderMenu/BaseMenu.js +236 -222
  256. package/es/layout/components/SiderMenu/SiderMenu.js +127 -117
  257. package/es/layout/components/SiderMenu/index.js +51 -43
  258. package/es/layout/components/SiderMenu/style/index.d.ts +1 -1
  259. package/es/layout/components/SiderMenu/style/index.js +179 -161
  260. package/es/layout/components/SiderMenu/style/menu.d.ts +1 -1
  261. package/es/layout/components/SiderMenu/style/menu.js +148 -110
  262. package/es/layout/components/SiderMenu/style/stylish.d.ts +1 -1
  263. package/es/layout/components/SiderMenu/style/stylish.js +15 -11
  264. package/es/layout/components/TopNavHeader/index.js +71 -60
  265. package/es/layout/components/TopNavHeader/style.d.ts +1 -1
  266. package/es/layout/components/TopNavHeader/style.js +64 -63
  267. package/es/layout/context/RouteContext.js +1 -1
  268. package/es/layout/defaultSettings.d.ts +6 -0
  269. package/es/layout/defaultSettings.js +1 -1
  270. package/es/layout/getPageTitle.js +23 -24
  271. package/es/layout/locales/en-US.js +3 -2
  272. package/es/layout/locales/index.js +5 -5
  273. package/es/layout/locales/it-IT.js +3 -2
  274. package/es/layout/locales/ko-KR.js +3 -2
  275. package/es/layout/locales/zh-CN.js +3 -2
  276. package/es/layout/locales/zh-TW.js +3 -2
  277. package/es/layout/style/index.d.ts +1 -1
  278. package/es/layout/style/index.js +48 -42
  279. package/es/layout/utils/getBreadcrumbProps.js +60 -60
  280. package/es/layout/utils/getMenuData.js +7 -11
  281. package/es/layout/utils/pathTools.js +2 -6
  282. package/es/layout/utils/useCurrentMenuLayoutProps.js +4 -9
  283. package/es/layout/utils/utils.js +15 -17
  284. package/es/list/Item.js +157 -137
  285. package/es/list/ListView.js +106 -115
  286. package/es/list/constants.js +2 -2
  287. package/es/list/index.js +72 -70
  288. package/es/list/style/index.d.ts +1 -1
  289. package/es/list/style/index.js +281 -213
  290. package/es/provider/index.d.ts +1 -0
  291. package/es/provider/index.js +126 -114
  292. package/es/provider/intl.js +53 -55
  293. package/es/provider/typing/layoutToken.js +26 -23
  294. package/es/provider/useStyle/index.d.ts +2 -1
  295. package/es/provider/useStyle/index.js +60 -60
  296. package/es/provider/utils/merge.js +10 -12
  297. package/es/skeleton/components/Descriptions/index.js +211 -229
  298. package/es/skeleton/components/List/index.js +208 -223
  299. package/es/skeleton/components/Result/index.js +45 -47
  300. package/es/skeleton/index.js +13 -10
  301. package/es/table/Store/Provide.d.ts +4 -4
  302. package/es/table/Store/Provide.js +102 -117
  303. package/es/table/Table.d.ts +5 -2
  304. package/es/table/Table.js +593 -603
  305. package/es/table/TableSearch.d.ts +24 -0
  306. package/es/table/TableSearch.js +54 -0
  307. package/es/table/TableToolbar.d.ts +22 -0
  308. package/es/table/TableToolbar.js +47 -0
  309. package/es/table/components/Alert/index.d.ts +1 -1
  310. package/es/table/components/Alert/index.js +41 -40
  311. package/es/table/components/Alert/style.d.ts +1 -1
  312. package/es/table/components/Alert/style.js +28 -27
  313. package/es/table/components/ColumnSetting/index.d.ts +1 -1
  314. package/es/table/components/ColumnSetting/index.js +230 -223
  315. package/es/table/components/ColumnSetting/style.d.ts +1 -1
  316. package/es/table/components/ColumnSetting/style.js +86 -71
  317. package/es/table/components/DragSortTable/index.d.ts +1 -1
  318. package/es/table/components/DragSortTable/index.js +65 -79
  319. package/es/table/components/DragSortTable/style.d.ts +1 -1
  320. package/es/table/components/DragSortTable/style.js +20 -19
  321. package/es/table/components/Dropdown/index.js +42 -47
  322. package/es/table/components/EditableTable/CellEditorTable.js +24 -32
  323. package/es/table/components/EditableTable/RowEditorTable.js +23 -28
  324. package/es/table/components/EditableTable/index.js +601 -302
  325. package/es/table/components/Form/FormRender.js +99 -103
  326. package/es/table/components/Form/index.d.ts +4 -19
  327. package/es/table/components/Form/index.js +112 -159
  328. package/es/table/components/ListToolBar/HeaderMenu.js +44 -52
  329. package/es/table/components/ListToolBar/index.js +122 -147
  330. package/es/table/components/ListToolBar/style.d.ts +1 -1
  331. package/es/table/components/ListToolBar/style.js +127 -117
  332. package/es/table/components/ToolBar/DensityIcon.js +10 -9
  333. package/es/table/components/ToolBar/FullscreenIcon.js +5 -9
  334. package/es/table/components/ToolBar/index.d.ts +2 -8
  335. package/es/table/components/ToolBar/index.js +155 -195
  336. package/es/table/style/index.d.ts +1 -1
  337. package/es/table/style/index.js +144 -112
  338. package/es/table/typing.d.ts +13 -6
  339. package/es/table/useFetchData.js +204 -348
  340. package/es/table/utils/cellRenderToFromItem.js +105 -119
  341. package/es/table/utils/columnRender.js +63 -54
  342. package/es/table/utils/columnSort.js +22 -22
  343. package/es/table/utils/genProColumnToColumn.d.ts +13 -9
  344. package/es/table/utils/genProColumnToColumn.js +121 -98
  345. package/es/table/utils/index.d.ts +12 -0
  346. package/es/table/utils/index.js +114 -178
  347. package/es/table/utils/useDragSort.d.ts +1 -1
  348. package/es/table/utils/useDragSort.js +99 -92
  349. package/es/table/utils/usePageInfo.d.ts +6 -0
  350. package/es/table/utils/usePageInfo.js +55 -0
  351. package/es/utils/components/DropdownFooter/index.js +23 -21
  352. package/es/utils/components/DropdownFooter/style.d.ts +1 -1
  353. package/es/utils/components/DropdownFooter/style.js +16 -15
  354. package/es/utils/components/ErrorBoundary/index.js +27 -50
  355. package/es/utils/components/FieldLabel/index.js +70 -70
  356. package/es/utils/components/FieldLabel/style.d.ts +1 -1
  357. package/es/utils/components/FieldLabel/style.js +104 -81
  358. package/es/utils/components/FilterDropdown/index.d.ts +11 -0
  359. package/es/utils/components/FilterDropdown/index.js +43 -32
  360. package/es/utils/components/FilterDropdown/style.d.ts +1 -1
  361. package/es/utils/components/FilterDropdown/style.js +19 -16
  362. package/es/utils/components/InlineErrorFormItem/index.js +78 -78
  363. package/es/utils/components/InlineErrorFormItem/style.d.ts +1 -1
  364. package/es/utils/components/InlineErrorFormItem/style.js +56 -49
  365. package/es/utils/components/LabelIconTip/index.js +30 -31
  366. package/es/utils/components/LabelIconTip/style.d.ts +1 -1
  367. package/es/utils/components/LabelIconTip/style.js +36 -35
  368. package/es/utils/components/ProFormContext/index.js +1 -1
  369. package/es/utils/conversionMomentValue/index.js +19 -22
  370. package/es/utils/dateArrayFormatter/index.js +9 -14
  371. package/es/utils/genCopyable/index.js +74 -32
  372. package/es/utils/getFieldPropsOrFormItemProps/index.js +1 -1
  373. package/es/utils/hooks/useDebounceFn/index.js +18 -51
  374. package/es/utils/hooks/useDebounceValue/index.js +7 -16
  375. package/es/utils/hooks/useDeepCompareEffect/index.js +6 -18
  376. package/es/utils/hooks/useDocumentTitle/index.js +2 -2
  377. package/es/utils/hooks/useFetchData/index.js +36 -65
  378. package/es/utils/hooks/useForceRender/index.js +2 -9
  379. package/es/utils/hooks/useLatest/index.js +2 -2
  380. package/es/utils/hooks/usePrevious/index.js +3 -3
  381. package/es/utils/hooks/useReactiveRef/index.js +2 -2
  382. package/es/utils/hooks/useRefCallback/index.js +3 -3
  383. package/es/utils/hooks/useRefFunction/index.js +4 -9
  384. package/es/utils/index.d.ts +1 -2
  385. package/es/utils/index.js +1 -2
  386. package/es/utils/isBrowser/index.js +2 -2
  387. package/es/utils/isDeepEqualReact/index.js +9 -44
  388. package/es/utils/isDropdownValueType/index.js +2 -2
  389. package/es/utils/isNil/index.js +1 -3
  390. package/es/utils/isUrl/index.js +2 -2
  391. package/es/utils/merge/index.js +10 -12
  392. package/es/utils/nanoid/index.js +5 -6
  393. package/es/utils/omitBoolean/index.js +1 -1
  394. package/es/utils/omitUndefined/index.js +3 -3
  395. package/es/utils/omitUndefinedAndEmptyArr/index.js +4 -5
  396. package/es/utils/parseValueToMoment/index.js +3 -7
  397. package/es/utils/pickProFormItemProps/index.js +3 -3
  398. package/es/utils/pickProProps/index.js +6 -7
  399. package/es/utils/proFieldParsingText/index.js +86 -99
  400. package/es/utils/runFunction/index.js +2 -5
  401. package/es/utils/stringify/index.js +1 -1
  402. package/es/utils/transformKeySubmitValue/index.js +99 -116
  403. package/es/utils/typing.d.ts +1 -1
  404. package/es/utils/useEditableArray/index.d.ts +9 -7
  405. package/es/utils/useEditableArray/index.js +788 -700
  406. package/es/utils/useEditableMap/index.d.ts +1 -1
  407. package/es/utils/useEditableMap/index.js +148 -137
  408. package/es/utils/useMediaQuery/index.js +16 -18
  409. package/es/utils/useMediaQuery/query.js +15 -19
  410. package/es/version.js +1 -1
  411. package/lib/card/ProCard.js +7 -7
  412. package/lib/card/components/Actions/index.js +25 -25
  413. package/lib/card/components/Actions/style.d.ts +1 -1
  414. package/lib/card/components/Actions/style.js +79 -72
  415. package/lib/card/components/Card/index.js +157 -138
  416. package/lib/card/components/Card/style.d.ts +1 -1
  417. package/lib/card/components/Card/style.js +249 -193
  418. package/lib/card/components/CheckCard/Group.js +97 -115
  419. package/lib/card/components/CheckCard/index.d.ts +6 -0
  420. package/lib/card/components/CheckCard/index.js +85 -77
  421. package/lib/card/components/CheckCard/style.d.ts +1 -1
  422. package/lib/card/components/CheckCard/style.js +184 -169
  423. package/lib/card/components/Divider/index.js +20 -16
  424. package/lib/card/components/Divider/style.d.ts +1 -1
  425. package/lib/card/components/Divider/style.js +32 -30
  426. package/lib/card/components/Loading/index.js +19 -16
  427. package/lib/card/components/Loading/style.d.ts +1 -1
  428. package/lib/card/components/Loading/style.js +34 -32
  429. package/lib/card/components/Operation/index.js +16 -14
  430. package/lib/card/components/Operation/style.d.ts +1 -1
  431. package/lib/card/components/Operation/style.js +19 -19
  432. package/lib/card/components/Statistic/index.js +46 -42
  433. package/lib/card/components/Statistic/style.d.ts +1 -1
  434. package/lib/card/components/Statistic/style.js +89 -71
  435. package/lib/card/components/StatisticCard/index.js +45 -38
  436. package/lib/card/components/StatisticCard/style.d.ts +1 -1
  437. package/lib/card/components/StatisticCard/style.js +37 -36
  438. package/lib/card/index.js +4 -4
  439. package/lib/card/typing.d.ts +5 -0
  440. package/lib/descriptions/index.js +219 -225
  441. package/lib/descriptions/useFetchData.js +51 -90
  442. package/lib/field/AllProField.js +267 -217
  443. package/lib/field/FieldHOC/index.js +9 -15
  444. package/lib/field/PureProField.js +84 -82
  445. package/lib/field/ValueTypeToComponent.js +517 -618
  446. package/lib/field/components/Cascader/index.d.ts +2 -3
  447. package/lib/field/components/Cascader/index.js +65 -85
  448. package/lib/field/components/Checkbox/index.d.ts +1 -2
  449. package/lib/field/components/Checkbox/index.js +75 -73
  450. package/lib/field/components/Code/index.js +40 -39
  451. package/lib/field/components/ColorPicker/index.js +38 -33
  452. package/lib/field/components/DatePicker/index.d.ts +1 -1
  453. package/lib/field/components/DatePicker/index.js +49 -53
  454. package/lib/field/components/Digit/index.js +41 -43
  455. package/lib/field/components/DigitRange/index.js +69 -76
  456. package/lib/field/components/FromNow/index.js +27 -25
  457. package/lib/field/components/Image/index.js +28 -24
  458. package/lib/field/components/IndexColumn/index.js +22 -17
  459. package/lib/field/components/Money/index.js +106 -116
  460. package/lib/field/components/Options/index.js +34 -34
  461. package/lib/field/components/Password/index.js +35 -38
  462. package/lib/field/components/Percent/index.js +40 -45
  463. package/lib/field/components/Percent/util.js +3 -6
  464. package/lib/field/components/Progress/index.js +29 -28
  465. package/lib/field/components/Radio/index.d.ts +1 -2
  466. package/lib/field/components/Radio/index.js +61 -63
  467. package/lib/field/components/RangePicker/index.d.ts +1 -1
  468. package/lib/field/components/RangePicker/index.js +52 -63
  469. package/lib/field/components/Rate/index.js +24 -21
  470. package/lib/field/components/Second/index.js +36 -33
  471. package/lib/field/components/Segmented/index.d.ts +1 -2
  472. package/lib/field/components/Segmented/index.js +37 -48
  473. package/lib/field/components/Select/LightSelect/index.d.ts +1 -1
  474. package/lib/field/components/Select/LightSelect/index.js +103 -111
  475. package/lib/field/components/Select/SearchSelect/index.d.ts +6 -1
  476. package/lib/field/components/Select/SearchSelect/index.js +193 -130
  477. package/lib/field/components/Select/index.d.ts +1 -4
  478. package/lib/field/components/Select/index.js +198 -220
  479. package/lib/field/components/Slider/index.js +25 -22
  480. package/lib/field/components/Status/index.js +69 -79
  481. package/lib/field/components/Switch/index.d.ts +1 -1
  482. package/lib/field/components/Switch/index.js +32 -31
  483. package/lib/field/components/Text/index.js +34 -38
  484. package/lib/field/components/TextArea/index.js +26 -21
  485. package/lib/field/components/TextArea/readonly.js +24 -22
  486. package/lib/field/components/TimePicker/index.js +96 -105
  487. package/lib/field/components/TreeSelect/index.d.ts +2 -3
  488. package/lib/field/components/TreeSelect/index.js +105 -124
  489. package/lib/field/index.js +34 -34
  490. package/lib/form/BaseForm/BaseForm.d.ts +3 -0
  491. package/lib/form/BaseForm/BaseForm.js +415 -495
  492. package/lib/form/BaseForm/EditOrReadOnlyContext.js +1 -1
  493. package/lib/form/BaseForm/LightWrapper/index.js +57 -66
  494. package/lib/form/BaseForm/LightWrapper/style.d.ts +1 -1
  495. package/lib/form/BaseForm/LightWrapper/style.js +17 -14
  496. package/lib/form/BaseForm/Submitter/index.js +44 -44
  497. package/lib/form/BaseForm/index.js +3 -3
  498. package/lib/form/FieldContext.js +1 -1
  499. package/lib/form/components/Captcha/index.d.ts +8 -2
  500. package/lib/form/components/Captcha/index.js +76 -129
  501. package/lib/form/components/Cascader/index.js +26 -29
  502. package/lib/form/components/Checkbox/index.js +60 -61
  503. package/lib/form/components/ColorPicker/index.js +24 -26
  504. package/lib/form/components/DatePicker/BaseDatePicker.js +32 -30
  505. package/lib/form/components/DatePicker/DatePicker.js +14 -13
  506. package/lib/form/components/DatePicker/DateTimePicker.js +11 -12
  507. package/lib/form/components/DatePicker/MonthPicker.js +14 -13
  508. package/lib/form/components/DatePicker/QuarterPicker.js +14 -13
  509. package/lib/form/components/DatePicker/TimePicker.js +26 -27
  510. package/lib/form/components/DatePicker/WeekPicker.js +14 -13
  511. package/lib/form/components/DatePicker/YearPicker.js +14 -13
  512. package/lib/form/components/DatePicker/index.js +1 -1
  513. package/lib/form/components/DateRangePicker/BaseDateRanger.js +34 -34
  514. package/lib/form/components/DateRangePicker/DateMonthRangePicker.js +15 -16
  515. package/lib/form/components/DateRangePicker/DateQuarterRangePicker.js +15 -16
  516. package/lib/form/components/DateRangePicker/DateTimeRangePicker.js +15 -16
  517. package/lib/form/components/DateRangePicker/DateWeekRangePicker.js +15 -16
  518. package/lib/form/components/DateRangePicker/DateYearRangePicker.js +15 -16
  519. package/lib/form/components/DateRangePicker/TimeRangePicker.js +26 -29
  520. package/lib/form/components/DateRangePicker/index.js +15 -16
  521. package/lib/form/components/Dependency/index.js +31 -35
  522. package/lib/form/components/Digit/DigitRange.js +23 -24
  523. package/lib/form/components/Digit/index.js +27 -29
  524. package/lib/form/components/Field/index.js +55 -63
  525. package/lib/form/components/FieldSet/index.js +68 -76
  526. package/lib/form/components/FormItem/FormItemRender/index.js +58 -48
  527. package/lib/form/components/FormItem/Group/index.js +95 -95
  528. package/lib/form/components/FormItem/Group/style.d.ts +1 -1
  529. package/lib/form/components/FormItem/Group/style.js +46 -41
  530. package/lib/form/components/FormItem/index.js +135 -141
  531. package/lib/form/components/FormItem/warpField.js +165 -149
  532. package/lib/form/components/List/ListContainer.js +100 -191
  533. package/lib/form/components/List/ListItem.js +153 -200
  534. package/lib/form/components/List/index.d.ts +1 -1
  535. package/lib/form/components/List/index.js +97 -107
  536. package/lib/form/components/List/style.d.ts +1 -1
  537. package/lib/form/components/List/style.js +71 -48
  538. package/lib/form/components/Money/index.js +28 -30
  539. package/lib/form/components/Radio/index.js +45 -49
  540. package/lib/form/components/Rate/index.js +17 -21
  541. package/lib/form/components/SchemaForm/index.js +54 -68
  542. package/lib/form/components/SchemaForm/layoutType/Embed.js +5 -6
  543. package/lib/form/components/SchemaForm/layoutType/StepsForm.js +22 -26
  544. package/lib/form/components/SchemaForm/layoutType/index.js +2 -2
  545. package/lib/form/components/SchemaForm/valueType/dependency.js +13 -12
  546. package/lib/form/components/SchemaForm/valueType/divider.js +6 -7
  547. package/lib/form/components/SchemaForm/valueType/field.js +47 -45
  548. package/lib/form/components/SchemaForm/valueType/formList.js +10 -9
  549. package/lib/form/components/SchemaForm/valueType/formSet.js +10 -8
  550. package/lib/form/components/SchemaForm/valueType/group.js +9 -10
  551. package/lib/form/components/SchemaForm/valueType/ignore.js +4 -3
  552. package/lib/form/components/SchemaForm/valueType/index.js +7 -6
  553. package/lib/form/components/Segmented/index.js +20 -24
  554. package/lib/form/components/Select/index.js +69 -73
  555. package/lib/form/components/Slider/index.js +33 -35
  556. package/lib/form/components/Switch/index.js +24 -26
  557. package/lib/form/components/Text/index.js +77 -86
  558. package/lib/form/components/TextArea/index.js +17 -21
  559. package/lib/form/components/TreeSelect/index.js +20 -23
  560. package/lib/form/components/UploadButton/index.js +56 -103
  561. package/lib/form/components/UploadDragger/index.js +37 -44
  562. package/lib/form/components/index.js +42 -42
  563. package/lib/form/helpers/grid.js +68 -69
  564. package/lib/form/helpers/index.js +1 -1
  565. package/lib/form/index.d.ts +1 -0
  566. package/lib/form/index.js +8 -8
  567. package/lib/form/layouts/DrawerForm/index.d.ts +1 -1
  568. package/lib/form/layouts/DrawerForm/index.js +151 -242
  569. package/lib/form/layouts/DrawerForm/style.d.ts +1 -1
  570. package/lib/form/layouts/DrawerForm/style.js +26 -26
  571. package/lib/form/layouts/LightFilter/index.d.ts +12 -1
  572. package/lib/form/layouts/LightFilter/index.js +158 -141
  573. package/lib/form/layouts/LightFilter/style.d.ts +1 -1
  574. package/lib/form/layouts/LightFilter/style.js +52 -49
  575. package/lib/form/layouts/LoginForm/index.d.ts +1 -1
  576. package/lib/form/layouts/LoginForm/index.js +44 -48
  577. package/lib/form/layouts/LoginForm/style.d.ts +1 -1
  578. package/lib/form/layouts/LoginForm/style.js +71 -68
  579. package/lib/form/layouts/LoginFormPage/index.d.ts +1 -1
  580. package/lib/form/layouts/LoginFormPage/index.js +45 -49
  581. package/lib/form/layouts/LoginFormPage/style.d.ts +1 -1
  582. package/lib/form/layouts/LoginFormPage/style.js +136 -127
  583. package/lib/form/layouts/ModalForm/index.js +119 -203
  584. package/lib/form/layouts/ProForm/index.d.ts +1 -1
  585. package/lib/form/layouts/ProForm/index.js +5 -5
  586. package/lib/form/layouts/QueryFilter/Actions.js +23 -22
  587. package/lib/form/layouts/QueryFilter/index.d.ts +2 -1
  588. package/lib/form/layouts/QueryFilter/index.js +177 -202
  589. package/lib/form/layouts/QueryFilter/style.d.ts +1 -1
  590. package/lib/form/layouts/QueryFilter/style.js +45 -38
  591. package/lib/form/layouts/StepsForm/StepForm.d.ts +2 -3
  592. package/lib/form/layouts/StepsForm/StepForm.js +50 -72
  593. package/lib/form/layouts/StepsForm/index.js +186 -215
  594. package/lib/form/layouts/StepsForm/style.d.ts +1 -1
  595. package/lib/form/layouts/StepsForm/style.js +30 -29
  596. package/lib/form/layouts/index.js +9 -9
  597. package/lib/index.js +11 -11
  598. package/lib/layout/ProLayout.js +281 -292
  599. package/lib/layout/WrapContent.js +18 -14
  600. package/lib/layout/assert/Logo.js +96 -97
  601. package/lib/layout/components/AppsLogoComponents/AppsLogo.js +11 -12
  602. package/lib/layout/components/AppsLogoComponents/DefaultContent.js +19 -17
  603. package/lib/layout/components/AppsLogoComponents/SimpleContent.js +22 -19
  604. package/lib/layout/components/AppsLogoComponents/index.js +37 -39
  605. package/lib/layout/components/AppsLogoComponents/style/default.js +4 -3
  606. package/lib/layout/components/AppsLogoComponents/style/index.d.ts +1 -1
  607. package/lib/layout/components/AppsLogoComponents/style/index.js +52 -51
  608. package/lib/layout/components/AppsLogoComponents/style/simple.js +3 -2
  609. package/lib/layout/components/CollapsedIcon/index.js +20 -17
  610. package/lib/layout/components/CollapsedIcon/style.d.ts +1 -1
  611. package/lib/layout/components/CollapsedIcon/style.js +40 -41
  612. package/lib/layout/components/Footer.js +23 -22
  613. package/lib/layout/components/FooterToolbar/index.js +59 -53
  614. package/lib/layout/components/FooterToolbar/style/index.d.ts +1 -1
  615. package/lib/layout/components/FooterToolbar/style/index.js +38 -38
  616. package/lib/layout/components/FooterToolbar/style/stylish.d.ts +1 -1
  617. package/lib/layout/components/FooterToolbar/style/stylish.js +11 -10
  618. package/lib/layout/components/GlobalFooter/index.d.ts +1 -1
  619. package/lib/layout/components/GlobalFooter/index.js +27 -27
  620. package/lib/layout/components/GlobalFooter/style.d.ts +1 -1
  621. package/lib/layout/components/GlobalFooter/style.js +31 -31
  622. package/lib/layout/components/GlobalHeader/ActionsContent.js +65 -81
  623. package/lib/layout/components/GlobalHeader/index.js +61 -49
  624. package/lib/layout/components/GlobalHeader/rightContentStyle.d.ts +1 -1
  625. package/lib/layout/components/GlobalHeader/rightContentStyle.js +49 -50
  626. package/lib/layout/components/GlobalHeader/style.d.ts +1 -1
  627. package/lib/layout/components/GlobalHeader/style.js +58 -55
  628. package/lib/layout/components/GridContent/index.js +26 -21
  629. package/lib/layout/components/GridContent/style.d.ts +1 -1
  630. package/lib/layout/components/GridContent/style.js +14 -14
  631. package/lib/layout/components/Header/index.js +65 -59
  632. package/lib/layout/components/Header/style/header.d.ts +1 -1
  633. package/lib/layout/components/Header/style/header.js +49 -48
  634. package/lib/layout/components/Header/style/stylish.d.ts +1 -1
  635. package/lib/layout/components/Header/style/stylish.js +15 -12
  636. package/lib/layout/components/Help/AsyncContentPanel.js +15 -20
  637. package/lib/layout/components/Help/HelpProvide.js +1 -1
  638. package/lib/layout/components/Help/ProHelpContentPanel.js +66 -85
  639. package/lib/layout/components/Help/ProHelpDrawer.d.ts +1 -1
  640. package/lib/layout/components/Help/ProHelpDrawer.js +27 -30
  641. package/lib/layout/components/Help/ProHelpModal.d.ts +1 -1
  642. package/lib/layout/components/Help/ProHelpModal.js +26 -28
  643. package/lib/layout/components/Help/ProHelpPanel.js +86 -94
  644. package/lib/layout/components/Help/ProHelpPopover.js +21 -19
  645. package/lib/layout/components/Help/RenderContentPanel.js +36 -26
  646. package/lib/layout/components/Help/Search.js +55 -80
  647. package/lib/layout/components/Help/index.js +19 -20
  648. package/lib/layout/components/Help/style.d.ts +1 -1
  649. package/lib/layout/components/Help/style.js +82 -76
  650. package/lib/layout/components/PageContainer/index.js +172 -151
  651. package/lib/layout/components/PageContainer/style/index.d.ts +1 -1
  652. package/lib/layout/components/PageContainer/style/index.js +95 -79
  653. package/lib/layout/components/PageContainer/style/stylish.d.ts +1 -1
  654. package/lib/layout/components/PageContainer/style/stylish.js +11 -10
  655. package/lib/layout/components/PageHeader/index.js +99 -99
  656. package/lib/layout/components/PageHeader/style/index.d.ts +1 -1
  657. package/lib/layout/components/PageHeader/style/index.js +142 -123
  658. package/lib/layout/components/PageLoading/index.js +18 -20
  659. package/lib/layout/components/SettingDrawer/BlockCheckbox.js +31 -34
  660. package/lib/layout/components/SettingDrawer/LayoutChange.js +25 -23
  661. package/lib/layout/components/SettingDrawer/RegionalChange.js +16 -16
  662. package/lib/layout/components/SettingDrawer/ThemeColor.js +34 -36
  663. package/lib/layout/components/SettingDrawer/index.js +140 -170
  664. package/lib/layout/components/SettingDrawer/style/index.d.ts +1 -1
  665. package/lib/layout/components/SettingDrawer/style/index.js +141 -138
  666. package/lib/layout/components/SiderMenu/BaseMenu.d.ts +1 -1
  667. package/lib/layout/components/SiderMenu/BaseMenu.js +236 -222
  668. package/lib/layout/components/SiderMenu/SiderMenu.js +130 -119
  669. package/lib/layout/components/SiderMenu/index.js +53 -45
  670. package/lib/layout/components/SiderMenu/style/index.d.ts +1 -1
  671. package/lib/layout/components/SiderMenu/style/index.js +179 -162
  672. package/lib/layout/components/SiderMenu/style/menu.d.ts +1 -1
  673. package/lib/layout/components/SiderMenu/style/menu.js +148 -111
  674. package/lib/layout/components/SiderMenu/style/stylish.d.ts +1 -1
  675. package/lib/layout/components/SiderMenu/style/stylish.js +15 -12
  676. package/lib/layout/components/TopNavHeader/index.js +73 -62
  677. package/lib/layout/components/TopNavHeader/style.d.ts +1 -1
  678. package/lib/layout/components/TopNavHeader/style.js +64 -64
  679. package/lib/layout/context/RouteContext.js +1 -1
  680. package/lib/layout/defaultSettings.d.ts +6 -0
  681. package/lib/layout/defaultSettings.js +1 -1
  682. package/lib/layout/getPageTitle.js +27 -26
  683. package/lib/layout/index.js +16 -16
  684. package/lib/layout/locales/en-US.js +3 -2
  685. package/lib/layout/locales/index.js +8 -6
  686. package/lib/layout/locales/it-IT.js +3 -2
  687. package/lib/layout/locales/ko-KR.js +3 -2
  688. package/lib/layout/locales/zh-CN.js +3 -2
  689. package/lib/layout/locales/zh-TW.js +3 -2
  690. package/lib/layout/style/index.d.ts +1 -1
  691. package/lib/layout/style/index.js +48 -43
  692. package/lib/layout/utils/getBreadcrumbProps.js +65 -62
  693. package/lib/layout/utils/getMenuData.js +9 -13
  694. package/lib/layout/utils/pathTools.js +2 -6
  695. package/lib/layout/utils/useCurrentMenuLayoutProps.js +6 -11
  696. package/lib/layout/utils/utils.js +16 -18
  697. package/lib/list/Item.js +155 -136
  698. package/lib/list/ListView.js +110 -119
  699. package/lib/list/constants.js +2 -2
  700. package/lib/list/index.js +72 -70
  701. package/lib/list/style/index.d.ts +1 -1
  702. package/lib/list/style/index.js +281 -214
  703. package/lib/provider/index.d.ts +1 -0
  704. package/lib/provider/index.js +132 -117
  705. package/lib/provider/intl.js +56 -56
  706. package/lib/provider/typing/layoutToken.js +28 -25
  707. package/lib/provider/useStyle/index.d.ts +2 -1
  708. package/lib/provider/useStyle/index.js +64 -61
  709. package/lib/provider/utils/merge.js +12 -14
  710. package/lib/skeleton/components/Descriptions/index.js +213 -229
  711. package/lib/skeleton/components/List/index.js +211 -221
  712. package/lib/skeleton/components/Result/index.js +45 -47
  713. package/lib/skeleton/index.js +23 -19
  714. package/lib/table/Store/Provide.d.ts +4 -4
  715. package/lib/table/Store/Provide.js +103 -117
  716. package/lib/table/Table.d.ts +5 -2
  717. package/lib/table/Table.js +592 -602
  718. package/lib/table/TableSearch.d.ts +24 -0
  719. package/lib/table/TableSearch.js +61 -0
  720. package/lib/table/TableToolbar.d.ts +22 -0
  721. package/lib/table/TableToolbar.js +55 -0
  722. package/lib/table/components/Alert/index.d.ts +1 -1
  723. package/lib/table/components/Alert/index.js +41 -40
  724. package/lib/table/components/Alert/style.d.ts +1 -1
  725. package/lib/table/components/Alert/style.js +28 -28
  726. package/lib/table/components/ColumnSetting/index.d.ts +1 -1
  727. package/lib/table/components/ColumnSetting/index.js +230 -224
  728. package/lib/table/components/ColumnSetting/style.d.ts +1 -1
  729. package/lib/table/components/ColumnSetting/style.js +86 -72
  730. package/lib/table/components/DragSortTable/index.d.ts +1 -1
  731. package/lib/table/components/DragSortTable/index.js +64 -78
  732. package/lib/table/components/DragSortTable/style.d.ts +1 -1
  733. package/lib/table/components/DragSortTable/style.js +20 -20
  734. package/lib/table/components/Dropdown/index.js +42 -48
  735. package/lib/table/components/EditableTable/CellEditorTable.js +24 -32
  736. package/lib/table/components/EditableTable/RowEditorTable.js +23 -28
  737. package/lib/table/components/EditableTable/index.js +598 -299
  738. package/lib/table/components/Form/FormRender.js +99 -104
  739. package/lib/table/components/Form/index.d.ts +4 -19
  740. package/lib/table/components/Form/index.js +113 -159
  741. package/lib/table/components/ListToolBar/HeaderMenu.js +42 -51
  742. package/lib/table/components/ListToolBar/index.js +123 -148
  743. package/lib/table/components/ListToolBar/style.d.ts +1 -1
  744. package/lib/table/components/ListToolBar/style.js +127 -118
  745. package/lib/table/components/ToolBar/DensityIcon.js +10 -9
  746. package/lib/table/components/ToolBar/FullscreenIcon.js +5 -10
  747. package/lib/table/components/ToolBar/index.d.ts +2 -8
  748. package/lib/table/components/ToolBar/index.js +154 -194
  749. package/lib/table/index.js +27 -27
  750. package/lib/table/style/index.d.ts +1 -1
  751. package/lib/table/style/index.js +144 -113
  752. package/lib/table/typing.d.ts +13 -6
  753. package/lib/table/useFetchData.js +202 -347
  754. package/lib/table/utils/cellRenderToFromItem.js +106 -120
  755. package/lib/table/utils/columnRender.js +65 -54
  756. package/lib/table/utils/columnSort.js +24 -23
  757. package/lib/table/utils/genProColumnToColumn.d.ts +13 -9
  758. package/lib/table/utils/genProColumnToColumn.js +121 -99
  759. package/lib/table/utils/index.d.ts +12 -0
  760. package/lib/table/utils/index.js +129 -181
  761. package/lib/table/utils/useDragSort.d.ts +1 -1
  762. package/lib/table/utils/useDragSort.js +99 -93
  763. package/lib/table/utils/usePageInfo.d.ts +6 -0
  764. package/lib/table/utils/usePageInfo.js +61 -0
  765. package/lib/utils/components/DropdownFooter/index.js +25 -23
  766. package/lib/utils/components/DropdownFooter/style.d.ts +1 -1
  767. package/lib/utils/components/DropdownFooter/style.js +16 -16
  768. package/lib/utils/components/ErrorBoundary/index.js +28 -50
  769. package/lib/utils/components/FieldLabel/index.js +70 -71
  770. package/lib/utils/components/FieldLabel/style.d.ts +1 -1
  771. package/lib/utils/components/FieldLabel/style.js +104 -82
  772. package/lib/utils/components/FilterDropdown/index.d.ts +11 -0
  773. package/lib/utils/components/FilterDropdown/index.js +44 -33
  774. package/lib/utils/components/FilterDropdown/style.d.ts +1 -1
  775. package/lib/utils/components/FilterDropdown/style.js +19 -17
  776. package/lib/utils/components/InlineErrorFormItem/index.js +80 -80
  777. package/lib/utils/components/InlineErrorFormItem/style.d.ts +1 -1
  778. package/lib/utils/components/InlineErrorFormItem/style.js +56 -50
  779. package/lib/utils/components/LabelIconTip/index.js +30 -32
  780. package/lib/utils/components/LabelIconTip/style.d.ts +1 -1
  781. package/lib/utils/components/LabelIconTip/style.js +36 -36
  782. package/lib/utils/components/ProFormContext/index.js +1 -1
  783. package/lib/utils/conversionMomentValue/index.js +22 -23
  784. package/lib/utils/dateArrayFormatter/index.js +11 -15
  785. package/lib/utils/genCopyable/index.js +75 -33
  786. package/lib/utils/getFieldPropsOrFormItemProps/index.js +3 -2
  787. package/lib/utils/hooks/useDebounceFn/index.js +18 -52
  788. package/lib/utils/hooks/useDebounceValue/index.js +7 -17
  789. package/lib/utils/hooks/useDeepCompareEffect/index.js +7 -19
  790. package/lib/utils/hooks/useDocumentTitle/index.js +2 -2
  791. package/lib/utils/hooks/useFetchData/index.js +36 -65
  792. package/lib/utils/hooks/useForceRender/index.js +2 -10
  793. package/lib/utils/hooks/useLatest/index.js +4 -3
  794. package/lib/utils/hooks/usePrevious/index.js +5 -4
  795. package/lib/utils/hooks/useReactiveRef/index.js +2 -2
  796. package/lib/utils/hooks/useRefCallback/index.js +3 -3
  797. package/lib/utils/hooks/useRefFunction/index.js +6 -11
  798. package/lib/utils/index.d.ts +1 -2
  799. package/lib/utils/index.js +57 -65
  800. package/lib/utils/isBrowser/index.js +4 -3
  801. package/lib/utils/isDeepEqualReact/index.js +9 -45
  802. package/lib/utils/isDropdownValueType/index.js +4 -3
  803. package/lib/utils/isNil/index.js +2 -3
  804. package/lib/utils/isUrl/index.js +4 -3
  805. package/lib/utils/merge/index.js +12 -14
  806. package/lib/utils/nanoid/index.js +7 -7
  807. package/lib/utils/omitBoolean/index.js +3 -2
  808. package/lib/utils/omitUndefined/index.js +5 -4
  809. package/lib/utils/omitUndefinedAndEmptyArr/index.js +6 -6
  810. package/lib/utils/parseValueToMoment/index.js +5 -8
  811. package/lib/utils/pickProFormItemProps/index.js +3 -3
  812. package/lib/utils/pickProProps/index.js +6 -7
  813. package/lib/utils/proFieldParsingText/index.js +90 -100
  814. package/lib/utils/runFunction/index.js +2 -5
  815. package/lib/utils/stringify/index.js +2 -2
  816. package/lib/utils/transformKeySubmitValue/index.js +101 -117
  817. package/lib/utils/typing.d.ts +1 -1
  818. package/lib/utils/useEditableArray/index.d.ts +9 -7
  819. package/lib/utils/useEditableArray/index.js +791 -700
  820. package/lib/utils/useEditableMap/index.d.ts +1 -1
  821. package/lib/utils/useEditableMap/index.js +147 -137
  822. package/lib/utils/useMediaQuery/index.js +19 -19
  823. package/lib/utils/useMediaQuery/query.js +14 -19
  824. package/lib/version.js +1 -1
  825. package/package.json +34 -45
  826. package/es/utils/useMountMergeState/index.d.ts +0 -2
  827. package/es/utils/useMountMergeState/index.js +0 -2
  828. package/lib/utils/useMountMergeState/index.d.ts +0 -2
  829. package/lib/utils/useMountMergeState/index.js +0 -12
@@ -1,67 +1,227 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
5
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
6
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
7
- var _excluded = ["onTableChange", "maxLength", "formItemProps", "recordCreatorProps", "rowKey", "controlled", "defaultValue", "onChange", "editableFormRef"],
8
- _excluded2 = ["record", "position", "creatorButtonText", "newRecordType", "parentKey", "style"];
9
1
  import { PlusOutlined } from '@ant-design/icons';
10
- import { get, set, useMergedState } from '@rc-component/util';
2
+ import { get, set, useControlledState } from '@rc-component/util';
11
3
  import { Button, Form } from 'antd';
12
- import React, { useContext, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
4
+ import React, { useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
13
5
  import ProForm, { ProFormDependency } from "../../../form";
14
6
  import { useIntl } from "../../../provider";
15
- import { isDeepEqualReact, runFunction, stringify, useRefFunction } from "../../../utils";
7
+ import { isDeepEqualReact, runFunction, useDeepCompareEffect, useRefFunction } from "../../../utils";
8
+ import { editableRowByKey, recordKeyToString } from "../../../utils/useEditableArray";
16
9
  import ProTable from "../../Table";
17
10
  import { jsx as _jsx } from "react/jsx-runtime";
18
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
12
  import { Fragment as _Fragment } from "react/jsx-runtime";
20
- var EditableTableActionContext = /*#__PURE__*/React.createContext(undefined);
13
+ const EditableTableActionContext = /*#__PURE__*/React.createContext(undefined);
21
14
 
22
15
  /** 可编辑表格的按钮 */
23
16
  function RecordCreator(props) {
24
- var children = props.children,
25
- record = props.record,
26
- position = props.position,
27
- newRecordType = props.newRecordType,
28
- parentKey = props.parentKey;
29
- var actionRef = useContext(EditableTableActionContext);
30
- return /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, {
31
- onClick: function () {
32
- var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
33
- var _children$props$onCli, _children$props, _actionRef$current;
34
- var isOk;
35
- return _regeneratorRuntime().wrap(function _callee$(_context) {
36
- while (1) switch (_context.prev = _context.next) {
37
- case 0:
38
- _context.next = 2;
39
- return (_children$props$onCli = (_children$props = children.props).onClick) === null || _children$props$onCli === void 0 ? void 0 : _children$props$onCli.call(_children$props, e);
40
- case 2:
41
- isOk = _context.sent;
42
- if (!(isOk === false)) {
43
- _context.next = 5;
44
- break;
45
- }
46
- return _context.abrupt("return");
47
- case 5:
48
- actionRef === null || actionRef === void 0 || (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 || _actionRef$current.addEditRecord(record, {
49
- position: position,
50
- newRecordType: newRecordType,
51
- parentKey: parentKey
52
- });
53
- case 6:
54
- case "end":
55
- return _context.stop();
56
- }
57
- }, _callee);
58
- }));
59
- function onClick(_x) {
60
- return _onClick.apply(this, arguments);
17
+ const {
18
+ children,
19
+ record,
20
+ position,
21
+ newRecordType,
22
+ parentKey
23
+ } = props;
24
+ const actionRef = useContext(EditableTableActionContext);
25
+ return /*#__PURE__*/React.cloneElement(children, {
26
+ ...children.props,
27
+ onClick: async e => {
28
+ // 如果返回了false,接触掉默认行为
29
+ const isOk = await children.props.onClick?.(e);
30
+ if (isOk === false) return;
31
+ if (actionRef?.current) {
32
+ actionRef.current.addEditRecord(record, {
33
+ position,
34
+ newRecordType,
35
+ parentKey: parentKey
36
+ });
61
37
  }
62
- return onClick;
63
- }()
64
- }));
38
+ }
39
+ });
40
+ }
41
+
42
+ /**
43
+ * 处理嵌套行的新增
44
+ */
45
+ function handleNestedRowInsert(baseData, defaultValue, newLineOptions, getRowKey, childrenColumnName) {
46
+ if (!newLineOptions.recordKey) {
47
+ return baseData;
48
+ }
49
+ const actionProps = {
50
+ data: baseData,
51
+ getRowKey,
52
+ row: {
53
+ ...defaultValue,
54
+ map_row_parentKey: recordKeyToString(newLineOptions.parentKey)?.toString()
55
+ },
56
+ key: newLineOptions.recordKey,
57
+ childrenColumnName
58
+ };
59
+ return editableRowByKey(actionProps, newLineOptions.position === 'top' ? 'top' : 'update');
60
+ }
61
+
62
+ /**
63
+ * 处理分页场景下的新增
64
+ */
65
+ function handlePaginationInsert(baseData, defaultValue, pageConfig) {
66
+ if (pageConfig.pageSize > baseData.length) {
67
+ return [...baseData, defaultValue];
68
+ }
69
+ const insertIndex = pageConfig.current * pageConfig.pageSize - 1;
70
+ const result = [...baseData];
71
+ result.splice(insertIndex, 0, defaultValue);
72
+ return result;
73
+ }
74
+ function useEditableDataSource({
75
+ actionDataSource,
76
+ editableUtils,
77
+ pagination,
78
+ getRowKey,
79
+ childrenColumnName
80
+ }) {
81
+ return useMemo(() => {
82
+ const newLineConfig = editableUtils?.newLineRecord;
83
+ const baseData = Array.isArray(actionDataSource) ? [...actionDataSource] : [];
84
+ if (!newLineConfig?.defaultValue) {
85
+ return baseData;
86
+ }
87
+ const {
88
+ options: newLineOptions,
89
+ defaultValue
90
+ } = newLineConfig;
91
+ if (newLineOptions?.parentKey) {
92
+ return handleNestedRowInsert(baseData, defaultValue, newLineOptions, getRowKey, childrenColumnName || 'children');
93
+ }
94
+ if (newLineOptions?.position === 'top') {
95
+ return [defaultValue, ...baseData];
96
+ }
97
+ const pageConfig = pagination && typeof pagination === 'object' ? pagination : undefined;
98
+ if (pageConfig?.current && pageConfig?.pageSize) {
99
+ return handlePaginationInsert(baseData, defaultValue, pageConfig);
100
+ }
101
+ return [...baseData, defaultValue];
102
+ }, [actionDataSource, childrenColumnName, editableUtils?.newLineRecord, getRowKey, pagination]);
103
+ }
104
+
105
+ /**
106
+ * 检查是否应该显示创建按钮
107
+ */
108
+ function shouldShowCreatorButton(maxLength, valueLength, recordCreatorProps) {
109
+ if (typeof maxLength === 'number' && maxLength <= valueLength) {
110
+ return false;
111
+ }
112
+ return recordCreatorProps !== false;
113
+ }
114
+
115
+ /**
116
+ * 创建按钮 DOM
117
+ */
118
+ function createButtonDom(recordCreatorProps, value, intl) {
119
+ const {
120
+ record,
121
+ position,
122
+ creatorButtonText,
123
+ newRecordType,
124
+ parentKey,
125
+ style,
126
+ ...restButtonProps
127
+ } = recordCreatorProps;
128
+ return /*#__PURE__*/_jsx(RecordCreator, {
129
+ record: runFunction(record, value?.length, value) || {},
130
+ position: position,
131
+ parentKey: runFunction(parentKey, value?.length, value),
132
+ newRecordType: newRecordType,
133
+ children: /*#__PURE__*/_jsx(Button, {
134
+ type: "dashed",
135
+ style: {
136
+ display: 'block',
137
+ margin: '10px 0',
138
+ width: '100%',
139
+ ...style
140
+ },
141
+ icon: /*#__PURE__*/_jsx(PlusOutlined, {}),
142
+ ...restButtonProps,
143
+ children: creatorButtonText || intl.getMessage('editableTable.action.add', '添加一行数据')
144
+ })
145
+ });
146
+ }
147
+
148
+ /**
149
+ * 创建顶部按钮的渲染属性
150
+ */
151
+ function createTopButtonProps(creatorButtonDom, columnsLength) {
152
+ return {
153
+ components: {
154
+ header: {
155
+ wrapper: ({
156
+ className,
157
+ children
158
+ }) => /*#__PURE__*/_jsxs("thead", {
159
+ className: className,
160
+ children: [children, /*#__PURE__*/_jsxs("tr", {
161
+ style: {
162
+ position: 'relative'
163
+ },
164
+ children: [/*#__PURE__*/_jsx("td", {
165
+ colSpan: 0,
166
+ style: {
167
+ visibility: 'hidden'
168
+ },
169
+ children: creatorButtonDom
170
+ }), /*#__PURE__*/_jsx("td", {
171
+ style: {
172
+ position: 'absolute',
173
+ left: 0,
174
+ width: '100%'
175
+ },
176
+ colSpan: columnsLength,
177
+ children: creatorButtonDom
178
+ })]
179
+ })]
180
+ })
181
+ }
182
+ }
183
+ };
184
+ }
185
+
186
+ /**
187
+ * 创建底部按钮的渲染属性
188
+ */
189
+ function createBottomButtonProps(creatorButtonDom, tableViewRender) {
190
+ return {
191
+ tableViewRender: (_, dom) => /*#__PURE__*/_jsxs(_Fragment, {
192
+ children: [tableViewRender?.(_, dom) ?? dom, creatorButtonDom]
193
+ })
194
+ };
195
+ }
196
+ function useCreatorButton({
197
+ recordCreatorProps,
198
+ maxLength,
199
+ value,
200
+ intl,
201
+ isTop,
202
+ columnsLength,
203
+ tableViewRender
204
+ }) {
205
+ const creatorButtonDom = useMemo(() => {
206
+ if (!shouldShowCreatorButton(maxLength, value?.length || 0, recordCreatorProps)) {
207
+ return false;
208
+ }
209
+ if (!recordCreatorProps) {
210
+ return false;
211
+ }
212
+ return createButtonDom(recordCreatorProps, value, intl);
213
+ // eslint-disable-next-line react-hooks/exhaustive-deps
214
+ }, [maxLength, recordCreatorProps, value?.length, intl]);
215
+ const buttonRenderProps = useMemo(() => {
216
+ if (!creatorButtonDom) {
217
+ return {};
218
+ }
219
+ return isTop ? createTopButtonProps(creatorButtonDom, columnsLength) : createBottomButtonProps(creatorButtonDom, tableViewRender);
220
+ }, [columnsLength, creatorButtonDom, isTop, tableViewRender]);
221
+ return {
222
+ creatorButtonDom,
223
+ buttonRenderProps
224
+ };
65
225
  }
66
226
 
67
227
  /**
@@ -70,294 +230,431 @@ function RecordCreator(props) {
70
230
  * @param props
71
231
  */
72
232
  function EditableTable(props) {
73
- var _props$editable2, _props$editable4;
74
- var intl = useIntl();
75
- var onTableChange = props.onTableChange,
76
- maxLength = props.maxLength,
77
- formItemProps = props.formItemProps,
78
- recordCreatorProps = props.recordCreatorProps,
79
- rowKey = props.rowKey,
80
- controlled = props.controlled,
81
- defaultValue = props.defaultValue,
82
- onChange = props.onChange,
83
- editableFormRef = props.editableFormRef,
84
- rest = _objectWithoutProperties(props, _excluded);
85
- var preData = useRef(undefined);
86
- var actionRef = useRef();
87
- var formRef = useRef();
233
+ const intl = useIntl();
234
+ const {
235
+ onTableChange,
236
+ maxLength,
237
+ formItemProps,
238
+ recordCreatorProps,
239
+ rowKey,
240
+ controlled,
241
+ defaultValue,
242
+ onChange,
243
+ editableFormRef,
244
+ // @ts-ignore
245
+ autoFocus,
246
+ ...rest
247
+ } = props;
248
+ const preData = useRef(undefined);
249
+ const actionRef = useRef();
250
+ const formRef = useRef();
251
+ const form = Form.useFormInstance();
88
252
 
89
253
  // 设置 ref
90
- useImperativeHandle(rest.actionRef, function () {
91
- return actionRef.current;
92
- }, [actionRef.current]);
93
- var _useMergedState = useMergedState(function () {
94
- return props.value || defaultValue || [];
95
- }, {
96
- value: props.value,
97
- onChange: props.onChange
98
- }),
99
- _useMergedState2 = _slicedToArray(_useMergedState, 2),
100
- value = _useMergedState2[0],
101
- setValue = _useMergedState2[1];
102
- var getRowKey = React.useMemo(function () {
254
+ useImperativeHandle(rest.actionRef, () => actionRef.current, [actionRef.current]);
255
+
256
+ // 在 name 模式下,如果没有传递 value prop,尝试从表单值中获取初始值
257
+ const getInitialValue = () => {
258
+ if (props.value) {
259
+ return props.value;
260
+ }
261
+ if (defaultValue) {
262
+ return defaultValue;
263
+ }
264
+ // 如果使用了 name 且没有 value,尝试从表单获取初始值
265
+ if (props.name && form) {
266
+ const namePath = [props.name].flat(1).filter(Boolean);
267
+ const formValue = form.getFieldValue(namePath);
268
+ if (Array.isArray(formValue)) {
269
+ return formValue;
270
+ }
271
+ }
272
+ return [];
273
+ };
274
+ const [value, setValueInner] = useControlledState(getInitialValue, props.value);
275
+ const onChangeFn = props.controlled ? props.onChange : undefined;
276
+ const setValue = useCallback(updater => {
277
+ setValueInner(prev => {
278
+ const next = typeof updater === 'function' ? updater(prev) : updater;
279
+ // 在非受控模式下,onChange 应该在 onDataSourceChange 中触发
280
+ onChangeFn?.(next);
281
+ return next;
282
+ });
283
+ }, [onChangeFn]);
284
+ const getRowKey = React.useMemo(() => {
103
285
  if (typeof rowKey === 'function') {
104
286
  return rowKey;
105
287
  }
106
- return function (record, index) {
107
- return record[rowKey] || index;
108
- };
288
+ return (record, index) => record[rowKey] || index;
109
289
  }, [rowKey]);
110
290
 
111
291
  /**
112
- * 根据不同的情况返回不同的 rowKey
113
- * @param finlayRowKey
114
- * @returns string | number
292
+ * 创建编辑 keys 的 Set,用于快速查找
115
293
  */
116
- var coverRowKey = useRefFunction(function (finlayRowKey) {
117
- /**
118
- * 如果是 prop.name 的模式,就需要把行号转化成具体的rowKey。
119
- */
120
- if (typeof finlayRowKey === 'number' && !props.name) {
121
- if (finlayRowKey >= value.length) return finlayRowKey;
122
- var rowData = value && value[finlayRowKey];
123
- return getRowKey === null || getRowKey === void 0 ? void 0 : getRowKey(rowData, finlayRowKey);
294
+ const createEditingKeysSet = useRefFunction(editingKeys => {
295
+ return new Set((editingKeys || []).map(key => String(key)));
296
+ });
297
+
298
+ /**
299
+ * 同步表单值,排除正在编辑的行
300
+ */
301
+ const syncFormValuesExcludingEditing = useRefFunction((dataSource, editingKeysSet, namePath) => {
302
+ if (!formRef.current) return;
303
+ try {
304
+ if (namePath && namePath.length > 0) {
305
+ // name 模式:需要保留正在编辑的行
306
+ const currentFormValues = formRef.current.getFieldsValue() || {};
307
+ const currentList = get(currentFormValues, namePath);
308
+ if (currentList && Array.isArray(currentList)) {
309
+ // 构建新的表单值,保留正在编辑的行
310
+ // 使用 Map 优化查找性能,将 O(n²) 降低到 O(n)
311
+ const currentListMap = new Map();
312
+ currentList.forEach((item, idx) => {
313
+ const key = getRowKey(item, idx);
314
+ currentListMap.set(String(key), item);
315
+ });
316
+ const newList = dataSource.map((item, index) => {
317
+ const key = getRowKey(item, index);
318
+ const keyStr = String(key);
319
+
320
+ // 如果该行正在编辑,保留表单中的值
321
+ if (editingKeysSet.has(keyStr)) {
322
+ return currentListMap.get(keyStr) || item;
323
+ }
324
+ return item;
325
+ });
326
+ const newValue = set({}, namePath, newList);
327
+ formRef.current.setFieldsValue(newValue);
328
+ } else {
329
+ const newValue = set({}, namePath, dataSource);
330
+ formRef.current.setFieldsValue(newValue);
331
+ }
332
+ } else {
333
+ // 非 name 模式:直接设置值
334
+ const formValues = {};
335
+ dataSource.forEach((current, index) => {
336
+ const key = getRowKey(current, index);
337
+ const keyStr = String(key);
338
+ if (!editingKeysSet.has(keyStr)) {
339
+ formValues[keyStr] = current;
340
+ }
341
+ });
342
+ if (Object.keys(formValues).length > 0) {
343
+ formRef.current.setFieldsValue(formValues);
344
+ }
345
+ }
346
+ } catch (error) {
347
+ console.warn('Failed to sync form values:', error);
124
348
  }
349
+ });
125
350
 
126
- /**
127
- * 如果是 prop.name 的模式,就直接返回行号
128
- */
129
- if ((typeof finlayRowKey === 'string' || finlayRowKey >= value.length) && props.name) {
130
- var _rowIndex = value.findIndex(function (item, index) {
131
- var _getRowKey;
132
- return (getRowKey === null || getRowKey === void 0 || (_getRowKey = getRowKey(item, index)) === null || _getRowKey === void 0 ? void 0 : _getRowKey.toString()) === (finlayRowKey === null || finlayRowKey === void 0 ? void 0 : finlayRowKey.toString());
351
+ /**
352
+ * 将数字索引转换为实际的 rowKey(非 name 模式)
353
+ */
354
+ const convertIndexToRowKey = useRefFunction(index => {
355
+ const dataLength = value?.length ?? 0;
356
+ if (index >= dataLength) return index;
357
+ const rowData = value?.[index];
358
+ return getRowKey?.(rowData, index);
359
+ });
360
+
361
+ /**
362
+ * 将 rowKey 转换为数字索引(name 模式)
363
+ */
364
+ const convertRowKeyToIndex = useRefFunction(rowKey => {
365
+ const dataLength = value?.length ?? 0;
366
+ if (typeof rowKey === 'string' || rowKey >= dataLength) {
367
+ const rowIndex = value.findIndex((item, index) => {
368
+ return getRowKey?.(item, index)?.toString() === rowKey?.toString();
133
369
  });
134
- if (_rowIndex !== -1) return _rowIndex;
370
+ if (rowIndex !== -1) return rowIndex;
371
+ }
372
+ return rowKey;
373
+ });
374
+
375
+ /**
376
+ * 根据不同的情况返回不同的 rowKey
377
+ */
378
+ const coverRowKey = useRefFunction(finlayRowKey => {
379
+ if (typeof finlayRowKey === 'number' && !props.name) {
380
+ return convertIndexToRowKey(finlayRowKey);
381
+ }
382
+ if (props.name) {
383
+ return convertRowKeyToIndex(finlayRowKey);
135
384
  }
136
385
  return finlayRowKey;
137
386
  });
138
387
 
139
- // 设置 editableFormRef
140
- useImperativeHandle(editableFormRef, function () {
141
- /**
142
- * 获取一行数据的
143
- * @param rowIndex
144
- * @returns T | undefined
145
- */
146
- var getRowData = function getRowData(rowIndex) {
147
- var _finlayRowKey$toStrin, _formRef$current;
148
- if (rowIndex == undefined) {
149
- throw new Error('rowIndex is required');
150
- }
151
- var finlayRowKey = coverRowKey(rowIndex);
152
- var rowKeyName = [props.name, (_finlayRowKey$toStrin = finlayRowKey === null || finlayRowKey === void 0 ? void 0 : finlayRowKey.toString()) !== null && _finlayRowKey$toStrin !== void 0 ? _finlayRowKey$toStrin : ''].flat(1).filter(Boolean);
153
- return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getFieldValue(rowKeyName);
154
- };
388
+ /**
389
+ * 构建表单字段路径
390
+ */
391
+ const buildFormFieldPath = useRefFunction(rowKey => {
392
+ return [props.name, rowKey?.toString() ?? ''].flat(1).filter(Boolean);
393
+ });
155
394
 
156
- /**
157
- * 获取整个 table 的数据
158
- * @returns T[] | undefined
159
- */
160
- var getRowsData = function getRowsData() {
161
- var _formRef$current3;
162
- var rowKeyName = [props.name].flat(1).filter(Boolean);
163
- if (Array.isArray(rowKeyName) && rowKeyName.length === 0) {
164
- var _formRef$current2;
165
- var rowData = (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldsValue();
166
- if (Array.isArray(rowData)) return rowData;
167
- return Object.keys(rowData).map(function (key) {
168
- return rowData[key];
169
- });
170
- }
171
- return (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.getFieldValue(rowKeyName);
172
- };
173
- return _objectSpread(_objectSpread({}, formRef.current), {}, {
174
- getRowData: getRowData,
175
- getRowsData: getRowsData,
176
- /**
177
- * 设置一行的数据,会将数据进行简单的 merge
178
- * @param rowIndex
179
- * @param data
180
- * @returns void
181
- */
182
- setRowData: function setRowData(rowIndex, data) {
183
- var _finlayRowKey$toStrin2, _formRef$current4;
184
- if (rowIndex == undefined) {
185
- throw new Error('rowIndex is required');
186
- }
187
- var finlayRowKey = coverRowKey(rowIndex);
188
- var rowKeyName = [props.name, (_finlayRowKey$toStrin2 = finlayRowKey === null || finlayRowKey === void 0 ? void 0 : finlayRowKey.toString()) !== null && _finlayRowKey$toStrin2 !== void 0 ? _finlayRowKey$toStrin2 : ''].flat(1).filter(Boolean);
189
- var newRowData = Object.assign({}, _objectSpread(_objectSpread({}, getRowData(rowIndex)), data || {}));
190
- var updateValues = set({}, rowKeyName, newRowData);
191
- (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 || _formRef$current4.setFieldsValue(updateValues);
192
- return true;
193
- }
194
- });
195
- }, [coverRowKey, props.name, formRef.current]);
196
- useEffect(function () {
197
- if (!props.controlled) return;
198
- (value || []).forEach(function (current, index) {
199
- var _formRef$current5;
200
- (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 || _formRef$current5.setFieldsValue(_defineProperty({}, "".concat(getRowKey(current, index)), current));
201
- }, {});
202
- // eslint-disable-next-line react-hooks/exhaustive-deps
203
- }, [stringify(value), props.controlled]);
204
- useEffect(function () {
205
- if (props.name) {
206
- var _props$editable;
207
- formRef.current = props === null || props === void 0 || (_props$editable = props.editable) === null || _props$editable === void 0 ? void 0 : _props$editable.form;
395
+ /**
396
+ * 获取一行数据
397
+ */
398
+ const getRowData = useRefFunction(rowIndex => {
399
+ if (rowIndex == null) {
400
+ throw new Error('rowIndex is required');
208
401
  }
209
- }, [(_props$editable2 = props.editable) === null || _props$editable2 === void 0 ? void 0 : _props$editable2.form, props.name]);
210
- var _ref = recordCreatorProps || {},
211
- record = _ref.record,
212
- position = _ref.position,
213
- creatorButtonText = _ref.creatorButtonText,
214
- newRecordType = _ref.newRecordType,
215
- parentKey = _ref.parentKey,
216
- style = _ref.style,
217
- restButtonProps = _objectWithoutProperties(_ref, _excluded2);
218
- var isTop = position === 'top';
219
- var creatorButtonDom = useMemo(function () {
220
- if (typeof maxLength === 'number' && maxLength <= (value === null || value === void 0 ? void 0 : value.length)) {
221
- return false;
402
+ const finlayRowKey = coverRowKey(rowIndex);
403
+ const rowKeyName = buildFormFieldPath(finlayRowKey);
404
+ return formRef.current?.getFieldValue(rowKeyName);
405
+ });
406
+
407
+ /**
408
+ * 获取整个表格的数据
409
+ */
410
+ const getRowsData = useRefFunction(() => {
411
+ const rowKeyName = [props.name].flat(1).filter(Boolean);
412
+ if (Array.isArray(rowKeyName) && rowKeyName.length === 0) {
413
+ const rowData = formRef.current?.getFieldsValue();
414
+ if (Array.isArray(rowData)) return rowData;
415
+ return Object.keys(rowData).map(key => rowData[key]);
222
416
  }
223
- return recordCreatorProps !== false && /*#__PURE__*/_jsx(RecordCreator, {
224
- record: runFunction(record, value === null || value === void 0 ? void 0 : value.length, value) || {},
225
- position: position,
226
- parentKey: runFunction(parentKey, value === null || value === void 0 ? void 0 : value.length, value),
227
- newRecordType: newRecordType,
228
- children: /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
229
- type: "dashed",
230
- style: _objectSpread({
231
- display: 'block',
232
- margin: '10px 0',
233
- width: '100%'
234
- }, style),
235
- icon: /*#__PURE__*/_jsx(PlusOutlined, {})
236
- }, restButtonProps), {}, {
237
- children: creatorButtonText || intl.getMessage('editableTable.action.add', '添加一行数据')
238
- }))
239
- });
240
- // eslint-disable-next-line react-hooks/exhaustive-deps
241
- }, [recordCreatorProps, maxLength, value === null || value === void 0 ? void 0 : value.length]);
242
- var buttonRenderProps = useMemo(function () {
243
- if (!creatorButtonDom) {
244
- return {};
417
+ return formRef.current?.getFieldValue(rowKeyName);
418
+ });
419
+
420
+ /**
421
+ * 设置一行数据
422
+ */
423
+ const setRowData = useRefFunction((rowIndex, data) => {
424
+ if (rowIndex == null) {
425
+ throw new Error('rowIndex is required');
245
426
  }
246
- if (isTop) {
247
- return {
248
- components: {
249
- header: {
250
- wrapper: function wrapper(_ref2) {
251
- var _rest$columns;
252
- var className = _ref2.className,
253
- children = _ref2.children;
254
- return /*#__PURE__*/_jsxs("thead", {
255
- className: className,
256
- children: [children, /*#__PURE__*/_jsxs("tr", {
257
- style: {
258
- position: 'relative'
259
- },
260
- children: [/*#__PURE__*/_jsx("td", {
261
- colSpan: 0,
262
- style: {
263
- visibility: 'hidden'
264
- },
265
- children: creatorButtonDom
266
- }), /*#__PURE__*/_jsx("td", {
267
- style: {
268
- position: 'absolute',
269
- left: 0,
270
- width: '100%'
271
- },
272
- colSpan: (_rest$columns = rest.columns) === null || _rest$columns === void 0 ? void 0 : _rest$columns.length,
273
- children: creatorButtonDom
274
- })]
275
- })]
276
- });
277
- }
427
+ const finlayRowKey = coverRowKey(rowIndex);
428
+ const rowKeyName = buildFormFieldPath(finlayRowKey);
429
+ const currentRowData = getRowData(rowIndex);
430
+ const newRowData = {
431
+ ...currentRowData,
432
+ ...(data || {})
433
+ };
434
+
435
+ // name 模式下,需要更新整个数组
436
+ if (props.name) {
437
+ const tableName = [props.name].flat(1).filter(Boolean);
438
+ // 优先从 value prop 获取数据(受控模式),否则从表单值获取
439
+ let currentTableData = props.value || formRef.current?.getFieldValue(tableName);
440
+ if (Array.isArray(currentTableData)) {
441
+ // 找到要更新的行的索引
442
+ const rowIndexToUpdate = typeof finlayRowKey === 'number' ? finlayRowKey : currentTableData.findIndex((row, index) => {
443
+ const rowKey = getRowKey?.(row, index);
444
+ return rowKey === finlayRowKey || rowKey?.toString() === finlayRowKey?.toString();
445
+ });
446
+ if (rowIndexToUpdate >= 0 && rowIndexToUpdate < currentTableData.length) {
447
+ // 更新数组中的对应行
448
+ const updatedTableData = [...currentTableData];
449
+ updatedTableData[rowIndexToUpdate] = newRowData;
450
+
451
+ // 设置整个数组,使用 set 来构建正确的路径
452
+ // 使用与 syncFormValuesExcludingEditing 相同的路径格式(数组路径)
453
+ // 这样可以确保 getFieldValue 能正确获取值
454
+ const updateValues = set({}, tableName, updatedTableData);
455
+ formRef.current?.setFieldsValue(updateValues);
456
+
457
+ // 在受控模式下,触发 onChange
458
+ if (props.controlled && props.onChange) {
459
+ props.onChange(updatedTableData);
278
460
  }
279
461
  }
280
- };
462
+ } else {
463
+ // 如果当前没有数据,直接设置单个字段
464
+ const updateValues = set({}, rowKeyName, newRowData);
465
+ formRef.current?.setFieldsValue(updateValues);
466
+ }
467
+ } else {
468
+ // 非 name 模式下,直接设置单个字段
469
+ const updateValues = set({}, rowKeyName, newRowData);
470
+ formRef.current?.setFieldsValue(updateValues);
281
471
  }
472
+ return true;
473
+ });
474
+
475
+ // 设置 editableFormRef
476
+ useImperativeHandle(editableFormRef, () => {
282
477
  return {
283
- tableViewRender: function tableViewRender(_, dom) {
284
- var _props$tableViewRende, _props$tableViewRende2;
285
- return /*#__PURE__*/_jsxs(_Fragment, {
286
- children: [(_props$tableViewRende = (_props$tableViewRende2 = props.tableViewRender) === null || _props$tableViewRende2 === void 0 ? void 0 : _props$tableViewRende2.call(props, _, dom)) !== null && _props$tableViewRende !== void 0 ? _props$tableViewRende : dom, creatorButtonDom]
478
+ ...formRef.current,
479
+ getRowData,
480
+ getRowsData,
481
+ setRowData
482
+ };
483
+ }, [coverRowKey, props.name, getRowData, getRowsData, setRowData]);
484
+
485
+ /**
486
+ * 受控模式下同步表单值
487
+ * 在受控模式下,即使正在编辑的行也要同步更新,因为数据由外部完全控制
488
+ * 使用深度比较优化性能,避免频繁的序列化操作
489
+ * 注意:只有当 value 明确传递时才同步,避免覆盖表单中的初始值
490
+ */
491
+ useDeepCompareEffect(() => {
492
+ if (!props.controlled || !formRef.current) return;
493
+
494
+ // 在受控模式下,只有当 value 明确传递时才同步
495
+ // 避免在 value 为 undefined 时覆盖表单中的初始值
496
+ if (value === undefined) return;
497
+
498
+ // 在受控模式下,同步所有值(包括正在编辑的行)
499
+ // 因为数据由外部完全控制,应该同步更新
500
+ try {
501
+ if (props.name) {
502
+ // name 模式:直接设置整个数组
503
+ const namePath = [props.name].flat(1);
504
+ const newValue = set({}, namePath, value);
505
+ formRef.current.setFieldsValue(newValue);
506
+ } else {
507
+ // 非 name 模式:直接设置值
508
+ const formValues = {};
509
+ value.forEach((item, index) => {
510
+ const key = getRowKey(item, index);
511
+ const keyStr = String(key);
512
+ formValues[keyStr] = item;
287
513
  });
514
+ if (Object.keys(formValues).length > 0) {
515
+ formRef.current.setFieldsValue(formValues);
516
+ }
288
517
  }
289
- };
290
- // eslint-disable-next-line react-hooks/exhaustive-deps
291
- }, [isTop, creatorButtonDom]);
292
- var editableProps = _objectSpread({}, props.editable);
518
+ } catch (error) {
519
+ console.warn('Failed to sync form values in controlled mode:', error);
520
+ }
521
+ }, [value, props.controlled, props.name, getRowKey]);
293
522
 
294
523
  /**
295
- * 防止闭包的onchange
296
- *
297
- * >>>>>>为了性能好辛苦
524
+ * 同步表单实例引用
525
+ * 只在 name 模式下且 form 存在时更新
298
526
  */
299
- var newOnValueChange = useRefFunction(function (r, dataSource) {
300
- var _props$editable3, _props$editable3$onVa, _props$onValuesChange;
301
- (_props$editable3 = props.editable) === null || _props$editable3 === void 0 || (_props$editable3$onVa = _props$editable3.onValuesChange) === null || _props$editable3$onVa === void 0 || _props$editable3$onVa.call(_props$editable3, r, dataSource);
302
- (_props$onValuesChange = props.onValuesChange) === null || _props$onValuesChange === void 0 || _props$onValuesChange.call(props, dataSource, r);
303
- if (props.controlled) {
304
- var _props$onChange;
305
- props === null || props === void 0 || (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, dataSource);
527
+ useEffect(() => {
528
+ if (props.name && props?.editable?.form) {
529
+ formRef.current = props.editable.form;
306
530
  }
531
+ }, [props.editable?.form, props.name]);
532
+ const {
533
+ position
534
+ } = recordCreatorProps || {};
535
+ const isTop = position === 'top';
536
+ const {
537
+ creatorButtonDom,
538
+ buttonRenderProps
539
+ } = useCreatorButton({
540
+ recordCreatorProps,
541
+ maxLength,
542
+ value,
543
+ intl,
544
+ isTop,
545
+ columnsLength: rest.columns?.length,
546
+ tableViewRender: props.tableViewRender
307
547
  });
308
- if (props !== null && props !== void 0 && props.onValuesChange || (_props$editable4 = props.editable) !== null && _props$editable4 !== void 0 && _props$editable4.onValuesChange ||
309
- // 受控模式需要触发 onchange
310
- props.controlled && props !== null && props !== void 0 && props.onChange) {
311
- editableProps.onValuesChange = newOnValueChange;
312
- }
548
+
549
+ /**
550
+ * 处理值变化回调
551
+ * 注意:受控模式下不调用 onChange,避免循环更新
552
+ * onChange 应该由外部控制,而不是在内部触发
553
+ */
554
+ const handleValuesChange = useRefFunction((r, dataSource) => {
555
+ props.editable?.onValuesChange?.(r, dataSource);
556
+ props.onValuesChange?.(dataSource, r);
557
+
558
+ // 在受控模式下,当表单值变化时也应该触发 onChange
559
+ // 这样外部可以同步更新 value,实现真正的受控
560
+ if (props.controlled && props?.onChange) {
561
+ props.onChange(dataSource);
562
+ }
563
+ // 非受控模式下,onChange 应该在 onDataSourceChange 中触发
564
+ // 这样可以确保数据已经正确更新
565
+ });
566
+
567
+ /**
568
+ * 构建可编辑属性
569
+ * 使用 useMemo 优化性能,避免不必要的重新创建
570
+ */
571
+ const editableProps = useMemo(() => {
572
+ const baseProps = {
573
+ ...props.editable
574
+ };
575
+ const hasOnValuesChange = Boolean(props?.onValuesChange) || Boolean(props.editable?.onValuesChange) || Boolean(props.controlled && props?.onChange);
576
+ if (hasOnValuesChange) {
577
+ baseProps.onValuesChange = handleValuesChange;
578
+ }
579
+ return baseProps;
580
+ }, [props.editable, props.onValuesChange, props.controlled, props.onChange, handleValuesChange]);
313
581
  return /*#__PURE__*/_jsxs(_Fragment, {
314
582
  children: [/*#__PURE__*/_jsx(EditableTableActionContext.Provider, {
315
583
  value: actionRef,
316
- children: /*#__PURE__*/_jsx(ProTable, _objectSpread(_objectSpread(_objectSpread({
584
+ children: /*#__PURE__*/_jsx(ProTable, {
317
585
  search: false,
318
586
  options: false,
319
587
  pagination: false,
320
588
  rowKey: rowKey,
321
- revalidateOnFocus: false
322
- }, rest), buttonRenderProps), {}, {
589
+ revalidateOnFocus: false,
590
+ ...rest,
591
+ ...buttonRenderProps,
323
592
  tableLayout: "fixed",
324
593
  actionRef: actionRef,
325
594
  onChange: onTableChange,
326
- editable: _objectSpread(_objectSpread({}, editableProps), {}, {
327
- formProps: _objectSpread({
328
- formRef: formRef
329
- }, editableProps.formProps)
330
- }),
595
+ editable: {
596
+ ...editableProps,
597
+ formProps: {
598
+ formRef,
599
+ ...editableProps.formProps
600
+ }
601
+ },
331
602
  dataSource: value,
332
- onDataSourceChange: function onDataSourceChange(dataSource) {
603
+ onDataSourceChange: dataSource => {
604
+ // setValue 会触发 onChange,但我们需要确保数据已经正确更新
605
+ // 所以先设置数据,然后手动触发 onChange
333
606
  setValue(dataSource);
607
+
334
608
  /**
335
- * 如果是top,需要重新设置一下 form,不然会导致 id 相同数据混淆
609
+ * 如果是 name 模式,需要同步表单值
610
+ * 避免表单值和数据源不一致
611
+ * 注意:不会覆盖正在编辑的行
336
612
  */
337
- if (props.name && position === 'top') {
338
- var _formRef$current6;
339
- var newValue = set({}, [props.name].flat(1).filter(Boolean), dataSource);
340
- (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 || _formRef$current6.setFieldsValue(newValue);
613
+ if (props.name && formRef.current) {
614
+ const editingKeys = props.editable?.editableKeys;
615
+ const editingKeysSet = createEditingKeysSet(editingKeys);
616
+ const namePath = [props.name].flat(1).filter(Boolean);
617
+ syncFormValuesExcludingEditing(dataSource, editingKeysSet, namePath);
618
+ }
619
+
620
+ // 在非受控模式下,通过 onDataSourceChange 触发 onChange
621
+ // 这样可以确保数据已经正确更新
622
+ if (!props.controlled && props.onChange) {
623
+ props.onChange(dataSource);
341
624
  }
342
625
  }
343
- }))
626
+ })
344
627
  }), props.name ? /*#__PURE__*/_jsx(ProFormDependency, {
345
628
  name: [props.name],
346
- children: function children(changeValue) {
347
- var _props$editable5, _props$editable5$onVa;
629
+ children: changeValue => {
630
+ // 初始化 preData
348
631
  if (!preData.current) {
349
632
  preData.current = value;
350
633
  return null;
351
634
  }
352
- var list = get(changeValue, [props.name].flat(1));
353
- var changeItem = list === null || list === void 0 ? void 0 : list.find(function (item, index) {
354
- var _preData$current;
355
- return !isDeepEqualReact(item, (_preData$current = preData.current) === null || _preData$current === void 0 ? void 0 : _preData$current[index]);
635
+ const namePath = [props.name].flat(1);
636
+ const list = get(changeValue, namePath);
637
+
638
+ // 添加空值检查,避免后续操作出错
639
+ if (!list || !Array.isArray(list)) {
640
+ preData.current = value;
641
+ return null;
642
+ }
643
+
644
+ // 在更新 preData 之前找到变化的项
645
+ // 使用 findIndex 可以同时获取变化的项和索引
646
+ const changeIndex = list.findIndex((item, index) => {
647
+ return !isDeepEqualReact(item, preData.current?.[index]);
356
648
  });
357
- preData.current = value;
358
- if (!changeItem) return null;
359
- // 如果不存在 preData 说明是初始化,此时不需要触发 onValuesChange
360
- props === null || props === void 0 || (_props$editable5 = props.editable) === null || _props$editable5 === void 0 || (_props$editable5$onVa = _props$editable5.onValuesChange) === null || _props$editable5$onVa === void 0 || _props$editable5$onVa.call(_props$editable5, changeItem, list);
649
+
650
+ // 只有在找到变化项时才触发回调
651
+ if (changeIndex !== -1) {
652
+ const changeItem = list[changeIndex];
653
+ props?.editable?.onValuesChange?.(changeItem, list);
654
+ }
655
+
656
+ // 在找到 changeItem 之后再更新 preData,确保后续比较正确
657
+ preData.current = list;
361
658
  return null;
362
659
  }
363
660
  }) : null]
@@ -370,38 +667,40 @@ function EditableTable(props) {
370
667
  * @param props
371
668
  */
372
669
  function FieldEditableTable(props) {
373
- var form = ProForm.useFormInstance();
374
- if (!props.name) return /*#__PURE__*/_jsx(EditableTable, _objectSpread({
670
+ const form = ProForm.useFormInstance();
671
+ if (!props.name) return /*#__PURE__*/_jsx(EditableTable, {
375
672
  tableLayout: "fixed",
376
673
  scroll: {
377
674
  x: 'max-content'
378
- }
379
- }, props));
380
- return /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({
675
+ },
676
+ ...props
677
+ });
678
+ return /*#__PURE__*/_jsx(Form.Item, {
381
679
  style: {
382
680
  maxWidth: '100%'
383
681
  },
384
- shouldUpdate: function shouldUpdate(prev, next) {
385
- var name = [props.name].flat(1);
682
+ shouldUpdate: (prev, next) => {
683
+ const name = [props.name].flat(1);
386
684
  try {
387
685
  return JSON.stringify(get(prev, name)) !== JSON.stringify(get(next, name));
388
686
  } catch (error) {
389
687
  return true;
390
688
  }
391
- }
392
- }, props === null || props === void 0 ? void 0 : props.formItemProps), {}, {
689
+ },
690
+ ...props?.formItemProps,
393
691
  name: props.name,
394
- children: /*#__PURE__*/_jsx(EditableTable, _objectSpread(_objectSpread({
692
+ children: /*#__PURE__*/_jsx(EditableTable, {
395
693
  tableLayout: "fixed",
396
694
  scroll: {
397
695
  x: 'max-content'
398
- }
399
- }, props), {}, {
400
- editable: _objectSpread(_objectSpread({}, props.editable), {}, {
696
+ },
697
+ ...props,
698
+ editable: {
699
+ ...props.editable,
401
700
  form: form
402
- })
403
- }))
404
- }));
701
+ }
702
+ })
703
+ });
405
704
  }
406
705
  FieldEditableTable.RecordCreator = RecordCreator;
407
706
  export default FieldEditableTable;