{"name":"react-virtualized-auto-sizer","version":"1.0.6","description":"Standalone version of the AutoSizer component from react-virtualized","author":{"name":"Brian Vaughn","email":"brian.david.vaughn@gmail.com","url":"https://github.com/bvaughn/"},"contributors":[{"name":"Brian Vaughn","email":"brian.david.vaughn@gmail.com","url":"https://github.com/bvaughn/"}],"license":"MIT","homepage":"https://github.com/bvaughn/react-virtualized-auto-sizer/","repository":{"type":"git","url":"git+https://github.com/bvaughn/react-virtualized-auto-sizer.git"},"bugs":{"url":"https://github.com/bvaughn/react-virtualized-auto-sizer/issues"},"engines":{"node":">8.0.0"},"keywords":["react","reactjs","virtual","window","windowed","list","scrolling","infinite","virtualized","table","grid","spreadsheet"],"main":"dist/index.cjs.js","module":"dist/index.esm.js","scripts":{"precommit":"lint-staged","prettier":"prettier --write '**/*.{js,json,css}'","linc":"lint-staged","lint":"eslint '**/*.js'","test":"cross-env CI=1 react-scripts test --env=jsdom","test:watch":"react-scripts test --env=jsdom","build":"del dist && rollup -c","start":"rollup -c -w","prepare":"yarn run build","predeploy":"cd example && yarn install && yarn run build","deploy":"gh-pages -d example/build"},"lint-staged":{"{example,src}/**/*.{js,json,css}":["prettier --write","git add"],"**/*.js":"eslint --max-warnings 0"},"peerDependencies":{"react":"^15.3.0 || ^16.0.0-alpha || ^17.0.0","react-dom":"^15.3.0 || ^16.0.0-alpha || ^17.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^8.2.1","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.6.0","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","cross-env":"^5.1.4","del-cli":"^1.1.0","eslint":"^4.19.1","eslint-config-prettier":"^2.9.0","eslint-config-react-app":"^2.1.0","eslint-config-standard":"^11.0.0","eslint-config-standard-react":"^6.0.0","eslint-plugin-flowtype":"^2.47.1","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^5","eslint-plugin-node":"^6.0.1","eslint-plugin-prettier":"^2.6.0","eslint-plugin-promise":"^3.7.0","eslint-plugin-react":"^7.7.0","eslint-plugin-standard":"^3.0.1","gh-pages":"^1.1.0","lint-staged":"^7.0.5","prettier":"^1.12.1","react":"15","react-dom":"15","react-scripts":"^1.1.1","react-test-renderer":"^16.4.0","rollup":"^0.59.3","rollup-plugin-babel":"^3.0.3","rollup-plugin-commonjs":"^8.2.1","rollup-plugin-node-resolve":"^3.0.2","rollup-plugin-peer-deps-external":"^2.0.0","rollup-plugin-postcss":"^1.1.0","rollup-plugin-url":"^1.3.0"},"gitHead":"1275e69264dd960d15aca42fea8bd73194672778","_id":"react-virtualized-auto-sizer@1.0.6","_nodeVersion":"12.18.3","_npmVersion":"7.9.0","dist":{"integrity":"sha512-7tQ0BmZqfVF6YYEWcIGuoR3OdYe8I/ZFbNclFlGOC3pMqunkYF/oL30NCjSGl9sMEb17AnzixDz98Kqc3N76HQ==","shasum":"66c5b1c9278064c5ef1699ed40a29c11518f97ca","tarball":"http://registry-npm.ywwl.com/react-virtualized-auto-sizer/download/react-virtualized-auto-sizer-1.0.6.tgz","fileCount":4,"unpackedSize":38575,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFbrTCRA9TVsSAnZWagAAXG0QAI64fRKkrohM82k9oC2U\nWHw66tzQCCFI4VE9KAGaC5Ftjw7dy5Hv+Go07glmgJep0xiGmCv9iSo8X5CB\nyEPkxcaS9/tE3oI6QhobqjkuqywkMdVcAb/ABCqRRltbz3Y2LbtFEN0iQpa0\naAPxQ9sAvO8FuIaSxvOYja8ylttMAHRsisvl6KHlFBkGU/rB1MxBkHh/Z3Zb\nqzOWtLoyxj69D17eoHrgnfjahfpho55rGdk0wEyHZwuxjAyAWH1k0EqxbnQI\nETt+8E60WxvGNcS77nbtLSUJ/Uzqcax/Yn2ys5MkomO13SlCaEOhVxlVj9XQ\nCdYkUFdw7a6iRt6yecIAdlB4+yXODva6G56G5V4a9ZtNOiv+YnDpRkU9zMfT\nieuwvWG5fGL+UpT5Dy1oOjmZLVBK3fWIz1l/JDzDviOtVb+GsfBraIsEpRKF\nmkuhojxMxr6MWOEXzVBLaXuXBOXwLdgMpcCshgIKsJlCKQrwFXD7SsPdk1z4\nno6r9PGfc0gJRF+UemdwxRn7fBjZmcfwsqRxu1wVaxh3BSD8OO5A6DVV4c4p\nC2TJ3LJ1B+SxKl3NxqxdQ08oCwSJX63XgIYGHaKy0dRa5YZos6U3hgotAbuZ\nddCsrKsDv6Y4SLfNhrAhMPcWBifZ4c0YutJ1jJilpET8FAacd4G+Qlz25SKI\naNeD\r\n=21md\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA146jufB1LuuoyPL1IcBKg5scH9gccgWQuBDaLqkx7QAiEAv4R/8brG/X0AqQE0/q5RCA9Z26LzulnIsWbnX9JiOCc="}],"size":6727,"noattachment":false,"key":"/react-virtualized-auto-sizer/-/react-virtualized-auto-sizer-1.0.6.tgz"},"_npmUser":{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"},"directories":{},"maintainers":[{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"},{"name":"shhnjk","email":"shhnjk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-virtualized-auto-sizer_1.0.6_1628814035071_0.3447210379828254"},"_hasShrinkwrap":false,"readme":"# react-virtualized-auto-sizer\n\nStandalone version of the `AutoSizer` component from [`react-virtualized`](https://github.com/bvaughn/react-virtualized).\n\n### If you like this project, 🎉 [become a sponsor](https://github.com/sponsors/bvaughn/) or ☕ [buy me a coffee](http://givebrian.coffee/)\n\n## Install\n\n```bash\nnpm install --save react-virtualized-auto-sizer\n```\n\n## Documentation\n\n\n| Property      | Type     | Required? | Description                                                                                                                                                     |\n| :------------ | :------- | :-------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| children      | Function |     ✓     | Function responsible for rendering children. This function should implement the following signature: `({ height?: number \\| undefined, width?: number \\| undefined }) => PropTypes.element` |\n| className     | String   |           | Optional custom CSS class name to attach to root `AutoSizer` element. This is an advanced property and is not typically necessary.                              |\n| defaultHeight | Number   |           | Height passed to child for initial render; useful for server-side rendering. This value will be overridden with an accurate height after mounting.              |\n| defaultWidth  | Number   |           | Width passed to child for initial render; useful for server-side rendering. This value will be overridden with an accurate width after mounting.                |\n| disableHeight | Boolean  |           | Fixed `height`; if specified, the child's `height` property will not be managed                                                                                 |\n| disableWidth  | Boolean  |           | Fixed `width`; if specified, the child's `width` property will not be managed                                                                                   |\n| nonce         | String   |           | Nonce of the inlined stylesheets for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute)                    |\n| onResize      | Function |           | Callback to be invoked on-resize; it is passed the following named parameters: `({ height: number, width: number })`.                                           |\n| style         | Object   |           | Optional custom inline style to attach to root `AutoSizer` element. This is an advanced property and is not typically necessary.                                |\n| tagName       | string   |           | Optional HTML tag name for root element; defaults to `\"div\"` |\n\n## Examples\n\nSome components (like those found in [`react-window`](https://github.com/bvaughn/react-window) or [`react-virtualized`](https://github.com/bvaughn/react-virtualized)) require numeric width and height parameters. The `AutoSizer` component can be useful if you want to pass percentage based dimensions.\n\n```jsx\nimport AutoSizer from \"react-virtualized-auto-sizer\";\n\n// UI\n<AutoSizer>\n  {({ height, width }) => {\n    // Use these actual sizes to calculate your percentage based sizes\n  }}\n</AutoSizer>;\n```\n\n## FAQs\n\n### Can I use this component with flexbox?\n\nFlex containers don't prevent their children from growing and `AutoSizer` greedily grows to fill as much space as possible. Combining the two can be problematic. The simple way to fix this is to nest `AutoSizer` inside of a `block` element (like a `<div>`) rather than putting it as a direct child of the flex container, like so:\n\n```jsx\n<div style={{ display: 'flex' }}>\n  <!-- Other children... -->\n  <div style={{ flex: '1 1 auto' }}>\n    <AutoSizer>\n      {({ height, width }) => (\n        <Component\n          width={width}\n          height={height}\n          {...props}\n        />\n      )}\n    </AutoSizer>\n  </div>\n</div>\n```\n\n### Why is `AutoSizer` passing a height of 0?\n\n`AutoSizer` expands to _fill_ its parent but it will not _stretch_ the parent. This is done to prevent problems with flexbox layouts. If `AutoSizer` is reporting a height (or width) of 0- then it's likely that the parent element (or one of its parents) has a height of 0.\n\nThe solution to this problem is often to add `height: 100%` or `flex: 1` to the parent. One easy way to test this is to add a style property (eg `background-color: red;`) to the parent to visually confirm that it is the expected size.\n\n### Can I use `AutoSizer` to manage only width or height (not both)?\n\nYou can use `AutoSizer` to control only one dimension of its child component using the `disableHeight` or `disableWidth` attributes. For example, a fixed-height component that should grow to fill the available width can be created like so:\n\n```jsx\n<AutoSizer disableHeight>\n  {({width}) => <Component height={200} width={width} {...props} />}\n</AutoSizer>\n```\n\n\n### Module parsing fails because of an unexpected token?\n\nThis package targets [ECMAScript 2015](https://262.ecma-international.org/6.0/) (ES6) and requires a build tool such as [babel-loader](https://www.npmjs.com/package/babel-loader) that is capable of parsing the ES6 `class` syntax.\n\n### Can this component work with a Content Security Policy?\n\n[The specification of Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#intro)\ndescribes as the following:\n\n> This document defines Content Security Policy, a mechanism web applications\n> can use to mitigate a broad class of content injection vulnerabilities, such\n> as cross-site scripting (XSS).\n\nTo apply Content Security Policy, pass a `nonce` to `AutoSizer` and add a matching `nonce-source` to the `Content-Security-Policy` field in HTTP header.\n","publish_time":1628814035224,"_cnpm_publish_time":1628814035224,"dist-tags":{"latest":"2.0.4"}}