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

re-resizable

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

re-resizable - npm Package Compare versions

Comparing version 6.9.1 to 6.9.2

59

lib/index.es5.js

@@ -5,30 +5,7 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React = require('react');
var memoize = require('fast-memoize');
var memoize = _interopDefault(require('fast-memoize'));
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () {
return e[k];
}
});
}
});
}
n['default'] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
var memoize__default = /*#__PURE__*/_interopDefaultLegacy(memoize);
/*! *****************************************************************************

@@ -58,4 +35,2 @@ Copyright (c) Microsoft Corporation.

function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -152,6 +127,6 @@ function __() { this.constructor = d; }

Resizer.prototype.render = function () {
return (React__namespace.createElement("div", { className: this.props.className || '', style: __assign(__assign({ position: 'absolute', userSelect: 'none' }, styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
return (React.createElement("div", { className: this.props.className || '', style: __assign(__assign({ position: 'absolute', userSelect: 'none' }, styles[this.props.direction]), (this.props.replaceStyles || {})), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children));
};
return Resizer;
}(React__namespace.PureComponent));
}(React.PureComponent));

@@ -162,5 +137,5 @@ var DEFAULT_SIZE = {

};
var clamp = memoize__default['default'](function (n, min, max) { return Math.max(Math.min(n, max), min); });
var snap = memoize__default['default'](function (n, size) { return Math.round(n / size) * size; });
var hasDirection = memoize__default['default'](function (dir, target) {
var clamp = memoize(function (n, min, max) { return Math.max(Math.min(n, max), min); });
var snap = memoize(function (n, size) { return Math.round(n / size) * size; });
var hasDirection = memoize(function (dir, target) {
return new RegExp(dir, 'i').test(target);

@@ -176,3 +151,3 @@ });

};
var findClosestSnap = memoize__default['default'](function (n, snapArray, snapGap) {
var findClosestSnap = memoize(function (n, snapArray, snapGap) {
if (snapGap === void 0) { snapGap = 0; }

@@ -183,6 +158,6 @@ var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);

});
var endsWith = memoize__default['default'](function (str, searchStr) {
var endsWith = memoize(function (str, searchStr) {
return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;
});
var getStringSize = memoize__default['default'](function (n) {
var getStringSize = memoize(function (n) {
n = n.toString();

@@ -232,3 +207,3 @@ if (n === 'auto') {

};
var calculateNewMax = memoize__default['default'](function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
var calculateNewMax = memoize(function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);

@@ -836,3 +811,3 @@ maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);

if (enable[dir] !== false) {
return (React__namespace.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));
return (React.createElement(Resizer, { key: dir, direction: dir, onResizeStart: _this.onResizeStart, replaceStyles: handleStyles && handleStyles[dir], className: handleClasses && handleClasses[dir] }, handleComponent && handleComponent[dir] ? handleComponent[dir] : null));
}

@@ -842,3 +817,3 @@ return null;

// #93 Wrap the resize box in span (will not break 100% width/height)
return (React__namespace.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));
return (React.createElement("div", { className: handleWrapperClass, style: handleWrapperStyle }, resizers));
};

@@ -859,4 +834,4 @@ Resizable.prototype.render = function () {

var Wrapper = this.props.as || 'div';
return (React__namespace.createElement(Wrapper, __assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps),
this.state.isResizing && React__namespace.createElement("div", { style: this.state.backgroundStyle }),
return (React.createElement(Wrapper, __assign({ ref: this.ref, style: style, className: this.props.className }, extendsProps),
this.state.isResizing && React.createElement("div", { style: this.state.backgroundStyle }),
this.props.children,

@@ -890,4 +865,4 @@ this.renderResizer()));

return Resizable;
}(React__namespace.PureComponent));
}(React.PureComponent));
exports.Resizable = Resizable;

@@ -9,4 +9,2 @@ var __extends = (this && this.__extends) || (function () {

return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -13,0 +11,0 @@ function __() { this.constructor = d; }

@@ -9,4 +9,2 @@ var __extends = (this && this.__extends) || (function () {

return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -13,0 +11,0 @@ function __() { this.constructor = d; }

{
"name": "re-resizable",
"version": "6.9.1",
"version": "6.9.2",
"description": "Resizable component for React.",

@@ -5,0 +5,0 @@ "title": "re-resizable",

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