@ant-design/pro-components 3.0.0-beta.1 → 3.0.0-beta.3

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 (784) hide show
  1. package/dist/pro-components.min.js +1 -1
  2. package/es/card/ProCard.d.ts +0 -1
  3. package/es/card/ProCard.js +11 -23
  4. package/es/card/components/Actions/index.js +33 -28
  5. package/es/card/components/Actions/style.js +72 -100
  6. package/es/card/components/Card/index.js +212 -258
  7. package/es/card/components/Card/style.js +192 -266
  8. package/es/card/components/CheckCard/Group.js +198 -208
  9. package/es/card/components/CheckCard/index.js +151 -160
  10. package/es/card/components/CheckCard/style.js +186 -212
  11. package/es/card/components/Divider/index.js +23 -18
  12. package/es/card/components/Divider/style.js +30 -54
  13. package/es/card/components/Loading/index.js +80 -13
  14. package/es/card/components/Loading/style.js +42 -63
  15. package/es/card/components/Operation/index.js +22 -17
  16. package/es/card/components/Operation/style.js +19 -43
  17. package/es/card/components/Statistic/index.js +79 -96
  18. package/es/card/components/Statistic/style.js +76 -115
  19. package/es/card/components/StatisticCard/index.d.ts +0 -2
  20. package/es/card/components/StatisticCard/index.js +59 -70
  21. package/es/card/components/StatisticCard/style.js +36 -55
  22. package/es/card/index.d.ts +2 -2
  23. package/es/card/index.js +2 -9
  24. package/es/card/typing.js +1 -0
  25. package/es/descriptions/index.js +363 -414
  26. package/es/descriptions/useFetchData.js +94 -73
  27. package/es/field/AllProField.js +438 -361
  28. package/es/field/FieldHOC/index.js +32 -28
  29. package/es/field/PureProField.js +129 -160
  30. package/es/field/ValueTypeToComponent.js +686 -396
  31. package/es/field/components/Cascader/index.d.ts +2 -2
  32. package/es/field/components/Cascader/index.js +124 -149
  33. package/es/field/components/Checkbox/index.d.ts +1 -1
  34. package/es/field/components/Checkbox/index.js +106 -128
  35. package/es/field/components/Code/index.js +67 -60
  36. package/es/field/components/ColorPicker/index.d.ts +1 -1
  37. package/es/field/components/ColorPicker/index.js +55 -78
  38. package/es/field/components/DatePicker/index.d.ts +2 -2
  39. package/es/field/components/DatePicker/index.js +100 -116
  40. package/es/field/components/Digit/index.js +84 -83
  41. package/es/field/components/DigitRange/index.js +102 -96
  42. package/es/field/components/FromNow/index.js +50 -62
  43. package/es/field/components/Image/index.js +46 -50
  44. package/es/field/components/IndexColumn/index.js +45 -43
  45. package/es/field/components/Money/index.js +244 -253
  46. package/es/field/components/Options/index.js +61 -71
  47. package/es/field/components/Password/index.js +62 -59
  48. package/es/field/components/Percent/index.js +74 -80
  49. package/es/field/components/Percent/util.js +23 -18
  50. package/es/field/components/Progress/index.js +53 -54
  51. package/es/field/components/Radio/index.d.ts +1 -1
  52. package/es/field/components/Radio/index.js +85 -107
  53. package/es/field/components/RangePicker/index.d.ts +2 -2
  54. package/es/field/components/RangePicker/index.js +122 -137
  55. package/es/field/components/Rate/index.js +39 -35
  56. package/es/field/components/Second/index.js +61 -59
  57. package/es/field/components/Segmented/index.d.ts +1 -1
  58. package/es/field/components/Segmented/index.js +68 -90
  59. package/es/field/components/Select/LightSelect/index.d.ts +1 -1
  60. package/es/field/components/Select/LightSelect/index.js +210 -256
  61. package/es/field/components/Select/SearchSelect/index.js +192 -225
  62. package/es/field/components/Select/index.d.ts +2 -2
  63. package/es/field/components/Select/index.js +299 -368
  64. package/es/field/components/Slider/index.js +39 -45
  65. package/es/field/components/Status/index.js +83 -23
  66. package/es/field/components/Switch/index.d.ts +1 -1
  67. package/es/field/components/Switch/index.js +60 -71
  68. package/es/field/components/Text/index.js +53 -48
  69. package/es/field/components/TextArea/index.js +39 -53
  70. package/es/field/components/TextArea/readonly.js +36 -50
  71. package/es/field/components/TimePicker/index.js +182 -190
  72. package/es/field/components/TreeSelect/index.d.ts +2 -2
  73. package/es/field/components/TreeSelect/index.js +178 -184
  74. package/es/field/index.js +3 -43
  75. package/es/form/BaseForm/BaseForm.js +581 -621
  76. package/es/form/BaseForm/EditOrReadOnlyContext.js +4 -8
  77. package/es/form/BaseForm/LightWrapper/index.js +104 -161
  78. package/es/form/BaseForm/LightWrapper/style.js +14 -41
  79. package/es/form/BaseForm/Submitter/index.js +69 -100
  80. package/es/form/BaseForm/index.js +1 -2
  81. package/es/form/FieldContext.js +4 -8
  82. package/es/form/components/Captcha/index.js +162 -169
  83. package/es/form/components/Cascader/index.js +46 -75
  84. package/es/form/components/Checkbox/index.js +73 -98
  85. package/es/form/components/ColorPicker/index.js +43 -64
  86. package/es/form/components/DatePicker/BaseDatePicker.js +45 -69
  87. package/es/form/components/DatePicker/DatePicker.js +26 -51
  88. package/es/form/components/DatePicker/DateTimePicker.js +26 -50
  89. package/es/form/components/DatePicker/MonthPicker.js +26 -51
  90. package/es/form/components/DatePicker/QuarterPicker.js +26 -51
  91. package/es/form/components/DatePicker/TimePicker.js +43 -72
  92. package/es/form/components/DatePicker/WeekPicker.js +26 -51
  93. package/es/form/components/DatePicker/YearPicker.js +26 -51
  94. package/es/form/components/DatePicker/index.js +4 -6
  95. package/es/form/components/DateRangePicker/BaseDateRanger.js +42 -70
  96. package/es/form/components/DateRangePicker/DateMonthRangePicker.js +29 -51
  97. package/es/form/components/DateRangePicker/DateQuarterRangePicker.js +29 -51
  98. package/es/form/components/DateRangePicker/DateTimeRangePicker.js +29 -51
  99. package/es/form/components/DateRangePicker/DateWeekRangePicker.js +29 -51
  100. package/es/form/components/DateRangePicker/DateYearRangePicker.js +29 -51
  101. package/es/form/components/DateRangePicker/TimeRangePicker.js +42 -67
  102. package/es/form/components/DateRangePicker/index.js +29 -51
  103. package/es/form/components/Dependency/index.js +56 -96
  104. package/es/form/components/Digit/DigitRange.d.ts +1 -1
  105. package/es/form/components/Digit/DigitRange.js +42 -75
  106. package/es/form/components/Digit/index.js +47 -78
  107. package/es/form/components/Field/index.js +80 -124
  108. package/es/form/components/FieldSet/index.js +95 -123
  109. package/es/form/components/FormItem/FormItemRender/index.js +135 -92
  110. package/es/form/components/FormItem/Group/index.js +134 -169
  111. package/es/form/components/FormItem/Group/style.js +41 -62
  112. package/es/form/components/FormItem/index.js +252 -293
  113. package/es/form/components/FormItem/warpField.js +218 -285
  114. package/es/form/components/List/ListContainer.js +221 -181
  115. package/es/form/components/List/ListItem.js +258 -350
  116. package/es/form/components/List/index.js +195 -252
  117. package/es/form/components/List/style.js +48 -95
  118. package/es/form/components/Money/index.js +50 -80
  119. package/es/form/components/Radio/index.js +52 -86
  120. package/es/form/components/Rate/index.js +37 -60
  121. package/es/form/components/SchemaForm/index.js +121 -167
  122. package/es/form/components/SchemaForm/layoutType/Embed.js +8 -5
  123. package/es/form/components/SchemaForm/layoutType/StepsForm.js +35 -68
  124. package/es/form/components/SchemaForm/layoutType/index.js +2 -7
  125. package/es/form/components/SchemaForm/typing.js +1 -0
  126. package/es/form/components/SchemaForm/valueType/dependency.js +19 -43
  127. package/es/form/components/SchemaForm/valueType/divider.js +11 -30
  128. package/es/form/components/SchemaForm/valueType/field.js +59 -100
  129. package/es/form/components/SchemaForm/valueType/formList.js +16 -42
  130. package/es/form/components/SchemaForm/valueType/formSet.js +16 -42
  131. package/es/form/components/SchemaForm/valueType/group.js +15 -37
  132. package/es/form/components/SchemaForm/valueType/ignore.js +4 -7
  133. package/es/form/components/SchemaForm/valueType/index.js +16 -17
  134. package/es/form/components/Segmented/index.js +43 -61
  135. package/es/form/components/Select/index.js +114 -151
  136. package/es/form/components/Slider/index.js +54 -91
  137. package/es/form/components/Switch/index.js +47 -71
  138. package/es/form/components/Text/index.js +132 -161
  139. package/es/form/components/TextArea/index.js +34 -57
  140. package/es/form/components/TreeSelect/index.js +42 -61
  141. package/es/form/components/UploadButton/index.js +125 -145
  142. package/es/form/components/UploadDragger/index.js +77 -92
  143. package/es/form/components/index.js +36 -88
  144. package/es/form/helpers/grid.js +77 -82
  145. package/es/form/helpers/index.js +1 -2
  146. package/es/form/index.js +6 -15
  147. package/es/form/layouts/DrawerForm/index.js +308 -315
  148. package/es/form/layouts/DrawerForm/style.js +26 -50
  149. package/es/form/layouts/LightFilter/index.js +208 -270
  150. package/es/form/layouts/LightFilter/style.js +49 -74
  151. package/es/form/layouts/LoginForm/index.js +85 -104
  152. package/es/form/layouts/LoginForm/style.js +68 -95
  153. package/es/form/layouts/LoginFormPage/index.js +141 -147
  154. package/es/form/layouts/LoginFormPage/style.js +129 -154
  155. package/es/form/layouts/ModalForm/index.js +247 -253
  156. package/es/form/layouts/ProForm/index.js +15 -32
  157. package/es/form/layouts/QueryFilter/Actions.js +52 -47
  158. package/es/form/layouts/QueryFilter/index.js +297 -359
  159. package/es/form/layouts/QueryFilter/style.js +38 -69
  160. package/es/form/layouts/StepsForm/StepForm.js +87 -119
  161. package/es/form/layouts/StepsForm/index.js +339 -353
  162. package/es/form/layouts/StepsForm/style.js +29 -50
  163. package/es/form/layouts/index.js +9 -20
  164. package/es/form/typing.js +1 -0
  165. package/es/index.js +1 -5
  166. package/es/layout/ProLayout.js +426 -497
  167. package/es/layout/WrapContent.js +26 -15
  168. package/es/layout/assert/Logo.js +107 -79
  169. package/es/layout/components/AppsLogoComponents/AppsLogo.js +13 -11
  170. package/es/layout/components/AppsLogoComponents/DefaultContent.js +50 -56
  171. package/es/layout/components/AppsLogoComponents/SimpleContent.js +73 -66
  172. package/es/layout/components/AppsLogoComponents/index.js +90 -73
  173. package/es/layout/components/AppsLogoComponents/style/default.js +31 -35
  174. package/es/layout/components/AppsLogoComponents/style/index.js +51 -77
  175. package/es/layout/components/AppsLogoComponents/style/simple.js +37 -40
  176. package/es/layout/components/CollapsedIcon/index.js +19 -55
  177. package/es/layout/components/CollapsedIcon/style.js +42 -66
  178. package/es/layout/components/Footer.js +27 -38
  179. package/es/layout/components/FooterToolbar/index.js +78 -102
  180. package/es/layout/components/FooterToolbar/style/index.js +38 -62
  181. package/es/layout/components/FooterToolbar/style/stylish.js +10 -38
  182. package/es/layout/components/GlobalFooter/index.js +37 -31
  183. package/es/layout/components/GlobalFooter/style.js +32 -53
  184. package/es/layout/components/GlobalHeader/ActionsContent.js +132 -181
  185. package/es/layout/components/GlobalHeader/index.d.ts +0 -5
  186. package/es/layout/components/GlobalHeader/index.js +76 -84
  187. package/es/layout/components/GlobalHeader/rightContentStyle.js +52 -76
  188. package/es/layout/components/GlobalHeader/style.js +57 -83
  189. package/es/layout/components/GridContent/index.js +35 -33
  190. package/es/layout/components/GridContent/style.js +14 -38
  191. package/es/layout/components/Header/index.js +95 -124
  192. package/es/layout/components/Header/style/header.js +48 -72
  193. package/es/layout/components/Header/style/stylish.js +12 -42
  194. package/es/layout/components/Help/AsyncContentPanel.js +53 -42
  195. package/es/layout/components/Help/HelpProvide.js +55 -6
  196. package/es/layout/components/Help/ProHelpContentPanel.js +128 -127
  197. package/es/layout/components/Help/ProHelpDrawer.js +48 -76
  198. package/es/layout/components/Help/ProHelpModal.js +47 -76
  199. package/es/layout/components/Help/ProHelpPanel.js +183 -224
  200. package/es/layout/components/Help/ProHelpPopover.js +37 -64
  201. package/es/layout/components/Help/RenderContentPanel.js +90 -103
  202. package/es/layout/components/Help/Search.js +124 -163
  203. package/es/layout/components/Help/index.js +19 -40
  204. package/es/layout/components/Help/style.js +90 -115
  205. package/es/layout/components/PageContainer/index.js +233 -280
  206. package/es/layout/components/PageContainer/style/index.js +78 -118
  207. package/es/layout/components/PageContainer/style/stylish.js +10 -38
  208. package/es/layout/components/PageHeader/index.js +144 -129
  209. package/es/layout/components/PageHeader/style/index.js +125 -172
  210. package/es/layout/components/PageLoading/index.js +23 -50
  211. package/es/layout/components/SettingDrawer/BlockCheckbox.js +42 -42
  212. package/es/layout/components/SettingDrawer/LayoutChange.js +108 -98
  213. package/es/layout/components/SettingDrawer/RegionalChange.js +31 -34
  214. package/es/layout/components/SettingDrawer/ThemeColor.js +50 -69
  215. package/es/layout/components/SettingDrawer/icon/group.js +109 -88
  216. package/es/layout/components/SettingDrawer/icon/sub.js +70 -116
  217. package/es/layout/components/SettingDrawer/index.js +405 -420
  218. package/es/layout/components/SettingDrawer/style/index.js +142 -146
  219. package/es/layout/components/SiderMenu/Arrow.js +12 -15
  220. package/es/layout/components/SiderMenu/BaseMenu.js +402 -451
  221. package/es/layout/components/SiderMenu/SiderMenu.js +246 -336
  222. package/es/layout/components/SiderMenu/index.js +72 -101
  223. package/es/layout/components/SiderMenu/style/index.js +171 -210
  224. package/es/layout/components/SiderMenu/style/menu.js +110 -173
  225. package/es/layout/components/SiderMenu/style/stylish.js +12 -42
  226. package/es/layout/components/TopNavHeader/index.js +106 -179
  227. package/es/layout/components/TopNavHeader/style.js +67 -95
  228. package/es/layout/context/RouteContext.js +2 -6
  229. package/es/layout/defaultSettings.js +6 -9
  230. package/es/layout/getPageTitle.js +46 -40
  231. package/es/layout/index.js +4 -27
  232. package/es/layout/locales/en-US/settingDrawer.js +43 -47
  233. package/es/layout/locales/en-US.js +2 -22
  234. package/es/layout/locales/index.js +13 -18
  235. package/es/layout/locales/it-IT/settingDrawer.js +34 -38
  236. package/es/layout/locales/it-IT.js +2 -22
  237. package/es/layout/locales/ko-KR/settingDrawer.js +39 -43
  238. package/es/layout/locales/ko-KR.js +2 -22
  239. package/es/layout/locales/zh-CN/settingDrawer.js +43 -47
  240. package/es/layout/locales/zh-CN.js +2 -22
  241. package/es/layout/locales/zh-TW/settingDrawer.js +35 -39
  242. package/es/layout/locales/zh-TW.js +2 -22
  243. package/es/layout/style/index.js +43 -73
  244. package/es/layout/typing.js +1 -0
  245. package/es/layout/utils/getBreadcrumbProps.js +111 -91
  246. package/es/layout/utils/getMenuData.js +18 -21
  247. package/es/layout/utils/pathTools.js +11 -12
  248. package/es/layout/utils/useCurrentMenuLayoutProps.js +21 -29
  249. package/es/layout/utils/utils.js +35 -51
  250. package/es/list/Item.js +222 -294
  251. package/es/list/ListView.js +188 -232
  252. package/es/list/constants.js +4 -17
  253. package/es/list/index.js +121 -178
  254. package/es/list/style/index.js +224 -287
  255. package/es/provider/index.js +228 -179
  256. package/es/provider/intl.js +100 -124
  257. package/es/provider/locale/ar_EG.js +47 -51
  258. package/es/provider/locale/ca_ES.js +45 -49
  259. package/es/provider/locale/cs_CZ.js +50 -54
  260. package/es/provider/locale/de_DE.js +47 -51
  261. package/es/provider/locale/en_GB.js +49 -53
  262. package/es/provider/locale/en_US.js +51 -55
  263. package/es/provider/locale/es_ES.js +47 -51
  264. package/es/provider/locale/fa_IR.js +47 -51
  265. package/es/provider/locale/fr_FR.js +47 -51
  266. package/es/provider/locale/he_IL.js +50 -54
  267. package/es/provider/locale/hr_HR.js +47 -51
  268. package/es/provider/locale/id_ID.js +47 -51
  269. package/es/provider/locale/it_IT.js +47 -51
  270. package/es/provider/locale/ja_JP.js +47 -51
  271. package/es/provider/locale/ko_KR.js +47 -51
  272. package/es/provider/locale/mn_MN.js +47 -51
  273. package/es/provider/locale/ms_MY.js +47 -51
  274. package/es/provider/locale/nl_NL.js +50 -54
  275. package/es/provider/locale/pl_PL.js +47 -51
  276. package/es/provider/locale/pt_BR.js +47 -51
  277. package/es/provider/locale/ro_RO.js +50 -54
  278. package/es/provider/locale/ru_RU.js +47 -51
  279. package/es/provider/locale/sk_SK.js +50 -54
  280. package/es/provider/locale/sr_RS.js +47 -51
  281. package/es/provider/locale/sv_SE.js +50 -54
  282. package/es/provider/locale/th_TH.js +50 -54
  283. package/es/provider/locale/tr_TR.js +47 -51
  284. package/es/provider/locale/uk_UA.js +50 -54
  285. package/es/provider/locale/uz_UZ.js +47 -51
  286. package/es/provider/locale/vi_VN.js +47 -51
  287. package/es/provider/locale/zh_CN.js +50 -54
  288. package/es/provider/locale/zh_HK.js +50 -54
  289. package/es/provider/locale/zh_TW.js +50 -54
  290. package/es/provider/typing/layoutToken.d.ts +0 -10
  291. package/es/provider/typing/layoutToken.js +19 -42
  292. package/es/provider/useStyle/index.d.ts +1 -1
  293. package/es/provider/useStyle/index.js +91 -78
  294. package/es/provider/utils/merge.js +13 -29
  295. package/es/skeleton/components/Descriptions/index.js +240 -252
  296. package/es/skeleton/components/List/index.js +217 -207
  297. package/es/skeleton/components/Result/index.js +57 -54
  298. package/es/skeleton/index.js +18 -62
  299. package/es/table/Store/Provide.d.ts +0 -1
  300. package/es/table/Store/Provide.js +141 -128
  301. package/es/table/Table.js +645 -698
  302. package/es/table/components/Alert/index.js +60 -37
  303. package/es/table/components/Alert/style.js +28 -52
  304. package/es/table/components/ColumnSetting/index.js +382 -387
  305. package/es/table/components/ColumnSetting/style.js +72 -108
  306. package/es/table/components/DragSortTable/index.js +101 -137
  307. package/es/table/components/DragSortTable/style.js +20 -44
  308. package/es/table/components/Dropdown/index.js +70 -83
  309. package/es/table/components/EditableTable/CellEditorTable.js +50 -65
  310. package/es/table/components/EditableTable/RowEditorTable.js +44 -62
  311. package/es/table/components/EditableTable/index.js +343 -347
  312. package/es/table/components/Form/FormRender.js +167 -173
  313. package/es/table/components/Form/index.js +123 -132
  314. package/es/table/components/ListToolBar/HeaderMenu.js +68 -102
  315. package/es/table/components/ListToolBar/index.js +254 -273
  316. package/es/table/components/ListToolBar/style.js +119 -134
  317. package/es/table/components/ToolBar/DensityIcon.js +36 -41
  318. package/es/table/components/ToolBar/FullscreenIcon.js +21 -14
  319. package/es/table/components/ToolBar/index.js +235 -267
  320. package/es/table/index.js +3 -50
  321. package/es/table/style/index.js +129 -175
  322. package/es/table/typing.d.ts +2 -2
  323. package/es/table/typing.js +1 -0
  324. package/es/table/useFetchData.js +432 -232
  325. package/es/table/utils/cellRenderToFromItem.js +186 -261
  326. package/es/table/utils/columnRender.js +116 -115
  327. package/es/table/utils/columnSort.js +23 -21
  328. package/es/table/utils/genProColumnToColumn.js +101 -129
  329. package/es/table/utils/index.js +197 -115
  330. package/es/table/utils/useDragSort.js +135 -174
  331. package/es/utils/components/DropdownFooter/index.js +48 -58
  332. package/es/utils/components/DropdownFooter/style.js +16 -40
  333. package/es/utils/components/ErrorBoundary/index.js +51 -25
  334. package/es/utils/components/FieldLabel/index.js +119 -146
  335. package/es/utils/components/FieldLabel/style.js +82 -128
  336. package/es/utils/components/FilterDropdown/index.js +54 -81
  337. package/es/utils/components/FilterDropdown/style.js +17 -38
  338. package/es/utils/components/InlineErrorFormItem/index.js +132 -167
  339. package/es/utils/components/InlineErrorFormItem/style.js +51 -79
  340. package/es/utils/components/LabelIconTip/index.js +58 -56
  341. package/es/utils/components/LabelIconTip/style.js +36 -57
  342. package/es/utils/components/ProFormContext/index.js +2 -6
  343. package/es/utils/conversionMomentValue/index.js +102 -83
  344. package/es/utils/dateArrayFormatter/index.js +31 -16
  345. package/es/utils/genCopyable/index.js +44 -38
  346. package/es/utils/getFieldPropsOrFormItemProps/index.js +10 -7
  347. package/es/utils/hooks/useDebounceFn/index.js +58 -48
  348. package/es/utils/hooks/useDebounceValue/index.js +29 -19
  349. package/es/utils/hooks/useDeepCompareEffect/index.js +29 -44
  350. package/es/utils/hooks/useDeepCompareMemo/index.js +12 -10
  351. package/es/utils/hooks/useDocumentTitle/index.js +5 -9
  352. package/es/utils/hooks/useFetchData/index.js +70 -63
  353. package/es/utils/hooks/useForceRender/index.js +12 -9
  354. package/es/utils/hooks/useLatest/index.js +8 -8
  355. package/es/utils/hooks/usePrevious/index.js +5 -9
  356. package/es/utils/hooks/useReactiveRef/index.js +4 -8
  357. package/es/utils/hooks/useRefCallback/index.js +6 -10
  358. package/es/utils/hooks/useRefFunction/index.js +11 -10
  359. package/es/utils/index.d.ts +1 -3
  360. package/es/utils/index.js +9 -84
  361. package/es/utils/isBrowser/index.js +14 -9
  362. package/es/utils/isDeepEqualReact/index.js +79 -53
  363. package/es/utils/isDropdownValueType/index.js +4 -8
  364. package/es/utils/isImg/index.js +3 -6
  365. package/es/utils/isNil/index.js +3 -5
  366. package/es/utils/isUrl/index.js +10 -10
  367. package/es/utils/merge/index.js +20 -27
  368. package/es/utils/nanoid/index.js +24 -18
  369. package/es/utils/omitBoolean/index.js +8 -7
  370. package/es/utils/omitUndefined/index.js +6 -10
  371. package/es/utils/omitUndefinedAndEmptyArr/index.js +7 -11
  372. package/es/utils/parseValueToMoment/index.js +16 -14
  373. package/es/utils/pickProFormItemProps/index.js +9 -42
  374. package/es/utils/pickProProps/index.js +9 -11
  375. package/es/utils/proFieldParsingText/index.js +141 -49
  376. package/es/utils/runFunction/index.js +8 -8
  377. package/es/utils/stringify/index.js +4 -9
  378. package/es/utils/transformKeySubmitValue/index.js +254 -130
  379. package/es/utils/typing.js +1 -0
  380. package/es/utils/useEditableArray/index.js +776 -611
  381. package/es/utils/useEditableMap/index.js +179 -161
  382. package/es/utils/useMediaQuery/index.js +47 -43
  383. package/es/utils/useMediaQuery/query.js +19 -15
  384. package/es/utils/useMountMergeState/index.d.ts +1 -1
  385. package/es/utils/useMountMergeState/index.js +2 -5
  386. package/es/version.js +3 -7
  387. package/lib/card/ProCard.d.ts +0 -1
  388. package/lib/card/ProCard.js +20 -52
  389. package/lib/card/components/Actions/index.js +39 -57
  390. package/lib/card/components/Actions/style.js +77 -115
  391. package/lib/card/components/Card/index.js +221 -287
  392. package/lib/card/components/Card/style.js +197 -281
  393. package/lib/card/components/CheckCard/Group.js +205 -230
  394. package/lib/card/components/CheckCard/index.js +160 -190
  395. package/lib/card/components/CheckCard/style.js +192 -227
  396. package/lib/card/components/Divider/index.js +30 -47
  397. package/lib/card/components/Divider/style.js +35 -69
  398. package/lib/card/components/Loading/index.js +85 -42
  399. package/lib/card/components/Loading/style.js +48 -78
  400. package/lib/card/components/Operation/index.js +29 -46
  401. package/lib/card/components/Operation/style.js +24 -58
  402. package/lib/card/components/Statistic/index.js +84 -117
  403. package/lib/card/components/Statistic/style.js +81 -130
  404. package/lib/card/components/StatisticCard/index.d.ts +0 -2
  405. package/lib/card/components/StatisticCard/index.js +72 -103
  406. package/lib/card/components/StatisticCard/style.js +41 -70
  407. package/lib/card/index.d.ts +2 -2
  408. package/lib/card/index.js +34 -41
  409. package/lib/card/typing.js +4 -16
  410. package/lib/descriptions/index.js +368 -436
  411. package/lib/descriptions/useFetchData.js +99 -100
  412. package/lib/field/AllProField.js +477 -415
  413. package/lib/field/FieldHOC/index.js +37 -56
  414. package/lib/field/PureProField.js +141 -187
  415. package/lib/field/ValueTypeToComponent.js +725 -454
  416. package/lib/field/components/Cascader/index.d.ts +2 -2
  417. package/lib/field/components/Cascader/index.js +132 -171
  418. package/lib/field/components/Checkbox/index.d.ts +1 -1
  419. package/lib/field/components/Checkbox/index.js +113 -155
  420. package/lib/field/components/Code/index.js +73 -86
  421. package/lib/field/components/ColorPicker/index.d.ts +1 -1
  422. package/lib/field/components/ColorPicker/index.js +61 -103
  423. package/lib/field/components/DatePicker/index.d.ts +2 -2
  424. package/lib/field/components/DatePicker/index.js +109 -145
  425. package/lib/field/components/Digit/index.js +92 -110
  426. package/lib/field/components/DigitRange/index.js +108 -122
  427. package/lib/field/components/FromNow/index.js +57 -90
  428. package/lib/field/components/Image/index.js +52 -76
  429. package/lib/field/components/IndexColumn/index.js +50 -72
  430. package/lib/field/components/Money/index.js +253 -281
  431. package/lib/field/components/Options/index.js +68 -98
  432. package/lib/field/components/Password/index.js +66 -85
  433. package/lib/field/components/Percent/index.js +80 -101
  434. package/lib/field/components/Percent/util.js +28 -33
  435. package/lib/field/components/Progress/index.js +61 -80
  436. package/lib/field/components/Radio/index.d.ts +1 -1
  437. package/lib/field/components/Radio/index.js +92 -134
  438. package/lib/field/components/RangePicker/index.d.ts +2 -2
  439. package/lib/field/components/RangePicker/index.js +129 -164
  440. package/lib/field/components/Rate/index.js +43 -60
  441. package/lib/field/components/Second/index.js +67 -84
  442. package/lib/field/components/Segmented/index.d.ts +1 -1
  443. package/lib/field/components/Segmented/index.js +74 -117
  444. package/lib/field/components/Select/LightSelect/index.d.ts +1 -1
  445. package/lib/field/components/Select/LightSelect/index.js +216 -282
  446. package/lib/field/components/Select/SearchSelect/index.js +195 -245
  447. package/lib/field/components/Select/index.d.ts +2 -2
  448. package/lib/field/components/Select/index.js +307 -379
  449. package/lib/field/components/Slider/index.js +43 -70
  450. package/lib/field/components/Status/index.js +89 -52
  451. package/lib/field/components/Switch/index.d.ts +1 -1
  452. package/lib/field/components/Switch/index.js +67 -98
  453. package/lib/field/components/Text/index.js +58 -74
  454. package/lib/field/components/TextArea/index.js +44 -80
  455. package/lib/field/components/TextArea/readonly.js +43 -76
  456. package/lib/field/components/TimePicker/index.js +188 -217
  457. package/lib/field/components/TreeSelect/index.d.ts +2 -2
  458. package/lib/field/components/TreeSelect/index.js +185 -206
  459. package/lib/field/index.js +240 -96
  460. package/lib/form/BaseForm/BaseForm.js +594 -634
  461. package/lib/form/BaseForm/EditOrReadOnlyContext.js +9 -36
  462. package/lib/form/BaseForm/LightWrapper/index.js +111 -182
  463. package/lib/form/BaseForm/LightWrapper/style.js +19 -56
  464. package/lib/form/BaseForm/Submitter/index.js +75 -126
  465. package/lib/form/BaseForm/index.js +37 -20
  466. package/lib/form/FieldContext.js +8 -36
  467. package/lib/form/components/Captcha/index.js +169 -196
  468. package/lib/form/components/Cascader/index.js +56 -104
  469. package/lib/form/components/Checkbox/index.js +83 -128
  470. package/lib/form/components/ColorPicker/index.js +51 -92
  471. package/lib/form/components/DatePicker/BaseDatePicker.js +54 -98
  472. package/lib/form/components/DatePicker/DatePicker.js +32 -77
  473. package/lib/form/components/DatePicker/DateTimePicker.js +32 -76
  474. package/lib/form/components/DatePicker/MonthPicker.js +32 -77
  475. package/lib/form/components/DatePicker/QuarterPicker.js +32 -77
  476. package/lib/form/components/DatePicker/TimePicker.js +55 -103
  477. package/lib/form/components/DatePicker/WeekPicker.js +32 -77
  478. package/lib/form/components/DatePicker/YearPicker.js +32 -77
  479. package/lib/form/components/DatePicker/index.js +19 -44
  480. package/lib/form/components/DateRangePicker/BaseDateRanger.js +53 -100
  481. package/lib/form/components/DateRangePicker/DateMonthRangePicker.js +36 -78
  482. package/lib/form/components/DateRangePicker/DateQuarterRangePicker.js +36 -78
  483. package/lib/form/components/DateRangePicker/DateTimeRangePicker.js +36 -78
  484. package/lib/form/components/DateRangePicker/DateWeekRangePicker.js +36 -78
  485. package/lib/form/components/DateRangePicker/DateYearRangePicker.js +36 -78
  486. package/lib/form/components/DateRangePicker/TimeRangePicker.js +53 -97
  487. package/lib/form/components/DateRangePicker/index.js +36 -78
  488. package/lib/form/components/Dependency/index.js +68 -127
  489. package/lib/form/components/Digit/DigitRange.d.ts +1 -1
  490. package/lib/form/components/Digit/DigitRange.js +50 -103
  491. package/lib/form/components/Digit/index.js +55 -106
  492. package/lib/form/components/Field/index.js +89 -153
  493. package/lib/form/components/FieldSet/index.js +107 -153
  494. package/lib/form/components/FormItem/FormItemRender/index.js +142 -114
  495. package/lib/form/components/FormItem/Group/index.js +143 -198
  496. package/lib/form/components/FormItem/Group/style.js +46 -77
  497. package/lib/form/components/FormItem/index.js +257 -316
  498. package/lib/form/components/FormItem/warpField.js +229 -308
  499. package/lib/form/components/List/ListContainer.js +227 -211
  500. package/lib/form/components/List/ListItem.js +267 -374
  501. package/lib/form/components/List/index.js +211 -277
  502. package/lib/form/components/List/style.js +53 -110
  503. package/lib/form/components/Money/index.js +58 -108
  504. package/lib/form/components/Radio/index.js +60 -114
  505. package/lib/form/components/Rate/index.js +45 -88
  506. package/lib/form/components/SchemaForm/index.js +154 -193
  507. package/lib/form/components/SchemaForm/layoutType/Embed.js +12 -24
  508. package/lib/form/components/SchemaForm/layoutType/StepsForm.js +43 -96
  509. package/lib/form/components/SchemaForm/layoutType/index.js +18 -35
  510. package/lib/form/components/SchemaForm/typing.js +4 -16
  511. package/lib/form/components/SchemaForm/valueType/dependency.js +25 -69
  512. package/lib/form/components/SchemaForm/valueType/divider.js +16 -45
  513. package/lib/form/components/SchemaForm/valueType/field.js +67 -128
  514. package/lib/form/components/SchemaForm/valueType/formList.js +22 -58
  515. package/lib/form/components/SchemaForm/valueType/formSet.js +22 -68
  516. package/lib/form/components/SchemaForm/valueType/group.js +21 -53
  517. package/lib/form/components/SchemaForm/valueType/ignore.js +8 -25
  518. package/lib/form/components/SchemaForm/valueType/index.js +27 -43
  519. package/lib/form/components/Segmented/index.js +50 -89
  520. package/lib/form/components/Select/index.js +125 -181
  521. package/lib/form/components/Slider/index.js +62 -119
  522. package/lib/form/components/Switch/index.js +55 -99
  523. package/lib/form/components/Text/index.js +141 -190
  524. package/lib/form/components/TextArea/index.js +42 -85
  525. package/lib/form/components/TreeSelect/index.js +50 -89
  526. package/lib/form/components/UploadButton/index.js +131 -172
  527. package/lib/form/components/UploadDragger/index.js +84 -119
  528. package/lib/form/components/index.js +294 -110
  529. package/lib/form/helpers/grid.js +82 -97
  530. package/lib/form/helpers/index.js +15 -18
  531. package/lib/form/index.js +78 -38
  532. package/lib/form/layouts/DrawerForm/index.js +317 -338
  533. package/lib/form/layouts/DrawerForm/style.js +31 -65
  534. package/lib/form/layouts/LightFilter/index.js +217 -293
  535. package/lib/form/layouts/LightFilter/style.js +54 -89
  536. package/lib/form/layouts/LoginForm/index.js +93 -133
  537. package/lib/form/layouts/LoginForm/style.js +73 -110
  538. package/lib/form/layouts/LoginFormPage/index.js +148 -174
  539. package/lib/form/layouts/LoginFormPage/style.js +133 -165
  540. package/lib/form/layouts/ModalForm/index.js +253 -273
  541. package/lib/form/layouts/ProForm/index.js +28 -68
  542. package/lib/form/layouts/QueryFilter/Actions.js +57 -77
  543. package/lib/form/layouts/QueryFilter/index.js +308 -390
  544. package/lib/form/layouts/QueryFilter/style.js +43 -84
  545. package/lib/form/layouts/StepsForm/StepForm.js +94 -146
  546. package/lib/form/layouts/StepsForm/index.js +351 -378
  547. package/lib/form/layouts/StepsForm/style.js +34 -65
  548. package/lib/form/layouts/index.js +62 -40
  549. package/lib/form/typing.js +4 -16
  550. package/lib/index.js +133 -34
  551. package/lib/layout/ProLayout.js +447 -528
  552. package/lib/layout/WrapContent.js +34 -46
  553. package/lib/layout/assert/Logo.js +110 -97
  554. package/lib/layout/components/AppsLogoComponents/AppsLogo.js +17 -29
  555. package/lib/layout/components/AppsLogoComponents/DefaultContent.js +55 -85
  556. package/lib/layout/components/AppsLogoComponents/SimpleContent.js +78 -95
  557. package/lib/layout/components/AppsLogoComponents/index.js +98 -105
  558. package/lib/layout/components/AppsLogoComponents/style/default.js +36 -55
  559. package/lib/layout/components/AppsLogoComponents/style/index.js +58 -94
  560. package/lib/layout/components/AppsLogoComponents/style/simple.js +41 -59
  561. package/lib/layout/components/CollapsedIcon/index.js +26 -82
  562. package/lib/layout/components/CollapsedIcon/style.js +47 -81
  563. package/lib/layout/components/Footer.js +33 -65
  564. package/lib/layout/components/FooterToolbar/index.js +87 -132
  565. package/lib/layout/components/FooterToolbar/style/index.js +43 -77
  566. package/lib/layout/components/FooterToolbar/style/stylish.js +16 -54
  567. package/lib/layout/components/GlobalFooter/index.js +43 -61
  568. package/lib/layout/components/GlobalFooter/style.js +37 -68
  569. package/lib/layout/components/GlobalHeader/ActionsContent.js +138 -208
  570. package/lib/layout/components/GlobalHeader/index.d.ts +0 -5
  571. package/lib/layout/components/GlobalHeader/index.js +86 -116
  572. package/lib/layout/components/GlobalHeader/rightContentStyle.js +57 -91
  573. package/lib/layout/components/GlobalHeader/style.js +62 -98
  574. package/lib/layout/components/GridContent/index.js +43 -64
  575. package/lib/layout/components/GridContent/style.js +19 -53
  576. package/lib/layout/components/Header/index.js +105 -156
  577. package/lib/layout/components/Header/style/header.js +53 -87
  578. package/lib/layout/components/Header/style/stylish.js +18 -58
  579. package/lib/layout/components/Help/AsyncContentPanel.js +59 -62
  580. package/lib/layout/components/Help/HelpProvide.js +59 -34
  581. package/lib/layout/components/Help/ProHelpContentPanel.js +139 -157
  582. package/lib/layout/components/Help/ProHelpDrawer.js +54 -102
  583. package/lib/layout/components/Help/ProHelpModal.js +53 -102
  584. package/lib/layout/components/Help/ProHelpPanel.js +192 -254
  585. package/lib/layout/components/Help/ProHelpPopover.js +46 -92
  586. package/lib/layout/components/Help/RenderContentPanel.js +97 -130
  587. package/lib/layout/components/Help/Search.js +130 -191
  588. package/lib/layout/components/Help/index.js +113 -74
  589. package/lib/layout/components/Help/style.js +96 -130
  590. package/lib/layout/components/PageContainer/index.js +245 -308
  591. package/lib/layout/components/PageContainer/style/index.js +83 -133
  592. package/lib/layout/components/PageContainer/style/stylish.js +16 -54
  593. package/lib/layout/components/PageHeader/index.js +149 -156
  594. package/lib/layout/components/PageHeader/style/index.js +129 -182
  595. package/lib/layout/components/PageLoading/index.js +28 -76
  596. package/lib/layout/components/SettingDrawer/BlockCheckbox.js +46 -71
  597. package/lib/layout/components/SettingDrawer/LayoutChange.js +114 -129
  598. package/lib/layout/components/SettingDrawer/RegionalChange.js +38 -65
  599. package/lib/layout/components/SettingDrawer/ThemeColor.js +55 -95
  600. package/lib/layout/components/SettingDrawer/icon/group.js +111 -105
  601. package/lib/layout/components/SettingDrawer/icon/sub.js +72 -133
  602. package/lib/layout/components/SettingDrawer/index.js +424 -447
  603. package/lib/layout/components/SettingDrawer/style/index.js +147 -161
  604. package/lib/layout/components/SiderMenu/Arrow.js +16 -34
  605. package/lib/layout/components/SiderMenu/BaseMenu.js +416 -487
  606. package/lib/layout/components/SiderMenu/SiderMenu.js +254 -367
  607. package/lib/layout/components/SiderMenu/index.js +81 -130
  608. package/lib/layout/components/SiderMenu/style/index.js +178 -226
  609. package/lib/layout/components/SiderMenu/style/menu.js +115 -188
  610. package/lib/layout/components/SiderMenu/style/stylish.js +18 -58
  611. package/lib/layout/components/TopNavHeader/index.js +117 -211
  612. package/lib/layout/components/TopNavHeader/style.js +72 -110
  613. package/lib/layout/context/RouteContext.js +6 -24
  614. package/lib/layout/defaultSettings.js +11 -29
  615. package/lib/layout/getPageTitle.js +53 -60
  616. package/lib/layout/index.js +145 -55
  617. package/lib/layout/locales/en-US/settingDrawer.js +47 -65
  618. package/lib/layout/locales/en-US.js +8 -48
  619. package/lib/layout/locales/index.js +24 -52
  620. package/lib/layout/locales/it-IT/settingDrawer.js +38 -56
  621. package/lib/layout/locales/it-IT.js +8 -48
  622. package/lib/layout/locales/ko-KR/settingDrawer.js +43 -61
  623. package/lib/layout/locales/ko-KR.js +8 -48
  624. package/lib/layout/locales/zh-CN/settingDrawer.js +47 -65
  625. package/lib/layout/locales/zh-CN.js +8 -48
  626. package/lib/layout/locales/zh-TW/settingDrawer.js +39 -57
  627. package/lib/layout/locales/zh-TW.js +8 -48
  628. package/lib/layout/style/index.js +48 -88
  629. package/lib/layout/typing.js +4 -16
  630. package/lib/layout/utils/getBreadcrumbProps.js +117 -107
  631. package/lib/layout/utils/getMenuData.js +23 -40
  632. package/lib/layout/utils/pathTools.js +14 -29
  633. package/lib/layout/utils/useCurrentMenuLayoutProps.js +27 -49
  634. package/lib/layout/utils/utils.js +40 -64
  635. package/lib/list/Item.js +229 -321
  636. package/lib/list/ListView.js +197 -260
  637. package/lib/list/constants.js +7 -35
  638. package/lib/list/index.js +132 -207
  639. package/lib/list/style/index.js +230 -302
  640. package/lib/provider/index.js +270 -215
  641. package/lib/provider/intl.js +140 -188
  642. package/lib/provider/locale/ar_EG.js +51 -69
  643. package/lib/provider/locale/ca_ES.js +49 -67
  644. package/lib/provider/locale/cs_CZ.js +54 -72
  645. package/lib/provider/locale/de_DE.js +51 -69
  646. package/lib/provider/locale/en_GB.js +53 -71
  647. package/lib/provider/locale/en_US.js +55 -73
  648. package/lib/provider/locale/es_ES.js +51 -69
  649. package/lib/provider/locale/fa_IR.js +51 -69
  650. package/lib/provider/locale/fr_FR.js +51 -69
  651. package/lib/provider/locale/he_IL.js +54 -72
  652. package/lib/provider/locale/hr_HR.js +51 -69
  653. package/lib/provider/locale/id_ID.js +51 -69
  654. package/lib/provider/locale/it_IT.js +51 -69
  655. package/lib/provider/locale/ja_JP.js +51 -69
  656. package/lib/provider/locale/ko_KR.js +51 -69
  657. package/lib/provider/locale/mn_MN.js +51 -69
  658. package/lib/provider/locale/ms_MY.js +51 -69
  659. package/lib/provider/locale/nl_NL.js +54 -72
  660. package/lib/provider/locale/pl_PL.js +51 -69
  661. package/lib/provider/locale/pt_BR.js +51 -69
  662. package/lib/provider/locale/ro_RO.js +54 -72
  663. package/lib/provider/locale/ru_RU.js +51 -69
  664. package/lib/provider/locale/sk_SK.js +54 -72
  665. package/lib/provider/locale/sr_RS.js +51 -69
  666. package/lib/provider/locale/sv_SE.js +54 -72
  667. package/lib/provider/locale/th_TH.js +54 -72
  668. package/lib/provider/locale/tr_TR.js +51 -69
  669. package/lib/provider/locale/uk_UA.js +54 -72
  670. package/lib/provider/locale/uz_UZ.js +51 -69
  671. package/lib/provider/locale/vi_VN.js +51 -69
  672. package/lib/provider/locale/zh_CN.js +54 -72
  673. package/lib/provider/locale/zh_HK.js +54 -72
  674. package/lib/provider/locale/zh_TW.js +54 -72
  675. package/lib/provider/typing/layoutToken.d.ts +0 -10
  676. package/lib/provider/typing/layoutToken.js +36 -69
  677. package/lib/provider/useStyle/index.d.ts +1 -1
  678. package/lib/provider/useStyle/index.js +98 -94
  679. package/lib/provider/utils/merge.js +18 -44
  680. package/lib/skeleton/components/Descriptions/index.js +246 -282
  681. package/lib/skeleton/components/List/index.js +221 -236
  682. package/lib/skeleton/components/Result/index.js +63 -84
  683. package/lib/skeleton/index.js +73 -79
  684. package/lib/table/Store/Provide.d.ts +0 -1
  685. package/lib/table/Store/Provide.js +147 -151
  686. package/lib/table/Table.js +664 -712
  687. package/lib/table/components/Alert/index.js +66 -67
  688. package/lib/table/components/Alert/style.js +33 -67
  689. package/lib/table/components/ColumnSetting/index.js +391 -404
  690. package/lib/table/components/ColumnSetting/style.js +77 -123
  691. package/lib/table/components/DragSortTable/index.js +110 -165
  692. package/lib/table/components/DragSortTable/style.js +25 -59
  693. package/lib/table/components/Dropdown/index.js +75 -108
  694. package/lib/table/components/EditableTable/CellEditorTable.js +55 -90
  695. package/lib/table/components/EditableTable/RowEditorTable.js +49 -87
  696. package/lib/table/components/EditableTable/index.js +351 -365
  697. package/lib/table/components/Form/FormRender.js +176 -201
  698. package/lib/table/components/Form/index.js +132 -161
  699. package/lib/table/components/ListToolBar/HeaderMenu.js +74 -128
  700. package/lib/table/components/ListToolBar/index.js +263 -302
  701. package/lib/table/components/ListToolBar/style.js +124 -149
  702. package/lib/table/components/ToolBar/DensityIcon.js +43 -71
  703. package/lib/table/components/ToolBar/FullscreenIcon.js +30 -45
  704. package/lib/table/components/ToolBar/index.js +247 -299
  705. package/lib/table/index.js +179 -71
  706. package/lib/table/style/index.js +135 -190
  707. package/lib/table/typing.d.ts +2 -2
  708. package/lib/table/typing.js +4 -16
  709. package/lib/table/useFetchData.js +437 -241
  710. package/lib/table/utils/cellRenderToFromItem.js +192 -277
  711. package/lib/table/utils/columnRender.js +126 -144
  712. package/lib/table/utils/columnSort.js +27 -39
  713. package/lib/table/utils/genProColumnToColumn.js +111 -141
  714. package/lib/table/utils/index.js +204 -128
  715. package/lib/table/utils/useDragSort.js +141 -188
  716. package/lib/utils/components/DropdownFooter/index.js +56 -89
  717. package/lib/utils/components/DropdownFooter/style.js +21 -55
  718. package/lib/utils/components/ErrorBoundary/index.js +55 -53
  719. package/lib/utils/components/FieldLabel/index.js +126 -176
  720. package/lib/utils/components/FieldLabel/style.js +87 -143
  721. package/lib/utils/components/FilterDropdown/index.js +61 -109
  722. package/lib/utils/components/FilterDropdown/style.js +22 -53
  723. package/lib/utils/components/InlineErrorFormItem/index.js +137 -193
  724. package/lib/utils/components/InlineErrorFormItem/style.js +56 -94
  725. package/lib/utils/components/LabelIconTip/index.js +62 -82
  726. package/lib/utils/components/LabelIconTip/style.js +41 -72
  727. package/lib/utils/components/ProFormContext/index.js +7 -34
  728. package/lib/utils/conversionMomentValue/index.js +112 -115
  729. package/lib/utils/dateArrayFormatter/index.js +38 -46
  730. package/lib/utils/genCopyable/index.js +49 -66
  731. package/lib/utils/getFieldPropsOrFormItemProps/index.js +15 -27
  732. package/lib/utils/hooks/useDebounceFn/index.js +63 -65
  733. package/lib/utils/hooks/useDebounceValue/index.js +35 -38
  734. package/lib/utils/hooks/useDeepCompareEffect/index.js +37 -61
  735. package/lib/utils/hooks/useDeepCompareMemo/index.js +17 -39
  736. package/lib/utils/hooks/useDocumentTitle/index.js +10 -28
  737. package/lib/utils/hooks/useFetchData/index.js +74 -89
  738. package/lib/utils/hooks/useForceRender/index.js +16 -26
  739. package/lib/utils/hooks/useLatest/index.js +11 -26
  740. package/lib/utils/hooks/usePrevious/index.js +9 -27
  741. package/lib/utils/hooks/useReactiveRef/index.js +10 -37
  742. package/lib/utils/hooks/useRefCallback/index.js +9 -27
  743. package/lib/utils/hooks/useRefFunction/index.js +16 -29
  744. package/lib/utils/index.d.ts +1 -3
  745. package/lib/utils/index.js +455 -138
  746. package/lib/utils/isBrowser/index.js +18 -27
  747. package/lib/utils/isDeepEqualReact/index.js +83 -70
  748. package/lib/utils/isDropdownValueType/index.js +8 -26
  749. package/lib/utils/isImg/index.js +6 -23
  750. package/lib/utils/isNil/index.js +7 -23
  751. package/lib/utils/isUrl/index.js +14 -28
  752. package/lib/utils/merge/index.js +26 -44
  753. package/lib/utils/nanoid/index.js +28 -36
  754. package/lib/utils/omitBoolean/index.js +12 -25
  755. package/lib/utils/omitUndefined/index.js +10 -28
  756. package/lib/utils/omitUndefinedAndEmptyArr/index.js +11 -29
  757. package/lib/utils/parseValueToMoment/index.js +26 -47
  758. package/lib/utils/pickProFormItemProps/index.js +12 -59
  759. package/lib/utils/pickProProps/index.js +13 -29
  760. package/lib/utils/proFieldParsingText/index.js +146 -77
  761. package/lib/utils/runFunction/index.js +12 -26
  762. package/lib/utils/stringify/index.js +14 -28
  763. package/lib/utils/transformKeySubmitValue/index.js +262 -160
  764. package/lib/utils/typing.js +4 -16
  765. package/lib/utils/useEditableArray/index.js +790 -630
  766. package/lib/utils/useEditableMap/index.js +188 -179
  767. package/lib/utils/useMediaQuery/index.js +53 -73
  768. package/lib/utils/useMediaQuery/query.js +23 -32
  769. package/lib/utils/useMountMergeState/index.d.ts +1 -1
  770. package/lib/utils/useMountMergeState/index.js +10 -33
  771. package/lib/version.js +7 -25
  772. package/package.json +4 -3
  773. package/es/card/components/TabPane/index.d.ts +0 -26
  774. package/es/card/components/TabPane/index.js +0 -84
  775. package/es/utils/compareVersions/coverToNewToken.d.ts +0 -2
  776. package/es/utils/compareVersions/coverToNewToken.js +0 -56
  777. package/es/utils/compareVersions/index.d.ts +0 -8
  778. package/es/utils/compareVersions/index.js +0 -48
  779. package/lib/card/components/TabPane/index.d.ts +0 -26
  780. package/lib/card/components/TabPane/index.js +0 -111
  781. package/lib/utils/compareVersions/coverToNewToken.d.ts +0 -2
  782. package/lib/utils/compareVersions/coverToNewToken.js +0 -73
  783. package/lib/utils/compareVersions/index.d.ts +0 -8
  784. package/lib/utils/compareVersions/index.js +0 -68
