UNPKG

@progress/kendo-angular-dropdowns

Version:
1 lines • 115 kB
System.register("@progress/kendo-angular-dropdowns",["@progress/kendo-angular-popup","@progress/kendo-angular-resize-sensor","tslib","@angular/core","@angular/forms","rxjs/Observable","@progress/kendo-angular-l10n","rxjs/add/operator/do","rxjs/add/operator/filter","rxjs/add/operator/catch","rxjs/add/operator/let","rxjs/add/operator/merge","rxjs/add/operator/distinctUntilChanged","rxjs/add/operator/throttleTime","rxjs/Subject","rxjs/Subscription","rxjs/add/operator/partition","rxjs/add/operator/map","rxjs/add/observable/fromEvent","rxjs/add/observable/interval","rxjs/add/operator/concatMap","rxjs/add/operator/take","rxjs/add/operator/takeUntil","rxjs/add/operator/skipWhile","@angular/common"],function(e){function t(t){for(var i in t)e(i,t[i])}function i(e){return e.__useDefault?e.default:e}var n,o,a,s,r,p,l,u,d,c,h,m,v,g,f,_,y,b,S,C,x,I,w,E,O;return{setters:[function(e){n=i(e)},function(e){o=i(e)},function(e){a=i(e)},function(e){s=i(e)},function(e){r=i(e)},function(e){p=i(e)},function(e){l=i(e)},function(e){u=i(e)},function(e){d=i(e)},function(e){c=i(e)},function(e){h=i(e)},function(e){m=i(e)},function(e){v=i(e)},function(e){g=i(e)},function(e){f=i(e)},function(e){_=i(e)},function(e){y=i(e)},function(e){b=i(e)},function(e){S=i(e)},function(e){C=i(e)},function(e){x=i(e)},function(e){I=i(e)},function(e){w=i(e)},function(e){E=i(e)},function(e){O=i(e)}],execute:function(){!function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var i={};t.m=e,t.c=i,t.p="",t(0)}([function(e,i,n){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var o=n(1);i.AutoCompleteComponent=o.AutoCompleteComponent;var a=n(19);i.ComboBoxComponent=a.ComboBoxComponent;var s=n(31);i.DropDownListComponent=s.DropDownListComponent;var r=n(39);i.MultiSelectComponent=r.MultiSelectComponent;var p=n(42);i.TagListComponent=p.TagListComponent;var l=n(9);i.ItemTemplateDirective=l.ItemTemplateDirective;var u=n(10);i.HeaderTemplateDirective=u.HeaderTemplateDirective;var d=n(11);i.FooterTemplateDirective=d.FooterTemplateDirective;var c=n(38);i.ValueTemplateDirective=c.ValueTemplateDirective;var h=n(43);i.TemplateContextDirective=h.TemplateContextDirective;var m=n(44);i.SelectableDirective=m.SelectableDirective;var v=n(45);i.DropDownsModule=v.DropDownsModule;var g=n(55);i.MultiSelectModule=g.MultiSelectModule;var f=n(47);i.SharedModule=f.SharedModule;var _=n(46);i.AutoCompleteModule=_.AutoCompleteModule;var y=n(53);i.ComboBoxModule=y.ComboBoxModule;var b=n(54);i.DropDownListModule=b.DropDownListModule;var S=n(52);i.SharedDirectivesModule=S.SharedDirectivesModule;var C=n(49);i.ListComponent=C.ListComponent;var x=n(18);i.PopupComponent=x.PopupComponent;var I=n(51);i.ResizeSensorComponent=I.ResizeSensorComponent;var w=n(17);i.PreventableEvent=w.PreventableEvent,t(i)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=i(4),s=i(5),r=i(9),p=i(10),l=i(11),u=i(12),d=i(13),c=i(15),h=i(7),m=i(14),v=i(16),g=i(6),f=i(17),_=i(8),y=i(18);t.AUTOCOMPLETE_VALUE_ACCESSOR={multi:!0,provide:a.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return b})};var b=function(){function e(e,t,i,n,a,s){this.popupService=t,this.selectionService=i,this.navigationService=n,this.cdr=a,this.placeholder="",this.clearButton=!0,this.disabled=!1,this.tabIndex=0,this.filterable=!1,this.valueChange=new o.EventEmitter,this.filterChange=new o.EventEmitter,this.open=new o.EventEmitter,this.close=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.listBoxId=h.guid(),this.optionPrefix=h.guid(),this.onChangeCallback=function(e){},this.onTouchedCallback=function(e){},this.popupMouseDownHandler=function(e){return e.preventDefault()},this._popupSettings={height:200,animate:!0},this._open=!1,this._value="",this._isFocused=!1,this.direction=e?"rtl":"ltr",this.wrapper=s.nativeElement,this.data=[],this.subscribeEvents(),this.selectionService.resetSelection([-1])}return Object.defineProperty(e.prototype,"width",{get:function(){var e=0;h.isDocumentAvailable()&&(e=this.wrapper.offsetWidth);var t=this.popupSettings.width||e;return{min:isNaN(e)?e:e+"px",max:isNaN(t)?t:t+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.popupSettings.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listContainerClasses",{get:function(){var e=["k-list-container","k-reset"];return this.popupSettings.popupClass&&e.push(this.popupSettings.popupClass),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suggestion",{get:function(){if(this.value&&this.suggestedText){var e=this.suggestedText.toLowerCase().startsWith(this.value.toLowerCase());return this.suggest&&!this.backspacePressed&&e?this.suggestedText:void 0}this.suggestedText=void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupOpen",{get:function(){return this._open},set:function(e){if(!this.disabled&&this.popupOpen!==e){var t=new f.PreventableEvent;e&&!this.popupOpen&&this.open.emit(t),!e&&this.popupOpen&&this.close.emit(t),t.isDefaultPrevented()||this._toggle(e)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeDescendant",{get:function(){return this.optionPrefix+"-"+this.value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this.verifySettings(e),this._value=e,this.cdr.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({height:200,animate:!0},e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetClasses",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){this._isFocused=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetHeight",{get:function(){return this.popupSettings.height+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this._toggle(!1),this.unsubscribeEvents()},e.prototype.ngOnChanges=function(e){this.suggest&&this.data&&this.data.length&&this.value&&(this.suggestedText=h.getter(this.data[0],this.valueField))},e.prototype.toggle=function(e){var t=this;Promise.resolve(null).then(function(){t._toggle(void 0===e?!t._open:e),t.cdr.markForCheck()})},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.popupOpen},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this._previousValue=void 0,this.value=void 0},e.prototype.clearValue=function(e){e.stopImmediatePropagation(),this.filterable&&this.filterChange.emit(""),void 0!==this._previousValue&&(this._previousValue=this.value),this.change(void 0),this.selectionService.resetSelection([])},e.prototype.writeValue=function(e){this._previousValue=this.value,this.value=e},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.popupOpened=function(){this.popupWidth=this.width.max,this.popupMinWidth=this.width.min},e.prototype.focus=function(){this.disabled||this.searchbar.focus()},e.prototype.blur=function(){this.disabled||this.searchbar.blur()},e.prototype.onResize=function(){if(this._open){var e=this.popupRef.popupElement,t=this.width,i=t.min,n=t.max;e.style.minWidth=i,e.style.width=n}},e.prototype.verifySettings=function(e){if(o.isDevMode()&&h.isPresent(e)&&"string"!=typeof e)throw new Error("Expected value of type string. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/autocomplete/#toc-value")},e.prototype.search=function(e){var t=this,i=this.data.findIndex(function(i){var n=h.getter(i,t.valueField);return(n=void 0===n?"":n.toString().toLowerCase()).startsWith(e.toLowerCase())});this.selectionService.focus(i),this.suggest&&(this.suggestedText=h.getter(this.data[i],this.valueField))},e.prototype.navigate=function(e){this.popupOpen&&((e<0||e>this.data.length)&&(e=0),this.selectionService.focus(e))},e.prototype.handleNavigate=function(e){var t=isNaN(this.selectionService.focused)?0:this.selectionService.focused,i=h.isPresent(t),n=0;if(!this.disabled){i||(e.keyCode===g.Keys.down?n=-1:e.keyCode===g.Keys.up&&(n=1));var o=this.navigationService.process({current:t+n,max:this.data.length-1,min:0,originalEvent:e});o!==m.NavigationAction.Undefined&&o!==m.NavigationAction.Backspace&&o!==m.NavigationAction.Delete&&o!==m.NavigationAction.Home&&o!==m.NavigationAction.End&&o!==m.NavigationAction.Left&&o!==m.NavigationAction.Right&&(o===m.NavigationAction.Enter&&this.popupOpen||o!==m.NavigationAction.Enter)&&e.preventDefault()}},e.prototype.handleEnter=function(e){var t,i=this.selectionService.focused;if(this.popupOpen&&e.originalEvent.preventDefault(),i>=0)t=h.getter(this.data[i],this.valueField);else{var n=this.suggest&&this.suggestedText&&this.data.length&&h.getter(this.data[0],this.valueField,!0).toLowerCase()===this.searchbar.value.toLowerCase();t=this.popupOpen&&n?this.suggestedText:this.searchbar.value}this.change(t)},e.prototype.searchBarChange=function(e){var t=this.value?this.value.length:0;this.backspacePressed=e.length<t,this.value=e,this.popupOpen=e.length>0,this.filterable?(this.selectionService.focused=-1,this.filterChange.emit(e)):this.search(e)},e.prototype.handleFocus=function(){this._previousValue=this.value,this.isFocused=!0,this.onFocus.emit()},e.prototype.handleBlur=function(){if(void 0===this.value)return this.popupOpen=!1,this.isFocused=!1,this.onBlur.emit(),void this.onTouchedCallback();var e,t,i=this.selectionService.focused,n=this.value;-1!==i?(e=this.data[i],t=h.getter(e,this.valueField)||""):t=this.searchbar.value,t===this.searchbar.value?n=t:t&&t.toLowerCase()===this.searchbar.value.toLowerCase()&&(this.selectionService.resetSelection([]),n=this.searchbar.value),this.change(n),this.popupOpen=!1,this.isFocused=!1,this.onBlur.emit(),this.onTouchedCallback()},e.prototype.change=function(e){this.popupOpen=!1,e!==this._previousValue?(this.value=e,this._previousValue=this.value,this.onChangeCallback(this.value),this.valueChange.emit(this.value)):this.value=e},e.prototype.subscribeEvents=function(){var e=this;h.isDocumentAvailable()&&(this.changeSubscribtion=this.selectionService.onChange.subscribe(this.handleItemChange.bind(this)),this.focusSubscribtion=this.selectionService.onFocus.subscribe(this.handleItemFocus.bind(this)),this.navigationSubscribtion=c.Observable.merge(this.navigationService.up,this.navigationService.down).subscribe(function(t){return e.navigate(t.index)}),this.closeSubscription=this.navigationService.close.subscribe(function(){return e.popupOpen=!1}),this.enterSubscription=this.navigationService.enter.subscribe(this.handleEnter.bind(this)),this.escSubscription=this.navigationService.esc.subscribe(this.handleBlur.bind(this)))},e.prototype.unsubscribeEvents=function(){h.isDocumentAvailable()&&(this.changeSubscribtion.unsubscribe(),this.navigationSubscribtion.unsubscribe(),this.closeSubscription.unsubscribe(),this.enterSubscription.unsubscribe(),this.escSubscription.unsubscribe())},e.prototype.handleItemChange=function(e){var t=e.indices.length?e.indices[0]:void 0;if(this.selectionService.resetSelection([-1]),h.isPresent(t)){var i=h.getter(this.data[t],this.valueField);this.change(i)}},e.prototype.handleItemFocus=function(e){var t=this.selectionService.focused;Boolean(this.suggest&&this.data&&this.data.length&&t>=0)&&(this.suggestedText=h.getter(this.data[t],this.valueField))},e.prototype._toggle=function(e){var t=this;if(this._open=e,this.popupRef&&(this.popupRef.popupElement.removeEventListener("mousedown",this.popupMouseDownHandler),this.popupRef.close(),this.popupRef=null),this._open){this.popupRef=this.popupService.open({anchor:this.wrapper,animate:this.popupSettings.animate,appendTo:this.appendTo,content:this.popupTemplate,popupClass:this.listContainerClasses,positionMode:"absolute"});var i=this.popupRef.popupElement,n=this.width,o=n.min,a=n.max;i.addEventListener("mousedown",this.popupMouseDownHandler),i.style.minWidth=o,i.style.width=a,i.setAttribute("dir",this.direction),this.popupRef.popupAnchorViewportLeave.subscribe(function(){return t.popupOpen=!1})}},e}();n.__decorate([o.Input(),n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[Object])],b.prototype,"data",null),n.__decorate([o.Input(),n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[Object])],b.prototype,"value",null),n.__decorate([o.Input(),n.__metadata("design:type",String)],b.prototype,"valueField",void 0),n.__decorate([o.Input(),n.__metadata("design:type",String)],b.prototype,"placeholder",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[Object])],b.prototype,"popupSettings",null),n.__decorate([o.Input(),n.__metadata("design:type",Boolean)],b.prototype,"loading",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Boolean)],b.prototype,"clearButton",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Boolean)],b.prototype,"suggest",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Boolean)],b.prototype,"disabled",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Number)],b.prototype,"tabIndex",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Boolean)],b.prototype,"filterable",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],b.prototype,"valueChange",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],b.prototype,"filterChange",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],b.prototype,"open",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],b.prototype,"close",void 0),n.__decorate([o.Output("focus"),n.__metadata("design:type",o.EventEmitter)],b.prototype,"onFocus",void 0),n.__decorate([o.Output("blur"),n.__metadata("design:type",o.EventEmitter)],b.prototype,"onBlur",void 0),n.__decorate([o.ContentChild(r.ItemTemplateDirective),n.__metadata("design:type",r.ItemTemplateDirective)],b.prototype,"template",void 0),n.__decorate([o.ContentChild(p.HeaderTemplateDirective),n.__metadata("design:type",p.HeaderTemplateDirective)],b.prototype,"headerTemplate",void 0),n.__decorate([o.ContentChild(l.FooterTemplateDirective),n.__metadata("design:type",l.FooterTemplateDirective)],b.prototype,"footerTemplate",void 0),n.__decorate([o.ContentChild(v.NoDataTemplateDirective),n.__metadata("design:type",v.NoDataTemplateDirective)],b.prototype,"noDataTemplate",void 0),n.__decorate([o.ViewChild("container",{read:o.ViewContainerRef}),n.__metadata("design:type",o.ViewContainerRef)],b.prototype,"container",void 0),n.__decorate([o.ViewChild("popupTemplate"),n.__metadata("design:type",o.TemplateRef)],b.prototype,"popupTemplate",void 0),n.__decorate([o.ViewChild(s.SearchBarComponent),n.__metadata("design:type",s.SearchBarComponent)],b.prototype,"searchbar",void 0),n.__decorate([o.HostBinding("class.k-widget"),o.HostBinding("class.k-autocomplete"),o.HostBinding("class.k-header"),n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[])],b.prototype,"widgetClasses",null),n.__decorate([o.HostBinding("class.k-state-focused"),n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[Boolean])],b.prototype,"isFocused",null),n.__decorate([o.HostBinding("class.k-state-disabled"),n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[])],b.prototype,"isDisabled",null),n.__decorate([o.HostBinding("style.max-height"),n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],b.prototype,"widgetHeight",null),n.__decorate([o.HostBinding("attr.dir"),n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],b.prototype,"dir",null),b=n.__decorate([o.Component({exportAs:"kendoAutoComplete",providers:[t.AUTOCOMPLETE_VALUE_ACCESSOR,u.SelectionService,d.NavigationService],selector:"kendo-autocomplete",template:'\n <kendo-searchbar #searchbar\n [role]="\'textbox\'"\n [id]="listBoxId"\n [activeDescendant]="activeDescendant"\n [userInput]="value"\n [suggestedText]="suggestion"\n [disabled]="disabled"\n [tabIndex]="tabIndex"\n [popupOpen]="popupOpen"\n [placeholder]="placeholder"\n (onNavigate)="handleNavigate($event)"\n (valueChange)="searchBarChange($event)"\n (onBlur)="handleBlur()"\n (onFocus)="handleFocus()"\n ></kendo-searchbar>\n <span *ngIf="!loading && (clearButton && value?.length)" class="k-icon k-clear-value k-i-close" title="clear" role="button" tabindex="-1" (click)="clearValue($event)" (mousedown)="$event.preventDefault()">\n</span>\n <span *ngIf="loading" class="k-icon k-i-loading"></span>\n <ng-template #popupTemplate>\n \x3c!--header template--\x3e\n <ng-template *ngIf="headerTemplate"\n [templateContext]="{\n templateRef: headerTemplate.templateRef\n }">\n </ng-template>\n \x3c!--list--\x3e\n <kendo-list\n [id]="listBoxId"\n [optionPrefix]="optionPrefix"\n [data]="data"\n [textField]="valueField"\n [valueField]="valueField"\n [template]="template"\n [height]="height"\n [show]="popupOpen"\n >\n </kendo-list>\n \x3c!--no-data template--\x3e\n <div class="k-nodata" *ngIf="data.length === 0">\n <ng-template [ngIf]="noDataTemplate"\n [templateContext]="{\n templateRef: noDataTemplate?.templateRef\n }">\n </ng-template>\n <ng-template [ngIf]="!noDataTemplate">\n <div>NO DATA FOUND.</div>\n </ng-template>\n </div>\n \x3c!--footer template--\x3e\n <ng-template *ngIf="footerTemplate"\n [templateContext]="{\n templateRef: footerTemplate.templateRef\n }">\n </ng-template>\n </ng-template>\n <ng-template [ngIf]="popupOpen">\n <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>\n </ng-template>\n <ng-container #container></ng-container>\n '}),n.__param(0,o.Optional()),n.__param(0,o.Inject(_.RTL)),n.__metadata("design:paramtypes",[Boolean,y.PopupService,u.SelectionService,d.NavigationService,o.ChangeDetectorRef,o.ElementRef])],b),t.AutoCompleteComponent=b},function(e,t){e.exports=a},function(e,t){e.exports=s},function(e,t){e.exports=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=i(6),s=i(7),r=i(8),p=function(){function e(e,t){this.valueChange=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.onClick=new o.EventEmitter,this.onNavigate=new o.EventEmitter,this._userInput="",this._composing=!1,this.direction=e?"rtl":"ltr",this.renderer=t}return Object.defineProperty(e.prototype,"userInput",{get:function(){return this._userInput},set:function(e){this._userInput=e||""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchBarClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.input.nativeElement.value},enumerable:!0,configurable:!0}),e.prototype.compositionStart=function(){this._composing=!0},e.prototype.compositionUpdate=function(){this._composing=!0},e.prototype.compositionEnd=function(){this._composing=!1,this.valueChange.emit(this.value)},e.prototype.ngOnChanges=function(e){if(this.input&&(e.userInput||e.suggestedText)){var t=e.userInput&&e.userInput.previousValue?e.userInput.previousValue:"",i=this.input.nativeElement.selectionStart,n=t.length+1===i;this.writeInputValue(this.suggestedText?s.combineStr(this.userInput,this.suggestedText):this.userInput),this.suggestedText?this.setInputSelection(this.userInput.length,this.suggestedText.length):n?this.setInputSelection(this.userInput.length,this.userInput.length):this.setInputSelection(i,i)}},e.prototype.writeInputValue=function(e){s.isDocumentAvailable()&&this.renderer.setProperty(this.input.nativeElement,"value",e)},e.prototype.setInputSelection=function(e,t){if(s.isDocumentAvailable()&&this.input.nativeElement===document.activeElement)try{this.input.nativeElement.setSelectionRange(e,t)}catch(e){}},e.prototype.handleInput=function(e){var t=e.target.value;t===this.userInput||this._composing||this.valueChange.emit(t)},e.prototype.handleFocus=function(e){this.onFocus.emit(e)},e.prototype.handleBlur=function(e){this.onBlur.emit(e)},e.prototype.handleKeydown=function(e){var t=e.keyCode;[a.Keys.up,a.Keys.down,a.Keys.left,a.Keys.right,a.Keys.enter,a.Keys.esc,a.Keys.delete,a.Keys.backspace,a.Keys.home,a.Keys.end].indexOf(t)>-1&&this.onNavigate.emit(e)},e.prototype.focus=function(){s.isDocumentAvailable()&&this.input.nativeElement.focus()},e.prototype.blur=function(){s.isDocumentAvailable()&&this.input.nativeElement.blur()},e.prototype.resizeInput=function(e){var t=this.input.nativeElement;this.renderer.setAttribute(t,"size",e.toString())},e}();n.__decorate([o.Input(),n.__metadata("design:type",String)],p.prototype,"activeDescendant",void 0),n.__decorate([o.Input(),n.__metadata("design:type",String)],p.prototype,"id",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Boolean)],p.prototype,"disabled",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Number)],p.prototype,"tabIndex",void 0),n.__decorate([o.Input(),n.__metadata("design:type",Boolean)],p.prototype,"popupOpen",void 0),n.__decorate([o.Input(),n.__metadata("design:type",String)],p.prototype,"placeholder",void 0),n.__decorate([o.Input(),n.__metadata("design:type",String)],p.prototype,"role",void 0),n.__decorate([o.Input(),n.__metadata("design:type",String),n.__metadata("design:paramtypes",[String])],p.prototype,"userInput",null),n.__decorate([o.Input(),n.__metadata("design:type",String)],p.prototype,"suggestedText",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],p.prototype,"valueChange",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],p.prototype,"onBlur",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],p.prototype,"onFocus",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],p.prototype,"onClick",void 0),n.__decorate([o.Output(),n.__metadata("design:type",o.EventEmitter)],p.prototype,"onNavigate",void 0),n.__decorate([o.ViewChild("input"),n.__metadata("design:type",o.ElementRef)],p.prototype,"input",void 0),n.__decorate([o.HostBinding("class.k-searchbar"),n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[])],p.prototype,"searchBarClass",null),n.__decorate([o.HostListener("compositionstart"),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"compositionStart",null),n.__decorate([o.HostListener("compositionupdate"),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"compositionUpdate",null),n.__decorate([o.HostListener("compositionend"),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"compositionEnd",null),p=n.__decorate([o.Component({selector:"kendo-searchbar",template:'\n <input #input\n autocomplete="off"\n [disabled]="disabled"\n [placeholder]="placeholder"\n [class]="\'k-input\'"\n (input)="handleInput($event)"\n (focus)="handleFocus($event)"\n (blur)="handleBlur($event)"\n (keydown)="handleKeydown($event)"\n [attr.tabIndex]="tabIndex"\n [attr.dir]="direction"\n [attr.role]="role"\n [attr.aria-disabled]="disabled"\n [attr.aria-haspopup]="true"\n [attr.aria-expanded]="popupOpen"\n [attr.aria-owns]="id"\n [attr.aria-activedescendant]="activeDescendant"\n />\n '}),n.__param(0,o.Optional()),n.__param(0,o.Inject(r.RTL)),n.__metadata("design:paramtypes",[Boolean,o.Renderer2])],p),t.SearchBarComponent=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.backspace=8]="backspace",e[e.tab=9]="tab",e[e.enter=13]="enter",e[e.shift=16]="shift",e[e.ctrl=17]="ctrl",e[e.alt=18]="alt",e[e["pause/break"]=19]="pause/break",e[e["caps lock"]=20]="caps lock",e[e.esc=27]="esc",e[e.space=32]="space",e[e["page up"]=33]="page up",e[e["page down"]=34]="page down",e[e.end=35]="end",e[e.home=36]="home",e[e.left=37]="left",e[e.up=38]="up",e[e.right=39]="right",e[e.down=40]="down",e[e.insert=45]="insert",e[e.delete=46]="delete",e[e.command=91]="command",e[e["left command"]=91]="left command",e[e["right command"]=93]="right command",e[e["numpad *"]=106]="numpad *",e[e["numpad +"]=107]="numpad +",e[e["numpad -"]=109]="numpad -",e[e["numpad ."]=110]="numpad .",e[e["numpad /"]=111]="numpad /",e[e["num lock"]=144]="num lock",e[e["scroll lock"]=145]="scroll lock",e[e["my computer"]=182]="my computer",e[e["my calculator"]=183]="my calculator",e[e[";"]=186]=";",e[e["="]=187]="=",e[e[","]=188]=",",e[e["-"]=189]="-",e[e["."]=190]=".",e[e["/"]=191]="/",e[e["`"]=192]="`",e[e["["]=219]="[",e[e["\\"]=220]="\\",e[e["]"]=221]="]",e[e["'"]=222]="'"}(t.Keys||(t.Keys={}))},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPresent=function(e){return null!==e&&void 0!==e},t.isNumber=function(e){return!isNaN(e)},t.isChanged=function(e,t){return t[e]&&!t[e].isFirstChange()&&t[e].previousValue!==t[e].currentValue},t.guid=function(){var e,t,i="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(i+="-"),i+=(12===e?4:16===e?3&t|8:t).toString(16);return i},t.combineStr=function(e,t){return e.concat(t.substr(t.toLowerCase().indexOf(e.toLowerCase())+e.length))},t.isDocumentAvailable=function(){return"undefined"!=typeof document},t.isArray=function(e){return Array.isArray(e)},t.isObject=function(e){return"object"==typeof e},t.resolveValuesInArray=function(e,t,i){return void 0===t&&(t=[]),t.filter(function(t){return e.some(function(e){return e===t[i]})})},t.validateComplexValues=function(e,i){return t.isArray(e)&&e.filter(function(e){return t.isObject(e)&&e[i]})},t.resolveAllValues=function(e,i,n){var o=t.validateComplexValues(e,n)||[];return(t.resolveValuesInArray(e,i,n)||[]).concat(o)},t.isObjectArray=function(e){return t.isArray(e)&&e.some(function(e){return t.isObject(e)})},t.selectedIndices=function(e,i,n){var o=i.map(function(e){return t.isPresent(e[n])?e[n]:e});return e.reduce(function(e,i){var a=t.isPresent(i[n])?i[n]:i,s=o.indexOf(a);return-1!==s&&e.push(s),e},[])},t.getter=function(e,i,n){if(void 0===n&&(n=!1),t.isPresent(e))return n?i&&t.isPresent(e[i])?e[i]:e:i?e[i]:e},t.resolveValue=function(e){var i;return t.isPresent(e.value)?(i=e.data.find(function(i){return t.getter(i,e.valueField)===e.value}),{dataItem:i,focused:e.data.indexOf(i),selected:e.data.indexOf(i)}):e.index?(i=e.data[e.index],{dataItem:e.data[e.index],focused:e.index,selected:e.index}):{dataItem:e.defaultItem,focused:-1,selected:-1}},t.sameCharsOnly=function(e,t){for(var i=0;i<e.length;i++)if(e.charAt(i)!==t)return!1;return!0},t.shuffleData=function(e,t,i){var n=e;return i&&(n=[i].concat(n)),n.slice(t).concat(n.slice(0,t))},t.matchText=function(e,i,n){if(!t.isPresent(e))return!1;var o=String(e);return n&&(o=o.toLowerCase()),0===o.indexOf(i)}},function(e,t){e.exports=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=function(){return function(e){this.templateRef=e}}();a=n.__decorate([o.Directive({selector:"[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]"}),n.__metadata("design:paramtypes",[o.TemplateRef])],a),t.ItemTemplateDirective=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=function(){return function(e){this.templateRef=e}}();a=n.__decorate([o.Directive({selector:"[kendoDropDownListHeaderTemplate],[kendoComboBoxHeaderTemplate],[kendoAutoCompleteHeaderTemplate],[kendoMultiSelectHeaderTemplate]"}),n.__metadata("design:paramtypes",[o.TemplateRef])],a),t.HeaderTemplateDirective=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=function(){return function(e){this.templateRef=e}}();a=n.__decorate([o.Directive({selector:"[kendoDropDownListFooterTemplate],[kendoComboBoxFooterTemplate],[kendoAutoCompleteFooterTemplate],[kendoMultiSelectFooterTemplate]"}),n.__metadata("design:paramtypes",[o.TemplateRef])],a),t.FooterTemplateDirective=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=i(7),s=function(){function e(){this.onSelect=new o.EventEmitter,this.onChange=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.selectedIndices=[]}return e.prototype.isSelected=function(e){return a.isPresent(this.selectedIndices.find(function(t){return t===e}))},e.prototype.isFocused=function(e){return e===this.focused},e.prototype.focus=function(e){this.isFocused(e)||(this.focused=e,this.onFocus.emit(e))},e.prototype.select=function(e){this.isSelected(e)||(this.selectedIndices=[e],this.focused=e,this.onSelect.emit({indices:this.selectedIndices.slice()}))},e.prototype.add=function(e){this.isSelected(e)||(this.selectedIndices.push(e),this.focused=e,this.onChange.emit({added:e,indices:this.selectedIndices.slice()}))},e.prototype.unselect=function(e){if(this.isSelected(e)){var t=this.selectedIndices.indexOf(e);this.selectedIndices.splice(t,1),this.focused=e,this.onChange.emit({indices:this.selectedIndices.slice(),removed:e})}},e.prototype.change=function(e){this.selectedIndices=[e],this.focused=e,this.onChange.emit({indices:this.selectedIndices.slice()})},e.prototype.resetSelection=function(e){this.selectedIndices=e instanceof Array?e:[e],this.focused=this.selectedIndices[this.selectedIndices.length-1]},Object.defineProperty(e.prototype,"selected",{get:function(){return this.selectedIndices.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focused",{get:function(){return this.focusedIndex},set:function(e){this.focusedIndex!==e&&(this.focusedIndex=e,this.onFocus.emit(e))},enumerable:!0,configurable:!0}),e}();s=n.__decorate([o.Injectable()],s),t.SelectionService=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=i(7),s=i(6),r=i(14),p=function(){return function(e,t){this.index=e,this.originalEvent=t}}();t.NavigationEvent=p;var l=function(){function e(){this.open=new o.EventEmitter,this.close=new o.EventEmitter,this.enter=new o.EventEmitter,this.tab=new o.EventEmitter,this.esc=new o.EventEmitter,this.up=new o.EventEmitter,this.right=new o.EventEmitter,this.down=new o.EventEmitter,this.left=new o.EventEmitter,this.delete=new o.EventEmitter,this.backspace=new o.EventEmitter,this.home=new o.EventEmitter,this.end=new o.EventEmitter}return e.prototype.process=function(e){var t,i=e.originalEvent.keyCode,n=e.originalEvent.altKey,o=r.NavigationAction.Undefined;n&&i===s.Keys.down?o=r.NavigationAction.Open:n&&i===s.Keys.up?o=r.NavigationAction.Close:i===s.Keys.enter?o=r.NavigationAction.Enter:i===s.Keys.esc?o=r.NavigationAction.Esc:i===s.Keys.tab?o=r.NavigationAction.Tab:i===s.Keys.up?(t=this.next({current:e.current,start:e.max,end:e.min,step:-1}),o=r.NavigationAction.Up):i===s.Keys.left?(t=this.next({current:e.current,start:e.max,end:e.min,step:-1}),o=r.NavigationAction.Left):i===s.Keys.down?(t=this.next({current:e.current,start:e.min,end:e.max,step:1}),o=r.NavigationAction.Down):i===s.Keys.right?(t=this.next({current:e.current,start:e.min,end:e.max,step:1}),o=r.NavigationAction.Right):i===s.Keys.home?(t=0,o=r.NavigationAction.Home):i===s.Keys.end?(t=e.max,o=r.NavigationAction.End):i===s.Keys.delete?o=r.NavigationAction.Delete:i===s.Keys.backspace&&(o=r.NavigationAction.Backspace);var a=new p(t,e.originalEvent);return o!==r.NavigationAction.Undefined&&this[r.NavigationAction[o].toLowerCase()].emit(a),o},e.prototype.next=function(e){return a.isPresent(e.current)?e.current!==e.end?e.current+e.step:e.end:e.start},e}();l=n.__decorate([o.Injectable()],l),t.NavigationService=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.Undefined=0]="Undefined",e[e.Open=1]="Open",e[e.Close=2]="Close",e[e.Enter=3]="Enter",e[e.Tab=4]="Tab",e[e.Esc=5]="Esc",e[e.Delete=6]="Delete",e[e.Backspace=7]="Backspace",e[e.Home=8]="Home",e[e.End=9]="End",e[e.Up=10]="Up",e[e.Down=11]="Down",e[e.Left=12]="Left",e[e.Right=13]="Right"}(t.NavigationAction||(t.NavigationAction={}))},function(e,t){e.exports=p},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=function(){return function(e){this.templateRef=e}}();a=n.__decorate([o.Directive({selector:"[kendoDropDownListNoDataTemplate],[kendoComboBoxNoDataTemplate],[kendoAutoCompleteNoDataTemplate],[kendoMultiSelectNoDataTemplate]"}),n.__metadata("design:paramtypes",[o.TemplateRef])],a),t.NoDataTemplateDirective=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.prevented=!1}return e.prototype.preventDefault=function(){this.prevented=!0},e.prototype.isDefaultPrevented=function(){return this.prevented},e}();t.PreventableEvent=i},function(e,t){e.exports=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),o=i(3),a=i(4),s=i(5),r=i(9),p=i(10),l=i(11),u=i(16),d=i(12),c=i(13),h=i(15);i(20),i(21),i(22),i(23),i(24),i(25),i(26),i(27),i(28);var m,v=i(29),g=i(30),f=i(7),_=i(14),y=i(6),b=i(17),S=i(8),C=i(18);!function(e){e[e.None=0]="None",e[e.SetInitial=1]="SetInitial",e[e.UseInitial=2]="UseInitial",e[e.UseExisting=4]="UseExisting",e[e.UseCustom=8]="UseCustom",e[e.UseFilter=16]="UseFilter",e[e.UseNone=32]="UseNone",e[e.UseEmpty=64]="UseEmpty"}(m||(m={})),t.COMBOBOX_VALUE_ACCESSOR={multi:!0,provide:a.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return x})};var x=function(){function e(e,t,i,n,a,s){this.popupService=t,this.selectionService=i,this.navigationService=n,this.cdr=a,this.selected=[],this.allowCustom=!1,this.valueNormalizer=function(e){return e.map(function(e){return e})},this.placeholder="",this.suggest=!1,this.clearButton=!0,this.disabled=!1,this.tabIndex=0,this.filterable=!1,this.valueChange=new o.EventEmitter,this.selectionChange=new o.EventEmitter,this.filterChange=new o.EventEmitter,this.open=new o.EventEmitter,this.close=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.isFocused=!1,this.listBoxId=f.guid(),this.optionPrefix=f.guid(),this.onChangeCallback=function(e){},this.onTouchedCallback=function(e){},this.observableSubscriptions=new g.Subscription,this._state=m.SetInitial,this._filtering=!1,this._text="",this._open=!1,this._previousValue=void 0,this.suggestedText=void 0,this._popupSettings={height:200,animate:!0},this.popupMouseDownHandler=function(e){return e.preventDefault()},this.customValueSubject=new v.Subject,this.valueSubject=new v.Subject,this.selectionSubject=new v.Subject,this.direction=e?"rtl":"ltr",this.wrapper=s.nativeElement,this.data=[],this.subscribeEvents()}return Object.defineProperty(e.prototype,"width",{get:function(){var e=0;f.isDocumentAvailable()&&(e=this.wrapper.offsetWidth);var t=this.popupSettings.width||e;return{min:isNaN(e)?e:e+"px",max:isNaN(t)?t:t+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.popupSettings.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(e){var t=f.getter(e,this.textField,!0);this._text=f.isPresent(t)?t.toString():""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupOpen",{get:function(){return this._open},set:function(e){if(!this.disabled&&this.popupOpen!==e){var t=new b.PreventableEvent;e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()||this._toggle(e)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeDescendant",{get:function(){return this.optionPrefix+"-"+f.getter(this.value,this.valueField)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this.verifySettings(e),this._value=e,this.cdr.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({height:200,animate:!0},e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetClasses",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.wrapperClasses=function(){return{"k-dropdown-wrap":!0,"k-state-default":!this.disabled,"k-state-disabled":this.disabled,"k-state-focused":this.isFocused}},Object.defineProperty(e.prototype,"clearable",{get:function(){return this.clearButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetHeight",{get:function(){return this.popupSettings.height+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.createSelectionStream(),this.createValueStream()},e.prototype.createSelectionStream=function(){var e=this;this.selectionSubscription&&this.selectionSubscription.unsubscribe(),this.selectionSubscription=this.selectionSubject.map(function(t){return{dataItem:e.data[t],value:f.getter(e.data[t],e.valueField)}}).distinctUntilChanged(function(e,t){return e.value===t.value}).subscribe(function(t){e.selectionChange.emit(t.dataItem)})},e.prototype.createValueStream=function(){var e=this,t=this.valueSubject.filter(function(t){var i=e.valuePrimitive?e.value:f.getter(e.value,e.valueField),n=f.getter(t,e.valueField),o=f.getter(t,e.textField);return f.isPresent(o)&&(o=o.toString()),i!==n||e.text!==o}).map(function(t){var i=f.getter(t,e.valueField);return{dataItem:t,text:f.getter(t,e.textField),value:e.valuePrimitive?i:t}}),i=this.customValueSubject.throttleTime(300).partition(function(){return e.allowCustom}),n=i[0].do(function(){e.loading=!0,e.disabled=!0}).filter(function(){var t=e.text!==f.getter(e.value,e.textField);return e.loading=t,e.disabled=t,t}).let(this.valueNormalizer).map(function(t){return{dataItem:void 0,text:e.text,value:t}}),o=i[1].map(function(){return{dataItem:void 0,text:void 0,value:void 0}});this.valueSubscription&&this.valueSubscription.unsubscribe();var a=t.merge(n,o);this.valueSubscription=a.catch(function(){return e.dataItem=void 0,e.value=void 0,e.text=void 0,e.loading=!1,e.disabled=!1,e.emitChange(),a}).subscribe(function(t){e.dataItem=t.dataItem,e.value=t.value,e.text=t.text,e.loading=!1,e.disabled=!1,!e.filterable||f.isPresent(t.value)||f.isPresent(t.text)||f.isPresent(e._previousValue)||e.filterChange.emit(""),e.emitChange()})},e.prototype.subscribeEvents=function(){var e=this;f.isDocumentAvailable()&&[this.selectionService.onChange.filter(function(e){return f.isPresent(e.indices[0])}).map(function(e){return e.indices[0]}).subscribe(this.handleItemChange.bind(this)),this.selectionService.onSelect.filter(function(e){return f.isPresent(e.indices[0])}).map(function(e){return e.indices[0]}).subscribe(this.handleItemSelect.bind(this)),h.Observable.merge(this.navigationService.up,this.navigationService.down,this.navigationService.home,this.navigationService.end).subscribe(function(t){return e.navigate(t.index)}),this.navigationService.open.subscribe(function(){return e.popupOpen=!0}),this.navigationService.close.subscribe(function(){return e.popupOpen=!1}),this.navigationService.enter.subscribe(this.handleEnter.bind(this)),this.navigationService.esc.subscribe(this.handleBlur.bind(this))].forEach(function(t){return e.observableSubscriptions.add(t)})},e.prototype.unsubscribeEvents=function(){f.isDocumentAvailable()&&(this.observableSubscriptions.unsubscribe(),this.valueSubscription&&this.valueSubscription.unsubscribe(),this.selectionSubscription&&this.selectionSubscription.unsubscribe())},e.prototype.handleItemChange=function(e){this._filtering=!1,this.change(this.data[e])},e.prototype.handleItemSelect=function(e){this._filtering=!1,this.popupOpen?this.selectionSubject.next(e):this.change(this.data[e])},e.prototype.ngOnDestroy=function(){this._toggle(!1),this.unsubscribeEvents()},e.prototype.ngOnChanges=function(e){Boolean(e.value&&e.value.firstChange||f.isChanged("value",e)&&this._state&m.SetInitial)&&(this._state|=m.UseInitial),f.isChanged("valueNormalizer",e)&&(this.createSelectionStream(),this.createValueStream()),void 0===this.valuePrimitive&&(this.valuePrimitive=!this.valueField),/(data|value|textField|valueField|valuePrimitive)/g.test(Object.keys(e).join())&&this.setState(this.value),f.isChanged("data",e)&&this._filtering&&(this.text.length>0?(this.search(this.text),-1===this.selectionService.focused&&(this.selectionService.focused=0)):this.selectionService.focused=-1),this.suggest&&this.data&&this.data.length&&this.text&&(this.suggestedText=f.getter(this.data[0],this.textField))},e.prototype.focus=function(){this.disabled||this.searchbar.focus()},e.prototype.blur=function(){this.disabled||this.searchbar.blur()},e.prototype.toggle=function(e){var t=this;Promise.resolve(null).then(function(){t._toggle(void 0===e?!t._open:e),t.cdr.markForCheck()})},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.popupOpen},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.setState(void 0)},e.prototype.clearValue=function(e){e.stopImmediatePropagation(),this._filtering=!0,this._previousValue=void 0,this.change(void 0),this.selectionService.resetSelection([])},e.prototype.writeValue=function(e){Boolean(null!==e&&this._state&m.SetInitial)&&(this._state|=m.UseInitial),this.text="",this.setState(e)},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.popupOpened=function(){this.popupWidth=this.width.max,this.popupMinWidth=this.width.min},Object.defineProperty(e.prototype,"buttonClasses",{get:function(){return e={},e[this.iconClass]=!this.loading&&this.iconClass,e["k-i-arrow-s"]=!this.loading&&!this.iconClass,e["k-i-loading"]=this.loading,e["k-icon"]=!0,e;var e},enumerable:!0,configurable:!0}),e.prototype.onResize=function(){if(this._open){var e=this.popupRef.popupElement,t=this.width,i=t.min,n=t.max;e.style.minWidth=i,e.style.width=n}},e.prototype.verifySettings=function(e){var t=!f.isPresent(this.valueField)!=!f.isPresent(this.textField);if(o.isDevMode()){if(!0===this.valuePrimitive&&f.isPresent(e)&&"object"==typeof e)throw new Error("Expected initial value of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection");if(!1===this.valuePrimitive&&f.isPresent(e)&&"object"!=typeof e)throw new Error("Expected initial value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection");if(t)throw new Error("Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-bind-to-arrays-of-complex-data")}},e.prototype.resolveState=function(e){var t,i,n=f.getter(e,this.valueField,!0);return(i=this._filtering?m.UseFilter:this.data.length?m.UseExisting:this.allowCustom?m.UseCustom:m.UseNone)===m.UseExisting&&(i=void 0!==(t=f.resolveValue({data:this.data,value:n,valueField:this.valueField})).dataItem?m.UseExisting:this.allowCustom?m.UseCustom:m.UseEmpty),i|=this._state&m.SetInitial|this._state&m.UseInitial,this._state=i,t},e.prototype.setState=function(e){var t=this.resolveState(e),i={value:void 0,text:void 0,dataItem:void 0,selected:[-1]};this._state&m.UseFilter||(this._state&m.UseNone?i.value=e:this._state&m.UseEmpty?(i.selected=void 0,i.value=void 0,i.text=void 0,i.dataItem=void 0):this._state&m.UseExisting?(i.value=e,i.text=t.dataItem,i.dataItem=t.dataItem,i.selected=t.selected):this._state&m.UseCustom&&(i.value=e,i.text=e,i.dataItem=e),this._state&m.UseInitial?(this._state&=~m.UseInitial|~m.SetInitial,this._previousValue=i.dataItem):this._previousValue=this.dataItem,this.text=i.text,this.value=this.valuePrimitive?f.getter(i.value,this.valueField,!0):i.value,this.dataItem=i.dataItem,this.selectionService.resetSelection(i.selected))},e.prototype.search=function(e){var t=this,i=this.data.findIndex(function(i){var n=f.getter(i,t.textField);return(n=void 0===n?"":n.toString().toLowerCase()).startsWith(e.toLowerCase())});this.selectionService.focused=i,this.suggestedText=f.getter(this.data[i],this.textField)},e.prototype.getSuggestion=function(){var e=!!this.selectionService.selected.length,t=this.suggest&&!this.backspacePressed&&this.suggestedText&&this.text;if(!e&&t&&this.suggestedText.toLowerCase().startsWith(this.text.toLowerCase()))return this.suggestedText;this.suggestedText=void 0},e.prototype.navigate=function(e){0!==this.data.length&&(this.text=this.data[e],this.selectionService.select(e))},e.prototype.handleNavigate=function(e){var t=f.isPresent(this.selectionService.selected[0]),i=isNaN(this.selectionService.focused)?0:this.selectionService.focused,n=0;if(!this.disabled&&e.keyCode!==y.Keys.home&&e.keyCode!==y.Keys.end){t||(e.keyCode===y.Keys.down?n=-1:e.keyCode===y.Keys.up&&(n=1));var o=n+i;o<-1&&(o=-1);var a=this.navigationService.process({current:o,max:this.data.length-1,min:0,originalEvent:e});a!==_.NavigationAction.Undefined&&a!==_.NavigationAction.Left&&a!==_.NavigationAction.Right&&a!==_.NavigationAction.Backspace&&a!==_.NavigationAction.Delete&&(a===_.NavigationAction.Enter&&this.popupOpen||a!==_.NavigationAction.Enter)&&e.preventDefault()}},e.prototype.handleEnter=function(e){var t=this.selectionService.focused,i=f.getter(this._previousValue,this.textField)||"",n=this.text!==i,o=!1;if(this._filtering=!1,o=this.allowCustom?this.text!==f.getter(this.data[t],this.textField):-1===t||void 0===t,this.popupOpen&&e.originalEvent.preventDefault(),!o&&this.popupOpen)return this.selectionService.select(t),void this.change(this.data[t]||this.text,o);n?this.change(this.text,o):this.popupOpen=!1},e.prototype.handleBlur=function(){this._filtering=!1;var e=this.searchbar.value;if(!e&&!f.isPresent(this._previousValue))return this.popupOpen=!1,this.isFocused=!1,this.onBlur.emit(),void this.onTouchedCallback();var t,i=this.selectionService.focused;-1!==i&&void 0!==i&&(t=void 0===(t=f.getter(this.data[i],this.textField))?"":t.toString().toLowerCase()),t===e.toLowerCase()?this.selectionService.change(i):this.change(e,!0),this.popupOpen=!1,this.isFocused=!1,this.onBlur.emit(),this.onTouchedCallback()},e.prototype.searchBarChange=function(e){var t=this.text?this.text.length:0;this.backspacePressed=e.length<t,this.text=e,this.selectionService.resetSelection([]),this.popupOpen=!0,this.filterable?(this._filtering=!0,this.filterChange.emit(e)):this.search(e)},e.prototype.handleFocus=function(){this.isFocused=!0,this.onFocus.emit()},e.prototype.change=function(e,t){void 0===t&&(t=!1),this.popupOpen=!1,t?this.customValueSubject.next(e):this.valueSubject.next(e)},e.prototype.emitChange=function(){var e=this;this._previousValue=this.dataItem,this.selectionSubject.next(this.data.findIndex(function(t){return f.getter(t,e.valueField)===f.getter(e.value,e.valueField)})),this.onChangeCallback(this.value),this.valueChange.emit(this.value)},e.prototype.iconClick=function(){this.searchbar.focus(),this.popupOpen=!this.popupOpen},Object.defineProperty(e.prototype,"listContainerClasses",{get:function(){var e=["k-list-container","k-reset"];return this.popupSettings.popupClass&&e.push(this.popupSettings.popupClass),e},enumerable:!0,configurable:!0}),e.prototype._toggle=function(e){var t=this;if(this._open=e,this.popupRef&&(this.popupRef.popupElement.removeEventListener("mousedown",this.popupMouseDownHandler),this.popupRef.close(),this.popupRef=null),this._open){this.popupRef=this.popupService.open({anchor:this.wrapper,animate:this.popupSettings.animate,appendTo:this.appendTo,content:this.popupTemplate,popupClass:this.listContainerClasses,positionMode:"absolute"});var i=this.popupRef.popupElement,n=this.width,o=n.min,a=n.max;i.addEventListener("mousedown",this.popupMouseDownHandler),i.style.minWidth=o,i.style.width=a,i.setAttribute("dir