import React from 'react'; import Tooltip from 'rc-tooltip'; import Icon from '../icon'; import Button from '../button'; const prefixCls = 'ant-popover'; export default React.createClass({ getInitialState() { return { visible: false }; }, getDefaultProps() { return { transitionName: '', placement: 'top', trigger: 'click', overlayStyle: {}, onConfirm: function () { }, onCancel: function () { } }; }, confirm() { this.props.onConfirm.call(this); this.setState({ visible: false }); }, cancel() { this.props.onCancel.call(this); this.setState({ visible: false }); }, onVisibleChange(v) { this.setState({ visible: v }); }, render() { const overlay =

{this.props.title}

; const transitionName = ({ top: 'zoom-down', bottom: 'zoom-up', left: 'zoom-right', right: 'zoom-left', topLeft: 'zoom-down', bottomLeft: 'zoom-up', leftTop: 'zoom-right', rightTop: 'zoom-left', topRight: 'zoom-down', bottomRight: 'zoom-up', leftBottom: 'zoom-right', rightBottom: 'zoom-left', })[this.props.placement]; return ( {this.props.children} ); } });