UNPKG

29 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/scrolling"),require("@angular/core"),require("@angular/animations"),require("@angular/common"),require("primeng/api"),require("primeng/dom"),require("primeng/utils"),require("@angular/forms"),require("primeng/tooltip")):"function"==typeof define&&define.amd?define("primeng/dropdown",["exports","@angular/cdk/scrolling","@angular/core","@angular/animations","@angular/common","primeng/api","primeng/dom","primeng/utils","@angular/forms","primeng/tooltip"],e):e(((t=t||self).primeng=t.primeng||{},t.primeng.dropdown={}),t.ng.cdk.scrolling,t.ng.core,t.ng.animations,t.ng.common,t.primeng.api,t.primeng.dom,t.primeng.utils,t.ng.forms,t.primeng.tooltip)}(this,(function(t,e,i,o,n,l,s,r,a,p){"use strict";var d=this&&this.__decorate||function(t,e,i,o){var n,l=arguments.length,s=l<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(s=(l<3?n(s):l>3?n(e,i,s):n(e,i))||s);return l>3&&s&&Object.defineProperty(e,i,s),s},h=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],o=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u={provide:a.NG_VALUE_ACCESSOR,useExisting:i.forwardRef((function(){return f})),multi:!0},c=function(){function t(){this.onClick=new i.EventEmitter}return t.prototype.onOptionClick=function(t){this.onClick.emit({originalEvent:t,option:this.option})},d([i.Input()],t.prototype,"option",void 0),d([i.Input()],t.prototype,"selected",void 0),d([i.Input()],t.prototype,"disabled",void 0),d([i.Input()],t.prototype,"visible",void 0),d([i.Input()],t.prototype,"itemSize",void 0),d([i.Input()],t.prototype,"template",void 0),d([i.Output()],t.prototype,"onClick",void 0),t=d([i.Component({selector:"p-dropdownItem",template:'\n <li (click)="onOptionClick($event)" role="option"\n [attr.aria-label]="option.label" [attr.aria-selected]="selected"\n [ngStyle]="{\'height\': itemSize + \'px\'}"\n [ngClass]="{\'ui-dropdown-item ui-corner-all\':true,\n \'ui-state-highlight\': selected,\n \'ui-state-disabled\':(option.disabled),\n \'ui-dropdown-item-empty\': !option.label||option.label.length === 0}">\n <span *ngIf="!template">{{option.label||\'empty\'}}</span>\n <ng-container *ngTemplateOutlet="template; context: {$implicit: option}"></ng-container>\n </li>\n '})],t)}(),f=function(){function t(t,e,o,n){this.el=t,this.renderer=e,this.cd=o,this.zone=n,this.scrollHeight="200px",this.filterBy="label",this.resetFilterOnHide=!1,this.dropdownIcon="pi pi-chevron-down",this.autoDisplayFirst=!0,this.emptyFilterMessage="No results found",this.autoZIndex=!0,this.baseZIndex=0,this.showTransitionOptions="225ms ease-out",this.hideTransitionOptions="195ms ease-in",this.filterMatchMode="contains",this.tooltip="",this.tooltipPosition="right",this.tooltipPositionStyle="absolute",this.autofocusFilter=!0,this.onChange=new i.EventEmitter,this.onFocus=new i.EventEmitter,this.onBlur=new i.EventEmitter,this.onClick=new i.EventEmitter,this.onShow=new i.EventEmitter,this.onHide=new i.EventEmitter,this.onModelChange=function(){},this.onModelTouched=function(){},this.viewPortOffsetTop=0}return Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){t&&(this.focused=!1),this._disabled=t,this.cd.destroyed||this.cd.detectChanges()},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this.templates.forEach((function(e){switch(e.getType()){case"item":t.itemTemplate=e.template;break;case"selectedItem":t.selectedItemTemplate=e.template;break;case"group":t.groupTemplate=e.template;break;default:t.itemTemplate=e.template}}))},t.prototype.ngOnInit=function(){this.optionsToDisplay=this.options,this.updateSelectedOption(null)},Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){var e=this.optionLabel?r.ObjectUtils.generateSelectItems(t,this.optionLabel):t;this._options=e,this.optionsToDisplay=this._options,this.updateSelectedOption(this.value),this.optionsChanged=!0,this.updateFilledState(),this.filterValue&&this.filterValue.length&&this.activateFilter()},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){this.editable&&this.updateEditableLabel()},Object.defineProperty(t.prototype,"label",{get:function(){return this.selectedOption?this.selectedOption.label:null},enumerable:!0,configurable:!0}),t.prototype.updateEditableLabel=function(){this.editableInputViewChild&&this.editableInputViewChild.nativeElement&&(this.editableInputViewChild.nativeElement.value=this.selectedOption?this.selectedOption.label:this.value||"")},t.prototype.onItemClick=function(t){var e=this,i=t.option;this.itemClick=!0,i.disabled||(this.selectItem(t,i),this.focusViewChild.nativeElement.focus()),setTimeout((function(){e.hide(t)}),150)},t.prototype.selectItem=function(t,e){var i=this;this.selectedOption!=e&&(this.selectedOption=e,this.value=e.value,this.filled=!0,this.onModelChange(this.value),this.updateEditableLabel(),this.onChange.emit({originalEvent:t.originalEvent,value:this.value}),this.virtualScroll&&setTimeout((function(){i.viewPortOffsetTop=i.viewPort?i.viewPort.measureScrollOffset():0}),1))},t.prototype.ngAfterViewChecked=function(){var t=this;if(this.optionsChanged&&this.overlayVisible&&(this.optionsChanged=!1,this.virtualScroll&&this.updateVirtualScrollSelectedIndex(!0),this.zone.runOutsideAngular((function(){setTimeout((function(){t.alignOverlay()}),1)}))),this.selectedOptionUpdated&&this.itemsWrapper){if(this.virtualScroll&&this.viewPort){var e=this.viewPort.getRenderedRange();this.updateVirtualScrollSelectedIndex(!1),(e.start>this.virtualScrollSelectedIndex||e.end<this.virtualScrollSelectedIndex)&&this.viewPort.scrollToIndex(this.virtualScrollSelectedIndex)}s.DomHandler.findSingle(this.overlay,"li.ui-state-highlight")&&s.DomHandler.scrollInView(this.itemsWrapper,s.DomHandler.findSingle(this.overlay,"li.ui-state-highlight")),this.selectedOptionUpdated=!1}},t.prototype.writeValue=function(t){this.filter&&this.resetFilter(),this.value=t,this.updateSelectedOption(t),this.updateEditableLabel(),this.updateFilledState(),this.cd.markForCheck()},t.prototype.resetFilter=function(){this.filterValue=null,this.filterViewChild&&this.filterViewChild.nativeElement&&(this.filterViewChild.nativeElement.value=""),this.optionsToDisplay=this.options},t.prototype.updateSelectedOption=function(t){this.selectedOption=this.findOption(t,this.optionsToDisplay),this.autoDisplayFirst&&!this.placeholder&&!this.selectedOption&&this.optionsToDisplay&&this.optionsToDisplay.length&&!this.editable&&(this.selectedOption=this.optionsToDisplay[0]),this.selectedOptionUpdated=!0},t.prototype.registerOnChange=function(t){this.onModelChange=t},t.prototype.registerOnTouched=function(t){this.onModelTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.onMouseclick=function(t){this.disabled||this.readonly||(this.onClick.emit(t),this.selfClick=!0,this.clearClick=s.DomHandler.hasClass(t.target,"ui-dropdown-clear-icon"),this.itemClick||this.clearClick||(this.focusViewChild.nativeElement.focus(),this.overlayVisible?this.hide(t):this.show(),this.cd.detectChanges()))},t.prototype.onEditableInputClick=function(t){this.itemClick=!0,this.bindDocumentClickListener()},t.prototype.onEditableInputFocus=function(t){this.focused=!0,this.hide(t),this.onFocus.emit(t)},t.prototype.onEditableInputChange=function(t){this.value=t.target.value,this.updateSelectedOption(this.value),this.onModelChange(this.value),this.onChange.emit({originalEvent:t,value:this.value})},t.prototype.show=function(){this.overlayVisible=!0},t.prototype.onOverlayAnimationStart=function(t){switch(t.toState){case"visible":this.overlay=t.element;var e=this.virtualScroll?".cdk-virtual-scroll-viewport":".ui-dropdown-items-wrapper";if(this.itemsWrapper=s.DomHandler.findSingle(this.overlay,e),this.appendOverlay(),this.autoZIndex&&(this.overlay.style.zIndex=String(this.baseZIndex+ ++s.DomHandler.zindex)),this.alignOverlay(),this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.options&&this.options.length&&!this.virtualScroll){var i=s.DomHandler.findSingle(this.itemsWrapper,".ui-dropdown-item.ui-state-highlight");i&&s.DomHandler.scrollInView(this.itemsWrapper,i)}this.filterViewChild&&this.filterViewChild.nativeElement&&(this.preventModelTouched=!0,this.autofocusFilter&&this.filterViewChild.nativeElement.focus()),this.onShow.emit(t);break;case"void":this.onOverlayHide()}},t.prototype.scrollToSelectedVirtualScrollElement=function(){this.virtualAutoScrolled||(this.viewPortOffsetTop?this.viewPort.scrollToOffset(this.viewPortOffsetTop):this.virtualScrollSelectedIndex>-1&&this.viewPort.scrollToIndex(this.virtualScrollSelectedIndex)),this.virtualAutoScrolled=!0},t.prototype.updateVirtualScrollSelectedIndex=function(t){this.selectedOption&&this.optionsToDisplay&&this.optionsToDisplay.length&&(t&&(this.viewPortOffsetTop=0),this.virtualScrollSelectedIndex=this.findOptionIndex(this.selectedOption.value,this.optionsToDisplay))},t.prototype.appendOverlay=function(){this.appendTo&&("body"===this.appendTo?document.body.appendChild(this.overlay):s.DomHandler.appendChild(this.overlay,this.appendTo),this.overlay.style.minWidth||(this.overlay.style.minWidth=s.DomHandler.getWidth(this.containerViewChild.nativeElement)+"px"))},t.prototype.restoreOverlayAppend=function(){this.overlay&&this.appendTo&&this.el.nativeElement.appendChild(this.overlay)},t.prototype.hide=function(t){this.overlayVisible=!1,this.filter&&this.resetFilterOnHide&&this.resetFilter(),this.virtualScroll&&(this.virtualAutoScrolled=!1),this.cd.markForCheck(),this.onHide.emit(t)},t.prototype.alignOverlay=function(){this.overlay&&(this.appendTo?s.DomHandler.absolutePosition(this.overlay,this.containerViewChild.nativeElement):s.DomHandler.relativePosition(this.overlay,this.containerViewChild.nativeElement))},t.prototype.onInputFocus=function(t){this.focused=!0,this.onFocus.emit(t)},t.prototype.onInputBlur=function(t){this.focused=!1,this.onBlur.emit(t),this.preventModelTouched||this.onModelTouched(),this.preventModelTouched=!1},t.prototype.findPrevEnabledOption=function(t){var e;if(this.optionsToDisplay&&this.optionsToDisplay.length){for(var i=t-1;0<=i;i--){if(!(o=this.optionsToDisplay[i]).disabled){e=o;break}}if(!e)for(i=this.optionsToDisplay.length-1;i>=t;i--){var o;if(!(o=this.optionsToDisplay[i]).disabled){e=o;break}}}return e},t.prototype.findNextEnabledOption=function(t){var e;if(this.optionsToDisplay&&this.optionsToDisplay.length){for(var i=t+1;t<this.optionsToDisplay.length-1;i++){if(!(o=this.optionsToDisplay[i]).disabled){e=o;break}}if(!e)for(i=0;i<t;i++){var o;if(!(o=this.optionsToDisplay[i]).disabled){e=o;break}}}return e},t.prototype.onKeydown=function(t,e){if(!this.readonly&&this.optionsToDisplay&&null!==this.optionsToDisplay.length)switch(t.which){case 40:if(!this.overlayVisible&&t.altKey)this.show();else if(this.group){if(-1!==(o=this.selectedOption?this.findOptionGroupIndex(this.selectedOption.value,this.optionsToDisplay):-1)){var i=o.itemIndex+1;i<this.optionsToDisplay[o.groupIndex].items.length?(this.selectItem(t,this.optionsToDisplay[o.groupIndex].items[i]),this.selectedOptionUpdated=!0):this.optionsToDisplay[o.groupIndex+1]&&(this.selectItem(t,this.optionsToDisplay[o.groupIndex+1].items[0]),this.selectedOptionUpdated=!0)}else this.selectItem(t,this.optionsToDisplay[0].items[0])}else{var o=this.selectedOption?this.findOptionIndex(this.selectedOption.value,this.optionsToDisplay):-1,n=this.findNextEnabledOption(o);n&&(this.selectItem(t,n),this.selectedOptionUpdated=!0)}t.preventDefault();break;case 38:if(this.group){if(-1!==(o=this.selectedOption?this.findOptionGroupIndex(this.selectedOption.value,this.optionsToDisplay):-1)){var l=o.itemIndex-1;if(l>=0)this.selectItem(t,this.optionsToDisplay[o.groupIndex].items[l]),this.selectedOptionUpdated=!0;else if(l<0){var s=this.optionsToDisplay[o.groupIndex-1];s&&(this.selectItem(t,s.items[s.items.length-1]),this.selectedOptionUpdated=!0)}}}else{o=this.selectedOption?this.findOptionIndex(this.selectedOption.value,this.optionsToDisplay):-1;var r=this.findPrevEnabledOption(o);r&&(this.selectItem(t,r),this.selectedOptionUpdated=!0)}t.preventDefault();break;case 32:case 32:this.overlayVisible||(this.show(),t.preventDefault());break;case 13:(!this.filter||this.optionsToDisplay&&this.optionsToDisplay.length>0)&&this.hide(t),t.preventDefault();break;case 27:case 9:this.hide(t);break;default:e&&this.search(t)}},t.prototype.search=function(t){var e=this;this.searchTimeout&&clearTimeout(this.searchTimeout);var i,o=t.key;if(this.previousSearchChar=this.currentSearchChar,this.currentSearchChar=o,this.previousSearchChar===this.currentSearchChar?this.searchValue=this.currentSearchChar:this.searchValue=this.searchValue?this.searchValue+o:o,this.group){var n=this.selectedOption?this.findOptionGroupIndex(this.selectedOption.value,this.optionsToDisplay):{groupIndex:0,itemIndex:0};i=this.searchOptionWithinGroup(n)}else{n=this.selectedOption?this.findOptionIndex(this.selectedOption.value,this.optionsToDisplay):-1;i=this.searchOption(++n)}i&&!i.disabled&&(this.selectItem(t,i),this.selectedOptionUpdated=!0),this.searchTimeout=setTimeout((function(){e.searchValue=null}),250)},t.prototype.searchOption=function(t){var e;return this.searchValue&&((e=this.searchOptionInRange(t,this.optionsToDisplay.length))||(e=this.searchOptionInRange(0,t))),e},t.prototype.searchOptionInRange=function(t,e){for(var i=t;i<e;i++){var o=this.optionsToDisplay[i];if(o.label.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))&&!o.disabled)return o}return null},t.prototype.searchOptionWithinGroup=function(t){if(this.searchValue){for(var e=t.groupIndex;e<this.optionsToDisplay.length;e++)for(var i=t.groupIndex===e?t.itemIndex+1:0;i<this.optionsToDisplay[e].items.length;i++){if((o=this.optionsToDisplay[e].items[i]).label.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))&&!o.disabled)return o}for(e=0;e<=t.groupIndex;e++)for(i=0;i<(t.groupIndex===e?t.itemIndex:this.optionsToDisplay[e].items.length);i++){var o;if((o=this.optionsToDisplay[e].items[i]).label.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))&&!o.disabled)return o}}return null},t.prototype.findOptionIndex=function(t,e){var i=-1;if(e)for(var o=0;o<e.length;o++)if(null==t&&null==e[o].value||r.ObjectUtils.equals(t,e[o].value,this.dataKey)){i=o;break}return i},t.prototype.findOptionGroupIndex=function(t,e){var i,o;if(e)for(var n=0;n<e.length&&(i=n,-1===(o=this.findOptionIndex(t,e[n].items)));n++);return-1!==o?{groupIndex:i,itemIndex:o}:-1},t.prototype.findOption=function(t,e,i){var o,n;if(this.group&&!i){var l=void 0;if(e&&e.length)try{for(var s=h(e),r=s.next();!r.done;r=s.next()){var a=r.value;if(l=this.findOption(t,a.items,!0))break}}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return l}var p=this.findOptionIndex(t,e);return-1!=p?e[p]:null},t.prototype.onFilter=function(t){var e=t.target.value;e&&e.length?(this.filterValue=e,this.activateFilter()):(this.filterValue=null,this.optionsToDisplay=this.options),this.optionsChanged=!0},t.prototype.activateFilter=function(){var t,e,i=this.filterBy.split(",");if(this.options&&this.options.length){if(this.group){var o=[];try{for(var n=h(this.options),l=n.next();!l.done;l=n.next()){var s=l.value,a=r.FilterUtils.filter(s.items,i,this.filterValue,this.filterMatchMode,this.filterLocale);a&&a.length&&o.push({label:s.label,value:s.value,items:a})}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.optionsToDisplay=o}else this.optionsToDisplay=r.FilterUtils.filter(this.options,i,this.filterValue,this.filterMatchMode,this.filterLocale);this.optionsChanged=!0}},t.prototype.applyFocus=function(){this.editable?s.DomHandler.findSingle(this.el.nativeElement,".ui-dropdown-label.ui-inputtext").focus():s.DomHandler.findSingle(this.el.nativeElement,"input[readonly]").focus()},t.prototype.focus=function(){this.applyFocus()},t.prototype.bindDocumentClickListener=function(){var t=this;this.documentClickListener||(this.documentClickListener=this.renderer.listen("document","click",(function(e){t.selfClick||t.itemClick||(t.hide(e),t.unbindDocumentClickListener()),t.clearClickState(),t.cd.markForCheck()})))},t.prototype.clearClickState=function(){this.selfClick=!1,this.itemClick=!1},t.prototype.unbindDocumentClickListener=function(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null)},t.prototype.bindDocumentResizeListener=function(){this.documentResizeListener=this.onWindowResize.bind(this),window.addEventListener("resize",this.documentResizeListener)},t.prototype.unbindDocumentResizeListener=function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},t.prototype.onWindowResize=function(){s.DomHandler.isAndroid()||this.hide(event)},t.prototype.updateFilledState=function(){this.filled=null!=this.selectedOption},t.prototype.clear=function(t){this.clearClick=!0,this.value=null,this.onModelChange(this.value),this.onChange.emit({originalEvent:t,value:this.value}),this.updateSelectedOption(this.value),this.updateEditableLabel(),this.updateFilledState()},t.prototype.onOverlayHide=function(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.overlay=null,this.itemsWrapper=null,this.onModelTouched()},t.prototype.ngOnDestroy=function(){this.restoreOverlayAppend(),this.onOverlayHide()},t.ctorParameters=function(){return[{type:i.ElementRef},{type:i.Renderer2},{type:i.ChangeDetectorRef},{type:i.NgZone}]},d([i.Input()],t.prototype,"scrollHeight",void 0),d([i.Input()],t.prototype,"filter",void 0),d([i.Input()],t.prototype,"name",void 0),d([i.Input()],t.prototype,"style",void 0),d([i.Input()],t.prototype,"panelStyle",void 0),d([i.Input()],t.prototype,"styleClass",void 0),d([i.Input()],t.prototype,"panelStyleClass",void 0),d([i.Input()],t.prototype,"readonly",void 0),d([i.Input()],t.prototype,"required",void 0),d([i.Input()],t.prototype,"editable",void 0),d([i.Input()],t.prototype,"appendTo",void 0),d([i.Input()],t.prototype,"tabindex",void 0),d([i.Input()],t.prototype,"placeholder",void 0),d([i.Input()],t.prototype,"filterPlaceholder",void 0),d([i.Input()],t.prototype,"filterLocale",void 0),d([i.Input()],t.prototype,"inputId",void 0),d([i.Input()],t.prototype,"selectId",void 0),d([i.Input()],t.prototype,"dataKey",void 0),d([i.Input()],t.prototype,"filterBy",void 0),d([i.Input()],t.prototype,"autofocus",void 0),d([i.Input()],t.prototype,"resetFilterOnHide",void 0),d([i.Input()],t.prototype,"dropdownIcon",void 0),d([i.Input()],t.prototype,"optionLabel",void 0),d([i.Input()],t.prototype,"autoDisplayFirst",void 0),d([i.Input()],t.prototype,"group",void 0),d([i.Input()],t.prototype,"showClear",void 0),d([i.Input()],t.prototype,"emptyFilterMessage",void 0),d([i.Input()],t.prototype,"virtualScroll",void 0),d([i.Input()],t.prototype,"itemSize",void 0),d([i.Input()],t.prototype,"autoZIndex",void 0),d([i.Input()],t.prototype,"baseZIndex",void 0),d([i.Input()],t.prototype,"showTransitionOptions",void 0),d([i.Input()],t.prototype,"hideTransitionOptions",void 0),d([i.Input()],t.prototype,"ariaFilterLabel",void 0),d([i.Input()],t.prototype,"ariaLabelledBy",void 0),d([i.Input()],t.prototype,"filterMatchMode",void 0),d([i.Input()],t.prototype,"maxlength",void 0),d([i.Input()],t.prototype,"tooltip",void 0),d([i.Input()],t.prototype,"tooltipPosition",void 0),d([i.Input()],t.prototype,"tooltipPositionStyle",void 0),d([i.Input()],t.prototype,"tooltipStyleClass",void 0),d([i.Input()],t.prototype,"autofocusFilter",void 0),d([i.Output()],t.prototype,"onChange",void 0),d([i.Output()],t.prototype,"onFocus",void 0),d([i.Output()],t.prototype,"onBlur",void 0),d([i.Output()],t.prototype,"onClick",void 0),d([i.Output()],t.prototype,"onShow",void 0),d([i.Output()],t.prototype,"onHide",void 0),d([i.ViewChild("container")],t.prototype,"containerViewChild",void 0),d([i.ViewChild("filter")],t.prototype,"filterViewChild",void 0),d([i.ViewChild("in")],t.prototype,"focusViewChild",void 0),d([i.ViewChild(e.CdkVirtualScrollViewport)],t.prototype,"viewPort",void 0),d([i.ViewChild("editableInput")],t.prototype,"editableInputViewChild",void 0),d([i.ContentChildren(l.PrimeTemplate)],t.prototype,"templates",void 0),d([i.Input()],t.prototype,"disabled",null),d([i.Input()],t.prototype,"options",null),t=d([i.Component({selector:"p-dropdown",template:'\n <div #container [ngClass]="{\'ui-dropdown ui-widget ui-state-default ui-corner-all\':true,\n \'ui-state-disabled\':disabled, \'ui-dropdown-open\':overlayVisible, \'ui-state-focus\':focused, \'ui-dropdown-clearable\': showClear && !disabled}"\n (click)="onMouseclick($event)" [ngStyle]="style" [class]="styleClass">\n <div class="ui-helper-hidden-accessible">\n <input #in [attr.id]="inputId" type="text" [attr.aria-label]="selectedOption ? selectedOption.label : \' \'" readonly (focus)="onInputFocus($event)" aria-haspopup="listbox"\n aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible" [attr.aria-labelledby]="ariaLabelledBy" (blur)="onInputBlur($event)" (keydown)="onKeydown($event, true)"\n [disabled]="disabled" [attr.tabindex]="tabindex" [attr.autofocus]="autofocus" role="listbox">\n </div>\n <div class="ui-dropdown-label-container" [pTooltip]="tooltip" [tooltipPosition]="tooltipPosition" [positionStyle]="tooltipPositionStyle" [tooltipStyleClass]="tooltipStyleClass">\n <label [ngClass]="{\'ui-dropdown-label ui-inputtext ui-corner-all\':true,\'ui-dropdown-label-empty\':(label == null || label.length === 0)}" *ngIf="!editable && (label != null)">\n <ng-container *ngIf="!selectedItemTemplate">{{label||\'empty\'}}</ng-container>\n <ng-container *ngTemplateOutlet="selectedItemTemplate; context: {$implicit: selectedOption}"></ng-container>\n </label>\n <label [ngClass]="{\'ui-dropdown-label ui-inputtext ui-corner-all ui-placeholder\':true,\'ui-dropdown-label-empty\': (placeholder == null || placeholder.length === 0)}" *ngIf="!editable && (label == null)">{{placeholder||\'empty\'}}</label>\n <input #editableInput type="text" [attr.maxlength]="maxlength" [attr.aria-label]="selectedOption ? selectedOption.label : \' \'" class="ui-dropdown-label ui-inputtext ui-corner-all" *ngIf="editable" [disabled]="disabled" [attr.placeholder]="placeholder"\n aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible" (click)="onEditableInputClick($event)" (input)="onEditableInputChange($event)" (focus)="onEditableInputFocus($event)" (blur)="onInputBlur($event)">\n <i class="ui-dropdown-clear-icon pi pi-times" (click)="clear($event)" *ngIf="value != null && showClear && !disabled"></i>\n </div>\n <div class="ui-dropdown-trigger ui-state-default ui-corner-right" role="button" aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible">\n <span class="ui-dropdown-trigger-icon ui-clickable" [ngClass]="dropdownIcon"></span>\n </div>\n <div *ngIf="overlayVisible" [ngClass]="\'ui-dropdown-panel ui-widget ui-widget-content ui-corner-all ui-shadow\'" [@overlayAnimation]="{value: \'visible\', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}" (@overlayAnimation.start)="onOverlayAnimationStart($event)" [ngStyle]="panelStyle" [class]="panelStyleClass">\n <div *ngIf="filter" class="ui-dropdown-filter-container" (click)="$event.stopPropagation()">\n <input #filter type="text" autocomplete="off" [value]="filterValue||\'\'" class="ui-dropdown-filter ui-inputtext ui-widget ui-state-default ui-corner-all" [attr.placeholder]="filterPlaceholder"\n (keydown.enter)="$event.preventDefault()" (keydown)="onKeydown($event, false)" (input)="onFilter($event)" [attr.aria-label]="ariaFilterLabel">\n <span class="ui-dropdown-filter-icon pi pi-search"></span>\n </div>\n <div class="ui-dropdown-items-wrapper" [style.max-height]="virtualScroll ? \'auto\' : (scrollHeight||\'auto\')">\n <ul class="ui-dropdown-items ui-dropdown-list ui-widget-content ui-widget ui-corner-all ui-helper-reset" role="listbox">\n <ng-container *ngIf="group">\n <ng-template ngFor let-optgroup [ngForOf]="optionsToDisplay">\n <li class="ui-dropdown-item-group">\n <span *ngIf="!groupTemplate">{{optgroup.label||\'empty\'}}</span>\n <ng-container *ngTemplateOutlet="groupTemplate; context: {$implicit: optgroup}"></ng-container>\n </li>\n <ng-container *ngTemplateOutlet="itemslist; context: {$implicit: optgroup.items, selectedOption: selectedOption}"></ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf="!group">\n <ng-container *ngTemplateOutlet="itemslist; context: {$implicit: optionsToDisplay, selectedOption: selectedOption}"></ng-container>\n </ng-container>\n <ng-template #itemslist let-options let-selectedOption="selectedOption">\n\n <ng-container *ngIf="!virtualScroll; else virtualScrollList">\n <ng-template ngFor let-option let-i="index" [ngForOf]="options">\n <p-dropdownItem [option]="option" [selected]="selectedOption == option"\n (onClick)="onItemClick($event)"\n [template]="itemTemplate"></p-dropdownItem>\n </ng-template>\n </ng-container>\n <ng-template #virtualScrollList>\n <cdk-virtual-scroll-viewport (scrolledIndexChange)="scrollToSelectedVirtualScrollElement()" #viewport [ngStyle]="{\'height\': scrollHeight}" [itemSize]="itemSize" *ngIf="virtualScroll && optionsToDisplay && optionsToDisplay.length">\n <ng-container *cdkVirtualFor="let option of options; let i = index; let c = count; let f = first; let l = last; let e = even; let o = odd">\n <p-dropdownItem [option]="option" [selected]="selectedOption == option"\n (onClick)="onItemClick($event)"\n [template]="itemTemplate"></p-dropdownItem>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n </ng-template>\n </ng-template>\n <li *ngIf="filter && (!optionsToDisplay || (optionsToDisplay && optionsToDisplay.length === 0))" class="ui-dropdown-empty-message">{{emptyFilterMessage}}</li>\n </ul>\n </div>\n </div>\n </div>\n ',animations:[o.trigger("overlayAnimation",[o.state("void",o.style({transform:"translateY(5%)",opacity:0})),o.state("visible",o.style({transform:"translateY(0)",opacity:1})),o.transition("void => visible",o.animate("{{showTransitionParams}}")),o.transition("visible => void",o.animate("{{hideTransitionParams}}"))])],host:{"[class.ui-inputwrapper-filled]":"filled","[class.ui-inputwrapper-focus]":"focused"},providers:[u],changeDetection:i.ChangeDetectionStrategy.Default})],t)}(),v=function(){function t(){}return t=d([i.NgModule({imports:[n.CommonModule,l.SharedModule,e.ScrollingModule,p.TooltipModule],exports:[f,l.SharedModule,e.ScrollingModule],declarations:[f,c]})],t)}();t.DROPDOWN_VALUE_ACCESSOR=u,t.Dropdown=f,t.DropdownItem=c,t.DropdownModule=v,Object.defineProperty(t,"__esModule",{value:!0})}));
2//# sourceMappingURL=primeng-dropdown.umd.min.js.map
\No newline at end of file