{"name":"re-resizable","version":"5.0.0-beta.0","description":"Resizable component for React.","title":"re-resizable","main":"./lib/index.es5.js","module":"./lib/index.js","jsnext:main":"./lib/index.js","keywords":["react","resize","resizable","component"],"scripts":{"lint":"tslint -c tslint.json src/index.tsx","tsc":"tsc -p tsconfig.json","build:prod:main":"rollup -c scripts/prod.js","build:prod:es5":"rollup -c scripts/prod.es5.js","build":"npm-run-all --serial build:prod:*","start":"npm-run-all --parallel storybook","test":"cross-env NODE_ENV='test' tsc && avaron lib/index.test.js --renderer","test:ci":"npm run flow && npm run build","prepublish":"npm run build","storybook":"start-storybook -p 6066","build-storybook":"build-storybook","deploy":"npm run build-storybook && gh-pages -d storybook-static"},"repository":{"type":"git","url":"git+https://github.com/bokuweb/react-resizable-box.git"},"author":{"name":"bokuweb"},"license":"MIT","bugs":{"url":"https://github.com/bokuweb/react-resizable-box/issues"},"homepage":"https://github.com/bokuweb/react-resizable-box","devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.2.2","@babel/plugin-proposal-class-properties":"^7.2.3","@babel/plugin-transform-modules-commonjs":"^7.2.0","@babel/preset-react":"^7.0.0","@babel/preset-typescript":"^7.1.0","@babel/traverse":"^7.1.4","@babel/types":"^7.1.3","@storybook/addon-info":"4.1.7","@storybook/addon-options":"^4.1.7","@storybook/react":"4.1.7","@types/node":"^11.11.1","@types/react":"16.8.7","@types/react-dom":"^16.0.11","@types/sinon":"^7.0.5","avaron":"0.2.0","babel-core":"7.0.0-bridge.0","babel-eslint":"10.0.1","babel-loader":"^8.0.5","babel-plugin-external-helpers":"6.22.0","babel-plugin-transform-class-properties":"6.24.1","babel-plugin-transform-object-assign":"6.22.0","babel-plugin-transform-object-rest-spread":"6.26.0","babel-polyfill":"6.26.0","babel-preset-env":"1.7.0","babel-preset-es2015":"6.24.1","babel-preset-flow":"6.23.0","babel-preset-react":"6.24.1","babel-register":"6.26.0","cross-env":"5.2.0","gh-pages":"2.0.1","npm-run-all":"4.1.5","prettier":"1.16.4","react":"16.8.4","react-dom":"16.8.4","rollup":"1.6.0","rollup-plugin-babel":"4.3.2","rollup-plugin-commonjs":"9.2.1","rollup-plugin-node-globals":"1.4.0","rollup-plugin-node-resolve":"4.0.1","rollup-plugin-replace":"2.1.0","rollup-plugin-typescript2":"0.16.0","rollup-watch":"4.3.1","sinon":"7.2.7","tslint":"^5.13.1","tslint-config-google":"^1.0.1","tslint-config-prettier":"^1.17.0","tslint-plugin-prettier":"^2.0.1","typescript":"^3.2.2"},"typings":"./lib/index.d.ts","types":"./lib/index.d.ts","avaron":{"babel":"inherit","require":["babel-polyfill","babel-register"],"fixture":"./test/fixture.html"},"dependencies":{"fast-memoize":"^2.5.1"},"readme":"<p align=\"center\"><img src =\"https://github.com/bokuweb/re-resizable/blob/master/logo.png?raw=true\" /></p>\n\n<p align=\"center\">📏 A resizable component for React.</p>\n\n<p align=\"center\"><a href=\"https://circleci.com/gh/bokuweb/re-resizable/tree/master\">\n<img src=\"https://circleci.com/gh/bokuweb/re-resizable/tree/master.svg?style=svg\" alt=\"Build Status\" /></a>\n<a href=\"https://www.npmjs.com/package/re-resizable\">\n<img src=\"https://img.shields.io/npm/v/re-resizable.svg\" alt=\"Build Status\" /></a>\n<a href=\"https://www.npmjs.com/package/re-resizable\">\n<img src=\"https://img.shields.io/npm/dm/re-resizable.svg\" /></a>\n<a href=\"https://renovatebot.com/\">\n<img src=\"https://img.shields.io/badge/renovate-enabled-brightgreen.svg\" /></a>\n<a href=\"https://github.com/prettier/prettier\">\n<img src=\"https://img.shields.io/badge/styled_with-prettier-ff69b4.svg\" /></a>\n<a href=\"https://bokuweb.github.io/re-resizable/\">\n<img src=\"https://github.com/storybooks/press/blob/master/badges/storybook.svg\" /></a>\n</p>\n\n## Table of Contents\n\n- [Screenshot](#Screenshot)\n_ [Live Demo](#live-demo)\n  - [Storybook](#storybook)\n  - [CodeSandbox](#codesandbox)\n- [Install](#install)\n- [Usage](#usage)\n- [Props](#props)\n- [Instance API](#instance-api)\n  - [updateSize(size: { width: number | string, height: number | string }): void](#updateSize-void)\n- [Test](#test)\n- [Related](#related)\n\n## Screenshot\n\n![screenshot](https://github.com/bokuweb/re-resizable/blob/master/docs/screenshot.gif?raw=true)\n\n## Live Demo\n\n### Storybook\n\n[Storybook](http://bokuweb.github.io/re-resizable/)\n\n### CodeSandbox\n\n[![Edit xp9p7272m4](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/xp9p7272m4)  \n[CodeSandbox](https://codesandbox.io/s/xp9p7272m4)  \n[CodeSandbox(TypeScript)](https://codesandbox.io/s/1vwo2p4l64)\n\n## Install\n\n```sh\n$ npm install --save re-resizable\n```\n\n## Usage\n\n### Example with `defaultSize`\n\n```javascript\n<Resizable\n  defaultSize={{\n    width:320,\n    height:200,\n  }}\n>\n  Sample with default size\n</Resizable>\n```\n\n### Example with `size`\n\nIf you use `size` props, please manage state by yourself.\n\n```javascript\n<Resizable\n  size={{ width: this.state.width, height: this.state.height }}\n  onResizeStop={(e, direction, ref, d) => {\n    this.setState({\n      width: this.state.width + d.width,\n      height: this.state.height + d.height,\n    });\n  }}\n>\n  Sample with size\n</Resizable>\n```\n\n## Props\n\n#### `defaultSize?: { width: (number | string), height: (number | string) };`\n\nSpecifies the `width` and `height` that the dragged item should start at.\nFor example, you can set `300`, `'300px'`, `50%`.\nIf both `defaultSize` and `size` omitted, set `'auto'`.\n\n`defaultSize` will be ignored when `size` set.\n\n#### `size?: { width: (number | string), height: (number | string) };`\n\nThe `size` property is used to set the size of the component.\nFor example, you can set `300`, `'300px'`, `50%`.\n\nUse `size` if you need to control size state by yourself.\n\n#### `className?: string;`\n\nThe `className` property is used to set the custom `className` of a resizable component.\n\n#### `style?: { [key: string]: string };`\n\nThe `style` property is used to set the custom `style` of a resizable component.\n\n#### `minWidth?: number | string;`\n\nThe `minWidth` property is used to set the minimum width of a resizable component. Defaults to 10px.\n\n#### `minHeight?: number | string;`\n\nThe `minHeight` property is used to set the minimum height of a resizable component. Defaults to 10px.\n\n#### `maxWidth?: number | string;`\n\nThe `maxWidth` property is used to set the maximum width of a resizable component.\n\n#### `maxHeight?: number | string`;\n\nThe `maxHeight` property is used to set the maximum height of a resizable component.\n\n#### `grid?: [number, number];`\n\nThe `grid` property is used to specify the increments that resizing should snap to. Defaults to `[1, 1]`.\n\n#### `snap?: { x?: Array<number>, y?: Array<number> };`\n\nThe `snap` property is used to specify absolute pixel values that resizing should snap to. `x` and `y` are both optional, allowing you to only include the axis you want to define. Defaults to `null`.\n\n#### `resizeRatio?: number | string;`\n\nThe `resizeRatio` property is used to set the number of pixels the resizable component scales by compared to the number of pixels the mouse/touch moves. Defaults to `1` (for a 1:1 ratio). The number set is the left side of the ratio, `2` will give a 2:1 ratio.\n\n#### `lockAspectRatio?: boolean | number;`\n\nThe `lockAspectRatio` property is used to lock aspect ratio.\nSet to `true` to lock the aspect ratio based on the initial size.\nSet to a numeric value to lock a specific aspect ratio (such as `16/9`).\nIf set to numeric, make sure to set initial height/width to values with correct aspect ratio.\nIf omitted, set `false`.\n\n#### `lockAspectRatioExtraWidth?: number;`\n\nThe `lockAspectRatioExtraWidth` property enables a resizable component to maintain an aspect ratio plus extra width.\nFor instance, a video could be displayed 16:9 with a 50px side bar.\nIf omitted, set `0`.\n\n#### `lockAspectRatioExtraHeight?: number;`\n\nThe `lockAspectRatioExtraHeight` property enables a resizable component to maintain an aspect ratio plus extra height.\nFor instance, a video could be displayed 16:9 with a 50px header bar.\nIf omitted, set `0`.\n\n#### `bounds?: ('window' | 'parent' | HTMLElement);`\n\nSpecifies resize boundaries.\n\n#### `handleStyles?: HandleStyles;`\n\nThe `handleStyles` property is used to override the style of one or more resize handles.\nOnly the axis you specify will have its handle style replaced.\nIf you specify a value for `right` it will completely replace the styles for the `right` resize handle,\nbut other handle will still use the default styles.\n\n#### `handleClasses?: HandleClassName;`\n\nThe `handleClasses` property is used to set the className of one or more resize handles.\n\n#### `handleComponent?: HandleComponent;`\n\nThe `handleComponent` property is used to pass a React Component to be rendered as one or more resize handle. For example, this could be used to use an arrow icon as a handle..\n\n#### `handleWrapperStyle?: { [key: string]: string };`\n\nThe `handleWrapperStyle` property is used to override the style of resize handles wrapper.\n\n#### `handleWrapperClass?: string;`\n\nThe `handleWrapperClass` property is used to override the className of resize handles wrapper.\n\n#### `enable?: ?Enable;`\n\nThe `enable` property is used to set the resizable permission of a resizable component.\n\nThe permission of `top`, `right`, `bottom`, `left`, `topRight`, `bottomRight`, `bottomLeft`, `topLeft` direction resizing.\nIf omitted, all resizer are enabled.\nIf 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 }`.\n\n#### `onResizeStart?: ResizeStartCallBack;`\n\n`ResizeStartCallBack` type is below.\n\n```javascript\ntype ResizeStartCallback = (\n  e: SyntheticMouseEvent<HTMLDivElement> | SyntheticTouchEvent<HTMLDivElement>,\n  dir: ResizableDirection,\n  refToElement: HTMLDivElement,\n) => void;\n```\n\nCalls when resizable component resize start.\n\n#### `onResize?: ResizeCallback;`\n\n#### `scale?: number`;\n\nThe `scale` property is used in the scenario where the resizable element is a descendent of an element using css scaling (e.g. - `transform: scale(0.5)`).\n\n### Basic\n\n`ResizeCallback` type is below.\n\n```javascript\ntype ResizeCallback = (\n  event: MouseEvent | TouchEvent,\n  direction: ResizableDirection,\n  refToElement: HTMLDivElement,\n  delta: NumberSize,\n) => void;\n```\n\nCalls when resizable component resizing.\n\n#### `onResizeStop?: ResizeCallback;`\n\n`ResizeCallback` type is below.\n\n```javascript\ntype ResizeCallback = (\n  event: MouseEvent | TouchEvent,\n  direction: ResizableDirection,\n  refToElement: HTMLDivElement,\n  delta: NumberSize,\n) => void;\n```\n\nCalls when resizable component resize stop.\n\n## Instance API\n\n#### * `updateSize(size: { width: number | string, height: number | string }): void`\n\nUpdate component size.\n\n`grid`, `snap`, `max/minWidth`, `max/minHeight` props is ignored, when this method called.\n\n- for example\n\n```javascript\nclass YourComponent extends Component {\n\n  // ...\n\n  update() {\n    this.resizable.updateSize({ width: 200, height: 300 });\n  }\n\n  render() {\n    return (\n      <Resizable ref={c => { this.resizable = c; }}>\n        example\n      </Resizable>\n    );\n  }\n\n  // ...\n}\n```\n\n## Contribute\n\nIf you have a feature request, please add it as an issue or make a pull request.\n\nIf you have a bug to report, please reproduce the bug in [CodeSandbox](https://codesandbox.io/s/ll587k677z) to help us easily isolate it.\n\n## Test\n\n``` sh\nnpm test\n```\n\n## Related\n\n- [react-rnd](https://github.com/bokuweb/react-rnd)\n- [react-sortable-pane](https://github.com/bokuweb/react-sortable-pane)\n","readmeFilename":"README.md","gitHead":"954501c75dfe32d97575439d412385653f329c5e","_id":"re-resizable@5.0.0-beta.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.2","_npmUser":{"name":"bokuweb","email":"bokuweb12@gmail.com"},"dist":{"integrity":"sha512-RmgwWMHh/7MwSQWRk8IaIAen4FlOfEGequvau2tzm1G22S+4j1M9LGYj8G+LFKbe0LkTbfw3pSA0/B3q33xVrA==","shasum":"d6f0019e0a1b4542c7ec9529fdbc9c4eb74d6411","tarball":"http://registry-npm.ywwl.com/re-resizable/download/re-resizable-5.0.0-beta.0.tgz","fileCount":12,"unpackedSize":167290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjb6vCRA9TVsSAnZWagAA08cP/R9M7ougbzOXJbtZo4cu\nLlopk+Q/aKa9lRl1rbpnr6AsMs80L8LZwwC0dLIAU6SI+RJNY072kjzJI5cT\n9OviDkzLj0JjaeWbBG4Hd9tfkB64bY1fK007/hsiAKPOCp90vbiOdgCG5E/2\n6fop2XV5YBPPAjhMjZUhBtNt+sWPN1Ir/mlN52I+kIxu/HPk1JvQhn65wREb\nIMC+XVgJs/jc6amHTuK69cFTJL7wu3c0konW0v4Z4Y18xE8Wq4885RZ8Zin1\ncGGts9vOXMbp6s/8L7QL32X9lnvu98yjrdcgTXjGsqG8b0yAcaF0AHYfcGwQ\nVsTc1KctYxppdv0xtVSa5e6jiDSGI/4/+M1OMJRzVjzkM3FotolF2v/c5R/m\nprdUCpop3URAMTv2pOLlSpjEJMYWsg7PXqU6XtTFVn2dXUha9UkE8wOfvVbW\nKZWVCZszcrsIAQzC91v30ComlJr/wbQTo78tMrtBVVnAKnIT5ldYVmMXwJok\nMLmfbMP5gk5Y1Ljp1ikqGgRkJW2Upx7Mk43W+CjwnIM4qMLVgmTHmAk5OZpW\nYZ3XqkgCaGgLUvjGIY+FbVR0lEMVKDe0k86pwSnAMlG4Cs+Z1o6GN4maw21u\ntuMKotlaxOrOFlFeVvrbRyAuxn+OqZGbRx1gp4HS/64ANtMbZuv8nO6jPzna\nVsBY\r\n=K4rl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGi+NPTSmJt9lABq+9d6fv9YY5iQ9LwuXU95arVDV8VXAiBgZU66QwwiQNaMzI3Sx0T9TDvC4nv5llxQpT/nOhvODw=="}],"size":27216,"noattachment":false,"key":"/re-resizable/-/re-resizable-5.0.0-beta.0.tgz"},"maintainers":[{"name":"bokuweb","email":"bokuweb12@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/re-resizable_5.0.0-beta.0_1552793262873_0.09977749584415196"},"_hasShrinkwrap":false,"publish_time":1552793263026,"_cnpm_publish_time":1552793263026,"dist-tags":{"beta":"5.0.0-beta.0","latest":"6.11.2"}}