<commit_before>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Row from './Row';
import HeaderCell from './HeaderCell';
import Checkbox from '../checkbox';
import cx from 'classnames';
import theme from './theme.css';

class HeaderRow extends PureComponent {
  static propTypes = {
    className: PropTypes.string,
    children: PropTypes.any,
    onSelectionChange: PropTypes.func,
    selectable: PropTypes.bool,
    selected: PropTypes.bool,
    sliceFrom: PropTypes.number,
    sliceTo: PropTypes.number,
  };

  render() {
    const { className, children, sliceFrom, sliceTo, onSelectionChange, selected, selectable, ...others } = this.props;

    const childrenArray = Array.isArray(children) ? children : [children];
    const childrenSliced = childrenArray.slice(sliceFrom, sliceTo);
    const classNames = cx(theme['header-row'], className);

    return (
      <Row backgroundColor="neutral" className={classNames} data-teamleader-ui="datagrid-header-row" {...others}>
        {selectable && (
          <HeaderCell flex="min-width">
            <Checkbox checked={selected} onChange={onSelectionChange} size="large" />
          </HeaderCell>
        )}
        {childrenSliced}
      </Row>
    );
  }
}

export default HeaderRow;
<commit_msg>HeaderRow: move static propTypes & defaultProps outside of the component class<commit_after>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Row from './Row';
import HeaderCell from './HeaderCell';
import Checkbox from '../checkbox';
import cx from 'classnames';
import theme from './theme.css';

class HeaderRow extends PureComponent {
  render() {
    const { className, children, sliceFrom, sliceTo, onSelectionChange, selected, selectable, ...others } = this.props;

    const childrenArray = Array.isArray(children) ? children : [children];
    const childrenSliced = childrenArray.slice(sliceFrom, sliceTo);
    const classNames = cx(theme['header-row'], className);

    return (
      <Row backgroundColor="neutral" className={classNames} data-teamleader-ui="datagrid-header-row" {...others}>
        {selectable && (
          <HeaderCell flex="min-width">
            <Checkbox checked={selected} onChange={onSelectionChange} size="large" />
          </HeaderCell>
        )}
        {childrenSliced}
      </Row>
    );
  }
}

HeaderRow.propTypes = {
  className: PropTypes.string,
  children: PropTypes.any,
  onSelectionChange: PropTypes.func,
  selectable: PropTypes.bool,
  selected: PropTypes.bool,
  sliceFrom: PropTypes.number,
  sliceTo: PropTypes.number,
};

export default HeaderRow;

{'fraction_non_alphanumeric': 0.12604087812263437, 'fraction_numerical': 0.0, 'mean_word_length': 3.7112299465240643, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1342027', 'n_tokens_mistral': 733, 'n_tokens_neox': 737, 'n_words': 192}