{"_id":"@advanced-rest-client/arc-scroll-threshold","_rev":"12-c90d61f4bea9c731a45604abd9bcb29a","name":"@advanced-rest-client/arc-scroll-threshold","dist-tags":{"latest":"1.2.1"},"versions":{"1.0.0":{"name":"@advanced-rest-client/arc-scroll-threshold","version":"1.0.0","keywords":["web-components","scroll","threshold"],"license":"Apache-2.0","_id":"@advanced-rest-client/arc-scroll-threshold@1.0.0","maintainers":[{"name":"jarrodek","email":"jarrodek@gmail.com"}],"contributors":[{"name":"Pawel Psztyc"},{"name":"The Advanced REST client authors","email":"arc@mulesoft.com"}],"homepage":"https://github.com/advanced-rest-client/arc-scroll-threshold#readme","bugs":{"url":"https://github.com/advanced-rest-client/arc-scroll-threshold/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"45f0d51e72d133462aebc6989a1acc30825514da","tarball":"https://registry.npmjs.org/@advanced-rest-client/arc-scroll-threshold/-/arc-scroll-threshold-1.0.0.tgz","fileCount":13,"integrity":"sha512-nBf54Ad+WDGl4WgTnhzuPYQ+m2gtDocEBu11PBX8Q32E2TkYdaP0PCac4nOnus2+3J3IPHAL4/em6gyuaftX6w==","signatures":[{"sig":"MEQCIBe1SN8pAC+tWqQCHhgn3Kuuj8Sm9MFW81VovpTTiFZJAiA1ktuyPNHdOvBU0Je+rNlE8xAjjtOf9Mfo5DDUBqpRQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdM40tCRA9TVsSAnZWagAAo0gP/0pP0M8QugRcvSnZYnP3\nBcc2S3+5ofZYDM7Mjzw5QMfC00FEs4TKzjsxsvE3IAuLcxommO67kTNGKgA6\nJ98ynNk8dGy34wELXMsmCVLzui4sX6y8HbHyPHnWUgDyoQw0FQ9y/iUDVbg5\nETz0BCKXXZVYH3Df1qvnquH++xWhrq+BN4xE5JIYqe8c35oEr61zaBwYbnUd\nYAv8TPTtp7UicWJ7UXzhG73kPud3/sXDPESFlMeGM+vDNkH9nhnWqF3vYiQv\n7hQ0Rt9KFdX/WjrCRlyV+CSVDj2ztRnwVpo9+KN0shoQARtkjNXuhOqIxWyV\n83aky5em9V1yQ737zwwkECxhG5Sogf2RfApHtsPa+42wqo+bPPTMitEGKObs\nggVFalcE6oanitIhd/N2hbkjNOYceXJ4WW+cMuWWLc1kyrMEMurGeWugUfNG\nEHlS8x/I/Ihu7Y8a+Ku/vuvn0aUoKkgFSdMg+9KmVOfaFhKzlACbh4/lXCuB\nNpyvQDOAkXOx+Abo6NzH7Txq4GzFSWYY/3DnFCv4nLpm5OEjzi82qywevfb2\nfUg/vX2DbASNyDz+XFsFy1IB8ZTeaVGXkHDRaoxbOIxgAzqg9Uy1kqa2VB0C\nFj0Gt84DkZUYFNcUMiWbQUoCpGzcVpfYn+r0/dljb9Ry2rNp1L4nPSEMYHAq\n14as\r\n=tsOv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"arc-scroll-threshold.js","authors":["Pawel Psztyc","The Advanced REST client authors <arc@mulesoft.com>"],"gitHead":"40f5a6ccaf7ac9c721097c0cf0b1e79cec3719c3","scripts":{"lint":"npm run lint:eslint && npm run lint:prettier","test":"karma start --coverage","start":"es-dev-server --app-index demo/index.html --node-resolve --open --watch","format":"npm run format:eslint && npm run format:prettier","test:sl":"karma start karma.sl.config.js --legacy --coverage","test:watch":"karma start --auto-watch=true --single-run=false","lint:eslint":"eslint --ext .js,.html .","test:legacy":"karma start --legacy --coverage","update-types":"gen-typescript-declarations --deleteExisting --outDir .","format:eslint":"eslint --ext .js,.html . --fix","lint:prettier":"prettier \"**/*.js\" --list-different || (echo '↑↑ these files are not prettier formatted ↑↑' && exit 1)","format:prettier":"prettier \"**/*.js\" --write","test:legacy:watch":"karma start --legacy --auto-watch=true --single-run=false","start:compatibility":"es-dev-server --app-index demo/index.html --compatibility all --node-resolve --open --watch"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/advanced-rest-client/arc-scroll-threshold.git","type":"git"},"_npmVersion":"6.10.1","description":"Triggers an event when nearing the beginning or end of a scrollable element. Port of iron-scroll-threshold to LitElement","directories":{},"lint-staged":{"*.js":["eslint --fix","git add"]},"_nodeVersion":"10.15.3","dependencies":{"lit-element":"^2.0.1","@advanced-rest-client/arc-scroll-target-mixin":"1.0.2"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^1.0.0","sinon":"^7.3.2","lint-staged":"^8.0.0","es-dev-server":"^1.5.0","webpack-merge":"^4.1.5","@commitlint/cli":"^8.1.0","@open-wc/testing":"^0.11.1","@open-wc/testing-karma":"^2.0.6","@open-wc/prettier-config":"^0.1.0","@polymer/paper-toggle-button":"^3.0.1","@commitlint/config-conventional":"^7.0.0","@advanced-rest-client/a11y-suite":"^1.0.0","@advanced-rest-client/eslint-config":"^1.0.5","@google-web-components/google-signin":"^3.0.1","@polymer/gen-typescript-declarations":"^1.6.2","@advanced-rest-client/arc-demo-helper":"^1.0.3","@advanced-rest-client/testing-karma-sl":"^1.0.2"},"_npmOperationalInternal":{"tmp":"tmp/arc-scroll-threshold_1.0.0_1563659564903_0.3211834650100429","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@advanced-rest-client/arc-scroll-threshold","version":"1.2.0","keywords":["web-components","scroll","threshold"],"license":"Apache-2.0","_id":"@advanced-rest-client/arc-scroll-threshold@1.2.0","maintainers":[{"name":"carowright","email":"carolina.wright@mulesoft.com"},{"name":"jarrodek","email":"jarrodek@gmail.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"},{"name":"lbauret","email":"leandro.bauret@mulesoft.com"}],"contributors":[{"name":"Your name can be here!"}],"homepage":"https://github.com/advanced-rest-client/arc-scroll-threshold#readme","bugs":{"url":"https://github.com/advanced-rest-client/arc-scroll-threshold/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"4b77fd2c94864dc9debe994f489932f4a2fae24d","tarball":"https://registry.npmjs.org/@advanced-rest-client/arc-scroll-threshold/-/arc-scroll-threshold-1.2.0.tgz","fileCount":9,"integrity":"sha512-4mLmUIQzmF1tH/00Xrt8YPu7Bg1FCxosNdwarAqgBHkrAn04uS2btoh2clQQvTEoScZI+JdjV7x4Fx+6RM6c7Q==","signatures":[{"sig":"MEYCIQCKOFDkdTwFEa3wsCD33ewcQ5SfIrQLIQlpy45MwDj1jwIhAMWU6CfP58BExuu5gVdRuUmYOFKw0+mfKdnwupq9by2K","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSwELCRA9TVsSAnZWagAAdpkP/jCLpWxNyMNaZTzGUJ0J\nIhYskjTtNlAiFma773JtC3AMMBBfN+JCmNV2FzlQUHGnbe2El7sNR2o0904D\n6MJ/FjELNQzvH9lPYZlDfyIWgoiiXGzUoaSvPIKaKwfNBNkEoqcE10Gx2tpI\nlk3XJUCPxWU0szwA5aem8JRJ+8Kf7sZ7hoITXvtCRypfGa2aStYllza5q+mq\n982efD9eoSmf70u61LyY+LaXefEpdYGRdUAnNA9b5Ym8ImSIdrrCZBVU3T4A\nJBGt3WvA+dC0Y/vzRFuCXLR4SKFnm8kdA30rcGdT84ovjhgLYV0eT0GZq9VE\ndcVGZzlgpknh4oDSUb68dDLFbqJHAEPiGjJv8NDLuKl76WUjwr3k7x6udOjh\nTXRVxS5K0u19lg23ajPWspJOiGibAWQ7Z0ZQoxgvB0/agtzpxo+FXcN2YkZz\nd4gWyLUihwTPiOsRic3P89eb5bkpXbUIyorfECISGh47AY9roLFmDtMFNEvo\nVcaWd4IEzr/UQzDucmKXVimzARWMSmKeMivGFvND8n2fsSYlT9dlzSQTJCk1\nXMZIveWva3MuQT1+XdIOmbS9+Op+uL5eFjQWMb9rxuE3W9mpG5ktm/O1s5u5\np3Mw+Vv4ZfahkJer3k+wlYD4pbLemM6vfyk5lmd15UYrvq9O/HK03OR4sYYi\nECwf\r\n=uoH5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","authors":["Pawel Psztyc"],"gitHead":"5b0e950725a12bc6f550335daed28444a7e2b62b","scripts":{"lint":"npm run lint:eslint","test":"web-test-runner test/**/*.test.js --coverage --node-resolve --playwright --browsers chromium firefox webkit","start":"web-dev-server --app-index demo/index.html --node-resolve --open --watch --root-dir .","format":"npm run format:eslint","gen:wc":"wca analyze \"*.js\" --outFile custom-elements.json","lint:types":"tsc","test:watch":"web-test-runner test/**/*.test.js --node-resolve --watch --playwright --browsers chromium","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/advanced-rest-client/arc-scroll-threshold.git","type":"git"},"_npmVersion":"6.14.11","description":"Triggers an event when nearing the beginning or end of a scrollable element. Port of iron-scroll-threshold to LitElement","directories":{},"lint-staged":{"*.js":["eslint --fix"]},"_nodeVersion":"14.16.0","dependencies":{"lit-element":"^2.4.0","@advanced-rest-client/arc-scroll-target-mixin":"1.1.1"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"],"overrides":[{"files":["demo/**/*.js","test/**/*.js","**/demo/**/*.html"],"rules":{"no-console":"off","no-plusplus":"off","no-param-reassing":"off","no-unused-expressions":"off","class-methods-use-this":"off","import/no-extraneous-dependencies":"off"}},{"files":["**/*.js"],"rules":{"no-continue":"off","no-plusplus":"off","class-methods-use-this":"off"}}]},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.3.8","sinon":"^9.2.4","eslint":"^7.21.0","typescript":"^4.2.3","lint-staged":"^10.5.4","@commitlint/cli":"^12.0.1","@web/dev-server":"^0.1.8","@open-wc/testing":"^2.5.32","@web/test-runner":"^0.12.16","@open-wc/eslint-config":"^4.2.0","eslint-config-prettier":"^8.1.0","typescript-lit-html-plugin":"^0.9.0","@web/test-runner-playwright":"^0.8.4","@commitlint/config-conventional":"^12.0.1","@advanced-rest-client/arc-demo-helper":"^2.2.6","@anypoint-web-components/anypoint-switch":"^0.1.5","@anypoint-web-components/anypoint-checkbox":"^1.1.4"},"_npmOperationalInternal":{"tmp":"tmp/arc-scroll-threshold_1.2.0_1615528203023_0.996532286654463","host":"s3://npm-registry-packages"}},"1.2.1":{"name":"@advanced-rest-client/arc-scroll-threshold","version":"1.2.1","keywords":["web-components","scroll","threshold"],"license":"Apache-2.0","_id":"@advanced-rest-client/arc-scroll-threshold@1.2.1","maintainers":[{"name":"jarrodek","email":"jarrodek@gmail.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"},{"name":"lbauret","email":"leandro.bauret@mulesoft.com"},{"name":"carowright","email":"carolina.wright@mulesoft.com"}],"contributors":[{"name":"Your name can be here!"}],"homepage":"https://github.com/advanced-rest-client/arc-scroll-threshold#readme","bugs":{"url":"https://github.com/advanced-rest-client/arc-scroll-threshold/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"3c518f6ab1144b4894a64fc5a6aa56e69febe36e","tarball":"https://registry.npmjs.org/@advanced-rest-client/arc-scroll-threshold/-/arc-scroll-threshold-1.2.1.tgz","fileCount":9,"integrity":"sha512-jKloktga5AxxvnlkZOyZV8Q03vKWLueAOFyGfPl2RQqre1pJFyRhQ77lV/EFsu6in7dekT0AXbZSW1cxVb1c0g==","signatures":[{"sig":"MEYCIQDQEuZEVQk+sF/IyYFWr4bOaD6yjWrQk4oWxsJbFWbzEQIhAN9/pXWqLW1iGOtrwZVEmgML8qbEM5pcZ2O3BGGc5xWN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwtYcCRA9TVsSAnZWagAASIQP/i6lTmZU/f0pIYTht/OW\nUNKcQUrMzepzXhfJNToA0Orz8jfxoyG75HG16kMkMQAwm0SsZXYoH1fpBoFz\nR7UNigChNWWBt23GVgDaLPW+RU5LQuHXprP4yWHVZgWWD8RZR3CH68ciLy2g\n2zyZmejUuK7RqtTXveuXcw0LxuJktwn9aWiMk56mYaBbqTVWhfhbrlXGgA6A\nsYjF3wZGJUVfVnjKSRIQOoLt+cIQypqM5vMnC8ccy4egDYHuJcUiK5Fdk9sN\nkGMIH+GueR8JmkQZhwvXNVx4JxKEMDskgV7bFZhxNrwJ4EInbThKtw0J36pL\nm95TAsd84H4fhPg4n1KlfDIVS37IwLp1eQ8jWV006xaJS5WdzrEEDgFH3jrv\nMNr8+LDdMuwACZ0gH98OQhnIZNOZhWDgreRHwAsJHLfEvqVTZMGukw9TOmI8\nCZ915Uz+uhqk3xkoyWpc21Q6hEVLRzM33TdtVEb+Wvwjw1mrv2PrML/ZyJpB\nJZzu9qlbHtX+Xwg4JPGuetcwlK3boB0/B+edmIvgD1eO/h3ZwBhETBjoUiHl\nfWNyvnnIw3tRs/MKLBh1PCXQRMCRqijapAh4v4KVI3hDejvc0GytQ5Up//JL\nYCxP31WeA16nySNyd08bMB9muVdDWpAB6ZEbJw31iIhJx0MB9pPb/CS5iOrO\nGZII\r\n=5o/X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","authors":["Pawel Psztyc"],"gitHead":"886148af0a831648884c5f00ddf1a209f9e2233f","scripts":{"lint":"npm run lint:eslint","test":"web-test-runner test/**/*.test.js --coverage --node-resolve --playwright --browsers chromium firefox webkit","start":"web-dev-server --app-index demo/index.html --node-resolve --open --watch --root-dir .","format":"npm run format:eslint","gen:wc":"wca analyze \"*.js\" --outFile custom-elements.json","lint:types":"tsc","test:watch":"web-test-runner test/**/*.test.js --node-resolve --watch --playwright --browsers chromium","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/advanced-rest-client/arc-scroll-threshold.git","type":"git"},"_npmVersion":"6.14.15","description":"Triggers an event when nearing the beginning or end of a scrollable element. Port of iron-scroll-threshold to LitElement","directories":{},"lint-staged":{"*.js":["eslint --fix"]},"_nodeVersion":"14.18.0","dependencies":{"lit-element":"^2.5.1","@advanced-rest-client/arc-scroll-target-mixin":"1.1.3"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"],"overrides":[{"files":["demo/**/*.js","test/**/*.js","**/demo/**/*.html"],"rules":{"no-console":"off","no-plusplus":"off","no-param-reassing":"off","no-unused-expressions":"off","class-methods-use-this":"off","import/no-extraneous-dependencies":"off"}},{"files":["**/*.js"],"rules":{"no-continue":"off","no-plusplus":"off","class-methods-use-this":"off"}}]},"_hasShrinkwrap":false,"devDependencies":{"husky":"^7.0.2","sinon":"^11.1.2","eslint":"^8.0.1","typescript":"^4.4.4","lint-staged":"^10.5.4","@commitlint/cli":"^13.2.1","@web/dev-server":"^0.1.25","@open-wc/testing":"^3.0.1","@web/test-runner":"^0.13.20","@open-wc/eslint-config":"^6.0.0","eslint-config-prettier":"^8.3.0","typescript-lit-html-plugin":"^0.9.0","@web/test-runner-playwright":"^0.8.8","@commitlint/config-conventional":"^13.2.0","@advanced-rest-client/arc-demo-helper":"^2.2.6","@anypoint-web-components/anypoint-switch":"^0.1.11","@anypoint-web-components/anypoint-checkbox":"^1.2.3"},"_npmOperationalInternal":{"tmp":"tmp/arc-scroll-threshold_1.2.1_1634588577248_0.8998186782327913","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-07-20T21:52:44.732Z","modified":"2026-04-07T19:24:12.135Z","1.0.0":"2019-07-20T21:52:44.996Z","1.2.0":"2021-03-12T05:50:03.180Z","1.2.1":"2021-10-18T20:22:57.489Z"},"bugs":{"url":"https://github.com/advanced-rest-client/arc-scroll-threshold/issues","email":"arc@mulesoft.com"},"license":"Apache-2.0","homepage":"https://github.com/advanced-rest-client/arc-scroll-threshold#readme","keywords":["web-components","scroll","threshold"],"repository":{"url":"git://github.com/advanced-rest-client/arc-scroll-threshold.git","type":"git"},"description":"Triggers an event when nearing the beginning or end of a scrollable element. Port of iron-scroll-threshold to LitElement","contributors":[{"name":"Your name can be here!"}],"maintainers":[{"email":"jarrodek@gmail.com","name":"jarrodek"},{"email":"alexperez@mulesoft.com","name":"alexperez_march_2024"},{"email":"elmellidiego@gmail.com","name":"dmacias"}],"readme":"# DEPRECATED\n\nUse the `@anypoint-web-components/awc` module instead.\n\n-----\n\nThis is a port of [iron-scroll-threshold](https://github.com/PolymerElements/iron-scroll-threshold) that works with LitElement and plain WC.\n\n`arc-scroll-threshold` is a utility element that listens for `scroll` events from a scrollable region and dispatches events to indicate when the scroller has reached a pre-defined limit, specified in pixels from the upper and lower bounds of the scrollable region.\nThis element may wrap a scrollable region and will listen for `scroll` events bubbling through it from its children. In this case, care should be taken that only one scrollable region with the same orientation as this element is contained within. Alternatively, the `scrollTarget` property can be set/bound to a non-child scrollable region, from which it will listen for events.\n\nOnce a threshold has been reached, a `lower-threshold` or `upper-threshold` event are fired, at which point the user may perform actions such as lazily-loading more data to be displayed. After any work is done, the user must then clear the threshold by calling the `clearTriggers` method on this element, after which it will begin listening again for the scroll position to reach the threshold again assuming the content in the scrollable region has grown. If the user no longer wishes to receive events (e.g. all data has been exhausted), the threshold property in question (e.g. `lowerThreshold`) may be set to a falsy value to disable events and clear the associated triggered property.\n\n## Example\n\n### In a Polymer template\n\n```javascript\nstatic get template() {\n  return html`\n  <arc-scroll-threshold on-lower-threshold=\"loadMoreData\">\n    <template is=\"dom-repeat\" items=\"[[items]]\">\n      ...\n    </template>\n  </arc-scroll-threshold>`;\n}\n\nasync loadMoreData() {\n  // loadData() loads some API data from somewhere\n  const data = await loadData();\n  // Assuming `items` contains list of rendered items\n  this.items = [...this.items, ...data];\n}\n```\n\n### In a LitElement template\n\n```javascript\nimport { LitElement, html } from 'lit-element';\nimport '@advanced-rest-client/arc-scroll-threshold/arc-scroll-threshold.js';\n\nclass SampleElement extends LitElement {\n  render() {\n    const { items } = this;\n    return html`\n    <arc-scroll-threshold @lower-threshold=\"${this.loadMoreData}\">\n    ${items.map((item) => html`...`)}\n    </arc-scroll-threshold>`;\n  }\n\n  async loadMoreData() {\n    // loadData() loads some API data from somewhere\n    const data = await this.loadData();\n    // Assuming `items` contains list of rendered items\n    this.items = [...this.items, ...data];\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n### Imperative use\n\n```html\n<script type=\"module\" src=\"@advanced-rest-client/arc-scroll-threshold/arc-scroll-threshold.js\"></script>\n<arc-scroll-threshold></arc-scroll-threshold>\n<section id=\"list\"></section>\n<script>\n{\n  async function loadMore() {\n    const data = await loadData();\n    const fragment = document.createDocumentFragment();\n    data.forEach((item) => {\n      fragment.appendChild(createListItemElement(item))\n    })\n    document.getElementById('#list').appendChild(fragment)\n  }\n  document.querySelector('arc-scroll-threshold').onlowerthreshold = () => {\n    loadMore();\n  };\n}\n</script>\n```\n\n## Development\n\n```sh\ngit clone https://github.com/@advanced-rest-client/arc-scroll-threshold\ncd arc-scroll-threshold\nnpm install\n```\n\n### Running the demo locally\n\n```sh\nnpm start\n```\n\n### Running the tests\n\n```sh\nnpm test\n```\n","readmeFilename":"README.md"}