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 RcDropdown from"rc-dropdown";import classNames from"classnames";import warning from"../_util/warning";var Dropdown=function(e){function r(){return _classCallCheck(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,e),_createClass(r,[{key:"getTransitionName",value:function(){var e=this.props,r=e.placement,t=void 0===r?"":r,o=e.transitionName;return void 0!==o?o:t.indexOf("top")>=0?"slide-down":"slide-up"}},{key:"componentDidMount",value:function(){var e=this.props.overlay.props;warning(!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,o=e.overlay,s=e.trigger,n=e.disabled,a=React.Children.only(r),i=React.Children.only(o),l=React.cloneElement(a,{className:classNames(a.props.className,t+"-trigger"),disabled:n}),p=i.props.selectable||!1,m=React.cloneElement(i,{mode:"vertical",selectable:p});return React.createElement(RcDropdown,_extends({},this.props,{transitionName:this.getTransitionName(),trigger:n?[]:s,overlay:m}),l)}}]),r}(React.Component);export default Dropdown;Dropdown.defaultProps={prefixCls:"dt-dropdown",mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft"};