Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -37,6 +37,10 @@ var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
@@ -55,7 +59,7 @@ var _withStyles2 = _interopRequireDefault(_withStyles);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var rowsHeight = 24;
var ROWS_HEIGHT = 19;
var styles = exports.styles = {
root: {
@@ -88,56 +92,10 @@ var styles = exports.styles = {
}
};
var babelPluginFlowReactPropTypes_proptype_Props = {
/**
* Useful to extend the style applied to components.
*/
classes: require('prop-types').object,
/**
* @ignore
*/
className: require('prop-types').string,
/**
* @ignore
*/
defaultValue: require('prop-types').oneOfType([require('prop-types').string, require('prop-types').number]),
/**
* @ignore
*/
disabled: require('prop-types').bool,
/**
* @ignore
*/
onChange: require('prop-types').func,
/**
* Number of rows to display when multiline option is set to true.
*/
rows: require('prop-types').oneOfType([require('prop-types').string, require('prop-types').number]),
/**
* Maximum number of rows to display when multiline option is set to true.
*/
rowsMax: require('prop-types').oneOfType([require('prop-types').string, require('prop-types').number]),
/**
* Use that property to pass a ref callback to the native textarea element.
*/
textareaRef: require('prop-types').func,
/**
* @ignore
*/
value: require('prop-types').oneOfType([require('prop-types').string, require('prop-types').number])
};
/**
* @ignore - internal component.
*/
var Textarea = function (_React$Component) {
(0, _inherits3.default)(Textarea, _React$Component);
@@ -154,7 +112,7 @@ var Textarea = function (_React$Component) {
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Textarea.__proto__ || (0, _getPrototypeOf2.default)(Textarea)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
height: null
}, _this.handleResize = (0, _debounce2.default)(function (event) {
}, _this.shadow = null, _this.singlelineShadow = null, _this.input = null, _this.value = null, _this.handleResize = (0, _debounce2.default)(function (event) {
_this.syncHeightWithShadow(event);
}, 166), _this.handleRefInput = function (node) {
_this.input = node;
@@ -187,7 +145,7 @@ var Textarea = function (_React$Component) {
// so that it can check whether they are dirty
this.value = this.props.value || this.props.defaultValue || '';
this.setState({
height: Number(this.props.rows) * rowsHeight
height: Number(this.props.rows) * ROWS_HEIGHT
});
}
}, {
@@ -283,17 +241,56 @@ var Textarea = function (_React$Component) {
className: (0, _classnames2.default)(classes.textarea, className),
defaultValue: defaultValue,
value: value,
onChange: this.handleChange
}, other, {
onChange: this.handleChange,
ref: this.handleRefInput
}))
}, other))
);
}
}]);
return Textarea;
}(_react2.default.Component);
Textarea.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* Useful to extend the style applied to components.
*/
classes: _propTypes2.default.object.isRequired,
/**
* @ignore
*/
className: _propTypes2.default.string,
/**
* @ignore
*/
defaultValue: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
/**
* @ignore
*/
disabled: _propTypes2.default.bool,
/**
* @ignore
*/
onChange: _propTypes2.default.func,
/**
* Number of rows to display when multiline option is set to true.
*/
rows: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
/**
* Maximum number of rows to display when multiline option is set to true.
*/
rowsMax: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
/**
* Use that property to pass a ref callback to the native textarea element.
*/
textareaRef: _propTypes2.default.func,
/**
* @ignore
*/
value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number])
} : {};
Textarea.defaultProps = {
rows: 1
};
exports.default = (0, _withStyles2.default)(styles, { name: 'MuiTextarea' })(Textarea);