{"_id":"@alpinebricks/autocomplete","_rev":"1-237ae9093e6d5e30cafea153d3341d88","name":"@alpinebricks/autocomplete","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@alpinebricks/autocomplete","version":"0.0.1","description":"An autocomplete engine for Alpinejs","repository":{"type":"git","url":"https://github.com/emencia/alpinebricks"},"scripts":{"build":"rollup -c","watch":"rollup -c -w"},"author":{},"license":"MIT","peerDependencies":{"alpinejs":"^3.8.1","htmx.org":"^1.7.0"},"devDependencies":{"@rollup/plugin-commonjs":"^21.0.2","@rollup/plugin-node-resolve":"^13.1.3","@types/node":"^17.0.23","rollup":"^2.70.0","rollup-plugin-livereload":"^2.0.5","rollup-plugin-serve":"^1.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.31.2","tslib":"^2.3.1","typescript":"^4.5.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"main":"./dist/index.min.js","module":"./dist/index.es.js","types":"./dist/main.es.d.ts","exports":{".":{"import":"./dist/index.es.js","require":"./dist/index.min.js"}},"_id":"@alpinebricks/autocomplete@0.0.1","dist":{"shasum":"e53c857ae49ca525ff32ca36b6e3ef987366e081","integrity":"sha512-uBH5cYh6eO0Nve1sRrZ2t5+N0NCu4NoEjmrW/Ukq92s/BsMN3zopGF4vmm0p5HDkR+Tvw5TzdecpwQsi29ZjJw==","tarball":"https://registry.npmjs.org/@alpinebricks/autocomplete/-/autocomplete-0.0.1.tgz","fileCount":11,"unpackedSize":8382,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwrwzXzm3VnovRhHm6Rv6+zCBmMh8ePZAyFm9tMXWsvQIgfHyhw1M965WqbpWG06Rykt8n8j5lRLiZAQM5CMlyLP0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigmVvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNHRAAg6le2RbbrSxbb9Q/0/GXC5zIgFeCjVJGxJ+/JJ7vK6t/Dq4h\r\nh5TJTdXnWe3xSz4iBpt4HZgrToht0xSMVlC3GlGAD7RZPBNIweFmo4prr6I1\r\nqBLUnLu33C6TwIKsNCPMb6UL6UmGOIvI2nleO1Oo5i7tzBv3dhegldMVJ//6\r\nqtAcpx1G9FeCwZlYz/da504D0CGEkLPYvnKevKxuXMCoknuKqvuGEB44SW9X\r\nRXXK4W5lcOHHLZ/AsWezfH3mZpxBxoGn4G0lw4+8F96IW2thfDE2X2e2ImN1\r\nS4U/cmMS53ZmKn8Q0O+NNcCuG69lB+569vaeClJtbMP1rX8yitwUWpP+a5+v\r\nFFb5ht4eFIe7jcsBwxwxnpVXpgAnwkuPay4fgjJlZRqawrw2R/nl4zTesdQR\r\neR71y4J/dWL1ZPILjSX4XUX759b0bI882jExfqVxNyjvQGTVtp1PNM0GkGEC\r\nnx3kUy2Ird7TxPeZlbN1qCCKrEf6mC6qwVmDfuUtaAxcRQlO6b2yCXsP5TvL\r\nGlXF88p8m5ADCRnHELRJKt/FLb8IraGCrmEs2FFMEFgf5BQSpDb52PFga2gL\r\nMW+z9qz/5PV23YypRva5Al++epDrHn/xntrI10Jplh65BWsO4XKkyDGzDbWB\r\npquObHZD3+OjNacCle0gY2iDKRCuF0y9eNI=\r\n=tGEh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"synw","email":"synwx@pm.me"},"directories":{},"maintainers":[{"name":"synw","email":"synwx@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/autocomplete_0.0.1_1652712814825_0.9140989194379963"},"_hasShrinkwrap":false},"0.0.2":{"name":"@alpinebricks/autocomplete","version":"0.0.2","description":"An autocomplete engine for Alpinejs","repository":{"type":"git","url":"https://github.com/emencia/alpinebricks"},"scripts":{"build":"rollup -c","watch":"rollup -c -w"},"author":{},"license":"MIT","peerDependencies":{"alpinejs":"^3.8.1","htmx.org":"^1.7.0"},"devDependencies":{"@rollup/plugin-commonjs":"^21.0.2","@rollup/plugin-node-resolve":"^13.1.3","@types/node":"^17.0.23","rollup":"^2.70.0","rollup-plugin-livereload":"^2.0.5","rollup-plugin-serve":"^1.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.31.2","tslib":"^2.3.1","typescript":"^4.5.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"main":"./dist/index.min.js","module":"./dist/index.es.js","types":"./dist/main.es.d.ts","exports":{".":{"import":"./dist/index.es.js","require":"./dist/index.min.js"}},"_id":"@alpinebricks/autocomplete@0.0.2","dist":{"shasum":"918a8f897caef70b8380e2bd869d8bbc3beb5969","integrity":"sha512-QImgr2DVIgpoVYDj66u5MLK5ZPAdbC//6iN86g9gW5sCq6Y4sS02Dik2A65I/X+r89iT9hemDU42rcTnDcp9IQ==","tarball":"https://registry.npmjs.org/@alpinebricks/autocomplete/-/autocomplete-0.0.2.tgz","fileCount":11,"unpackedSize":8249,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDD0MIjseKYMn1KTiA34qilDNFv5LWbmiPeFdWEwJGdIQIgbbYdWcz7MeJ95e4XsVCTh+48I8AknPNZf3cXo1mx45k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihKdWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmruOA/+M2R0EXDGT6d6OZw4M+qFBoBoUUyCIt3BsYAHdIT7cLnEszPh\r\n62YtePsXn9jFFXigS6zUGG1YM84VZEOjd+9Wl3uPrKb2nfYwRrQokpB/oI08\r\nHqDZDhr8pN9c9LapPWUsYVKc4Qoyo2KQ1T/IHK4YQZWq9bdcnMFXIiHIdIs1\r\nh0Jg3DyrvtM3QsrB1xnkuoRZyhQ2Ohe0iyoihGSf9y793Jq/Y+abijaFYNsp\r\n4Q1tOTZeXXecFljVKy57WDyCN3jy7dXZsYrq+U5mzrRvZMu01sSprAUY1vd9\r\nqjuoA5t9Szzqs3McX0vL9rUuWm14fkDFbE66NLUJ4T7K7pp47nRFRAkgv/UP\r\nRkYLo/8cC9594E9SNQS4f/9tHOrK0ZPh3RtP3GG5KQ9hQsdbLll6oKmHs8yJ\r\nwPH+u9csk3C+9sNfXh1o/qbh7bxnM5xNvRpAs5vCRur4fMOthEIJl4mqkq4j\r\n2lwVUj7bvmF0+P5rwzW6Yul8fYryXho0sX6uQXNU1hHxBDH2oKxVM+/k0Fbx\r\nck3N2ILHfr6i5xQaRpUrMkkWM1C26wxO5sBBiHv585ieEQ7bb1cwsZpB1K1S\r\nltapoYWm4ALPlyvobmiHIiIbrtJiTTxfBV3EXPua/w+0RGFHqHZpY0r8MdjM\r\nG8ohBNsxx5/KIV6ea2DMr6OxoUeD5OCk8No=\r\n=DzGT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"synw","email":"synwx@pm.me"},"directories":{},"maintainers":[{"name":"synw","email":"synwx@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/autocomplete_0.0.2_1652860758824_0.8863018120546817"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-16T14:53:34.751Z","0.0.1":"2022-05-16T14:53:35.008Z","modified":"2022-05-18T07:59:19.082Z","0.0.2":"2022-05-18T07:59:18.942Z"},"maintainers":[{"name":"synw","email":"synwx@pm.me"}],"description":"An autocomplete engine for Alpinejs","repository":{"type":"git","url":"https://github.com/emencia/alpinebricks"},"author":{},"license":"MIT","readme":"# Autocomplete\n\nAn autocomplete engine\n\nInclude the Alpinejs lib in your html:\n\n```html\n  <script type=\"text/javascript\" src=\"https://unpkg.com/alpinejs@3.9.1/dist/cdn.min.js\" defer></script>\n```\n\nInclude the component:\n\n```html\n  <script src=\"https://unpkg.com/@alpinebricks/autocomplete@0.0.2/dist/index.min.js\"></script>\n```\n\nInitialize it:\n\n```html\n<script>\nvar $ac;\ndocument.addEventListener('alpine:init', () => {\n  $ac = $autocomplete.create();\n});\n</script>\n```\n\nUse it in html:\n\n```html\n<div x-data>\n  <input id=\"searchinput\"\n    x-on:input.debounce.500=\"$ac.search('http://localhost:8080/search.html', '#results')\"\n    x-model=\"$ac.searchTerm\" />\n  <div id=\"results\"></div>\n  <div class=\"px-2 py-5 d-flex justify-content-center\">\n    <div class=\"spinner-border\" role=\"status\" x-show=\"$ac.isLoading\">\n      <span class=\"visually-hidden\">Loading...</span>\n    </div>\n  </div>\n</div>\n```\n\n## Methods\n\n- `search(url: string, destSelector: string)`: run the search query\n- `resetSearch(idDest: string))`: reset the search results area\n- `resetInput(idDest: string)`: reset the search input content\n- `resetAll(inputIdDest: string, searchIdDest: string)`: reset both search area and input\n\n## Properties\n\n- `searchTerm`: the current searched term\n- `isLoading`: true if the search is running\n\n## Getters\n\n- `hasResults`: true if the search term is not null and the search has finished loading\n\n## Events\n\nA custom `result-loaded` event is fired when the search result is available. To use it in html:\n\n```html\n<div x-on:result-loaded.window=\"doSomething()\">\n```\n\nTo use it in javascript:\n\n```javascript\nwindow.addEventListener(\"result-loaded\", function (evt) {\n  console.log(\"result loaded event was triggered\")\n  // ...\n})\n```\n\n","readmeFilename":"README.md"}