Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tarekraafat/autocomplete.js

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tarekraafat/autocomplete.js - npm Package Compare versions

Comparing version 9.0.1 to 9.0.2

2

dist/js/autoComplete.js

@@ -533,3 +533,3 @@ (function (global, factory) {

eventEmitter(this.inputField, dataFeedback, "open");
document.addEventListener("focusout", function () {
document.addEventListener("click", function () {
return closeList(_this);

@@ -536,0 +536,0 @@ });

@@ -1,1 +0,1 @@

var e,t;e=this,t=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?n(Object(r),!0).forEach((function(n){t(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function s(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,s=function(){};return{s:s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}var o=function(e,t,n){e.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:t,cancelable:!0}))},a=function(e){var t=document.getElementById(e.resultsList.idName);t&&(t.remove(),e.inputField.removeAttribute("aria-activedescendant"),e.inputField.setAttribute("aria-expanded",!1),o(e.inputField,null,"close"))},l=function(e,t,n){var r=document.getElementById(e.resultsList.idName);if(r?r.innerHTML="":r=function(e){var t=document.createElement(e.resultsList.element);return t.setAttribute("id",e.resultsList.idName),t.setAttribute("class",e.resultsList.className),t.setAttribute("role","listbox"),e.resultsList.container&&e.resultsList.container(t),("string"==typeof e.resultsList.destination?document.querySelector(e.resultsList.destination):e.resultsList.destination()).insertAdjacentElement(e.resultsList.position,t),t}(e),e.inputField.setAttribute("aria-expanded",!0),n.length)for(var s=function(s){var o=t.results[s],a=function(e,t,n){var i=document.createElement(n.resultItem.element);return i.setAttribute("id","".concat(n.resultItem.idName,"_").concat(t)),i.setAttribute("class",n.resultItem.className),i.setAttribute("role","option"),i.innerHTML=e.match,n.resultItem.content&&n.resultItem.content(e,i),i}(o,s,e);a.addEventListener("click",(function(r){var a={event:r,matches:n,input:t.input,query:t.query,results:t.results,selection:i(i({},o),{},{index:s})};e.onSelection&&e.onSelection(a)})),r.appendChild(a)},o=0;o<t.results.length;o++)s(o);else e.resultsList.noResults?e.resultsList.noResults(r,t.query):r.remove()},u="keydown",c=function(e,t){var n=-1,r=function(r,a,l){r.preventDefault(),l?n++:n--,s(a),e.inputField.setAttribute("aria-activedescendant",a[n].id),o(r.srcElement,i(i({event:r},t),{},{selection:t.results[n]}),"navigate")},s=function(t){if(!t)return!1;!function(t){for(var n=0;n<t.length;n++)t[n].removeAttribute("aria-selected"),e.resultItem.selected.className&&t[n].classList.remove(e.resultItem.selected.className)}(t),n>=t.length&&(n=0),n<0&&(n=t.length-1),t[n].setAttribute("aria-selected","true"),e.resultItem.selected.className&&t[n].classList.add(e.resultItem.selected.className)},l=e.resultsList.navigation||function(t){var i=document.getElementById(e.resultsList.idName);if(i)switch(i=i.getElementsByTagName(e.resultItem.element),t.keyCode){case 27:e.inputField.value="",a(e);break;case 40:r(t,i,!0);break;case 38:r(t,i,!1);break;case 13:t.preventDefault(),n>-1&&(i[n].click(),a(e))}else e.inputField.removeEventListener(u,l)};e.inputField.autoCompleteNavigate&&e.inputField.removeEventListener(u,e.inputField.autoCompleteNavigate),e.inputField.autoCompleteNavigate=l,e.inputField.addEventListener(u,l)},d=function(e,t){for(var n=[],i=function(i){var r=e.data.store[i],o=function(s){var o=(s?r[s]:r).toString();if(o){var a="function"==typeof e.searchEngine?e.searchEngine(t,o):function(e,t,n){var i=n.diacritics?t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):t.toLowerCase();if("loose"===n.searchEngine){e=e.replace(/ /g,"");for(var r=[],s=0,o=0;o<i.length;o++){var a=t[o];s<e.length&&i[o]===e[s]&&(a=n.resultItem.highlight.render?'<span class="'.concat(n.resultItem.highlight.className,'">').concat(a,"</span>"):a,s++),r.push(a)}if(s===e.length)return r.join("")}else if(i.includes(e)){var l=new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i");return e=l.exec(t),n.resultItem.highlight.render?t.replace(e,'<span class="'.concat(n.resultItem.highlight.className,'">').concat(e,"</span>")):t}}(t,o,e);a&&s?n.push({key:s,index:i,match:a,value:r}):a&&!s&&n.push({index:i,match:a,value:r})}};if(e.data.key){var a,l=s(e.data.key);try{for(l.s();!(a=l.n()).done;)o(a.value)}catch(e){l.e(e)}finally{l.f()}}else o()},r=0;r<e.data.store.length;r++)i(r);return n};return function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.selector,i=void 0===n?"#autoComplete":n,r=e.placeHolder,s=e.observer,o=void 0!==s&&s,a=e.data,l=a.src,u=a.key,c=a.cache,d=void 0!==c&&c,h=a.store,f=a.results,m=e.query,v=e.trigger,p=(v=void 0===v?{}:v).event,g=void 0===p?["input"]:p,b=v.condition,y=void 0!==b&&b,L=e.threshold,N=void 0===L?1:L,F=e.debounce,E=void 0===F?0:F,k=e.diacritics,w=void 0!==k&&k,I=e.searchEngine,A=void 0===I?"strict":I,O=e.feedback,C=e.resultsList,j=(C=void 0===C?{}:C).render,x=void 0===j||j,S=C.container,P=void 0!==S&&S,T=C.destination,q=C.position,H=void 0===q?"afterend":q,D=C.element,R=void 0===D?"ul":D,M=C.idName,_=void 0===M?"autoComplete_list":M,z=C.className,B=void 0===z?"autoComplete_list":z,$=C.maxResults,U=void 0===$?5:$,G=C.navigation,J=void 0!==G&&G,K=C.noResults,Q=e.resultItem,V=(Q=void 0===Q?{}:Q).content,W=void 0!==V&&V,X=Q.element,Y=void 0===X?"li":X,Z=Q.idName,ee=Q.className,te=void 0===ee?"autoComplete_result":ee,ne=Q.highlight,ie=(ne=void 0===ne?{}:ne).render,re=void 0!==ie&&ie,se=ne.className,oe=void 0===se?"autoComplete_highlighted":se,ae=Q.selected,le=(ae=void 0===ae?{}:ae).className,ue=void 0===le?"autoComplete_selected":le,ce=e.onSelection;this.selector=i,this.observer=o,this.placeHolder=r,this.data={src:l,key:u,cache:d,store:h,results:f},this.query=m,this.trigger={event:g,condition:y},this.threshold=N,this.debounce=E,this.diacritics=w,this.searchEngine=A,this.feedback=O,this.resultsList={render:x,container:P,destination:T||this.selector,position:H,element:R,idName:_,className:B,maxResults:U,navigation:J,noResults:K},this.resultItem={content:W,element:Y,idName:Z,className:te,highlight:{render:re,className:oe},selected:{className:ue}},this.onSelection=ce,this.inputField="string"==typeof this.selector?document.querySelector(this.selector):this.selector(),this.observer?this.preInit():this.init()}var n,i,r;return n=t,(i=[{key:"start",value:function(e,t){var n=this,i=this.data.results?this.data.results(d(this,t)):d(this,t),r={input:e,query:t,matches:i,results:i.slice(0,this.resultsList.maxResults)};if(o(this.inputField,r,"results"),!this.resultsList.render)return this.feedback(r);l(this,r,i),c(this,r),o(this.inputField,r,"open"),document.addEventListener("focusout",(function(){return a(n)}))}},{key:"dataStore",value:function(){var e=this;return new Promise((function(t,n){return e.data.cache&&e.data.store?t(null):new Promise((function(t,n){return"function"==typeof e.data.src?e.data.src().then(t,n):t(e.data.src)})).then((function(i){try{return e.data.store=i,o(e.inputField,e.data.store,"fetch"),t()}catch(e){return n(e)}}),n)}))}},{key:"compose",value:function(e){var t=this;return new Promise((function(n,i){var r,s,o,l,u;return o=t.inputField,r=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?o.value.toLowerCase():o.innerHTML.toLowerCase(),l=r,s=(u=t).query&&u.query.manipulate?u.query.manipulate(l):u.diacritics?l.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):l,function(e,t,n){return e.trigger.condition?e.trigger.condition(t,n):n.length>=e.threshold&&n.replace(/ /g,"").length}(t,e,s)?t.dataStore().then((function(e){try{return t.start(r,s),c.call(t)}catch(e){return i(e)}}),i):(a(t),c.call(t));function c(){return n()}}))}},{key:"init",value:function(){var e,t,n,i,r=this;(e=this).inputField.setAttribute("role","combobox"),e.inputField.setAttribute("aria-haspopup",!0),e.inputField.setAttribute("aria-expanded",!1),e.inputField.setAttribute("aria-controls",e.resultsList.idName),e.inputField.setAttribute("aria-autocomplete","both"),this.placeHolder&&this.inputField.setAttribute("placeholder",this.placeHolder),this.hook=(t=function(e){r.compose(e)},n=this.debounce,function(){var e=this,r=arguments;clearTimeout(i),i=setTimeout((function(){return t.apply(e,r)}),n)}),this.trigger.event.forEach((function(e){r.inputField.removeEventListener(e,r.hook),r.inputField.addEventListener(e,r.hook)})),o(this.inputField,null,"init")}},{key:"preInit",value:function(){var e=this;new MutationObserver((function(t,n){var i,r=s(t);try{for(r.s();!(i=r.n()).done;)i.value,e.inputField&&(n.disconnect(),e.init())}catch(e){r.e(e)}finally{r.f()}})).observe(document,{childList:!0,subtree:!0})}},{key:"unInit",value:function(){this.inputField.removeEventListener("input",this.hook),o(this.inputField,null,"unInit")}}])&&e(n.prototype,i),r&&e(n,r),t}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).autoComplete=t();
var e,t;e=this,t=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?n(Object(r),!0).forEach((function(n){t(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function s(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,s=function(){};return{s:s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}var o=function(e,t,n){e.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:t,cancelable:!0}))},a=function(e){var t=document.getElementById(e.resultsList.idName);t&&(t.remove(),e.inputField.removeAttribute("aria-activedescendant"),e.inputField.setAttribute("aria-expanded",!1),o(e.inputField,null,"close"))},l=function(e,t,n){var r=document.getElementById(e.resultsList.idName);if(r?r.innerHTML="":r=function(e){var t=document.createElement(e.resultsList.element);return t.setAttribute("id",e.resultsList.idName),t.setAttribute("class",e.resultsList.className),t.setAttribute("role","listbox"),e.resultsList.container&&e.resultsList.container(t),("string"==typeof e.resultsList.destination?document.querySelector(e.resultsList.destination):e.resultsList.destination()).insertAdjacentElement(e.resultsList.position,t),t}(e),e.inputField.setAttribute("aria-expanded",!0),n.length)for(var s=function(s){var o=t.results[s],a=function(e,t,n){var i=document.createElement(n.resultItem.element);return i.setAttribute("id","".concat(n.resultItem.idName,"_").concat(t)),i.setAttribute("class",n.resultItem.className),i.setAttribute("role","option"),i.innerHTML=e.match,n.resultItem.content&&n.resultItem.content(e,i),i}(o,s,e);a.addEventListener("click",(function(r){var a={event:r,matches:n,input:t.input,query:t.query,results:t.results,selection:i(i({},o),{},{index:s})};e.onSelection&&e.onSelection(a)})),r.appendChild(a)},o=0;o<t.results.length;o++)s(o);else e.resultsList.noResults?e.resultsList.noResults(r,t.query):r.remove()},u="keydown",c=function(e,t){var n=-1,r=function(r,a,l){r.preventDefault(),l?n++:n--,s(a),e.inputField.setAttribute("aria-activedescendant",a[n].id),o(r.srcElement,i(i({event:r},t),{},{selection:t.results[n]}),"navigate")},s=function(t){if(!t)return!1;!function(t){for(var n=0;n<t.length;n++)t[n].removeAttribute("aria-selected"),e.resultItem.selected.className&&t[n].classList.remove(e.resultItem.selected.className)}(t),n>=t.length&&(n=0),n<0&&(n=t.length-1),t[n].setAttribute("aria-selected","true"),e.resultItem.selected.className&&t[n].classList.add(e.resultItem.selected.className)},l=e.resultsList.navigation||function(t){var i=document.getElementById(e.resultsList.idName);if(i)switch(i=i.getElementsByTagName(e.resultItem.element),t.keyCode){case 27:e.inputField.value="",a(e);break;case 40:r(t,i,!0);break;case 38:r(t,i,!1);break;case 13:t.preventDefault(),n>-1&&(i[n].click(),a(e))}else e.inputField.removeEventListener(u,l)};e.inputField.autoCompleteNavigate&&e.inputField.removeEventListener(u,e.inputField.autoCompleteNavigate),e.inputField.autoCompleteNavigate=l,e.inputField.addEventListener(u,l)},d=function(e,t){for(var n=[],i=function(i){var r=e.data.store[i],o=function(s){var o=(s?r[s]:r).toString();if(o){var a="function"==typeof e.searchEngine?e.searchEngine(t,o):function(e,t,n){var i=n.diacritics?t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):t.toLowerCase();if("loose"===n.searchEngine){e=e.replace(/ /g,"");for(var r=[],s=0,o=0;o<i.length;o++){var a=t[o];s<e.length&&i[o]===e[s]&&(a=n.resultItem.highlight.render?'<span class="'.concat(n.resultItem.highlight.className,'">').concat(a,"</span>"):a,s++),r.push(a)}if(s===e.length)return r.join("")}else if(i.includes(e)){var l=new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i");return e=l.exec(t),n.resultItem.highlight.render?t.replace(e,'<span class="'.concat(n.resultItem.highlight.className,'">').concat(e,"</span>")):t}}(t,o,e);a&&s?n.push({key:s,index:i,match:a,value:r}):a&&!s&&n.push({index:i,match:a,value:r})}};if(e.data.key){var a,l=s(e.data.key);try{for(l.s();!(a=l.n()).done;)o(a.value)}catch(e){l.e(e)}finally{l.f()}}else o()},r=0;r<e.data.store.length;r++)i(r);return n};return function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.selector,i=void 0===n?"#autoComplete":n,r=e.placeHolder,s=e.observer,o=void 0!==s&&s,a=e.data,l=a.src,u=a.key,c=a.cache,d=void 0!==c&&c,h=a.store,f=a.results,m=e.query,v=e.trigger,p=(v=void 0===v?{}:v).event,g=void 0===p?["input"]:p,b=v.condition,y=void 0!==b&&b,L=e.threshold,N=void 0===L?1:L,F=e.debounce,E=void 0===F?0:F,k=e.diacritics,w=void 0!==k&&k,I=e.searchEngine,A=void 0===I?"strict":I,O=e.feedback,C=e.resultsList,j=(C=void 0===C?{}:C).render,x=void 0===j||j,S=C.container,P=void 0!==S&&S,T=C.destination,q=C.position,H=void 0===q?"afterend":q,D=C.element,R=void 0===D?"ul":D,M=C.idName,_=void 0===M?"autoComplete_list":M,z=C.className,B=void 0===z?"autoComplete_list":z,$=C.maxResults,U=void 0===$?5:$,G=C.navigation,J=void 0!==G&&G,K=C.noResults,Q=e.resultItem,V=(Q=void 0===Q?{}:Q).content,W=void 0!==V&&V,X=Q.element,Y=void 0===X?"li":X,Z=Q.idName,ee=Q.className,te=void 0===ee?"autoComplete_result":ee,ne=Q.highlight,ie=(ne=void 0===ne?{}:ne).render,re=void 0!==ie&&ie,se=ne.className,oe=void 0===se?"autoComplete_highlighted":se,ae=Q.selected,le=(ae=void 0===ae?{}:ae).className,ue=void 0===le?"autoComplete_selected":le,ce=e.onSelection;this.selector=i,this.observer=o,this.placeHolder=r,this.data={src:l,key:u,cache:d,store:h,results:f},this.query=m,this.trigger={event:g,condition:y},this.threshold=N,this.debounce=E,this.diacritics=w,this.searchEngine=A,this.feedback=O,this.resultsList={render:x,container:P,destination:T||this.selector,position:H,element:R,idName:_,className:B,maxResults:U,navigation:J,noResults:K},this.resultItem={content:W,element:Y,idName:Z,className:te,highlight:{render:re,className:oe},selected:{className:ue}},this.onSelection=ce,this.inputField="string"==typeof this.selector?document.querySelector(this.selector):this.selector(),this.observer?this.preInit():this.init()}var n,i,r;return n=t,(i=[{key:"start",value:function(e,t){var n=this,i=this.data.results?this.data.results(d(this,t)):d(this,t),r={input:e,query:t,matches:i,results:i.slice(0,this.resultsList.maxResults)};if(o(this.inputField,r,"results"),!this.resultsList.render)return this.feedback(r);l(this,r,i),c(this,r),o(this.inputField,r,"open"),document.addEventListener("click",(function(){return a(n)}))}},{key:"dataStore",value:function(){var e=this;return new Promise((function(t,n){return e.data.cache&&e.data.store?t(null):new Promise((function(t,n){return"function"==typeof e.data.src?e.data.src().then(t,n):t(e.data.src)})).then((function(i){try{return e.data.store=i,o(e.inputField,e.data.store,"fetch"),t()}catch(e){return n(e)}}),n)}))}},{key:"compose",value:function(e){var t=this;return new Promise((function(n,i){var r,s,o,l,u;return o=t.inputField,r=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?o.value.toLowerCase():o.innerHTML.toLowerCase(),l=r,s=(u=t).query&&u.query.manipulate?u.query.manipulate(l):u.diacritics?l.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):l,function(e,t,n){return e.trigger.condition?e.trigger.condition(t,n):n.length>=e.threshold&&n.replace(/ /g,"").length}(t,e,s)?t.dataStore().then((function(e){try{return t.start(r,s),c.call(t)}catch(e){return i(e)}}),i):(a(t),c.call(t));function c(){return n()}}))}},{key:"init",value:function(){var e,t,n,i,r=this;(e=this).inputField.setAttribute("role","combobox"),e.inputField.setAttribute("aria-haspopup",!0),e.inputField.setAttribute("aria-expanded",!1),e.inputField.setAttribute("aria-controls",e.resultsList.idName),e.inputField.setAttribute("aria-autocomplete","both"),this.placeHolder&&this.inputField.setAttribute("placeholder",this.placeHolder),this.hook=(t=function(e){r.compose(e)},n=this.debounce,function(){var e=this,r=arguments;clearTimeout(i),i=setTimeout((function(){return t.apply(e,r)}),n)}),this.trigger.event.forEach((function(e){r.inputField.removeEventListener(e,r.hook),r.inputField.addEventListener(e,r.hook)})),o(this.inputField,null,"init")}},{key:"preInit",value:function(){var e=this;new MutationObserver((function(t,n){var i,r=s(t);try{for(r.s();!(i=r.n()).done;)i.value,e.inputField&&(n.disconnect(),e.init())}catch(e){r.e(e)}finally{r.f()}})).observe(document,{childList:!0,subtree:!0})}},{key:"unInit",value:function(){this.inputField.removeEventListener("input",this.hook),o(this.inputField,null,"unInit")}}])&&e(n.prototype,i),r&&e(n,r),t}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).autoComplete=t();
{
"name": "@tarekraafat/autocomplete.js",
"version": "9.0.1",
"version": "9.0.2",
"description": "Simple autocomplete pure vanilla Javascript library.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc