Socket
Socket
Sign inDemoInstall

react-textarea-autosize

Package Overview
Dependencies
6
Maintainers
4
Versions
98
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.1.0-0 to 6.1.0-1

29

dist/react-textarea-autosize.cjs.js

@@ -274,5 +274,3 @@ 'use strict';

if (_this.props.inputRef) {
_this.props.inputRef(node);
}
_this.props.inputRef(node);
};

@@ -338,8 +336,8 @@

var _props = this.props,
_inputRef = _props.inputRef,
_maxRows = _props.maxRows,
_minRows = _props.minRows,
_maxRows = _props.maxRows,
_onHeightChange = _props.onHeightChange,
_useCacheForDOMMeasurements = _props.useCacheForDOMMeasurements,
_inputRef = _props.inputRef,
props = _objectWithoutProperties(_props, ["minRows", "maxRows", "onHeightChange", "useCacheForDOMMeasurements", "inputRef"]);
props = _objectWithoutProperties(_props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);

@@ -387,7 +385,9 @@ props.style = _extends({}, props.style, {

this._clearNextFrame();
if (prevProps !== this.props) {
this._clearNextFrame();
this._onNextFrameActionId = onNextFrame(function () {
return _this3._resizeComponent();
});
this._onNextFrameActionId = onNextFrame(function () {
return _this3._resizeComponent();
});
}

@@ -414,11 +414,12 @@ if (this.state.height !== prevState.height) {

TextareaAutosize.propTypes = {
value: PropTypes.string,
inputRef: PropTypes.func,
maxRows: PropTypes.number,
minRows: PropTypes.number,
onChange: PropTypes.func,
onHeightChange: PropTypes.func,
useCacheForDOMMeasurements: PropTypes.bool,
minRows: PropTypes.number,
maxRows: PropTypes.number,
inputRef: PropTypes.func
value: PropTypes.string
};
TextareaAutosize.defaultProps = {
inputRef: noop,
onChange: noop,

@@ -425,0 +426,0 @@ onHeightChange: noop,

@@ -268,5 +268,3 @@ import React from 'react';

if (_this.props.inputRef) {
_this.props.inputRef(node);
}
_this.props.inputRef(node);
};

@@ -332,8 +330,8 @@

var _props = this.props,
_inputRef = _props.inputRef,
_maxRows = _props.maxRows,
_minRows = _props.minRows,
_maxRows = _props.maxRows,
_onHeightChange = _props.onHeightChange,
_useCacheForDOMMeasurements = _props.useCacheForDOMMeasurements,
_inputRef = _props.inputRef,
props = _objectWithoutProperties(_props, ["minRows", "maxRows", "onHeightChange", "useCacheForDOMMeasurements", "inputRef"]);
props = _objectWithoutProperties(_props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);

@@ -381,7 +379,9 @@ props.style = _extends({}, props.style, {

this._clearNextFrame();
if (prevProps !== this.props) {
this._clearNextFrame();
this._onNextFrameActionId = onNextFrame(function () {
return _this3._resizeComponent();
});
this._onNextFrameActionId = onNextFrame(function () {
return _this3._resizeComponent();
});
}

@@ -408,11 +408,12 @@ if (this.state.height !== prevState.height) {

TextareaAutosize.propTypes = {
value: PropTypes.string,
inputRef: PropTypes.func,
maxRows: PropTypes.number,
minRows: PropTypes.number,
onChange: PropTypes.func,
onHeightChange: PropTypes.func,
useCacheForDOMMeasurements: PropTypes.bool,
minRows: PropTypes.number,
maxRows: PropTypes.number,
inputRef: PropTypes.func
value: PropTypes.string
};
TextareaAutosize.defaultProps = {
inputRef: noop,
onChange: noop,

@@ -419,0 +420,0 @@ onHeightChange: noop,

@@ -1120,5 +1120,3 @@ (function (global, factory) {

if (_this.props.inputRef) {
_this.props.inputRef(node);
}
_this.props.inputRef(node);
};

@@ -1184,8 +1182,8 @@

var _props = this.props,
_inputRef = _props.inputRef,
_maxRows = _props.maxRows,
_minRows = _props.minRows,
_maxRows = _props.maxRows,
_onHeightChange = _props.onHeightChange,
_useCacheForDOMMeasurements = _props.useCacheForDOMMeasurements,
_inputRef = _props.inputRef,
props = _objectWithoutProperties(_props, ["minRows", "maxRows", "onHeightChange", "useCacheForDOMMeasurements", "inputRef"]);
props = _objectWithoutProperties(_props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);

@@ -1233,7 +1231,9 @@ props.style = _extends({}, props.style, {

this._clearNextFrame();
if (prevProps !== this.props) {
this._clearNextFrame();
this._onNextFrameActionId = onNextFrame(function () {
return _this3._resizeComponent();
});
this._onNextFrameActionId = onNextFrame(function () {
return _this3._resizeComponent();
});
}

@@ -1260,11 +1260,12 @@ if (this.state.height !== prevState.height) {

TextareaAutosize.propTypes = {
value: propTypes.string,
inputRef: propTypes.func,
maxRows: propTypes.number,
minRows: propTypes.number,
onChange: propTypes.func,
onHeightChange: propTypes.func,
useCacheForDOMMeasurements: propTypes.bool,
minRows: propTypes.number,
maxRows: propTypes.number,
inputRef: propTypes.func
value: propTypes.string
};
TextareaAutosize.defaultProps = {
inputRef: noop,
onChange: noop,

@@ -1271,0 +1272,0 @@ onHeightChange: noop,

@@ -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 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})});
!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(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,["inputRef","maxRows","minRows","onHeightChange","useCacheForDOMMeasurements"]);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;e!==this.props&&(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={inputRef:d.func,maxRows:d.number,minRows:d.number,onChange:d.func,onHeightChange:d.func,useCacheForDOMMeasurements:d.bool,value:d.string},F.defaultProps={inputRef:C,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.1.0-0",
"version": "6.1.0-1",
"keywords": "autosize, grow, react, react-component, textarea",

@@ -6,0 +6,0 @@ "repository": "andreypopp/react-textarea-autosize",

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