"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends2=require("babel-runtime/helpers/extends"),_extends3=_interopRequireDefault(_extends2),_classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=require("babel-runtime/helpers/createClass"),_createClass3=_interopRequireDefault(_createClass2),_possibleConstructorReturn2=require("babel-runtime/helpers/possibleConstructorReturn"),_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=require("babel-runtime/helpers/inherits"),_inherits3=_interopRequireDefault(_inherits2),_react=require("react"),React=_interopRequireWildcard(_react),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_tooltip=require("../tooltip"),_tooltip2=_interopRequireDefault(_tooltip),_warning=require("../_util/warning"),_warning2=_interopRequireDefault(_warning);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var Popover=function(e){function r(){(0,_classCallCheck3.default)(this,r);var t=(0,_possibleConstructorReturn3.default)(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments));return t.saveTooltip=function(e){t.tooltip=e},t}return(0,_inherits3.default)(r,e),(0,_createClass3.default)(r,[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"getOverlay",value:function(){var e=this.props,t=e.title,r=e.prefixCls,l=e.content,a=e.maxHeight,i=(0,_classnames2.default)(r+"-inner-content",{"limit-height":"number"==typeof a});return(0,_warning2.default)(!("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:a+"px"}},l))}},{key:"render",value:function(){var e="error"===this.props.type?(0,_extends3.default)({},this.props,{overlayClassName:this.props.prefixCls+"-error"}):(0,_extends3.default)({},this.props);return delete e.title,delete e.type,React.createElement(_tooltip2.default,(0,_extends3.default)({},e,{ref:this.saveTooltip,overlay:this.getOverlay()}))}}]),r}(React.Component);(exports.default=Popover).defaultProps={prefixCls:"dt-popover",placement:"top",transitionName:"zoom-big",trigger:"hover",mouseEnterDelay:.1,mouseLeaveDelay:.1,maxHeight:"none",overlayStyle:{}},module.exports=exports.default;