@@ -3,8 +3,10 @@ import { ProCard as AntProCard } from '@ant-design/pro-components';
33import type { ProCardProps } from '@ant-design/pro-components' ;
44import { ConfigProvider } from '@oceanbase/design' ;
55import { isHorizontalPaddingZero } from '@oceanbase/design/es/_util' ;
6+ import { theme } from '@oceanbase/design' ;
67import classNames from 'classnames' ;
78import useStyle from './style' ;
9+ import { CaretRightFilled } from '@oceanbase/icons' ;
810
911export { ProCardProps } ;
1012
@@ -19,10 +21,11 @@ const ProCard: typeof AntProCard = ({
1921 className,
2022 ...restProps
2123} ) => {
22- const { getPrefixCls } = useContext ( ConfigProvider . ConfigContext ) ;
24+ const { getPrefixCls, iconPrefixCls } = useContext ( ConfigProvider . ConfigContext ) ;
2325
2426 const prefixCls = getPrefixCls ( 'pro-card' , customizePrefixCls ) ;
2527 const { wrapSSR } = useStyle ( prefixCls ) ;
28+ const { token } = theme . useToken ( ) ;
2629
2730 // ProCard body no horizontal padding
2831 const noBodyHorizontalPadding = isHorizontalPaddingZero ( bodyStyle ?. padding ) || ghost ;
@@ -53,6 +56,18 @@ const ProCard: typeof AntProCard = ({
5356 headerBordered = { headerBordered }
5457 bodyStyle = { bodyStyle }
5558 className = { proCardCls }
59+ collapsibleIconRender = { ( { collapsed } ) => {
60+ return (
61+ < CaretRightFilled
62+ className = { `${ iconPrefixCls } ${ iconPrefixCls } -right ${ prefixCls } -collapsible-icon` }
63+ style = { {
64+ transition : 'transform 0.2s' ,
65+ transform : collapsed ? undefined : 'rotate(90deg)' ,
66+ color : token . colorTextSecondary ,
67+ } }
68+ />
69+ ) ;
70+ } }
5671 { ...restProps }
5772 />
5873 ) ;
0 commit comments