{"version":3,"file":"bootstrap-autocomplete.js","sources":["../../src/js/util.js","../../src/js/autocomplete.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\n\n/**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\nconst TRANSITION_END = 'transitionend'\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nfunction toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\nfunction getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined // eslint-disable-line no-undefined\n }\n }\n}\n\nfunction transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n}\n\nfunction setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''\n }\n\n try {\n return document.querySelector(selector) ? selector : null\n } catch (err) {\n return null\n }\n },\n\n getTransitionDurationFromElement(element) {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let transitionDuration = $(element).css('transition-duration')\n let transitionDelay = $(element).css('transition-delay')\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END)\n },\n\n // TODO: Remove in v5\n supportsTransitionEnd() {\n return Boolean(TRANSITION_END)\n },\n\n isElement(obj) {\n return (obj[0] || obj).nodeType\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && Util.isElement(value)\n ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n },\n\n findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return Util.findShadowRoot(element.parentNode)\n }\n}\n\nsetTransitionEndSupport()\n\nexport default Util\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap Autocomplete (v0.2.0): autocomplete.js\n * Licensed under MIT (https://github.com/iqbalfn/bootstrap-autocomplete/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'autocomplete'\nconst VERSION = '0.2.0'\nconst DATA_KEY = 'bs.autocomplete'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Default = {\n list : null,\n\n prefetch : null,\n\n filter : null,\n filterDelay : 300,\n filterMinChars : 1,\n filterRelation : null,\n\n maxResult : 10,\n\n onPick : null,\n onItemRendered : null,\n\n preProcess : null\n}\n\nconst DefaultType = {\n list : '(null|string|element)',\n\n prefetch : '(null|string)',\n\n filter : '(null|string)',\n filterDelay : 'number',\n filterMinChars : 'number',\n filterRelation : '(null|object)',\n\n maxResult : 'number',\n\n preProcess : '(null|function)',\n\n onPick : '(null|function)',\n onItemRendered : '(null|function)'\n}\n\nconst Event = {\n BLUR_DATA_API : `blur${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,\n INPUT_DATA_API : `input${EVENT_KEY}${DATA_API_KEY}`,\n\n PICK : `pick${EVENT_KEY}`,\n ITEM_RENDER : `itemrender${EVENT_KEY}`\n}\n\nconst ClassName = {\n DROPDOWN_MENU : 'dropdown-menu',\n DROPDOWN_ITEM : 'dropdown-item'\n}\n\nconst KeyCode = {\n ARROW_DOWN : 40,\n ARROW_UP : 38,\n ENTER : 13,\n ESCAPE : 27\n}\n\nconst Selector = {}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Autocomplete {\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n\n this._items = []\n this._labels = {}\n\n this._isShown = false\n this._dropdown = null\n this._spinner = null\n this._result = []\n this._query = ''\n this._preventClose = false\n this._timer = null\n this._relations = null\n\n if(element.hasAttribute('list')){\n this._config.list = '#' + element.getAttribute('list')\n element.removeAttribute('list')\n }\n\n if(!this._config.list && !this._config.prefetch && !this._config.filter)\n throw new TypeError('No data source provided')\n\n if(this._config.filterRelation)\n this._handleRelations()\n\n element.setAttribute('autocomplete', 'off')\n\n this._makeDropdown()\n this._makeSpinner()\n this._fetchPresetData()\n this._addElementListener()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n show(){\n if(this._isShown)\n return\n\n if(this._result.length)\n this._showDropdown()\n }\n\n hide(){\n if(!this._isShown)\n return\n\n this._hideDropdown()\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._element = null\n this._items = null\n this._labels = null\n this._isShown = null\n this._dropdown = null\n this._spinner = null\n this._result = null\n this._query = null\n this._preventClose = null\n if(this._timer)\n clearTimeout(this._timer)\n this._timer = null\n }\n\n // Private\n\n _addElementListener(){\n $(this._element).on(Event.KEYDOWN_DATA_API, e => {\n let prevent = false\n\n switch(e.keyCode){\n case KeyCode.ARROW_DOWN:\n if(e.altKey && !this._isShown){\n this._query = this._element.value.trim().toLowerCase()\n\n if(this._query){\n this._findFromList()\n prevent = true\n }\n }else{\n this._focusNext()\n prevent = true\n }\n break;\n\n case KeyCode.ARROW_UP:\n this._focusPrev()\n prevent = true\n break;\n\n case KeyCode.ENTER:\n if(this._isShown){\n let item = $(this._dropdown).children('.active').get(0)\n if(!item)\n item = $(this._dropdown).children(':first-child').get(0)\n\n if(item)\n this._selectItem(item)\n\n this.hide()\n prevent = true\n }\n break;\n\n case KeyCode.ESCAPE:\n prevent = true\n this.hide()\n break;\n }\n\n if(prevent)\n e.preventDefault()\n })\n\n $(this._element).on(Event.INPUT_DATA_API, e => {\n this._query = this._element.value.trim().toLowerCase()\n\n if(!this._query){\n this._truncateDropdown()\n this.hide()\n }else{\n this._findFromList()\n }\n })\n\n $(this._element).on(Event.BLUR_DATA_API, e => {\n if(this._preventClose)\n return\n setTimeout(() => this.hide(), 150)\n })\n }\n\n _fetchPresetData(){\n // from datalist\n if(this._config.list){\n let dataList = this._config.list\n if(typeof dataList === 'string')\n dataList = document.querySelector(this._config.list)\n\n if(dataList){\n Array.from(dataList.children).forEach(o => {\n let val = o.innerHTML.toLowerCase()\n if(this._items.includes(val))\n return\n\n this._items.push(val)\n this._labels[val] = o.innerHTML\n })\n }\n }\n\n // from prefetch\n if(this._config.prefetch){\n this._showSpinner()\n $.get(this._config.prefetch, res => {\n this._hideSpinner()\n if(this._config.preProcess)\n res = this._config.preProcess(res)\n\n res.forEach(i => {\n let val = i.toLowerCase()\n if(this._items.includes(val))\n return\n this._items.push(val)\n this._labels[val] = i\n })\n })\n }\n }\n\n _findFromAjax(){\n if(!this._config.filter)\n return\n if(this._dropdown.children.length >= this._config.maxResult)\n return\n\n if(this._timer)\n clearTimeout(this._timer)\n\n let vval = this._query\n this._timer = setTimeout(() => {\n if(vval != this._query)\n return\n this._showSpinner()\n\n let url = this._config.filter\n .replace(/%23/g, '#')\n .replace('#QUERY#', this._query)\n\n if(this._relations){\n let sep = url.includes('?') ? '&' : '?'\n\n for(let k in this._relations){\n let el = this._relations[k]\n let val= $(el).val()\n if(!val)\n continue;\n\n url+= `${sep}${k}=${val}`\n sep = '&'\n }\n }\n\n $.get(url, res => {\n this._hideSpinner()\n if(this._config.preProcess)\n res = this._config.preProcess(res)\n\n let local = []\n res.forEach(i => {\n let val = i.toLowerCase()\n if(this._items.includes(val))\n return\n\n this._items.push(val)\n this._labels[val] = i\n\n local.push(i)\n this._result.push(i)\n })\n\n if(local.length)\n this._renderItem(local)\n\n if(this._result.length)\n this.show()\n else\n this.hide()\n })\n }, this._config.filterDelay)\n }\n\n _findFromList(){\n this._truncateDropdown()\n this._result = []\n\n let local = []\n this._items.forEach(i => {\n if(!i.includes(this._query))\n return\n\n let label = this._labels[i]\n\n if(this._result.includes(label))\n return\n\n local.push(label)\n this._result.push(label)\n })\n\n // now render the result\n if(local.length){\n this._renderItem(local)\n this.show()\n }else{\n this.hide()\n }\n\n this._findFromAjax()\n }\n\n _focusNext(){\n let next = $(this._dropdown).children(':first-child').get(0)\n let focused = $(this._dropdown).children('.active').get(0)\n\n if(focused){\n focused.classList.remove('active')\n let tmpNext = $(focused).next().get(0)\n if(tmpNext)\n next = tmpNext\n }\n\n if(next)\n next.classList.add('active')\n }\n\n _focusPrev(){\n let next = $(this._dropdown).children(':last-child').get(0)\n let focused = $(this._dropdown).children('.active').get(0)\n\n if(focused){\n focused.classList.remove('active')\n let tmpNext = $(focused).prev().get(0)\n if(tmpNext)\n next = tmpNext\n }\n\n if(next)\n next.classList.add('active')\n }\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _handleRelations(){\n this._relations = []\n for(let name in this._config.filterRelation){\n let selector = this._config.filterRelation[name];\n this._relations[name] = $(selector).get(0)\n $(this._relations[name]).change(e => {\n this._element.value = ''\n $(this._element).change() // we need to trigger this manually\n this._items = []\n });\n }\n }\n\n _hideDropdown(){\n this._isShown = false\n this._dropdown.classList.remove('show')\n }\n\n _hideSpinner(){\n this._spinner.style.display = 'none'\n }\n\n _makeDropdown(){\n this._element.parentNode.style.position = 'relative'\n\n let tmpl = '
'\n\n this._dropdown = $(tmpl).appendTo(this._element.parentNode).get(0)\n\n }\n\n _makeSpinner(){\n let tmpl = '
'\n\n this._spinner = $(tmpl).appendTo(this._element.parentNode).get(0)\n\n $(this._spinner).css({\n position : 'absolute',\n right : $(this._element).css('padding-right'),\n top : (this._element.offsetTop + ((this._element.offsetHeight - this._spinner.offsetHeight)/2)) + 'px'\n })\n\n this._hideSpinner()\n }\n\n _renderItem(items){\n items.forEach(i => {\n if(this._dropdown.children.length >= this._config.maxResult)\n return\n\n let item = $('')\n let itemEl = item.get(0)\n\n item.text(i).appendTo(this._dropdown)\n\n if(this._config.onItemRendered)\n this._config.onItemRendered(this._element, itemEl)\n\n const renderEvent = $.Event(Event.ITEM_RENDER, {item:itemEl})\n\n $(this._element).trigger(renderEvent)\n\n item.on(Event.CLICK_DATA_API, e => {\n this._selectItem(e.target);\n this._preventClose = true\n this.hide()\n e.preventDefault()\n this._preventClose = false\n })\n })\n }\n\n _selectItem(item){\n this._element.value = item.innerText\n\n if(this._config.onPick)\n this._config.onPick(this._element, item)\n\n const pickEvent = $.Event(Event.PICK, {item})\n $(this._element).trigger(pickEvent)\n }\n\n _showDropdown(){\n this._isShown = true\n this._dropdown.classList.add('show')\n }\n\n _showSpinner(){\n this._spinner.style.display = 'inline-block'\n }\n\n _truncateDropdown(){\n this._dropdown.innerHTML = ''\n }\n\n // Static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = {\n ...Default,\n ...$(this).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data) {\n data = new Autocomplete(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined')\n throw new TypeError(`No method named \"${config}\"`)\n data[config](relatedTarget)\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Autocomplete._jQueryInterface\n$.fn[NAME].Constructor = Autocomplete\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Autocomplete._jQueryInterface\n}\n\nexport default Autocomplete\n"],"names":["TRANSITION_END","MAX_UID","MILLISECONDS_MULTIPLIER","toType","obj","toString","call","match","toLowerCase","getSpecialTransitionEndEvent","bindType","delegateType","handle","event","$","target","is","handleObj","handler","apply","arguments","undefined","transitionEndEmulator","duration","called","one","Util","setTimeout","triggerTransitionEnd","setTransitionEndSupport","fn","emulateTransitionEnd","special","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","hrefAttr","trim","querySelector","err","getTransitionDurationFromElement","transitionDuration","css","transitionDelay","floatTransitionDuration","parseFloat","floatTransitionDelay","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","nodeType","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase","findShadowRoot","documentElement","attachShadow","getRootNode","root","ShadowRoot","parentNode","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","Default","list","prefetch","filter","filterDelay","filterMinChars","filterRelation","maxResult","onPick","onItemRendered","preProcess","DefaultType","Event","BLUR_DATA_API","CLICK_DATA_API","KEYDOWN_DATA_API","INPUT_DATA_API","PICK","ITEM_RENDER","KeyCode","ARROW_DOWN","ARROW_UP","ENTER","ESCAPE","Autocomplete","_config","_getConfig","_element","_items","_labels","_isShown","_dropdown","_spinner","_result","_query","_preventClose","_timer","_relations","hasAttribute","removeAttribute","TypeError","_handleRelations","setAttribute","_makeDropdown","_makeSpinner","_fetchPresetData","_addElementListener","show","length","_showDropdown","hide","_hideDropdown","dispose","off","removeData","clearTimeout","on","e","prevent","keyCode","altKey","_findFromList","_focusNext","_focusPrev","item","children","get","_selectItem","preventDefault","_truncateDropdown","dataList","Array","from","forEach","o","val","innerHTML","includes","push","_showSpinner","res","_hideSpinner","i","_findFromAjax","vval","url","replace","sep","k","el","local","_renderItem","label","next","focused","classList","remove","tmpNext","add","prev","name","change","style","display","position","tmpl","appendTo","right","top","offsetTop","items","itemEl","text","renderEvent","innerText","pickEvent","_jQueryInterface","relatedTarget","each","data","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;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