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

react-resizable-box

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-resizable-box - npm Package Compare versions

Comparing version 0.3.3 to 0.4.0

23

lib/index.js

@@ -182,8 +182,19 @@ 'use strict';

}, {
key: 'getBoxStyle',
value: function getBoxStyle() {
var _this2 = this;
var getSize = function getSize(key) {
if (typeof _this2.state[key] === 'undefined') return 'auto';else if (/px$/.test(_this2.state[key].toString())) return _this2.state[key];else if (/%$/.test(_this2.state[key].toString())) return _this2.state[key];
return _this2.state[key] + 'px';
};
return {
width: getSize('width'),
height: getSize('height')
};
}
}, {
key: 'render',
value: function render() {
var style = {
width: this.state.width ? this.state.width + 'px' : '100%',
height: this.state.height ? this.state.height + 'px' : '100%'
};
var style = this.getBoxStyle();
var _props2 = this.props;

@@ -245,4 +256,4 @@ var isResizable = _props2.isResizable;

customClass: _react.PropTypes.string,
width: _react.PropTypes.number,
height: _react.PropTypes.number,
width: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]),
height: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]),
minWidth: _react.PropTypes.number,

@@ -249,0 +260,0 @@ minHeight: _react.PropTypes.number,

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

bottom: '-5px',
left: 0,
cursor: 'row-resize'

@@ -40,0 +41,0 @@ },

{
"name": "react-resizable-box",
"version": "0.3.3",
"version": "0.4.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -53,9 +53,13 @@ # react-resizable-box

#### `width`: PropTypes.number
#### `width`: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
The `width` property is used to set the width of a resizable component.
Forexample, you can set `300`, `'300px'`, `50%`.
If ommited, set `'auto'`.
#### `height`: PropTypes.number
#### `height`: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
The `height` property is used to set the width of a resizable component.
Forexample, you can set `300`, `'300px'`, `50%`.
If ommited, set `'auto'`.

@@ -151,2 +155,8 @@ #### `minWidth`: PropTypes.number

## Changelog
#### v0.4.0
- Support `'px'` and `'%'` for width and height props.
## License

@@ -153,0 +163,0 @@

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