{"_id":"@bogdanbeniaminb/virtualized-list","_rev":"2-bab87c7ae018f8764ef6271b256ceacb","name":"@bogdanbeniaminb/virtualized-list","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@bogdanbeniaminb/virtualized-list","version":"1.0.0","description":"Virtualized List using vanilla JS","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","test":"jest --config jestconfig.json --passWithNoTests","format":"prettier --write \"src/**/*.ts\" \"src/**/*.js\"","lint":"tslint -p tsconfig.json","prepare":"npm run build","preversion":"npm run lint","prepublishOnly":"npm test && npm run lint","version":"npm run format && git add -A src","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git+https://github.com/bogdanbeniaminb/virtualized-list.git"},"keywords":["virtualized","list","vanilla"],"author":{"name":"Bogdan Beniamin Barbu"},"license":"ISC","bugs":{"url":"https://github.com/bogdanbeniaminb/virtualized-list/issues"},"homepage":"https://github.com/bogdanbeniaminb/virtualized-list#readme","devDependencies":{"@types/jest":"^29.4.0","jest":"^29.4.3","prettier":"^2.8.4","ts-jest":"^29.0.5","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0"},"gitHead":"2246841409c16066583b37635c2497a4f8c1386c","_id":"@bogdanbeniaminb/virtualized-list@1.0.0","_nodeVersion":"16.19.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-4Xpp4ldh0q0XAk7V4hvuHr4mLaHPoKqUJ/2zciDlGlecKxb4azhlsp9eci3u3HB7bDDwTF4VUJYSKiyGTs8U4g==","shasum":"92233ae1c78a7588fdfa257a3a35ad8325aeaede","tarball":"https://registry.npmjs.org/@bogdanbeniaminb/virtualized-list/-/virtualized-list-1.0.0.tgz","fileCount":7,"unpackedSize":11499,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCclbVhJ66MeSP+ETwq4O9ZUVuNHuwATNm5LylGP7cn8AIhALsIOaa3d8lIQph20OE1dekdiWeA6nvJfv+y+kJBaPjI"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/FViACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtOg/+LiEGwCYF69+PQDzuUYWhpa/lnPYtPPi03BGbfcT8+lyzSJmq\r\nUPcKKymlS+hPe+VeECohRyLLrrV7J454WY9Rznl62+vGSgLi9kBqwcbbzKcv\r\ncrt1RepUuez/Myh08JI4I/FruAAL1awLizr16uz7TZIZvc7I5QJL2ljP6HD6\r\nSrTtgZqH/V9lP/JLk4iWgrUxyhjbhSNA5zYrFqDD5G30qCjnyLPRrokZv+41\r\nMiwxtQVeWdp0v7mPZxjY5iYvFt4HUwRU0pOD4Kqmo2XhVi1bjAjboP5Rvxbl\r\n6mA0EUZodAvcZkMK0eEiFlgAXCeN73NMbdjXKPfjuxqzPEkp/ZG/d0Dx/koj\r\nVOA/XsP67o6RhArnGwDxEn//lqm6j+EZiu2dNIBfIqb2NHqB1xL2gGXbGv29\r\ngEEOADEXY9GQ2lo6BSWE3b9rw9mTW5ZHBlVUL/qUFHxrgwb9T+0ALEIA2hPw\r\nUGnQyVLBt4YnsOEjQRSa3k4OUakcmJ62e3Arsl/VSsriwJo48DaswWStLXfU\r\nACodCYyCCg4wKDHneApjSPjwAN1oTMROpHh5qYICVcpRD3bv31KmWPSAs1uc\r\nSHhaOh2iRjek7tA5V31LtW+56KviI8ZiSarUXx/plhvErN3h05JC0fvQ6eMG\r\nkeEaVD41iuocTjfI+Lc9JMqFgZOaNsax8xI=\r\n=iyrv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogdanbeniaminb","email":"barbu.bogdan.beniamin@gmail.com"},"directories":{},"maintainers":[{"name":"bogdanbeniaminb","email":"barbu.bogdan.beniamin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/virtualized-list_1.0.0_1677481314646_0.7795802689215194"},"_hasShrinkwrap":false},"1.0.3":{"name":"@bogdanbeniaminb/virtualized-list","version":"1.0.3","description":"Virtualized List using vanilla JS","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","test":"jest --config jestconfig.json --passWithNoTests","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json","prepare":"npm run build","preversion":"npm run lint","prepublishOnly":"npm test && npm run lint","version":"npm run format && git add -A src","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git+https://github.com/bogdanbeniaminb/virtualized-list.git"},"keywords":["virtualized","list","vanilla"],"author":{"name":"Bogdan Beniamin Barbu"},"license":"ISC","bugs":{"url":"https://github.com/bogdanbeniaminb/virtualized-list/issues"},"homepage":"https://github.com/bogdanbeniaminb/virtualized-list#readme","devDependencies":{"@types/jest":"^29.4.0","jest":"^29.4.3","prettier":"^2.8.4","ts-jest":"^29.0.5","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0"},"gitHead":"c16cdd8d0d900e69e2fd6a1823bd029d73938536","_id":"@bogdanbeniaminb/virtualized-list@1.0.3","_nodeVersion":"18.14.1","_npmVersion":"9.3.1","dist":{"integrity":"sha512-5A0S3vlUf59pCztGS1gywGOi+7i8p+Tl8l7VMb7nbYEZuMB/YfHdBLPs61JoKyLhE9gDBixhIiP1UxwtQIk65g==","shasum":"1cd3c468adbc4e9658aaf46b430e3fea8f5ca2e0","tarball":"https://registry.npmjs.org/@bogdanbeniaminb/virtualized-list/-/virtualized-list-1.0.3.tgz","fileCount":7,"unpackedSize":13273,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHWbyyeIPS/8NxVWQK3htJjdxziqrGj4WBqJ6YdZczGgIgNQjTWtO83KO508MHMZlAvQMuoJF46q+Zh0wpbFpVKyk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/Fu6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLiQ//QDs07FK5owZv2bxmzIKU0upCww5x6I2fjrLTsfwKaNfWLka/\r\ntm8xb/lz2Bx1juQr4v1Ew7bq8b5gfnQfLVKQ/JgTDUgG1oQ/QAS302SDaNys\r\nIWE23ng8zAybT72/zIfqAbShCQwcZ83/uiMW1Y4lR83nOgpdVFN8BCGhtuHk\r\nO6jBojBBjxUVvDLSJXED/Ur5bLQASs+r5uSpUQWkt8IRs6hEyQEzVwMBRcYJ\r\nQ58rEZY55YSCzJLxA2oFCIrgEOtUfzaRRRTUCOIdQIDlX6rReoPCPnLOcetJ\r\nXDdldleQswsldILQsgBw3RESWlWyA4EtZmotEmKHMx8bsIHOGFJ9QhNhAUV5\r\ntlbZRoU1D2Wtg8YRscYdsmE2Z0kTXIYwKYl9v95qOTJdPtGQvknYhB0nilhj\r\nUv0ggob+UrjLotAwdf1H7xnu8X3YriGCF/p2G0JrH+kjFkz/s2JW/W4+w+Bl\r\nh5Rqy/sZ7IMTJgEre3KPMwNNukb7P/XJSJ234qgYs65I3GfDy4M3v7hZpOtk\r\nr4oCelHSkECVOSQOo9InPtxDHu4unMKBxOu122MoDyg0sUcO0gwQaIrxlSoH\r\n0VJ7Qes+66fsxunawxbYfuTl53x6B0ZQ0ite6B3HvIEhWDALBJrTc69IQH1I\r\nxm/TLqQ8RpdM6E4562cvZtk1x3F4HNsegUI=\r\n=83wU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogdanbeniaminb","email":"barbu.bogdan.beniamin@gmail.com"},"directories":{},"maintainers":[{"name":"bogdanbeniaminb","email":"barbu.bogdan.beniamin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/virtualized-list_1.0.3_1677482938168_0.2687200593327541"},"_hasShrinkwrap":false},"1.0.4":{"name":"@bogdanbeniaminb/virtualized-list","version":"1.0.4","description":"Virtualized List using vanilla JS","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","test":"jest --config jestconfig.json --passWithNoTests","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json","prepare":"npm run build","preversion":"npm run lint","prepublishOnly":"npm test && npm run lint","version":"npm run format && git add -A src","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git+https://github.com/bogdanbeniaminb/virtualized-list.git"},"keywords":["virtualized","list","vanilla"],"author":{"name":"Bogdan Beniamin Barbu"},"license":"ISC","bugs":{"url":"https://github.com/bogdanbeniaminb/virtualized-list/issues"},"homepage":"https://github.com/bogdanbeniaminb/virtualized-list#readme","devDependencies":{"@types/jest":"^29.4.0","jest":"^29.4.3","prettier":"^2.8.4","ts-jest":"^29.0.5","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^4.9.5"},"gitHead":"6c3544a4c663f2008e787a3cd23187d3f346776b","_id":"@bogdanbeniaminb/virtualized-list@1.0.4","_nodeVersion":"18.14.1","_npmVersion":"9.3.1","dist":{"integrity":"sha512-7v0DtfLGF6i9xIUUYZIk9AjWoBFhZxOXyeKGNsX0GG3BGNdvagoXu1AkzmHMBVW4yptqFS6vJhgzWnjGsGavrw==","shasum":"1744435ed66dfb07203520e194722c8907270248","tarball":"https://registry.npmjs.org/@bogdanbeniaminb/virtualized-list/-/virtualized-list-1.0.4.tgz","fileCount":7,"unpackedSize":14397,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXz8SyYACaWGflovSR7aPHsCJhHGjgKdTv4qIdFGtwkwIhAImoWXuqwxRQ32E8IAcCYQRisBkP5I3T1PFg5Ykp89D5"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/F+MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4qA//YM1EHNOpo/piTIYsmHMaDIinfd+Vnxh29TmaThOXGDuM39ou\r\n3Uxn8CGPDeMGO1YXfMxeRitbAwVSzOY3/66FhQQfGLUbemgmIukySvyEdZ70\r\nkLaDwqepFFXwdFcFABkGctDNv6dUJaotJp5Lt7PUlMn5r5dQAwiwkwIKjf+1\r\n05H3FqS4pM1SvQHVbEDW2S7fW0hJRHcLyL2p3rwjt9XZxEJEAOM0K7PhOYxk\r\nmXbIfy3XrE2JdbS5V8QFmbrLZs2JF4COmhrgEaTUEBsaLOyxm2icI661LmfF\r\nEoaQOqWs1OeQKOdKbUMlgq4SD6KdqfjfBChXmKxj2H+fA0X68ex3BL4fr/Xn\r\nzqjsRo5jf/itkQG6roWzkmp0IKTSJhcR/4elmHKWpj4mzlD4bGrjysqyWIrB\r\nXHgrjMtgm8JVoPKH+QAfTmLY4tX6uyF/CssCMtn7h+wJ8uyNEV2t9/bk7Ke9\r\n9dZv00Nmg3Qq3AixtRPTbb5Gav8r7cinfLUX6qEXao2L97n4wE4XqmdaohOK\r\n/NEnllNOgVzeB1SOnSX2HlOAiY64Y1wHBH/b1njtPyPyYk+BzRkytLdkpfEr\r\nSkYHw7rb3xK8I95yApmf3mf120CUfJ7IHRHNdxGY3AvZvyQgGYyD5mICYvtW\r\nUdtCbiKigK/jiJNPfOgeEkyoxtZKUL+oNG4=\r\n=Tel7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bogdanbeniaminb","email":"barbu.bogdan.beniamin@gmail.com"},"directories":{},"maintainers":[{"name":"bogdanbeniaminb","email":"barbu.bogdan.beniamin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/virtualized-list_1.0.4_1677483915865_0.9822002356109885"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-27T07:01:54.551Z","1.0.0":"2023-02-27T07:01:54.795Z","modified":"2023-02-27T07:45:16.070Z","1.0.3":"2023-02-27T07:28:58.374Z","1.0.4":"2023-02-27T07:45:15.994Z"},"maintainers":[{"name":"bogdanbeniaminb","email":"barbu.bogdan.beniamin@gmail.com"}],"description":"Virtualized List using vanilla JS","homepage":"https://github.com/bogdanbeniaminb/virtualized-list#readme","keywords":["virtualized","list","vanilla"],"repository":{"type":"git","url":"git+https://github.com/bogdanbeniaminb/virtualized-list.git"},"author":{"name":"Bogdan Beniamin Barbu"},"bugs":{"url":"https://github.com/bogdanbeniaminb/virtualized-list/issues"},"license":"ISC","readme":"# VirtualizedList\n\nA simple Virtualized List using vanilla JS.\n\n## How to install\n\nJust install the package from npm:\n\n```bash\nnpm install --save @bogdanbeniaminb/virtualized-list\n```\n\n## How to use\n\nYou will need:\n\n- a container element with a **fixed** height\n- a list of items\n- an estimated height of the list items (optional)\n- a renderer function, which accepts the item data and returns the HTML element\n\n```javascript\nimport VirtualizedList from '@bogdanbeniaminb/virtualized-list';\n\nconst listItems = [\n  {\n    id: 1,\n    title: 'First',\n  },\n  {\n    id: 2,\n    title: 'Second',\n  },\n];\n\n// Make sure this element exists on the page and that it has a fixed height.\nconst wrapper = document.querySelector('.virtualized-list-wrapper');\n\nconst virtualizedList = new VirtualizedList({\n  listElement: wrapper,\n  itemHeight: 35, // optional\n  items: listItems,\n  itemRenderer: (item) => {\n    const itemElement = document.createElement('div');\n    itemElement.innerHTML = item.title;\n    return itemElement;\n  },\n  itemKeyGetter: (item) => item.id, // optional\n});\n```\n\n### Parameters\n\n- `listElement` (HTMLElement, **required**) - the list container\n- `itemHeight` (number, optional) - the estimated item height\n- `items` (array of objects, **required**) - the items to display\n- `itemRenderer` (function, **required**) - accepts 1 or 2 parameters, the first one being the current item, and should return a HTMLElement\n- `itemKeyGetter` (function, optional) - a function which accepts the item and returns a **unique** ID. If not provided, the library will search for: 1) the `id` field of the item; 2) the `key` field of the item; 3) the actual index of the item in the array.\n\n### Methods\n\n- `updateItems(items: T[])` - update the whole array of items. Use this if you want to dynamically change the items. It will be similar to a reset.\n","readmeFilename":"README.md"}