{"_id":"@bytesoftio/helpers-pagination","_rev":"5-eba576ff674579b3a1137a7ee85a6a53","name":"@bytesoftio/helpers-pagination","dist-tags":{"latest":"2.0.2"},"versions":{"1.0.0":{"name":"@bytesoftio/helpers-pagination","version":"1.0.0","author":{"name":"Maxim Kott"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"test":"jest","lint":"tsc --noEmit","build":"rm -rf dist && tsc -p tsconfig.build.json","release":"yarn run build && np"},"dependencies":{"lodash":"^4.17.15"},"devDependencies":{"@types/jest":"^25.1.4","@types/lodash":"^4.14.149","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","typescript":"^3.8.3"},"description":"# @bytesoftio/helpers-pagination","_id":"@bytesoftio/helpers-pagination@1.0.0","dist":{"shasum":"db71609334d61a9848139e65086c029ced3aac19","integrity":"sha512-gzoAaKEYK4ssJnDEsYnim14DaVx5mQlFoHfVxZOEmDuWPDPm2zG/Ux0Ms6cRGQ6AiE2jCxeWQO7Ggf2HX9HYlA==","tarball":"https://registry.npmjs.org/@bytesoftio/helpers-pagination/-/helpers-pagination-1.0.0.tgz","fileCount":10,"unpackedSize":6527,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeps2PCRA9TVsSAnZWagAAYDwP/RIAJyIpS/PqlqDGUXk2\nq6NBOrlfyJmqlYfdMT8gAy6qW3JRAj1DcFzqGtZ1EWNx8K5Rz90/WGJD7n4+\n/pb7nyn3cmzAl8PpdoPqDJjUhkmYDAUjD543ieke3Tx2ZxKVWpZUXAczmf7p\nniDeAWIU5vKqP5YRtfMmstFJ3KZ/3dwcAE+CGM/w1U2cMQ92QzO+VPQXwTIL\nxaNwq7frdTEdVyjHhTGvXDwVhzOFeQqT82ShdcZeya3kRlDPptryuBa/7g7K\nbr0lv/p5UbWYPGFiZ3JfPkfpByEh4t9xnbKDjsT6Yh4AsLrGt9cXv/4nga5y\nu482zorCV79FyD9fy3+jl/7pXTWdSnvPn8ZeDgOi9Z+i7F+hrgRT29kMb/0v\n/bjq61aJvSTiZP0orwOvn4fbY2rAtR9WZbOvP9ZHZFZ+/LE+iEqEZuME7B1l\n+zqFuHciC3h0K7oRK2luhfMnVZjV4ECsZMTZ2KN+BawQ6aMLsktVc88yq9Yp\neo3c2Xj4SJ0E60Nefw+ZEg42bKkAncfM+XjqqDzjFhFZ4mvlt+K1HhzBCYPw\nr49hJ6NFXF/s91dwuO/RQHlM4L8nHv1ybskqQpWf8RhTU5ZbJowtFr4Z/UYv\nTd8T8e77JWpWVa3HBOgmKd57L50zi+jz6mJ06rnKl71Y+0SLNEd7CUpmGd5L\nHw9l\r\n=06ys\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOXsAdoZsfC31SAazc1PiTdJINsPKRQ8VePsMO4QWo/AiEA73WhEEHJiU5RcponN+RhCdU1bYtrXVPUVnyAyeOq3KU="}]},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"_npmUser":{"name":"maximkott","email":"maximkott@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/helpers-pagination_1.0.0_1587989902658_0.6113617478099904"},"_hasShrinkwrap":false},"1.0.1":{"name":"@bytesoftio/helpers-pagination","version":"1.0.1","author":{"name":"Maxim Kott"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"test":"jest","lint":"tsc --noEmit","build":"rm -rf dist && tsc -p tsconfig.build.json","release":"yarn run build && np"},"dependencies":{"lodash":"^4.17.15"},"devDependencies":{"@types/jest":"^25.1.4","@types/lodash":"^4.14.149","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","typescript":"^3.8.3"},"description":"## Installation","_id":"@bytesoftio/helpers-pagination@1.0.1","dist":{"shasum":"ff9c6119b9ca6e2291acadcce4e3c5e642ccbd9d","integrity":"sha512-IU2BhYhrZTNDd/JPz/qB3kvmsWaAp07G/weQdNd1cbvl9ggMooJL/heMlY5XA/6SXMXPkm3Ul/WhCmzjAsB9rw==","tarball":"https://registry.npmjs.org/@bytesoftio/helpers-pagination/-/helpers-pagination-1.0.1.tgz","fileCount":10,"unpackedSize":6491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeps39CRA9TVsSAnZWagAAtMYP/2c0nApUsdqys2IS2Slv\nwa3GkxvtxlYbkygzMbUKb0JLggXJLbp6GHnTFo9Yp2dF03PcAa5jXYkXg/1S\n9hLqBGDHElthuYclMNPKaPV+i9PUsi/+7K94rQeMa7pCzrMqL56QDfBrxVQl\naPSRSacRx3VLkkhEtvI04WuAk3ISVMRn136oQi8mpRvg+o2S3EJKIKUrEUzP\nNvaFf49NlZ5N+dqEVlnypznORiAijxMJ5gDuCGEoZJ6sBFbnwAZksNolUKTT\nNCt/cdWX3SY9oVqIfcBzoDhRnBz9tQaKe5Jny+WrflcLzNOtvmES0rRhbWSV\nXA1f+4CDIUnc7kQA4HOEmcJaeC6H3MIrJ1+YYe1ysUQiC26Ihozo6WZHUMBD\n2qYIaAeUv+pqTo4JBdFILL8b2NkG/yDj0/HqDpWn+SXGxfK8lHMX96r/XYvX\nYzBIV2JMHLoDYqlRR7LSYir6uD+ThoITcycR+FXPLTwVf+lRpC4PMdFWD5rv\n6Yw3wzvI0oOIE+esduvIwPGzsCFqmlhVNYaCvMoo0x3hZ5okU/c40lFB84c5\neu9Y70X3OjJT0FE8YwXtCd8XoaiuRXTX8wtAKghl/x0tdE//xpxqTKWhEtxA\nXKMrGIQ3Idjz7WqYPPeK4AfeG8nGUWu3g/vbGq1Sq5yaZh0XooKvOAI+gSuQ\nThP0\r\n=3qfR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9/L3oOdHUkBBWmGpn4bnJ3KGzKsUNe2a5vUME7ou0lAIgBhBAGjRj1amXXhluoDEh9eZPHrZhxxn/lDI2uh8NPdg="}]},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"_npmUser":{"name":"maximkott","email":"maximkott@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/helpers-pagination_1.0.1_1587990012720_0.9037788511664318"},"_hasShrinkwrap":false},"2.0.0":{"name":"@bytesoftio/helpers-pagination","version":"2.0.0","author":{"name":"Maxim Kott"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"test":"jest","lint":"tsc --noEmit","build":"rm -rf dist && tsc -p tsconfig.build.json","release":"yarn run build && np"},"dependencies":{"lodash":"^4.17.15"},"devDependencies":{"@types/jest":"^25.1.4","@types/lodash":"^4.14.149","@types/node":"^13.9.1","jest":"^25.1.0","ts-jest":"^25.2.1","typescript":"^3.8.3"},"description":"## Installation","_id":"@bytesoftio/helpers-pagination@2.0.0","dist":{"shasum":"fe4c6649968428f6862b5df8b862f2a6415a5143","integrity":"sha512-olwPM8jpD7oBhu9rbMj2N3XoanOtrsUvIwYAwIccg5nGMbik8t4xhKjwSpbbgO9PcZQcccgLiOusWKVk4556Aw==","tarball":"https://registry.npmjs.org/@bytesoftio/helpers-pagination/-/helpers-pagination-2.0.0.tgz","fileCount":10,"unpackedSize":6701,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeptZwCRA9TVsSAnZWagAAPnoQAKQYcBPDZvEmHjn1ylfE\nxaZ8l8ZuI88gtoGXxJsZ4C+TZ13P6Gmn8gD3iNvSxVO5+2wMFpbQME/lJ83n\nDEnkTy4TGqnJtyGY/YB+gSssdLKBN7D7epP5TVJfgjD7R0SDp60YlEXJ9kbc\n/Fm3hKZWMKKLWYTqtabxnfREbCDXsnhx4CtLvsNgLmUMyoGTqJRD7Fjf8PdF\n8diffSB+STx2x0Fi2utjRyJ3jzhXgep0Kn2VGnCFBVJjvzJ2W3RTcZC7ep3T\nCxCggA9VcuLYnsc6mnKW2w6vTfdudw6J84tebUrBos5e3ph6Vp07/ts7weOP\nUNHbaoUHQqqlMnKUPCaz7dkTyWwvMg7/jMNAtYO1BhxaXCxWmphPP04s7fxJ\noaZHXoDdCmvn9tsK34ALetOrvLApDv5XLHb5PAT1UTT562PJ+ZxQx9X/5/jY\nqsUmR6SabTY6qus/531nbhHztP13LobeeBu8M/UuRmyrq79BDw/ps7aba9kk\nN764WUL14cH9GxS6Kg5s+IRqjRI5YKgshNgKB9zjUQmEAz5CPjXzQkwEsxlQ\nUnuKaR7EXsaGCNoBVB1SyUyoTWxWn90BEMV8wT2XVbtofSgqO2Jdr87+ha1i\nY/VmnaXb1Oi0gxv9aakZi6PG754TSdVPOK7/c+znfvQmMwuxSk342ogY6Niw\n29eQ\r\n=zuOH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBaP6k83tsWIujRNZxR1+KZwwJ8kZZNu5FmZ/PK9gXWWAiAGBj+RX2k+56JhshLN0v7pYFdHct8ViENMkuH/LobQKg=="}]},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"_npmUser":{"name":"maximkott","email":"maximkott@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/helpers-pagination_2.0.0_1587992175478_0.13184949865717144"},"_hasShrinkwrap":false},"2.0.1":{"name":"@bytesoftio/helpers-pagination","version":"2.0.1","author":{"name":"Maxim Kott"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/bytesoftio/helpers-pagination.git"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"test":"jest","lint":"tsc --noEmit","build":"rm -rf dist && tsc -p tsconfig.build.json","docs":"doctoc readme.md && typedoc src/index.ts --out docs --hideGenerator --tsconfig tsconfig.build.json --mode library --theme minimal","release":"yarn run build && np"},"dependencies":{"lodash":"^4.17.15"},"devDependencies":{"@types/jest":"^25.1.4","@types/lodash":"^4.14.149","@types/node":"^13.9.1","doctoc":"^1.4.0","jest":"^25.1.0","ts-jest":"^25.2.1","typedoc":"^0.17.0-3","typescript":"^3.8.3"},"description":"## Installation","_id":"@bytesoftio/helpers-pagination@2.0.1","dist":{"shasum":"cc068d706a79a21eab0fed0de4f967e79817f980","integrity":"sha512-r3D1DebZMTB69hKWx9dyltBwj9Qdr2VIbKDB4TmQ4BLkpL2L0Raa5xR2rtU0xMAThbsdaL7EnNBaKSDlYYWC9w==","tarball":"https://registry.npmjs.org/@bytesoftio/helpers-pagination/-/helpers-pagination-2.0.1.tgz","fileCount":10,"unpackedSize":7298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq0RuCRA9TVsSAnZWagAAcLYP/inBsxGtrcCP9Fj+ILnN\ncfoCQPPoQbhIHKQkBJlq4ErzL6PWnQ/P3MWGRmCk3lwoqYK6B+cTvnRNgp5i\ndqi/TjUTcmXEyijGhlNIknh+c2UStcjxIJcsWAX8iaOILhJetbijgJwOzaLy\nTTeVrt9ISKItfc28ykUJLKOkRWaGAMtlQTligp3aFRBUsfEds1L8AXvPEau+\nhyqO5VDKXX8rjqTNKP59SzD8abPXhYdyLVJmR8DiAGkrReLKK60VHQ2CwnM9\nlA19IH5ElmJrti+9r6AcNC+w1IAi5+15BZhy9IJ7z7We+vq75vKv9aDcwqRc\n5ZhLExxNReLZwRRv1eOGqAbmumJxMGOIrabQ2ACVavmxdviQJseH07W9Wfg+\nKzuHpugYdB90YxmWGSClg5wq9M02XoDOii1GGnNklaIgkgholf2wduhJ2JZ7\n/LxxbNmTj6gmRKdN6ADjM/YpVqb2Uu5bCil6MFGAwUpTl1NY0u93G6SoLp7k\nbh4vAIEfRKz68/FUgibI0Ebff6paleHAOW1JvHpc98fZivTQonxOnt1DtFRz\n2fPSmLlZb9A4WIYWAs+DffM+PRmw2xs+bLLArDNtKt2B4zHFju57QJ2Yh6to\nF6gSQ4qDxUEIW3HuzOhukyRHTisl22p6KJFY8kOPxEknFh/FNFuKdPGHBMBD\nb+Bv\r\n=Ny+S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl7cQu+SPkW6jZvtq45YoMnitTALhX8B5mNJrXlfo5UQIgLgAxSVSz8xwhiIwrC6rhmajFCbhZNOcw0VA0Amx8hF0="}]},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"_npmUser":{"name":"maximkott","email":"maximkott@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/helpers-pagination_2.0.1_1588282478079_0.7981360723139799"},"_hasShrinkwrap":false},"2.0.2":{"name":"@bytesoftio/helpers-pagination","version":"2.0.2","author":{"name":"Maxim Kott"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/bytesoftio/helpers-pagination.git"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"test":"jest","lint":"tsc --noEmit","build":"rm -rf dist && tsc -p tsconfig.build.json","docs":"doctoc readme.md && typedoc src/index.ts --out docs --hideGenerator --tsconfig tsconfig.build.json --mode library --theme minimal","release":"yarn run build && np"},"dependencies":{"lodash":"^4.17.15"},"devDependencies":{"@types/jest":"^25.1.4","@types/lodash":"^4.14.149","@types/node":"^13.9.1","doctoc":"^1.4.0","jest":"^25.1.0","ts-jest":"^25.2.1","typedoc":"^0.17.0-3","typescript":"^3.8.3"},"description":"## Installation","_id":"@bytesoftio/helpers-pagination@2.0.2","dist":{"shasum":"cbc5ea5c46ec7ea5782743edf515fe30359dc390","integrity":"sha512-BPS0C/fIQO4JBgHEHonQs/fPG8yEXsjRCrPdqOvV5wWULc7/+9YMF3SlbLjgyYLTchEIn0JTYjY1/Ij7yJ3Eiw==","tarball":"https://registry.npmjs.org/@bytesoftio/helpers-pagination/-/helpers-pagination-2.0.2.tgz","fileCount":10,"unpackedSize":7266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJerGXDCRA9TVsSAnZWagAAPeMP/2RNXeGlbE1HNaPtvPVK\n7tXqLhJUlGV/YtXlvRTAIy6IIY1cl7okeaLMWVYSJMmYLMyvy+5Bu4yhRHkG\ntkcgO4TTDSpWn8A7gJ+fuLWB+THI7WQc7u9N9qsf8q8E/p/BgD4o9FYubU5w\nRJMrhrz1oT7FpfPFD7Xlwrp+AZ43o2AQSbco6vMjgWGhLw+QahMq8rDjjoW4\nji6r+FvYN4RpqeosbXKPrzqZi/Vi9V0fVn2uE+roiMztFm4qzpiWRH/VL1KJ\nygsr7JwnnIEmrpfFJsfnuwJwURwQKNPe2WEp0l7bZi1Rad0U/oIsuHKus4b2\nbuWDfNadNPtpCpy+DxyJQO6AEZAX358rwDwiQ4NoJyb12LcaEvaTxViM+ae0\n20JPr1q2+g03LYhppl1/5h/Rh5Cq7BRumYmjSFNSnnH47AHuX/S8IQqs6exI\ni4Rtp/xKviqx6NnIs0fOLuvvnIAE4ldJ3/Sm/tuQbWOWbAjq5T0Kr0bdhBdl\n9H89qjhSaKm4X3WO5dYfWiATqgx1+zAIxNqHxbDm9vuA7LjR1Dyk3k3TryIg\nKVQzqXRD9l0ic4uMDvhrjBJXRmlOocuUxziGIqPz97r//E4sVNXxo9sndK0K\n0phxlyorAp0Ky3GTMhzqRyxlOOzQDsoHP3gDWbDMvnfa0UlHn338sJArHQdl\n1xAC\r\n=WCOZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdKMWP69W4RiYvuc1ihMx770Vfm72BiT0GmhT5Jdn27AiEAzVnup2hc1ANPbOhgNDf396aARlvyJP4vf9WNIfCYC08="}]},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"_npmUser":{"name":"maximkott","email":"maximkott@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/helpers-pagination_2.0.2_1588356547103_0.8710733276525204"},"_hasShrinkwrap":false}},"time":{"created":"2020-04-27T12:18:22.432Z","1.0.0":"2020-04-27T12:18:22.855Z","modified":"2022-04-04T21:22:24.439Z","1.0.1":"2020-04-27T12:20:13.073Z","2.0.0":"2020-04-27T12:56:15.662Z","2.0.1":"2020-04-30T21:34:38.210Z","2.0.2":"2020-05-01T18:09:07.213Z"},"maintainers":[{"name":"maximkott","email":"maximkott@gmail.com"}],"description":"## Installation","author":{"name":"Maxim Kott"},"license":"MIT","readme":"# @bytesoftio/helpers-pagination\n\n## Installation\n\n`yarn add @bytesoftio/helpers-pagination` or `npm install @bytesoftio/helpers-pagination`\n\n## Table of contents\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n\n- [Description](#description)\n- [createPagination](#createpagination)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n## Description\n\nCollection of helpers related to pagination.  \n\n## createPagination\n\nCalculate total amount of pages, visible pages, more / less indicators and so on, based on the current page, total\nitems, page size, etc.\n\nThis helper can be used to build paginations like:\n\n```\n< << ... 6 7 8 [9] 10 11 12 ... >> >\n< << 7 8 [9] 10 11 >> >\n<  ... 7 8 [9] 10 11  ... >\n< [9] >\n[ v Select page ]\n```\n\nUsage example:\n\n```ts\nimport { createPagination } from \"@bytesoftio/helpers-pagination\"\n\n// active page\nconst currentPage = 7\n// total number of items for pagination\nconst totalItems = 1337\n// how many items are visible on a single page\nconst pageSize = 20\n// how many pages you want to display to the left and right of the current page\nconst surroundBy = 2\n\nconst pagination = createPagination({ currentPage, totalItems, pageSize, surroundBy })\n```\n\nWith the calculated information below you can build almost every possible kind of pagination you can\nthink of.\n\n```js\n{\n  // active page\n  currentPage: 7,\n  // number of the first page, obviously...\n  firstPage: 1,\n  // number of the last page\n  lastPage: 67,\n  // first visible page based on the surroundBy \n  firstVisiblePage: 5,\n  // last visible page based on the surroundBy \n  lastVisiblePage: 9,\n  // all visible pages based on the surroundBy \n  visiblePages: [ 5, 6, 7, 8, 9 ],\n  // all available pages, for a dropdown for example \n  allPages: [\n     1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,\n    13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n    25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,\n    37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,\n    49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,\n    61, 62, 63, 64, 65, 66, 67\n  ],\n  // are there any previous pages?\n  hasPrevious: true,\n  // are there any next pages?\n  hasNext: true,\n  // are there any pages in between the first page and the first visible page?\n  hasLess: true,\n  // are there any pages in between the last page and the last visible page?\n  hasMore: true,\n  // how many items to skip, useful for an api call\n  itemsOffset: 120,\n  // how many items are visible per page\n  pageSize: 20,\n  // is current page the first one?\n  isFirstPage: false,\n  // is current page the last one?\n  isLastPage: false\n}\n```","readmeFilename":"readme.md","repository":{"type":"git","url":"https://github.com/bytesoftio/helpers-pagination.git"}}