<commit_before>/* eslint jsx-a11y/no-static-element-interactions: "off" */
/* eslint react/forbid-prop-types: "off" */
/* eslint class-methods-use-this: "off" */

import React from 'react';
import color from 'color';
import PropTypes from 'prop-types';
import styledComonent from '../shared/styledComponent';
import Base from './Base';
import Checkbox from './Checkbox';
import TableCell from './TableCell';
import TableRow from './TableRow';

export default class DataTable extends Base {

  static propTypes = {
    columns: PropTypes.shape({
      order: PropTypes.array,
      width: PropTypes.array,
    }),
    filterRecords: PropTypes.array,
    headers: PropTypes.object,
    multiselectRowKey: PropTypes.string,
    noRecordsText: PropTypes.string,
    orderBy: PropTypes.shape({
      column: PropTypes.string,
      direction: PropTypes.oneOf(['asc', 'desc']),
      /* Strings and numbers are supported by default and do not need explicit format config.
        Use date for any dates, must be pure date (Yes: 10/20/1994 No: Updated: 10/20/1994)
      */
      formatter: PropTypes.oneOf(['date']),
      getSortValue: PropTypes.func,
    }),
    onClick: PropTypes.func,
    onHeaderClick: PropTypes.func,
    onChange: PropTypes.func,
    records: PropTypes.array,
    recordInclusion: PropTypes.array,
    returnAllRecordsOnClick: PropTypes.bool,
    selectedColumn: PropTypes.string,
    selectedRows: PropTypes.arrayOf(PropTypes.string),
  }

  static defaultProps = {
    noRecordsText: 'No records found.',
    multiselectRowKey: '',
    onClick: () => {},
    onChange: () => {},
    onHeaderClick: () => {},
    records: [],
    selectedRows: [],
  };

  displayName = 'DataTable';

  constructor() {
    super();
    this.state = {
      hoveredRow: null,
      isRowHovering: false,
    };
  }

  includeSubRecords = (record) => {
    const filteredRecord = {};
    Object.getOwnPropertyNames(record).forEach((val) => {<commit_msg>fix(Component-DataTable): DataTable onClick defaults to null, preventing hover (#43)<commit_after>/* eslint jsx-a11y/no-static-element-interactions: "off" */
/* eslint react/forbid-prop-types: "off" */
/* eslint class-methods-use-this: "off" */

import React from 'react';
import color from 'color';
import PropTypes from 'prop-types';
import styledComonent from '../shared/styledComponent';
import Base from './Base';
import Checkbox from './Checkbox';
import TableCell from './TableCell';
import TableRow from './TableRow';

export default class DataTable extends Base {

  static propTypes = {
    columns: PropTypes.shape({
      order: PropTypes.array,
      width: PropTypes.array,
    }),
    filterRecords: PropTypes.array,
    headers: PropTypes.object,
    multiselectRowKey: PropTypes.string,
    noRecordsText: PropTypes.string,
    orderBy: PropTypes.shape({
      column: PropTypes.string,
      direction: PropTypes.oneOf(['asc', 'desc']),
      /* Strings and numbers are supported by default and do not need explicit format config.
        Use date for any dates, must be pure date (Yes: 10/20/1994 No: Updated: 10/20/1994)
      */
      formatter: PropTypes.oneOf(['date']),
      getSortValue: PropTypes.func,
    }),
    onClick: PropTypes.func,
    onHeaderClick: PropTypes.func,
    onChange: PropTypes.func,
    records: PropTypes.array,
    recordInclusion: PropTypes.array,
    returnAllRecordsOnClick: PropTypes.bool,
    selectedColumn: PropTypes.string,
    selectedRows: PropTypes.arrayOf(PropTypes.string),
  }

  static defaultProps = {
    noRecordsText: 'No records found.',
    multiselectRowKey: '',
    onClick: null,
    onChange: () => {},
    onHeaderClick: () => {},
    records: [],
    selectedRows: [],
  };

  displayName = 'DataTable';

  constructor() {
    super();
    this.state = {
      hoveredRow: null,
      isRowHovering: false,
    };
  }

  includeSubRecords = (record) => {
    const filteredRecord = {};
    Object.getOwnPropertyNames(record).forEach((val) => {
{'fraction_non_alphanumeric': 0.13232704402515724, 'fraction_numerical': 0.009559748427672956, 'mean_word_length': 3.3788546255506606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '7221522', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1182, 'n_words': 299}