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 7.0.2 to 7.0.3

15

dist/react-textarea-autosize.cjs.browser.js

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

function _objectWithoutProperties(source, excluded) {
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};

@@ -47,13 +47,2 @@ var target = {};

if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;

@@ -321,3 +310,3 @@ }

_useCacheForDOMMeasurements = _this$props.useCacheForDOMMeasurements,
props = _objectWithoutProperties(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);
props = _objectWithoutPropertiesLoose(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);

@@ -324,0 +313,0 @@ props.style = _extends({}, props.style, {

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

function _objectWithoutProperties(source, excluded) {
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};

@@ -47,13 +47,2 @@ var target = {};

if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;

@@ -328,3 +317,3 @@ }

_useCacheForDOMMeasurements = _this$props.useCacheForDOMMeasurements,
props = _objectWithoutProperties(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);
props = _objectWithoutPropertiesLoose(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);

@@ -331,0 +320,0 @@ props.style = _extends({}, props.style, {

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

function _objectWithoutProperties(source, excluded) {
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};

@@ -41,13 +41,2 @@ var target = {};

if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;

@@ -315,3 +304,3 @@ }

_useCacheForDOMMeasurements = _this$props.useCacheForDOMMeasurements,
props = _objectWithoutProperties(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);
props = _objectWithoutPropertiesLoose(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);

@@ -318,0 +307,0 @@ props.style = _extends({}, props.style, {

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

function _objectWithoutProperties(source, excluded) {
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};

@@ -41,13 +41,2 @@ var target = {};

if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;

@@ -322,3 +311,3 @@ }

_useCacheForDOMMeasurements = _this$props.useCacheForDOMMeasurements,
props = _objectWithoutProperties(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);
props = _objectWithoutPropertiesLoose(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);

@@ -325,0 +314,0 @@ props.style = _extends({}, props.style, {

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

function _objectWithoutProperties(source, excluded) {
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};

@@ -46,13 +46,2 @@ var target = {};

if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;

@@ -1104,3 +1093,3 @@ }

_useCacheForDOMMeasurements = _this$props.useCacheForDOMMeasurements,
props = _objectWithoutProperties(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);
props = _objectWithoutPropertiesLoose(_this$props, ["inputRef", "maxRows", "minRows", "onHeightChange", "useCacheForDOMMeasurements"]);

@@ -1107,0 +1096,0 @@ props.style = _extends({}, props.style, {

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 r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}i=i&&i.hasOwnProperty("default")?i.default:i;var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=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={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),Object.keys(Object.assign({},n)).join("")}catch(e){return}}();var o="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",h=Object.freeze({default:o,__moduleExports:o}),p=h?o:h;function u(){}var l,d=function(){function e(e,t,r,n,o,i){if(i!==p){var a=Error("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");throw a.name="Invariant Violation",a}}function t(){return e}var r={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 r.checkPropTypes=u,r.PropTypes=r},c=Object.freeze({default:d,__moduleExports:d}),f=c&&d||c,g=(function(e){e.exports=f()}(l={exports:{}},l.exports),!!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=document.createElement("textarea"),w=function(t){Object.keys(m).forEach(function(e){t.style.setProperty(e,m[e],"important")})};function _(e,t,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=null),void 0===o&&(o=null),null===v.parentNode&&document.body.appendChild(v);var i=function(e,t,r){void 0===r&&(r=!1);if(r&&y[t])return y[t];var n=window.getComputedStyle(e);if(null===n)return null;var o=b.reduce(function(e,t){return e[t]=n.getPropertyValue(t),e},{}),i=o["box-sizing"];if(""===i)return null;g&&"border-box"===i&&(o.width=parseFloat(o.width)+parseFloat(n["border-right-width"])+parseFloat(n["border-left-width"])+parseFloat(n["padding-right"])+parseFloat(n["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};r&&(y[t]=a);return a}(e,t,r);if(null===i)return null;var a=i.paddingSize,s=i.borderSize,h=i.boxSizing,p=i.sizingStyle;Object.keys(p).forEach(function(e){v.style[e]=p[e]}),w(v),v.value=e.value||e.placeholder||"x";var u=-1/0,l=1/0,d=v.scrollHeight;"border-box"===h?d+=s:"content-box"===h&&(d-=a),v.value="x";var c=v.scrollHeight-a,f=Math.floor(d/c);return null!==n&&(u=c*n,"border-box"===h&&(u=u+a+s),d=Math.max(u,d)),null!==o&&(l=c*o,"border-box"===h&&(l=l+a+s),d=Math.min(l,d)),{height:d,minHeight:u,maxHeight:l,rowCount:Math.floor(d/c),valueRowCount:f}}w(v);var x=function(){},O=window.requestAnimationFrame?[window.requestAnimationFrame,window.cancelAnimationFrame]:[setTimeout,clearTimeout],z=O[0],C=O[1],j=0,S=function(t){var e,r;function n(e){var a;return(a=t.call(this,e)||this)._onRef=function(e){a._ref=e,a.props.inputRef(e)},a._onChange=function(e){a._controlled||a._resizeComponent(),a.props.onChange(e,s(s(a)))},a._resizeComponent=function(e){void 0===e&&(e=x);var t=_(a._ref,a._uid,a.props.useCacheForDOMMeasurements,a.props.minRows,a.props.maxRows);if(null!==t){var r=t.height,n=t.minHeight,o=t.maxHeight,i=t.valueRowCount;a.rowCount=t.rowCount,a.valueRowCount=i,a.state.height===r&&a.state.minHeight===n&&a.state.maxHeight===o?e():a.setState({height:r,minHeight:n,maxHeight:o},e)}else e()},a.state={height:e.style&&e.style.height||0,minHeight:-1/0,maxHeight:1/0},a._uid=j++,a._controlled=void 0!==e.value,a._resizeLock=!1,a}(e=n).prototype=Object.create((r=t).prototype),(e.prototype.constructor=e).__proto__=r;var o=n.prototype;return o.render=function(){var e=this.props,t=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])<0&&(o[r]=e[r]);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["inputRef","maxRows","minRows","onHeightChange","useCacheForDOMMeasurements"]);return t.style=a({},t.style,{height:this.state.height}),Math.max(t.style.maxHeight||1/0,this.state.maxHeight)<this.state.height&&(t.style.overflow="hidden"),i.createElement("textarea",a({},t,{onChange:this._onChange,ref:this._onRef}))},o.componentDidMount=function(){var e=this;this._resizeComponent(),this._resizeListener=function(){e._resizeLock||(e._resizeLock=!0,e._resizeComponent(function(){e._resizeLock=!1}))},window.addEventListener("resize",this._resizeListener)},o.componentDidUpdate=function(e,t){var r=this;e!==this.props&&(C(this._rafId),this._rafId=z(function(){r._resizeComponent()})),this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},o.componentWillUnmount=function(){C(this._rafId),window.removeEventListener("resize",this._resizeListener),delete y[this._uid]},n}(i.Component);S.defaultProps={inputRef:x,onChange:x,onHeightChange:x,useCacheForDOMMeasurements:!1},e.default=S,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)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}i=i&&i.hasOwnProperty("default")?i.default:i;var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=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 o="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",h=Object.freeze({default:o,__moduleExports:o}),u=h?o:h;function p(){}var d,l=function(){function e(e,t,n,r,o,i){if(i!==u){var a=Error("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");throw a.name="Invariant Violation",a}}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=p,n.PropTypes=n},c=Object.freeze({default:l,__moduleExports:l}),f=c&&l||c,g=(function(e){e.exports=f()}(d={exports:{}},d.exports),!!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=document.createElement("textarea"),w=function(t){Object.keys(m).forEach(function(e){t.style.setProperty(e,m[e],"important")})};function _(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,h=i.boxSizing,u=i.sizingStyle;Object.keys(u).forEach(function(e){v.style[e]=u[e]}),w(v),v.value=e.value||e.placeholder||"x";var p=-1/0,d=1/0,l=v.scrollHeight;"border-box"===h?l+=s:"content-box"===h&&(l-=a),v.value="x";var c=v.scrollHeight-a,f=Math.floor(l/c);return null!==r&&(p=c*r,"border-box"===h&&(p=p+a+s),l=Math.max(p,l)),null!==o&&(d=c*o,"border-box"===h&&(d=d+a+s),l=Math.min(d,l)),{height:l,minHeight:p,maxHeight:d,rowCount:Math.floor(l/c),valueRowCount:f}}w(v);var x=function(){},O=window.requestAnimationFrame?[window.requestAnimationFrame,window.cancelAnimationFrame]:[setTimeout,clearTimeout],z=O[0],C=O[1],j=0,R=function(t){var e,n;function r(e){var a;return(a=t.call(this,e)||this)._onRef=function(e){a._ref=e,a.props.inputRef(e)},a._onChange=function(e){a._controlled||a._resizeComponent(),a.props.onChange(e,s(s(a)))},a._resizeComponent=function(e){void 0===e&&(e=x);var t=_(a._ref,a._uid,a.props.useCacheForDOMMeasurements,a.props.minRows,a.props.maxRows);if(null!==t){var n=t.height,r=t.minHeight,o=t.maxHeight,i=t.valueRowCount;a.rowCount=t.rowCount,a.valueRowCount=i,a.state.height===n&&a.state.minHeight===r&&a.state.maxHeight===o?e():a.setState({height:n,minHeight:r,maxHeight:o},e)}else e()},a.state={height:e.style&&e.style.height||0,minHeight:-1/0,maxHeight:1/0},a._uid=j++,a._controlled=void 0!==e.value,a._resizeLock=!1,a}(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]);return o}(e,["inputRef","maxRows","minRows","onHeightChange","useCacheForDOMMeasurements"]);return t.style=a({},t.style,{height:this.state.height}),Math.max(t.style.maxHeight||1/0,this.state.maxHeight)<this.state.height&&(t.style.overflow="hidden"),i.createElement("textarea",a({},t,{onChange:this._onChange,ref:this._onRef}))},o.componentDidMount=function(){var e=this;this._resizeComponent(),this._resizeListener=function(){e._resizeLock||(e._resizeLock=!0,e._resizeComponent(function(){e._resizeLock=!1}))},window.addEventListener("resize",this._resizeListener)},o.componentDidUpdate=function(e,t){var n=this;e!==this.props&&(C(this._rafId),this._rafId=z(function(){n._resizeComponent()})),this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},o.componentWillUnmount=function(){C(this._rafId),window.removeEventListener("resize",this._resizeListener),delete y[this._uid]},r}(i.Component);R.defaultProps={inputRef:x,onChange:x,onHeightChange:x,useCacheForDOMMeasurements:!1},e.default=R,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "react-textarea-autosize",
"description": "textarea component for React which grows with content",
"version": "7.0.2",
"version": "7.0.3",
"keywords": "autosize, grow, react, react-component, textarea",

@@ -37,8 +37,8 @@ "repository": "andreypopp/react-textarea-autosize",

"devDependencies": {
"@babel/core": "7.0.0-beta.51",
"@babel/helper-module-imports": "7.0.0-beta.52",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.51",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.51",
"@babel/preset-env": "7.0.0-beta.51",
"@babel/preset-react": "7.0.0-beta.51",
"@babel/core": "7.0.0-beta.53",
"@babel/helper-module-imports": "7.0.0-beta.53",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.53",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.53",
"@babel/preset-env": "7.0.0-beta.53",
"@babel/preset-react": "7.0.0-beta.53",
"babel-plugin-macros": "^2.2.2",

@@ -45,0 +45,0 @@ "babel-plugin-transform-define": "^1.3.0",

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

[jQuery Autosize](http://www.jacklmoore.com/autosize/)! Weighs
<span class="weight">1.92 KB</span> (minified & gzipped).
<span class="weight">1.87 KB</span> (minified & gzipped).

@@ -15,3 +15,3 @@ This module supports IE9 and above.

```javascript
import Textarea from "react-textarea-autosize";
import Textarea from 'react-textarea-autosize';

@@ -25,3 +25,3 @@ // If you use CommonJS syntax:

</div>,
document.getElementById("element")
document.getElementById('element')
);

@@ -75,3 +75,3 @@ ```

.create(<Textarea />, {
createNodeMock: () => document.createElement("textarea")
createNodeMock: () => document.createElement('textarea')
})

@@ -78,0 +78,0 @@ .toJSON();

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