ngx-bootstrap-ci
Version:
Native Angular Bootstrap Components
2 lines • 26.2 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("ngx-bootstrap/utils"),require("@angular/forms"),require("rxjs"),require("ngx-bootstrap/component-loader"),require("ngx-bootstrap/positioning"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-bootstrap/typeahead",["exports","@angular/core","ngx-bootstrap/utils","@angular/forms","rxjs","ngx-bootstrap/component-loader","ngx-bootstrap/positioning","rxjs/operators","@angular/common"],t):t((e["ngx-bootstrap"]=e["ngx-bootstrap"]||{},e["ngx-bootstrap"].typeahead={}),e.ng.core,e.utils,e.ng.forms,e.rxjs,e.componentLoader,e.positioning,e.rxjs.operators,e.ng.common)}(this,function(e,h,s,t,n,i,a,o,r){"use strict";var p={"Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ḃ":"B","Ḅ":"B","Ɓ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"D","Dž":"D","Đ":"D","Ƌ":"D","DZ":"DZ","DŽ":"DZ","É":"E","Ĕ":"E","Ě":"E","Ȩ":"E","Ḝ":"E","Ê":"E","Ế":"E","Ệ":"E","Ề":"E","Ể":"E","Ễ":"E","Ḙ":"E","Ë":"E","Ė":"E","Ẹ":"E","Ȅ":"E","È":"E","Ẻ":"E","Ȇ":"E","Ē":"E","Ḗ":"E","Ḕ":"E","Ę":"E","Ɇ":"E","Ẽ":"E","Ḛ":"E","Ꝫ":"ET","Ḟ":"F","Ƒ":"F","Ǵ":"G","Ğ":"G","Ǧ":"G","Ģ":"G","Ĝ":"G","Ġ":"G","Ɠ":"G","Ḡ":"G","Ǥ":"G","Ḫ":"H","Ȟ":"H","Ḩ":"H","Ĥ":"H","Ⱨ":"H","Ḧ":"H","Ḣ":"H","Ḥ":"H","Ħ":"H","Í":"I","Ĭ":"I","Ǐ":"I","Î":"I","Ï":"I","Ḯ":"I","İ":"I","Ị":"I","Ȉ":"I","Ì":"I","Ỉ":"I","Ȋ":"I","Ī":"I","Į":"I","Ɨ":"I","Ĩ":"I","Ḭ":"I","Ꝺ":"D","Ꝼ":"F","Ᵹ":"G","Ꞃ":"R","Ꞅ":"S","Ꞇ":"T","Ꝭ":"IS","Ĵ":"J","Ɉ":"J","Ḱ":"K","Ǩ":"K","Ķ":"K","Ⱪ":"K","Ꝃ":"K","Ḳ":"K","Ƙ":"K","Ḵ":"K","Ꝁ":"K","Ꝅ":"K","Ĺ":"L","Ƚ":"L","Ľ":"L","Ļ":"L","Ḽ":"L","Ḷ":"L","Ḹ":"L","Ⱡ":"L","Ꝉ":"L","Ḻ":"L","Ŀ":"L","Ɫ":"L","Lj":"L","Ł":"L","LJ":"LJ","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ń":"N","Ň":"N","Ņ":"N","Ṋ":"N","Ṅ":"N","Ṇ":"N","Ǹ":"N","Ɲ":"N","Ṉ":"N","Ƞ":"N","Nj":"N","Ñ":"N","NJ":"NJ","Ó":"O","Ŏ":"O","Ǒ":"O","Ô":"O","Ố":"O","Ộ":"O","Ồ":"O","Ổ":"O","Ỗ":"O","Ö":"O","Ȫ":"O","Ȯ":"O","Ȱ":"O","Ọ":"O","Ő":"O","Ȍ":"O","Ò":"O","Ỏ":"O","Ơ":"O","Ớ":"O","Ợ":"O","Ờ":"O","Ở":"O","Ỡ":"O","Ȏ":"O","Ꝋ":"O","Ꝍ":"O","Ō":"O","Ṓ":"O","Ṑ":"O","Ɵ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Õ":"O","Ṍ":"O","Ṏ":"O","Ȭ":"O","Ƣ":"OI","Ꝏ":"OO","Ɛ":"E","Ɔ":"O","Ȣ":"OU","Ṕ":"P","Ṗ":"P","Ꝓ":"P","Ƥ":"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P","Ꝙ":"Q","Ꝗ":"Q","Ŕ":"R","Ř":"R","Ŗ":"R","Ṙ":"R","Ṛ":"R","Ṝ":"R","Ȑ":"R","Ȓ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꜿ":"C","Ǝ":"E","Ś":"S","Ṥ":"S","Š":"S","Ṧ":"S","Ş":"S","Ŝ":"S","Ș":"S","Ṡ":"S","Ṣ":"S","Ṩ":"S","Ť":"T","Ţ":"T","Ṱ":"T","Ț":"T","Ⱦ":"T","Ṫ":"T","Ṭ":"T","Ƭ":"T","Ṯ":"T","Ʈ":"T","Ŧ":"T","Ɐ":"A","Ꞁ":"L","Ɯ":"M","Ʌ":"V","Ꜩ":"TZ","Ú":"U","Ŭ":"U","Ǔ":"U","Û":"U","Ṷ":"U","Ü":"U","Ǘ":"U","Ǚ":"U","Ǜ":"U","Ǖ":"U","Ṳ":"U","Ụ":"U","Ű":"U","Ȕ":"U","Ù":"U","Ủ":"U","Ư":"U","Ứ":"U","Ự":"U","Ừ":"U","Ử":"U","Ữ":"U","Ȗ":"U","Ū":"U","Ṻ":"U","Ų":"U","Ů":"U","Ũ":"U","Ṹ":"U","Ṵ":"U","Ꝟ":"V","Ṿ":"V","Ʋ":"V","Ṽ":"V","Ꝡ":"VY","Ẃ":"W","Ŵ":"W","Ẅ":"W","Ẇ":"W","Ẉ":"W","Ẁ":"W","Ⱳ":"W","Ẍ":"X","Ẋ":"X","Ý":"Y","Ŷ":"Y","Ÿ":"Y","Ẏ":"Y","Ỵ":"Y","Ỳ":"Y","Ƴ":"Y","Ỷ":"Y","Ỿ":"Y","Ȳ":"Y","Ɏ":"Y","Ỹ":"Y","Ź":"Z","Ž":"Z","Ẑ":"Z","Ⱬ":"Z","Ż":"Z","Ẓ":"Z","Ȥ":"Z","Ẕ":"Z","Ƶ":"Z","IJ":"IJ","Œ":"OE","ᴀ":"A","ᴁ":"AE","ʙ":"B","ᴃ":"B","ᴄ":"C","ᴅ":"D","ᴇ":"E","ꜰ":"F","ɢ":"G","ʛ":"G","ʜ":"H","ɪ":"I","ʁ":"R","ᴊ":"J","ᴋ":"K","ʟ":"L","ᴌ":"L","ᴍ":"M","ɴ":"N","ᴏ":"O","ɶ":"OE","ᴐ":"O","ᴕ":"OU","ᴘ":"P","ʀ":"R","ᴎ":"N","ᴙ":"R","ꜱ":"S","ᴛ":"T","ⱻ":"E","ᴚ":"R","ᴜ":"U","ᴠ":"V","ᴡ":"W","ʏ":"Y","ᴢ":"Z","á":"a","ă":"a","ắ":"a","ặ":"a","ằ":"a","ẳ":"a","ẵ":"a","ǎ":"a","â":"a","ấ":"a","ậ":"a","ầ":"a","ẩ":"a","ẫ":"a","ä":"a","ǟ":"a","ȧ":"a","ǡ":"a","ạ":"a","ȁ":"a","à":"a","ả":"a","ȃ":"a","ā":"a","ą":"a","ᶏ":"a","ẚ":"a","å":"a","ǻ":"a","ḁ":"a","ⱥ":"a","ã":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ḃ":"b","ḅ":"b","ɓ":"b","ḇ":"b","ᵬ":"b","ᶀ":"b","ƀ":"b","ƃ":"b","ɵ":"o","ć":"c","č":"c","ç":"c","ḉ":"c","ĉ":"c","ɕ":"c","ċ":"c","ƈ":"c","ȼ":"c","ď":"d","ḑ":"d","ḓ":"d","ȡ":"d","ḋ":"d","ḍ":"d","ɗ":"d","ᶑ":"d","ḏ":"d","ᵭ":"d","ᶁ":"d","đ":"d","ɖ":"d","ƌ":"d","ı":"i","ȷ":"j","ɟ":"j","ʄ":"j","dz":"dz","dž":"dz","é":"e","ĕ":"e","ě":"e","ȩ":"e","ḝ":"e","ê":"e","ế":"e","ệ":"e","ề":"e","ể":"e","ễ":"e","ḙ":"e","ë":"e","ė":"e","ẹ":"e","ȅ":"e","è":"e","ẻ":"e","ȇ":"e","ē":"e","ḗ":"e","ḕ":"e","ⱸ":"e","ę":"e","ᶒ":"e","ɇ":"e","ẽ":"e","ḛ":"e","ꝫ":"et","ḟ":"f","ƒ":"f","ᵮ":"f","ᶂ":"f","ǵ":"g","ğ":"g","ǧ":"g","ģ":"g","ĝ":"g","ġ":"g","ɠ":"g","ḡ":"g","ᶃ":"g","ǥ":"g","ḫ":"h","ȟ":"h","ḩ":"h","ĥ":"h","ⱨ":"h","ḧ":"h","ḣ":"h","ḥ":"h","ɦ":"h","ẖ":"h","ħ":"h","ƕ":"hv","í":"i","ĭ":"i","ǐ":"i","î":"i","ï":"i","ḯ":"i","ị":"i","ȉ":"i","ì":"i","ỉ":"i","ȋ":"i","ī":"i","į":"i","ᶖ":"i","ɨ":"i","ĩ":"i","ḭ":"i","ꝺ":"d","ꝼ":"f","ᵹ":"g","ꞃ":"r","ꞅ":"s","ꞇ":"t","ꝭ":"is","ǰ":"j","ĵ":"j","ʝ":"j","ɉ":"j","ḱ":"k","ǩ":"k","ķ":"k","ⱪ":"k","ꝃ":"k","ḳ":"k","ƙ":"k","ḵ":"k","ᶄ":"k","ꝁ":"k","ꝅ":"k","ĺ":"l","ƚ":"l","ɬ":"l","ľ":"l","ļ":"l","ḽ":"l","ȴ":"l","ḷ":"l","ḹ":"l","ⱡ":"l","ꝉ":"l","ḻ":"l","ŀ":"l","ɫ":"l","ᶅ":"l","ɭ":"l","ł":"l","lj":"lj","ſ":"s","ẜ":"s","ẛ":"s","ẝ":"s","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ᵯ":"m","ᶆ":"m","ń":"n","ň":"n","ņ":"n","ṋ":"n","ȵ":"n","ṅ":"n","ṇ":"n","ǹ":"n","ɲ":"n","ṉ":"n","ƞ":"n","ᵰ":"n","ᶇ":"n","ɳ":"n","ñ":"n","nj":"nj","ó":"o","ŏ":"o","ǒ":"o","ô":"o","ố":"o","ộ":"o","ồ":"o","ổ":"o","ỗ":"o","ö":"o","ȫ":"o","ȯ":"o","ȱ":"o","ọ":"o","ő":"o","ȍ":"o","ò":"o","ỏ":"o","ơ":"o","ớ":"o","ợ":"o","ờ":"o","ở":"o","ỡ":"o","ȏ":"o","ꝋ":"o","ꝍ":"o","ⱺ":"o","ō":"o","ṓ":"o","ṑ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","õ":"o","ṍ":"o","ṏ":"o","ȭ":"o","ƣ":"oi","ꝏ":"oo","ɛ":"e","ᶓ":"e","ɔ":"o","ᶗ":"o","ȣ":"ou","ṕ":"p","ṗ":"p","ꝓ":"p","ƥ":"p","ᵱ":"p","ᶈ":"p","ꝕ":"p","ᵽ":"p","ꝑ":"p","ꝙ":"q","ʠ":"q","ɋ":"q","ꝗ":"q","ŕ":"r","ř":"r","ŗ":"r","ṙ":"r","ṛ":"r","ṝ":"r","ȑ":"r","ɾ":"r","ᵳ":"r","ȓ":"r","ṟ":"r","ɼ":"r","ᵲ":"r","ᶉ":"r","ɍ":"r","ɽ":"r","ↄ":"c","ꜿ":"c","ɘ":"e","ɿ":"r","ś":"s","ṥ":"s","š":"s","ṧ":"s","ş":"s","ŝ":"s","ș":"s","ṡ":"s","ṣ":"s","ṩ":"s","ʂ":"s","ᵴ":"s","ᶊ":"s","ȿ":"s","ɡ":"g","ᴑ":"o","ᴓ":"o","ᴝ":"u","ť":"t","ţ":"t","ṱ":"t","ț":"t","ȶ":"t","ẗ":"t","ⱦ":"t","ṫ":"t","ṭ":"t","ƭ":"t","ṯ":"t","ᵵ":"t","ƫ":"t","ʈ":"t","ŧ":"t","ᵺ":"th","ɐ":"a","ᴂ":"ae","ǝ":"e","ᵷ":"g","ɥ":"h","ʮ":"h","ʯ":"h","ᴉ":"i","ʞ":"k","ꞁ":"l","ɯ":"m","ɰ":"m","ᴔ":"oe","ɹ":"r","ɻ":"r","ɺ":"r","ⱹ":"r","ʇ":"t","ʌ":"v","ʍ":"w","ʎ":"y","ꜩ":"tz","ú":"u","ŭ":"u","ǔ":"u","û":"u","ṷ":"u","ü":"u","ǘ":"u","ǚ":"u","ǜ":"u","ǖ":"u","ṳ":"u","ụ":"u","ű":"u","ȕ":"u","ù":"u","ủ":"u","ư":"u","ứ":"u","ự":"u","ừ":"u","ử":"u","ữ":"u","ȗ":"u","ū":"u","ṻ":"u","ų":"u","ᶙ":"u","ů":"u","ũ":"u","ṹ":"u","ṵ":"u","ᵫ":"ue","ꝸ":"um","ⱴ":"v","ꝟ":"v","ṿ":"v","ʋ":"v","ᶌ":"v","ⱱ":"v","ṽ":"v","ꝡ":"vy","ẃ":"w","ŵ":"w","ẅ":"w","ẇ":"w","ẉ":"w","ẁ":"w","ⱳ":"w","ẘ":"w","ẍ":"x","ẋ":"x","ᶍ":"x","ý":"y","ŷ":"y","ÿ":"y","ẏ":"y","ỵ":"y","ỳ":"y","ƴ":"y","ỷ":"y","ỿ":"y","ȳ":"y","ẙ":"y","ɏ":"y","ỹ":"y","ź":"z","ž":"z","ẑ":"z","ʑ":"z","ⱬ":"z","ż":"z","ẓ":"z","ȥ":"z","ẕ":"z","ᵶ":"z","ᶎ":"z","ʐ":"z","ƶ":"z","ɀ":"z","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ij":"ij","œ":"oe","st":"st","ₐ":"a","ₑ":"e","ᵢ":"i","ⱼ":"j","ₒ":"o","ᵣ":"r","ᵤ":"u","ᵥ":"v","ₓ":"x"},l=function O(e){Object.assign(this,e)},c=function(){function e(e,t,i){void 0===t&&(t=e),void 0===i&&(i=!1),this.item=e,this.value=t,this.header=i}return e.prototype.isHeader=function(){return this.header},e.prototype.toString=function(){return this.value},e}();function u(e){var t="function"==typeof Symbol&&e[Symbol.iterator],i=0;return t?t.call(e):{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function d(e){return e?e.replace(/[^A-Za-z0-9\[\] ]/g,function(e){return p[e]||e}):""}function y(e,t,i){void 0===t&&(t=" "),void 0===i&&(i="");for(var n,a="(?:["+i+"])([^"+i+"]+)(?:["+i+"])|([^"+t+"]+)",o=e.split(new RegExp(a,"g")),s=[],r=o.length,h=new RegExp("["+i+"]+","g"),p=0;p<r;p+=1)(n=o[p])&&n.length&&n!==t&&s.push(n.replace(h,""));return s}function m(e,t){if(!t||"object"!=typeof e)return e.toString();if(t.endsWith("()"))return e[t.slice(0,t.length-2)]().toString();var i,n,a=t.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".");try{for(var o=u(a),s=o.next();!s.done;s=o.next()){var r=s.value;r in e&&(e=e[r])}}catch(h){i={error:h}}finally{try{s&&!s.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return e?e.toString():""}var g=function(){function e(e,t){this.renderer=t,this.isFocused=!1,this._matches=[],this.isScrolledIntoView=function(e){var t=this.ulElement.nativeElement.scrollTop,i=t+Number(this.ulElement.nativeElement.offsetHeight),n=e.offsetTop;return n+e.offsetHeight<=i&&t<=n},this.element=e}return Object.defineProperty(e.prototype,"isBs4",{get:function(){return!s.isBs3()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matches",{get:function(){return this._matches},set:function(e){var t=this;this._matches=e,this.needScrollbar=this.typeaheadScrollable&&this.typeaheadOptionsInScrollableView<this.matches.length,this.typeaheadScrollable&&setTimeout(function(){t.setScrollableMode()}),0<this._matches.length&&(this._active=this._matches[0],this._active.isHeader()&&this.nextActiveMatch())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsListTemplate",{get:function(){return this.parent?this.parent.optionsListTemplate:undefined},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadScrollable",{get:function(){return!!this.parent&&this.parent.typeaheadScrollable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadOptionsInScrollableView",{get:function(){return this.parent?this.parent.typeaheadOptionsInScrollableView:5},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemTemplate",{get:function(){return this.parent?this.parent.typeaheadItemTemplate:undefined},enumerable:!0,configurable:!0}),e.prototype.selectActiveMatch=function(e){this._active&&this.parent.typeaheadSelectFirstItem&&this.selectMatch(this._active),!this.parent.typeaheadSelectFirstItem&&e&&this.selectMatch(this._active)},e.prototype.prevActiveMatch=function(){var e=this.matches.indexOf(this._active);this._active=this.matches[e-1<0?this.matches.length-1:e-1],this._active.isHeader()&&this.prevActiveMatch(),this.typeaheadScrollable&&this.scrollPrevious(e)},e.prototype.nextActiveMatch=function(){var e=this.matches.indexOf(this._active);this._active=this.matches[e+1>this.matches.length-1?0:e+1],this._active.isHeader()&&this.nextActiveMatch(),this.typeaheadScrollable&&this.scrollNext(e)},e.prototype.selectActive=function(e){this.isFocused=!0,this._active=e},e.prototype.highlight=function(e,t){var i,n,a=e.value,o=(this.parent&&this.parent.typeaheadLatinize?d(a):a).toLowerCase();if("object"==typeof t)for(var s=t.length,r=0;r<s;r+=1)i=o.indexOf(t[r]),n=t[r].length,0<=i&&0<n&&(a=a.substring(0,i)+"<strong>"+a.substring(i,i+n)+"</strong>"+a.substring(i+n),o=o.substring(0,i)+" "+" ".repeat(n)+" "+o.substring(i+n));else t&&(i=o.indexOf(t),n=t.length,0<=i&&0<n&&(a=a.substring(0,i)+"<strong>"+a.substring(i,i+n)+"</strong>"+a.substring(i+n)));return a},e.prototype.focusLost=function(){this.isFocused=!1},e.prototype.isActive=function(e){return this._active===e},e.prototype.selectMatch=function(e,t){var i=this;return void 0===t&&(t=void 0),t&&(t.stopPropagation(),t.preventDefault()),this.parent.changeModel(e),setTimeout(function(){return i.parent.typeaheadOnSelect.emit(e)},0),!1},e.prototype.setScrollableMode=function(){if(this.ulElement||(this.ulElement=this.element),this.liElements.first){var e=s.Utils.getStyles(this.ulElement.nativeElement),t=s.Utils.getStyles(this.liElements.first.nativeElement),i=parseFloat((e["padding-bottom"]?e["padding-bottom"]:"").replace("px","")),n=parseFloat((e["padding-top"]?e["padding-top"]:"0").replace("px","")),a=parseFloat((t.height?t.height:"0").replace("px","")),o=this.typeaheadOptionsInScrollableView*a;this.guiHeight=o+n+i+"px"}this.renderer.setStyle(this.element.nativeElement,"visibility","visible")},e.prototype.scrollPrevious=function(e){if(0!==e){if(this.liElements){var t=this.liElements.toArray()[e-1];t&&!this.isScrolledIntoView(t.nativeElement)&&(this.ulElement.nativeElement.scrollTop=t.nativeElement.offsetTop)}}else this.scrollToBottom()},e.prototype.scrollNext=function(e){if(e+1>this.matches.length-1)this.scrollToTop();else if(this.liElements){var t=this.liElements.toArray()[e+1];t&&!this.isScrolledIntoView(t.nativeElement)&&(this.ulElement.nativeElement.scrollTop=t.nativeElement.offsetTop-Number(this.ulElement.nativeElement.offsetHeight)+Number(t.nativeElement.offsetHeight))}},e.prototype.scrollToBottom=function(){this.ulElement.nativeElement.scrollTop=this.ulElement.nativeElement.scrollHeight},e.prototype.scrollToTop=function(){this.ulElement.nativeElement.scrollTop=0},e.decorators=[{type:h.Component,args:[{selector:"typeahead-container",template:'\x3c!-- inject options list template --\x3e\n<ng-template [ngTemplateOutlet]="optionsListTemplate || (isBs4 ? bs4Template : bs3Template)"\n [ngTemplateOutletContext]="{matches:matches, itemTemplate:itemTemplate, query:query}"></ng-template>\n\n\x3c!-- default options item template --\x3e\n<ng-template #bsItemTemplate let-match="match" let-query="query"><span [innerHtml]="highlight(match, query)"></span>\n</ng-template>\n\n\x3c!-- Bootstrap 3 options list template --\x3e\n<ng-template #bs3Template>\n <ul class="dropdown-menu"\n #ulElement\n [style.overflow-y]="needScrollbar ? \'scroll\': \'auto\'"\n [style.height]="needScrollbar ? guiHeight: \'auto\'">\n <ng-template ngFor let-match let-i="index" [ngForOf]="matches">\n <li #liElements *ngIf="match.isHeader()" class="dropdown-header">{{ match }}</li>\n <li #liElements *ngIf="!match.isHeader()" [class.active]="isActive(match)" (mouseenter)="selectActive(match)">\n <a href="#" (click)="selectMatch(match, $event)" tabindex="-1">\n <ng-template [ngTemplateOutlet]="itemTemplate || bsItemTemplate"\n [ngTemplateOutletContext]="{item:match.item, index:i, match:match, query:query}"></ng-template>\n </a>\n </li>\n </ng-template>\n </ul>\n</ng-template>\n\n\x3c!-- Bootstrap 4 options list template --\x3e\n<ng-template #bs4Template>\n <ng-template ngFor let-match let-i="index" [ngForOf]="matches">\n <h6 *ngIf="match.isHeader()" class="dropdown-header">{{ match }}</h6>\n <ng-template [ngIf]="!match.isHeader()">\n <button #liElements\n class="dropdown-item"\n (click)="selectMatch(match, $event)"\n (mouseenter)="selectActive(match)"\n [class.active]="isActive(match)">\n <ng-template [ngTemplateOutlet]="itemTemplate || bsItemTemplate"\n [ngTemplateOutletContext]="{item:match.item, index:i, match:match, query:query}"></ng-template>\n </button>\n </ng-template>\n </ng-template>\n</ng-template>\n',host:{"class":"dropdown open","[class.dropdown-menu]":"isBs4","[style.overflow-y]":"isBs4 && needScrollbar ? 'scroll': 'visible'","[style.height]":"isBs4 && needScrollbar ? guiHeight: 'auto'","[style.visibility]":"typeaheadScrollable ? 'hidden' : 'visible'","[class.dropup]":"dropup",style:"position: absolute;display: block;"},styles:["\n :host.dropdown {\n z-index: 1000;\n }\n "]}]}],e.ctorParameters=function(){return[{type:h.ElementRef},{type:h.Renderer2}]},e.propDecorators={ulElement:[{type:h.ViewChild,args:["ulElement"]}],liElements:[{type:h.ViewChildren,args:["liElements"]}],focusLost:[{type:h.HostListener,args:["mouseleave"]},{type:h.HostListener,args:["blur"]}]},e}(),f=function(){function e(){this.adaptivePosition=!1,this.hideResultsOnBlur=!0,this.selectFirstItem=!0,this.minLength=1}return e.decorators=[{type:h.Injectable}],e}(),v=function(){function e(e,t,i,n,a,o,s,r){this.changeDetection=i,this.element=n,this.ngControl=a,this.positionService=o,this.renderer=s,this.typeaheadMinLength=void 0,this.typeaheadAsync=void 0,this.typeaheadLatinize=!0,this.typeaheadSingleWords=!0,this.typeaheadWordDelimiters=" ",this.typeaheadPhraseDelimiters="'\"",this.typeaheadScrollable=!1,this.typeaheadOptionsInScrollableView=5,this.typeaheadSelectFirstItem=!0,this.typeaheadLoading=new h.EventEmitter,this.typeaheadNoResults=new h.EventEmitter,this.typeaheadOnSelect=new h.EventEmitter,this.typeaheadOnBlur=new h.EventEmitter,this.dropup=!1,this.isActiveItemChanged=!1,this.isTypeaheadOptionsListActive=!1,this.keyUpEventEmitter=new h.EventEmitter,this.placement="bottom-left",this._subscriptions=[],this._typeahead=e.createLoader(n,r,s).provide({provide:f,useValue:t}),Object.assign(this,{typeaheadHideResultsOnBlur:t.hideResultsOnBlur,typeaheadSelectFirstItem:t.selectFirstItem,typeaheadMinLength:t.minLength,adaptivePosition:t.adaptivePosition})}return e.prototype.ngOnInit=function(){this.typeaheadOptionsLimit=this.typeaheadOptionsLimit||20,this.typeaheadMinLength=void 0===this.typeaheadMinLength?1:this.typeaheadMinLength,this.typeaheadWaitMs=this.typeaheadWaitMs||0,this.typeaheadAsync!==undefined||n.isObservable(this.typeahead)||(this.typeaheadAsync=!1),n.isObservable(this.typeahead)&&(this.typeaheadAsync=!0),this.typeaheadAsync?this.asyncActions():this.syncActions()},e.prototype.onInput=function(e){var t=e.target.value!==undefined?e.target.value:e.target.textContent!==undefined?e.target.textContent:e.target.innerText;null!=t&&t.trim().length>=this.typeaheadMinLength?(this.typeaheadLoading.emit(!0),this.keyUpEventEmitter.emit(e.target.value)):(this.typeaheadLoading.emit(!1),this.typeaheadNoResults.emit(!1),this.hide())},e.prototype.onChange=function(e){if(this._container){if(27===e.keyCode||"Escape"===e.key)return void this.hide();if(38===e.keyCode||"ArrowUp"===e.key)return this.isActiveItemChanged=!0,void this._container.prevActiveMatch();if(40===e.keyCode||"ArrowDown"===e.key)return this.isActiveItemChanged=!0,void this._container.nextActiveMatch()}},e.prototype.onFocus=function(){0===this.typeaheadMinLength&&(this.typeaheadLoading.emit(!0),this.keyUpEventEmitter.emit(this.element.nativeElement.value||""))},e.prototype.onBlur=function(){this._container&&!this._container.isFocused&&this.typeaheadOnBlur.emit(this._container.active)},e.prototype.onKeydown=function(e){if(this._container&&(9===e.keyCode||"Tab"===e.key||13===e.keyCode||"Enter"===e.key)){if(e.preventDefault(),this.typeaheadSelectFirstItem)return void this._container.selectActiveMatch();this.typeaheadSelectFirstItem||(this._container.selectActiveMatch(this.isActiveItemChanged),this.isActiveItemChanged=!1,this.hide())}},e.prototype.changeModel=function(e){var t=e.value;this.ngControl.viewToModelUpdate(t),this.ngControl.control.setValue(t),this.changeDetection.markForCheck(),this.hide()},Object.defineProperty(e.prototype,"matches",{get:function(){return this._matches},enumerable:!0,configurable:!0}),e.prototype.show=function(){var t=this;this.positionService.setOptions({modifiers:{flip:{enabled:this.adaptivePosition}}}),this._typeahead.attach(g).to(this.container).position({attachment:(this.dropup?"top":"bottom")+" left"}).show({typeaheadRef:this,placement:this.placement,animation:!1,dropup:this.dropup}),this._outsideClickListener=this.renderer.listen("document","click",function(e){return 0===t.typeaheadMinLength&&t.element.nativeElement.contains(e.target)?undefined:!t.typeaheadHideResultsOnBlur||t.element.nativeElement.contains(e.target)?undefined:void t.onOutsideClick()}),this._container=this._typeahead.instance;var e=((this._container.parent=this).typeaheadLatinize?d(this.ngControl.control.value):this.ngControl.control.value).toString().toLowerCase();this._container.query=this.typeaheadSingleWords?y(e,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters):e,this._container.matches=this._matches,this.element.nativeElement.focus()},e.prototype.hide=function(){this._typeahead.isShown&&(this._typeahead.hide(),this._outsideClickListener(),this._container=null)},e.prototype.onOutsideClick=function(){this._container&&!this._container.isFocused&&this.hide()},e.prototype.ngOnDestroy=function(){try{for(var e=u(this._subscriptions),t=e.next();!t.done;t=e.next()){t.value.unsubscribe()}}catch(a){i={error:a}}finally{try{t&&!t.done&&(n=e["return"])&&n.call(e)}finally{if(i)throw i.error}}var i,n;this._typeahead.dispose()},e.prototype.asyncActions=function(){var t=this;this._subscriptions.push(this.keyUpEventEmitter.pipe(o.debounceTime(this.typeaheadWaitMs),o.switchMap(function(){return t.typeahead})).subscribe(function(e){t.finalizeAsyncCall(e)}))},e.prototype.syncActions=function(){var i=this;this._subscriptions.push(this.keyUpEventEmitter.pipe(o.debounceTime(this.typeaheadWaitMs),o.mergeMap(function(e){var t=i.normalizeQuery(e);return n.from(i.typeahead).pipe(o.filter(function(e){return e&&i.testMatch(i.normalizeOption(e),t)}),o.toArray())})).subscribe(function(e){i.finalizeAsyncCall(e)}))},e.prototype.normalizeOption=function(e){var t=m(e,this.typeaheadOptionField);return(this.typeaheadLatinize?d(t):t).toLowerCase()},e.prototype.normalizeQuery=function(e){var t=(this.typeaheadLatinize?d(e):e).toString().toLowerCase();return t=this.typeaheadSingleWords?y(t,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters):t},e.prototype.testMatch=function(e,t){var i;if("object"!=typeof t)return 0<=e.indexOf(t);i=t.length;for(var n=0;n<i;n+=1)if(0<t[n].length&&e.indexOf(t[n])<0)return!1;return!0},e.prototype.finalizeAsyncCall=function(e){if(this.prepareMatches(e||[]),this.typeaheadLoading.emit(!1),this.typeaheadNoResults.emit(!this.hasMatches()),this.hasMatches())if(this._container){var t=((this.typeaheadLatinize?d(this.ngControl.control.value):this.ngControl.control.value)||"").toString().toLowerCase();this._container.query=this.typeaheadSingleWords?y(t,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters):t,this._container.matches=this._matches}else this.show();else this.hide()},e.prototype.prepareMatches=function(e){var i=this,n=e.slice(0,this.typeaheadOptionsLimit);if(this.typeaheadGroupField){var a=[];n.map(function(e){return m(e,i.typeaheadGroupField)}).filter(function(e,t,i){return i.indexOf(e)===t}).forEach(function(t){a.push(new c(t,t,!0)),a=a.concat(n.filter(function(e){return m(e,i.typeaheadGroupField)===t}).map(function(e){return new c(e,m(e,i.typeaheadOptionField))}))}),this._matches=a}else this._matches=n.map(function(e){return new c(e,m(e,i.typeaheadOptionField))})},e.prototype.hasMatches=function(){return 0<this._matches.length},e.decorators=[{type:h.Directive,args:[{selector:"[typeahead]",exportAs:"bs-typeahead"}]}],e.ctorParameters=function(){return[{type:i.ComponentLoaderFactory},{type:f},{type:h.ChangeDetectorRef},{type:h.ElementRef},{type:t.NgControl},{type:a.PositioningService},{type:h.Renderer2},{type:h.ViewContainerRef}]},e.propDecorators={typeahead:[{type:h.Input}],typeaheadMinLength:[{type:h.Input}],adaptivePosition:[{type:h.Input}],typeaheadWaitMs:[{type:h.Input}],typeaheadOptionsLimit:[{type:h.Input}],typeaheadOptionField:[{type:h.Input}],typeaheadGroupField:[{type:h.Input}],typeaheadAsync:[{type:h.Input}],typeaheadLatinize:[{type:h.Input}],typeaheadSingleWords:[{type:h.Input}],typeaheadWordDelimiters:[{type:h.Input}],typeaheadPhraseDelimiters:[{type:h.Input}],typeaheadItemTemplate:[{type:h.Input}],optionsListTemplate:[{type:h.Input}],typeaheadScrollable:[{type:h.Input}],typeaheadOptionsInScrollableView:[{type:h.Input}],typeaheadHideResultsOnBlur:[{type:h.Input}],typeaheadSelectFirstItem:[{type:h.Input}],typeaheadLoading:[{type:h.Output}],typeaheadNoResults:[{type:h.Output}],typeaheadOnSelect:[{type:h.Output}],typeaheadOnBlur:[{type:h.Output}],container:[{type:h.Input}],dropup:[{type:h.Input}],onInput:[{type:h.HostListener,args:["input",["$event"]]}],onChange:[{type:h.HostListener,args:["keyup",["$event"]]}],onFocus:[{type:h.HostListener,args:["click"]},{type:h.HostListener,args:["focus"]}],onBlur:[{type:h.HostListener,args:["blur"]}],onKeydown:[{type:h.HostListener,args:["keydown",["$event"]]}]},e}(),b=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[i.ComponentLoaderFactory,a.PositioningService,f]}},e.decorators=[{type:h.NgModule,args:[{imports:[r.CommonModule],declarations:[g,v],exports:[g,v],entryComponents:[g]}]}],e}();e.latinMap=p,e.TypeaheadOptions=l,e.TypeaheadMatch=c,e.escapeRegexp=function E(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},e.getValueFromObject=m,e.tokenize=y,e.latinize=d,e.TypeaheadContainerComponent=g,e.TypeaheadDirective=v,e.TypeaheadModule=b,e.TypeaheadConfig=f,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ngx-bootstrap-typeahead.umd.min.js.map