mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
remove jsx file
This commit is contained in:
parent
0612251647
commit
c79826ea83
@ -1,40 +0,0 @@
|
||||
import * as React from 'react';
|
||||
import Tooltip from '../tooltip';
|
||||
import getPlacements from './placements';
|
||||
import warning from 'warning';
|
||||
const placements = getPlacements();
|
||||
export default class Popover extends React.Component {
|
||||
render() {
|
||||
return (<Tooltip transitionName={this.props.transitionName} builtinPlacements={placements} ref="tooltip" {...this.props} overlay={this.getOverlay()}>
|
||||
{this.props.children}
|
||||
</Tooltip>);
|
||||
}
|
||||
getPopupDomNode() {
|
||||
return this.refs.tooltip.getPopupDomNode();
|
||||
}
|
||||
componentDidMount() {
|
||||
if ('overlay' in this.props) {
|
||||
warning(false, '`overlay` prop of Popover is deprecated, use `content` instead.');
|
||||
}
|
||||
}
|
||||
getOverlay() {
|
||||
// use content replace overlay
|
||||
// keep overlay for compatibility
|
||||
const { title, prefixCls, overlay, content } = this.props;
|
||||
return (<div>
|
||||
{title && <div className={`${prefixCls}-title`}>{title}</div>}
|
||||
<div className={`${prefixCls}-inner-content`}>
|
||||
{content || overlay}
|
||||
</div>
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
Popover.defaultProps = {
|
||||
prefixCls: 'ant-popover',
|
||||
placement: 'top',
|
||||
transitionName: 'zoom-big',
|
||||
trigger: 'hover',
|
||||
mouseEnterDelay: 0.1,
|
||||
mouseLeaveDelay: 0.1,
|
||||
overlayStyle: {},
|
||||
};
|
Loading…
Reference in New Issue
Block a user