react-form-controlled
Version:
Intuitive react forms for building powerful applications
32 lines (27 loc) • 1.29 kB
JavaScript
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import PropTypes from 'prop-types';
import Input from './Input';
export default class Textarea extends Input {
render() {
const _props = this.props,
{ path, debounce, type, group } = _props,
rest = _objectWithoutProperties(_props, ['path', 'debounce', 'type', 'group']);
const value = this.getValue();
return React.createElement('textarea', _extends({}, rest, {
className: this.getClassName(),
name: path,
onChange: (...args) => this.onChange(...args),
onFocus: this.onFocus,
onBlur: this.onBlur,
onKeyPress: this.onKeyPress,
value: value
}));
}
}
Textarea.propTypes = _extends({}, Input.propTypes, {
disabled: PropTypes.bool,
className: PropTypes.string
});
//# sourceMappingURL=Textarea.js.map