<commit_before>import React from 'react'
import * as ReactAddons from 'react/addons'
import { FormWidgetInputForm } from './'
const ReactTransitionGroup = ReactAddons.addons.TransitionGroup

export default class FormWidgetInput extends React.Component {
  constructor(props, context) {
    super(props, context)
    this.state = {
      hasMouseOver: false,
      editing: this.props.initializeEditing
    }
  }

  handleMouseOver() {
    this.setState({hasMouseOver: true})
  }

  handleMouseOut() {
    this.setState({hasMouseOver: false})
  }

  handleClick(event) {
    if (this.props.configurable) {
      event.stopPropagation()
      event.preventDefault()
      this.setState({editing: true})
    }
  }

  handleCloseForm() {
    this.setState({editing: false})
  }

  renderForm() {
    const { uid } = this.props
    return (
      <ReactTransitionGroup>
        <FormWidgetInputForm {...this.props} onClose={::this.handleCloseForm} key={'form-' + uid} />
      </ReactTransitionGroup>
    )
  }

  renderInstructions() {
    const { configurable } = this.props
    if (configurable && this.state.hasMouseOver) {
      return (
        <div className="right">
          <i className="fa fa-pencil-square-o mr1" />
          Clique para editar
        </div>
      )
    }
  }

  renderInput() {
    const { field, editable, configurable, uid } = this.props

    return (
      <div className="mb3" onMouseEnter={::this.handleMouseOver} onMouseLeave={::this.handleMouseOut} style={(editable || configurable ? {cursor: 'pointer'} : null)} onClick={::this.handleClick}>
        <label className="block h4 caps bold mb1 left" style={(editable || configurable ? {cursor: 'pointer'} : null)}>{field.label}</label>
        { this.renderInstructions() }
        <input
          id={'input-' + uid}
          className="field-light block full-width h3"
          style={(editable || configurable ? {cursor: 'pointer'} : null)}
          placeholder={field.placeholder}
          type={field.kind}/>
      </div>
    )
  }

  render() {
    return (this.state.editing ? this.renderForm() : this.renderInput())
  }
}<commit_msg>[#100327136] ignore field kind, and set field type as text<commit_after>import React from 'react'
import * as ReactAddons from 'react/addons'
import { FormWidgetInputForm } from './'
const ReactTransitionGroup = ReactAddons.addons.TransitionGroup

export default class FormWidgetInput extends React.Component {
  constructor(props, context) {
    super(props, context)
    this.state = {
      hasMouseOver: false,
      editing: this.props.initializeEditing
    }
  }

  handleMouseOver() {
    this.setState({hasMouseOver: true})
  }

  handleMouseOut() {
    this.setState({hasMouseOver: false})
  }

  handleClick(event) {
    if (this.props.configurable) {
      event.stopPropagation()
      event.preventDefault()
      this.setState({editing: true})
    }
  }

  handleCloseForm() {
    this.setState({editing: false})
  }

  renderForm() {
    const { uid } = this.props
    return (
      <ReactTransitionGroup>
        <FormWidgetInputForm {...this.props} onClose={::this.handleCloseForm} key={'form-' + uid} />
      </ReactTransitionGroup>
    )
  }

  renderInstructions() {
    const { configurable } = this.props
    if (configurable && this.state.hasMouseOver) {
      return (
        <div className="right">
          <i className="fa fa-pencil-square-o mr1" />
          Clique para editar
        </div>
      )
    }
  }

  renderInput() {
    const { field, editable, configurable, uid } = this.props

    return (
      <div
        className="mb3"
        onMouseEnter={::this.handleMouseOver}
        onMouseLeave={::this.handleMouseOut}
        style={(editable || configurable ? {cursor: 'pointer'} : null)}
        onClick={::this.handleClick}>
        <label
          className="block h4 caps bold mb1 left"
          style={(editable || configurable ? {cursor: 'pointer'} : null)}>
          {field.label}{field.required ? ' *' : null}
        </label>
        { this.renderInstructions() }
        <input
          id={'input-' + uid}
          className="field-light block full-width h3"
          style={(editable || configurable ? {cursor: 'pointer'} : null)}
          placeholder={field.placeholder}
          type='text'
        />
      </div>
    )
  }

  render() {
    return (this.state.editing ? this.renderForm() : this.renderInput())
  }
}
{'fraction_non_alphanumeric': 0.13751699139102855, 'fraction_numerical': 0.004304485727231536, 'mean_word_length': 2.6976549413735342, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '5551983', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1330, 'n_words': 266}