react-autosize-textarea
Advanced tools
Comparing version 0.3.6 to 0.4.0
@@ -5,2 +5,9 @@ # Change Log | ||
## [v0.4.0](https://github.com/buildo/react-autosize-textarea/tree/v0.4.0) (2017-03-30) | ||
[Full Changelog](https://github.com/buildo/react-autosize-textarea/compare/v0.3.6...v0.4.0) | ||
#### Breaking: | ||
- Remove react-tcomb [#30](https://github.com/buildo/react-autosize-textarea/issues/30) | ||
## [v0.3.6](https://github.com/buildo/react-autosize-textarea/tree/v0.3.6) (2017-01-22) | ||
@@ -7,0 +14,0 @@ [Full Changelog](https://github.com/buildo/react-autosize-textarea/compare/v0.3.5...v0.3.6) |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.default = exports.Props = undefined; | ||
exports.default = undefined; | ||
@@ -13,3 +13,3 @@ 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; }; | ||
var _dec, _class, _class2, _temp2; | ||
var _class, _temp2; | ||
@@ -24,4 +24,2 @@ var _react = require('react'); | ||
var _tcombReact = require('tcomb-react'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -41,8 +39,2 @@ | ||
var Props = exports.Props = { | ||
rows: _tcombReact.t.maybe(_tcombReact.t.Integer), | ||
maxRows: _tcombReact.t.maybe(_tcombReact.t.Integer), | ||
onResize: _tcombReact.t.maybe(_tcombReact.t.Function) | ||
}; | ||
/** A light replacement for built-in textarea component | ||
@@ -54,3 +46,3 @@ * which automaticaly adjusts its height to match the content | ||
*/ | ||
var TextareaAutosize = (_dec = (0, _tcombReact.props)(Props, { strict: false }), _dec(_class = (_temp2 = _class2 = function (_React$Component) { | ||
var TextareaAutosize = (_temp2 = _class = function (_React$Component) { | ||
_inherits(TextareaAutosize, _React$Component); | ||
@@ -86,3 +78,3 @@ | ||
return _tcombReact.t.Number.is(maxRows) && numberOfRows >= maxRows; | ||
return numberOfRows >= parseInt(maxRows); | ||
}, _this.updateMaxHeight = function (value) { | ||
@@ -202,5 +194,12 @@ var _this2 = _this, | ||
return TextareaAutosize; | ||
}(_react2.default.Component), _class2.defaultProps = { | ||
}(_react2.default.Component), _class.defaultProps = { | ||
rows: 1 | ||
}, _temp2)) || _class); | ||
exports.default = TextareaAutosize; | ||
}, _temp2); | ||
exports.default = TextareaAutosize; | ||
TextareaAutosize.propTypes = { | ||
rows: _react2.default.PropTypes.number, | ||
maxRows: _react2.default.PropTypes.number, | ||
onResize: _react2.default.PropTypes.func | ||
}; |
{ | ||
"name": "react-autosize-textarea", | ||
"version": "0.3.6", | ||
"version": "0.4.0", | ||
"description": "replacement for built-in textarea which auto resizes itself", | ||
"main": "index.js", | ||
"main": "lib", | ||
"scripts": { | ||
@@ -15,3 +15,4 @@ "test": "npm run build && ./node_modules/karma/bin/karma start", | ||
"clean": "rm -f examples/bundle.js examples/bundle.js.map", | ||
"generate-readme": "node ./generateReadme.js" | ||
"generate-readme": "node ./generateReadme.js", | ||
"release-version": "smooth-release" | ||
}, | ||
@@ -37,2 +38,7 @@ "repository": { | ||
}, | ||
"files": [ | ||
"lib", | ||
"src", | ||
"examples" | ||
], | ||
"homepage": "https://github.com/buildo/react-autosize-textarea", | ||
@@ -65,2 +71,3 @@ "devDependencies": { | ||
"require-dir": "^0.3.0", | ||
"smooth-release": "^8.0.0", | ||
"webpack": "^1.12.12", | ||
@@ -74,5 +81,4 @@ "webpack-dev-server": "^1.14.1" | ||
"dependencies": { | ||
"autosize": "^3.0.15", | ||
"tcomb-react": "^0.9.3" | ||
"autosize": "^3.0.15" | ||
} | ||
} |
import React from 'react'; | ||
import autosize from 'autosize'; | ||
import { t, props } from 'tcomb-react'; | ||
@@ -9,7 +8,2 @@ const UPDATE = 'autosize:update', | ||
export const Props = { | ||
rows: t.maybe(t.Integer), | ||
maxRows: t.maybe(t.Integer), | ||
onResize: t.maybe(t.Function) | ||
}; | ||
@@ -22,3 +16,2 @@ /** A light replacement for built-in textarea component | ||
*/ | ||
@props(Props, { strict: false }) | ||
export default class TextareaAutosize extends React.Component { | ||
@@ -73,3 +66,3 @@ | ||
return t.Number.is(maxRows) && numberOfRows >= maxRows; | ||
return numberOfRows >= parseInt(maxRows); | ||
} | ||
@@ -146,1 +139,7 @@ | ||
} | ||
TextareaAutosize.propTypes = { | ||
rows: React.PropTypes.number, | ||
maxRows: React.PropTypes.number, | ||
onResize: React.PropTypes.func | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
178564
28
19
978
1
- Removedtcomb-react@^0.9.3
- Removeddoctrine@0.7.2(transitive)
- Removedesutils@1.1.6(transitive)
- Removedget-comments@1.0.1(transitive)
- Removedisarray@0.0.1(transitive)
- Removedtcomb@3.2.29(transitive)
- Removedtcomb-doc@0.5.2(transitive)
- Removedtcomb-react@0.9.3(transitive)
- Removedtcomb-validation@3.4.1(transitive)