UNPKG

ng-select

Version:
2 lines 33.2 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define("ng-select",["exports","@angular/core","@angular/common","@angular/forms"],e):e((t=t||self)["ng-select"]={},t.ng.core,t.ng.common,t.ng.forms)}(this,function(t,e,i,n){"use strict";function o(t){var e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}}var l=function(){function t(t){this.wrappedOption=t,this.disabled=!1,this.highlighted=!1,this.selected=!1,this.shown=!0}return Object.defineProperty(t.prototype,"value",{get:function(){return this.wrappedOption.value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this.wrappedOption.label},enumerable:!0,configurable:!0}),t}(),s=function(){function t(){}return t.strip=function(t){var e=this;return t.replace(/[^\u0000-\u007E]/g,function(t){return e.DIACRITICS[t]||t})},t.DIACRITICS={"Ⓐ":"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","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","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","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"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","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"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","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","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","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"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","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"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","ⓐ":"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","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"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","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"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","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"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","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"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","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"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","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},t}(),p=function(){function t(t){this._highlightedOption=null,null==t&&(t=[]),this._options=t.map(function(t){var e=new l(t);return t.disabled&&(e.disabled=!0),e}),this._hasShown=this._options.length>0,this.highlight()}return Object.defineProperty(t.prototype,"hasShown",{get:function(){return this._hasShown},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasSelected",{get:function(){return this._hasSelected},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},enumerable:!0,configurable:!0}),t.prototype.getOptionsByValue=function(t){return this.options.filter(function(e){return e.value===t})},Object.defineProperty(t.prototype,"value",{get:function(){return this.selection.map(function(t){return t.value})},set:function(t){t=null==t?[]:t,this.options.forEach(function(e){e.selected=t.indexOf(e.value)>-1}),this.updateHasSelected()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.options.filter(function(t){return t.selected})},enumerable:!0,configurable:!0}),t.prototype.select=function(t,e){e||this.clearSelection(),t.selected=!0,this.updateHasSelected()},t.prototype.deselect=function(t){t.selected=!1,this.updateHasSelected()},t.prototype.clearSelection=function(){this.options.forEach(function(t){t.selected=!1}),this._hasSelected=!1},t.prototype.updateHasSelected=function(){this._hasSelected=this.options.some(function(t){return t.selected})},Object.defineProperty(t.prototype,"filtered",{get:function(){return this.options.filter(function(t){return t.shown})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filteredEnabled",{get:function(){return this.options.filter(function(t){return t.shown&&!t.disabled})},enumerable:!0,configurable:!0}),t.prototype.filter=function(t){var e=!1;return""===t.trim()?(this.resetFilter(),e=this.options.length>0):this.options.forEach(function(i){var n=s.strip(i.label).toUpperCase(),o=s.strip(t).toUpperCase();i.shown=n.indexOf(o)>-1,i.shown&&(e=!0)}),this.highlight(),this._hasShown=e,e},t.prototype.resetFilter=function(){this.options.forEach(function(t){t.shown=!0})},Object.defineProperty(t.prototype,"highlightedOption",{get:function(){return this._highlightedOption},enumerable:!0,configurable:!0}),t.prototype.highlight=function(){var t=this.hasShownSelected()?this.getFirstShownSelected():this.getFirstShown();this.highlightOption(t)},t.prototype.highlightOption=function(t){this.clearHighlightedOption(),null!==t&&(t.highlighted=!0,this._highlightedOption=t)},t.prototype.highlightNextOption=function(){var t=this.filteredEnabled,e=this.getHighlightedIndexFromList(t);e>-1&&e<t.length-1&&this.highlightOption(t[e+1])},t.prototype.highlightPreviousOption=function(){var t=this.filteredEnabled,e=this.getHighlightedIndexFromList(t);e>0&&this.highlightOption(t[e-1])},t.prototype.clearHighlightedOption=function(){null!==this.highlightedOption&&(this.highlightedOption.highlighted=!1,this._highlightedOption=null)},t.prototype.getHighlightedIndexFromList=function(t){for(var e=0;e<t.length;e++)if(t[e].highlighted)return e;return-1},t.prototype.getHighlightedIndex=function(){return this.getHighlightedIndexFromList(this.filtered)},t.prototype.hasShownSelected=function(){return this.options.some(function(t){return t.shown&&t.selected})},t.prototype.getFirstShown=function(){var t,e;try{for(var i=o(this.options),n=i.next();!n.done;n=i.next()){var l=n.value;if(l.shown)return l}}catch(s){t={error:s}}finally{try{n&&!n.done&&(e=i["return"])&&e.call(i)}finally{if(t)throw t.error}}return null},t.prototype.getFirstShownSelected=function(){var t,e;try{for(var i=o(this.options),n=i.next();!n.done;n=i.next()){var l=n.value;if(l.shown&&l.selected)return l}}catch(s){t={error:s}}finally{try{n&&!n.done&&(e=i["return"])&&e.call(i)}finally{if(t)throw t.error}}return null},t.equalValues=function(t,e){if(t.length!==e.length)return!1;var i=t.slice().sort(),n=e.slice().sort();return i.every(function(t,e){return t===n[e]})},t}(),r=function(){function t(t){this.hostElement=t,this.optionClicked=new e.EventEmitter,this.optionsListClick=new e.EventEmitter,this.singleFilterClick=new e.EventEmitter,this.singleFilterFocus=new e.EventEmitter,this.singleFilterInput=new e.EventEmitter,this.singleFilterKeydown=new e.EventEmitter,this.disabledColor="#fff",this.disabledTextColor="9e9e9e"}return t.prototype.ngOnInit=function(){this.optionsReset()},t.prototype.ngOnChanges=function(t){t.hasOwnProperty("optionList")&&this.optionsReset()},t.prototype.ngAfterViewInit=function(){this.moveHighlightedIntoView(),!this.multiple&&this.filterEnabled&&this.filterInput.nativeElement.focus()},t.prototype.onOptionsListClick=function(){this.optionsListClick.emit(null)},t.prototype.onSingleFilterClick=function(){this.singleFilterClick.emit(null)},t.prototype.onSingleFilterInput=function(t){this.singleFilterInput.emit(t.target.value)},t.prototype.onSingleFilterKeydown=function(t){this.singleFilterKeydown.emit(t)},t.prototype.onSingleFilterFocus=function(){this.singleFilterFocus.emit(null)},t.prototype.onOptionsWheel=function(t){this.handleOptionsWheel(t)},t.prototype.onOptionMouseover=function(t){this.optionList.highlightOption(t)},t.prototype.onOptionClick=function(t){this.optionClicked.emit(t)},t.prototype.optionsReset=function(){this.optionList.filter(""),this.optionList.highlight()},t.prototype.getOptionStyle=function(t){if(t.highlighted){var e={};return"undefined"!=typeof this.highlightColor&&(e["background-color"]=this.highlightColor),"undefined"!=typeof this.highlightTextColor&&(e.color=this.highlightTextColor),e}return{}},t.prototype.moveHighlightedIntoView=function(){var t=this.optionsList.nativeElement,e=t.offsetHeight,i=this.optionList.getHighlightedIndex();if(i>-1){var n=t.children[0].children[i].offsetHeight,o=i*n,l=o+n,s=t.scrollTop;l>s+e?t.scrollTop=l-e:o<s&&(t.scrollTop=o)}},t.prototype.handleOptionsWheel=function(t){var e=this.optionsList.nativeElement,i=0===e.scrollTop,n=e.offsetHeight+e.scrollTop===e.scrollHeight;i&&t.deltaY<0?t.preventDefault():n&&t.deltaY>0&&t.preventDefault()},t.decorators=[{type:e.Component,args:[{selector:"select-dropdown",template:'<div\n [ngClass]="{\'below\': isBelow, \'above\': !isBelow}"\n [ngStyle]="{\'top.px\': top, \'left.px\': left, \'width.px\': width}">\n\n <div class="filter"\n *ngIf="!multiple && filterEnabled">\n <input\n #filterInput\n autocomplete="off"\n [placeholder]="placeholder"\n (click)="onSingleFilterClick()"\n (input)="onSingleFilterInput($event)"\n (keydown)="onSingleFilterKeydown($event)"\n (focus)="onSingleFilterFocus()">\n </div>\n\n <div class="options"\n (click)="onOptionsListClick()"\n #optionsList>\n <ul\n (wheel)="onOptionsWheel($event)">\n <li *ngFor="let option of optionList.filtered"\n [ngClass]="{\'highlighted\': option.highlighted, \'selected\': option.selected, \'disabled\': option.disabled}"\n [ngStyle]="getOptionStyle(option)"\n (click)="onOptionClick(option)"\n (mouseover)="onOptionMouseover(option)">\n <ng-container *ngTemplateOutlet="optionTemplate; context:{option: option.wrappedOption}"></ng-container>\n <span *ngIf="!optionTemplate">{{option.label}}</span>\n </li>\n <li\n *ngIf="!optionList.hasShown"\n class="message">\n {{notFoundMsg}}\n </li>\n </ul>\n </div>\n</div>\n',encapsulation:e.ViewEncapsulation.None,styles:["select-dropdown,select-dropdown *{box-sizing:border-box}select-dropdown>div{background-color:#fff;border:1px solid #ccc;box-sizing:border-box;position:absolute;z-index:1}select-dropdown>div.above{border-bottom:none}select-dropdown>div.below{border-top:none}select-dropdown>div .filter{padding:3px;width:100%}select-dropdown>div .filter input{border:1px solid #eee;box-sizing:border-box;padding:4px;width:100%}select-dropdown>div .options{max-height:200px;overflow-y:auto}select-dropdown>div .options ul{list-style:none;margin:0;padding:0}select-dropdown>div .options ul li{padding:4px 8px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}select-dropdown .selected{background-color:#e0e0e0}select-dropdown .highlighted,select-dropdown .selected.highlighted{background-color:#2196f3;color:#fff}select-dropdown .disabled{background-color:#fff;color:#9e9e9e;cursor:default;pointer-events:none}"]}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={filterEnabled:[{type:e.Input}],highlightColor:[{type:e.Input}],highlightTextColor:[{type:e.Input}],left:[{type:e.Input}],multiple:[{type:e.Input}],notFoundMsg:[{type:e.Input}],optionList:[{type:e.Input}],isBelow:[{type:e.Input}],top:[{type:e.Input}],width:[{type:e.Input}],placeholder:[{type:e.Input}],optionTemplate:[{type:e.Input}],optionClicked:[{type:e.Output}],optionsListClick:[{type:e.Output}],singleFilterClick:[{type:e.Output}],singleFilterFocus:[{type:e.Output}],singleFilterInput:[{type:e.Output}],singleFilterKeydown:[{type:e.Output}],filterInput:[{type:e.ViewChild,args:["filterInput",{"static":!1}]}],optionsList:[{type:e.ViewChild,args:["optionsList",{"static":!0}]}]},t}(),h={provide:n.NG_VALUE_ACCESSOR,useExisting:e.forwardRef(function(){return d}),multi:!0},d=function(){function t(t){this.hostElement=t,this.options=[],this.allowClear=!1,this.disabled=!1,this.multiple=!1,this.noFilter=0,this.notFoundMsg="No results found",this.placeholder="",this.filterPlaceholder="",this.label="",this.opened=new e.EventEmitter,this.closed=new e.EventEmitter,this.selected=new e.EventEmitter,this.deselected=new e.EventEmitter,this.focus=new e.EventEmitter,this.blur=new e.EventEmitter,this.noOptionsFound=new e.EventEmitter,this.filterInputChanged=new e.EventEmitter,this._value=[],this.optionList=new p([]),this.hasFocus=!1,this.isOpen=!1,this.isBelow=!0,this.filterEnabled=!0,this.filterInputWidth=1,this.isDisabled=!1,this.placeholderView="",this.clearClicked=!1,this.selectContainerClicked=!1,this.optionListClicked=!1,this.optionClicked=!1,this.onChange=function(t){},this.onTouched=function(){},this.KEYS={BACKSPACE:8,TAB:9,ENTER:13,ESC:27,SPACE:32,UP:38,DOWN:40}}return t.prototype.ngOnInit=function(){this.placeholderView=this.placeholder},t.prototype.ngOnChanges=function(t){this.handleInputChanges(t)},t.prototype.ngAfterViewInit=function(){this.updateState()},t.prototype.onWindowBlur=function(){this._blur()},t.prototype.onWindowClick=function(){!this.selectContainerClicked&&(!this.optionListClicked||this.optionListClicked&&this.optionClicked)&&(this.closeDropdown(this.optionClicked),this.optionClicked||this._blur()),this.clearClicked=!1,this.selectContainerClicked=!1,this.optionListClicked=!1,this.optionClicked=!1},t.prototype.onWindowResize=function(){this.updateWidth()},t.prototype.onSelectContainerClick=function(t){this.selectContainerClicked=!0,this.clearClicked||this.toggleDropdown()},t.prototype.onSelectContainerFocus=function(){this._focus()},t.prototype.onSelectContainerKeydown=function(t){this.handleSelectContainerKeydown(t)},t.prototype.onOptionsListClick=function(){this.optionListClicked=!0},t.prototype.onDropdownOptionClicked=function(t){this.optionClicked=!0,this.multiple?this.toggleSelectOption(t):this.selectOption(t)},t.prototype.onSingleFilterClick=function(){this.selectContainerClicked=!0},t.prototype.onSingleFilterFocus=function(){this._focus()},t.prototype.onFilterInput=function(t){this.filterInputChanged.emit(t),this.filter(t)},t.prototype.onSingleFilterKeydown=function(t){this.handleSingleFilterKeydown(t)},t.prototype.onMultipleFilterKeydown=function(t){this.handleMultipleFilterKeydown(t)},t.prototype.onMultipleFilterFocus=function(){this._focus()},t.prototype.onClearSelectionClick=function(t){this.clearClicked=!0,this.clearSelection(),this.closeDropdown(!0)},t.prototype.onDeselectOptionClick=function(t){this.clearClicked=!0,this.deselectOption(t)},t.prototype.open=function(){this.openDropdown()},t.prototype.close=function(){this.closeDropdown(!1)},t.prototype.clear=function(){this.clearSelection()},t.prototype.select=function(t){this.writeValue(t)},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.handleInputChanges=function(t){var e=t.hasOwnProperty("options"),i=t.hasOwnProperty("noFilter"),n=t.hasOwnProperty("placeholder");e&&(this.updateOptionList(t.options.currentValue),this.updateState()),(e||i)&&this.updateFilterEnabled(),n&&this.updateState()},t.prototype.updateOptionList=function(t){this.optionList=new p(t),this.optionList.value=this._value},t.prototype.updateFilterEnabled=function(){this.filterEnabled=this.optionList.options.length>=this.noFilter},Object.defineProperty(t.prototype,"value",{get:function(){return this.multiple?this._value:this._value[0]},set:function(t){if(null==t||""===t)t=[];else if("string"==typeof t)t=[t];else if(!Array.isArray(t))throw new TypeError("Value must be a string or an array.");this.optionList.value=t,this._value=t,this.updateState()},enumerable:!0,configurable:!0}),t.prototype.valueChanged=function(){this._value=this.optionList.value,this.updateState(),this.onChange(this.value)},t.prototype.updateState=function(){var t=this;this.placeholderView=this.optionList.hasSelected?"":this.placeholder,setTimeout(function(){t.updateFilterWidth()})},t.prototype.selectOption=function(t){t.selected||t.disabled||(this.optionList.select(t,this.multiple),this.valueChanged(),this.selected.emit(t.wrappedOption))},t.prototype.deselectOption=function(t){var e=this;t.selected&&(this.optionList.deselect(t),this.valueChanged(),this.deselected.emit(t.wrappedOption),setTimeout(function(){e.multiple&&(e.updatePosition(),e.optionList.highlight(),e.isOpen&&e.dropdown.moveHighlightedIntoView())}))},t.prototype.clearSelection=function(){var t=this.optionList.selection;t.length>0&&(this.optionList.clearSelection(),this.valueChanged(),1===t.length?this.deselected.emit(t[0].wrappedOption):this.deselected.emit(t.map(function(t){return t.wrappedOption})))},t.prototype.toggleSelectOption=function(t){t.selected?this.deselectOption(t):this.selectOption(t)},t.prototype.selectHighlightedOption=function(){var t=this.optionList.highlightedOption;null!==t&&(this.selectOption(t),this.closeDropdown(!0))},t.prototype.deselectLast=function(){var t=this.optionList.selection;if(t.length>0){var e=t[t.length-1];this.deselectOption(e),this.setMultipleFilterInput(e.label+" ")}},t.prototype.toggleDropdown=function(){this.isDisabled||(this.isOpen?this.closeDropdown(!0):this.openDropdown())},t.prototype.openDropdown=function(){var t=this;this.isOpen||(this.isOpen=!0,this.updateWidth(),setTimeout(function(){t.updatePosition(),t.multiple&&t.filterEnabled&&t.filterInput.nativeElement.focus(),t.opened.emit(null)}))},t.prototype.closeDropdown=function(t){this.isOpen&&(this.clearFilterInput(),this.updateFilterWidth(),this.isOpen=!1,t&&this._focusSelectContainer(),this.closed.emit(null))},t.prototype.filter=function(t){var e=this;this.multiple&&(this.isOpen||this.openDropdown(),this.updateFilterWidth()),setTimeout(function(){e.optionList.filter(t)||e.noOptionsFound.emit(t)})},t.prototype.clearFilterInput=function(){this.multiple&&this.filterEnabled&&(this.filterInput.nativeElement.value="")},t.prototype.setMultipleFilterInput=function(t){this.filterEnabled&&(this.filterInput.nativeElement.value=t)},t.prototype.handleSelectContainerKeydown=function(t){var e=this,i=t.which;this.isOpen?i===this.KEYS.ESC||i===this.KEYS.UP&&t.altKey?this.closeDropdown(!0):i===this.KEYS.TAB?(this.closeDropdown(t.shiftKey),this._blur()):i===this.KEYS.ENTER?this.selectHighlightedOption():i===this.KEYS.UP?(this.optionList.highlightPreviousOption(),this.dropdown.moveHighlightedIntoView(),this.filterEnabled||t.preventDefault()):i===this.KEYS.DOWN&&(this.optionList.highlightNextOption(),this.dropdown.moveHighlightedIntoView(),this.filterEnabled||t.preventDefault()):i===this.KEYS.ENTER||i===this.KEYS.SPACE||i===this.KEYS.DOWN&&t.altKey?setTimeout(function(){e.openDropdown()}):i===this.KEYS.TAB&&this._blur()},t.prototype.handleMultipleFilterKeydown=function(t){t.which===this.KEYS.BACKSPACE&&this.optionList.hasSelected&&this.filterEnabled&&""===this.filterInput.nativeElement.value&&this.deselectLast()},t.prototype.handleSingleFilterKeydown=function(t){var e=t.which;e!==this.KEYS.ESC&&e!==this.KEYS.TAB&&e!==this.KEYS.UP&&e!==this.KEYS.DOWN&&e!==this.KEYS.ENTER||this.handleSelectContainerKeydown(t)},t.prototype._blur=function(){this.hasFocus&&(this.hasFocus=!1,this.onTouched(),this.blur.emit(null))},t.prototype._focus=function(){this.hasFocus||(this.hasFocus=!0,this.focus.emit(null))},t.prototype._focusSelectContainer=function(){this.selectionSpan.nativeElement.focus()},t.prototype.updateWidth=function(){this.width=this.selectionSpan.nativeElement.getBoundingClientRect().width},t.prototype.updatePosition=function(){if("undefined"!=typeof this.dropdown){var t=this.hostElement.nativeElement.getBoundingClientRect(),e=this.selectionSpan.nativeElement.getBoundingClientRect(),i=this.dropdown.hostElement.nativeElement.firstElementChild.getBoundingClientRect(),n=window.innerHeight,o=e.top-t.top,l=t.bottom+i.height;this.isBelow=l<n,this.left=e.left-t.left,this.top=this.isBelow?o+e.height:o-i.height}},t.prototype.updateFilterWidth=function(){if("undefined"!=typeof this.filterInput){var t=this.filterInput.nativeElement.value;this.filterInputWidth=0===t.length?1+10*this.placeholderView.length:1+10*t.length}},t.decorators=[{type:e.Component,args:[{selector:"ng-select",template:'<label\n *ngIf="label !== \'\'">\n {{label}}\n</label>\n<div\n #selection\n [attr.tabindex]="disabled ? null : 0"\n [ngClass]="{\'open\': isOpen, \'focus\': hasFocus, \'below\': isBelow, \'above\': !isBelow, \'disabled\': disabled}"\n (click)="onSelectContainerClick($event)"\n (focus)="onSelectContainerFocus()"\n (keydown)="onSelectContainerKeydown($event)">\n\n <div class="single"\n *ngIf="!multiple">\n <div class="value"\n *ngIf="optionList.hasSelected">\n <ng-container *ngTemplateOutlet="optionTemplate; context:{option: optionList.selection[0].wrappedOption, onDeselectOptionClick: onDeselectOptionClick}"></ng-container>\n <span *ngIf="!optionTemplate">{{optionList.selection[0].label}}</span>\n </div>\n <div class="placeholder"\n *ngIf="!optionList.hasSelected">\n {{placeholderView}}\n </div>\n <div class="clear"\n *ngIf="allowClear && optionList.hasSelected"\n (click)="onClearSelectionClick($event)">\n &#x2715;\n </div>\n <div class="toggle"\n *ngIf="isOpen">\n &#x25B2;\n </div>\n <div class="toggle"\n *ngIf="!isOpen">\n &#x25BC;\n </div>\n </div>\n\n <div class="multiple"\n *ngIf="multiple">\n <div class="option"\n *ngFor="let option of optionList.selection">\n <span class="deselect-option"\n (click)=onDeselectOptionClick(option)>\n &#x2715;\n </span>\n {{option.label}}\n </div>\n <div class="placeholder"\n *ngIf="!filterEnabled && !optionList.hasSelected">\n {{placeholderView}}\n </div>\n <input\n *ngIf="filterEnabled"\n #filterInput\n autocomplete="off"\n tabindex="-1"\n [placeholder]="placeholderView"\n [ngStyle]="{\'width.px\': filterInputWidth}"\n (input)="onFilterInput($event.target.value)"\n (keydown)="onMultipleFilterKeydown($event)"\n (focus)="onMultipleFilterFocus()"/>\n </div>\n\n</div>\n<select-dropdown\n *ngIf="isOpen"\n #dropdown\n [multiple]="multiple"\n [optionList]="optionList"\n [notFoundMsg]="notFoundMsg"\n [highlightColor]="highlightColor"\n [highlightTextColor]="highlightTextColor"\n [filterEnabled]="filterEnabled"\n [placeholder]="filterPlaceholder"\n [isBelow]="isBelow"\n [width]="width"\n [top]="top"\n [left]="left"\n [optionTemplate]="optionTemplate"\n (optionClicked)="onDropdownOptionClicked($event)"\n (optionsListClick)="onOptionsListClick()"\n (singleFilterClick)="onSingleFilterClick()"\n (singleFilterFocus)="onSingleFilterFocus()"\n (singleFilterInput)="onFilterInput($event)"\n (singleFilterKeydown)="onSingleFilterKeydown($event)">\n</select-dropdown>\n',providers:[h],encapsulation:e.ViewEncapsulation.None,styles:["ng-select{display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%}ng-select *{box-sizing:border-box}ng-select>div{border:1px solid #ddd;box-sizing:border-box;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%}ng-select>div.disabled{background-color:#eee;color:#aaa;cursor:default;pointer-events:none}ng-select>div>div.single{display:flex;height:30px;width:100%}ng-select>div>div.single>div.placeholder,ng-select>div>div.single>div.value{flex:1;line-height:30px;overflow:hidden;padding:0 10px;white-space:nowrap}ng-select>div>div.single>div.placeholder{color:#757575}ng-select>div>div.single>div.clear,ng-select>div>div.single>div.toggle{color:#aaa;line-height:30px;text-align:center;width:30px}ng-select>div>div.single>div.clear:hover,ng-select>div>div.single>div.toggle:hover{background-color:#ececec}ng-select>div>div.single>div.clear{font-size:18px}ng-select>div>div.single>div.toggle{font-size:14px}ng-select>div>div.multiple{display:flex;flex-flow:row wrap;height:100%;min-height:30px;padding:0 10px;width:100%}ng-select>div>div.multiple>div.option{background-color:#eee;border:1px solid #aaa;border-radius:4px;color:#333;cursor:default;display:inline-block;flex-shrink:0;font-size:14px;line-height:22px;margin:3px 5px 3px 0;padding:0 4px}ng-select>div>div.multiple>div.option span.deselect-option{color:#aaa;cursor:pointer;font-size:14px;height:20px;line-height:20px}ng-select>div>div.multiple>div.option span.deselect-option:hover{color:#555}ng-select>div>div.multiple input{background-color:transparent;border:none;cursor:pointer;height:30px;line-height:30px;padding:0}ng-select>div>div.multiple input:focus{outline:0}ng-select label{color:rgba(0,0,0,.38);display:block;font-size:13px;padding:4px 0}"]}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={options:[{type:e.Input}],allowClear:[{type:e.Input}],disabled:[{type:e.Input}],multiple:[{type:e.Input}],noFilter:[{type:e.Input}],highlightColor:[{type:e.Input}],highlightTextColor:[{type:e.Input}],notFoundMsg:[{type:e.Input}],placeholder:[{type:e.Input}],filterPlaceholder:[{type:e.Input}],label:[{type:e.Input}],opened:[{type:e.Output}],closed:[{type:e.Output}],selected:[{type:e.Output}],deselected:[{type:e.Output}],focus:[{type:e.Output}],blur:[{type:e.Output}],noOptionsFound:[{type:e.Output}],filterInputChanged:[{type:e.Output}],selectionSpan:[{type:e.ViewChild,args:["selection",{"static":!0}]}],dropdown:[{type:e.ViewChild,args:["dropdown",{"static":!1}]}],filterInput:[{type:e.ViewChild,args:["filterInput",{"static":!1}]}],optionTemplate:[{type:e.ContentChild,args:["optionTemplate",{"static":!1}]}],onWindowBlur:[{type:e.HostListener,args:["window:blur"]}],onWindowClick:[{type:e.HostListener,args:["window:click"]}],onWindowResize:[{type:e.HostListener,args:["window:resize"]}]},t}(),c=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[d,r],exports:[d],imports:[i.CommonModule,n.FormsModule]}]}],t}();t.SELECT_VALUE_ACCESSOR=h,t.SelectComponent=d,t.SelectModule=c,t.ɵa=r,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=ng-select.umd.min.js.map