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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (691) 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 +2 -2
  30. package/es/field/components/Cascader/index.js +65 -84
  31. package/es/field/components/Checkbox/index.d.ts +1 -1
  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.d.ts +1 -1
  48. package/es/field/components/Percent/util.js +3 -5
  49. package/es/field/components/Progress/index.js +29 -27
  50. package/es/field/components/Radio/index.d.ts +1 -1
  51. package/es/field/components/Radio/index.js +61 -62
  52. package/es/field/components/RangePicker/index.d.ts +2 -2
  53. package/es/field/components/RangePicker/index.js +52 -63
  54. package/es/field/components/Rate/index.js +24 -21
  55. package/es/field/components/Second/index.js +36 -33
  56. package/es/field/components/Segmented/index.d.ts +1 -1
  57. package/es/field/components/Segmented/index.js +37 -46
  58. package/es/field/components/Select/LightSelect/index.d.ts +1 -1
  59. package/es/field/components/Select/LightSelect/index.js +102 -109
  60. package/es/field/components/Select/SearchSelect/index.js +129 -155
  61. package/es/field/components/Select/index.d.ts +1 -1
  62. package/es/field/components/Select/index.js +193 -219
  63. package/es/field/components/Slider/index.js +25 -22
  64. package/es/field/components/Status/index.js +67 -78
  65. package/es/field/components/Switch/index.d.ts +1 -1
  66. package/es/field/components/Switch/index.js +32 -30
  67. package/es/field/components/Text/index.js +34 -37
  68. package/es/field/components/TextArea/index.js +26 -21
  69. package/es/field/components/TextArea/readonly.js +24 -21
  70. package/es/field/components/TimePicker/index.js +96 -105
  71. package/es/field/components/TreeSelect/index.d.ts +2 -2
  72. package/es/field/components/TreeSelect/index.js +107 -125
  73. package/es/form/BaseForm/BaseForm.js +416 -502
  74. package/es/form/BaseForm/EditOrReadOnlyContext.js +1 -1
  75. package/es/form/BaseForm/LightWrapper/index.js +56 -65
  76. package/es/form/BaseForm/LightWrapper/style.js +17 -13
  77. package/es/form/BaseForm/Submitter/index.js +44 -43
  78. package/es/form/FieldContext.js +1 -1
  79. package/es/form/components/Captcha/index.js +74 -134
  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.js +24 -26
  83. package/es/form/components/DatePicker/BaseDatePicker.js +32 -30
  84. package/es/form/components/DatePicker/DatePicker.js +14 -13
  85. package/es/form/components/DatePicker/DateTimePicker.js +11 -12
  86. package/es/form/components/DatePicker/MonthPicker.js +14 -13
  87. package/es/form/components/DatePicker/QuarterPicker.js +14 -13
  88. package/es/form/components/DatePicker/TimePicker.js +26 -27
  89. package/es/form/components/DatePicker/WeekPicker.js +14 -13
  90. package/es/form/components/DatePicker/YearPicker.js +14 -13
  91. package/es/form/components/DatePicker/index.js +1 -1
  92. package/es/form/components/DateRangePicker/BaseDateRanger.js +34 -34
  93. package/es/form/components/DateRangePicker/DateMonthRangePicker.js +15 -16
  94. package/es/form/components/DateRangePicker/DateQuarterRangePicker.js +15 -16
  95. package/es/form/components/DateRangePicker/DateTimeRangePicker.js +15 -16
  96. package/es/form/components/DateRangePicker/DateWeekRangePicker.js +15 -16
  97. package/es/form/components/DateRangePicker/DateYearRangePicker.js +15 -16
  98. package/es/form/components/DateRangePicker/TimeRangePicker.js +26 -29
  99. package/es/form/components/DateRangePicker/index.js +15 -16
  100. package/es/form/components/Dependency/index.js +31 -34
  101. package/es/form/components/Digit/DigitRange.js +23 -24
  102. package/es/form/components/Digit/index.js +27 -29
  103. package/es/form/components/Field/index.js +55 -63
  104. package/es/form/components/FieldSet/index.js +68 -76
  105. package/es/form/components/FormItem/FormItemRender/index.js +58 -48
  106. package/es/form/components/FormItem/Group/index.js +95 -95
  107. package/es/form/components/FormItem/Group/style.js +46 -40
  108. package/es/form/components/FormItem/index.js +135 -141
  109. package/es/form/components/FormItem/warpField.js +165 -149
  110. package/es/form/components/List/ListContainer.js +98 -189
  111. package/es/form/components/List/ListItem.js +151 -198
  112. package/es/form/components/List/index.js +97 -107
  113. package/es/form/components/List/style.js +71 -47
  114. package/es/form/components/Money/index.js +28 -30
  115. package/es/form/components/Radio/index.js +45 -49
  116. package/es/form/components/Rate/index.js +17 -20
  117. package/es/form/components/SchemaForm/index.js +58 -72
  118. package/es/form/components/SchemaForm/layoutType/Embed.js +5 -6
  119. package/es/form/components/SchemaForm/layoutType/StepsForm.js +22 -26
  120. package/es/form/components/SchemaForm/valueType/dependency.js +11 -11
  121. package/es/form/components/SchemaForm/valueType/divider.js +4 -5
  122. package/es/form/components/SchemaForm/valueType/field.js +45 -44
  123. package/es/form/components/SchemaForm/valueType/formList.js +8 -7
  124. package/es/form/components/SchemaForm/valueType/formSet.js +8 -7
  125. package/es/form/components/SchemaForm/valueType/group.js +7 -8
  126. package/es/form/components/SchemaForm/valueType/ignore.js +2 -2
  127. package/es/form/components/SchemaForm/valueType/index.js +5 -5
  128. package/es/form/components/Segmented/index.js +20 -23
  129. package/es/form/components/Select/index.js +69 -73
  130. package/es/form/components/Slider/index.js +33 -35
  131. package/es/form/components/Switch/index.js +24 -26
  132. package/es/form/components/Text/index.js +75 -86
  133. package/es/form/components/TextArea/index.js +17 -20
  134. package/es/form/components/TreeSelect/index.js +20 -23
  135. package/es/form/components/UploadButton/index.js +56 -103
  136. package/es/form/components/UploadDragger/index.js +37 -44
  137. package/es/form/helpers/grid.js +65 -67
  138. package/es/form/layouts/DrawerForm/index.js +150 -241
  139. package/es/form/layouts/DrawerForm/style.js +26 -25
  140. package/es/form/layouts/LightFilter/index.d.ts +12 -1
  141. package/es/form/layouts/LightFilter/index.js +158 -140
  142. package/es/form/layouts/LightFilter/style.js +52 -48
  143. package/es/form/layouts/LoginForm/index.js +44 -47
  144. package/es/form/layouts/LoginForm/style.js +71 -67
  145. package/es/form/layouts/LoginFormPage/index.js +45 -48
  146. package/es/form/layouts/LoginFormPage/style.js +136 -126
  147. package/es/form/layouts/ModalForm/index.js +119 -203
  148. package/es/form/layouts/ProForm/index.d.ts +2 -2
  149. package/es/form/layouts/ProForm/index.js +5 -5
  150. package/es/form/layouts/QueryFilter/Actions.js +23 -22
  151. package/es/form/layouts/QueryFilter/index.js +178 -203
  152. package/es/form/layouts/QueryFilter/style.js +45 -37
  153. package/es/form/layouts/StepsForm/StepForm.d.ts +2 -3
  154. package/es/form/layouts/StepsForm/StepForm.js +50 -71
  155. package/es/form/layouts/StepsForm/index.js +175 -217
  156. package/es/form/layouts/StepsForm/style.js +30 -28
  157. package/es/form/layouts/index.js +1 -1
  158. package/es/layout/ProLayout.js +281 -292
  159. package/es/layout/WrapContent.js +16 -12
  160. package/es/layout/assert/Logo.js +95 -97
  161. package/es/layout/components/AppsLogoComponents/AppsLogo.js +10 -12
  162. package/es/layout/components/AppsLogoComponents/DefaultContent.js +17 -16
  163. package/es/layout/components/AppsLogoComponents/SimpleContent.js +19 -18
  164. package/es/layout/components/AppsLogoComponents/index.js +33 -38
  165. package/es/layout/components/AppsLogoComponents/style/default.js +2 -2
  166. package/es/layout/components/AppsLogoComponents/style/index.js +52 -50
  167. package/es/layout/components/AppsLogoComponents/style/simple.js +1 -1
  168. package/es/layout/components/CollapsedIcon/index.js +18 -15
  169. package/es/layout/components/CollapsedIcon/style.js +40 -40
  170. package/es/layout/components/Footer.js +22 -21
  171. package/es/layout/components/FooterToolbar/index.js +58 -52
  172. package/es/layout/components/FooterToolbar/style/index.js +38 -37
  173. package/es/layout/components/FooterToolbar/style/stylish.js +11 -9
  174. package/es/layout/components/GlobalFooter/index.js +25 -25
  175. package/es/layout/components/GlobalFooter/style.js +31 -30
  176. package/es/layout/components/GlobalHeader/ActionsContent.js +62 -78
  177. package/es/layout/components/GlobalHeader/index.js +59 -47
  178. package/es/layout/components/GlobalHeader/rightContentStyle.js +49 -49
  179. package/es/layout/components/GlobalHeader/style.js +58 -54
  180. package/es/layout/components/GridContent/index.js +24 -19
  181. package/es/layout/components/GridContent/style.js +14 -13
  182. package/es/layout/components/Header/index.js +63 -57
  183. package/es/layout/components/Header/style/header.js +49 -47
  184. package/es/layout/components/Header/style/stylish.js +15 -11
  185. package/es/layout/components/Help/AsyncContentPanel.js +13 -18
  186. package/es/layout/components/Help/HelpProvide.js +1 -1
  187. package/es/layout/components/Help/ProHelpContentPanel.js +64 -83
  188. package/es/layout/components/Help/ProHelpDrawer.js +25 -31
  189. package/es/layout/components/Help/ProHelpModal.d.ts +1 -1
  190. package/es/layout/components/Help/ProHelpModal.js +24 -27
  191. package/es/layout/components/Help/ProHelpPanel.js +86 -94
  192. package/es/layout/components/Help/ProHelpPopover.js +18 -16
  193. package/es/layout/components/Help/RenderContentPanel.js +34 -24
  194. package/es/layout/components/Help/Search.js +52 -78
  195. package/es/layout/components/Help/index.js +9 -11
  196. package/es/layout/components/Help/style.js +82 -75
  197. package/es/layout/components/PageContainer/index.js +168 -149
  198. package/es/layout/components/PageContainer/style/index.js +95 -78
  199. package/es/layout/components/PageContainer/style/stylish.js +11 -9
  200. package/es/layout/components/PageHeader/index.js +96 -97
  201. package/es/layout/components/PageHeader/style/index.js +142 -122
  202. package/es/layout/components/PageLoading/index.js +17 -20
  203. package/es/layout/components/SettingDrawer/BlockCheckbox.js +29 -32
  204. package/es/layout/components/SettingDrawer/LayoutChange.js +22 -22
  205. package/es/layout/components/SettingDrawer/RegionalChange.js +14 -15
  206. package/es/layout/components/SettingDrawer/ThemeColor.js +32 -35
  207. package/es/layout/components/SettingDrawer/index.js +137 -168
  208. package/es/layout/components/SettingDrawer/style/index.js +141 -137
  209. package/es/layout/components/SiderMenu/BaseMenu.js +235 -221
  210. package/es/layout/components/SiderMenu/SiderMenu.js +125 -115
  211. package/es/layout/components/SiderMenu/index.js +47 -42
  212. package/es/layout/components/SiderMenu/style/index.js +179 -161
  213. package/es/layout/components/SiderMenu/style/menu.js +148 -110
  214. package/es/layout/components/SiderMenu/style/stylish.js +15 -11
  215. package/es/layout/components/TopNavHeader/index.js +71 -60
  216. package/es/layout/components/TopNavHeader/style.js +64 -63
  217. package/es/layout/context/RouteContext.js +1 -1
  218. package/es/layout/defaultSettings.js +1 -1
  219. package/es/layout/getPageTitle.js +23 -24
  220. package/es/layout/locales/en-US.js +3 -2
  221. package/es/layout/locales/index.js +5 -5
  222. package/es/layout/locales/it-IT.js +3 -2
  223. package/es/layout/locales/ko-KR.js +3 -2
  224. package/es/layout/locales/zh-CN.js +3 -2
  225. package/es/layout/locales/zh-TW.js +3 -2
  226. package/es/layout/style/index.js +48 -42
  227. package/es/layout/utils/getBreadcrumbProps.js +60 -60
  228. package/es/layout/utils/getMenuData.js +7 -11
  229. package/es/layout/utils/pathTools.js +2 -6
  230. package/es/layout/utils/useCurrentMenuLayoutProps.js +4 -9
  231. package/es/layout/utils/utils.js +15 -17
  232. package/es/list/Item.js +157 -137
  233. package/es/list/ListView.js +106 -115
  234. package/es/list/constants.js +2 -2
  235. package/es/list/index.js +72 -70
  236. package/es/list/style/index.js +281 -213
  237. package/es/provider/index.js +122 -115
  238. package/es/provider/intl.js +53 -55
  239. package/es/provider/typing/layoutToken.js +26 -23
  240. package/es/provider/useStyle/index.js +51 -59
  241. package/es/provider/utils/merge.js +10 -12
  242. package/es/skeleton/components/Descriptions/index.js +211 -229
  243. package/es/skeleton/components/List/index.js +208 -223
  244. package/es/skeleton/components/Result/index.js +45 -47
  245. package/es/skeleton/index.js +13 -10
  246. package/es/table/Store/Provide.d.ts +4 -4
  247. package/es/table/Store/Provide.js +102 -117
  248. package/es/table/Table.d.ts +5 -2
  249. package/es/table/Table.js +526 -691
  250. package/es/table/TableSearch.d.ts +24 -0
  251. package/es/table/TableSearch.js +54 -0
  252. package/es/table/TableToolbar.d.ts +22 -0
  253. package/es/table/TableToolbar.js +47 -0
  254. package/es/table/components/Alert/index.js +41 -40
  255. package/es/table/components/Alert/style.js +28 -27
  256. package/es/table/components/ColumnSetting/index.js +228 -223
  257. package/es/table/components/ColumnSetting/style.js +86 -71
  258. package/es/table/components/DragSortTable/index.js +65 -79
  259. package/es/table/components/DragSortTable/style.js +20 -19
  260. package/es/table/components/Dropdown/index.js +42 -47
  261. package/es/table/components/EditableTable/CellEditorTable.js +24 -32
  262. package/es/table/components/EditableTable/RowEditorTable.js +23 -28
  263. package/es/table/components/EditableTable/index.js +295 -329
  264. package/es/table/components/Form/FormRender.js +99 -103
  265. package/es/table/components/Form/index.d.ts +4 -19
  266. package/es/table/components/Form/index.js +112 -159
  267. package/es/table/components/ListToolBar/HeaderMenu.js +44 -52
  268. package/es/table/components/ListToolBar/index.js +122 -147
  269. package/es/table/components/ListToolBar/style.js +127 -117
  270. package/es/table/components/ToolBar/DensityIcon.js +10 -9
  271. package/es/table/components/ToolBar/FullscreenIcon.js +5 -9
  272. package/es/table/components/ToolBar/index.d.ts +2 -8
  273. package/es/table/components/ToolBar/index.js +155 -195
  274. package/es/table/style/index.js +144 -112
  275. package/es/table/typing.d.ts +4 -0
  276. package/es/table/useFetchData.js +199 -338
  277. package/es/table/utils/cellRenderToFromItem.js +105 -119
  278. package/es/table/utils/columnRender.js +63 -54
  279. package/es/table/utils/columnSort.js +22 -22
  280. package/es/table/utils/genProColumnToColumn.d.ts +13 -9
  281. package/es/table/utils/genProColumnToColumn.js +121 -98
  282. package/es/table/utils/index.d.ts +10 -0
  283. package/es/table/utils/index.js +112 -178
  284. package/es/table/utils/useDragSort.d.ts +1 -1
  285. package/es/table/utils/useDragSort.js +99 -92
  286. package/es/table/utils/usePageInfo.d.ts +6 -0
  287. package/es/table/utils/usePageInfo.js +55 -0
  288. package/es/utils/components/DropdownFooter/index.js +23 -21
  289. package/es/utils/components/DropdownFooter/style.js +16 -15
  290. package/es/utils/components/ErrorBoundary/index.js +27 -50
  291. package/es/utils/components/FieldLabel/index.js +70 -70
  292. package/es/utils/components/FieldLabel/style.js +104 -81
  293. package/es/utils/components/FilterDropdown/index.d.ts +11 -0
  294. package/es/utils/components/FilterDropdown/index.js +43 -32
  295. package/es/utils/components/FilterDropdown/style.js +19 -16
  296. package/es/utils/components/InlineErrorFormItem/index.js +78 -78
  297. package/es/utils/components/InlineErrorFormItem/style.js +56 -49
  298. package/es/utils/components/LabelIconTip/index.js +30 -31
  299. package/es/utils/components/LabelIconTip/style.js +36 -35
  300. package/es/utils/components/ProFormContext/index.js +1 -1
  301. package/es/utils/conversionMomentValue/index.js +19 -22
  302. package/es/utils/dateArrayFormatter/index.js +9 -14
  303. package/es/utils/genCopyable/index.js +74 -32
  304. package/es/utils/getFieldPropsOrFormItemProps/index.js +1 -1
  305. package/es/utils/hooks/useDebounceFn/index.js +18 -51
  306. package/es/utils/hooks/useDebounceValue/index.js +7 -16
  307. package/es/utils/hooks/useDeepCompareEffect/index.js +6 -18
  308. package/es/utils/hooks/useDocumentTitle/index.js +2 -2
  309. package/es/utils/hooks/useFetchData/index.js +36 -65
  310. package/es/utils/hooks/useForceRender/index.js +2 -9
  311. package/es/utils/hooks/useLatest/index.js +2 -2
  312. package/es/utils/hooks/usePrevious/index.js +3 -3
  313. package/es/utils/hooks/useReactiveRef/index.js +2 -2
  314. package/es/utils/hooks/useRefCallback/index.js +3 -3
  315. package/es/utils/hooks/useRefFunction/index.js +4 -9
  316. package/es/utils/index.d.ts +1 -2
  317. package/es/utils/index.js +1 -2
  318. package/es/utils/isBrowser/index.js +2 -2
  319. package/es/utils/isDeepEqualReact/index.js +9 -44
  320. package/es/utils/isDropdownValueType/index.js +2 -2
  321. package/es/utils/isNil/index.js +1 -3
  322. package/es/utils/isUrl/index.js +2 -2
  323. package/es/utils/merge/index.js +10 -12
  324. package/es/utils/nanoid/index.js +5 -6
  325. package/es/utils/omitBoolean/index.js +1 -1
  326. package/es/utils/omitUndefined/index.js +3 -3
  327. package/es/utils/omitUndefinedAndEmptyArr/index.js +4 -5
  328. package/es/utils/parseValueToMoment/index.js +3 -7
  329. package/es/utils/pickProFormItemProps/index.js +3 -3
  330. package/es/utils/pickProProps/index.js +6 -7
  331. package/es/utils/proFieldParsingText/index.js +85 -98
  332. package/es/utils/runFunction/index.js +2 -5
  333. package/es/utils/stringify/index.js +1 -1
  334. package/es/utils/transformKeySubmitValue/index.js +99 -116
  335. package/es/utils/useEditableArray/index.d.ts +6 -1
  336. package/es/utils/useEditableArray/index.js +579 -735
  337. package/es/utils/useEditableMap/index.d.ts +1 -1
  338. package/es/utils/useEditableMap/index.js +89 -135
  339. package/es/utils/useMediaQuery/index.js +16 -18
  340. package/es/utils/useMediaQuery/query.js +7 -17
  341. package/es/version.js +1 -1
  342. package/lib/card/ProCard.js +8 -10
  343. package/lib/card/components/Actions/index.js +25 -25
  344. package/lib/card/components/Actions/style.js +79 -72
  345. package/lib/card/components/Card/index.js +154 -139
  346. package/lib/card/components/Card/style.js +249 -193
  347. package/lib/card/components/CheckCard/Group.js +97 -115
  348. package/lib/card/components/CheckCard/index.js +85 -78
  349. package/lib/card/components/CheckCard/style.js +184 -169
  350. package/lib/card/components/Divider/index.js +20 -16
  351. package/lib/card/components/Divider/style.js +32 -30
  352. package/lib/card/components/Loading/index.js +19 -16
  353. package/lib/card/components/Loading/style.js +34 -32
  354. package/lib/card/components/Operation/index.js +16 -14
  355. package/lib/card/components/Operation/style.js +19 -19
  356. package/lib/card/components/Statistic/index.js +46 -42
  357. package/lib/card/components/Statistic/style.js +89 -71
  358. package/lib/card/components/StatisticCard/index.js +46 -41
  359. package/lib/card/components/StatisticCard/style.js +37 -36
  360. package/lib/card/index.js +4 -4
  361. package/lib/descriptions/index.js +219 -225
  362. package/lib/descriptions/useFetchData.js +51 -90
  363. package/lib/field/AllProField.js +267 -217
  364. package/lib/field/FieldHOC/index.js +9 -15
  365. package/lib/field/PureProField.js +84 -82
  366. package/lib/field/ValueTypeToComponent.js +517 -618
  367. package/lib/field/components/Cascader/index.d.ts +2 -2
  368. package/lib/field/components/Cascader/index.js +65 -85
  369. package/lib/field/components/Checkbox/index.d.ts +1 -1
  370. package/lib/field/components/Checkbox/index.js +75 -73
  371. package/lib/field/components/Code/index.js +40 -39
  372. package/lib/field/components/ColorPicker/index.js +38 -33
  373. package/lib/field/components/DatePicker/index.d.ts +1 -1
  374. package/lib/field/components/DatePicker/index.js +49 -53
  375. package/lib/field/components/Digit/index.js +41 -43
  376. package/lib/field/components/DigitRange/index.js +69 -76
  377. package/lib/field/components/FromNow/index.js +27 -25
  378. package/lib/field/components/Image/index.js +28 -24
  379. package/lib/field/components/IndexColumn/index.js +22 -17
  380. package/lib/field/components/Money/index.js +106 -116
  381. package/lib/field/components/Options/index.js +34 -34
  382. package/lib/field/components/Password/index.js +35 -38
  383. package/lib/field/components/Percent/index.js +40 -45
  384. package/lib/field/components/Percent/util.js +3 -6
  385. package/lib/field/components/Progress/index.js +29 -28
  386. package/lib/field/components/Radio/index.d.ts +1 -1
  387. package/lib/field/components/Radio/index.js +61 -63
  388. package/lib/field/components/RangePicker/index.d.ts +1 -1
  389. package/lib/field/components/RangePicker/index.js +52 -63
  390. package/lib/field/components/Rate/index.js +24 -21
  391. package/lib/field/components/Second/index.js +36 -33
  392. package/lib/field/components/Segmented/index.d.ts +1 -1
  393. package/lib/field/components/Segmented/index.js +37 -48
  394. package/lib/field/components/Select/LightSelect/index.d.ts +1 -1
  395. package/lib/field/components/Select/LightSelect/index.js +103 -110
  396. package/lib/field/components/Select/SearchSelect/index.js +133 -156
  397. package/lib/field/components/Select/index.d.ts +1 -1
  398. package/lib/field/components/Select/index.js +194 -218
  399. package/lib/field/components/Slider/index.js +25 -22
  400. package/lib/field/components/Status/index.js +69 -79
  401. package/lib/field/components/Switch/index.d.ts +1 -1
  402. package/lib/field/components/Switch/index.js +32 -31
  403. package/lib/field/components/Text/index.js +34 -38
  404. package/lib/field/components/TextArea/index.js +26 -21
  405. package/lib/field/components/TextArea/readonly.js +24 -22
  406. package/lib/field/components/TimePicker/index.js +96 -105
  407. package/lib/field/components/TreeSelect/index.d.ts +2 -2
  408. package/lib/field/components/TreeSelect/index.js +105 -124
  409. package/lib/field/index.js +34 -34
  410. package/lib/form/BaseForm/BaseForm.js +413 -499
  411. package/lib/form/BaseForm/EditOrReadOnlyContext.js +1 -1
  412. package/lib/form/BaseForm/LightWrapper/index.js +57 -66
  413. package/lib/form/BaseForm/LightWrapper/style.js +17 -14
  414. package/lib/form/BaseForm/Submitter/index.js +44 -44
  415. package/lib/form/BaseForm/index.js +3 -3
  416. package/lib/form/FieldContext.js +1 -1
  417. package/lib/form/components/Captcha/index.js +74 -135
  418. package/lib/form/components/Cascader/index.js +26 -29
  419. package/lib/form/components/Checkbox/index.js +60 -61
  420. package/lib/form/components/ColorPicker/index.js +24 -26
  421. package/lib/form/components/DatePicker/BaseDatePicker.js +32 -30
  422. package/lib/form/components/DatePicker/DatePicker.js +14 -13
  423. package/lib/form/components/DatePicker/DateTimePicker.js +11 -12
  424. package/lib/form/components/DatePicker/MonthPicker.js +14 -13
  425. package/lib/form/components/DatePicker/QuarterPicker.js +14 -13
  426. package/lib/form/components/DatePicker/TimePicker.js +26 -27
  427. package/lib/form/components/DatePicker/WeekPicker.js +14 -13
  428. package/lib/form/components/DatePicker/YearPicker.js +14 -13
  429. package/lib/form/components/DatePicker/index.js +1 -1
  430. package/lib/form/components/DateRangePicker/BaseDateRanger.js +34 -34
  431. package/lib/form/components/DateRangePicker/DateMonthRangePicker.js +15 -16
  432. package/lib/form/components/DateRangePicker/DateQuarterRangePicker.js +15 -16
  433. package/lib/form/components/DateRangePicker/DateTimeRangePicker.js +15 -16
  434. package/lib/form/components/DateRangePicker/DateWeekRangePicker.js +15 -16
  435. package/lib/form/components/DateRangePicker/DateYearRangePicker.js +15 -16
  436. package/lib/form/components/DateRangePicker/TimeRangePicker.js +26 -29
  437. package/lib/form/components/DateRangePicker/index.js +15 -16
  438. package/lib/form/components/Dependency/index.js +31 -35
  439. package/lib/form/components/Digit/DigitRange.js +23 -24
  440. package/lib/form/components/Digit/index.js +27 -29
  441. package/lib/form/components/Field/index.js +55 -63
  442. package/lib/form/components/FieldSet/index.js +68 -76
  443. package/lib/form/components/FormItem/FormItemRender/index.js +58 -48
  444. package/lib/form/components/FormItem/Group/index.js +95 -95
  445. package/lib/form/components/FormItem/Group/style.js +46 -41
  446. package/lib/form/components/FormItem/index.js +135 -141
  447. package/lib/form/components/FormItem/warpField.js +165 -149
  448. package/lib/form/components/List/ListContainer.js +100 -191
  449. package/lib/form/components/List/ListItem.js +153 -200
  450. package/lib/form/components/List/index.js +97 -107
  451. package/lib/form/components/List/style.js +71 -48
  452. package/lib/form/components/Money/index.js +28 -30
  453. package/lib/form/components/Radio/index.js +45 -49
  454. package/lib/form/components/Rate/index.js +17 -21
  455. package/lib/form/components/SchemaForm/index.js +54 -68
  456. package/lib/form/components/SchemaForm/layoutType/Embed.js +5 -6
  457. package/lib/form/components/SchemaForm/layoutType/StepsForm.js +22 -26
  458. package/lib/form/components/SchemaForm/layoutType/index.js +2 -2
  459. package/lib/form/components/SchemaForm/valueType/dependency.js +13 -12
  460. package/lib/form/components/SchemaForm/valueType/divider.js +6 -7
  461. package/lib/form/components/SchemaForm/valueType/field.js +47 -45
  462. package/lib/form/components/SchemaForm/valueType/formList.js +10 -9
  463. package/lib/form/components/SchemaForm/valueType/formSet.js +10 -8
  464. package/lib/form/components/SchemaForm/valueType/group.js +9 -10
  465. package/lib/form/components/SchemaForm/valueType/ignore.js +4 -3
  466. package/lib/form/components/SchemaForm/valueType/index.js +7 -6
  467. package/lib/form/components/Segmented/index.js +20 -24
  468. package/lib/form/components/Select/index.js +69 -73
  469. package/lib/form/components/Slider/index.js +33 -35
  470. package/lib/form/components/Switch/index.js +24 -26
  471. package/lib/form/components/Text/index.js +73 -84
  472. package/lib/form/components/TextArea/index.js +17 -21
  473. package/lib/form/components/TreeSelect/index.js +20 -23
  474. package/lib/form/components/UploadButton/index.js +56 -103
  475. package/lib/form/components/UploadDragger/index.js +37 -44
  476. package/lib/form/components/index.js +42 -42
  477. package/lib/form/helpers/grid.js +68 -69
  478. package/lib/form/helpers/index.js +1 -1
  479. package/lib/form/index.js +8 -8
  480. package/lib/form/layouts/DrawerForm/index.js +149 -241
  481. package/lib/form/layouts/DrawerForm/style.js +26 -26
  482. package/lib/form/layouts/LightFilter/index.d.ts +12 -1
  483. package/lib/form/layouts/LightFilter/index.js +158 -141
  484. package/lib/form/layouts/LightFilter/style.js +52 -49
  485. package/lib/form/layouts/LoginForm/index.js +44 -48
  486. package/lib/form/layouts/LoginForm/style.js +71 -68
  487. package/lib/form/layouts/LoginFormPage/index.js +45 -49
  488. package/lib/form/layouts/LoginFormPage/style.js +136 -127
  489. package/lib/form/layouts/ModalForm/index.js +118 -203
  490. package/lib/form/layouts/ProForm/index.d.ts +1 -1
  491. package/lib/form/layouts/ProForm/index.js +5 -5
  492. package/lib/form/layouts/QueryFilter/Actions.js +23 -22
  493. package/lib/form/layouts/QueryFilter/index.js +177 -202
  494. package/lib/form/layouts/QueryFilter/style.js +45 -38
  495. package/lib/form/layouts/StepsForm/StepForm.d.ts +2 -3
  496. package/lib/form/layouts/StepsForm/StepForm.js +50 -72
  497. package/lib/form/layouts/StepsForm/index.js +174 -216
  498. package/lib/form/layouts/StepsForm/style.js +30 -29
  499. package/lib/form/layouts/index.js +9 -9
  500. package/lib/index.js +11 -11
  501. package/lib/layout/ProLayout.js +281 -292
  502. package/lib/layout/WrapContent.js +18 -14
  503. package/lib/layout/assert/Logo.js +96 -97
  504. package/lib/layout/components/AppsLogoComponents/AppsLogo.js +11 -12
  505. package/lib/layout/components/AppsLogoComponents/DefaultContent.js +19 -17
  506. package/lib/layout/components/AppsLogoComponents/SimpleContent.js +22 -19
  507. package/lib/layout/components/AppsLogoComponents/index.js +36 -40
  508. package/lib/layout/components/AppsLogoComponents/style/default.js +4 -3
  509. package/lib/layout/components/AppsLogoComponents/style/index.js +52 -51
  510. package/lib/layout/components/AppsLogoComponents/style/simple.js +3 -2
  511. package/lib/layout/components/CollapsedIcon/index.js +20 -17
  512. package/lib/layout/components/CollapsedIcon/style.js +40 -41
  513. package/lib/layout/components/Footer.js +23 -22
  514. package/lib/layout/components/FooterToolbar/index.js +59 -53
  515. package/lib/layout/components/FooterToolbar/style/index.js +38 -38
  516. package/lib/layout/components/FooterToolbar/style/stylish.js +11 -10
  517. package/lib/layout/components/GlobalFooter/index.js +27 -27
  518. package/lib/layout/components/GlobalFooter/style.js +31 -31
  519. package/lib/layout/components/GlobalHeader/ActionsContent.js +65 -81
  520. package/lib/layout/components/GlobalHeader/index.js +61 -49
  521. package/lib/layout/components/GlobalHeader/rightContentStyle.js +49 -50
  522. package/lib/layout/components/GlobalHeader/style.js +58 -55
  523. package/lib/layout/components/GridContent/index.js +26 -21
  524. package/lib/layout/components/GridContent/style.js +14 -14
  525. package/lib/layout/components/Header/index.js +65 -59
  526. package/lib/layout/components/Header/style/header.js +49 -48
  527. package/lib/layout/components/Header/style/stylish.js +15 -12
  528. package/lib/layout/components/Help/AsyncContentPanel.js +15 -20
  529. package/lib/layout/components/Help/HelpProvide.js +1 -1
  530. package/lib/layout/components/Help/ProHelpContentPanel.js +66 -85
  531. package/lib/layout/components/Help/ProHelpDrawer.js +27 -32
  532. package/lib/layout/components/Help/ProHelpModal.d.ts +1 -1
  533. package/lib/layout/components/Help/ProHelpModal.js +26 -28
  534. package/lib/layout/components/Help/ProHelpPanel.js +86 -94
  535. package/lib/layout/components/Help/ProHelpPopover.js +20 -18
  536. package/lib/layout/components/Help/RenderContentPanel.js +36 -26
  537. package/lib/layout/components/Help/Search.js +55 -80
  538. package/lib/layout/components/Help/index.js +19 -20
  539. package/lib/layout/components/Help/style.js +82 -76
  540. package/lib/layout/components/PageContainer/index.js +172 -151
  541. package/lib/layout/components/PageContainer/style/index.js +95 -79
  542. package/lib/layout/components/PageContainer/style/stylish.js +11 -10
  543. package/lib/layout/components/PageHeader/index.js +99 -99
  544. package/lib/layout/components/PageHeader/style/index.js +142 -123
  545. package/lib/layout/components/PageLoading/index.js +18 -20
  546. package/lib/layout/components/SettingDrawer/BlockCheckbox.js +31 -34
  547. package/lib/layout/components/SettingDrawer/LayoutChange.js +25 -23
  548. package/lib/layout/components/SettingDrawer/RegionalChange.js +16 -16
  549. package/lib/layout/components/SettingDrawer/ThemeColor.js +34 -36
  550. package/lib/layout/components/SettingDrawer/index.js +138 -168
  551. package/lib/layout/components/SettingDrawer/style/index.js +141 -138
  552. package/lib/layout/components/SiderMenu/BaseMenu.js +235 -221
  553. package/lib/layout/components/SiderMenu/SiderMenu.js +128 -117
  554. package/lib/layout/components/SiderMenu/index.js +49 -44
  555. package/lib/layout/components/SiderMenu/style/index.js +179 -162
  556. package/lib/layout/components/SiderMenu/style/menu.js +148 -111
  557. package/lib/layout/components/SiderMenu/style/stylish.js +15 -12
  558. package/lib/layout/components/TopNavHeader/index.js +73 -62
  559. package/lib/layout/components/TopNavHeader/style.js +64 -64
  560. package/lib/layout/context/RouteContext.js +1 -1
  561. package/lib/layout/defaultSettings.js +1 -1
  562. package/lib/layout/getPageTitle.js +27 -26
  563. package/lib/layout/index.js +16 -16
  564. package/lib/layout/locales/en-US.js +3 -2
  565. package/lib/layout/locales/index.js +8 -6
  566. package/lib/layout/locales/it-IT.js +3 -2
  567. package/lib/layout/locales/ko-KR.js +3 -2
  568. package/lib/layout/locales/zh-CN.js +3 -2
  569. package/lib/layout/locales/zh-TW.js +3 -2
  570. package/lib/layout/style/index.js +48 -43
  571. package/lib/layout/utils/getBreadcrumbProps.js +65 -62
  572. package/lib/layout/utils/getMenuData.js +9 -13
  573. package/lib/layout/utils/pathTools.js +2 -6
  574. package/lib/layout/utils/useCurrentMenuLayoutProps.js +6 -11
  575. package/lib/layout/utils/utils.js +16 -18
  576. package/lib/list/Item.js +155 -136
  577. package/lib/list/ListView.js +110 -119
  578. package/lib/list/constants.js +2 -2
  579. package/lib/list/index.js +72 -70
  580. package/lib/list/style/index.js +281 -214
  581. package/lib/provider/index.js +128 -118
  582. package/lib/provider/intl.js +56 -56
  583. package/lib/provider/typing/layoutToken.js +28 -25
  584. package/lib/provider/useStyle/index.js +55 -60
  585. package/lib/provider/utils/merge.js +12 -14
  586. package/lib/skeleton/components/Descriptions/index.js +213 -229
  587. package/lib/skeleton/components/List/index.js +211 -221
  588. package/lib/skeleton/components/Result/index.js +45 -47
  589. package/lib/skeleton/index.js +23 -19
  590. package/lib/table/Store/Provide.d.ts +4 -4
  591. package/lib/table/Store/Provide.js +103 -117
  592. package/lib/table/Table.d.ts +5 -2
  593. package/lib/table/Table.js +524 -689
  594. package/lib/table/TableSearch.d.ts +24 -0
  595. package/lib/table/TableSearch.js +61 -0
  596. package/lib/table/TableToolbar.d.ts +22 -0
  597. package/lib/table/TableToolbar.js +55 -0
  598. package/lib/table/components/Alert/index.js +41 -40
  599. package/lib/table/components/Alert/style.js +28 -28
  600. package/lib/table/components/ColumnSetting/index.js +228 -224
  601. package/lib/table/components/ColumnSetting/style.js +86 -72
  602. package/lib/table/components/DragSortTable/index.js +64 -78
  603. package/lib/table/components/DragSortTable/style.js +20 -20
  604. package/lib/table/components/Dropdown/index.js +42 -48
  605. package/lib/table/components/EditableTable/CellEditorTable.js +24 -32
  606. package/lib/table/components/EditableTable/RowEditorTable.js +23 -28
  607. package/lib/table/components/EditableTable/index.js +293 -327
  608. package/lib/table/components/Form/FormRender.js +99 -104
  609. package/lib/table/components/Form/index.d.ts +4 -19
  610. package/lib/table/components/Form/index.js +113 -159
  611. package/lib/table/components/ListToolBar/HeaderMenu.js +42 -51
  612. package/lib/table/components/ListToolBar/index.js +123 -148
  613. package/lib/table/components/ListToolBar/style.js +127 -118
  614. package/lib/table/components/ToolBar/DensityIcon.js +10 -9
  615. package/lib/table/components/ToolBar/FullscreenIcon.js +5 -10
  616. package/lib/table/components/ToolBar/index.d.ts +2 -8
  617. package/lib/table/components/ToolBar/index.js +154 -194
  618. package/lib/table/index.js +27 -27
  619. package/lib/table/style/index.js +144 -113
  620. package/lib/table/typing.d.ts +4 -0
  621. package/lib/table/useFetchData.js +197 -337
  622. package/lib/table/utils/cellRenderToFromItem.js +106 -120
  623. package/lib/table/utils/columnRender.js +65 -54
  624. package/lib/table/utils/columnSort.js +24 -23
  625. package/lib/table/utils/genProColumnToColumn.d.ts +13 -9
  626. package/lib/table/utils/genProColumnToColumn.js +121 -99
  627. package/lib/table/utils/index.d.ts +10 -0
  628. package/lib/table/utils/index.js +127 -181
  629. package/lib/table/utils/useDragSort.d.ts +1 -1
  630. package/lib/table/utils/useDragSort.js +99 -93
  631. package/lib/table/utils/usePageInfo.d.ts +6 -0
  632. package/lib/table/utils/usePageInfo.js +61 -0
  633. package/lib/utils/components/DropdownFooter/index.js +25 -23
  634. package/lib/utils/components/DropdownFooter/style.js +16 -16
  635. package/lib/utils/components/ErrorBoundary/index.js +28 -50
  636. package/lib/utils/components/FieldLabel/index.js +70 -71
  637. package/lib/utils/components/FieldLabel/style.js +104 -82
  638. package/lib/utils/components/FilterDropdown/index.d.ts +11 -0
  639. package/lib/utils/components/FilterDropdown/index.js +44 -33
  640. package/lib/utils/components/FilterDropdown/style.js +19 -17
  641. package/lib/utils/components/InlineErrorFormItem/index.js +80 -80
  642. package/lib/utils/components/InlineErrorFormItem/style.js +56 -50
  643. package/lib/utils/components/LabelIconTip/index.js +30 -32
  644. package/lib/utils/components/LabelIconTip/style.js +36 -36
  645. package/lib/utils/components/ProFormContext/index.js +1 -1
  646. package/lib/utils/conversionMomentValue/index.js +22 -23
  647. package/lib/utils/dateArrayFormatter/index.js +11 -15
  648. package/lib/utils/genCopyable/index.js +75 -33
  649. package/lib/utils/getFieldPropsOrFormItemProps/index.js +3 -2
  650. package/lib/utils/hooks/useDebounceFn/index.js +18 -52
  651. package/lib/utils/hooks/useDebounceValue/index.js +7 -17
  652. package/lib/utils/hooks/useDeepCompareEffect/index.js +7 -19
  653. package/lib/utils/hooks/useDocumentTitle/index.js +2 -2
  654. package/lib/utils/hooks/useFetchData/index.js +36 -65
  655. package/lib/utils/hooks/useForceRender/index.js +2 -10
  656. package/lib/utils/hooks/useLatest/index.js +4 -3
  657. package/lib/utils/hooks/usePrevious/index.js +5 -4
  658. package/lib/utils/hooks/useReactiveRef/index.js +2 -2
  659. package/lib/utils/hooks/useRefCallback/index.js +3 -3
  660. package/lib/utils/hooks/useRefFunction/index.js +6 -11
  661. package/lib/utils/index.d.ts +1 -2
  662. package/lib/utils/index.js +57 -65
  663. package/lib/utils/isBrowser/index.js +4 -3
  664. package/lib/utils/isDeepEqualReact/index.js +9 -45
  665. package/lib/utils/isDropdownValueType/index.js +4 -3
  666. package/lib/utils/isNil/index.js +2 -3
  667. package/lib/utils/isUrl/index.js +4 -3
  668. package/lib/utils/merge/index.js +12 -14
  669. package/lib/utils/nanoid/index.js +7 -7
  670. package/lib/utils/omitBoolean/index.js +3 -2
  671. package/lib/utils/omitUndefined/index.js +5 -4
  672. package/lib/utils/omitUndefinedAndEmptyArr/index.js +6 -6
  673. package/lib/utils/parseValueToMoment/index.js +5 -8
  674. package/lib/utils/pickProFormItemProps/index.js +3 -3
  675. package/lib/utils/pickProProps/index.js +6 -7
  676. package/lib/utils/proFieldParsingText/index.js +89 -99
  677. package/lib/utils/runFunction/index.js +2 -5
  678. package/lib/utils/stringify/index.js +2 -2
  679. package/lib/utils/transformKeySubmitValue/index.js +101 -117
  680. package/lib/utils/useEditableArray/index.d.ts +6 -1
  681. package/lib/utils/useEditableArray/index.js +582 -735
  682. package/lib/utils/useEditableMap/index.d.ts +1 -1
  683. package/lib/utils/useEditableMap/index.js +88 -135
  684. package/lib/utils/useMediaQuery/index.js +19 -19
  685. package/lib/utils/useMediaQuery/query.js +7 -18
  686. package/lib/version.js +1 -1
  687. package/package.json +17 -28
  688. package/es/utils/useMountMergeState/index.d.ts +0 -2
  689. package/es/utils/useMountMergeState/index.js +0 -2
  690. package/lib/utils/useMountMergeState/index.d.ts +0 -2
  691. package/lib/utils/useMountMergeState/index.js +0 -12
