text: "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),_templateObject=_taggedTemplateLiteral(["\n  padding: 20px;\n  border-bottom: 1px solid #ccc;\n"],["\n  padding: 20px;\n  border-bottom: 1px solid #ccc;\n"]),_templateObject2=_taggedTemplateLiteral(["\n  padding: 10px 20px;\n"],["\n  padding: 10px 20px;\n"]),_react=require("react"),React=_interopRequireWildcard(_react),_index=require("../consts/index"),_index2=_interopRequireDefault(_index),_styledComponents=require("styled-components"),_styledComponents2=_interopRequireDefault(_styledComponents),_checkbox=require("./checkbox"),_checkbox2=_interopRequireDefault(_checkbox),_checkboxGroup=require("./checkbox-group"),_checkboxGroup2=_interopRequireDefault(_checkboxGroup);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _taggedTemplateLiteral(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var data=[{text:"Apple",value:"apple"},{text:"Pear",value:"pear"},{text:"Orange",value:"orange"}],CheckAll=_styledComponents2.default.div(_templateObject),Items=_styledComponents2.default.div(_templateObject2),_class=function(){function l(){var e,t,n;_classCallCheck(this,l);for(var r=arguments.length,a=Array(r),o=0;o<r;o++)a[o]=arguments[o];return(t=n=_possibleConstructorReturn(this,(e=l.__proto__||Object.getPrototypeOf(l)).call.apply(e,[this].concat(a)))).handleChange=function(e){n.setState({value:e,checked:e.length===data.length,indeterminate:!!e.length&&e.length<data.length})},n.handleCheckAll=function(){var e=n.state.checked;n.setState({value:e?[]:n.allValues,checked:!e,indeterminate:!1})},_possibleConstructorReturn(n,t)}return _inherits(l,React.Component),_createClass(l,[{key:"componentDidMount",value:function(){var t=this;this.allValues=[],data.map(function(e){t.allValues.push(e.value)})}},{key:"render",value:function(){var e=this.state,t=e.value,n=e.indeterminate,r=e.checked;return React.createElement("div",null,React.createElement(CheckAll,null,React.createElement(_checkbox2.default,{indeterminate:n,checked:r,onChange:this.handleCheckAll},"Check All")),React.createElement(Items,null,React.createElement(_checkboxGroup2.default,{data:data,value:t,onChange:this.handleChange})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(!t){var n=["pear"];return{value:n,indeterminate:!0,checked:n.length===data.length}}}}]),l}();exports.default=_class;