"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends2=require("babel-runtime/helpers/extends"),_extends3=_interopRequireDefault(_extends2),_defineProperty2=require("babel-runtime/helpers/defineProperty"),_defineProperty3=_interopRequireDefault(_defineProperty2),_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),_propTypes=require("prop-types"),PropTypes=_interopRequireWildcard(_propTypes),_rcSwitch=require("rc-switch"),_rcSwitch2=_interopRequireDefault(_rcSwitch),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames),_omit=require("omit.js"),_omit2=_interopRequireDefault(_omit);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var Switch=function(e){function t(){(0,_classCallCheck3.default)(this,t);var r=(0,_possibleConstructorReturn3.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return r.saveSwitch=function(e){r.rcSwitch=e},r}return(0,_inherits3.default)(t,e),(0,_createClass3.default)(t,[{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,i=r.size,s=r.loading,l=r.className,a=void 0===l?"":l,u=(0,_classnames2.default)(a,(e={},(0,_defineProperty3.default)(e,t+"-small","small"===i),(0,_defineProperty3.default)(e,t+"-loading",s),e)),n="small"===i?(0,_extends3.default)({},(0,_omit2.default)(this.props,["loading","checkedChildren","unCheckedChildren"])):(0,_extends3.default)({},(0,_omit2.default)(this.props,["loading"]));return React.createElement(_rcSwitch2.default,(0,_extends3.default)({},n,{className:u,ref:this.saveSwitch}))}}]),t}(React.Component);(exports.default=Switch).defaultProps={prefixCls:"dt-switch"},Switch.propTypes={prefixCls:PropTypes.string,size:PropTypes.oneOf(["small","default","large"]),className:PropTypes.string},module.exports=exports.default;