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";import*as React from"react";import*as PropTypes from"prop-types";import RcSwitch from"rc-switch";import classNames from"classnames";import omit from"omit.js";var Switch=function(e){function r(){_classCallCheck(this,r);var e=_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments));return e.saveSwitch=function(r){e.rcSwitch=r},e}return _inherits(r,e),_createClass(r,[{key:"focus",value:function(){this.rcSwitch.focus()}},{key:"blur",value:function(){this.rcSwitch.blur()}},{key:"render",value:function(){var e,r=this.props,t=r.prefixCls,s=r.size,i=r.loading,o=r.className,l=classNames(void 0===o?"":o,(_defineProperty(e={},t+"-small","small"===s),_defineProperty(e,t+"-loading",i),e)),a=_extends({},omit(this.props,"small"===s?["loading","checkedChildren","unCheckedChildren"]:["loading"]));return React.createElement(RcSwitch,_extends({},a,{className:l,ref:this.saveSwitch}))}}]),r}(React.Component);export default Switch;Switch.defaultProps={prefixCls:"dt-switch"},Switch.propTypes={prefixCls:PropTypes.string,size:PropTypes.oneOf(["small","default","large"]),className:PropTypes.string};