"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),_rcDropdown=require("rc-dropdown"),_rcDropdown2=_interopRequireDefault(_rcDropdown),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_warning=require("../_util/warning"),_warning2=_interopRequireDefault(_warning);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var Dropdown=function(e){function r(){return(0,_classCallCheck3.default)(this,r),(0,_possibleConstructorReturn3.default)(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return(0,_inherits3.default)(r,e),(0,_createClass3.default)(r,[{key:"getTransitionName",value:function(){var e=this.props,r=e.placement,t=void 0===r?"":r,n=e.transitionName;return void 0!==n?n:0<=t.indexOf("top")?"slide-down":"slide-up"}},{key:"componentDidMount",value:function(){var e=this.props.overlay.props;(0,_warning2.default)(!e.mode||"vertical"===e.mode,'mode="'+e.mode+"\" is not supported for Dropdown's Menu.")}},{key:"render",value:function(){var e=this.props,r=e.children,t=e.prefixCls,n=e.overlay,a=e.trigger,s=e.disabled,l=React.Children.only(r),o=React.Children.only(n),i=React.cloneElement(l,{className:(0,_classnames2.default)(l.props.className,t+"-trigger"),disabled:s}),u=o.props.selectable||!1,c=React.cloneElement(o,{mode:"vertical",selectable:u});return React.createElement(_rcDropdown2.default,(0,_extends3.default)({},this.props,{transitionName:this.getTransitionName(),trigger:s?[]:a,overlay:c}),i)}}]),r}(React.Component);(exports.default=Dropdown).defaultProps={prefixCls:"dt-dropdown",mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft"},module.exports=exports.default;