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

react-resizable

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-resizable - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

2

build/cloneElement.js

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

// React.addons.cloneWithProps look-alike that merges style & className.
module.exports = function cloneElement(element, props) {
module.exports = function cloneElement(element /*: React.Element*/, props /*: Object*/) /*: React.Element*/ {
if (props.style && element.props.style) {

@@ -15,0 +15,0 @@ props.style = _extends({}, element.props.style, props.style);

@@ -27,2 +27,16 @@ 'use strict';

/*:: type Position = {
deltaX: number,
deltaY: number
};*/
/*:: type State = {
resizing: boolean,
width: number, height: number,
slackW: number, slackH: number
};*/
/*:: type DragCallbackData = {
node: HTMLElement,
position: Position
};*/
var Resizable = function (_React$Component) {

@@ -47,3 +61,3 @@ _inherits(Resizable, _React$Component);

Resizable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
Resizable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps /*: Object*/) {
// If parent changes height/width, set that in our state.

@@ -58,3 +72,3 @@ if (!this.state.resizing && (nextProps.width !== this.props.width || nextProps.height !== this.props.height)) {

Resizable.prototype.lockAspectRatio = function lockAspectRatio(width, height, aspectRatio) {
Resizable.prototype.lockAspectRatio = function lockAspectRatio(width /*: number*/, height /*: number*/, aspectRatio /*: number*/) {
height = width / aspectRatio;

@@ -68,3 +82,3 @@ width = height * aspectRatio;

Resizable.prototype.runConstraints = function runConstraints(width, height) {
Resizable.prototype.runConstraints = function runConstraints(width /*: number*/, height /*: number*/) {
var min = this.props.minConstraints;

@@ -123,3 +137,3 @@ var max = this.props.maxConstraints;

Resizable.prototype.resizeHandler = function resizeHandler(handlerName) {
Resizable.prototype.resizeHandler = function resizeHandler(handlerName /*: string*/) {
var _this2 = this;

@@ -126,0 +140,0 @@

@@ -25,3 +25,8 @@ 'use strict';

/*:: type State = {width: number, height: number, aspectRatio: number};*/
/*:: type Size = {width: number, height: number};*/
// An example use of Resizable.
/*:: type ResizeData = {element: Element, size: Size};*/

@@ -28,0 +33,0 @@ var ResizableBox = function (_React$Component) {

# Changelog
### 1.3.3 (Apr 19, 2016)
- Enhancement: Add Flow comments.
### 1.3.2 (Apr 8, 2016)

@@ -4,0 +8,0 @@

{
"name": "react-resizable",
"version": "1.3.2",
"version": "1.3.3",
"description": "A component that is resizable with handles.",

@@ -13,3 +13,6 @@ "main": "index.js",

"prepublish": "npm run build",
"validate": "npm ls"
"validate": "npm ls",
"preversion": "npm run lint",
"version": "git add CHANGELOG.md",
"postversion": "git push && git push --tags"
},

@@ -36,2 +39,3 @@ "repository": {

"babel-loader": "^6.2.2",
"babel-plugin-transform-flow-comments": "^6.7.0",
"babel-preset-es2015": "^6.6.0",

@@ -38,0 +42,0 @@ "babel-preset-es2015-loose": "^7.0.0",

Sorry, the diff of this file is not supported yet

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