@ant-design/pro-components 3.1.0-0 → 3.1.1-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 (714) 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 +8 -10
  6. package/es/card/components/Actions/index.js +25 -25
  7. package/es/card/components/Actions/style.js +79 -71
  8. package/es/card/components/Card/index.js +157 -142
  9. package/es/card/components/Card/style.js +249 -192
  10. package/es/card/components/CheckCard/Group.js +94 -115
  11. package/es/card/components/CheckCard/index.js +85 -79
  12. package/es/card/components/CheckCard/style.js +184 -168
  13. package/es/card/components/Divider/index.js +19 -15
  14. package/es/card/components/Divider/style.js +32 -29
  15. package/es/card/components/Loading/index.js +19 -16
  16. package/es/card/components/Loading/style.js +34 -31
  17. package/es/card/components/Operation/index.js +16 -13
  18. package/es/card/components/Operation/style.js +19 -18
  19. package/es/card/components/Statistic/index.js +46 -41
  20. package/es/card/components/Statistic/style.js +89 -70
  21. package/es/card/components/StatisticCard/index.js +46 -41
  22. package/es/card/components/StatisticCard/style.js +37 -35
  23. package/es/descriptions/index.js +214 -225
  24. package/es/descriptions/useFetchData.js +53 -91
  25. package/es/field/AllProField.js +265 -216
  26. package/es/field/FieldHOC/index.js +9 -14
  27. package/es/field/PureProField.js +82 -80
  28. package/es/field/ValueTypeToComponent.js +517 -618
  29. package/es/field/components/Cascader/index.d.ts +3 -3
  30. package/es/field/components/Cascader/index.js +66 -84
  31. package/es/field/components/Checkbox/index.d.ts +2 -2
  32. package/es/field/components/Checkbox/index.js +75 -72
  33. package/es/field/components/Code/index.js +40 -39
  34. package/es/field/components/ColorPicker/index.d.ts +2 -2
  35. package/es/field/components/ColorPicker/index.js +38 -32
  36. package/es/field/components/DatePicker/index.d.ts +2 -2
  37. package/es/field/components/DatePicker/index.js +49 -53
  38. package/es/field/components/Digit/index.js +41 -42
  39. package/es/field/components/DigitRange/index.js +71 -77
  40. package/es/field/components/FromNow/index.js +27 -25
  41. package/es/field/components/Image/index.js +28 -24
  42. package/es/field/components/IndexColumn/index.js +22 -16
  43. package/es/field/components/Money/index.js +107 -116
  44. package/es/field/components/Options/index.js +34 -33
  45. package/es/field/components/Password/index.js +35 -38
  46. package/es/field/components/Percent/index.js +40 -44
  47. package/es/field/components/Percent/util.js +3 -5
  48. package/es/field/components/Progress/index.js +29 -27
  49. package/es/field/components/Radio/index.d.ts +1 -1
  50. package/es/field/components/Radio/index.js +61 -62
  51. package/es/field/components/RangePicker/index.d.ts +2 -2
  52. package/es/field/components/RangePicker/index.js +52 -63
  53. package/es/field/components/Rate/index.js +24 -21
  54. package/es/field/components/Second/index.js +36 -33
  55. package/es/field/components/Segmented/index.d.ts +1 -1
  56. package/es/field/components/Segmented/index.js +37 -46
  57. package/es/field/components/Select/LightSelect/index.d.ts +1 -1
  58. package/es/field/components/Select/LightSelect/index.js +102 -109
  59. package/es/field/components/Select/SearchSelect/index.js +129 -155
  60. package/es/field/components/Select/index.d.ts +2 -2
  61. package/es/field/components/Select/index.js +193 -219
  62. package/es/field/components/Slider/index.js +25 -22
  63. package/es/field/components/Status/index.js +67 -78
  64. package/es/field/components/Switch/index.d.ts +1 -1
  65. package/es/field/components/Switch/index.js +32 -30
  66. package/es/field/components/Text/index.js +34 -37
  67. package/es/field/components/TextArea/index.js +26 -21
  68. package/es/field/components/TextArea/readonly.js +24 -21
  69. package/es/field/components/TimePicker/index.js +96 -105
  70. package/es/field/components/TreeSelect/index.d.ts +3 -3
  71. package/es/field/components/TreeSelect/index.js +107 -125
  72. package/es/form/BaseForm/BaseForm.js +416 -502
  73. package/es/form/BaseForm/EditOrReadOnlyContext.js +1 -1
  74. package/es/form/BaseForm/LightWrapper/index.js +56 -65
  75. package/es/form/BaseForm/LightWrapper/style.js +17 -13
  76. package/es/form/BaseForm/Submitter/index.js +44 -43
  77. package/es/form/FieldContext.js +1 -1
  78. package/es/form/components/Captcha/index.js +74 -134
  79. package/es/form/components/Cascader/index.d.ts +1 -1
  80. package/es/form/components/Cascader/index.js +26 -28
  81. package/es/form/components/Checkbox/index.js +60 -61
  82. package/es/form/components/ColorPicker/index.d.ts +1 -1
  83. package/es/form/components/ColorPicker/index.js +24 -26
  84. package/es/form/components/DatePicker/BaseDatePicker.js +32 -30
  85. package/es/form/components/DatePicker/DatePicker.js +14 -13
  86. package/es/form/components/DatePicker/DateTimePicker.js +11 -12
  87. package/es/form/components/DatePicker/MonthPicker.js +14 -13
  88. package/es/form/components/DatePicker/QuarterPicker.js +14 -13
  89. package/es/form/components/DatePicker/TimePicker.js +26 -27
  90. package/es/form/components/DatePicker/WeekPicker.js +14 -13
  91. package/es/form/components/DatePicker/YearPicker.js +14 -13
  92. package/es/form/components/DatePicker/index.js +1 -1
  93. package/es/form/components/DateRangePicker/BaseDateRanger.js +34 -34
  94. package/es/form/components/DateRangePicker/DateMonthRangePicker.js +15 -16
  95. package/es/form/components/DateRangePicker/DateQuarterRangePicker.js +15 -16
  96. package/es/form/components/DateRangePicker/DateTimeRangePicker.js +15 -16
  97. package/es/form/components/DateRangePicker/DateWeekRangePicker.js +15 -16
  98. package/es/form/components/DateRangePicker/DateYearRangePicker.js +15 -16
  99. package/es/form/components/DateRangePicker/TimeRangePicker.js +26 -29
  100. package/es/form/components/DateRangePicker/index.js +15 -16
  101. package/es/form/components/Dependency/index.js +31 -34
  102. package/es/form/components/Digit/DigitRange.d.ts +2 -2
  103. package/es/form/components/Digit/DigitRange.js +23 -24
  104. package/es/form/components/Digit/index.d.ts +1 -1
  105. package/es/form/components/Digit/index.js +27 -29
  106. package/es/form/components/Field/index.js +55 -63
  107. package/es/form/components/FieldSet/index.js +68 -76
  108. package/es/form/components/FormItem/FormItemRender/index.js +58 -48
  109. package/es/form/components/FormItem/Group/index.js +95 -95
  110. package/es/form/components/FormItem/Group/style.js +46 -40
  111. package/es/form/components/FormItem/index.js +135 -141
  112. package/es/form/components/FormItem/warpField.js +165 -149
  113. package/es/form/components/List/ListContainer.js +98 -189
  114. package/es/form/components/List/ListItem.js +151 -198
  115. package/es/form/components/List/index.js +97 -107
  116. package/es/form/components/List/style.js +71 -47
  117. package/es/form/components/Money/index.d.ts +1 -1
  118. package/es/form/components/Money/index.js +28 -30
  119. package/es/form/components/Radio/index.d.ts +2 -2
  120. package/es/form/components/Radio/index.js +45 -49
  121. package/es/form/components/Rate/index.d.ts +1 -1
  122. package/es/form/components/Rate/index.js +17 -20
  123. package/es/form/components/SchemaForm/index.js +58 -72
  124. package/es/form/components/SchemaForm/layoutType/Embed.js +5 -6
  125. package/es/form/components/SchemaForm/layoutType/StepsForm.js +22 -26
  126. package/es/form/components/SchemaForm/valueType/dependency.js +11 -11
  127. package/es/form/components/SchemaForm/valueType/divider.js +4 -5
  128. package/es/form/components/SchemaForm/valueType/field.js +45 -44
  129. package/es/form/components/SchemaForm/valueType/formList.js +8 -7
  130. package/es/form/components/SchemaForm/valueType/formSet.js +8 -7
  131. package/es/form/components/SchemaForm/valueType/group.js +7 -8
  132. package/es/form/components/SchemaForm/valueType/ignore.js +2 -2
  133. package/es/form/components/SchemaForm/valueType/index.js +5 -5
  134. package/es/form/components/Segmented/index.js +20 -23
  135. package/es/form/components/Select/index.js +69 -73
  136. package/es/form/components/Slider/index.d.ts +1 -1
  137. package/es/form/components/Slider/index.js +33 -35
  138. package/es/form/components/Switch/index.js +24 -26
  139. package/es/form/components/Text/index.js +75 -86
  140. package/es/form/components/TextArea/index.d.ts +1 -1
  141. package/es/form/components/TextArea/index.js +17 -20
  142. package/es/form/components/TreeSelect/index.js +20 -23
  143. package/es/form/components/UploadButton/index.js +56 -103
  144. package/es/form/components/UploadDragger/index.js +37 -44
  145. package/es/form/helpers/grid.js +65 -67
  146. package/es/form/layouts/DrawerForm/index.js +150 -241
  147. package/es/form/layouts/DrawerForm/style.js +26 -25
  148. package/es/form/layouts/LightFilter/index.d.ts +12 -1
  149. package/es/form/layouts/LightFilter/index.js +158 -140
  150. package/es/form/layouts/LightFilter/style.js +52 -48
  151. package/es/form/layouts/LoginForm/index.js +44 -47
  152. package/es/form/layouts/LoginForm/style.js +71 -67
  153. package/es/form/layouts/LoginFormPage/index.js +45 -48
  154. package/es/form/layouts/LoginFormPage/style.js +136 -126
  155. package/es/form/layouts/ModalForm/index.js +119 -203
  156. package/es/form/layouts/ProForm/index.d.ts +2 -2
  157. package/es/form/layouts/ProForm/index.js +5 -5
  158. package/es/form/layouts/QueryFilter/Actions.js +23 -22
  159. package/es/form/layouts/QueryFilter/index.js +178 -203
  160. package/es/form/layouts/QueryFilter/style.js +45 -37
  161. package/es/form/layouts/StepsForm/StepForm.d.ts +2 -3
  162. package/es/form/layouts/StepsForm/StepForm.js +50 -71
  163. package/es/form/layouts/StepsForm/index.js +175 -217
  164. package/es/form/layouts/StepsForm/style.js +30 -28
  165. package/es/form/layouts/index.js +1 -1
  166. package/es/layout/ProLayout.js +281 -292
  167. package/es/layout/WrapContent.js +16 -12
  168. package/es/layout/assert/Logo.js +95 -97
  169. package/es/layout/components/AppsLogoComponents/AppsLogo.js +10 -12
  170. package/es/layout/components/AppsLogoComponents/DefaultContent.js +17 -16
  171. package/es/layout/components/AppsLogoComponents/SimpleContent.js +19 -18
  172. package/es/layout/components/AppsLogoComponents/index.js +33 -38
  173. package/es/layout/components/AppsLogoComponents/style/default.js +2 -2
  174. package/es/layout/components/AppsLogoComponents/style/index.js +52 -50
  175. package/es/layout/components/AppsLogoComponents/style/simple.js +1 -1
  176. package/es/layout/components/CollapsedIcon/index.js +18 -15
  177. package/es/layout/components/CollapsedIcon/style.js +40 -40
  178. package/es/layout/components/Footer.js +22 -21
  179. package/es/layout/components/FooterToolbar/index.js +58 -52
  180. package/es/layout/components/FooterToolbar/style/index.js +38 -37
  181. package/es/layout/components/FooterToolbar/style/stylish.js +11 -9
  182. package/es/layout/components/GlobalFooter/index.js +25 -25
  183. package/es/layout/components/GlobalFooter/style.js +31 -30
  184. package/es/layout/components/GlobalHeader/ActionsContent.js +62 -78
  185. package/es/layout/components/GlobalHeader/index.js +59 -47
  186. package/es/layout/components/GlobalHeader/rightContentStyle.js +49 -49
  187. package/es/layout/components/GlobalHeader/style.js +58 -54
  188. package/es/layout/components/GridContent/index.js +24 -19
  189. package/es/layout/components/GridContent/style.js +14 -13
  190. package/es/layout/components/Header/index.js +63 -57
  191. package/es/layout/components/Header/style/header.js +49 -47
  192. package/es/layout/components/Header/style/stylish.js +15 -11
  193. package/es/layout/components/Help/AsyncContentPanel.js +13 -18
  194. package/es/layout/components/Help/HelpProvide.js +1 -1
  195. package/es/layout/components/Help/ProHelpContentPanel.js +64 -83
  196. package/es/layout/components/Help/ProHelpDrawer.js +25 -31
  197. package/es/layout/components/Help/ProHelpModal.d.ts +1 -1
  198. package/es/layout/components/Help/ProHelpModal.js +24 -27
  199. package/es/layout/components/Help/ProHelpPanel.js +86 -94
  200. package/es/layout/components/Help/ProHelpPopover.js +18 -16
  201. package/es/layout/components/Help/RenderContentPanel.js +34 -24
  202. package/es/layout/components/Help/Search.js +52 -78
  203. package/es/layout/components/Help/index.js +9 -11
  204. package/es/layout/components/Help/style.js +82 -75
  205. package/es/layout/components/PageContainer/index.js +168 -149
  206. package/es/layout/components/PageContainer/style/index.js +95 -78
  207. package/es/layout/components/PageContainer/style/stylish.js +11 -9
  208. package/es/layout/components/PageHeader/index.js +96 -97
  209. package/es/layout/components/PageHeader/style/index.js +142 -122
  210. package/es/layout/components/PageLoading/index.js +17 -20
  211. package/es/layout/components/SettingDrawer/BlockCheckbox.js +29 -32
  212. package/es/layout/components/SettingDrawer/LayoutChange.js +22 -22
  213. package/es/layout/components/SettingDrawer/RegionalChange.js +14 -15
  214. package/es/layout/components/SettingDrawer/ThemeColor.js +32 -35
  215. package/es/layout/components/SettingDrawer/index.js +137 -168
  216. package/es/layout/components/SettingDrawer/style/index.js +141 -137
  217. package/es/layout/components/SiderMenu/BaseMenu.js +235 -221
  218. package/es/layout/components/SiderMenu/SiderMenu.js +125 -115
  219. package/es/layout/components/SiderMenu/index.js +47 -42
  220. package/es/layout/components/SiderMenu/style/index.js +179 -161
  221. package/es/layout/components/SiderMenu/style/menu.js +148 -110
  222. package/es/layout/components/SiderMenu/style/stylish.js +15 -11
  223. package/es/layout/components/TopNavHeader/index.js +71 -60
  224. package/es/layout/components/TopNavHeader/style.js +64 -63
  225. package/es/layout/context/RouteContext.js +1 -1
  226. package/es/layout/defaultSettings.js +1 -1
  227. package/es/layout/getPageTitle.js +23 -24
  228. package/es/layout/locales/en-US.js +3 -2
  229. package/es/layout/locales/index.js +5 -5
  230. package/es/layout/locales/it-IT.js +3 -2
  231. package/es/layout/locales/ko-KR.js +3 -2
  232. package/es/layout/locales/zh-CN.js +3 -2
  233. package/es/layout/locales/zh-TW.js +3 -2
  234. package/es/layout/style/index.js +48 -42
  235. package/es/layout/utils/getBreadcrumbProps.js +60 -60
  236. package/es/layout/utils/getMenuData.js +7 -11
  237. package/es/layout/utils/pathTools.js +2 -6
  238. package/es/layout/utils/useCurrentMenuLayoutProps.js +4 -9
  239. package/es/layout/utils/utils.js +15 -17
  240. package/es/list/Item.js +157 -137
  241. package/es/list/ListView.js +106 -115
  242. package/es/list/constants.js +2 -2
  243. package/es/list/index.js +72 -70
  244. package/es/list/style/index.js +281 -213
  245. package/es/provider/index.js +122 -115
  246. package/es/provider/intl.js +53 -55
  247. package/es/provider/typing/layoutToken.js +26 -23
  248. package/es/provider/useStyle/index.js +51 -59
  249. package/es/provider/utils/merge.js +10 -12
  250. package/es/skeleton/components/Descriptions/index.js +211 -229
  251. package/es/skeleton/components/List/index.js +208 -223
  252. package/es/skeleton/components/Result/index.js +45 -47
  253. package/es/skeleton/index.js +13 -10
  254. package/es/table/Store/Provide.d.ts +4 -4
  255. package/es/table/Store/Provide.js +102 -117
  256. package/es/table/Table.d.ts +5 -2
  257. package/es/table/Table.js +526 -691
  258. package/es/table/TableSearch.d.ts +24 -0
  259. package/es/table/TableSearch.js +54 -0
  260. package/es/table/TableToolbar.d.ts +22 -0
  261. package/es/table/TableToolbar.js +47 -0
  262. package/es/table/components/Alert/index.js +41 -40
  263. package/es/table/components/Alert/style.js +28 -27
  264. package/es/table/components/ColumnSetting/index.js +228 -223
  265. package/es/table/components/ColumnSetting/style.js +86 -71
  266. package/es/table/components/DragSortTable/index.js +65 -79
  267. package/es/table/components/DragSortTable/style.js +20 -19
  268. package/es/table/components/Dropdown/index.js +42 -47
  269. package/es/table/components/EditableTable/CellEditorTable.js +24 -32
  270. package/es/table/components/EditableTable/RowEditorTable.js +23 -28
  271. package/es/table/components/EditableTable/index.js +295 -329
  272. package/es/table/components/Form/FormRender.js +99 -103
  273. package/es/table/components/Form/index.d.ts +4 -19
  274. package/es/table/components/Form/index.js +112 -159
  275. package/es/table/components/ListToolBar/HeaderMenu.js +44 -52
  276. package/es/table/components/ListToolBar/index.js +122 -147
  277. package/es/table/components/ListToolBar/style.js +127 -117
  278. package/es/table/components/ToolBar/DensityIcon.js +10 -9
  279. package/es/table/components/ToolBar/FullscreenIcon.js +5 -9
  280. package/es/table/components/ToolBar/index.d.ts +2 -8
  281. package/es/table/components/ToolBar/index.js +155 -195
  282. package/es/table/style/index.js +144 -112
  283. package/es/table/typing.d.ts +4 -0
  284. package/es/table/useFetchData.js +199 -338
  285. package/es/table/utils/cellRenderToFromItem.js +105 -119
  286. package/es/table/utils/columnRender.js +63 -54
  287. package/es/table/utils/columnSort.js +22 -22
  288. package/es/table/utils/genProColumnToColumn.d.ts +13 -9
  289. package/es/table/utils/genProColumnToColumn.js +121 -98
  290. package/es/table/utils/index.d.ts +10 -0
  291. package/es/table/utils/index.js +112 -178
  292. package/es/table/utils/useDragSort.d.ts +1 -1
  293. package/es/table/utils/useDragSort.js +99 -92
  294. package/es/table/utils/usePageInfo.d.ts +6 -0
  295. package/es/table/utils/usePageInfo.js +55 -0
  296. package/es/utils/components/DropdownFooter/index.js +23 -21
  297. package/es/utils/components/DropdownFooter/style.js +16 -15
  298. package/es/utils/components/ErrorBoundary/index.js +27 -50
  299. package/es/utils/components/FieldLabel/index.js +70 -70
  300. package/es/utils/components/FieldLabel/style.js +104 -81
  301. package/es/utils/components/FilterDropdown/index.d.ts +11 -0
  302. package/es/utils/components/FilterDropdown/index.js +43 -32
  303. package/es/utils/components/FilterDropdown/style.js +19 -16
  304. package/es/utils/components/InlineErrorFormItem/index.js +78 -78
  305. package/es/utils/components/InlineErrorFormItem/style.js +56 -49
  306. package/es/utils/components/LabelIconTip/index.js +30 -31
  307. package/es/utils/components/LabelIconTip/style.js +36 -35
  308. package/es/utils/components/ProFormContext/index.js +1 -1
  309. package/es/utils/conversionMomentValue/index.js +19 -22
  310. package/es/utils/dateArrayFormatter/index.js +9 -14
  311. package/es/utils/genCopyable/index.js +74 -32
  312. package/es/utils/getFieldPropsOrFormItemProps/index.js +1 -1
  313. package/es/utils/hooks/useDebounceFn/index.js +18 -51
  314. package/es/utils/hooks/useDebounceValue/index.js +7 -16
  315. package/es/utils/hooks/useDeepCompareEffect/index.js +6 -18
  316. package/es/utils/hooks/useDocumentTitle/index.js +2 -2
  317. package/es/utils/hooks/useFetchData/index.js +36 -65
  318. package/es/utils/hooks/useForceRender/index.js +2 -9
  319. package/es/utils/hooks/useLatest/index.js +2 -2
  320. package/es/utils/hooks/usePrevious/index.js +3 -3
  321. package/es/utils/hooks/useReactiveRef/index.js +2 -2
  322. package/es/utils/hooks/useRefCallback/index.js +3 -3
  323. package/es/utils/hooks/useRefFunction/index.js +4 -9
  324. package/es/utils/index.d.ts +1 -2
  325. package/es/utils/index.js +1 -2
  326. package/es/utils/isBrowser/index.js +2 -2
  327. package/es/utils/isDeepEqualReact/index.js +9 -44
  328. package/es/utils/isDropdownValueType/index.js +2 -2
  329. package/es/utils/isNil/index.js +1 -3
  330. package/es/utils/isUrl/index.js +2 -2
  331. package/es/utils/merge/index.js +10 -12
  332. package/es/utils/nanoid/index.js +5 -6
  333. package/es/utils/omitBoolean/index.js +1 -1
  334. package/es/utils/omitUndefined/index.js +3 -3
  335. package/es/utils/omitUndefinedAndEmptyArr/index.js +4 -5
  336. package/es/utils/parseValueToMoment/index.js +3 -7
  337. package/es/utils/pickProFormItemProps/index.js +3 -3
  338. package/es/utils/pickProProps/index.js +6 -7
  339. package/es/utils/proFieldParsingText/index.js +85 -98
  340. package/es/utils/runFunction/index.js +2 -5
  341. package/es/utils/stringify/index.js +1 -1
  342. package/es/utils/transformKeySubmitValue/index.js +99 -116
  343. package/es/utils/useEditableArray/index.d.ts +6 -1
  344. package/es/utils/useEditableArray/index.js +579 -735
  345. package/es/utils/useEditableMap/index.d.ts +1 -1
  346. package/es/utils/useEditableMap/index.js +89 -135
  347. package/es/utils/useMediaQuery/index.d.ts +2 -2
  348. package/es/utils/useMediaQuery/index.js +37 -34
  349. package/es/utils/useMediaQuery/query.js +7 -17
  350. package/es/version.js +1 -1
  351. package/guidelines/Guidelines.md +33 -0
  352. package/guidelines/components/drawer-form.md +90 -0
  353. package/guidelines/components/editable-pro-table.md +150 -0
  354. package/guidelines/components/modal-form.md +88 -0
  355. package/guidelines/components/pro-card.md +90 -0
  356. package/guidelines/components/pro-form.md +96 -0
  357. package/guidelines/components/pro-layout.md +84 -0
  358. package/guidelines/components/pro-table.md +142 -0
  359. package/guidelines/components/steps-form.md +105 -0
  360. package/guidelines/design-tokens/colors.md +58 -0
  361. package/guidelines/design-tokens/layout.md +53 -0
  362. package/guidelines/design-tokens/typography.md +49 -0
  363. package/guidelines/overview-components.md +55 -0
  364. package/guidelines/overview-icons.md +23 -0
  365. package/lib/card/ProCard.js +8 -10
  366. package/lib/card/components/Actions/index.js +25 -25
  367. package/lib/card/components/Actions/style.js +79 -72
  368. package/lib/card/components/Card/index.js +154 -139
  369. package/lib/card/components/Card/style.js +249 -193
  370. package/lib/card/components/CheckCard/Group.js +97 -115
  371. package/lib/card/components/CheckCard/index.js +85 -78
  372. package/lib/card/components/CheckCard/style.js +184 -169
  373. package/lib/card/components/Divider/index.js +20 -16
  374. package/lib/card/components/Divider/style.js +32 -30
  375. package/lib/card/components/Loading/index.js +19 -16
  376. package/lib/card/components/Loading/style.js +34 -32
  377. package/lib/card/components/Operation/index.js +16 -14
  378. package/lib/card/components/Operation/style.js +19 -19
  379. package/lib/card/components/Statistic/index.js +46 -42
  380. package/lib/card/components/Statistic/style.js +89 -71
  381. package/lib/card/components/StatisticCard/index.js +46 -41
  382. package/lib/card/components/StatisticCard/style.js +37 -36
  383. package/lib/card/index.js +4 -4
  384. package/lib/descriptions/index.js +219 -225
  385. package/lib/descriptions/useFetchData.js +51 -90
  386. package/lib/field/AllProField.js +267 -217
  387. package/lib/field/FieldHOC/index.js +9 -15
  388. package/lib/field/PureProField.js +84 -82
  389. package/lib/field/ValueTypeToComponent.js +517 -618
  390. package/lib/field/components/Cascader/index.d.ts +2 -2
  391. package/lib/field/components/Cascader/index.js +66 -85
  392. package/lib/field/components/Checkbox/index.d.ts +1 -1
  393. package/lib/field/components/Checkbox/index.js +75 -73
  394. package/lib/field/components/Code/index.js +40 -39
  395. package/lib/field/components/ColorPicker/index.js +38 -33
  396. package/lib/field/components/DatePicker/index.d.ts +1 -1
  397. package/lib/field/components/DatePicker/index.js +49 -53
  398. package/lib/field/components/Digit/index.js +41 -43
  399. package/lib/field/components/DigitRange/index.js +69 -76
  400. package/lib/field/components/FromNow/index.js +27 -25
  401. package/lib/field/components/Image/index.js +28 -24
  402. package/lib/field/components/IndexColumn/index.js +22 -17
  403. package/lib/field/components/Money/index.js +106 -116
  404. package/lib/field/components/Options/index.js +34 -34
  405. package/lib/field/components/Password/index.js +35 -38
  406. package/lib/field/components/Percent/index.js +40 -45
  407. package/lib/field/components/Percent/util.js +3 -6
  408. package/lib/field/components/Progress/index.js +29 -28
  409. package/lib/field/components/Radio/index.d.ts +1 -1
  410. package/lib/field/components/Radio/index.js +61 -63
  411. package/lib/field/components/RangePicker/index.d.ts +1 -1
  412. package/lib/field/components/RangePicker/index.js +52 -63
  413. package/lib/field/components/Rate/index.js +24 -21
  414. package/lib/field/components/Second/index.js +36 -33
  415. package/lib/field/components/Segmented/index.d.ts +1 -1
  416. package/lib/field/components/Segmented/index.js +37 -48
  417. package/lib/field/components/Select/LightSelect/index.d.ts +1 -1
  418. package/lib/field/components/Select/LightSelect/index.js +103 -110
  419. package/lib/field/components/Select/SearchSelect/index.js +133 -156
  420. package/lib/field/components/Select/index.d.ts +1 -1
  421. package/lib/field/components/Select/index.js +194 -218
  422. package/lib/field/components/Slider/index.js +25 -22
  423. package/lib/field/components/Status/index.js +69 -79
  424. package/lib/field/components/Switch/index.d.ts +1 -1
  425. package/lib/field/components/Switch/index.js +32 -31
  426. package/lib/field/components/Text/index.js +34 -38
  427. package/lib/field/components/TextArea/index.js +26 -21
  428. package/lib/field/components/TextArea/readonly.js +24 -22
  429. package/lib/field/components/TimePicker/index.js +96 -105
  430. package/lib/field/components/TreeSelect/index.d.ts +2 -2
  431. package/lib/field/components/TreeSelect/index.js +105 -124
  432. package/lib/field/index.js +34 -34
  433. package/lib/form/BaseForm/BaseForm.js +413 -499
  434. package/lib/form/BaseForm/EditOrReadOnlyContext.js +1 -1
  435. package/lib/form/BaseForm/LightWrapper/index.js +57 -66
  436. package/lib/form/BaseForm/LightWrapper/style.js +17 -14
  437. package/lib/form/BaseForm/Submitter/index.js +44 -44
  438. package/lib/form/BaseForm/index.js +3 -3
  439. package/lib/form/FieldContext.js +1 -1
  440. package/lib/form/components/Captcha/index.js +74 -135
  441. package/lib/form/components/Cascader/index.js +26 -29
  442. package/lib/form/components/Checkbox/index.js +60 -61
  443. package/lib/form/components/ColorPicker/index.js +24 -26
  444. package/lib/form/components/DatePicker/BaseDatePicker.js +32 -30
  445. package/lib/form/components/DatePicker/DatePicker.js +14 -13
  446. package/lib/form/components/DatePicker/DateTimePicker.js +11 -12
  447. package/lib/form/components/DatePicker/MonthPicker.js +14 -13
  448. package/lib/form/components/DatePicker/QuarterPicker.js +14 -13
  449. package/lib/form/components/DatePicker/TimePicker.js +26 -27
  450. package/lib/form/components/DatePicker/WeekPicker.js +14 -13
  451. package/lib/form/components/DatePicker/YearPicker.js +14 -13
  452. package/lib/form/components/DatePicker/index.js +1 -1
  453. package/lib/form/components/DateRangePicker/BaseDateRanger.js +34 -34
  454. package/lib/form/components/DateRangePicker/DateMonthRangePicker.js +15 -16
  455. package/lib/form/components/DateRangePicker/DateQuarterRangePicker.js +15 -16
  456. package/lib/form/components/DateRangePicker/DateTimeRangePicker.js +15 -16
  457. package/lib/form/components/DateRangePicker/DateWeekRangePicker.js +15 -16
  458. package/lib/form/components/DateRangePicker/DateYearRangePicker.js +15 -16
  459. package/lib/form/components/DateRangePicker/TimeRangePicker.js +26 -29
  460. package/lib/form/components/DateRangePicker/index.js +15 -16
  461. package/lib/form/components/Dependency/index.js +31 -35
  462. package/lib/form/components/Digit/DigitRange.js +23 -24
  463. package/lib/form/components/Digit/index.js +27 -29
  464. package/lib/form/components/Field/index.js +55 -63
  465. package/lib/form/components/FieldSet/index.js +68 -76
  466. package/lib/form/components/FormItem/FormItemRender/index.js +58 -48
  467. package/lib/form/components/FormItem/Group/index.js +95 -95
  468. package/lib/form/components/FormItem/Group/style.js +46 -41
  469. package/lib/form/components/FormItem/index.js +135 -141
  470. package/lib/form/components/FormItem/warpField.js +165 -149
  471. package/lib/form/components/List/ListContainer.js +100 -191
  472. package/lib/form/components/List/ListItem.js +153 -200
  473. package/lib/form/components/List/index.js +97 -107
  474. package/lib/form/components/List/style.js +71 -48
  475. package/lib/form/components/Money/index.js +28 -30
  476. package/lib/form/components/Radio/index.js +45 -49
  477. package/lib/form/components/Rate/index.js +17 -21
  478. package/lib/form/components/SchemaForm/index.js +54 -68
  479. package/lib/form/components/SchemaForm/layoutType/Embed.js +5 -6
  480. package/lib/form/components/SchemaForm/layoutType/StepsForm.js +22 -26
  481. package/lib/form/components/SchemaForm/layoutType/index.js +2 -2
  482. package/lib/form/components/SchemaForm/valueType/dependency.js +13 -12
  483. package/lib/form/components/SchemaForm/valueType/divider.js +6 -7
  484. package/lib/form/components/SchemaForm/valueType/field.js +47 -45
  485. package/lib/form/components/SchemaForm/valueType/formList.js +10 -9
  486. package/lib/form/components/SchemaForm/valueType/formSet.js +10 -8
  487. package/lib/form/components/SchemaForm/valueType/group.js +9 -10
  488. package/lib/form/components/SchemaForm/valueType/ignore.js +4 -3
  489. package/lib/form/components/SchemaForm/valueType/index.js +7 -6
  490. package/lib/form/components/Segmented/index.js +20 -24
  491. package/lib/form/components/Select/index.js +69 -73
  492. package/lib/form/components/Slider/index.js +33 -35
  493. package/lib/form/components/Switch/index.js +24 -26
  494. package/lib/form/components/Text/index.js +73 -84
  495. package/lib/form/components/TextArea/index.js +17 -21
  496. package/lib/form/components/TreeSelect/index.js +20 -23
  497. package/lib/form/components/UploadButton/index.js +56 -103
  498. package/lib/form/components/UploadDragger/index.js +37 -44
  499. package/lib/form/components/index.js +42 -42
  500. package/lib/form/helpers/grid.js +68 -69
  501. package/lib/form/helpers/index.js +1 -1
  502. package/lib/form/index.js +8 -8
  503. package/lib/form/layouts/DrawerForm/index.js +149 -241
  504. package/lib/form/layouts/DrawerForm/style.js +26 -26
  505. package/lib/form/layouts/LightFilter/index.d.ts +12 -1
  506. package/lib/form/layouts/LightFilter/index.js +158 -141
  507. package/lib/form/layouts/LightFilter/style.js +52 -49
  508. package/lib/form/layouts/LoginForm/index.js +44 -48
  509. package/lib/form/layouts/LoginForm/style.js +71 -68
  510. package/lib/form/layouts/LoginFormPage/index.js +45 -49
  511. package/lib/form/layouts/LoginFormPage/style.js +136 -127
  512. package/lib/form/layouts/ModalForm/index.js +118 -203
  513. package/lib/form/layouts/ProForm/index.d.ts +1 -1
  514. package/lib/form/layouts/ProForm/index.js +5 -5
  515. package/lib/form/layouts/QueryFilter/Actions.js +23 -22
  516. package/lib/form/layouts/QueryFilter/index.js +177 -202
  517. package/lib/form/layouts/QueryFilter/style.js +45 -38
  518. package/lib/form/layouts/StepsForm/StepForm.d.ts +2 -3
  519. package/lib/form/layouts/StepsForm/StepForm.js +50 -72
  520. package/lib/form/layouts/StepsForm/index.js +174 -216
  521. package/lib/form/layouts/StepsForm/style.js +30 -29
  522. package/lib/form/layouts/index.js +9 -9
  523. package/lib/index.js +11 -11
  524. package/lib/layout/ProLayout.js +281 -292
  525. package/lib/layout/WrapContent.js +18 -14
  526. package/lib/layout/assert/Logo.js +96 -97
  527. package/lib/layout/components/AppsLogoComponents/AppsLogo.js +11 -12
  528. package/lib/layout/components/AppsLogoComponents/DefaultContent.js +19 -17
  529. package/lib/layout/components/AppsLogoComponents/SimpleContent.js +22 -19
  530. package/lib/layout/components/AppsLogoComponents/index.js +36 -40
  531. package/lib/layout/components/AppsLogoComponents/style/default.js +4 -3
  532. package/lib/layout/components/AppsLogoComponents/style/index.js +52 -51
  533. package/lib/layout/components/AppsLogoComponents/style/simple.js +3 -2
  534. package/lib/layout/components/CollapsedIcon/index.js +20 -17
  535. package/lib/layout/components/CollapsedIcon/style.js +40 -41
  536. package/lib/layout/components/Footer.js +23 -22
  537. package/lib/layout/components/FooterToolbar/index.js +59 -53
  538. package/lib/layout/components/FooterToolbar/style/index.js +38 -38
  539. package/lib/layout/components/FooterToolbar/style/stylish.js +11 -10
  540. package/lib/layout/components/GlobalFooter/index.js +27 -27
  541. package/lib/layout/components/GlobalFooter/style.js +31 -31
  542. package/lib/layout/components/GlobalHeader/ActionsContent.js +65 -81
  543. package/lib/layout/components/GlobalHeader/index.js +61 -49
  544. package/lib/layout/components/GlobalHeader/rightContentStyle.js +49 -50
  545. package/lib/layout/components/GlobalHeader/style.js +58 -55
  546. package/lib/layout/components/GridContent/index.js +26 -21
  547. package/lib/layout/components/GridContent/style.js +14 -14
  548. package/lib/layout/components/Header/index.js +65 -59
  549. package/lib/layout/components/Header/style/header.js +49 -48
  550. package/lib/layout/components/Header/style/stylish.js +15 -12
  551. package/lib/layout/components/Help/AsyncContentPanel.js +15 -20
  552. package/lib/layout/components/Help/HelpProvide.js +1 -1
  553. package/lib/layout/components/Help/ProHelpContentPanel.js +66 -85
  554. package/lib/layout/components/Help/ProHelpDrawer.js +27 -32
  555. package/lib/layout/components/Help/ProHelpModal.d.ts +1 -1
  556. package/lib/layout/components/Help/ProHelpModal.js +26 -28
  557. package/lib/layout/components/Help/ProHelpPanel.js +86 -94
  558. package/lib/layout/components/Help/ProHelpPopover.js +20 -18
  559. package/lib/layout/components/Help/RenderContentPanel.js +36 -26
  560. package/lib/layout/components/Help/Search.js +55 -80
  561. package/lib/layout/components/Help/index.js +19 -20
  562. package/lib/layout/components/Help/style.js +82 -76
  563. package/lib/layout/components/PageContainer/index.js +172 -151
  564. package/lib/layout/components/PageContainer/style/index.js +95 -79
  565. package/lib/layout/components/PageContainer/style/stylish.js +11 -10
  566. package/lib/layout/components/PageHeader/index.js +99 -99
  567. package/lib/layout/components/PageHeader/style/index.js +142 -123
  568. package/lib/layout/components/PageLoading/index.js +18 -20
  569. package/lib/layout/components/SettingDrawer/BlockCheckbox.js +31 -34
  570. package/lib/layout/components/SettingDrawer/LayoutChange.js +25 -23
  571. package/lib/layout/components/SettingDrawer/RegionalChange.js +16 -16
  572. package/lib/layout/components/SettingDrawer/ThemeColor.js +34 -36
  573. package/lib/layout/components/SettingDrawer/index.js +138 -168
  574. package/lib/layout/components/SettingDrawer/style/index.js +141 -138
  575. package/lib/layout/components/SiderMenu/BaseMenu.js +235 -221
  576. package/lib/layout/components/SiderMenu/SiderMenu.js +128 -117
  577. package/lib/layout/components/SiderMenu/index.js +49 -44
  578. package/lib/layout/components/SiderMenu/style/index.js +179 -162
  579. package/lib/layout/components/SiderMenu/style/menu.js +148 -111
  580. package/lib/layout/components/SiderMenu/style/stylish.js +15 -12
  581. package/lib/layout/components/TopNavHeader/index.js +73 -62
  582. package/lib/layout/components/TopNavHeader/style.js +64 -64
  583. package/lib/layout/context/RouteContext.js +1 -1
  584. package/lib/layout/defaultSettings.js +1 -1
  585. package/lib/layout/getPageTitle.js +27 -26
  586. package/lib/layout/index.js +16 -16
  587. package/lib/layout/locales/en-US.js +3 -2
  588. package/lib/layout/locales/index.js +8 -6
  589. package/lib/layout/locales/it-IT.js +3 -2
  590. package/lib/layout/locales/ko-KR.js +3 -2
  591. package/lib/layout/locales/zh-CN.js +3 -2
  592. package/lib/layout/locales/zh-TW.js +3 -2
  593. package/lib/layout/style/index.js +48 -43
  594. package/lib/layout/utils/getBreadcrumbProps.js +65 -62
  595. package/lib/layout/utils/getMenuData.js +9 -13
  596. package/lib/layout/utils/pathTools.js +2 -6
  597. package/lib/layout/utils/useCurrentMenuLayoutProps.js +6 -11
  598. package/lib/layout/utils/utils.js +16 -18
  599. package/lib/list/Item.js +155 -136
  600. package/lib/list/ListView.js +110 -119
  601. package/lib/list/constants.js +2 -2
  602. package/lib/list/index.js +72 -70
  603. package/lib/list/style/index.js +281 -214
  604. package/lib/provider/index.js +128 -118
  605. package/lib/provider/intl.js +56 -56
  606. package/lib/provider/typing/layoutToken.js +28 -25
  607. package/lib/provider/useStyle/index.js +55 -60
  608. package/lib/provider/utils/merge.js +12 -14
  609. package/lib/skeleton/components/Descriptions/index.js +213 -229
  610. package/lib/skeleton/components/List/index.js +211 -221
  611. package/lib/skeleton/components/Result/index.js +45 -47
  612. package/lib/skeleton/index.js +23 -19
  613. package/lib/table/Store/Provide.d.ts +4 -4
  614. package/lib/table/Store/Provide.js +103 -117
  615. package/lib/table/Table.d.ts +5 -2
  616. package/lib/table/Table.js +524 -689
  617. package/lib/table/TableSearch.d.ts +24 -0
  618. package/lib/table/TableSearch.js +61 -0
  619. package/lib/table/TableToolbar.d.ts +22 -0
  620. package/lib/table/TableToolbar.js +55 -0
  621. package/lib/table/components/Alert/index.js +41 -40
  622. package/lib/table/components/Alert/style.js +28 -28
  623. package/lib/table/components/ColumnSetting/index.js +228 -224
  624. package/lib/table/components/ColumnSetting/style.js +86 -72
  625. package/lib/table/components/DragSortTable/index.js +64 -78
  626. package/lib/table/components/DragSortTable/style.js +20 -20
  627. package/lib/table/components/Dropdown/index.js +42 -48
  628. package/lib/table/components/EditableTable/CellEditorTable.js +24 -32
  629. package/lib/table/components/EditableTable/RowEditorTable.js +23 -28
  630. package/lib/table/components/EditableTable/index.js +293 -327
  631. package/lib/table/components/Form/FormRender.js +99 -104
  632. package/lib/table/components/Form/index.d.ts +4 -19
  633. package/lib/table/components/Form/index.js +113 -159
  634. package/lib/table/components/ListToolBar/HeaderMenu.js +42 -51
  635. package/lib/table/components/ListToolBar/index.js +123 -148
  636. package/lib/table/components/ListToolBar/style.js +127 -118
  637. package/lib/table/components/ToolBar/DensityIcon.js +10 -9
  638. package/lib/table/components/ToolBar/FullscreenIcon.js +5 -10
  639. package/lib/table/components/ToolBar/index.d.ts +2 -8
  640. package/lib/table/components/ToolBar/index.js +154 -194
  641. package/lib/table/index.js +27 -27
  642. package/lib/table/style/index.js +144 -113
  643. package/lib/table/typing.d.ts +4 -0
  644. package/lib/table/useFetchData.js +197 -337
  645. package/lib/table/utils/cellRenderToFromItem.js +106 -120
  646. package/lib/table/utils/columnRender.js +65 -54
  647. package/lib/table/utils/columnSort.js +24 -23
  648. package/lib/table/utils/genProColumnToColumn.d.ts +13 -9
  649. package/lib/table/utils/genProColumnToColumn.js +121 -99
  650. package/lib/table/utils/index.d.ts +10 -0
  651. package/lib/table/utils/index.js +127 -181
  652. package/lib/table/utils/useDragSort.d.ts +1 -1
  653. package/lib/table/utils/useDragSort.js +99 -93
  654. package/lib/table/utils/usePageInfo.d.ts +6 -0
  655. package/lib/table/utils/usePageInfo.js +61 -0
  656. package/lib/utils/components/DropdownFooter/index.js +25 -23
  657. package/lib/utils/components/DropdownFooter/style.js +16 -16
  658. package/lib/utils/components/ErrorBoundary/index.js +28 -50
  659. package/lib/utils/components/FieldLabel/index.js +70 -71
  660. package/lib/utils/components/FieldLabel/style.js +104 -82
  661. package/lib/utils/components/FilterDropdown/index.d.ts +11 -0
  662. package/lib/utils/components/FilterDropdown/index.js +44 -33
  663. package/lib/utils/components/FilterDropdown/style.js +19 -17
  664. package/lib/utils/components/InlineErrorFormItem/index.js +80 -80
  665. package/lib/utils/components/InlineErrorFormItem/style.js +56 -50
  666. package/lib/utils/components/LabelIconTip/index.js +30 -32
  667. package/lib/utils/components/LabelIconTip/style.js +36 -36
  668. package/lib/utils/components/ProFormContext/index.js +1 -1
  669. package/lib/utils/conversionMomentValue/index.js +22 -23
  670. package/lib/utils/dateArrayFormatter/index.js +11 -15
  671. package/lib/utils/genCopyable/index.js +75 -33
  672. package/lib/utils/getFieldPropsOrFormItemProps/index.js +3 -2
  673. package/lib/utils/hooks/useDebounceFn/index.js +18 -52
  674. package/lib/utils/hooks/useDebounceValue/index.js +7 -17
  675. package/lib/utils/hooks/useDeepCompareEffect/index.js +7 -19
  676. package/lib/utils/hooks/useDocumentTitle/index.js +2 -2
  677. package/lib/utils/hooks/useFetchData/index.js +36 -65
  678. package/lib/utils/hooks/useForceRender/index.js +2 -10
  679. package/lib/utils/hooks/useLatest/index.js +4 -3
  680. package/lib/utils/hooks/usePrevious/index.js +5 -4
  681. package/lib/utils/hooks/useReactiveRef/index.js +2 -2
  682. package/lib/utils/hooks/useRefCallback/index.js +3 -3
  683. package/lib/utils/hooks/useRefFunction/index.js +6 -11
  684. package/lib/utils/index.d.ts +1 -2
  685. package/lib/utils/index.js +57 -65
  686. package/lib/utils/isBrowser/index.js +4 -3
  687. package/lib/utils/isDeepEqualReact/index.js +9 -45
  688. package/lib/utils/isDropdownValueType/index.js +4 -3
  689. package/lib/utils/isNil/index.js +2 -3
  690. package/lib/utils/isUrl/index.js +4 -3
  691. package/lib/utils/merge/index.js +12 -14
  692. package/lib/utils/nanoid/index.js +7 -7
  693. package/lib/utils/omitBoolean/index.js +3 -2
  694. package/lib/utils/omitUndefined/index.js +5 -4
  695. package/lib/utils/omitUndefinedAndEmptyArr/index.js +6 -6
  696. package/lib/utils/parseValueToMoment/index.js +5 -8
  697. package/lib/utils/pickProFormItemProps/index.js +3 -3
  698. package/lib/utils/pickProProps/index.js +6 -7
  699. package/lib/utils/proFieldParsingText/index.js +89 -99
  700. package/lib/utils/runFunction/index.js +2 -5
  701. package/lib/utils/stringify/index.js +2 -2
  702. package/lib/utils/transformKeySubmitValue/index.js +101 -117
  703. package/lib/utils/useEditableArray/index.d.ts +6 -1
  704. package/lib/utils/useEditableArray/index.js +582 -735
  705. package/lib/utils/useEditableMap/index.d.ts +1 -1
  706. package/lib/utils/useEditableMap/index.js +88 -135
  707. package/lib/utils/useMediaQuery/index.js +40 -35
  708. package/lib/utils/useMediaQuery/query.js +7 -18
  709. package/lib/version.js +1 -1
  710. package/package.json +20 -31
  711. package/es/utils/useMountMergeState/index.d.ts +0 -2
  712. package/es/utils/useMountMergeState/index.js +0 -2
  713. package/lib/utils/useMountMergeState/index.d.ts +0 -2
  714. package/lib/utils/useMountMergeState/index.js +0 -12
