import _extends from"babel-runtime/helpers/extends";import _defineProperty from"babel-runtime/helpers/defineProperty";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,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)r.indexOf(o[l])<0&&(t[o[l]]=e[o[l]])}return t};import*as React from"react";import RcTreeSelect,{TreeNode,SHOW_ALL,SHOW_PARENT,SHOW_CHILD}from"rc-tree-select";import classNames from"classnames";import LocaleReceiver from"../locale-provider/LocaleReceiver";import warning from"../_util/warning";var TreeSelect=function(e){function r(e){_classCallCheck(this,r);var t=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.saveTreeSelect=function(e){t.rcTreeSelect=e},t.renderTreeSelect=function(e){var r,o=t.props,l=o.prefixCls,n=o.className,s=o.size,c=o.notFoundContent,a=o.dropdownStyle,i=__rest(o,["prefixCls","className","size","notFoundContent","dropdownStyle"]),m=classNames((_defineProperty(r={},l+"-lg","large"===s),_defineProperty(r,l+"-sm","small"===s),r),n),p=i.treeCheckable;return p&&(p=React.createElement("span",{className:l+"-tree-checkbox-inner"})),React.createElement(RcTreeSelect,_extends({},i,{prefixCls:l,className:m,dropdownStyle:_extends({maxHeight:"100vh",overflow:"auto"},a),treeCheckable:p,notFoundContent:c||e.notFoundContent,ref:t.saveTreeSelect}))},warning(!1!==e.multiple||!e.treeCheckable,"`multiple` will alway be `true` when `treeCheckable` is true"),t}return _inherits(r,e),_createClass(r,[{key:"focus",value:function(){this.rcTreeSelect.focus()}},{key:"blur",value:function(){this.rcTreeSelect.blur()}},{key:"render",value:function(){return React.createElement(LocaleReceiver,{componentName:"Select",defaultLocale:{}},this.renderTreeSelect)}}]),r}(React.Component);export default TreeSelect;TreeSelect.TreeNode=TreeNode,TreeSelect.SHOW_ALL=SHOW_ALL,TreeSelect.SHOW_PARENT=SHOW_PARENT,TreeSelect.SHOW_CHILD=SHOW_CHILD,TreeSelect.defaultProps={prefixCls:"dt-select",transitionName:"slide-up",choiceTransitionName:"zoom",showSearch:!1,dropdownClassName:"dt-select-tree-dropdown"};