<commit_before>import React, { createElement } from 'react';
import PropTypes from 'prop-types';
import getStyle from './style';
import { getConfiguration } from '../../config';
import { GutterWidthContext } from '../Row';
import ScreenClassResolver from '../../context/ScreenClassResolver';

export default class Col extends React.PureComponent {
  renderCol = (gutterWidth, screenClass) => {
    const {
      children,
      xs,
      sm,
      md,
      lg,
      xl,
      offset,
      pull,
      push,
      debug,
      style,
      component,
      width,
      ...otherProps
    } = this.props;
    const theStyle = getStyle({
      forceWidth: width,
      width: {
        xs,
        sm,
        md,
        lg,
        xl,
      },
      offset,
      pull,
      push,
      debug,
      screenClass,
      gutterWidth,
      gridColumns: getConfiguration().gridColumns,
      moreStyle: style,
    });
    return createElement(component, { style: theStyle, ...otherProps, children });
  };

  render = () => (
    <ScreenClassResolver>
      {(screenClass) => (
        <GutterWidthContext.Consumer>
          {(gutterWidth) => this.renderCol(gutterWidth, screenClass)}
        </GutterWidthContext.Consumer>
      )}
    </ScreenClassResolver>
  );
}

Col.propTypes = {
  /**
   * Content of the column
   */
  children: PropTypes.node,
  /**
   * The width of the column for screenclass `xs`, either a number between 0 and 12, or "content"
   */
  xs: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `sm`, either a number between 0 and 12, or "content"
   */
  sm: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `md`, either a number between 0 and 12, or "content"
   */
  md: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `lg`, either a number between 0 and 12, or "content"
   */
  lg: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `xl`, either a number between 0 and 12, or "content"
   */
  xl: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `xl`, either a number between 0 and 12, or "content"
   */
  width: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.string,
  ]),
  /**
   * The offset of this column for all screenclasses
   */
  offset: PropTypes.shape({
    xs: PropTypes.number,
    sm: PropTypes.number,
    md: PropTypes.number,
    lg: PropTypes.number,
    xl: PropTypes.number,
  }),
  /**
   * The amount this column is pushed to the right for all screenclasses
   */
  push: PropTypes.shape({
    xs: PropTypes.number,
    sm: PropTypes.number,
    md: PropTypes.number,
    lg: PropTypes.number,
    xl: PropTypes.number,
  }),
  /**
   * The amount this column is pulled to the left for all screenclasses<commit_msg>fixed width<commit_after>import React, { createElement } from 'react';
import PropTypes from 'prop-types';
import getStyle from './style';
import { getConfiguration } from '../../config';
import { GutterWidthContext } from '../Row';
import ScreenClassResolver from '../../context/ScreenClassResolver';

export default class Col extends React.PureComponent {
  renderCol = (gutterWidth, screenClass) => {
    const {
      children,
      xs,
      sm,
      md,
      lg,
      xl,
      offset,
      pull,
      push,
      debug,
      style,
      component,
      width,
      ...otherProps
    } = this.props;
    const theStyle = getStyle({
      forceWidth: width,
      width: {
        xs,
        sm,
        md,
        lg,
        xl,
      },
      offset,
      pull,
      push,
      debug,
      screenClass,
      gutterWidth,
      gridColumns: getConfiguration().gridColumns,
      moreStyle: style,
    });
    return createElement(component, { style: theStyle, ...otherProps, children });
  };

  render = () => (
    <ScreenClassResolver>
      {(screenClass) => (
        <GutterWidthContext.Consumer>
          {(gutterWidth) => this.renderCol(gutterWidth, screenClass)}
        </GutterWidthContext.Consumer>
      )}
    </ScreenClassResolver>
  );
}

Col.propTypes = {
  /**
   * Content of the column
   */
  children: PropTypes.node,
  /**
   * The width of the column for screenclass `xs`, either a number between 0 and 12, or "content"
   */
  xs: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `sm`, either a number between 0 and 12, or "content"
   */
  sm: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `md`, either a number between 0 and 12, or "content"
   */
  md: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `lg`, either a number between 0 and 12, or "content"
   */
  lg: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * The width of the column for screenclass `xl`, either a number between 0 and 12, or "content"
   */
  xl: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.oneOf(['content']),
  ]),
  /**
   * A fixed width of the column for all screenclasses"
   */
  width: PropTypes.oneOfType([
    PropTypes.number,
    PropTypes.string,
  ]),
  /**
   * The offset of this column for all screenclasses
   */
  offset: PropTypes.shape({
    xs: PropTypes.number,
    sm: PropTypes.number,
    md: PropTypes.number,
    lg: PropTypes.number,
    xl: PropTypes.number,
  }),
  /**
   * The amount this column is pushed to the right for all screenclasses
   */
  push: PropTypes.shape({
    xs: PropTypes.number,
    sm: PropTypes.number,
    md: PropTypes.number,
    lg: PropTypes.number,
    xl: PropTypes.number,
  }),
  /**
   * The amount this column is pulled to the left for all screenclasses
{'fraction_non_alphanumeric': 0.12868242149562967, 'fraction_numerical': 0.00534153447717708, 'mean_word_length': 2.4713483146067414, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '6850518', 'n_tokens_mistral': 1897, 'n_tokens_neox': 1881, 'n_words': 542}