@neocomplexx/ngx-neo-completer-mat
Version:
16 lines (14 loc) • 41.5 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@angular/material/form-field"),require("@angular/material/input"),require("@angular/material/chips"),require("@angular/material/icon")):"function"==typeof define&&define.amd?define("@neocomplexx/ngx-neo-completer-mat",["exports","@angular/core","@angular/common","@angular/forms","@angular/common/http","rxjs","rxjs/operators","@angular/material/form-field","@angular/material/input","@angular/material/chips","@angular/material/icon"],t):t(((e=e||self).neocomplexx=e.neocomplexx||{},e.neocomplexx["ngx-neo-completer-mat"]={}),e.ng.core,e.ng.common,e.ng.forms,e.ng.common.http,e.rxjs,e.rxjs.operators,e.ng.material.formField,e.ng.material.input,e.ng.material.chips,e.ng.material.icon)}(this,(function(e,t,i,n,r,o,s,c,l,a,h){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var p=function(e,t){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function u(e,t){function i(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function d(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var m=function(){function e(){this.selected=new t.EventEmitter,this.highlighted=new t.EventEmitter,this.opened=new t.EventEmitter,this.dataSourceChange=new t.EventEmitter,this._hasHighlighted=!1,this._hasSelected=!1,this._cancelBlur=!1,this._isOpen=!1}return e.prototype.registerList=function(e){this.list=e},e.prototype.registerDropdown=function(e){this.dropdown=e},e.prototype.onHighlighted=function(e){this.highlighted.emit(e),this._hasHighlighted=!!e},e.prototype.onSelected=function(e,t){void 0===t&&(t=!0),this.selected.emit(e),e&&(this._hasSelected=!0),t&&this.clear()},e.prototype.onDataSourceChange=function(){this.hasSelected&&(this.selected.emit(null),this._hasSelected=!1),this.dataSourceChange.emit()},e.prototype.search=function(e){this._hasSelected&&(this.selected.emit(null),this._hasSelected=!1),this.list&&this.list.search(e)},e.prototype.clear=function(){this._hasHighlighted=!1,this.isOpen=!1,this.dropdown&&this.dropdown.clear(),this.list&&this.list.clear()},e.prototype.selectCurrent=function(){this.dropdown&&this.dropdown.selectCurrent()},e.prototype.nextRow=function(){this.dropdown&&this.dropdown.nextRow()},e.prototype.prevRow=function(){this.dropdown&&this.dropdown.prevRow()},e.prototype.hasHighlighted=function(){return this._hasHighlighted},e.prototype.cancelBlur=function(e){this._cancelBlur=e},e.prototype.isCancelBlur=function(){return this._cancelBlur},e.prototype.open=function(){this._isOpen||(this.isOpen=!0,this.list.open())},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},set:function(e){this._isOpen=e,this.opened.emit(this._isOpen),this.list&&this.list.isOpen(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoHighlightIndex",{get:function(){return this._autoHighlightIndex},set:function(e){this._autoHighlightIndex=e,this.dropdown&&this.dropdown.highlightRow(this._autoHighlightIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasSelected",{get:function(){return this._hasSelected},enumerable:!0,configurable:!0}),e.ɵfac=function(t){return new(t||e)},e.ɵdir=t.ɵɵdefineDirective({type:e,selectors:[["","ctrCompleter",""]],outputs:{selected:"selected",highlighted:"highlighted",opened:"opened",dataSourceChange:"dataSourceChange"}}),e}();function f(e,i){if(1&e&&(t.ɵɵelementStart(0,"span",2),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){var n=i.$implicit,r=t.ɵɵnextContext();t.ɵɵproperty("ngClass",n.isMatch?r.matchClass:null),t.ɵɵadvance(1),t.ɵɵtextInterpolate(n.text)}}var g=function(e,t){return{"completer-title":e,"completer-description":t}},v=function(){function e(){this.parts=[]}return e.prototype.ngOnInit=function(){if(this.searchStr){for(var e=this.text.toLowerCase(),t=e.indexOf(this.searchStr.toLowerCase()),i=0;t>=0;){var n=this.text.slice(t,t+this.searchStr.length);if(0===t)this.parts.push({isMatch:!0,text:n}),i+=this.searchStr.length;else if(t>0){var r=this.text.slice(i,t);this.parts.push({isMatch:!1,text:r}),this.parts.push({isMatch:!0,text:n}),i+=this.searchStr.length+r.length}t=e.indexOf(this.searchStr.toLowerCase(),i)}i<this.text.length&&this.parts.push({isMatch:!1,text:this.text.slice(i,this.text.length)})}else this.parts.push({isMatch:!1,text:this.text})},e.ɵfac=function(t){return new(t||e)},e.ɵcmp=t.ɵɵdefineComponent({type:e,selectors:[["completer-list-item"]],inputs:{text:"text",searchStr:"searchStr",matchClass:"matchClass",type:"type"},decls:2,vars:5,consts:[[1,"completer-list-item-holder",3,"ngClass"],["class","completer-list-item",3,"ngClass",4,"ngFor","ngForOf"],[1,"completer-list-item",3,"ngClass"]],template:function(e,i){1&e&&(t.ɵɵelementStart(0,"span",0),t.ɵɵtemplate(1,f,2,2,"span",1),t.ɵɵelementEnd()),2&e&&(t.ɵɵproperty("ngClass",t.ɵɵpureFunction2(2,g,"title"===i.type,"description"===i.type)),t.ɵɵadvance(1),t.ɵɵproperty("ngForOf",i.parts))},directives:[i.NgClass,i.NgForOf],encapsulation:2}),e}();function y(e){return null==e}var S=function(e,t){this.row=e,this.index=t},C=function(){function e(e,t){this.completer=e,this.el=t,this.rows=[],this._rowMouseDown=!1,this.completer.registerDropdown(this)}return e.prototype.ngOnDestroy=function(){this.completer.registerDropdown(null)},e.prototype.ngAfterViewInit=function(){var e=this,t=getComputedStyle(this.el.nativeElement),i=this.completer.autoHighlightIndex;this.isScrollOn=!!t.maxHeight&&"auto"===t.overflowY,i&&setTimeout((function(){e.highlightRow(i)}),0)},e.prototype.onMouseDown=function(e){var t=this;this._rowMouseDown?this._rowMouseDown=!1:(this.completer.cancelBlur(!0),setTimeout((function(){t.completer.cancelBlur(!1)}),0))},e.prototype.registerRow=function(e){var t=this.rows.findIndex((function(t){return t.index===e.index}));t>=0?this.rows[t]=e:this.rows.push(e)},e.prototype.unregisterRow=function(e){var t=this.rows.findIndex((function(t){return t.index===e}));this.rows.splice(t,1),this.currHighlighted&&e===this.currHighlighted.index&&this.highlightRow(null)},e.prototype.highlightRow=function(e){var t=this.rows.find((function(t){return t.index===e}));if(y(e)||e<0)return this.currHighlighted&&this.currHighlighted.row.setHighlighted(!1),this.currHighlighted=void 0,void this.completer.onHighlighted(null);if(t&&(this.currHighlighted&&this.currHighlighted.row.setHighlighted(!1),this.currHighlighted=t,this.currHighlighted.row.setHighlighted(!0),this.completer.onHighlighted(this.currHighlighted.row.getDataItem()),this.isScrollOn&&this.currHighlighted)){var i=this.dropdownRowTop();if(!i)return;if(i<0)this.dropdownScrollTopTo(i-1);else{var n=this.currHighlighted.row.getNativeElement();this.dropdownHeight()<n.getBoundingClientRect().bottom&&(this.dropdownScrollTopTo(this.dropdownRowOffsetHeight(n)),this.el.nativeElement.getBoundingClientRect().bottom-this.dropdownRowOffsetHeight(n)<n.getBoundingClientRect().top&&this.dropdownScrollTopTo(n.getBoundingClientRect().top-(this.el.nativeElement.getBoundingClientRect().top+parseInt(getComputedStyle(this.el.nativeElement).paddingTop,10))))}}},e.prototype.clear=function(){this.rows=[]},e.prototype.onSelected=function(e){this.completer.onSelected(e)},e.prototype.rowMouseDown=function(){this._rowMouseDown=!0},e.prototype.selectCurrent=function(){this.currHighlighted?this.onSelected(this.currHighlighted.row.getDataItem()):this.rows.length>0&&this.onSelected(this.rows[0].row.getDataItem())},e.prototype.nextRow=function(){var e=0;this.currHighlighted&&(e=this.currHighlighted.index+1),this.highlightRow(e)},e.prototype.prevRow=function(){var e=-1;this.currHighlighted&&(e=this.currHighlighted.index-1),this.highlightRow(e)},e.prototype.dropdownScrollTopTo=function(e){this.el.nativeElement.scrollTop=this.el.nativeElement.scrollTop+e},e.prototype.dropdownRowTop=function(){if(this.currHighlighted)return this.currHighlighted.row.getNativeElement().getBoundingClientRect().top-(this.el.nativeElement.getBoundingClientRect().top+parseInt(getComputedStyle(this.el.nativeElement).paddingTop,10))},e.prototype.dropdownHeight=function(){return this.el.nativeElement.getBoundingClientRect().top+parseInt(getComputedStyle(this.el.nativeElement).maxHeight,10)},e.prototype.dropdownRowOffsetHeight=function(e){var t=getComputedStyle(e.parentElement);return e.parentElement.offsetHeight+parseInt(t.marginTop,10)+parseInt(t.marginBottom,10)},e.ɵfac=function(i){return new(i||e)(t.ɵɵdirectiveInject(m,1),t.ɵɵdirectiveInject(t.ElementRef))},e.ɵdir=t.ɵɵdefineDirective({type:e,selectors:[["","ctrDropdown",""]],hostBindings:function(e,i){1&e&&t.ɵɵlistener("mousedown",(function(e){return i.onMouseDown(e)}))}}),e}(),w=function(){function e(e,i,n){var r=this;this.completer=e,this.ngModel=i,this.el=n,this.clearSelected=!1,this.clearUnselected=!1,this.overrideSuggested=!1,this.fillHighlighted=!0,this.openOnFocus=!1,this.openOnClick=!1,this.selectOnClick=!1,this.selectOnFocus=!1,this.autoSelectOnEnter=!0,this.ngModelChange=new t.EventEmitter,this._searchStr="",this._displayStr="",this.blurTimer=null,this.completer.selected.subscribe((function(e){e&&(r.clearSelected?r.searchStr="":r.searchStr=e.title,r.ngModelChange.emit(r.searchStr))})),this.completer.highlighted.subscribe((function(e){r.fillHighlighted&&(e?(r._displayStr=e.title,r.ngModelChange.emit(e.title)):(r._displayStr=r.searchStr,r.ngModelChange.emit(r.searchStr)))})),this.completer.dataSourceChange.subscribe((function(){r.completer.search(r.searchStr)})),this.ngModel.valueChanges&&this.ngModel.valueChanges.subscribe((function(e){y(e)||r._displayStr===e||(r.searchStr!==e&&r.completer.search(e),r.searchStr=e)}))}return e.prototype.keyupHandler=function(e){37!==e.keyCode&&39!==e.keyCode&&9!==e.keyCode&&(38===e.keyCode||13===e.keyCode?e.preventDefault():40===e.keyCode?(e.preventDefault(),this.completer.search(this.searchStr)):27===e.keyCode&&this.completer.isOpen&&(this.restoreSearchValue(),this.completer.clear(),e.stopPropagation(),e.preventDefault()))},e.prototype.pasteHandler=function(e){this.completer.open()},e.prototype.keydownHandler=function(e){var t=e.keyCode||e.which;13===t?(this.completer.hasHighlighted()?e.preventDefault():this.autoSelectOnEnter&&(e.preventDefault(),this.completer.open(),this.completer.nextRow()),this.handleSelection()):40===t?(e.preventDefault(),this.completer.open(),this.completer.nextRow()):38===t?(e.preventDefault(),this.completer.prevRow()):9===t?this.handleSelection():8===t?this.completer.open():27===t?(e.preventDefault(),this.completer.isOpen&&e.stopPropagation()):0===t||16===t||20===t||!(t<=112||t>=123)||e.ctrlKey||e.metaKey||e.altKey||this.completer.open()},e.prototype.onBlur=function(e){var t=this;this.completer.isCancelBlur()?setTimeout((function(){t.el.nativeElement.focus()}),0):this.completer.isOpen&&(this.blurTimer=o.timer(200).pipe(s.take(1)).subscribe((function(){return t.doBlur()})))},e.prototype.onfocus=function(){this.blurTimer&&(this.blurTimer.unsubscribe(),this.blurTimer=null),this.selectOnFocus&&this.el.nativeElement.select(),this.openOnFocus&&this.completer.open()},e.prototype.onClick=function(e){this.selectOnClick&&this.el.nativeElement.select(),this.openOnClick&&(this.completer.isOpen?this.completer.clear():this.completer.open())},Object.defineProperty(e.prototype,"searchStr",{get:function(){return this._searchStr},set:function(e){this._searchStr=e,this._displayStr=e},enumerable:!0,configurable:!0}),e.prototype.handleSelection=function(){this.completer.hasHighlighted()?(this._searchStr="",this.completer.selectCurrent()):this.overrideSuggested?this.completer.onSelected({title:this.searchStr,originalObject:null}):(this.clearUnselected&&!this.completer.hasSelected&&(this.searchStr="",this.ngModelChange.emit(this.searchStr)),this.completer.clear())},e.prototype.restoreSearchValue=function(){this.fillHighlighted&&this._displayStr!==this.searchStr&&(this._displayStr=this.searchStr,this.ngModelChange.emit(this.searchStr))},e.prototype.doBlur=function(){this.blurTimer&&(this.blurTimer.unsubscribe(),this.blurTimer=null),this.overrideSuggested?this.completer.onSelected({title:this.searchStr,originalObject:null}):this.clearUnselected&&!this.completer.hasSelected?(this.searchStr="",this.ngModelChange.emit(this.searchStr)):this.restoreSearchValue(),this.completer.clear()},e.ɵfac=function(i){return new(i||e)(t.ɵɵdirectiveInject(m,1),t.ɵɵdirectiveInject(n.NgModel),t.ɵɵdirectiveInject(t.ElementRef))},e.ɵdir=t.ɵɵdefineDirective({type:e,selectors:[["","ctrInput",""]],hostBindings:function(e,i){1&e&&t.ɵɵlistener("keyup",(function(e){return i.keyupHandler(e)}))("paste",(function(e){return i.pasteHandler(e)}))("keydown",(function(e){return i.keydownHandler(e)}))("blur",(function(e){return i.onBlur(e)}))("focus",(function(){return i.onfocus()}))("click",(function(e){return i.onClick(e)}))},inputs:{clearSelected:"clearSelected",clearUnselected:"clearUnselected",overrideSuggested:"overrideSuggested",fillHighlighted:"fillHighlighted",openOnFocus:"openOnFocus",openOnClick:"openOnClick",selectOnClick:"selectOnClick",selectOnFocus:"selectOnFocus",autoSelectOnEnter:"autoSelectOnEnter"},outputs:{ngModelChange:"ngModelChange"}}),e}(),x=function(e,t,i,n){this.results=e,this.searching=t,this.searchInitialized=i,this.isOpen=n},b=function(){function e(e,t,i,n){this.completer=e,this.templateRef=t,this.viewContainer=i,this.cd=n,this.ctrListMinSearchLength=3,this.ctrListPause=10,this.ctrListAutoMatch=!1,this.ctrListAutoHighlight=!1,this.ctrListDisplaySearching=!0,this.term=null,this.searchTimer=null,this.clearTimer=null,this.ctx=new x([],!1,!1,!1),this._initialValue=null,this.viewRef=null}return e.prototype.ngOnInit=function(){this.completer.registerList(this),this.viewRef=this.viewContainer.createEmbeddedView(this.templateRef,new x([],!1,!1,!1))},Object.defineProperty(e.prototype,"dataService",{set:function(e){this._dataService=e,this.dataServiceSubscribe()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialValue",{set:function(e){var t=this;this._dataService&&"function"==typeof this._dataService.convertToItem?setTimeout((function(){if(e){var i=t._dataService.convertToItem(e);i&&t.completer.onSelected(i,!1)}})):this._dataService||(this._initialValue=e)},enumerable:!0,configurable:!0}),e.prototype.search=function(e){var t=this;!y(e)&&e.length>=this.ctrListMinSearchLength&&this.term!==e?(this.searchTimer&&(this.searchTimer.unsubscribe(),this.searchTimer=null),this.ctx.searching||(this.ctrListDisplaySearching&&(this.ctx.results=[]),this.ctx.searching=!0,this.ctx.searchInitialized=!0,this.refreshTemplate()),this.clearTimer&&this.clearTimer.unsubscribe(),this.searchTimer=o.timer(this.ctrListPause).pipe(s.take(1)).subscribe((function(){t.searchTimerComplete(e)}))):!y(e)&&e.length<this.ctrListMinSearchLength&&(this.clear(),this.term="")},e.prototype.clear=function(){var e=this;this.searchTimer&&this.searchTimer.unsubscribe(),this.clearTimer=o.timer(50).pipe(s.take(1)).subscribe((function(){e._clear()}))},e.prototype.open=function(){this.ctx.searchInitialized||this.search(""),this.refreshTemplate()},e.prototype.isOpen=function(e){this.ctx.isOpen=e},e.prototype._clear=function(){this.searchTimer&&(this.searchTimer.unsubscribe(),this.searchTimer=null),this.dataService&&this.dataService.cancel(),this.viewContainer.clear(),this.viewRef=null},e.prototype.searchTimerComplete=function(e){y(e)||e.length<this.ctrListMinSearchLength?this.ctx.searching=!1:(this.term=e,this._dataService.search(e))},e.prototype.refreshTemplate=function(){this.viewRef?this.viewRef.destroyed||(this.viewRef.context.isOpen=this.ctx.isOpen,this.viewRef.context.results=this.ctx.results,this.viewRef.context.searching=this.ctx.searching,this.viewRef.context.searchInitialized=this.ctx.searchInitialized,this.viewRef.detectChanges()):this.viewRef=this.viewContainer.createEmbeddedView(this.templateRef,this.ctx),this.cd.markForCheck()},e.prototype.getBestMatchIndex=function(){var e=this;if(!this.ctx.results||!this.term)return null;var t=this.ctx.results.findIndex((function(t){return t.title.toLowerCase()===e.term.toLocaleLowerCase()}));return t<0&&(t=this.ctx.results.findIndex((function(t){return t.title.toLowerCase().startsWith(e.term.toLocaleLowerCase())}))),t<0&&(t=this.ctx.results.findIndex((function(t){return t.title.toLowerCase().includes(e.term.toLocaleLowerCase())}))),t<0?null:t},e.prototype.dataServiceSubscribe=function(){var e=this;this._dataService&&(this._dataService.pipe(s.catchError((function(e){return console.error(e),console.error("Unexpected error in dataService: errors should be handled by the dataService Observable"),[]}))).subscribe((function(t){e.ctx.searchInitialized=!0,e.ctx.searching=!1,e.ctx.results=t,e.ctrListAutoMatch&&t&&1===t.length&&t[0].title&&!y(e.term)&&t[0].title.toLocaleLowerCase()===e.term.toLocaleLowerCase()?e.completer.onSelected(t[0]):(e._initialValue&&(e.initialValue=e._initialValue,e._initialValue=null),e.refreshTemplate(),e.ctrListAutoHighlight&&(e.completer.autoHighlightIndex=e.getBestMatchIndex()))})),this._dataService.dataSourceChange&&this._dataService.dataSourceChange.subscribe((function(){e.term=null,e.ctx.searchInitialized=!1,e.ctx.searching=!1,e.ctx.results=[],e.refreshTemplate(),e.completer.onDataSourceChange()})))},e.ɵfac=function(i){return new(i||e)(t.ɵɵdirectiveInject(m,1),t.ɵɵdirectiveInject(t.TemplateRef),t.ɵɵdirectiveInject(t.ViewContainerRef),t.ɵɵdirectiveInject(t.ChangeDetectorRef))},e.ɵdir=t.ɵɵdefineDirective({type:e,selectors:[["","ctrList",""]],inputs:{ctrListMinSearchLength:"ctrListMinSearchLength",ctrListPause:"ctrListPause",ctrListAutoMatch:"ctrListAutoMatch",ctrListAutoHighlight:"ctrListAutoHighlight",ctrListDisplaySearching:"ctrListDisplaySearching",dataService:["ctrList","dataService"],initialValue:["ctrListInitialValue","initialValue"]}}),e}(),I=function(){function e(e,t,i){this.el=e,this.renderer=t,this.dropdown=i,this.selected=!1}return e.prototype.ngOnDestroy=function(){this._rowIndex&&this.dropdown.unregisterRow(this._rowIndex)},Object.defineProperty(e.prototype,"ctrRow",{set:function(e){this._rowIndex=e,this.dropdown.registerRow(new S(this,this._rowIndex))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataItem",{set:function(e){this._item=e},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.dropdown.onSelected(this._item)},e.prototype.onMouseEnter=function(e){this.dropdown.highlightRow(this._rowIndex)},e.prototype.onMouseDown=function(e){this.dropdown.rowMouseDown()},e.prototype.setHighlighted=function(e){this.selected=e;this.selected?this.renderer.addClass(this.el.nativeElement,"completer-selected-row"):this.renderer.removeClass(this.el.nativeElement,"completer-selected-row")},e.prototype.getNativeElement=function(){return this.el.nativeElement},e.prototype.getDataItem=function(){return this._item},e.ɵfac=function(i){return new(i||e)(t.ɵɵdirectiveInject(t.ElementRef),t.ɵɵdirectiveInject(t.Renderer2),t.ɵɵdirectiveInject(C,1))},e.ɵdir=t.ɵɵdefineDirective({type:e,selectors:[["","ctrRow",""]],hostBindings:function(e,i){1&e&&t.ɵɵlistener("click",(function(e){return i.onClick(e)}))("mouseenter",(function(e){return i.onMouseEnter(e)}))("mousedown",(function(e){return i.onMouseDown(e)}))},inputs:{ctrRow:"ctrRow",dataItem:"dataItem"}}),e}(),_=function(e){function t(){return e.call(this)||this}return u(t,e),t.prototype.cancel=function(){},t.prototype.searchFields=function(e){return this._searchFields=e,this},t.prototype.titleField=function(e){return this._titleField=e,this},t.prototype.descriptionField=function(e){return this._descriptionField=e,this},t.prototype.imageField=function(e){return this._imageField=e,this},t.prototype.convertToItem=function(e){var t,i=null,n=null;return"string"!=typeof(t=this._titleField?this.extractTitle(e):e)&&(t=JSON.stringify(t)),this._descriptionField&&(n=this.extractValue(e,this._descriptionField)),this._imageField&&(i=this.extractValue(e,this._imageField)),y(t)?null:{description:n,image:i,originalObject:e,title:t}},t.prototype.extractMatches=function(e,t){var i=this,n=this._searchFields?this._searchFields.split(","):null;return null!==this._searchFields&&void 0!==this._searchFields&&""!==t?e.filter((function(e){return(n?i.extractBySearchFields(n,e):[e]).some((function(e){return e.toString().toLowerCase().indexOf(t.toString().toLowerCase())>=0}))})):e},t.prototype.extractTitle=function(e){var t=this;return this._titleField?this._titleField.split(",").map((function(i){return t.extractValue(e,i)})).reduce((function(e,t){return e?e+" "+t:t})):""},t.prototype.extractValue=function(e,t){var i,n,r,o;if(t){r=t.split("."),o=e;try{for(var s=d(r),c=s.next();!c.done;c=s.next())t=c.value,o&&(o=o[t])}catch(e){i={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}}else o=e;return o},t.prototype.processResults=function(e){var t,i=[];if(e&&e.length>0)for(t=0;t<e.length;t++){var n=this.convertToItem(e[t]);n&&i.push(n)}return i},t.prototype.extractBySearchFields=function(e,t){var i=this;return e.map((function(e){return i.extractValue(t,e)})).filter((function(e){return!!e}))},t}(o.Subject),O=function(e){function i(){var i=e.call(this)||this;return i.dataSourceChange=new t.EventEmitter,i}return u(i,e),i.prototype.data=function(e){var t=this;e instanceof o.Observable?e.pipe(s.catchError((function(){return[]}))).subscribe((function(e){t._data=e,t.savedTerm&&t.search(t.savedTerm),t.dataSourceChange.emit()})):this._data=e;return this.dataSourceChange.emit(),this},i.prototype.search=function(e){if(this._data){this.savedTerm=null;var t=this.extractMatches(this._data,e);this.next(this.processResults(t))}else this.savedTerm=e},i.prototype.convertToItem=function(t){return e.prototype.convertToItem.call(this,t)},i}(_),M=function(){function e(){}return e.prototype.create=function(){return new O},e.ɵfac=function(t){return new(t||e)},e.ɵprov=t.ɵɵdefineInjectable({token:e,factory:e.ɵfac}),e}(),E=function(e){function i(i){var n=e.call(this)||this;return n.http=i,n.dataSourceChange=new t.EventEmitter,n._urlFormater=null,n._dataField=null,n}return u(i,e),i.prototype.remoteUrl=function(e){return this._remoteUrl=e,this.dataSourceChange.emit(),this},i.prototype.urlFormater=function(e){this._urlFormater=e},i.prototype.dataField=function(e){this._dataField=e},i.prototype.requestOptions=function(e){this._requestOptions=e},i.prototype.search=function(e){var t=this;this.cancel();var i="";i=this._urlFormater?this._urlFormater(e):this._remoteUrl+encodeURIComponent(e),this.remoteSearch=this.http.get(i,Object.assign({},this._requestOptions)).pipe(s.map((function(i){var n=t.extractValue(i,t._dataField);return t.extractMatches(n,e)})),s.catchError((function(){return[]}))).subscribe((function(e){var i=t.processResults(e);t.next(i)}))},i.prototype.cancel=function(){this.remoteSearch&&this.remoteSearch.unsubscribe()},i.prototype.convertToItem=function(t){return e.prototype.convertToItem.call(this,t)},i}(_),R=function(){function e(e){this.http=e}return e.prototype.create=function(){return new E(this.http)},e.ɵfac=function(i){return new(i||e)(t.ɵɵinject(r.HttpClient))},e.ɵprov=t.ɵɵdefineInjectable({token:e,factory:e.ɵfac}),e}(),F=function(){function e(e,t){this.localDataFactory=e,this.remoteDataFactory=t}return e.prototype.local=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=""),this.localDataFactory.create().data(e).searchFields(t).titleField(i)},e.prototype.remote=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=""),this.remoteDataFactory.create().remoteUrl(e).searchFields(t).titleField(i)},e.ɵfac=function(i){return new(i||e)(t.ɵɵinject(M),t.ɵɵinject(R))},e.ɵprov=t.ɵɵdefineInjectable({token:e,factory:e.ɵfac}),e}(),L=["ctrInput"];function k(e,i){if(1&e&&(t.ɵɵelementStart(0,"mat-label"),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){var n=t.ɵɵnextContext();t.ɵɵadvance(1),t.ɵɵtextInterpolate(n.placeholder)}}function H(e,i){if(1&e&&(t.ɵɵelementStart(0,"div",15),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){var n=t.ɵɵnextContext(3);t.ɵɵadvance(1),t.ɵɵtextInterpolate(n._textSearching)}}function T(e,i){if(1&e&&(t.ɵɵelementStart(0,"div",16),t.ɵɵtext(1),t.ɵɵelementEnd()),2&e){var n=t.ɵɵnextContext(3);t.ɵɵadvance(1),t.ɵɵtextInterpolate(n._textNoResults)}}function j(e,i){if(1&e&&t.ɵɵelement(0,"img",26),2&e){var n=t.ɵɵnextContext(2).$implicit;t.ɵɵpropertyInterpolate("src",n.image,t.ɵɵsanitizeUrl)}}function D(e,i){1&e&&t.ɵɵelement(0,"div",27)}function V(e,i){if(1&e&&(t.ɵɵelementStart(0,"div",23),t.ɵɵtemplate(1,j,1,1,"img",24),t.ɵɵtemplate(2,D,1,0,"div",25),t.ɵɵelementEnd()),2&e){var n=t.ɵɵnextContext().$implicit;t.ɵɵadvance(1),t.ɵɵproperty("ngIf",""!=n.image),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",""===n.image)}}function P(e,i){if(1&e&&t.ɵɵelement(0,"completer-list-item",28),2&e){var n=t.ɵɵnextContext().$implicit,r=t.ɵɵnextContext(3);t.ɵɵproperty("text",n.description)("matchClass",r.matchClass)("searchStr",r.searchStr)("type","description")}}var N=function(e){return{"completer-item-text-image":e}};function B(e,i){if(1&e&&(t.ɵɵelementStart(0,"div",17),t.ɵɵelementStart(1,"div",18),t.ɵɵtemplate(2,V,3,2,"div",19),t.ɵɵelementStart(3,"div",20),t.ɵɵelement(4,"completer-list-item",21),t.ɵɵtemplate(5,P,1,4,"completer-list-item",22),t.ɵɵelementEnd(),t.ɵɵelementEnd(),t.ɵɵelementEnd()),2&e){var n=i.$implicit,r=i.index,o=t.ɵɵnextContext(3);t.ɵɵadvance(1),t.ɵɵproperty("ctrRow",r)("dataItem",n),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",n.image||""===n.image),t.ɵɵadvance(1),t.ɵɵproperty("ngClass",t.ɵɵpureFunction1(9,N,n.image||""===n.image)),t.ɵɵadvance(1),t.ɵɵproperty("text",n.title)("matchClass",o.matchClass)("searchStr",o.searchStr)("type","title"),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",n.description&&""!=n.description)}}function q(e,i){if(1&e&&(t.ɵɵelementStart(0,"div",11),t.ɵɵtemplate(1,H,2,1,"div",12),t.ɵɵtemplate(2,T,2,1,"div",13),t.ɵɵtemplate(3,B,6,11,"div",14),t.ɵɵelementEnd()),2&e){var n=t.ɵɵnextContext(),r=n.searching,o=n.results,s=t.ɵɵnextContext();t.ɵɵadvance(1),t.ɵɵproperty("ngIf",r&&s.displaySearching),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",!(r||o&&0!==(null==o?null:o.length))),t.ɵɵadvance(1),t.ɵɵproperty("ngForOf",o)}}function A(e,i){if(1&e&&(t.ɵɵelementStart(0,"div",9),t.ɵɵtemplate(1,q,4,3,"div",10),t.ɵɵelementEnd()),2&e){var n=i.results,r=i.searching,o=i.searchInitialized,s=i.isOpen,c=t.ɵɵnextContext();t.ɵɵadvance(1),t.ɵɵproperty("ngIf",o&&s&&((null==n?null:n.length)>0||c.displayNoResults&&!r||r&&c.displaySearching))}}function U(e,i){if(1&e){var n=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",29),t.ɵɵelementStart(1,"mat-chip-list",30),t.ɵɵelementStart(2,"mat-chip",31),t.ɵɵlistener("removed",(function(){return t.ɵɵrestoreView(n),t.ɵɵnextContext().removeItem()})),t.ɵɵelementStart(3,"span",32),t.ɵɵtext(4),t.ɵɵelementEnd(),t.ɵɵelementStart(5,"mat-icon",33),t.ɵɵtext(6,"cancel"),t.ɵɵelementEnd(),t.ɵɵelementEnd(),t.ɵɵelementEnd(),t.ɵɵelementEnd()}if(2&e){var r=t.ɵɵnextContext(),o=t.ɵɵreference(6);t.ɵɵadvance(1),t.ɵɵproperty("disabled",o.disabled),t.ɵɵadvance(1),t.ɵɵproperty("selectable",!0)("removable",!0),t.ɵɵadvance(2),t.ɵɵtextInterpolate(null==r.completerItem?null:r.completerItem.title)}}var z=function(){},K={provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return Q})),multi:!0},Q=function(){function e(e,i){this.completerService=e,this.cdr=i,this.inputName="",this.inputId="",this.pause=10,this.minSearchLength=3,this.maxChars=524288,this.overrideSuggested=!1,this.clearSelected=!1,this.clearUnselected=!1,this.fillHighlighted=!0,this.placeholder="",this.autoMatch=!1,this.disableInput=!1,this.autofocus=!1,this.openOnFocus=!1,this.openOnClick=!1,this.selectOnClick=!1,this.autoHighlight=!1,this.autoSelectOnEnter=!0,this.appearance="",this.selected=new t.EventEmitter,this.highlighted=new t.EventEmitter,this.blurEvent=new t.EventEmitter,this.click=new t.EventEmitter,this.focusEvent=new t.EventEmitter,this.opened=new t.EventEmitter,this.keyup=new t.EventEmitter,this.keydown=new t.EventEmitter,this.searchStr="",this.control=new n.FormControl(""),this.displaySearching=!0,this.displayNoResults=!0,this._textNoResults="No results found",this._textSearching="Searching...",this._onTouchedCallback=z,this._onChangeCallback=z,this._focus=!1,this._open=!1,this._onlyOnInit=!0}return Object.defineProperty(e.prototype,"value",{get:function(){return this.completerItem?this.completerItem.originalObject:this.searchStr},set:function(e){"string"==typeof e?this.searchStr=e:this.completerItem=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.autofocus&&(this._focus=!0)},e.prototype.ngAfterViewChecked=function(){var e=this;this._focus&&setTimeout((function(){e.ctrInput&&(e.ctrInput.nativeElement.focus(),e._focus=!1)}),0)},e.prototype.onTouched=function(){this._onTouchedCallback()},e.prototype.writeValue=function(e){!e||0!==e.id&&0!==e.id||(e=null),e&&this.dataService.convertToItem?(this.completerItem=this.dataService.convertToItem(e),this.searchStr=this.completerItem.title):(this.completerItem=null,this.searchStr=null)},e.prototype.registerOnChange=function(e){this._onChangeCallback=e},e.prototype.registerOnTouched=function(e){this._onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disableInput=e,this.form||(e?this.control.disable({onlySelf:!1,emitEvent:!0}):this.control.enable({onlySelf:!1,emitEvent:!0}))},Object.defineProperty(e.prototype,"datasource",{set:function(e){e&&(this.dataService=e instanceof Array?this.completerService.local(e):"string"==typeof e?this.completerService.remote(e):e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textNoResults",{set:function(e){this._textNoResults!==e&&(this._textNoResults=e,this.displayNoResults=!!this._textNoResults&&"false"!==this._textNoResults)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textSearching",{set:function(e){this._textSearching!==e&&(this._textSearching=e,this.displaySearching=!!this._textSearching&&"false"!==this._textSearching)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;""===this.required&&(this.required=!0),this.required&&this.control.setValidators(n.Validators.required),this.form&&(this.form.control.addControl(this.name,this.control),this.form.control.get(this.name).updateValueAndValidity()),this.completer.selected.subscribe((function(t){e.completerItem=t,e.completerItem||(e.searchStr=void 0),e._onChangeCallback(e.completerItem?e.completerItem.originalObject:null),e.selected.emit(t)})),this.completer.highlighted.subscribe((function(t){e.highlighted.emit(t)})),this.completer.opened.subscribe((function(t){e._open=t,e.opened.emit(t)}))},e.prototype.removeItem=function(){var e=this;this.completerItem=void 0,this.searchStr=void 0,this._onChangeCallback(this.completerItem?this.completerItem.originalObject:null),this.selected.emit(null),setTimeout((function(){e.ctrInput&&(e.ctrInput.nativeElement.focus(),e._focus=!1)}),10)},e.prototype.onBlur=function(){this.blurEvent.emit(),this.onTouched(),this.cdr.detectChanges()},e.prototype.onFocus=function(){this.focusEvent.emit()},e.prototype.onClick=function(e){this.click.emit(e),this.onTouched()},e.prototype.onKeyup=function(e){this.keyup.emit(e)},e.prototype.onKeydown=function(e){this._onlyOnInit=!1,this.keydown.emit(e)},e.prototype.onChange=function(e){this.value=e},e.prototype.open=function(){this.completer.open()},e.prototype.close=function(){this.completer.clear()},e.prototype.focus=function(){this.ctrInput?this.ctrInput.nativeElement.focus():this._focus=!0},e.prototype.blur=function(){this.ctrInput?this.ctrInput.nativeElement.blur():this._focus=!1},e.prototype.isOpen=function(){return this._open},e.ɵfac=function(i){return new(i||e)(t.ɵɵdirectiveInject(F),t.ɵɵdirectiveInject(t.ChangeDetectorRef))},e.ɵcmp=t.ɵɵdefineComponent({type:e,selectors:[["neo-completer-mat"]],viewQuery:function(e,i){var n;(1&e&&(t.ɵɵstaticViewQuery(m,!0),t.ɵɵstaticViewQuery(L,!0)),2&e)&&(t.ɵɵqueryRefresh(n=t.ɵɵloadQuery())&&(i.completer=n.first),t.ɵɵqueryRefresh(n=t.ɵɵloadQuery())&&(i.ctrInput=n.first))},inputs:{dataService:"dataService",required:"required",name:"name",inputName:"inputName",inputId:"inputId",pause:"pause",minSearchLength:"minSearchLength",maxChars:"maxChars",overrideSuggested:"overrideSuggested",clearSelected:"clearSelected",clearUnselected:"clearUnselected",fillHighlighted:"fillHighlighted",placeholder:"placeholder",matchClass:"matchClass",fieldTabindex:"fieldTabindex",autoMatch:"autoMatch",disableInput:"disableInput",inputClass:"inputClass",formFieldClass:"formFieldClass",autofocus:"autofocus",openOnFocus:"openOnFocus",openOnClick:"openOnClick",selectOnClick:"selectOnClick",initialValue:"initialValue",autoHighlight:"autoHighlight",autoSelectOnEnter:"autoSelectOnEnter",appearance:"appearance",form:"form",datasource:"datasource",textNoResults:"textNoResults",textSearching:"textSearching"},outputs:{selected:"selected",highlighted:"highlighted",blurEvent:"blur",click:"click",focusEvent:"focus",opened:"opened",keyup:"keyup",keydown:"keydown"},features:[t.ɵɵProvidersFeature([K])],decls:9,vars:33,consts:[[3,"ngClass","appearance"],[4,"ngIf"],["ctrCompleter","",1,"completer-holder"],["matInput","","type","search","ctrInput","","autocomplete","off","autocorrect","off","autocapitalize","off",1,"completer-input",3,"required","ngClass","ngModel","placeholder","tabindex","disabled","clearSelected","clearUnselected","overrideSuggested","openOnFocus","fillHighlighted","openOnClick","selectOnClick","autoSelectOnEnter","ngModelChange","blur","focus","keyup","keydown","click"],["ctrInput",""],["matInput","",3,"formControl"],["ctrInputHidden",""],["class","completer-dropdown-holder",4,"ctrList","ctrListMinSearchLength","ctrListPause","ctrListAutoMatch","ctrListInitialValue","ctrListAutoHighlight","ctrListDisplaySearching"],["class","completer-holder",4,"ngIf"],[1,"completer-dropdown-holder"],["class","completer-dropdown","ctrDropdown","",4,"ngIf"],["ctrDropdown","",1,"completer-dropdown"],["class","completer-searching",4,"ngIf"],["class","completer-no-results",4,"ngIf"],["class","completer-row-wrapper",4,"ngFor","ngForOf"],[1,"completer-searching"],[1,"completer-no-results"],[1,"completer-row-wrapper"],[1,"completer-row",3,"ctrRow","dataItem"],["class","completer-image-holder",4,"ngIf"],[1,"completer-item-text",3,"ngClass"],[1,"completer-title",3,"text","matchClass","searchStr","type"],["class","completer-description",3,"text","matchClass","searchStr","type",4,"ngIf"],[1,"completer-image-holder"],["class","completer-image",3,"src",4,"ngIf"],["class","completer-image-default",4,"ngIf"],[1,"completer-image",3,"src"],[1,"completer-image-default"],[1,"completer-description",3,"text","matchClass","searchStr","type"],[1,"completer-holder"],[3,"disabled"],["id","chip-badge",3,"selectable","removable","removed"],[1,""],["matChipRemove",""]],template:function(e,i){if(1&e&&(t.ɵɵelementStart(0,"mat-form-field",0),t.ɵɵtemplate(1,k,2,1,"mat-label",1),t.ɵɵelementStart(2,"div",2),t.ɵɵelementStart(3,"input",3,4),t.ɵɵlistener("ngModelChange",(function(e){return i.searchStr=e}))("ngModelChange",(function(e){return i.onChange(e)}))("blur",(function(){return i.onBlur()}))("focus",(function(){return i.onFocus()}))("keyup",(function(e){return i.onKeyup(e)}))("keydown",(function(e){return i.onKeydown(e)}))("click",(function(e){return i.onClick(e)})),t.ɵɵelementEnd(),t.ɵɵelement(5,"input",5,6),t.ɵɵtemplate(7,A,2,1,"div",7),t.ɵɵelementEnd(),t.ɵɵtemplate(8,U,7,4,"div",8),t.ɵɵelementEnd()),2&e){var n=t.ɵɵreference(6);t.ɵɵproperty("ngClass",i.formFieldClass)("appearance",i.appearance),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",i.appearance),t.ɵɵadvance(2),t.ɵɵclassProp("none-display",i.completerItem),t.ɵɵproperty("required",i.required)("ngClass",i.inputClass)("ngModel",i.searchStr)("placeholder",i.placeholder)("tabindex",i.fieldTabindex)("disabled",n.disabled)("clearSelected",i.clearSelected)("clearUnselected",i.clearUnselected)("overrideSuggested",i.overrideSuggested)("openOnFocus",i.openOnFocus)("fillHighlighted",i.fillHighlighted)("openOnClick",i.openOnClick)("selectOnClick",i.selectOnClick)("autoSelectOnEnter",i.autoSelectOnEnter),t.ɵɵattribute("id",i.inputId.length>0?i.inputId:null)("name",i.inputName)("maxlength",i.maxChars),t.ɵɵadvance(2),t.ɵɵclassProp("none-display",!0),t.ɵɵproperty("formControl",i.control),t.ɵɵadvance(2),t.ɵɵproperty("ctrList",i.dataService)("ctrListMinSearchLength",i.minSearchLength)("ctrListPause",i.pause)("ctrListAutoMatch",i.autoMatch)("ctrListInitialValue",i.initialValue)("ctrListAutoHighlight",i.autoHighlight)("ctrListDisplaySearching",i.displaySearching),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",i.completerItem)}},directives:[c.MatFormField,i.NgClass,i.NgIf,m,l.MatInput,n.DefaultValueAccessor,w,n.RequiredValidator,n.NgControlStatus,n.NgModel,n.MaxLengthValidator,n.FormControlDirective,b,c.MatLabel,C,i.NgForOf,I,v,a.MatChipList,a.MatChip,h.MatIcon,a.MatChipRemove],styles:[".completer-dropdown[_ngcontent-%COMP%]{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px;margin-top:10px;cursor:pointer;z-index:9999;position:absolute;background-color:#fff;max-height:200px;height:200px;overflow-y:auto;overflow-x:hidden}.completer-row[_ngcontent-%COMP%]:hover{background:rgba(0,0,0,.04)}.completer-row[_ngcontent-%COMP%]{line-height:48px;height:48px;color:#000;width:100%;text-overflow:ellipsis;text-align:left;padding:0 16px}.completer-row-wrapper[_ngcontent-%COMP%]{text-overflow:ellipsis}.completer-selected-row[_ngcontent-%COMP%]{background:rgba(0,0,0,.04)}.completer-description[_ngcontent-%COMP%]{font-size:14px}.completer-image-default[_ngcontent-%COMP%]{width:16px;height:16px}.completer-image-holder[_ngcontent-%COMP%]{float:left;width:10%}.completer-item-text-image[_ngcontent-%COMP%]{float:right;width:90%}.none-display[_ngcontent-%COMP%]{display:none}.mat-standard-chip[_ngcontent-%COMP%] .mat-chip-remove.mat-icon[_ngcontent-%COMP%]{width:16px!important;height:16px!important}.mat-chip[_ngcontent-%COMP%] .mat-chip-remove.mat-icon[_ngcontent-%COMP%], .mat-chip[_ngcontent-%COMP%] .mat-chip-trailing-icon.mat-icon[_ngcontent-%COMP%]{font-size:16px!important}.mat-standard-chip[_ngcontent-%COMP%]{min-height:24px!important;font-size:14px!important}mat-chip-list[_ngcontent-%COMP%] .mat-chip-list-wrapper[_ngcontent-%COMP%]{margin:-7px!important}#chip-badge[_ngcontent-%COMP%]{margin:1px!important}"]}),e}(),$=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[F,M,R]}},e.ɵmod=t.ɵɵdefineNgModule({type:e}),e.ɵinj=t.ɵɵdefineInjector({factory:function(t){return new(t||e)},imports:[[i.CommonModule,n.FormsModule,n.ReactiveFormsModule,r.HttpClientModule,l.MatInputModule,a.MatChipsModule,h.MatIconModule]]}),e}();("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope($,{declarations:[v,m,C,w,b,I,Q],imports:[i.CommonModule,n.FormsModule,n.ReactiveFormsModule,r.HttpClientModule,l.MatInputModule,a.MatChipsModule,h.MatIconModule],exports:[Q,v,m,C,w,b,I]});var J=function(){function e(e){this.modelString="",this.fieldValue="",this.completerService=e}return e.prototype.onSelected=function(e){this.selectedObject[this.fieldValue]=null!=e?e.originalObject:this.empty},e.prototype.local=function(e,t,i,n,r,o){return void 0===i&&(i=""),this.selectedObject=t,this.fieldValue=i,this.dataSource=this.completerService.local(e,n,r),this.modelString=""!==i?this.selectedObject[this.fieldValue][n]:this.selectedObject[n],this.empty=o,this.dataSource},e}();e.CompleterBaseData=_,e.CompleterCmp=Q,e.CompleterListItemCmp=v,e.CompleterService=F,e.CtrCompleter=m,e.CtrDropdown=C,e.CtrInput=w,e.CtrList=b,e.CtrListContext=x,e.CtrRow=I,e.CtrRowItem=S,e.LocalData=O,e.LocalDataFactory=M,e.NgxNeoCompleterMatModule=$,e.NgxNeoCompleterMatService=J,e.RemoteData=E,e.RemoteDataFactory=R,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=neocomplexx-ngx-neo-completer-mat.umd.min.js.map