<commit_before>import React, { PropTypes } from "react";
import cx from "classNames";
import { InputCore } from "../input";

/**
 * Simple component for a basic checkbox
 */
class Checkbox extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      checked: this.props.checked || false
    };
  }

  // Handles new checkbox clicks and sets value and checked status of hidden input
  _clickHandler = event => {
    if (this.state.checked === true) {
      this.setState({ checked: false });
    } else {
      this.setState({ checked: true });
    }

    /* Check if onClick has been passed, if so call it. */
    if (this.props.onClick) {
      this.props.onClick(event);
    }
  };
<commit_msg>Pass event and data object to onClick handler.<commit_after>import React, { PropTypes } from "react";
import cx from "classNames";
import { InputCore } from "../input";

/**
 * Simple component for a basic checkbox
 */
class Checkbox extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      checked: this.props.checked || false
    };
  }

  // Handles new checkbox clicks and sets value and checked status of hidden input
  _clickHandler = event => {
    if (this.state.checked === true) {
      this.setState({ checked: false });
    } else {
      this.setState({ checked: true });
    }

    /* Check if onClick has been passed, if so call it. */
    if (this.props.onClick) {
      /* Pass the event object, and a data object to the click handler.
       The data object contains a boolean for whether the checkbox was
       clicked or not, plus all the props passed to the object.  */
      this.props.onClick(event, {"checked": this.state.checked, "props": this.state.checked});
    }
  };

{'fraction_non_alphanumeric': 0.12047511312217195, 'fraction_numerical': 0.0, 'mean_word_length': 2.796137339055794, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2268626', 'n_tokens_mistral': 504, 'n_tokens_neox': 499, 'n_words': 179}