<commit_before>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { intlShape } from 'meteor/vulcan:i18n';
import { 
  Components, registerComponent, instantiateComponent,
  getHtmlInputProps
 } from 'meteor/vulcan:core';
import withStyles from '@material-ui/core/styles/withStyles';
import classNames from 'classnames';
import _omit from 'lodash/omit';


const styles = theme => ({
  
  formInput: {
    position: 'relative',
    marginBottom: theme.spacing.unit * 3,
    '&:last-child': {
      marginBottom: 0,
    }
  },
  
  halfWidthLeft: {
    display: 'inline-block',
    width: '48%',
    verticalAlign: 'top',
    marginRight: '4%',
  },
  
  halfWidthRight: {
    display: 'inline-block',
    width: '48%',
    verticalAlign: 'top',
  },
  
  thirdWidthLeft: {
    display: 'inline-block',
    width: '31%',
    verticalAlign: 'top',
    marginRight: '3.5%',
  },
  
  thirdWidthRight: {
    display: 'inline-block',
    width: '31%',
    verticalAlign: 'top',
  },
  
  hidden: {
    display: 'none',
  },
  
});


class FormComponentInner extends PureComponent {
  
  getProperties = () => {
    return _omit(
      getHtmlInputProps(this.props),
      'classes'
    );
  };
  
  render () {
    const {
      classes,
      inputClassName,
      name,
      input,
      hidden,
      beforeComponent,
      afterComponent,
      formInput,
      intlInput,
      nestedInput,
      formComponents,
    } = this.props;
  
    const FormComponents = formComponents;
    
    const inputClass = classNames(
      classes.formInput,
      hidden && classes.hidden,
      inputClassName && classes[inputClassName],
      `input-${name}`,
      `form-component-${input || 'default'}`
    );
    
    const properties = this.getProperties();
  
    const FormInput = formInput;
  
    if (intlInput) {
      return <Components.FormIntl {...properties} />;
    } else {
      return (
        <div className={inputClass}>
          {instantiateComponent(beforeComponent, properties)}
          <FormInput {...properties}/>
          {instantiateComponent(afterComponent, properties)}
        </div>
      );
    }
    
  }
}


FormComponentInner.contextTypes = {
  intl: intlShape,
};


FormComponentInner.propTypes = {
  classes: PropTypes.object.isRequired,
  inputClassName: PropTypes.string,
  name: PropTypes.string.isRequired,
  input: PropTypes.any,
  beforeComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
  afterComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
  errors: PropTypes.array.isRequired,
  help: PropTypes.node,
  onChange: PropTypes.func.isRequired,
  showCharsRemaining: PropTypes.bool.isRequired,
  charsRemaining: PropTypes.number,
  charsCount: PropTypes.number,
  max: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),
  formInput: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.object.isRequired]),
};


FormComponentInner.displayName = 'FormComponentInner';


registerComponent('FormComponentInner', FormComponentInner, [withStyles, styles]);
<commit_msg>FormComponentInner formInput prop change to avoid warning<commit_after>import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { intlShape } from 'meteor/vulcan:i18n';
import { 
  Components, registerComponent, instantiateComponent,
  getHtmlInputProps
 } from 'meteor/vulcan:core';
import withStyles from '@material-ui/core/styles/withStyles';
import classNames from 'classnames';
import _omit from 'lodash/omit';


const styles = theme => ({
  
  formInput: {
    position: 'relative',
    marginBottom: theme.spacing.unit * 3,
    '&:last-child': {
      marginBottom: 0,
    }
  },
  
  halfWidthLeft: {
    display: 'inline-block',
    width: '48%',
    verticalAlign: 'top',
    marginRight: '4%',
  },
  
  halfWidthRight: {
    display: 'inline-block',
    width: '48%',
    verticalAlign: 'top',
  },
  
  thirdWidthLeft: {
    display: 'inline-block',
    width: '31%',
    verticalAlign: 'top',
    marginRight: '3.5%',
  },
  
  thirdWidthRight: {
    display: 'inline-block',
    width: '31%',
    verticalAlign: 'top',
  },
  
  hidden: {
    display: 'none',
  },
  
});


class FormComponentInner extends PureComponent {
  
  getProperties = () => {
    return _omit(
      getHtmlInputProps(this.props),
      'classes'
    );
  };
  
  render () {
    const {
      classes,
      inputClassName,
      name,
      input,
      hidden,
      beforeComponent,
      afterComponent,
      formInput,
      intlInput,
      nestedInput,
      formComponents,
    } = this.props;
  
    const FormComponents = formComponents;
    
    const inputClass = classNames(
      classes.formInput,
      hidden && classes.hidden,
      inputClassName && classes[inputClassName],
      `input-${name}`,
      `form-component-${input || 'default'}`
    );
    
    const properties = this.getProperties();
  
    const FormInput = formInput;
  
    if (intlInput) {
      return <Components.FormIntl {...properties} />;
    } else {
      return (
        <div className={inputClass}>
          {instantiateComponent(beforeComponent, properties)}
          <FormInput {...properties}/>
          {instantiateComponent(afterComponent, properties)}
        </div>
      );
    }
    
  }
}


FormComponentInner.contextTypes = {
  intl: intlShape,
};


FormComponentInner.propTypes = {
  classes: PropTypes.object.isRequired,
  inputClassName: PropTypes.string,
  name: PropTypes.string.isRequired,
  input: PropTypes.any,
  beforeComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
  afterComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
  errors: PropTypes.array.isRequired,
  help: PropTypes.node,
  onChange: PropTypes.func.isRequired,
  showCharsRemaining: PropTypes.bool.isRequired,
  charsRemaining: PropTypes.number,
  charsCount: PropTypes.number,
  max: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),
  formInput: PropTypes.elementType.isRequired,
};


FormComponentInner.displayName = 'FormComponentInner';


registerComponent('FormComponentInner', FormComponentInner, [withStyles, styles]);

{'fraction_non_alphanumeric': 0.1276045873041512, 'fraction_numerical': 0.004845743821676627, 'mean_word_length': 3.1753202966958867, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '6616149', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1911, 'n_words': 365}