<commit_before>import SimpleWrapper from './SimpleWrapper.jsx';
import React from 'react';
import ReactDOM from 'react-dom';

const EVENT_TYPES = ['change', 'input'];

/**
 * @original ons-range
 * @category input
 * @tutorial react/Reference/input
 * @description
 * [en]
 *   Range input component.
 * [/en]
 * [jp][/jp]
 * @example
 * <Range modifier="material"
 *   value={this.state.value}
 *   onChange={(event) => this.setState({value: parseInt(event.target.value)})}
 *   />
 */
class Range extends SimpleWrapper {

  componentDidMount() {
    super.componentDidMount();
    var node = ReactDOM.findDOMNode(this);

    EVENT_TYPES.forEach((eventType) => {
      node.addEventListener(eventType, this.props.onChange);
    });
  }

  componentWillUnmount() {
    var node = ReactDOM.findDOMNode(this);

    EVENT_TYPES.forEach((eventType) => {
      node.removeEventListener(eventType, this.props.onChange);
    });
  }

  _getDomNodeName() {
    return 'ons-range';
  }
};

Range.propTypes = {
  /**
   * @name modifier
   * @type string
   * @required false
   * @description<commit_msg>Fix `value` prop of `Range` component. Closes #72.<commit_after>import SimpleWrapper from './SimpleWrapper.jsx';
import React from 'react';
import ReactDOM from 'react-dom';

const EVENT_TYPES = ['change', 'input'];

/**
 * @original ons-range
 * @category input
 * @tutorial react/Reference/input
 * @description
 * [en]
 *   Range input component.
 * [/en]
 * [jp][/jp]
 * @example
 * <Range modifier="material"
 *   value={this.state.value}
 *   onChange={(event) => this.setState({value: parseInt(event.target.value)})}
 *   />
 */
class Range extends SimpleWrapper {

  componentDidMount() {
    super.componentDidMount();
    var node = ReactDOM.findDOMNode(this);

    EVENT_TYPES.forEach((eventType) => {
      node.addEventListener(eventType, this.props.onChange);
    });
  }

  componentWillUnmount() {
    var node = ReactDOM.findDOMNode(this);

    EVENT_TYPES.forEach((eventType) => {
      node.removeEventListener(eventType, this.props.onChange);
    });
  }

  componentWillReceiveProps(props) {
    const node = ReactDOM.findDOMNode(this);
    node.value = props.value;
  }

  _getDomNodeName() {
    return 'ons-range';
  }
};

Range.propTypes = {
  /**
   * @name modifier
   * @type string
   * @required false
   * @description
{'fraction_non_alphanumeric': 0.15443686006825938, 'fraction_numerical': 0.0008532423208191126, 'mean_word_length': 3.580078125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4592428', 'n_tokens_mistral': 767, 'n_tokens_neox': 753, 'n_words': 144}