@@ -1,20 +1,11 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
5
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
6
- import _typeof from "@babel/runtime/helpers/esm/typeof";
7
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
8
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
9
- var _excluded = ["children", "contentRender", "submitter", "fieldProps", "formItemProps", "groupProps", "transformKey", "formRef", "onInit", "form", "loading", "formComponentType", "extraUrlParams", "syncToUrl", "onUrlSearchChange", "onReset", "omitNil", "isKeyPressSubmit", "autoFocusFirstInput", "grid", "rowProps", "colProps"],
10
- _excluded2 = ["extraUrlParams", "syncToUrl", "isKeyPressSubmit", "syncToUrlAsImportant", "syncToInitialValues", "children", "contentRender", "submitter", "fieldProps", "proFieldProps", "formItemProps", "groupProps", "dateFormatter", "formRef", "onInit", "form", "formComponentType", "onReset", "grid", "rowProps", "colProps", "omitNil", "request", "params", "initialValues", "formKey", "readonly", "onLoadingChange", "loading"];
11
- /* eslint-disable react-hooks/exhaustive-deps */import { get, set as namePathSet, omit, set, warning } from '@rc-component/util';
1
+ /* eslint-disable react-hooks/exhaustive-deps */
2
+ import { get, set as namePathSet, omit, set, useControlledState, warning } from '@rc-component/util';
12
3
  import { useUrlSearchParams } from '@umijs/use-params';