@@ -1,20 +1,23 @@
1
1
  import { ConfigProvider } from 'antd';
2
- import classNames from 'classnames';
2
+ import { clsx } from 'clsx';
3
3
  import React, { useContext } from 'react';
4
4
  import { useStyle } from "./style";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- var ProCardOperation = function ProCardOperation(props) {
7
- var className = props.className,
8
- _props$style = props.style,
9
- style = _props$style === void 0 ? {} : _props$style,
10
- children = props.children;
11
- var _useContext = useContext(ConfigProvider.ConfigContext),
12
- getPrefixCls = _useContext.getPrefixCls;
13
- var prefixCls = getPrefixCls('pro-card-operation');
14
- var _useStyle = useStyle(prefixCls),
15
- wrapSSR = _useStyle.wrapSSR,
16
- hashId = _useStyle.hashId;
17
- var classString = classNames(prefixCls, className, hashId);
6
+ const ProCardOperation = props => {
7
+ const {
8
+ className,
9
+ style = {},
10
+ children
11
+ } = props;
12
+ const {
13
+ getPrefixCls
14
+ } = useContext(ConfigProvider.ConfigContext);
15
+ const prefixCls = getPrefixCls('pro-card-operation');
16
+ const {
17
+ wrapSSR,
18
+ hashId
19
+ } = useStyle(prefixCls);
20
+ const classString = clsx(prefixCls, className, hashId);
18
21
  return wrapSSR( /*#__PURE__*/_jsx("div", {
19
22
  className: classString,
20
23
  style: style,
@@ -1,24 +1,25 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
1
  import { useStyle as useAntdStyle } from "../../../provider";
4
- var genProStyle = function genProStyle(token) {
5
- return _defineProperty({}, token.componentCls, {
6
- display: 'flex',
7
- flexDirection: 'column',
8
- justifyContent: 'flex-end',
9
- marginBlock: token.marginLG,
10
- marginInline: 0,
11
- color: token.colorText,
12
- fontWeight: '500',
13
- fontSize: '20px',
14
- lineHeight: '38px'
15
- });
2
+ const genProStyle = token => {
3
+ return {
4
+ [token.componentCls]: {
5
+ display: 'flex',
6
+ flexDirection: 'column',
7
+ justifyContent: 'flex-end',
8
+ marginBlock: token.marginLG,
9
+ marginInline: 0,
10
+ color: token.colorText,
11
+ fontWeight: '500',
12
+ fontSize: '20px',
13
+ lineHeight: '38px'
14
+ }
15
+ };
16
16
  };
17
17
  export function useStyle(prefixCls) {
18
- return useAntdStyle('ProCardOperation', function (token) {
19
- var proToken = _objectSpread(_objectSpread({}, token), {}, {
20
- componentCls: ".".concat(prefixCls)
21
- });
18
+ return useAntdStyle('ProCardOperation', token => {
19
+ const proToken = {
20
+ ...token,
21
+ componentCls: `.${prefixCls}`
22
+ };
22
23
  return [genProStyle(proToken)];
23
24
  });
24
25
  }
@@ -1,59 +1,63 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["className", "layout", "style", "description", "children", "title", "tip", "status", "trend", "prefix", "icon"];
5
1
  import { QuestionCircleOutlined } from '@ant-design/icons';
6
2
  import { Statistic as AntdStatistic, Badge, ConfigProvider, Tooltip } from 'antd';
7
- import classNames from 'classnames';
3
+ import { clsx } from 'clsx';
8
4
  import React, { useContext } from 'react';
9
5
  import { useStyle } from "./style";
10
6
  import { jsx as _jsx } from "react/jsx-runtime";
11
7
  import { Fragment as _Fragment } from "react/jsx-runtime";
12
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
- var Statistic = function Statistic(props) {
14
- var className = props.className,
15
- _props$layout = props.layout,
16
- layout = _props$layout === void 0 ? 'inline' : _props$layout,
17
- style = props.style,
18
- description = props.description,
19
- children = props.children,
20
- title = props.title,
21
- tip = props.tip,
22
- status = props.status,
23
- trend = props.trend,
24
- prefix = props.prefix,
25
- icon = props.icon,
26
- others = _objectWithoutProperties(props, _excluded);
27
- var _useContext = useContext(ConfigProvider.ConfigContext),
28
- getPrefixCls = _useContext.getPrefixCls;
29
- var prefixCls = getPrefixCls('pro-card-statistic');
30
- var _useStyle = useStyle(prefixCls),
31
- wrapSSR = _useStyle.wrapSSR,
32
- hashId = _useStyle.hashId;
33
- var classString = classNames(prefixCls, className, hashId);
34
- var statusClass = classNames("".concat(prefixCls, "-status"), hashId);
35
- var iconClass = classNames("".concat(prefixCls, "-icon"), hashId);
36
- var wrapperClass = classNames("".concat(prefixCls, "-wrapper"), hashId);
37
- var contentClass = classNames("".concat(prefixCls, "-content"), hashId);
38
- var statisticClassName = classNames(hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-layout-").concat(layout), layout), "".concat(prefixCls, "-trend-").concat(trend), trend));
39
- var tipDom = tip && /*#__PURE__*/_jsx(Tooltip, {
9
+ const Statistic = props => {
10
+ const {
11
+ className,
12
+ layout = 'inline',
13
+ style,
14
+ description,
15
+ children,
16
+ title,
17
+ tip,
18
+ status,
19
+ trend,
20
+ prefix,
21
+ icon,
22
+ ...others
23
+ } = props;
24
+ const {
25
+ getPrefixCls
26
+ } = useContext(ConfigProvider.ConfigContext);
27
+ const prefixCls = getPrefixCls('pro-card-statistic');
28
+ const {
29
+ wrapSSR,
30
+ hashId
31
+ } = useStyle(prefixCls);
32
+ const classString = clsx(prefixCls, className, hashId);
33
+ const statusClass = clsx(`${prefixCls}-status`, hashId);
34
+ const iconClass = clsx(`${prefixCls}-icon`, hashId);
35
+ const wrapperClass = clsx(`${prefixCls}-wrapper`, hashId);
36
+ const contentClass = clsx(`${prefixCls}-content`, hashId);
37
+ const statisticClassName = clsx(hashId, {
38
+ [`${prefixCls}-layout-${layout}`]: layout,
39
+ [`${prefixCls}-trend-${trend}`]: trend
40
+ });
41
+ const tipDom = tip && /*#__PURE__*/_jsx(Tooltip, {
40
42
  title: tip,
41
43
  children: /*#__PURE__*/_jsx(QuestionCircleOutlined, {
42
- className: "".concat(prefixCls, "-tip ").concat(hashId).trim()
44
+ className: `${prefixCls}-tip ${hashId}`.trim()
43
45
  })
44
46
  });
45
- var trendIconClassName = classNames("".concat(prefixCls, "-trend-icon"), hashId, _defineProperty({}, "".concat(prefixCls, "-trend-icon-").concat(trend), trend));
46
- var trendDom = trend && /*#__PURE__*/_jsx("div", {
47
+ const trendIconClassName = clsx(`${prefixCls}-trend-icon`, hashId, {
48
+ [`${prefixCls}-trend-icon-${trend}`]: trend
49
+ });
50
+ const trendDom = trend && /*#__PURE__*/_jsx("div", {
47
51
  className: trendIconClassName
48
52
  });
49
- var statusDom = status && /*#__PURE__*/_jsx("div", {
53
+ const statusDom = status && /*#__PURE__*/_jsx("div", {
50
54
  className: statusClass,
51
55
  children: /*#__PURE__*/_jsx(Badge, {
52
56
  status: status,
53
57
  text: null
54
58
  })
55
59
  });
56
- var iconDom = icon && /*#__PURE__*/_jsx("div", {
60
+ const iconDom = icon && /*#__PURE__*/_jsx("div", {
57
61
  className: iconClass,
58
62
  children: icon
59
63
  });
@@ -64,16 +68,17 @@ var Statistic = function Statistic(props) {
64
68
  className: wrapperClass,
65
69
  children: [statusDom, /*#__PURE__*/_jsxs("div", {
66
70
  className: contentClass,
67
- children: [/*#__PURE__*/_jsx(AntdStatistic, _objectSpread({
71
+ children: [/*#__PURE__*/_jsx(AntdStatistic, {
68
72
  title: (title || tipDom) && /*#__PURE__*/_jsxs(_Fragment, {
69
73
  children: [title, tipDom]
70
74
  }),
71
75
  prefix: (trendDom || prefix) && /*#__PURE__*/_jsxs(_Fragment, {
72
76
  children: [trendDom, prefix]
73
77
  }),
74
- className: statisticClassName
75
- }, others)), description && /*#__PURE__*/_jsx("div", {
76
- className: "".concat(prefixCls, "-description ").concat(hashId).trim(),
78
+ className: statisticClassName,
79
+ ...others
80
+ }), description && /*#__PURE__*/_jsx("div", {
81
+ className: `${prefixCls}-description ${hashId}`.trim(),
77
82
  children: description
78
83
  })]
79
84
  })]
@@ -1,80 +1,99 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
1
  import { useStyle as useAntdStyle } from "../../../provider";
4
- var genProStyle = function genProStyle(token) {
5
- return _defineProperty({}, token.componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
6
- display: 'flex',
7
- fontSize: token.fontSize,
8
- '& + &': {
9
- marginBlockStart: 4
10
- },
11
- '&-tip': {
12
- marginInlineStart: 4
13
- },
14
- '&-wrapper': _defineProperty({
2
+ const genProStyle = token => {
3
+ return {
4
+ [token.componentCls]: {
15
5
  display: 'flex',
16
- width: '100%'
17
- }, "".concat(token.componentCls, "-status"), {
18
- width: '14px'
19
- }),
20
- '&-icon': {
21
- marginInlineEnd: 16
22
- },
23
- '&-trend-icon': {
24
- width: 0,
25
- height: 0,
26
- borderInlineEnd: '3.5px solid transparent',
27
- borderBlockEnd: '9px solid #000',
28
- borderInlineStart: '3.5px solid transparent',
29
- '&-up': {
30
- transform: 'rotate(0deg)'
6
+ fontSize: token.fontSize,
7
+ '& + &': {
8
+ marginBlockStart: 4
31
9
  },
32
- '&-down': {
33
- transform: 'rotate(180deg)'
10
+ '&-tip': {
11
+ marginInlineStart: 4
12
+ },
13
+ '&-wrapper': {
14
+ display: 'flex',
15
+ width: '100%',
16
+ [`${token.componentCls}-status`]: {
17
+ width: '14px'
18
+ }
19
+ },
20
+ '&-icon': {
21
+ marginInlineEnd: 16
22
+ },
23
+ '&-trend-icon': {
24
+ width: 0,
25
+ height: 0,
26
+ borderInlineEnd: '3.5px solid transparent',
27
+ borderBlockEnd: '9px solid #000',
28
+ borderInlineStart: '3.5px solid transparent',
29
+ '&-up': {
30
+ transform: 'rotate(0deg)'
31
+ },
32
+ '&-down': {
33
+ transform: 'rotate(180deg)'
34
+ }
35
+ },
36
+ '&-content': {
37
+ width: '100%'
38
+ },
39
+ '&-description': {
40
+ width: '100%'
41
+ },
42
+ [`${token.antCls}-statistic-title`]: {
43
+ color: token.colorText
44
+ },
45
+ '&-trend-up': {
46
+ [`${token.antCls}-statistic-content`]: {
47
+ color: '#f5222d',
48
+ [`${token.componentCls}-trend-icon`]: {
49
+ borderBlockEndColor: '#f5222d'
50
+ }
51
+ }
52
+ },
53
+ '&-trend-down': {
54
+ [`${token.antCls}-statistic-content`]: {
55
+ color: '#389e0d',
56
+ [`${token.componentCls}-trend-icon`]: {
57
+ borderBlockEndColor: '#52c41a'
58
+ }
59
+ }
60
+ },
61
+ '& &-layout-horizontal': {
62
+ display: 'flex',
63
+ justifyContent: 'space-between',
64
+ [`${token.antCls}-statistic-title`]: {
65
+ marginBlockEnd: 0
66
+ },
67
+ [`${token.antCls}-statistic-content-value`]: {
68
+ fontWeight: 500
69
+ },
70
+ [`${token.antCls}-statistic-title,${token.antCls}-statistic-content,${token.antCls}-statistic-content-suffix,${token.antCls}-statistic-content-prefix,${token.antCls}-statistic-content-value-decimal`]: {
71
+ fontSize: token.fontSize
72
+ }
73
+ },
74
+ '& &-layout-inline': {
75
+ display: 'inline-flex',
76
+ color: token.colorTextSecondary,
77
+ [`${token.antCls}-statistic-title`]: {
78
+ marginInlineEnd: '6px',
79
+ marginBlockEnd: 0
80
+ },
81
+ [`${token.antCls}-statistic-content`]: {
82
+ color: token.colorTextSecondary
83
+ },
84
+ [`${token.antCls}-statistic-title,${token.antCls}-statistic-content,${token.antCls}-statistic-content-suffix,${token.antCls}-statistic-content-prefix,${token.antCls}-statistic-content-value-decimal`]: {
85
+ fontSize: token.fontSizeSM
86
+ }
34
87
  }
35
- },
36
- '&-content': {
37
- width: '100%'
38
- },
39
- '&-description': {
40
- width: '100%'
41
88
  }
42
- }, "".concat(token.antCls, "-statistic-title"), {
43
- color: token.colorText
44
- }), '&-trend-up', _defineProperty({}, "".concat(token.antCls, "-statistic-content"), _defineProperty({
45
- color: '#f5222d'
46
- }, "".concat(token.componentCls, "-trend-icon"), {
47
- borderBlockEndColor: '#f5222d'
48
- }))), '&-trend-down', _defineProperty({}, "".concat(token.antCls, "-statistic-content"), _defineProperty({
49
- color: '#389e0d'
50
- }, "".concat(token.componentCls, "-trend-icon"), {
51
- borderBlockEndColor: '#52c41a'
52
- }))), '& &-layout-horizontal', _defineProperty(_defineProperty(_defineProperty({
53
- display: 'flex',
54
- justifyContent: 'space-between'
55
- }, "".concat(token.antCls, "-statistic-title"), {
56
- marginBlockEnd: 0
57
- }), "".concat(token.antCls, "-statistic-content-value"), {
58
- fontWeight: 500
59
- }), "".concat(token.antCls, "-statistic-title,").concat(token.antCls, "-statistic-content,").concat(token.antCls, "-statistic-content-suffix,").concat(token.antCls, "-statistic-content-prefix,").concat(token.antCls, "-statistic-content-value-decimal"), {
60
- fontSize: token.fontSize
61
- })), '& &-layout-inline', _defineProperty(_defineProperty(_defineProperty({
62
- display: 'inline-flex',
63
- color: token.colorTextSecondary
64
- }, "".concat(token.antCls, "-statistic-title"), {
65
- marginInlineEnd: '6px',
66
- marginBlockEnd: 0
67
- }), "".concat(token.antCls, "-statistic-content"), {
68
- color: token.colorTextSecondary
69
- }), "".concat(token.antCls, "-statistic-title,").concat(token.antCls, "-statistic-content,").concat(token.antCls, "-statistic-content-suffix,").concat(token.antCls, "-statistic-content-prefix,").concat(token.antCls, "-statistic-content-value-decimal"), {
70
- fontSize: token.fontSizeSM
71
- })));
89
+ };
72
90
  };
73
91
  export function useStyle(prefixCls) {
74
- return useAntdStyle('Statistic', function (token) {
75
- var proListToken = _objectSpread(_objectSpread({}, token), {}, {
76
- componentCls: ".".concat(prefixCls)
77
- });
92
+ return useAntdStyle('Statistic', token => {
93
+ const proListToken = {
94
+ ...token,
95
+ componentCls: `.${prefixCls}`
96
+ };
78
97
  return [genProStyle(proListToken)];
79
98
  });
80
99
  }
@@ -1,9 +1,5 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["children", "statistic", "className", "chart", "chartPlacement", "footer"];
5
1
  import { ConfigProvider } from 'antd';
6
- import classNames from 'classnames';
2
+ import { clsx } from 'clsx';
7
3
  import React, { useContext } from 'react';
8
4
  import Card from "../Card";
9
5
  import Divider from "../Divider";
@@ -12,60 +8,69 @@ import Statistic from "../Statistic";
12
8
  import { useStyle } from "./style";
13
9
  import { jsx as _jsx } from "react/jsx-runtime";
14
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
- var StatisticCard = function StatisticCard(props) {
16
- var children = props.children,
17
- statistic = props.statistic,
18
- className = props.className,
19
- chart = props.chart,
20
- chartPlacement = props.chartPlacement,
21
- footer = props.footer,
22
- others = _objectWithoutProperties(props, _excluded);
23
- var _useContext = useContext(ConfigProvider.ConfigContext),
24
- getPrefixCls = _useContext.getPrefixCls;
25
- var prefixCls = getPrefixCls('pro-statistic-card');
26
- var _useStyle = useStyle(prefixCls),
27
- wrapSSR = _useStyle.wrapSSR,
28
- hashId = _useStyle.hashId;
29
- var classString = classNames(prefixCls, className, hashId);
11
+ const StatisticCard = props => {
12
+ const {
13
+ children,
14
+ statistic,
15
+ className,
16
+ chart,
17
+ chartPlacement,
18
+ footer,
19
+ ...others
20
+ } = props;
21
+ const {
22
+ getPrefixCls
23
+ } = useContext(ConfigProvider.ConfigContext);
24
+ const prefixCls = getPrefixCls('pro-statistic-card');
25
+ const {
26
+ wrapSSR,
27
+ hashId
28
+ } = useStyle(prefixCls);
29
+ const classString = clsx(prefixCls, className, hashId);
30
30
 
31
31
  // 在 StatisticCard 中时默认为 vertical。
32
- var statisticDom = statistic && /*#__PURE__*/_jsx(Statistic, _objectSpread({
33
- layout: "vertical"
34
- }, statistic));
35
- var chartCls = classNames("".concat(prefixCls, "-chart"), hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-chart-left"), chartPlacement === 'left' && chart && statistic), "".concat(prefixCls, "-chart-right"), chartPlacement === 'right' && chart && statistic));
36
- var chartDom = chart && /*#__PURE__*/_jsx("div", {
32
+ const statisticDom = statistic && /*#__PURE__*/_jsx(Statistic, {
33
+ layout: "vertical",
34
+ ...statistic
35
+ });
36
+ const chartCls = clsx(`${prefixCls}-chart`, hashId, {
37
+ [`${prefixCls}-chart-left`]: chartPlacement === 'left' && chart && statistic,
38
+ [`${prefixCls}-chart-right`]: chartPlacement === 'right' && chart && statistic
39
+ });
40
+ const chartDom = chart && /*#__PURE__*/_jsx("div", {
37
41
  className: chartCls,
38
42
  children: chart
39
43
  });
40
- var contentCls = classNames("".concat(prefixCls, "-content "), hashId, _defineProperty({}, "".concat(prefixCls, "-content-horizontal"), chartPlacement === 'left' || chartPlacement === 'right'));
44
+ const contentCls = clsx(`${prefixCls}-content `, hashId, {
45
+ [`${prefixCls}-content-horizontal`]: chartPlacement === 'left' || chartPlacement === 'right'
46
+ });
41
47
 
42
48
  // 默认上下结构
43
- var contentDom = (chartDom || statisticDom) && (chartPlacement === 'left' ? /*#__PURE__*/_jsxs("div", {
49
+ const contentDom = (chartDom || statisticDom) && (chartPlacement === 'left' ? /*#__PURE__*/_jsxs("div", {
44
50
  className: contentCls,
45
51
  children: [chartDom, statisticDom]
46
52
  }) : /*#__PURE__*/_jsxs("div", {
47
53
  className: contentCls,
48
54
  children: [statisticDom, chartDom]
49
55
  }));
50
- var footerDom = footer && /*#__PURE__*/_jsx("div", {
51
- className: "".concat(prefixCls, "-footer ").concat(hashId).trim(),
56
+ const footerDom = footer && /*#__PURE__*/_jsx("div", {
57
+ className: `${prefixCls}-footer ${hashId}`.trim(),
52
58
  children: footer
53
59
  });
54
- return wrapSSR( /*#__PURE__*/_jsxs(Card, _objectSpread(_objectSpread({
55
- className: classString
56
- }, others), {}, {
60
+ return wrapSSR( /*#__PURE__*/_jsxs(Card, {
61
+ className: classString,
62
+ ...others,
57
63
  children: [contentDom, children, footerDom]
58
- })));
64
+ }));
59
65
  };
60
- var Group = function Group(props) {
61
- return /*#__PURE__*/_jsx(StatisticCard, _objectSpread({
62
- styles: {
63
- body: {
64
- padding: 0
65
- }
66
+ const Group = props => /*#__PURE__*/_jsx(StatisticCard, {
67
+ styles: {
68
+ body: {
69
+ padding: 0
66
70
  }
67
- }, props));
68
- };
71
+ },
72
+ ...props
73
+ });
69
74
  StatisticCard.Statistic = Statistic;
70
75
  StatisticCard.Divider = Divider;
71
76
  StatisticCard.Operation = Operation;
@@ -1,44 +1,46 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
1
  import { useStyle as useAntdStyle } from "../../../provider";
4
- var genProStyle = function genProStyle(token) {
5
- return _defineProperty({}, token.componentCls, {
6
- '&-chart': {
7
- display: 'flex',
8
- flexDirection: 'column',
9
- marginBlockStart: 8,
10
- marginBlockEnd: 8,
11
- '&-left': {
12
- marginBlockStart: 0,
13
- marginInlineEnd: '16px'
2
+ const genProStyle = token => {
3
+ return {
4
+ [token.componentCls]: {
5
+ '&-chart': {
6
+ display: 'flex',
7
+ flexDirection: 'column',
8
+ marginBlockStart: 8,
9
+ marginBlockEnd: 8,
10
+ '&-left': {
11
+ marginBlockStart: 0,
12
+ marginInlineEnd: '16px'
13
+ },
14
+ '&-right': {
15
+ marginBlockStart: 0,
16
+ marginInlineStart: '16px'
17
+ }
14
18
  },
15
- '&-right': {
16
- marginBlockStart: 0,
17
- marginInlineStart: '16px'
19
+ '&-content': {
20
+ display: 'flex',
21
+ flexDirection: 'column',
22
+ '&-horizontal': {
23
+ flexDirection: 'row',
24
+ [`${token.componentCls}-chart`]: {
25
+ alignItems: 'center',
26
+ alignSelf: 'flex-start'
27
+ }
28
+ }
29
+ },
30
+ '&-footer': {
31
+ marginBlockStart: 8,
32
+ paddingBlockStart: '16px',
33
+ borderBlockStart: `rgba(0, 0, 0, 0.08) solid ${token.colorBorder}`
18
34
  }
19
- },
20
- '&-content': {
21
- display: 'flex',
22
- flexDirection: 'column',
23
- '&-horizontal': _defineProperty({
24
- flexDirection: 'row'
25
- }, "".concat(token.componentCls, "-chart"), {
26
- alignItems: 'center',
27
- alignSelf: 'flex-start'
28
- })
29
- },
30
- '&-footer': {
31
- marginBlockStart: 8,
32
- paddingBlockStart: '16px',
33
- borderBlockStart: "rgba(0, 0, 0, 0.08) solid ".concat(token.colorBorder)
34
35
  }
35
- });
36
+ };
36
37
  };
37
38
  export function useStyle(prefixCls) {
38
- return useAntdStyle('StatisticCard', function (token) {
39
- var proListToken = _objectSpread(_objectSpread({}, token), {}, {
40
- componentCls: ".".concat(prefixCls)
41
- });
39
+ return useAntdStyle('StatisticCard', token => {
40
+ const proListToken = {
41
+ ...token,
42
+ componentCls: `.${prefixCls}`
43
+ };
42
44
  return [genProStyle(proListToken)];
43
45
  });
44
46
  }