@ -1,11 +1,11 @@
import classNames from 'classnames' ;
import classNames from 'classnames' ;
import * as React from 'react' ;
import * as React from 'react' ;
import { ConfigContext } from '../config-provider' ;
import type { AbstractTooltipProps } from '../tooltip' ;
import Tooltip from '../tooltip' ;
import type { RenderFunction } from '../_util/getRenderPropValue' ;
import type { RenderFunction } from '../_util/getRenderPropValue' ;
import { getRenderPropValue } from '../_util/getRenderPropValue' ;
import { getRenderPropValue } from '../_util/getRenderPropValue' ;
import { getTransitionName } from '../_util/motion' ;
import { getTransitionName } from '../_util/motion' ;
import { ConfigContext } from '../config-provider' ;
import type { AbstractTooltipProps } from '../tooltip' ;
import Tooltip from '../tooltip' ;
import PurePanel from './PurePanel' ;
import PurePanel from './PurePanel' ;
// CSSINJS
// CSSINJS
import useStyle from './style' ;
import useStyle from './style' ;
@ -21,17 +21,12 @@ interface OverlayProps {
content? : PopoverProps [ 'content' ] ;
content? : PopoverProps [ 'content' ] ;
}
}
const Overlay : React.FC < OverlayProps > = ( { title , content , prefixCls } ) = > {
const Overlay : React.FC < OverlayProps > = ( { title , content , prefixCls } ) = > (
if ( ! title && ! content ) {
< >
return null ;
{ title && < div className = { ` ${ prefixCls } -title ` } > { getRenderPropValue ( title ) } < / div > }
}
< div className = { ` ${ prefixCls } -inner-content ` } > { getRenderPropValue ( content ) } < / div >
return (
< / >
< >
) ;
{ title && < div className = { ` ${ prefixCls } -title ` } > { getRenderPropValue ( title ) } < / div > }
< div className = { ` ${ prefixCls } -inner-content ` } > { getRenderPropValue ( content ) } < / div >
< / >
) ;
} ;
const Popover = React . forwardRef < unknown , PopoverProps > ( ( props , ref ) = > {
const Popover = React . forwardRef < unknown , PopoverProps > ( ( props , ref ) = > {
const {
const {
@ -65,7 +60,9 @@ const Popover = React.forwardRef<unknown, PopoverProps>((props, ref) => {
prefixCls = { prefixCls }
prefixCls = { prefixCls }
overlayClassName = { overlayCls }
overlayClassName = { overlayCls }
ref = { ref }
ref = { ref }
overlay = { < Overlay prefixCls = { prefixCls } title = { title } content = { content } / > }
overlay = {
title || content ? < Overlay prefixCls = { prefixCls } title = { title } content = { content } / > : null
}
transitionName = { getTransitionName ( rootPrefixCls , 'zoom-big' , otherProps . transitionName ) }
transitionName = { getTransitionName ( rootPrefixCls , 'zoom-big' , otherProps . transitionName ) }
data - popover - inject
data - popover - inject
/ > ,
/ > ,