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*as ReactDOM from"react-dom";var InputElement=function(e){function t(){_classCallCheck(this,t);var e=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.focus=function(){e.ele.focus?e.ele.focus():ReactDOM.findDOMNode(e.ele).focus()},e.blur=function(){e.ele.blur?e.ele.blur():ReactDOM.findDOMNode(e.ele).blur()},e.saveRef=function(t){e.ele=t;var r=e.props.children.ref;"function"==typeof r&&r(t)},e}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){return React.cloneElement(this.props.children,_extends({},this.props,{ref:this.saveRef}),null)}}]),t}(React.Component);export default InputElement;