Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

tt-react-textarea-autosize

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tt-react-textarea-autosize - npm Package Compare versions

Comparing version 6.1.0-tt1 to 6.1.0-tt2

1

dist/react-textarea-autosize.cjs.js

@@ -93,2 +93,3 @@ 'use strict';

var forceHiddenStyles = function forceHiddenStyles(node) {
node.tabIndex = -1;
Object.keys(HIDDEN_TEXTAREA_STYLE).forEach(function (key) {

@@ -95,0 +96,0 @@ node.style.setProperty(key, HIDDEN_TEXTAREA_STYLE[key], 'important');

@@ -87,2 +87,3 @@ import React from 'react';

var forceHiddenStyles = function forceHiddenStyles(node) {
node.tabIndex = -1;
Object.keys(HIDDEN_TEXTAREA_STYLE).forEach(function (key) {

@@ -89,0 +90,0 @@ node.style.setProperty(key, HIDDEN_TEXTAREA_STYLE[key], 'important');

@@ -989,2 +989,3 @@ (function (global, factory) {

var forceHiddenStyles = function forceHiddenStyles(node) {
node.tabIndex = -1;
Object.keys(HIDDEN_TEXTAREA_STYLE).forEach(function (key) {

@@ -991,0 +992,0 @@ node.style.setProperty(key, HIDDEN_TEXTAREA_STYLE[key], 'important');

2

dist/react-textarea-autosize.min.js

@@ -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,i){"use strict";function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;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)}i=i&&i.hasOwnProperty("default")?i.default:i;var t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e};"object"==typeof Reflect&&Reflect;function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e};var o=r;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],l=0;(u=Error(t.replace(/%s/g,function(){return h[l++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},u=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var r={};"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join("")}catch(e){return}}();var p,c=(function(e){e.exports=function(){function e(e,t,n,r,o,i){"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i&&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}var n={array:e.isRequired=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=o,n.PropTypes=n}()}(p={exports:{}},p.exports),p.exports),d="undefined"!=typeof window&&"undefined"!=typeof document,f=!!d&&!!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"},m=["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"],b={},y=d&&document.createElement("textarea"),v=function(t){Object.keys(g).forEach(function(e){t.style.setProperty(e,g[e],"important")})};function w(e,t,n,r,o){void 0===n&&(n=!1),void 0===r&&(r=null),void 0===o&&(o=null),null===y.parentNode&&document.body.appendChild(y);var i=function(e,t,n){void 0===n&&(n=!1);if(n&&b[t])return b[t];var r=window.getComputedStyle(e);if(null===r)return null;var o=m.reduce(function(e,t){return e[t]=r.getPropertyValue(t),e},{}),i=o["box-sizing"];if(""===i)return null;f&&"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&&(b[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){y.style[e]=h[e]}),v(y),y.value=e.value||e.placeholder||"x";var l=-1/0,p=1/0,c=y.scrollHeight;"border-box"===u?c+=s:"content-box"===u&&(c-=a),y.value="x";var d=y.scrollHeight-a;return null===r&&null===o||(null!==r&&(l=d*r,"border-box"===u&&(l=l+a+s),c=Math.max(l,c)),null!==o&&(p=d*o,"border-box"===u&&(p=p+a+s),c=Math.min(p,c))),{height:c,minHeight:l,maxHeight:p,rowCount:Math.floor(c/d)}}d&&v(y);var _,O=(void 0===_&&(_=0),function(){return++_}),x=function(){},j=d&&window.requestAnimationFrame?[window.requestAnimationFrame.bind(window),window.cancelAnimationFrame.bind(window)]:[setTimeout,clearTimeout],C=j[0],z=j[1],R=function(t){var e,n;function r(e){var i;return(i=t.call(this,e)||this)._resizeLock=!1,i._style=null,i._onRootDOMNode=function(e){i._rootDOMNode=e,i.props.inputRef(e)},i._onChange=function(e){i._controlled||i._resizeComponent(),i.props.onChange(e)},i._resizeComponent=function(e){if(void 0===e&&(e=x),void 0!==i._rootDOMNode){var t=w(i._rootDOMNode,i._uid,i.props.useCacheForDOMMeasurements,i.props.minRows,i.props.maxRows);if(null!==t){var n=t.height,r=t.minHeight,o=t.maxHeight;i.rowCount=t.rowCount,i.state.height===n&&i.state.minHeight===r&&i.state.maxHeight===o?e():i.setState({height:n,minHeight:r,maxHeight:o},e)}else e()}else e()},i.state={height:e.style&&e.style.height||0,minHeight:-1/0,maxHeight:1/0},i._uid=O(),i._controlled="string"==typeof e.value,i}(e=r).prototype=Object.create((n=t).prototype),(e.prototype.constructor=e).__proto__=n;var o=r.prototype;return o.render=function(){var e=this.props,t=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])<0&&(o[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["inputRef","maxRows","minRows","onHeightChange","useCacheForDOMMeasurements"]),n=a({},t.style,{height:this.state.height});return Math.max(n.maxHeight||1/0,this.state.maxHeight)<this.state.height&&(n.overflow="hidden"),function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),s=0;s<i.length;s++){var u=i[s];if(!a(u))return!1;var h=e[u],l=t[u];if(!1===(o=n?n.call(r,h,l,u):void 0)||void 0===o&&h!==l)return!1}return!0}(this._style,n)||(this._style=n),t.style=this._style,i.createElement("textarea",a({},t,{onChange:this._onChange,ref:this._onRootDOMNode}))},o.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)},o.componentDidUpdate=function(e,t){var n=this;e!==this.props&&(this._clearNextFrame(),this._onNextFrameActionId=C(function(){return n._resizeComponent()})),this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},o.componentWillUnmount=function(){this._clearNextFrame(),window.removeEventListener("resize",this._resizeListener),delete b[this._uid]},o._clearNextFrame=function(){z(this._onNextFrameActionId)},r}(i.Component);R.propTypes={inputRef:c.func,maxRows:c.number,minRows:c.number,onChange:c.func,onHeightChange:c.func,useCacheForDOMMeasurements:c.bool,value:c.string},R.defaultProps={inputRef:x,onChange:x,onHeightChange:x,useCacheForDOMMeasurements:!1},e.default=R,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,i){"use strict";function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;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)}i=i&&i.hasOwnProperty("default")?i.default:i;var t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e};"object"==typeof Reflect&&Reflect;function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e};var o=r;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],l=0;(u=Error(t.replace(/%s/g,function(){return h[l++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},u=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var r={};"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join("")}catch(e){return}}();var p,c=(function(e){e.exports=function(){function e(e,t,n,r,o,i){"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i&&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}var n={array:e.isRequired=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=o,n.PropTypes=n}()}(p={exports:{}},p.exports),p.exports),d="undefined"!=typeof window&&"undefined"!=typeof document,f=!!d&&!!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"},m=["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"],b={},y=d&&document.createElement("textarea"),v=function(t){t.tabIndex=-1,Object.keys(g).forEach(function(e){t.style.setProperty(e,g[e],"important")})};function w(e,t,n,r,o){void 0===n&&(n=!1),void 0===r&&(r=null),void 0===o&&(o=null),null===y.parentNode&&document.body.appendChild(y);var i=function(e,t,n){void 0===n&&(n=!1);if(n&&b[t])return b[t];var r=window.getComputedStyle(e);if(null===r)return null;var o=m.reduce(function(e,t){return e[t]=r.getPropertyValue(t),e},{}),i=o["box-sizing"];if(""===i)return null;f&&"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&&(b[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){y.style[e]=h[e]}),v(y),y.value=e.value||e.placeholder||"x";var l=-1/0,p=1/0,c=y.scrollHeight;"border-box"===u?c+=s:"content-box"===u&&(c-=a),y.value="x";var d=y.scrollHeight-a;return null===r&&null===o||(null!==r&&(l=d*r,"border-box"===u&&(l=l+a+s),c=Math.max(l,c)),null!==o&&(p=d*o,"border-box"===u&&(p=p+a+s),c=Math.min(p,c))),{height:c,minHeight:l,maxHeight:p,rowCount:Math.floor(c/d)}}d&&v(y);var _,O=(void 0===_&&(_=0),function(){return++_}),x=function(){},j=d&&window.requestAnimationFrame?[window.requestAnimationFrame.bind(window),window.cancelAnimationFrame.bind(window)]:[setTimeout,clearTimeout],C=j[0],z=j[1],R=function(t){var e,n;function r(e){var i;return(i=t.call(this,e)||this)._resizeLock=!1,i._style=null,i._onRootDOMNode=function(e){i._rootDOMNode=e,i.props.inputRef(e)},i._onChange=function(e){i._controlled||i._resizeComponent(),i.props.onChange(e)},i._resizeComponent=function(e){if(void 0===e&&(e=x),void 0!==i._rootDOMNode){var t=w(i._rootDOMNode,i._uid,i.props.useCacheForDOMMeasurements,i.props.minRows,i.props.maxRows);if(null!==t){var n=t.height,r=t.minHeight,o=t.maxHeight;i.rowCount=t.rowCount,i.state.height===n&&i.state.minHeight===r&&i.state.maxHeight===o?e():i.setState({height:n,minHeight:r,maxHeight:o},e)}else e()}else e()},i.state={height:e.style&&e.style.height||0,minHeight:-1/0,maxHeight:1/0},i._uid=O(),i._controlled="string"==typeof e.value,i}(e=r).prototype=Object.create((n=t).prototype),(e.prototype.constructor=e).__proto__=n;var o=r.prototype;return o.render=function(){var e=this.props,t=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])<0&&(o[n]=e[n]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["inputRef","maxRows","minRows","onHeightChange","useCacheForDOMMeasurements"]),n=a({},t.style,{height:this.state.height});return Math.max(n.maxHeight||1/0,this.state.maxHeight)<this.state.height&&(n.overflow="hidden"),function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),s=0;s<i.length;s++){var u=i[s];if(!a(u))return!1;var h=e[u],l=t[u];if(!1===(o=n?n.call(r,h,l,u):void 0)||void 0===o&&h!==l)return!1}return!0}(this._style,n)||(this._style=n),t.style=this._style,i.createElement("textarea",a({},t,{onChange:this._onChange,ref:this._onRootDOMNode}))},o.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)},o.componentDidUpdate=function(e,t){var n=this;e!==this.props&&(this._clearNextFrame(),this._onNextFrameActionId=C(function(){return n._resizeComponent()})),this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},o.componentWillUnmount=function(){this._clearNextFrame(),window.removeEventListener("resize",this._resizeListener),delete b[this._uid]},o._clearNextFrame=function(){z(this._onNextFrameActionId)},r}(i.Component);R.propTypes={inputRef:c.func,maxRows:c.number,minRows:c.number,onChange:c.func,onHeightChange:c.func,useCacheForDOMMeasurements:c.bool,value:c.string},R.defaultProps={inputRef:x,onChange:x,onHeightChange:x,useCacheForDOMMeasurements:!1},e.default=R,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "tt-react-textarea-autosize",
"description": "textarea component for React which grows with content",
"version": "6.1.0-tt1",
"version": "6.1.0-tt2",
"keywords": "autosize, grow, react, react-component, textarea",

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

@@ -34,2 +34,3 @@ [![npm version](https://img.shields.io/npm/v/react-textarea-autosize.svg)](https://www.npmjs.com/package/react-textarea-autosize)

- Performance: Use same `style` reference if no style changes occurred
- Make it impossible to tab into the hidden textarea

@@ -36,0 +37,0 @@ Original project: https://github.com/andreypopp/react-textarea-autosize

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc