import React,{ Component } from "react"; import { WordsBtn } from "educoder"; import { Checkbox } from 'antd' const CheckboxGroup = Checkbox.Group; class CheckAllGroup extends Component{ constructor(props){ super(props); this.state = { checkAll: true, checkedValues: [] } } onCheckAll = () => { this.setState({ 'checkAll': true, checkedValues: [] }) this.props.onChange && this.props.onChange([], true); } onChange = (checkedValues) => { if (checkedValues.length > 0 && checkedValues.length != this.props.options.length) { this.setState({ 'checkAll': false, checkedValues }) this.props.onChange && this.props.onChange(checkedValues, false) } else { this.setState({ 'checkAll': true, checkedValues: [] }) this.props.onChange && this.props.onChange(checkedValues, true); } console.log(checkedValues, arguments) } render() { let { label, options, checkboxGroupStyle }=this.props; const { checkAll, checkedValues } = this.state; return (