Socket
Socket
Sign inDemoInstall

react-textarea-autosize

Package Overview
Dependencies
1
Maintainers
4
Versions
98
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.3 to 6.1.0-0

4

dist/react-textarea-autosize.cjs.js

@@ -382,3 +382,3 @@ 'use strict';

_proto.componentWillReceiveProps = function componentWillReceiveProps() {
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
var _this3 = this;

@@ -391,5 +391,3 @@

});
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
if (this.state.height !== prevState.height) {

@@ -396,0 +394,0 @@ this.props.onHeightChange(this.state.height, this);

@@ -376,3 +376,3 @@ import React from 'react';

_proto.componentWillReceiveProps = function componentWillReceiveProps() {
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
var _this3 = this;

@@ -385,5 +385,3 @@

});
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
if (this.state.height !== prevState.height) {

@@ -390,0 +388,0 @@ this.props.onHeightChange(this.state.height, this);

@@ -1228,3 +1228,3 @@ (function (global, factory) {

_proto.componentWillReceiveProps = function componentWillReceiveProps() {
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
var _this3 = this;

@@ -1237,5 +1237,3 @@

});
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
if (this.state.height !== prevState.height) {

@@ -1242,0 +1240,0 @@ this.props.onHeightChange(this.state.height, this);

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.TextareaAutosize={},e.React)}(this,function(e,t){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t=t&&t.hasOwnProperty("default")?t.default:t;var r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e};"object"==typeof Reflect&&Reflect;function o(e){return function(){return e}}var i=function(){};i.thatReturns=o,i.thatReturnsFalse=o(!1),i.thatReturnsTrue=o(!0),i.thatReturnsNull=o(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e};var a=i;var s=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[n,r,o,i,a,s],h=0;(u=Error(t.replace(/%s/g,function(){return p[h++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},u=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;10>n;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}();var l,c="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",d=(function(e){e.exports=function(){function e(e,t,n,r,o,i){i!==c&&s(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=a,n.PropTypes=n,n}()}(l={exports:{}},l.exports),l.exports),f="undefined"!=typeof window&&"undefined"!=typeof document,m=!!f&&!!document.documentElement.currentStyle,g={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},b=["letter-spacing","line-height","font-family","font-weight","font-size","font-style","tab-size","text-rendering","text-transform","width","text-indent","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","box-sizing"],y={},v=f&&document.createElement("textarea"),_=function(e){Object.keys(g).forEach(function(t){e.style.setProperty(t,g[t],"important")})};function w(e,t,n,r,o){void 0===n&&(n=!1),void 0===r&&(r=null),void 0===o&&(o=null),null===v.parentNode&&document.body.appendChild(v);var i=function(e,t,n){void 0===n&&(n=!1);if(n&&y[t])return y[t];var r=window.getComputedStyle(e);if(null===r)return null;var o=b.reduce(function(e,t){return e[t]=r.getPropertyValue(t),e},{}),i=o["box-sizing"];if(""===i)return null;m&&"border-box"===i&&(o.width=parseFloat(o.width)+parseFloat(r["border-right-width"])+parseFloat(r["border-left-width"])+parseFloat(r["padding-right"])+parseFloat(r["padding-left"])+"px");var a={sizingStyle:o,paddingSize:parseFloat(o["padding-bottom"])+parseFloat(o["padding-top"]),borderSize:parseFloat(o["border-bottom-width"])+parseFloat(o["border-top-width"]),boxSizing:i};n&&(y[t]=a);return a}(e,t,n);if(null===i)return null;var a=i.paddingSize,s=i.borderSize,u=i.boxSizing,p=i.sizingStyle;Object.keys(p).forEach(function(e){v.style[e]=p[e]}),_(v),v.value=e.value||e.placeholder||"x";var h=-1/0,l=1/0,c=v.scrollHeight;"border-box"===u?c+=s:"content-box"===u&&(c-=a),v.value="x";var d=v.scrollHeight-a;return null===r&&null===o||(null!==r&&(h=d*r,"border-box"===u&&(h=h+a+s),c=Math.max(h,c)),null!==o&&(l=d*o,"border-box"===u&&(l=l+a+s),c=Math.min(l,c))),{height:c,minHeight:h,maxHeight:l,rowCount:Math.floor(c/d)}}f&&_(v);var x,O=(void 0===x&&(x=0),function(){return++x}),C=function(){},z=f&&window.requestAnimationFrame?[window.requestAnimationFrame,window.cancelAnimationFrame]:[setTimeout,clearTimeout],R=z[0],j=z[1],F=function(e){var r,o;function i(t){var n;return(n=e.call(this,t)||this)._resizeLock=!1,n._onRootDOMNode=function(e){n._rootDOMNode=e,n.props.inputRef&&n.props.inputRef(e)},n._onChange=function(e){n._controlled||n._resizeComponent(),n.props.onChange(e)},n._resizeComponent=function(e){if(void 0===e&&(e=C),void 0!==n._rootDOMNode){var t=w(n._rootDOMNode,n._uid,n.props.useCacheForDOMMeasurements,n.props.minRows,n.props.maxRows);if(null!==t){var r=t.height,o=t.minHeight,i=t.maxHeight;n.rowCount=t.rowCount,n.state.height===r&&n.state.minHeight===o&&n.state.maxHeight===i?e():n.setState({height:r,minHeight:o,maxHeight:i},e)}else e()}else e()},n.state={height:t.style&&t.style.height||0,minHeight:-1/0,maxHeight:1/0},n._uid=O(),n._controlled="string"==typeof t.value,n}(r=i).prototype=Object.create((o=e).prototype),r.prototype.constructor=r,r.__proto__=o;var a=i.prototype;return a.render=function(){var e=this.props,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;a.length>r;r++)0>t.indexOf(n=a[r])&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["minRows","maxRows","onHeightChange","useCacheForDOMMeasurements","inputRef"]);return r.style=n({},r.style,{height:this.state.height}),this.state.height>Math.max(r.style.maxHeight||1/0,this.state.maxHeight)&&(r.style.overflow="hidden"),t.createElement("textarea",n({},r,{onChange:this._onChange,ref:this._onRootDOMNode}))},a.componentDidMount=function(){var e=this;this._resizeComponent(),this._resizeListener=function(){e._resizeLock||(e._resizeLock=!0,e._resizeComponent(function(){return e._resizeLock=!1}))},window.addEventListener("resize",this._resizeListener)},a.componentWillReceiveProps=function(){var e=this;this._clearNextFrame(),this._onNextFrameActionId=R(function(){return e._resizeComponent()})},a.componentDidUpdate=function(e,t){this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},a.componentWillUnmount=function(){this._clearNextFrame(),window.removeEventListener("resize",this._resizeListener),delete y[this._uid]},a._clearNextFrame=function(){j(this._onNextFrameActionId)},i}(t.Component);F.propTypes={value:d.string,onChange:d.func,onHeightChange:d.func,useCacheForDOMMeasurements:d.bool,minRows:d.number,maxRows:d.number,inputRef:d.func},F.defaultProps={onChange:C,onHeightChange:C,useCacheForDOMMeasurements:!1},e.default=F,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.TextareaAutosize={},e.React)}(this,function(e,t){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t=t&&t.hasOwnProperty("default")?t.default:t;var r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e};"object"==typeof Reflect&&Reflect;function o(e){return function(){return e}}var i=function(){};i.thatReturns=o,i.thatReturnsFalse=o(!1),i.thatReturnsTrue=o(!0),i.thatReturnsNull=o(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e};var a=i;var s=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[n,r,o,i,a,s],p=0;(u=Error(t.replace(/%s/g,function(){return h[p++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},u=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;10>n;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}();var l,c="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",d=(function(e){e.exports=function(){function e(e,t,n,r,o,i){i!==c&&s(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=a,n.PropTypes=n,n}()}(l={exports:{}},l.exports),l.exports),f="undefined"!=typeof window&&"undefined"!=typeof document,g=!!f&&!!document.documentElement.currentStyle,m={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},b=["letter-spacing","line-height","font-family","font-weight","font-size","font-style","tab-size","text-rendering","text-transform","width","text-indent","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","box-sizing"],y={},v=f&&document.createElement("textarea"),_=function(e){Object.keys(m).forEach(function(t){e.style.setProperty(t,m[t],"important")})};function w(e,t,n,r,o){void 0===n&&(n=!1),void 0===r&&(r=null),void 0===o&&(o=null),null===v.parentNode&&document.body.appendChild(v);var i=function(e,t,n){void 0===n&&(n=!1);if(n&&y[t])return y[t];var r=window.getComputedStyle(e);if(null===r)return null;var o=b.reduce(function(e,t){return e[t]=r.getPropertyValue(t),e},{}),i=o["box-sizing"];if(""===i)return null;g&&"border-box"===i&&(o.width=parseFloat(o.width)+parseFloat(r["border-right-width"])+parseFloat(r["border-left-width"])+parseFloat(r["padding-right"])+parseFloat(r["padding-left"])+"px");var a={sizingStyle:o,paddingSize:parseFloat(o["padding-bottom"])+parseFloat(o["padding-top"]),borderSize:parseFloat(o["border-bottom-width"])+parseFloat(o["border-top-width"]),boxSizing:i};n&&(y[t]=a);return a}(e,t,n);if(null===i)return null;var a=i.paddingSize,s=i.borderSize,u=i.boxSizing,h=i.sizingStyle;Object.keys(h).forEach(function(e){v.style[e]=h[e]}),_(v),v.value=e.value||e.placeholder||"x";var p=-1/0,l=1/0,c=v.scrollHeight;"border-box"===u?c+=s:"content-box"===u&&(c-=a),v.value="x";var d=v.scrollHeight-a;return null===r&&null===o||(null!==r&&(p=d*r,"border-box"===u&&(p=p+a+s),c=Math.max(p,c)),null!==o&&(l=d*o,"border-box"===u&&(l=l+a+s),c=Math.min(l,c))),{height:c,minHeight:p,maxHeight:l,rowCount:Math.floor(c/d)}}f&&_(v);var x,O=(void 0===x&&(x=0),function(){return++x}),C=function(){},z=f&&window.requestAnimationFrame?[window.requestAnimationFrame,window.cancelAnimationFrame]:[setTimeout,clearTimeout],j=z[0],R=z[1],F=function(e){var r,o;function i(t){var n;return(n=e.call(this,t)||this)._resizeLock=!1,n._onRootDOMNode=function(e){n._rootDOMNode=e,n.props.inputRef&&n.props.inputRef(e)},n._onChange=function(e){n._controlled||n._resizeComponent(),n.props.onChange(e)},n._resizeComponent=function(e){if(void 0===e&&(e=C),void 0!==n._rootDOMNode){var t=w(n._rootDOMNode,n._uid,n.props.useCacheForDOMMeasurements,n.props.minRows,n.props.maxRows);if(null!==t){var r=t.height,o=t.minHeight,i=t.maxHeight;n.rowCount=t.rowCount,n.state.height===r&&n.state.minHeight===o&&n.state.maxHeight===i?e():n.setState({height:r,minHeight:o,maxHeight:i},e)}else e()}else e()},n.state={height:t.style&&t.style.height||0,minHeight:-1/0,maxHeight:1/0},n._uid=O(),n._controlled="string"==typeof t.value,n}(r=i).prototype=Object.create((o=e).prototype),r.prototype.constructor=r,r.__proto__=o;var a=i.prototype;return a.render=function(){var e=this.props,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;i.length>r;r++)0>t.indexOf(n=i[r])&&(o[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;a.length>r;r++)0>t.indexOf(n=a[r])&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["minRows","maxRows","onHeightChange","useCacheForDOMMeasurements","inputRef"]);return r.style=n({},r.style,{height:this.state.height}),this.state.height>Math.max(r.style.maxHeight||1/0,this.state.maxHeight)&&(r.style.overflow="hidden"),t.createElement("textarea",n({},r,{onChange:this._onChange,ref:this._onRootDOMNode}))},a.componentDidMount=function(){var e=this;this._resizeComponent(),this._resizeListener=function(){e._resizeLock||(e._resizeLock=!0,e._resizeComponent(function(){return e._resizeLock=!1}))},window.addEventListener("resize",this._resizeListener)},a.componentDidUpdate=function(e,t){var n=this;this._clearNextFrame(),this._onNextFrameActionId=j(function(){return n._resizeComponent()}),this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},a.componentWillUnmount=function(){this._clearNextFrame(),window.removeEventListener("resize",this._resizeListener),delete y[this._uid]},a._clearNextFrame=function(){R(this._onNextFrameActionId)},i}(t.Component);F.propTypes={value:d.string,onChange:d.func,onHeightChange:d.func,useCacheForDOMMeasurements:d.bool,minRows:d.number,maxRows:d.number,inputRef:d.func},F.defaultProps={onChange:C,onHeightChange:C,useCacheForDOMMeasurements:!1},e.default=F,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "react-textarea-autosize",
"description": "textarea component for React which grows with content",
"version": "6.0.3",
"version": "6.1.0-0",
"keywords": "autosize, grow, react, react-component, textarea",

@@ -16,3 +16,3 @@ "repository": "andreypopp/react-textarea-autosize",

"build": "rollup -c",
"docs:build": "cross-env BABEL_ENV=es NODE_ENV=development rollup -c example/rollup.config.js -i example/index.js -o example/bundle.js",
"docs:build": "cross-env BABEL_ENV=es NODE_ENV=development rollup -c example/rollup.config.js",
"docs:publish": "npm run docs:build && cd example && rimraf .git && git init && git commit --allow-empty -m 'update docs' && git checkout -b gh-pages && touch .nojekyll && git add . && git commit -am 'update docs' && git push git@github.com:andreypopp/react-textarea-autosize gh-pages --force",

@@ -19,0 +19,0 @@ "clean": "rimraf dist",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc