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";var __rest=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&(r[o[n]]=e[o[n]])}return r};import*as React from"react";import Button from"../button";import Icon from"../icon";import Dropdown from"./dropdown";import classNames from"classnames";var ButtonGroup=Button.Group,DropdownButton=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this.props,t=e.type,r=e.disabled,o=e.onClick,n=e.children,i=e.prefixCls,s=e.className,a=e.overlay,l=e.trigger,p=e.align,c=e.visible,m=e.onVisibleChange,u=e.placement,b=e.getPopupContainer,d=__rest(e,["type","disabled","onClick","children","prefixCls","className","overlay","trigger","align","visible","onVisibleChange","placement","getPopupContainer"]),f={align:p,overlay:a,disabled:r,trigger:r?[]:l,onVisibleChange:m,placement:u,getPopupContainer:b};return"visible"in this.props&&(f.visible=c),React.createElement(ButtonGroup,_extends({},d,{className:classNames(i,s)}),React.createElement(Button,{type:t,disabled:r,onClick:o},n),React.createElement(Dropdown,f,React.createElement(Button,{type:t},React.createElement(Icon,{type:"caret-down"}))))}}]),t}(React.Component);export default DropdownButton;DropdownButton.defaultProps={placement:"bottomRight",type:"default",prefixCls:"dt-dropdown-button"};