"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),_button=require("../button"),_button2=_interopRequireDefault(_button),_icon=require("../icon"),_icon2=_interopRequireDefault(_icon),_dropdown=require("./dropdown"),_dropdown2=_interopRequireDefault(_dropdown),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames);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 __rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&(r[n[l]]=e[n[l]])}return r},ButtonGroup=_button2.default.Group,DropdownButton=function(e){function t(){return(0,_classCallCheck3.default)(this,t),(0,_possibleConstructorReturn3.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,_inherits3.default)(t,e),(0,_createClass3.default)(t,[{key:"render",value:function(){var e=this.props,t=e.type,r=e.disabled,n=e.onClick,l=e.children,a=e.prefixCls,o=e.className,i=e.overlay,s=e.trigger,u=e.align,c=e.visible,p=e.onVisibleChange,_=e.placement,d=e.getPopupContainer,f=__rest(e,["type","disabled","onClick","children","prefixCls","className","overlay","trigger","align","visible","onVisibleChange","placement","getPopupContainer"]),b={align:u,overlay:i,disabled:r,trigger:r?[]:s,onVisibleChange:p,placement:_,getPopupContainer:d};return"visible"in this.props&&(b.visible=c),React.createElement(ButtonGroup,(0,_extends3.default)({},f,{className:(0,_classnames2.default)(a,o)}),React.createElement(_button2.default,{type:t,disabled:r,onClick:n},l),React.createElement(_dropdown2.default,b,React.createElement(_button2.default,{type:t},React.createElement(_icon2.default,{type:"caret-down"}))))}}]),t}(React.Component);(exports.default=DropdownButton).defaultProps={placement:"bottomRight",type:"default",prefixCls:"dt-dropdown-button"},module.exports=exports.default;