{"_id":"@aerian/preact-virtual-list","_rev":"1-6d30bc95c6bc01847249ecb96d6db1e3","name":"@aerian/preact-virtual-list","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.2":{"name":"@aerian/preact-virtual-list","amdName":"VirtualList","version":"0.3.2","description":"Virtual list, renders only visible items.","main":"dist/preact-virtual-list.js","minified:main":"dist/preact-virtual-list.min.js","jsnext:main":"src/index.js","scripts":{"build":"npm-run-all transpile optimize minify","transpile":"rollup -c rollup.config.js -f umd -n $npm_package_amdName $npm_package_jsnext_main -o $npm_package_main","optimize":"uglifyjs $npm_package_main -bc -o $npm_package_main ","minify":"uglifyjs $npm_package_main -cm -o $npm_package_minified_main ","test":"eslint {src,test} && mocha --compilers js:babel-register test/**/*.js","prepublish":"npm run build","release":"npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["es2015-minimal","stage-0"],"plugins":["transform-class-properties",["transform-react-jsx",{"pragma":"h"}]]},"keywords":["preact","virtual","list"],"author":{"name":"Jason Miller","email":"jason@developit.ca"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/developit/preact-virtual-list.git"},"bugs":{"url":"https://github.com/developit/preact-virtual-list/issues"},"homepage":"https://github.com/developit/preact-virtual-list","devDependencies":{"babel":"^6.5.2","babel-eslint":"^6.0.2","babel-plugin-transform-class-properties":"^6.6.0","babel-plugin-transform-react-jsx":"^6.7.5","babel-preset-es2015":"^6.6.0","babel-preset-es2015-minimal":"^1.1.0","babel-preset-es2015-minimal-rollup":"^2.0.0","babel-preset-stage-0":"^6.5.0","babel-register":"^6.7.2","chai":"^3.5.0","eslint":"^2.8.0","eslint-plugin-react":"^4.3.0","mocha":"^2.4.5","npm-run-all":"^1.7.0","preact":"^10.0.0-beta.2","rollup":"^0.25.8","rollup-plugin-babel":"^2.4.0","uglify-js":"^2.6.2"},"peerDependencies":{"preact":"*"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2016 Jason Miller\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@aerian/preact-virtual-list@0.3.2","dist":{"shasum":"de4a3bc418bd940fc4c09618da200be8d37e54a2","integrity":"sha512-XBf3ZtsNKWQG7duq/yHWUyJUJQ7EPUD/zDStGxaqv/eiXkTv1BbxfPmnD+uLulQJZ2XJn6hmwqQ3b6yQsKJkQA==","tarball":"https://registry.npmjs.org/@aerian/preact-virtual-list/-/preact-virtual-list-0.3.2.tgz","fileCount":15,"unpackedSize":20741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCi4GCRA9TVsSAnZWagAAIDsP/j8wCjARmUW2So0gEAyO\nlLu7xKalXcX+oDjggBf/813JYLhMA40gNCxnAi5ZLIXSDLZo+i50FpYlmwgs\nSUZFr7Y298Xru1ih7/UMx1xNh8fob7QPszNTEWG10JsBkbynUDmJ4akpgv68\nl++vykN76beQIbFD4EPAibx5yaSXRD56885ADIIWEAYiIUPs2ittr8S+Y1bk\nJisDNAEQGvYMCPO5It/6H14fQjp4iWs18+Z3bcCSnHSm/XAB5hf/59VmDudd\njJjp1GZSYIsj4U+P9DVve/oGL21mZRqp2d2yWXcFcFlLZ75scsY7nmOc+8tT\nZpPCwU/pKnBxRwg4Y3m54Q9NPP7PBt8dqUym36XVlCvYeosi7gtQG7UAePlH\n+GNkcf/uDyhiwSbBsCFRAn28YXuutjtB6MIp4+C95x6gPjWGgvuvAtXUUyO+\nmg1uKgrSvC8DtK5I8kPrUOJyURsVw2sdIQilskm/lDHol1IfI7Oxl9ASTd+G\nIsI8+cR0pUifmnZod2q/qB9Hrl9/Ai9JN/pL/fkCRP2qsbR5eNWD7vzPgyEa\n6fP0uzROupg+mnEi6JBV94EXd0p07nQ5P5uai7njoWzxblSSKBiu6HGuCQaJ\nNvfqHsPg9p2JWaRf+AgpoLMpm8RJGSSIMWXCaoZRFxDY0+P3lvmsM0zL3ePi\n4trs\r\n=gHth\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9V2UexKNOobRh3zxd4jOVJzCBNltiMr1VKlTyb+dPpwIhAIWKymJ8BCBnU9OphsLnVoCtbpIN1ye8VN/nbNe1zIju"}]},"maintainers":[{"name":"darren.ivey","email":"darren.ivey@aerian.com"},{"name":"davinux","email":"davinux@gmail.com"},{"name":"s-unya","email":"sunya.dickman@gmail.com"},{"name":"ascorbic","email":"m@mk.gg"}],"_npmUser":{"name":"ascorbic","email":"m@mk.gg"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/preact-virtual-list_0.3.2_1560948229359_0.10816362081193831"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-19T12:43:49.173Z","0.3.2":"2019-06-19T12:43:49.499Z","modified":"2022-04-04T11:48:35.233Z"},"maintainers":[{"name":"darren.ivey","email":"darren.ivey@aerian.com"},{"name":"davinux","email":"davinux@gmail.com"},{"name":"s-unya","email":"sunya.dickman@gmail.com"},{"name":"ascorbic","email":"m@mk.gg"}],"description":"Virtual list, renders only visible items.","homepage":"https://github.com/developit/preact-virtual-list","keywords":["preact","virtual","list"],"repository":{"type":"git","url":"git+https://github.com/developit/preact-virtual-list.git"},"author":{"name":"Jason Miller","email":"jason@developit.ca"},"bugs":{"url":"https://github.com/developit/preact-virtual-list/issues"},"license":"MIT","readme":"# `<VirtualList />` <sub>_for [Preact]_</sub>\n\n[![NPM](https://img.shields.io/npm/v/preact-virtual-list.svg)](https://www.npmjs.com/package/preact-virtual-list)\n[![Travis](https://travis-ci.org/developit/preact-virtual-list.svg?branch=master)](https://travis-ci.org/developit/preact-virtual-list)\n\nA \"virtual\" list component that renders only visible rows of a given data set.\n\nUseful for those super important business applications where one must show _all_ million rows.\n\n#### [Demo](https://jsfiddle.net/developit/qqan9pdo/)\n\n<a href=\"https://jsfiddle.net/developit/qqan9pdo/\">\n<img alt=\"preview\" src=\"https://i.gyazo.com/866e97be9075dd63260dbc5df30075ec.gif\" width=\"420\">\n</a>\n\n---\n\n\n## Usage Example\n\nProvide the list of items as `data`, an item renderer as `renderRow`, and the height of a single row as `rowHeight`. Everything else is optional.\n\n```js\n<VirtualList\n    data={['a', 'b', 'c']}\n    renderRow={ row => <div>{row}</div> }\n    rowHeight={22}\n    overscanCount={10}\n    sync\n/>\n```\n\n\n---\n\n\n## Props\n\n| Prop                | Type       | Description         |\n|---------------------|------------|---------------------|\n| **`data`**          | _Array_    | List of data items\n| **`renderRow`**     | _Function_ | Renders a single row\n| **`rowHeight`**     | _Number_   | Static height of a row\n| **`sync`**          | _Boolean_  | If `true`, forces synchronous rendering \\*\n| **`overscanCount`** | _Number_   | Number of extra rows to render above and below visible list. Defaults to 10. \\*\\*\n\n_**\\* About synchronous rendering:** It's best to try without `sync` enabled first. If the normal async rendering behavior is fine, it's best to leave sync turned off. If you're seeing flickering, enabling sync will ensure every update gets out to the screen without dropping renders, but does so at the expense of actual framerate._\n\n\n_**\\*\\* Why overscan?** Rendering normalized blocks of rows reduces the number of DOM interactions by grouping all row renders into a single atomic update._\n\n| _Without_ Overscan | _With_ Overscan |\n|--------------------|-----------------|\n| <img src=\"https://i.gyazo.com/e192bf1ca835fbe6ad803f7b6270e424.gif\" height=\"150\"> | <img src=\"https://i.gyazo.com/478440d1f06fe543e69fff8b88ce7963.gif\" height=\"150\"> |\n\n\n---\n\n## Simple Example\n\n[**View this example on JSFiddle**](https://jsfiddle.net/developit/qqan9pdo/)\n\n```js\nimport VirtualList from 'preact-virtual-list';\n\n// Generate 100,000 rows of data\nconst DATA = [];\nfor (let x=1e5; x--; ) DATA[x] = `Item #${x+1}`;\n\nclass Demo extends Component {\n    // 30px tall rows\n    rowHeight = 30;\n\n    // Renders a single row\n    renderRow(row) {\n        return <div class=\"row\">{row}</div>;\n    }\n\n    render() {\n        return (\n            <VirtualList sync class=\"list\"\n                data={DATA}\n                rowHeight={this.rowHeight}\n                renderRow={this.renderRow}\n            />\n        );\n    }\n}\n\nrender(Demo, document.body);\n```\n\n\n---\n\n\n## Functional Example\n\n[**View this example on JSFiddle**](https://jsfiddle.net/developit/qqan9pdo/)\n\n```js\nimport VirtualList from 'preact-virtual-list';\n\n// Generate 100,000 rows of data\nconst DATA = [];\nfor (let x=1e5; x--; ) DATA[x] = `Item #${x+1}`;\n\n// renders a single row\nconst Row = row => (\n    <div class=\"row\">{row}</div>\n);\n\nrender((\n    <VirtualList data={DATA} rowHeight={30} renderRow={Row} />\n), document.body);\n```\n\n\n---\n\n\n### License\n\n[MIT]\n\n\n[Preact]: https://github.com/developit/preact\n[MIT]: http://choosealicense.com/licenses/mit/\n","readmeFilename":"README.md"}