@@ -1,124 +1,84 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
-
21
- // src/layout/components/PageContainer/style/index.ts
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
22
4
  import { useStyle as useAntdStyle } from "../../../../provider";
23
- var [sm, md, lg, xl] = [576, 768, 992, 1200].map(
24
- (bp) => `@media (max-width: ${bp}px)`
25
- );
26
- var genPageContainerStyle = (token) => {
27
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
28
- return {
29
- [token.componentCls]: {
30
- position: "relative",
31
- "&-children-container": {
32
- paddingBlockStart: 0,
33
- paddingBlockEnd: (_b = (_a = token.layout) == null ? void 0 : _a.pageContainer) == null ? void 0 : _b.paddingBlockPageContainerContent,
34
- paddingInline: (_d = (_c = token.layout) == null ? void 0 : _c.pageContainer) == null ? void 0 : _d.paddingInlinePageContainerContent
35
- },
36
- "&-children-container-no-header": {
37
- paddingBlockStart: (_f = (_e = token.layout) == null ? void 0 : _e.pageContainer) == null ? void 0 : _f.paddingBlockPageContainerContent
38
- },
39
- "&-affix": {
40
- [`${token.antCls}-affix`]: {
41
- [`${token.componentCls}-warp`]: {
42
- backgroundColor: (_h = (_g = token.layout) == null ? void 0 : _g.pageContainer) == null ? void 0 : _h.colorBgPageContainerFixed,
43
- transition: "background-color 0.3s",
44
- boxShadow: "0 2px 8px #f0f1f2"
45
- }
46
- }
47
- },
48
- ["& &-warp-page-header"]: {
49
- paddingBlockStart: ((_k = (_j = (_i = token.layout) == null ? void 0 : _i.pageContainer) == null ? void 0 : _j.paddingBlockPageContainerContent) != null ? _k : 40) / 4,
50
- paddingBlockEnd: ((_n = (_m = (_l = token.layout) == null ? void 0 : _l.pageContainer) == null ? void 0 : _m.paddingBlockPageContainerContent) != null ? _n : 40) / 2,
51
- paddingInlineStart: (_p = (_o = token.layout) == null ? void 0 : _o.pageContainer) == null ? void 0 : _p.paddingInlinePageContainerContent,
52
- paddingInlineEnd: (_r = (_q = token.layout) == null ? void 0 : _q.pageContainer) == null ? void 0 : _r.paddingInlinePageContainerContent,
53
- [`& ~ ${token.proComponentsCls}-grid-content`]: {
54
- [`${token.proComponentsCls}-page-container-children-content`]: {
55
- paddingBlock: ((_u = (_t = (_s = token.layout) == null ? void 0 : _s.pageContainer) == null ? void 0 : _t.paddingBlockPageContainerContent) != null ? _u : 24) / 3
56
- }
57
- },
58
- [`${token.antCls}-page-header-breadcrumb`]: {
59
- paddingBlockStart: ((_x = (_w = (_v = token.layout) == null ? void 0 : _v.pageContainer) == null ? void 0 : _w.paddingBlockPageContainerContent) != null ? _x : 40) / 4 + 10
60
- },
61
- [`${token.antCls}-page-header-heading`]: {
62
- paddingBlockStart: ((_A = (_z = (_y = token.layout) == null ? void 0 : _y.pageContainer) == null ? void 0 : _z.paddingBlockPageContainerContent) != null ? _A : 40) / 4
63
- },
64
- [`${token.antCls}-page-header-footer`]: {
65
- marginBlockStart: ((_D = (_C = (_B = token.layout) == null ? void 0 : _B.pageContainer) == null ? void 0 : _C.paddingBlockPageContainerContent) != null ? _D : 40) / 4
66
- }
67
- },
68
- "&-detail": {
69
- display: "flex",
70
- [sm]: {
71
- display: "block"
72
- }
73
- },
74
- "&-main": {
75
- width: "100%"
76
- },
77
- "&-row": {
78
- display: "flex",
79
- width: "100%",
80
- [md]: {
81
- display: "block"
82
- }
83
- },
84
- "&-content": {
85
- flex: "auto",
86
- width: "100%"
87
- },
88
- "&-extraContent": {
89
- flex: "0 1 auto",
90
- minWidth: "242px",
91
- marginInlineStart: 88,
92
- textAlign: "end",
93
- [xl]: {
94
- marginInlineStart: 44
95
- },
96
- [lg]: {
97
- marginInlineStart: 20
98
- },
99
- [md]: {
100
- marginInlineStart: 0,
101
- textAlign: "start"
102
- },
103
- [sm]: {
104
- marginInlineStart: 0
105
- }
106
- }
107
- }
108
- };
5
+ var _map = [576, 768, 992, 1200].map(function (bp) {
6
+ return "@media (max-width: ".concat(bp, "px)");
7
+ }),
8
+ _map2 = _slicedToArray(_map, 4),
9
+ sm = _map2[0],
10
+ md = _map2[1],
11
+ lg = _map2[2],
12
+ xl = _map2[3];
13
+ var genPageContainerStyle = function genPageContainerStyle(token) {
14
+ var _token$layout, _token$layout2, _token$layout3, _token$layout4, _token$layout$pageCon, _token$layout5, _token$layout$pageCon2, _token$layout6, _token$layout7, _token$layout8, _token$layout$pageCon3, _token$layout9, _token$layout$pageCon4, _token$layout10, _token$layout$pageCon5, _token$layout11, _token$layout$pageCon6, _token$layout12;
15
+ return _defineProperty({}, token.componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
16
+ position: 'relative',
17
+ '&-children-container': {
18
+ paddingBlockStart: 0,
19
+ paddingBlockEnd: (_token$layout = token.layout) === null || _token$layout === void 0 || (_token$layout = _token$layout.pageContainer) === null || _token$layout === void 0 ? void 0 : _token$layout.paddingBlockPageContainerContent,
20
+ paddingInline: (_token$layout2 = token.layout) === null || _token$layout2 === void 0 || (_token$layout2 = _token$layout2.pageContainer) === null || _token$layout2 === void 0 ? void 0 : _token$layout2.paddingInlinePageContainerContent
21
+ },
22
+ '&-children-container-no-header': {
23
+ paddingBlockStart: (_token$layout3 = token.layout) === null || _token$layout3 === void 0 || (_token$layout3 = _token$layout3.pageContainer) === null || _token$layout3 === void 0 ? void 0 : _token$layout3.paddingBlockPageContainerContent
24
+ },
25
+ '&-affix': _defineProperty({}, "".concat(token.antCls, "-affix"), _defineProperty({}, "".concat(token.componentCls, "-warp"), {
26
+ backgroundColor: (_token$layout4 = token.layout) === null || _token$layout4 === void 0 || (_token$layout4 = _token$layout4.pageContainer) === null || _token$layout4 === void 0 ? void 0 : _token$layout4.colorBgPageContainerFixed,
27
+ transition: 'background-color 0.3s',
28
+ boxShadow: '0 2px 8px #f0f1f2'
29
+ }))
30
+ }, '& &-warp-page-header', _defineProperty(_defineProperty(_defineProperty(_defineProperty({
31
+ paddingBlockStart: ((_token$layout$pageCon = (_token$layout5 = token.layout) === null || _token$layout5 === void 0 || (_token$layout5 = _token$layout5.pageContainer) === null || _token$layout5 === void 0 ? void 0 : _token$layout5.paddingBlockPageContainerContent) !== null && _token$layout$pageCon !== void 0 ? _token$layout$pageCon : 40) / 4,
32
+ paddingBlockEnd: ((_token$layout$pageCon2 = (_token$layout6 = token.layout) === null || _token$layout6 === void 0 || (_token$layout6 = _token$layout6.pageContainer) === null || _token$layout6 === void 0 ? void 0 : _token$layout6.paddingBlockPageContainerContent) !== null && _token$layout$pageCon2 !== void 0 ? _token$layout$pageCon2 : 40) / 2,
33
+ paddingInlineStart: (_token$layout7 = token.layout) === null || _token$layout7 === void 0 || (_token$layout7 = _token$layout7.pageContainer) === null || _token$layout7 === void 0 ? void 0 : _token$layout7.paddingInlinePageContainerContent,
34
+ paddingInlineEnd: (_token$layout8 = token.layout) === null || _token$layout8 === void 0 || (_token$layout8 = _token$layout8.pageContainer) === null || _token$layout8 === void 0 ? void 0 : _token$layout8.paddingInlinePageContainerContent
35
+ }, "& ~ ".concat(token.proComponentsCls, "-grid-content"), _defineProperty({}, "".concat(token.proComponentsCls, "-page-container-children-content"), {
36
+ paddingBlock: ((_token$layout$pageCon3 = (_token$layout9 = token.layout) === null || _token$layout9 === void 0 || (_token$layout9 = _token$layout9.pageContainer) === null || _token$layout9 === void 0 ? void 0 : _token$layout9.paddingBlockPageContainerContent) !== null && _token$layout$pageCon3 !== void 0 ? _token$layout$pageCon3 : 24) / 3
37
+ })), "".concat(token.antCls, "-page-header-breadcrumb"), {
38
+ paddingBlockStart: ((_token$layout$pageCon4 = (_token$layout10 = token.layout) === null || _token$layout10 === void 0 || (_token$layout10 = _token$layout10.pageContainer) === null || _token$layout10 === void 0 ? void 0 : _token$layout10.paddingBlockPageContainerContent) !== null && _token$layout$pageCon4 !== void 0 ? _token$layout$pageCon4 : 40) / 4 + 10
39
+ }), "".concat(token.antCls, "-page-header-heading"), {
40
+ paddingBlockStart: ((_token$layout$pageCon5 = (_token$layout11 = token.layout) === null || _token$layout11 === void 0 || (_token$layout11 = _token$layout11.pageContainer) === null || _token$layout11 === void 0 ? void 0 : _token$layout11.paddingBlockPageContainerContent) !== null && _token$layout$pageCon5 !== void 0 ? _token$layout$pageCon5 : 40) / 4
41
+ }), "".concat(token.antCls, "-page-header-footer"), {
42
+ marginBlockStart: ((_token$layout$pageCon6 = (_token$layout12 = token.layout) === null || _token$layout12 === void 0 || (_token$layout12 = _token$layout12.pageContainer) === null || _token$layout12 === void 0 ? void 0 : _token$layout12.paddingBlockPageContainerContent) !== null && _token$layout$pageCon6 !== void 0 ? _token$layout$pageCon6 : 40) / 4
43
+ })), '&-detail', _defineProperty({
44
+ display: 'flex'
45
+ }, sm, {
46
+ display: 'block'
47
+ })), '&-main', {
48
+ width: '100%'
49
+ }), '&-row', _defineProperty({
50
+ display: 'flex',
51
+ width: '100%'
52
+ }, md, {
53
+ display: 'block'
54
+ })), '&-content', {
55
+ flex: 'auto',
56
+ width: '100%'
57
+ }), '&-extraContent', _defineProperty(_defineProperty(_defineProperty(_defineProperty({
58
+ flex: '0 1 auto',
59
+ minWidth: '242px',
60
+ marginInlineStart: 88,
61
+ textAlign: 'end'
62
+ }, xl, {
63
+ marginInlineStart: 44
64
+ }), lg, {
65
+ marginInlineStart: 20
66
+ }), md, {
67
+ marginInlineStart: 0,
68
+ textAlign: 'start'
69
+ }), sm, {
70
+ marginInlineStart: 0
71
+ })));
109
72
  };