13
4
  import { ConfigProvider, Form, Spin } from 'antd';
14
- import classNames from 'classnames';
15
- import React, { useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
5
+ import { clsx } from 'clsx';
6
+ import React, { useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
16
7
  import { ProConfigProvider } from "../../provider";
17
- import { ProFormContext, conversionMomentValue, isDeepEqualReact, nanoid, runFunction, transformKeySubmitValue, useFetchData, useMountMergeState, usePrevious, useRefFunction, useStyle } from "../../utils";
8
+ import { conversionMomentValue, isDeepEqualReact, nanoid, ProFormContext, runFunction, transformKeySubmitValue, useFetchData, usePrevious, useRefFunction, useStyle } from "../../utils";
18
9
  import { FormListContext } from "../components/List";
19
10
  import FieldContext from "../FieldContext";
20
11
  import { GridContext, useGridHelpers } from "../helpers";
@@ -22,11 +13,13 @@ import { EditOrReadOnlyContext } from "./EditOrReadOnlyContext";
22
13
  import Submitter from "./Submitter";
23
14
  import { jsx as _jsx } from "react/jsx-runtime";
24
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
25
- var noteOnce = warning.noteOnce;
16
+ const {
17
+ noteOnce
18
+ } = warning;
26
19
 
27
20
  // Define ProFormInstance and ProFormRef
28
21
 
29
- var genParams = function genParams(syncUrl, params, type) {
22
+ const genParams = (syncUrl, params, type) => {
30
23
  if (syncUrl === true) {
31
24
  return params;
32
25
  }
@@ -41,228 +34,198 @@ var genParams = function genParams(syncUrl, params, type) {
41
34
  * a-> [a]
42
35
  * [a] -> [a]
43
36
  */
44
- var covertFormName = function covertFormName(name) {
37
+ const covertFormName = name => {
45
38
  if (!name) return name;
46
39
  if (Array.isArray(name)) return name;
47
40
  return [name];
48
41
  };
49
- var defaultExtraUrlParams = {};
42
+ const defaultExtraUrlParams = {};
50
43
  function BaseFormComponents(props) {
51
- var _ConfigProvider$useCo;
52
- var children = props.children,
53
- contentRender = props.contentRender,
54
- submitter = props.submitter,
55
- fieldProps = props.fieldProps,
56
- formItemProps = props.formItemProps,
57
- groupProps = props.groupProps,
58
- transformKey = props.transformKey,
59
- propsFormRef = props.formRef,
60
- onInit = props.onInit,
61
- form = props.form,
62
- loading = props.loading,
63
- formComponentType = props.formComponentType,
64
- _props$extraUrlParams = props.extraUrlParams,
65
- extraUrlParams = _props$extraUrlParams === void 0 ? defaultExtraUrlParams : _props$extraUrlParams,
66
- syncToUrl = props.syncToUrl,
67
- onUrlSearchChange = props.onUrlSearchChange,
68
- _onReset = props.onReset,
69
- _props$omitNil = props.omitNil,
70
- omitNil = _props$omitNil === void 0 ? true : _props$omitNil,
71
- isKeyPressSubmit = props.isKeyPressSubmit,
72
- _props$autoFocusFirst = props.autoFocusFirstInput,
73
- autoFocusFirstInput = _props$autoFocusFirst === void 0 ? true : _props$autoFocusFirst,
74
- grid = props.grid,
75
- rowProps = props.rowProps,
76
- colProps = props.colProps,
77
- rest = _objectWithoutProperties(props, _excluded);
44
+ const {
45
+ children,
46
+ contentRender,
47
+ submitter,
48
+ fieldProps,
49
+ formItemProps,
50
+ groupProps,
51
+ transformKey,
52
+ formRef: propsFormRef,
53
+ onInit,
54
+ form,
55
+ loading,
56
+ formComponentType,
57
+ extraUrlParams = defaultExtraUrlParams,
58
+ syncToUrl,
59
+ onUrlSearchChange,
60
+ onReset,
61
+ omitNil = true,
62
+ isKeyPressSubmit,
63
+ autoFocusFirstInput = true,
64
+ grid,
65
+ rowProps,
66
+ colProps,
67
+ ...rest
68
+ } = props;
78
69
 
79
70
  /**
80
71
  * 获取 form 实例
81
72
  */
82
- var formInstance = Form.useFormInstance();
83
- var _ref = (ConfigProvider === null || ConfigProvider === void 0 || (_ConfigProvider$useCo = ConfigProvider.useConfig) === null || _ConfigProvider$useCo === void 0 ? void 0 : _ConfigProvider$useCo.call(ConfigProvider)) || {
84
- componentSize: 'middle'
85
- },
86
- componentSize = _ref.componentSize;
73
+ const formInstance = Form.useFormInstance();
74
+ const {
75
+ componentSize
76
+ } = ConfigProvider?.useConfig?.() || {
77
+ componentSize: 'middle'
78
+ };
87
79
 
88
80
  /** 同步 url 上的参数 */
89
- var formRef = useRef(form || formInstance);
81
+ const formRef = useRef(form || formInstance);
90
82
 
91
83
  /**
92
84
  * 获取布局
93
85
  */
94
- var _useGridHelpers = useGridHelpers({
95
- grid: grid,
96
- rowProps: rowProps
97
- }),
98
- RowWrapper = _useGridHelpers.RowWrapper;
99
- var getFormInstance = useRefFunction(function () {
100
- return formInstance;
86
+ const {
87
+ RowWrapper
88
+ } = useGridHelpers({
89
+ grid,
90
+ rowProps
101
91
  });
102
- var formatValues = useMemo(function () {
103
- return {
104
- /**
105
- * 获取被 ProForm 格式化后的所有数据
106
- * @param allData boolean
107
- * @param omitNilParam boolean
108
- * @returns T
109
- *
110
- * @example getFieldsFormatValue(true) ->返回所有数据,即使没有被 form 托管的
111
- */
112
- getFieldsFormatValue: function getFieldsFormatValue(allData, omitNilParam) {
113
- var formInstance = getFormInstance();
114
- if (!formInstance) {
115
- return {};
116
- }
117
- var values = formInstance.getFieldsValue(allData);
118
- return transformKey(values, omitNilParam !== undefined ? omitNilParam : omitNil);
119
- },
120
- /**
121
- * 获取被 ProForm 格式化后的单个数据
122
- * @param nameList (string|number)[]
123
- * @param omitNilParam boolean
124
- * @returns T
125
- *
126
- * @example {a:{b:value}} -> getFieldFormatValue(['a', 'b']) -> value
127
- */
128
- /** 获取格式化之后的单个数据 */
129
- getFieldFormatValue: function getFieldFormatValue() {
130
- var paramsNameList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
131
- var omitNilParam = arguments.length > 1 ? arguments[1] : undefined;
132
- var formInstance = getFormInstance();
133
- if (!formInstance) {
134
- return undefined;
135
- }
136
- var nameList = covertFormName(paramsNameList);
137
- if (!nameList) throw new Error('nameList is require');
138
- var value = formInstance.getFieldValue(nameList);
139
- var obj = nameList ? set({}, nameList, value) : value;
140
- //transformKey会将keys重新和nameList拼接,所以这里要将nameList的首个元素弹出
141
- var newNameList = _toConsumableArray(nameList);
142
- newNameList.shift();
143
- var transformed = transformKey(obj, omitNilParam !== undefined ? omitNilParam : omitNil, newNameList);
144
- var result = get(transformed, nameList);
145
- // 如果结果是对象,返回对象的值
146
- if (result && _typeof(result) === 'object' && !Array.isArray(result)) {
147
- var objValue = Object.values(result)[0];
148
- // 如果对象的值是数组,返回数组
149
- if (Array.isArray(objValue)) {
150
- return objValue;
151
- }
92
+ const getFormInstance = useRefFunction(() => formInstance);
93
+ const formatValues = useMemo(() => ({
94
+ /**
95
+ * 获取被 ProForm 格式化后的所有数据
96
+ * @param allData boolean
97
+ * @param omitNilParam boolean
98
+ * @returns T
99
+ *
100
+ * @example getFieldsFormatValue(true) ->返回所有数据,即使没有被 form 托管的
101
+ */
102
+ getFieldsFormatValue: (allData, omitNilParam) => {
103
+ const formInstance = getFormInstance();
104
+ if (!formInstance) {
105
+ return {};
106
+ }
107
+ const values = formInstance.getFieldsValue(allData);
108
+ return transformKey(values, omitNilParam !== undefined ? omitNilParam : omitNil);
109
+ },
110
+ /**
111
+ * 获取被 ProForm 格式化后的单个数据
112
+ * @param nameList (string|number)[]
113
+ * @param omitNilParam boolean
114
+ * @returns T
115
+ *
116
+ * @example {a:{b:value}} -> getFieldFormatValue(['a', 'b']) -> value
117
+ */
118
+ /** 获取格式化之后的单个数据 */
119
+ getFieldFormatValue: (paramsNameList = [], omitNilParam) => {
120
+ const formInstance = getFormInstance();
121
+ if (!formInstance) {
122
+ return undefined;
123
+ }
124
+ const nameList = covertFormName(paramsNameList);
125
+ if (!nameList) throw new Error('nameList is require');
126
+ const value = formInstance.getFieldValue(nameList);
127
+ const obj = nameList ? set({}, nameList, value) : value;
128
+ //transformKey会将keys重新和nameList拼接,所以这里要将nameList的首个元素弹出
129
+ const newNameList = [...nameList];
130
+ newNameList.shift();
131
+ const transformed = transformKey(obj, omitNilParam !== undefined ? omitNilParam : omitNil, newNameList);
132
+ const result = get(transformed, nameList);
133
+ // 如果结果是对象,返回对象的值
134
+ if (result && typeof result === 'object' && !Array.isArray(result)) {
135
+ const objValue = Object.values(result)[0];
136
+ // 如果对象的值是数组,返回数组
137
+ if (Array.isArray(objValue)) {
152
138
  return objValue;
153
139
  }
154
- return result;
155
- },
156
- /**
157
- * 获取被 ProForm 格式化后的单个数据, 包含他的 name
158
- * @param nameList (string|number)[]
159
- * @param omitNilParam boolean
160
- * @returns T
161
- *
162
- * @example {a:{b:value}} -> getFieldFormatValueObject(['a', 'b']) -> {a:{b:value}}
163
- */
164
- /** 获取格式化之后的单个数据 */
165
- getFieldFormatValueObject: function getFieldFormatValueObject(paramsNameList, omitNilParam) {
166
- var formInstance = getFormInstance();
167
- if (!formInstance) {
168
- return {};
169
- }
170
- var nameList = covertFormName(paramsNameList);
171
- var value = formInstance.getFieldValue(nameList);
172
- var obj = nameList ? set({}, nameList, value) : value;
173
- return transformKey(obj, omitNilParam !== undefined ? omitNilParam : omitNil, nameList);
174
- },
175
- /**
176
- /**
177
- *验字段后返回格式化之后的所有数据
178
- * @param nameList (string|number)[]
179
- * @param omitNilParam boolean
180
- * @returns T
181
- *
182
- * @example validateFieldsReturnFormatValue -> {a:{b:value}}
183
- */
184
- validateFieldsReturnFormatValue: function () {
185
- var _validateFieldsReturnFormatValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(nameList, omitNilParam) {
186
- var formInstance, values, transformedKey;
187
- return _regeneratorRuntime().wrap(function _callee$(_context) {
188
- while (1) switch (_context.prev = _context.next) {
189
- case 0:
190
- formInstance = getFormInstance();
191
- if (formInstance) {
192
- _context.next = 3;
193
- break;
194
- }
195
- return _context.abrupt("return", {});
196
- case 3:
197
- if (!(!Array.isArray(nameList) && nameList)) {
198
- _context.next = 5;
199
- break;
200
- }
201
- throw new Error('nameList must be array');
202
- case 5:
203
- _context.next = 7;
204
- return formInstance.validateFields(nameList);
205
- case 7:
206
- values = _context.sent;
207
- transformedKey = transformKey(values, omitNilParam !== undefined ? omitNilParam : omitNil);
208
- return _context.abrupt("return", transformedKey ? transformedKey : {});
209
- case 10:
210
- case "end":
211
- return _context.stop();
212
- }
213
- }, _callee);
214
- }));
215
- function validateFieldsReturnFormatValue(_x, _x2) {
216
- return _validateFieldsReturnFormatValue.apply(this, arguments);
217
- }
218
- return validateFieldsReturnFormatValue;
219
- }()
220
- };
221
- }, [omitNil, transformKey, getFormInstance]);
222
- var items = useMemo(function () {
223
- return React.Children.toArray(children).map(function (item, index) {
140
+ return objValue;
141
+ }
142
+ return result;
143
+ },
144
+ /**
145
+ * 获取被 ProForm 格式化后的单个数据, 包含他的 name
146
+ * @param nameList (string|number)[]
147
+ * @param omitNilParam boolean
148
+ * @returns T
149
+ *
150
+ * @example {a:{b:value}} -> getFieldFormatValueObject(['a', 'b']) -> {a:{b:value}}
151
+ */
152
+ /** 获取格式化之后的单个数据 */
153
+ getFieldFormatValueObject: (paramsNameList, omitNilParam) => {
154
+ const formInstance = getFormInstance();
155
+ if (!formInstance) {
156
+ return {};
157
+ }
158
+ const nameList = covertFormName(paramsNameList);
159
+ const value = formInstance.getFieldValue(nameList);
160
+ const obj = nameList ? set({}, nameList, value) : value;
161
+ return transformKey(obj, omitNilParam !== undefined ? omitNilParam : omitNil, nameList);
162
+ },
163
+ /**
164
+ /**
165
+ *验字段后返回格式化之后的所有数据
166
+ * @param nameList (string|number)[]
167
+ * @param omitNilParam boolean
168
+ * @returns T
169
+ *
170
+ * @example validateFieldsReturnFormatValue -> {a:{b:value}}
171
+ */
172
+ validateFieldsReturnFormatValue: async (nameList, omitNilParam) => {
173
+ const formInstance = getFormInstance();
174
+ if (!formInstance) {
175
+ return {};
176
+ }
177
+ if (!Array.isArray(nameList) && nameList) throw new Error('nameList must be array');
178
+ const values = await formInstance.validateFields(nameList);
179
+ const transformedKey = transformKey(values, omitNilParam !== undefined ? omitNilParam : omitNil);
180
+ return transformedKey ? transformedKey : {};
181
+ }
182
+ }), [omitNil, transformKey, getFormInstance]);
183
+ const items = useMemo(() => {
184
+ return React.Children.toArray(children).map((item, index) => {
224
185
  if (index === 0 && /*#__PURE__*/React.isValidElement(item) && autoFocusFirstInput) {
225
- return /*#__PURE__*/React.cloneElement(item, _objectSpread(_objectSpread({}, item.props), {}, {
186
+ return /*#__PURE__*/React.cloneElement(item, {
187
+ ...item.props,
226
188
  autoFocus: autoFocusFirstInput
227
- }));
189
+ });
228
190
  }
229
191
  return item;
230
192
  });
231
193
  }, [autoFocusFirstInput, children]);
232
194
 
233
195
  /** 计算 props 的对象 */
234
- var submitterProps = useMemo(function () {
235
- return typeof submitter === 'boolean' || !submitter ? {} : submitter;
236
- }, [submitter]);
196
+ const submitterProps = useMemo(() => typeof submitter === 'boolean' || !submitter ? {} : submitter, [submitter]);
237
197
 
238
198
  /** 渲染提交按钮与重置按钮 */
239
- var submitterNode = useMemo(function () {
199
+ const submitterNode = useMemo(() => {
240
200
  if (submitter === false) return undefined;
241
- return /*#__PURE__*/_jsx(Submitter, _objectSpread(_objectSpread({}, submitterProps), {}, {
242
- onReset: function onReset() {
243
- var _formRef$current, _submitterProps$onRes;
244
- var finalValues = transformKey((_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getFieldsValue(), omitNil);
245
- submitterProps === null || submitterProps === void 0 || (_submitterProps$onRes = submitterProps.onReset) === null || _submitterProps$onRes === void 0 || _submitterProps$onRes.call(submitterProps, finalValues);
246
- _onReset === null || _onReset === void 0 || _onReset(finalValues);
201
+ return /*#__PURE__*/_jsx(Submitter, {
202
+ ...submitterProps,
203
+ onReset: () => {
204
+ const finalValues = transformKey(formRef.current?.getFieldsValue(), omitNil);
205
+ submitterProps?.onReset?.(finalValues);
206
+ onReset?.(finalValues);
247
207
  // 如果 syncToUrl,清空一下数据
248
208
  if (syncToUrl) {
249
- var _formRef$current2;
250
209
  // 把没有的值设置为未定义可以删掉 url 的参数
251
- var params = Object.keys(transformKey((_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldsValue(), false)).reduce(function (pre, next) {
252
- return _objectSpread(_objectSpread({}, pre), {}, _defineProperty({}, next, finalValues[next] || undefined));
210
+ const params = Object.keys(transformKey(formRef.current?.getFieldsValue(), false)).reduce((pre, next) => {
211
+ return {
212
+ ...pre,
213
+ [next]: finalValues[next] || undefined
214
+ };
253
215
  }, extraUrlParams);
254
216
 
255
217
  /** 在同步到 url 上时对参数进行转化 */
256
218
  onUrlSearchChange(genParams(syncToUrl, params || {}, 'set'));
257
219
  }
258
220
  },
259
- submitButtonProps: _objectSpread({
260
- loading: loading
261
- }, submitterProps.submitButtonProps)
262
- }), "submitter");
263
- }, [submitter, submitterProps, loading, transformKey, omitNil, _onReset, syncToUrl, extraUrlParams, onUrlSearchChange]);
264
- var content = useMemo(function () {
265
- var wrapItems = grid ? /*#__PURE__*/_jsx(RowWrapper, {
221
+ submitButtonProps: {
222
+ loading,
223
+ ...submitterProps.submitButtonProps
224
+ }
225
+ }, "submitter");
226
+ }, [submitter, submitterProps, loading, transformKey, omitNil, onReset, syncToUrl, extraUrlParams, onUrlSearchChange]);
227
+ const content = useMemo(() => {
228
+ const wrapItems = grid ? /*#__PURE__*/_jsx(RowWrapper, {
266
229
  children: items
267
230
  }) : items;
268
231
  if (contentRender) {
@@ -270,47 +233,46 @@ function BaseFormComponents(props) {
270
233
  }
271
234
  return wrapItems;
272
235
  }, [grid, RowWrapper, items, contentRender, submitterNode]);
273
- var preInitialValues = usePrevious(props.initialValues);
236
+ const preInitialValues = usePrevious(props.initialValues);
274
237
 
275
238
  // 提示一个 initialValues ,问的人实在是太多了
276
- useEffect(function () {
239
+ useEffect(() => {
277
240
  if (syncToUrl || !props.initialValues || !preInitialValues || rest.request) return;
278
- var isEqual = isDeepEqualReact(props.initialValues, preInitialValues);
279
- noteOnce(isEqual, "initialValues \u53EA\u5728 form \u521D\u59CB\u5316\u65F6\u751F\u6548\uFF0C\u5982\u679C\u4F60\u9700\u8981\u5F02\u6B65\u52A0\u8F7D\u63A8\u8350\u4F7F\u7528 request\uFF0C\u6216\u8005 initialValues ? <Form/> : null ");
280
- noteOnce(isEqual, "The initialValues only take effect when the form is initialized, if you need to load asynchronously recommended request, or the initialValues ? <Form/> : null ");
241
+ const isEqual = isDeepEqualReact(props.initialValues, preInitialValues);
242
+ noteOnce(isEqual, `initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null `);
243
+ noteOnce(isEqual, `The initialValues only take effect when the form is initialized, if you need to load asynchronously recommended request, or the initialValues ? <Form/> : null `);
281
244
  // eslint-disable-next-line react-hooks/exhaustive-deps
282
245
  }, [props.initialValues]);
283
246
 
284
247
  // 初始化给一个默认的 form
285
- useImperativeHandle(propsFormRef, function () {
286
- return _objectSpread(_objectSpread({}, formRef.current), {}, {
287
- getFieldsFormatValue: function getFieldsFormatValue(allData, omitNilParam) {
288
- var formInstance = formRef.current;
248
+ useImperativeHandle(propsFormRef, () => {
249
+ return {
250
+ ...formRef.current,
251
+ getFieldsFormatValue: (allData, omitNilParam) => {
252
+ const formInstance = formRef.current;
289
253
  if (!formInstance) {
290
254
  return {};
291
255
  }
292
- var values = formInstance.getFieldsValue(allData);
256
+ const values = formInstance.getFieldsValue(allData);
293
257
  return transformKey(values, omitNilParam !== undefined ? omitNilParam : omitNil);
294
258
  },
295
- getFieldFormatValue: function getFieldFormatValue() {
296
- var paramsNameList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
297
- var omitNilParam = arguments.length > 1 ? arguments[1] : undefined;
298
- var formInstance = formRef.current;
259
+ getFieldFormatValue: (paramsNameList = [], omitNilParam) => {
260
+ const formInstance = formRef.current;
299
261
  if (!formInstance) {
300
262
  return undefined;
301
263
  }
302
- var nameList = covertFormName(paramsNameList);
264
+ const nameList = covertFormName(paramsNameList);
303
265
  if (!nameList) throw new Error('nameList is require');
304
- var value = formInstance.getFieldValue(nameList);
305
- var obj = nameList ? set({}, nameList, value) : value;
266
+ const value = formInstance.getFieldValue(nameList);
267
+ const obj = nameList ? set({}, nameList, value) : value;
306
268
  //transformKey会将keys重新和nameList拼接,所以这里要将nameList的首个元素弹出
307
- var newNameList = _toConsumableArray(nameList);
269
+ const newNameList = [...nameList];
308
270
  newNameList.shift();
309
- var transformed = transformKey(obj, omitNilParam !== undefined ? omitNilParam : omitNil, newNameList);
310
- var result = get(transformed, nameList);
271
+ const transformed = transformKey(obj, omitNilParam !== undefined ? omitNilParam : omitNil, newNameList);
272
+ const result = get(transformed, nameList);
311
273
  // 如果结果是对象,返回对象的值
312
- if (result && _typeof(result) === 'object' && !Array.isArray(result)) {
313
- var objValue = Object.values(result)[0];
274
+ if (result && typeof result === 'object' && !Array.isArray(result)) {
275
+ const objValue = Object.values(result)[0];
314
276
  // 如果对象的值是数组,返回数组
315
277
  if (Array.isArray(objValue)) {
316
278
  return objValue;
@@ -319,69 +281,46 @@ function BaseFormComponents(props) {
319
281
  }
320
282
  return result;
321
283
  },
322
- getFieldFormatValueObject: function getFieldFormatValueObject(paramsNameList, omitNilParam) {
323
- var formInstance = formRef.current;
284
+ getFieldFormatValueObject: (paramsNameList, omitNilParam) => {
285
+ const formInstance = formRef.current;
324
286
  if (!formInstance) {
325
287
  return {};
326
288
  }
327
- var nameList = covertFormName(paramsNameList);
328
- var value = formInstance.getFieldValue(nameList);
329
- var obj = nameList ? set({}, nameList, value) : value;
289
+ const nameList = covertFormName(paramsNameList);
290
+ const value = formInstance.getFieldValue(nameList);
291
+ const obj = nameList ? set({}, nameList, value) : value;
330
292
  return transformKey(obj, omitNilParam !== undefined ? omitNilParam : omitNil, nameList);
331
293
  },
332
- validateFieldsReturnFormatValue: function () {
333
- var _validateFieldsReturnFormatValue2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(nameList, omitNilParam) {
334
- var formInstance, values, transformedKey;
335
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
336
- while (1) switch (_context2.prev = _context2.next) {
337
- case 0:
338
- formInstance = formRef.current;
339
- if (formInstance) {
340
- _context2.next = 3;
341
- break;
342
- }
343
- return _context2.abrupt("return", {});
344
- case 3:
345
- if (!(!Array.isArray(nameList) && nameList)) {
346
- _context2.next = 5;
347
- break;
348
- }
349
- throw new Error('nameList must be array');
350
- case 5:
351
- _context2.next = 7;
352
- return formInstance.validateFields(nameList);
353
- case 7:
354
- values = _context2.sent;
355
- transformedKey = transformKey(values, omitNilParam !== undefined ? omitNilParam : omitNil);
356
- return _context2.abrupt("return", transformedKey ? transformedKey : {});
357
- case 10:
358
- case "end":
359
- return _context2.stop();
360
- }
361
- }, _callee2);
362
- }));
363
- function validateFieldsReturnFormatValue(_x3, _x4) {
364
- return _validateFieldsReturnFormatValue2.apply(this, arguments);
294
+ validateFieldsReturnFormatValue: async (nameList, omitNilParam) => {
295
+ const formInstance = formRef.current;
296
+ if (!formInstance) {
297
+ return {};
365
298
  }
366
- return validateFieldsReturnFormatValue;
367
- }()
368
- });
299
+ if (!Array.isArray(nameList) && nameList) throw new Error('nameList must be array');
300
+ const values = await formInstance.validateFields(nameList);
301
+ const transformedKey = transformKey(values, omitNilParam !== undefined ? omitNilParam : omitNil);
302
+ return transformedKey ? transformedKey : {};
303
+ }
304
+ };
369
305
  }, [omitNil, transformKey, formRef.current]);
370
- useEffect(function () {
371
- var _formRef$current3, _formRef$current3$get;
372
- var finalValues = transformKey((_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 || (_formRef$current3$get = _formRef$current3.getFieldsValue) === null || _formRef$current3$get === void 0 ? void 0 : _formRef$current3$get.call(_formRef$current3, true), omitNil);
373
- onInit === null || onInit === void 0 || onInit(finalValues, _objectSpread(_objectSpread({}, formRef.current), formatValues));
306
+ useEffect(() => {
307
+ const finalValues = transformKey(formRef.current?.getFieldsValue?.(true), omitNil);
308
+ onInit?.(finalValues, {
309
+ ...formRef.current,
310
+ ...formatValues
311
+ });
374
312
  }, []);
375
313
  return /*#__PURE__*/_jsx(ProFormContext.Provider, {
376
- value: _objectSpread(_objectSpread({}, formatValues), {}, {
377
- formRef: formRef
378
- }),
314
+ value: {
315
+ ...formatValues,
316
+ formRef
317
+ },
379
318
  children: /*#__PURE__*/_jsx(ConfigProvider, {
380
319
  componentSize: rest.size || componentSize,
381
320
  children: /*#__PURE__*/_jsxs(GridContext.Provider, {
382
321
  value: {
383
- grid: grid,
384
- colProps: colProps
322
+ grid,
323
+ colProps
385
324
  },
386
325
  children: [rest.component !== false && /*#__PURE__*/_jsx("input", {
387
326
  type: "text",
@@ -395,236 +334,203 @@ function BaseFormComponents(props) {
395
334
  }
396
335
 
397
336
  /** 自动的formKey 防止重复 */
398
- var requestFormCacheId = 0;
337
+ let requestFormCacheId = 0;
399
338
  export function BaseForm(props) {
400
- var _props$extraUrlParams2 = props.extraUrlParams,
401
- extraUrlParams = _props$extraUrlParams2 === void 0 ? defaultExtraUrlParams : _props$extraUrlParams2,
402
- syncToUrl = props.syncToUrl,
403
- isKeyPressSubmit = props.isKeyPressSubmit,
404
- _props$syncToUrlAsImp = props.syncToUrlAsImportant,
405
- syncToUrlAsImportant = _props$syncToUrlAsImp === void 0 ? false : _props$syncToUrlAsImp,
406
- _props$syncToInitialV = props.syncToInitialValues,
407
- syncToInitialValues = _props$syncToInitialV === void 0 ? true : _props$syncToInitialV,
408
- children = props.children,
409
- contentRender = props.contentRender,
410
- submitter = props.submitter,
411
- fieldProps = props.fieldProps,
412
- proFieldProps = props.proFieldProps,
413
- formItemProps = props.formItemProps,
414
- groupProps = props.groupProps,
415
- _props$dateFormatter = props.dateFormatter,
416
- dateFormatter = _props$dateFormatter === void 0 ? 'string' : _props$dateFormatter,
417
- propsFormRef = props.formRef,
418
- onInit = props.onInit,
419
- form = props.form,
420
- formComponentType = props.formComponentType,
421
- onReset = props.onReset,
422
- grid = props.grid,
423
- rowProps = props.rowProps,
424
- colProps = props.colProps,
425
- _props$omitNil2 = props.omitNil,
426
- omitNil = _props$omitNil2 === void 0 ? true : _props$omitNil2,
427
- request = props.request,
428
- params = props.params,
429
- initialValues = props.initialValues,
430
- _props$formKey = props.formKey,
431
- formKey = _props$formKey === void 0 ? requestFormCacheId : _props$formKey,
432
- readonly = props.readonly,
433
- onLoadingChange = props.onLoadingChange,
434
- propsLoading = props.loading,
435
- propRest = _objectWithoutProperties(props, _excluded2);
436
- var formRef = useRef({});
437
- var _useMountMergeState = useMountMergeState(false, {
438
- onChange: onLoadingChange,
439
- value: propsLoading
440
- }),
441
- _useMountMergeState2 = _slicedToArray(_useMountMergeState, 2),
442
- loading = _useMountMergeState2[0],
443
- setLoading = _useMountMergeState2[1];
444
- var _useUrlSearchParams = useUrlSearchParams({}, {
445
- disabled: !syncToUrl
446
- }),
447
- _useUrlSearchParams2 = _slicedToArray(_useUrlSearchParams, 2),
448
- urlSearch = _useUrlSearchParams2[0],
449
- setUrlSearch = _useUrlSearchParams2[1];
450
- var curFormKey = useRef(nanoid());
451
- useEffect(function () {
339
+ const {
340
+ extraUrlParams = defaultExtraUrlParams,
341
+ syncToUrl,
342
+ isKeyPressSubmit,
343
+ syncToUrlAsImportant = false,
344
+ syncToInitialValues = true,
345
+ children,
346
+ contentRender,
347
+ submitter,
348
+ fieldProps,
349
+ proFieldProps,
350
+ formItemProps,
351
+ groupProps,
352
+ dateFormatter = 'string',
353
+ formRef: propsFormRef,
354
+ onInit,
355
+ form,
356
+ formComponentType,
357
+ onReset,
358
+ grid,
359
+ rowProps,
360
+ colProps,
361
+ omitNil = true,
362
+ request,
363
+ params,
364
+ initialValues,
365
+ formKey = requestFormCacheId,
366
+ readonly,
367
+ onLoadingChange,
368
+ loading: propsLoading,
369
+ ...propRest
370
+ } = props;
371
+ const formRef = useRef({});
372
+ const [loading, setLoadingInner] = useControlledState(false, propsLoading);
373
+ const setLoading = useCallback(updater => {
374
+ setLoadingInner(prev => {
375
+ const next = typeof updater === 'function' ? updater(prev) : updater;
376
+ onLoadingChange?.(next);
377
+ return next;
378
+ });
379
+ }, [onLoadingChange]);
380
+ const [urlSearch, setUrlSearch] = useUrlSearchParams({}, {
381
+ disabled: !syncToUrl
382
+ });
383
+ const curFormKey = useRef(nanoid());
384
+ useEffect(() => {
452
385
  requestFormCacheId += 0;
453
386
  }, []);
454
- var _useFetchData = useFetchData({
455
- request: request,
456
- params: params,
457
- proFieldKey: formKey
458
- }),
459
- _useFetchData2 = _slicedToArray(_useFetchData, 2),
460
- initialData = _useFetchData2[0],
461
- initialDataLoading = _useFetchData2[1];
462
- var _useContext = useContext(ConfigProvider.ConfigContext),
463
- getPrefixCls = _useContext.getPrefixCls;
464
- var prefixCls = getPrefixCls('pro-form');
387
+ const [initialData, initialDataLoading] = useFetchData({
388
+ request,
389
+ params,
390
+ proFieldKey: formKey
391
+ });
392
+ const {
393
+ getPrefixCls
394
+ } = useContext(ConfigProvider.ConfigContext);
395
+ const prefixCls = getPrefixCls('pro-form');
465
396
  // css
466
- var _useStyle = useStyle('ProForm', function (token) {
467
- return _defineProperty({}, ".".concat(prefixCls), _defineProperty({}, "> div:not(".concat(token.proComponentsCls, "-form-light-filter)"), {
468
- '.pro-field': {
469
- maxWidth: '100%',
470
- '@media screen and (max-width: 575px)': {
471
- // 减少了 form 的 padding
472
- maxWidth: 'calc(93vw - 48px)'
473
- },
474
- // 适用于短数字,短文本或者选项
475
- '&-xs': {
476
- width: 104
477
- },
478
- '&-s': {
479
- width: 216
480
- },
481
- // 适用于较短字段录入、如姓名、电话、ID 等。
482
- '&-sm': {
483
- width: 216
484
- },
485
- '&-m': {
486
- width: 328
487
- },
488
- // 标准宽度,适用于大部分字段长度
489
- '&-md': {
490
- width: 328
491
- },
492
- '&-l': {
493
- width: 440
494
- },
495
- // 适用于较长字段录入,如长网址、标签组、文件路径等。
496
- '&-lg': {
497
- width: 440
498
- },
499
- // 适用于长文本录入,如长链接、描述、备注等,通常搭配自适应多行输入框或定高文本域使用。
500
- '&-xl': {
501
- width: 552
397
+ const {
398
+ wrapSSR,
399
+ hashId
400
+ } = useStyle('ProForm', token => {
401
+ return {
402
+ [`.${prefixCls}`]: {
403
+ [`> div:not(${token.proComponentsCls}-form-light-filter)`]: {
404
+ '.pro-field': {
405
+ maxWidth: '100%',
406
+ '@media screen and (max-width: 575px)': {
407
+ // 减少了 form 的 padding
408
+ maxWidth: 'calc(93vw - 48px)'
409
+ },
410
+ // 适用于短数字,短文本或者选项
411
+ '&-xs': {
412
+ width: 104
413
+ },
414
+ '&-s': {
415
+ width: 216
416
+ },
417
+ // 适用于较短字段录入、如姓名、电话、ID 等。
418
+ '&-sm': {
419
+ width: 216
420
+ },
421
+ '&-m': {
422
+ width: 328
423
+ },
424
+ // 标准宽度,适用于大部分字段长度
425
+ '&-md': {
426
+ width: 328
427
+ },
428
+ '&-l': {
429
+ width: 440
430
+ },
431
+ // 适用于较长字段录入,如长网址、标签组、文件路径等。
432
+ '&-lg': {
433
+ width: 440
434
+ },
435
+ // 适用于长文本录入,如长链接、描述、备注等,通常搭配自适应多行输入框或定高文本域使用。
436
+ '&-xl': {
437
+ width: 552
438
+ }
502
439
  }
503
440
  }
504
- }));
505
- }),
506
- wrapSSR = _useStyle.wrapSSR,
507
- hashId = _useStyle.hashId;
441
+ }
442
+ };
443
+ });
508
444
 
509
445
  // 如果为 false,不需要触发设置进去
510
- var _useState = useState(function () {
511
- if (!syncToUrl) {
512
- return {};
513
- }
514
- return genParams(syncToUrl, urlSearch, 'get');
515
- }),
516
- _useState2 = _slicedToArray(_useState, 2),
517
- urlParamsMergeInitialValues = _useState2[0],
518
- setUrlParamsMergeInitialValues = _useState2[1];
446
+ const [urlParamsMergeInitialValues, setUrlParamsMergeInitialValues] = useState(() => {
447
+ if (!syncToUrl) {
448
+ return {};
449
+ }
450
+ return genParams(syncToUrl, urlSearch, 'get');
451
+ });
519
452
 
520
453
  /** 保存 transformKeyRef,用于对表单key transform */
521
- var transformKeyRef = useRef({});
522
- var fieldsValueType = useRef({});
454
+ const transformKeyRef = useRef({});
455
+ const fieldsValueType = useRef({});
523
456
 
524
457
  /** 使用 callback 的类型 */
525
- var transformKey = useRefFunction(function (values, paramsOmitNil, parentKey) {
526
- if (!values || _typeof(values) !== 'object') {
458
+ const transformKey = useRefFunction((values, paramsOmitNil, parentKey) => {
459
+ if (!values || typeof values !== 'object') {
527
460
  return values;
528
461
  }
529
462
  return transformKeySubmitValue(conversionMomentValue(values, dateFormatter, fieldsValueType.current, paramsOmitNil, parentKey), transformKeyRef.current);
530
463
  });
531
- useEffect(function () {
464
+ useEffect(() => {
532
465
  if (syncToInitialValues) return;
533
466
  setUrlParamsMergeInitialValues({});
534
467
  }, [syncToInitialValues]);
535
- var getGenParams = useRefFunction(function () {
536
- return _objectSpread(_objectSpread({}, urlSearch), extraUrlParams);
468
+ const getGenParams = useRefFunction(() => {
469
+ return {
470
+ ...urlSearch,
471
+ ...extraUrlParams
472
+ };
537
473
  });
538
- useEffect(function () {
474
+ useEffect(() => {
539
475
  if (!syncToUrl) return;
540
476
  setUrlSearch(genParams(syncToUrl, getGenParams(), 'set'));
541
477
  // eslint-disable-next-line react-hooks/exhaustive-deps
542
478
  }, [extraUrlParams, getGenParams, syncToUrl]);
543
- var getPopupContainer = useMemo(function () {
479
+ const getPopupContainer = useMemo(() => {
544
480
  if (typeof window === 'undefined') return undefined;
545
481
  // 如果在 drawerForm 和 modalForm 里就渲染dom到父节点里
546
482
  // modalForm 可能高度太小不适合
547
483
  if (formComponentType && ['DrawerForm'].includes(formComponentType)) {
548
- return function (e) {
549
- return e.parentNode || document.body;
550
- };
484
+ return e => e.parentNode || document.body;
551
485
  }
552
486
  return undefined;
553
487
  }, [formComponentType]);
554
- var onFinish = useRefFunction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
555
- var _formRef$current4, _formRef$current4$get, finalValues, response, _formRef$current5, _formRef$current5$get, syncToUrlParams;
556
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
557
- while (1) switch (_context3.prev = _context3.next) {
558
- case 0:
559
- if (propRest.onFinish) {
560
- _context3.next = 2;
561
- break;
562
- }
563
- return _context3.abrupt("return");
564
- case 2:
565
- if (!loading) {
566
- _context3.next = 4;
567
- break;
568
- }
569
- return _context3.abrupt("return");
570
- case 4:
571
- _context3.prev = 4;
572
- setLoading(true);
573
- finalValues = (formRef === null || formRef === void 0 || (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 || (_formRef$current4$get = _formRef$current4.getFieldsFormatValue) === null || _formRef$current4$get === void 0 ? void 0 : _formRef$current4$get.call(_formRef$current4)) || {};
574
- response = propRest.onFinish(finalValues);
575
- if (!(response && _typeof(response) === 'object' && typeof response.then === 'function')) {
576
- _context3.next = 21;
577
- break;
578
- }
579
- _context3.prev = 9;
580
- _context3.next = 12;
581
- return response;
582
- case 12:
583
- _context3.next = 18;
584
- break;
585
- case 14:
586
- _context3.prev = 14;
587
- _context3.t0 = _context3["catch"](9);
488
+ const onFinish = useRefFunction(async () => {
489
+ // 没设置 onFinish 就不执行
490
+ if (!propRest.onFinish) return;
491
+ // 防止重复提交
492
+ if (loading) return;
493
+ try {
494
+ setLoading(true);
495
+ const finalValues = formRef?.current?.getFieldsFormatValue?.() || {};
496
+ const response = propRest.onFinish(finalValues);
497
+ if (response && typeof response === 'object' && typeof response.then === 'function') {
498
+ try {
499
+ await response;
500
+ } catch (error) {
588
501
  // 确保在 Promise 被拒绝时也重置 loading 状态
589
502
  setLoading(false);
590
- throw _context3.t0;
591
- case 18:
592
- // 只有在 Promise 成功完成时才重置 loading 状态
593
- setLoading(false);
594
- _context3.next = 22;
595
- break;
596
- case 21:
597
- setLoading(false);
598
- case 22:
599
- if (syncToUrl) {
600
- // 把没有的值设置为未定义可以删掉 url 的参数
601
- syncToUrlParams = Object.keys((formRef === null || formRef === void 0 || (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 || (_formRef$current5$get = _formRef$current5.getFieldsFormatValue) === null || _formRef$current5$get === void 0 ? void 0 : _formRef$current5$get.call(_formRef$current5, true, false)) || {}).reduce(function (pre, next) {
602
- var _finalValues$next;
603
- return _objectSpread(_objectSpread({}, pre), {}, _defineProperty({}, next, (_finalValues$next = finalValues[next]) !== null && _finalValues$next !== void 0 ? _finalValues$next : undefined));
604
- }, extraUrlParams); // fix #3547: 当原先在url中存在的字段被删除时,应该将 params 中的该字段设置为 undefined,以便触发url同步删除
605
- Object.keys(urlSearch).forEach(function (key) {
606
- if (syncToUrlParams[key] !== false && syncToUrlParams[key] !== 0 && !syncToUrlParams[key]) {
607
- syncToUrlParams[key] = undefined;
608
- }
609
- });
610
- /** 在同步到 url 上时对参数进行转化 */
611
- setUrlSearch(genParams(syncToUrl, syncToUrlParams, 'set'));
503
+ throw error;
504
+ }
505
+ // 只有在 Promise 成功完成时才重置 loading 状态
506
+ setLoading(false);
507
+ } else {
508
+ setLoading(false);
509
+ }
510
+ if (syncToUrl) {
511
+ // 把没有的值设置为未定义可以删掉 url 的参数
512
+ const syncToUrlParams = Object.keys(formRef?.current?.getFieldsFormatValue?.(true, false) || {}).reduce((pre, next) => {
513
+ return {
514
+ ...pre,
515
+ [next]: finalValues[next] ?? undefined
516
+ };
517
+ }, extraUrlParams);
518
+ // fix #3547: 当原先在url中存在的字段被删除时,应该将 params 中的该字段设置为 undefined,以便触发url同步删除
519
+ Object.keys(urlSearch).forEach(key => {
520
+ if (syncToUrlParams[key] !== false && syncToUrlParams[key] !== 0 && !syncToUrlParams[key]) {
521
+ syncToUrlParams[key] = undefined;
612
522
  }
613
- _context3.next = 28;
614
- break;
615
- case 25:
616
- _context3.prev = 25;
617
- _context3.t1 = _context3["catch"](4);
618
- setLoading(false);
619
- case 28:
620
- case "end":
621
- return _context3.stop();
523
+ });
524
+ /** 在同步到 url 上时对参数进行转化 */
525
+ setUrlSearch(genParams(syncToUrl, syncToUrlParams, 'set'));
622
526
  }
623
- }, _callee3, null, [[4, 25], [9, 14]]);
624
- })));
527
+ } catch (error) {
528
+ setLoading(false);
529
+ }
530
+ });
625
531
 
626
532
  // 初始化给一个默认的 form
627
- useImperativeHandle(propsFormRef, function () {
533
+ useImperativeHandle(propsFormRef, () => {
628
534
  return formRef.current;
629
535
  }, [!initialData]);
630
536
  if (request && initialDataLoading) {
@@ -645,19 +551,19 @@ export function BaseForm(props) {
645
551
  needDeps: true,
646
552
  children: /*#__PURE__*/_jsx(FieldContext.Provider, {
647
553
  value: {
648
- formRef: formRef,
649
- fieldProps: fieldProps,
650
- proFieldProps: proFieldProps,
651
- formItemProps: formItemProps,
652
- groupProps: groupProps,
653
- formComponentType: formComponentType,
654
- getPopupContainer: getPopupContainer,
554
+ formRef,
555
+ fieldProps,
556
+ proFieldProps,
557
+ formItemProps,
558
+ groupProps,
559
+ formComponentType,
560
+ getPopupContainer,
655
561
  formKey: curFormKey.current,
656
- setFieldValueType: function setFieldValueType(name, _ref4) {
657
- var _ref4$valueType = _ref4.valueType,
658
- valueType = _ref4$valueType === void 0 ? 'text' : _ref4$valueType,
659
- dateFormat = _ref4.dateFormat,
660
- transform = _ref4.transform;
562
+ setFieldValueType: (name, {
563
+ valueType = 'text',
564
+ dateFormat,
565
+ transform
566
+ }) => {
661
567
  if (!Array.isArray(name)) return;
662
568
 
663
569
  // Store transform function in the correct nested structure
@@ -665,53 +571,61 @@ export function BaseForm(props) {
665
571
  transformKeyRef.current = namePathSet(transformKeyRef.current, name, transform);
666
572
  }
667
573
  fieldsValueType.current = namePathSet(fieldsValueType.current, name, {
668
- valueType: valueType,
669
- dateFormat: dateFormat
574
+ valueType,
575
+ dateFormat
670
576
  });
671
577
  }
672
578
  },
673
579
  children: /*#__PURE__*/_jsx(FormListContext.Provider, {
674
580
  value: {},
675
- children: /*#__PURE__*/_jsx(Form, _objectSpread(_objectSpread({
676
- onKeyPress: function onKeyPress(event) {
581
+ children: /*#__PURE__*/_jsx(Form, {
582
+ onKeyPress: event => {
677
583
  if (!isKeyPressSubmit) return;
678
584
  if (event.key === 'Enter') {
679
- var _formRef$current6;
680
- (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 || _formRef$current6.submit();
585
+ formRef.current?.submit();
681
586
  }
682
587
  },
683
588
  autoComplete: "off",
684
- form: form
685
- }, omit(propRest, ['ref', 'labelWidth', 'autoFocusFirstInput'])), {}, {
686
- ref: function ref(instance) {
589
+ form: form,
590
+ ...omit(propRest, ['ref', 'labelWidth', 'autoFocusFirstInput']),
591
+ ref: instance => {
687
592
  if (!formRef.current) return;
688
- formRef.current.nativeElement = instance === null || instance === void 0 ? void 0 : instance.nativeElement;
689
- formRef.current.focus = function () {
690
- var _instance$nativeEleme;
593
+ formRef.current.nativeElement = instance?.nativeElement;
594
+ formRef.current.focus = () => {
691
595
  // 聚焦到表单的第一个输入框
692
- var firstInput = instance === null || instance === void 0 || (_instance$nativeEleme = instance.nativeElement) === null || _instance$nativeEleme === void 0 ? void 0 : _instance$nativeEleme.querySelector('input, textarea, select');
693
- firstInput === null || firstInput === void 0 || firstInput.focus();
596
+ const firstInput = instance?.nativeElement?.querySelector('input, textarea, select');
597
+ firstInput?.focus();
694
598
  };
695
599
  }
696
600
  // 组合 urlSearch 和 initialValues
697
601
  ,
698
- initialValues: syncToUrlAsImportant ? _objectSpread(_objectSpread(_objectSpread({}, initialValues), initialData), urlParamsMergeInitialValues) : _objectSpread(_objectSpread(_objectSpread({}, urlParamsMergeInitialValues), initialValues), initialData),
699
- onValuesChange: function onValuesChange(changedValues, values) {
700
- var _propRest$onValuesCha;
701
- propRest === null || propRest === void 0 || (_propRest$onValuesCha = propRest.onValuesChange) === null || _propRest$onValuesCha === void 0 || _propRest$onValuesCha.call(propRest, transformKey(changedValues, !!omitNil), transformKey(values, !!omitNil));
602
+ initialValues: syncToUrlAsImportant ? {
603
+ ...initialValues,
604
+ ...initialData,
605
+ ...urlParamsMergeInitialValues
606
+ } : {
607
+ ...urlParamsMergeInitialValues,
608
+ ...initialValues,
609
+ ...initialData
702
610
  },
703
- className: classNames(props.className, prefixCls, hashId),
611
+ onValuesChange: (changedValues, values) => {
612
+ propRest?.onValuesChange?.(transformKey(changedValues, !!omitNil), transformKey(values, !!omitNil));
613
+ },
614
+ className: clsx(props.className, prefixCls, hashId),
704
615
  onFinish: onFinish,
705
- children: /*#__PURE__*/_jsx(BaseFormComponents, _objectSpread(_objectSpread({
616
+ children: /*#__PURE__*/_jsx(BaseFormComponents, {
706
617
  transformKey: transformKey,
707
618
  autoComplete: "off",
708
619
  loading: loading || !!(request && !initialData && initialDataLoading),
709
- onUrlSearchChange: setUrlSearch
710
- }, props), {}, {
620
+ onUrlSearchChange: setUrlSearch,
621
+ ...props,
711
622
  formRef: formRef,
712
- initialValues: _objectSpread(_objectSpread({}, initialValues), initialData)
713
- }))
714
- }))
623
+ initialValues: {
624
+ ...initialValues,
625
+ ...initialData
626
+ }
627
+ })
628
+ })
715
629
  })
716
630
  })
717
631
  })