import _extends from"babel-runtime/helpers/extends";import _classCallCheck from"babel-runtime/helpers/classCallCheck";import _createClass from"babel-runtime/helpers/createClass";import _possibleConstructorReturn from"babel-runtime/helpers/possibleConstructorReturn";import _inherits from"babel-runtime/helpers/inherits";import*as React from"react";import classNames from"classnames";import Tooltip from"../tooltip";import warning from"../_util/warning";var Popover=function(e){function t(){_classCallCheck(this,t);var e=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.saveTooltip=function(t){e.tooltip=t},e}return _inherits(t,e),_createClass(t,[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"getOverlay",value:function(){var e=this.props,t=e.title,r=e.prefixCls,o=e.content,s=e.maxHeight,i=classNames(r+"-inner-content",{"limit-height":"number"==typeof s});return warning(!("overlay"in this.props),"Popover[overlay] is removed, please use Popover[content] instead, see: #"),React.createElement("div",null,t&&React.createElement("div",{className:r+"-title"},t),React.createElement("div",{className:i,style:{maxHeight:s+"px"}},o))}},{key:"render",value:function(){var e="error"===this.props.type?_extends({},this.props,{overlayClassName:this.props.prefixCls+"-error"}):_extends({},this.props);return delete e.title,delete e.type,React.createElement(Tooltip,_extends({},e,{ref:this.saveTooltip,overlay:this.getOverlay()}))}}]),t}(React.Component);export default Popover;Popover.defaultProps={prefixCls:"dt-popover",placement:"top",transitionName:"zoom-big",trigger:"hover",mouseEnterDelay:.1,mouseLeaveDelay:.1,maxHeight:"none",overlayStyle:{}};