110
- function useStyle(prefixCls, componentsToken) {
111
- return useAntdStyle("ProLayoutPageContainer", (token) => {
112
- var _a;
113
- const proCardToken = __spreadProps(__spreadValues({}, token), {
114
- componentCls: `.${prefixCls}`,
115
- layout: __spreadProps(__spreadValues({}, token == null ? void 0 : token.layout), {
116
- pageContainer: __spreadValues(__spreadValues({}, (_a = token == null ? void 0 : token.layout) == null ? void 0 : _a.pageContainer), componentsToken)
73
+ export function useStyle(prefixCls, componentsToken) {
74
+ return useAntdStyle('ProLayoutPageContainer', function (token) {
75
+ var _token$layout13;
76
+ var proCardToken = _objectSpread(_objectSpread({}, token), {}, {
77
+ componentCls: ".".concat(prefixCls),
78
+ layout: _objectSpread(_objectSpread({}, token === null || token === void 0 ? void 0 : token.layout), {}, {
79
+ pageContainer: _objectSpread(_objectSpread({}, token === null || token === void 0 || (_token$layout13 = token.layout) === null || _token$layout13 === void 0 ? void 0 : _token$layout13.pageContainer), componentsToken)
117
80
  })
118
81
  });
119
82
  return [genPageContainerStyle(proCardToken)];
120
83
  });
121
- }
122
- export {
123
- useStyle
124
- };
84
+ }
@@ -1,41 +1,13 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
-
21
- // src/layout/components/PageContainer/style/stylish.ts
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
22
3
  import { useStyle as useAntdStyle } from "../../../../provider";
23
- function useStylish(prefixCls, {
24
- stylish
25
- }) {
26
- return useAntdStyle("ProLayoutPageContainerStylish", (token) => {
27
- const stylishToken = __spreadProps(__spreadValues({}, token), {
28
- componentCls: `.${prefixCls}`
4
+ export function useStylish(prefixCls, _ref) {
5
+ var stylish = _ref.stylish;
6
+ return useAntdStyle('ProLayoutPageContainerStylish', function (token) {
7
+ var stylishToken = _objectSpread(_objectSpread({}, token), {}, {
8
+ componentCls: ".".concat(prefixCls)
29
9
  });
30
- if (!stylish)
31
- return [];
32
- return [
33
- {
34
- [`div${stylishToken.componentCls}`]: stylish == null ? void 0 : stylish(stylishToken)
35
- }
36
- ];
10
+ if (!stylish) return [];
11
+ return [_defineProperty({}, "div".concat(stylishToken.componentCls), stylish === null || stylish === void 0 ? void 0 : stylish(stylishToken))];
37
12
  });
38
- }
39
- export {
40
- useStylish
41
- };
13
+ }
@@ -1,155 +1,170 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
-
21
- // src/layout/components/PageHeader/index.tsx
22
- import { ArrowLeftOutlined, ArrowRightOutlined } from "@ant-design/icons";
23
- import { Avatar, Breadcrumb, ConfigProvider, Space } from "antd";
24
- import classNames from "classnames";
25
- import ResizeObserver from "rc-resize-observer";
26
- import React from "react";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import { ArrowLeftOutlined, ArrowRightOutlined } from '@ant-design/icons';
5
+ import { Avatar, Breadcrumb, ConfigProvider, Space } from 'antd';
6
+ import classNames from 'classnames';
7
+ import ResizeObserver from 'rc-resize-observer';
8
+ import React from 'react';
27
9
  import useStyle from "./style";
28
- var renderBack = (prefixCls, hashId, backIcon, onBack) => {
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ var renderBack = function renderBack(prefixCls, hashId, backIcon, onBack) {
29
13
  if (!backIcon || !onBack) {
30
14
  return null;
31
15
  }
32
- return /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-back ${hashId}`.trim() }, /* @__PURE__ */ React.createElement(
33
- "div",
34
- {
16
+ return /*#__PURE__*/_jsx("div", {
17
+ className: "".concat(prefixCls, "-back ").concat(hashId).trim(),
18
+ children: /*#__PURE__*/_jsx("div", {
35
19
  role: "button",
36
- onClick: (e) => {
37
- onBack == null ? void 0 : onBack(e);
20
+ onClick: function onClick(e) {
21
+ onBack === null || onBack === void 0 || onBack(e);
38
22
  },
39
- className: `${prefixCls}-back-button ${hashId}`.trim(),
40
- "aria-label": "back"
41
- },
42
- backIcon
43
- ));
44
- };
45
- var renderBreadcrumb = (breadcrumb, prefixCls) => {
46
- var _a;
47
- if (!((_a = breadcrumb.items) == null ? void 0 : _a.length))
48
- return null;
49
- return /* @__PURE__ */ React.createElement(
50
- Breadcrumb,
51
- __spreadProps(__spreadValues({}, breadcrumb), {
52
- className: classNames(`${prefixCls}-breadcrumb`, breadcrumb.className)
23
+ className: "".concat(prefixCls, "-back-button ").concat(hashId).trim(),
24
+ "aria-label": "back",
25
+ children: backIcon
53
26
  })
54
- );
27
+ });
55
28
  };
56
- var getBackIcon = (props, direction = "ltr") => {
57
- if (props.backIcon !== void 0) {
29
+ var renderBreadcrumb = function renderBreadcrumb(breadcrumb, prefixCls) {
30
+ var _breadcrumb$items;
31
+ if (!((_breadcrumb$items = breadcrumb.items) !== null && _breadcrumb$items !== void 0 && _breadcrumb$items.length)) return null;
32
+ return /*#__PURE__*/_jsx(Breadcrumb, _objectSpread(_objectSpread({}, breadcrumb), {}, {
33
+ className: classNames("".concat(prefixCls, "-breadcrumb"), breadcrumb.className)
34
+ }));
35
+ };
36
+ var getBackIcon = function getBackIcon(props) {
37
+ var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ltr';
38
+ if (props.backIcon !== undefined) {
58
39
  return props.backIcon;
59
40
  }
60
- return direction === "rtl" ? /* @__PURE__ */ React.createElement(ArrowRightOutlined, null) : /* @__PURE__ */ React.createElement(ArrowLeftOutlined, null);
41
+ return direction === 'rtl' ? /*#__PURE__*/_jsx(ArrowRightOutlined, {}) : /*#__PURE__*/_jsx(ArrowLeftOutlined, {});
61
42
  };
62
- var renderTitle = (prefixCls, props, direction = "ltr", hashId) => {
63
- const { title, avatar, subTitle, tags, extra, onBack } = props;
64
- const headingPrefixCls = `${prefixCls}-heading`;
65
- const hasHeading = title || subTitle || tags || extra;
43
+ var renderTitle = function renderTitle(prefixCls, props) {
44
+ var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'ltr';
45
+ var hashId = arguments.length > 3 ? arguments[3] : undefined;
46
+ var title = props.title,
47
+ avatar = props.avatar,
48
+ subTitle = props.subTitle,
49
+ tags = props.tags,
50
+ extra = props.extra,
51
+ onBack = props.onBack;
52
+ var headingPrefixCls = "".concat(prefixCls, "-heading");
53
+ var hasHeading = title || subTitle || tags || extra;
54
+ // If there is nothing, return a null
66
55
  if (!hasHeading) {
67
56
  return null;
68
57
  }
69
- const backIcon = getBackIcon(props, direction);
70
- const backIconDom = renderBack(prefixCls, hashId, backIcon, onBack);
71
- const hasTitle = backIconDom || avatar || hasHeading;
72
- return /* @__PURE__ */ React.createElement("div", { className: headingPrefixCls + " " + hashId }, hasTitle && /* @__PURE__ */ React.createElement("div", { className: `${headingPrefixCls}-left ${hashId}`.trim() }, backIconDom, avatar && /* @__PURE__ */ React.createElement(
73
- Avatar,
74
- __spreadValues({
75
- className: classNames(
76
- `${headingPrefixCls}-avatar`,
77
- hashId,
78
- avatar.className
79
- )
80
- }, avatar)
81
- ), title && /* @__PURE__ */ React.createElement(
82
- "span",
83
- {
84
- className: `${headingPrefixCls}-title ${hashId}`.trim(),
85
- title: typeof title === "string" ? title : void 0
86
- },
87
- title
88
- ), subTitle && /* @__PURE__ */ React.createElement(
89
- "span",
90
- {
91
- className: `${headingPrefixCls}-sub-title ${hashId}`.trim(),
92
- title: typeof subTitle === "string" ? subTitle : void 0
93
- },
94
- subTitle
95
- ), tags && /* @__PURE__ */ React.createElement("span", { className: `${headingPrefixCls}-tags ${hashId}`.trim() }, tags)), extra && /* @__PURE__ */ React.createElement("span", { className: `${headingPrefixCls}-extra ${hashId}`.trim() }, /* @__PURE__ */ React.createElement(Space, null, extra)));
58
+ var backIcon = getBackIcon(props, direction);
59
+ var backIconDom = renderBack(prefixCls, hashId, backIcon, onBack);
60
+ var hasTitle = backIconDom || avatar || hasHeading;
61
+ return /*#__PURE__*/_jsxs("div", {
62
+ className: headingPrefixCls + ' ' + hashId,
63
+ children: [hasTitle && /*#__PURE__*/_jsxs("div", {
64
+ className: "".concat(headingPrefixCls, "-left ").concat(hashId).trim(),
65
+ children: [backIconDom, avatar && /*#__PURE__*/_jsx(Avatar, _objectSpread({
66
+ className: classNames("".concat(headingPrefixCls, "-avatar"), hashId, avatar.className)
67
+ }, avatar)), title && /*#__PURE__*/_jsx("span", {
68
+ className: "".concat(headingPrefixCls, "-title ").concat(hashId).trim(),
69
+ title: typeof title === 'string' ? title : undefined,
70
+ children: title
71
+ }), subTitle && /*#__PURE__*/_jsx("span", {
72
+ className: "".concat(headingPrefixCls, "-sub-title ").concat(hashId).trim(),
73
+ title: typeof subTitle === 'string' ? subTitle : undefined,
74
+ children: subTitle
75
+ }), tags && /*#__PURE__*/_jsx("span", {
76
+ className: "".concat(headingPrefixCls, "-tags ").concat(hashId).trim(),
77
+ children: tags
78
+ })]
79
+ }), extra && /*#__PURE__*/_jsx("span", {
80
+ className: "".concat(headingPrefixCls, "-extra ").concat(hashId).trim(),
81
+ children: /*#__PURE__*/_jsx(Space, {
82
+ children: extra
83
+ })
84
+ })]
85
+ });
96
86
  };
97
- var renderFooter = (prefixCls, footer, hashId) => {
87
+ var renderFooter = function renderFooter(prefixCls, footer, hashId) {
98
88
  if (footer) {
99
- return /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-footer ${hashId}`.trim() }, footer);
89
+ return /*#__PURE__*/_jsx("div", {
90
+ className: "".concat(prefixCls, "-footer ").concat(hashId).trim(),
91
+ children: footer
92
+ });
100
93
  }
101
94
  return null;
102
95
  };
103
- var renderChildren = (prefixCls, children, hashId) => /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-content ${hashId}`.trim() }, children);
104
- var PageHeader = (props) => {
105
- var _a;
106
- const [compact, updateCompact] = React.useState(false);
107
- const onResize = ({ width }) => updateCompact(width < 768);
108
- const { getPrefixCls, direction } = React.useContext(
109
- ConfigProvider.ConfigContext
110
- );
111
- const {
112
- prefixCls: customizePrefixCls,
113
- style,
114
- footer,
115
- children,
116
- breadcrumb,
117
- breadcrumbRender,
118
- className: customizeClassName,
119
- contentWidth,
120
- layout,
121
- ghost = true
122
- } = props;
123
- const prefixCls = getPrefixCls("page-header", customizePrefixCls);
124
- const { wrapSSR, hashId } = useStyle(prefixCls);
125
- const getDefaultBreadcrumbDom = () => {
126
- if (breadcrumb == null ? void 0 : breadcrumb.items) {
96
+ var renderChildren = function renderChildren(prefixCls, children, hashId) {
97
+ return /*#__PURE__*/_jsx("div", {
98
+ className: "".concat(prefixCls, "-content ").concat(hashId).trim(),
99
+ children: children
100
+ });
101
+ };
102
+ var PageHeader = function PageHeader(props) {
103
+ var _breadcrumbRender;
104
+ var _React$useState = React.useState(false),
105
+ _React$useState2 = _slicedToArray(_React$useState, 2),
106
+ compact = _React$useState2[0],
107
+ updateCompact = _React$useState2[1];
108
+ var onResize = function onResize(_ref) {
109
+ var width = _ref.width;
110
+ return updateCompact(width < 768);
111
+ };
112
+ var _React$useContext = React.useContext(ConfigProvider.ConfigContext),
113
+ getPrefixCls = _React$useContext.getPrefixCls,
114
+ direction = _React$useContext.direction;
115
+ var customizePrefixCls = props.prefixCls,
116
+ style = props.style,
117
+ footer = props.footer,
118
+ children = props.children,
119
+ breadcrumb = props.breadcrumb,
120
+ breadcrumbRender = props.breadcrumbRender,
121
+ customizeClassName = props.className,
122
+ contentWidth = props.contentWidth,
123
+ layout = props.layout,
124
+ _props$ghost = props.ghost,
125
+ ghost = _props$ghost === void 0 ? true : _props$ghost;
126
+ var prefixCls = getPrefixCls('page-header', customizePrefixCls);
127
+ var _useStyle = useStyle(prefixCls),
128
+ wrapSSR = _useStyle.wrapSSR,
129
+ hashId = _useStyle.hashId;
130
+ var getDefaultBreadcrumbDom = function getDefaultBreadcrumbDom() {
131
+ if (breadcrumb !== null && breadcrumb !== void 0 && breadcrumb.items) {
127
132
  return renderBreadcrumb(breadcrumb, prefixCls);
128
133
  }
129
134
  return null;
130
135
  };
131
- const defaultBreadcrumbDom = getDefaultBreadcrumbDom();
132
- const isBreadcrumbComponent = breadcrumb && "props" in breadcrumb;
133
- const breadcrumbRenderDomFromProps = (_a = breadcrumbRender == null ? void 0 : breadcrumbRender(__spreadProps(__spreadValues({}, props), { prefixCls }), defaultBreadcrumbDom)) != null ? _a : defaultBreadcrumbDom;
134
- const breadcrumbDom = isBreadcrumbComponent ? breadcrumb : Array.isArray(breadcrumbRenderDomFromProps) ? renderBreadcrumb({ items: breadcrumbRenderDomFromProps }, prefixCls) : breadcrumbRenderDomFromProps;
135
- const className = classNames(prefixCls, hashId, customizeClassName, {
136
- [`${prefixCls}-has-breadcrumb`]: !!breadcrumbDom,
137
- [`${prefixCls}-has-footer`]: !!footer,
138
- [`${prefixCls}-rtl`]: direction === "rtl",
139
- [`${prefixCls}-compact`]: compact,
140
- [`${prefixCls}-wide`]: contentWidth === "Fixed" && layout == "top",
141
- [`${prefixCls}-ghost`]: ghost
142
- });
143
- const title = renderTitle(prefixCls, props, direction, hashId);
144
- const childDom = children && renderChildren(prefixCls, children, hashId);
145
- const footerDom = renderFooter(prefixCls, footer, hashId);
136
+ var defaultBreadcrumbDom = getDefaultBreadcrumbDom();
137
+ var isBreadcrumbComponent = breadcrumb && 'props' in breadcrumb;
138
+
139
+ // support breadcrumbRender function
140
+ var breadcrumbRenderDomFromProps = (_breadcrumbRender = breadcrumbRender === null || breadcrumbRender === void 0 ? void 0 : breadcrumbRender(_objectSpread(_objectSpread({}, props), {}, {
141
+ prefixCls: prefixCls
142
+ }), defaultBreadcrumbDom)) !== null && _breadcrumbRender !== void 0 ? _breadcrumbRender : defaultBreadcrumbDom;
143
+
144
+ // 如果 breadcrumbRender 返回的是数组,需要转换为 Breadcrumb 组件
145
+ // 如果返回的是 React.ReactNode,直接使用
146
+ var breadcrumbDom = isBreadcrumbComponent ? breadcrumb : Array.isArray(breadcrumbRenderDomFromProps) ? renderBreadcrumb({
147
+ items: breadcrumbRenderDomFromProps
148
+ }, prefixCls) : breadcrumbRenderDomFromProps;
149
+ var className = classNames(prefixCls, hashId, customizeClassName, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-breadcrumb"), !!breadcrumbDom), "".concat(prefixCls, "-has-footer"), !!footer), "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-compact"), compact), "".concat(prefixCls, "-wide"), contentWidth === 'Fixed' && layout == 'top'), "".concat(prefixCls, "-ghost"), ghost));
150
+ var title = renderTitle(prefixCls, props, direction, hashId);
151
+ var childDom = children && renderChildren(prefixCls, children, hashId);
152
+ var footerDom = renderFooter(prefixCls, footer, hashId);
146
153
  if (!breadcrumbDom && !title && !footerDom && !childDom) {
147
- return /* @__PURE__ */ React.createElement("div", { className: classNames(hashId, [`${prefixCls}-no-children`]) });
154
+ return /*#__PURE__*/_jsx("div", {
155
+ className: classNames(hashId, ["".concat(prefixCls, "-no-children")])
156
+ });
148
157
  }
149
- return wrapSSR(
150
- /* @__PURE__ */ React.createElement(ResizeObserver, { onResize }, (ref) => /* @__PURE__ */ React.createElement("div", { ref, className, style }, breadcrumbDom, title, childDom, footerDom))
151
- );
152
- };
153
- export {
154
- PageHeader
158
+ return wrapSSR( /*#__PURE__*/_jsx(ResizeObserver, {
159
+ onResize: onResize,
160
+ children: function children(ref) {
161
+ return /*#__PURE__*/_jsxs("div", {
162
+ ref: ref,
163
+ className: className,
164
+ style: style,
165
+ children: [breadcrumbDom, title, childDom, footerDom]
166
+ });
167
+ }
168
+ }));
155
169
  };
170
+ export { PageHeader };