Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-resizable-box
Advanced tools
Resizable component for React.
See demo: http://bokuweb.github.io/react-resizable-box/example/
$ npm install --save react-resizable-box
<Resizable
className="item"
width={320}
height={200}
>
Basic Sample
</Resizable>
className?: string;
The className
property is used to set the custom className
of a resizable component.
style?: any;
The style
property is used to set the custom style
of a resizable component.
width?: (number | string);
The width
property is used to set the initial width of a resizable component.
For example, you can set 300
, '300px'
, 50%
.
If omitted, set 'auto'
.
height?: (number | string);
The height
property is used to set the initial height of a resizable component.
For example, you can set 300
, '300px'
, 50%
.
If omitted, set 'auto'
.
minWidth?: number;
The minWidth
property is used to set the minimum width of a resizable component.
minHeight?: number;
The minHeight
property is used to set the minimum height of a resizable component.
maxWidth?: number;
The maxWidth
property is used to set the maximum width of a resizable component.
maxHeight?: number
;The maxHeight
property is used to set the maximum height of a resizable component.
grid?: Array<number>;
The grid
property is used to specify the increments that resizing should snap to. Defaults to [1, 1]
.
lockAspectRatio?: boolean;
The lockAspectRatio
property is used to lock aspect ratio.
If omitted, set false
.
bounds?: ('window' | 'parent' | HTMLElement);
Specifies resize boundaries.
handlerStyles?: HandlersStyles;
The handleStyles
property is used to override the style of one or more resize handlers.
Only the axis you specify will have its handler style replaced.
If you specify a value for right
it will completely replace the styles for the right
resize handler,
but other handler will still use the default styles.
handlerClasses?: HandlersClassName;
The handlerClasses
property is used to set the className of one or more resize handlers. You can set className for span wrapper with wrapper
index.
enable?: ?Enable;
The enable
property is used to set the resizable permission of a resizable component.
The permission of top
, right
, bottom
, left
, topRight
, bottomRight
, bottomLeft
, topLeft
direction resizing.
If omitted, all resizer are enabled.
If you want to permit only right direction resizing, set { top:false, right:true, bottom:false, left:false, topRight:false, bottomRight:false, bottomLeft:false, topLeft:false }
.
onResizeStart?: ResizeStartCallBack;
ResizeStartCallBack
type is below.
type ResizeStartCallBack = (
e: SyntheticMouseEvent | SyntheticTouchEvent,
dir: Direction,
refToElement: HTMLElement,
) => void;
Calls when resizable component resize start.
onResize?: Callback;
Callback
type is below.
type Callback = (
event: MouseEvent | TouchEvent,
direction: Direction,
refToElement: HTMLElement,
delta: NumberSize,
) => void;
Calls when resizable component resizing.
onResizeStop?: Callback;
Callback
type is below.
type Callback = (
event: MouseEvent | TouchEvent,
direction: Direction,
refToElement: HTMLElement,
delta: NumberSize,
) => void;
Calls when resizable component resize startStop.
extendsProps?: any;
This property is used to pass the other props to the component.
e.g.
const extendsProps = {
data-foo: 'foo',
onMouseOver: () => {},
};
<Resizable extendsProps={extendsProps} />
updateSize(object size)
Update component size.
grid
,max/minWidth
, max/minHeight
props is ignored, when this method called.
class YourComponent extends Component {
...
update() {
this.resizable.updateSize({ width: 200, height: 300 });
}
render() {
return (
<Resizable ref={c => { this.resizable = c; }}>
example
</Resizable>
);
}
...
}
npm test
shouldUpdateComponent
(#135).lodash.isEqual
.border-box
.flowtype
.extendsProps
prop to other props (e.g. data-*
, aria-*
, and other ).updateSize
method.lockAspectRatio
property.grid
props to snap grid. (thanks @paulyoung)userSelect: none
when resize get srated.require
.onResizeStart
callback argument.'px'
and '%'
for width and height props.The MIT License (MIT)
Copyright (c) 2017 bokuweb
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
v2.1.0
shouldUpdateComponent
(#135).lodash.isEqual
.FAQs
Unknown package
The npm package react-resizable-box receives a total of 2,085 weekly downloads. As such, react-resizable-box popularity was classified as popular.
We found that react-resizable-box demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.