!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(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"),require("primeng/ripple")):"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","primeng/ripple"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.dropdown={}),e.ng.cdk.scrolling,e.ng.core,e.ng.animations,e.ng.common,e.primeng.api,e.primeng.dom,e.primeng.utils,e.ng.forms,e.primeng.tooltip,e.primeng.ripple)}(this,(function(e,t,i,n,o,l,s,r,p,a,d){"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. ***************************************************************************** */Object.create;function h(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.")}Object.create;var c={provide:p.NG_VALUE_ACCESSOR,useExisting:i.forwardRef((function(){return y})),multi:!0},u=function(){function e(){this.onClick=new i.EventEmitter}return e.prototype.onOptionClick=function(e){this.onClick.emit({originalEvent:e,option:this.option})},e}();u.decorators=[{type:i.Component,args:[{selector:"p-dropdownItem",template:'\n
  • \n {{option.label||\'empty\'}}\n \n
  • \n '}]}],u.propDecorators={option:[{type:i.Input}],selected:[{type:i.Input}],disabled:[{type:i.Input}],visible:[{type:i.Input}],itemSize:[{type:i.Input}],template:[{type:i.Input}],onClick:[{type:i.Output}]};var y=function(){function e(e,t,n,o){this.el=e,this.renderer=t,this.cd=n,this.zone=o,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=".12s cubic-bezier(0, 0, 0.2, 1)",this.hideTransitionOptions=".1s linear",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(e.prototype,"disabled",{get:function(){return this._disabled},set:function(e){e&&(this.focused=!1),this._disabled=e,this.cd.destroyed||this.cd.detectChanges()},enumerable:!1,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach((function(t){switch(t.getType()){case"item":e.itemTemplate=t.template;break;case"selectedItem":e.selectedItemTemplate=t.template;break;case"group":e.groupTemplate=t.template;break;default:e.itemTemplate=t.template}}))},e.prototype.ngOnInit=function(){this.optionsToDisplay=this.options,this.updateSelectedOption(null)},Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){var t=this.optionLabel?r.ObjectUtils.generateSelectItems(e,this.optionLabel):e;this._options=t,this.optionsToDisplay=this._options,this.updateSelectedOption(this.value),this.optionsChanged=!0,this.updateFilledState(),this.filterValue&&this.filterValue.length&&this.activateFilter()},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.editable&&this.updateEditableLabel()},Object.defineProperty(e.prototype,"label",{get:function(){return this.selectedOption?this.selectedOption.label:null},enumerable:!1,configurable:!0}),e.prototype.updateEditableLabel=function(){this.editableInputViewChild&&this.editableInputViewChild.nativeElement&&(this.editableInputViewChild.nativeElement.value=this.selectedOption?this.selectedOption.label:this.value||"")},e.prototype.onItemClick=function(e){var t=this,i=e.option;i.disabled||(this.selectItem(e,i),this.accessibleViewChild.nativeElement.focus()),setTimeout((function(){t.hide(e)}),150)},e.prototype.selectItem=function(e,t){var i=this;this.selectedOption!=t&&(this.selectedOption=t,this.value=t.value,this.filled=!0,this.onModelChange(this.value),this.updateEditableLabel(),this.onChange.emit({originalEvent:e.originalEvent,value:this.value}),this.virtualScroll&&setTimeout((function(){i.viewPortOffsetTop=i.viewPort?i.viewPort.measureScrollOffset():0}),1))},e.prototype.ngAfterViewChecked=function(){var e=this;if(this.optionsChanged&&this.overlayVisible&&(this.optionsChanged=!1,this.virtualScroll&&this.updateVirtualScrollSelectedIndex(!0),this.zone.runOutsideAngular((function(){setTimeout((function(){e.alignOverlay()}),1)}))),this.selectedOptionUpdated&&this.itemsWrapper){if(this.virtualScroll&&this.viewPort){var t=this.viewPort.getRenderedRange();this.updateVirtualScrollSelectedIndex(!1),(t.start>this.virtualScrollSelectedIndex||t.end-1&&this.viewPort.scrollToIndex(this.virtualScrollSelectedIndex)),this.virtualAutoScrolled=!0},e.prototype.updateVirtualScrollSelectedIndex=function(e){this.selectedOption&&this.optionsToDisplay&&this.optionsToDisplay.length&&(e&&(this.viewPortOffsetTop=0),this.virtualScrollSelectedIndex=this.findOptionIndex(this.selectedOption.value,this.optionsToDisplay))},e.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"))},e.prototype.restoreOverlayAppend=function(){this.overlay&&this.appendTo&&this.el.nativeElement.appendChild(this.overlay)},e.prototype.hide=function(e){this.overlayVisible=!1,this.filter&&this.resetFilterOnHide&&this.resetFilter(),this.virtualScroll&&(this.virtualAutoScrolled=!1),this.cd.markForCheck(),this.onHide.emit(e)},e.prototype.alignOverlay=function(){this.overlay&&(this.appendTo?s.DomHandler.absolutePosition(this.overlay,this.containerViewChild.nativeElement):s.DomHandler.relativePosition(this.overlay,this.containerViewChild.nativeElement))},e.prototype.onInputFocus=function(e){this.focused=!0,this.onFocus.emit(e)},e.prototype.onInputBlur=function(e){this.focused=!1,this.onBlur.emit(e),this.preventModelTouched||this.onModelTouched(),this.preventModelTouched=!1},e.prototype.findPrevEnabledOption=function(e){var t;if(this.optionsToDisplay&&this.optionsToDisplay.length){for(var i=e-1;0<=i;i--){if(!(n=this.optionsToDisplay[i]).disabled){t=n;break}}if(!t)for(i=this.optionsToDisplay.length-1;i>=e;i--){var n;if(!(n=this.optionsToDisplay[i]).disabled){t=n;break}}}return t},e.prototype.findNextEnabledOption=function(e){var t;if(this.optionsToDisplay&&this.optionsToDisplay.length){for(var i=e+1;e=0)this.selectItem(e,this.optionsToDisplay[n.groupIndex].items[l]),this.selectedOptionUpdated=!0;else if(l<0){var s=this.optionsToDisplay[n.groupIndex-1];s&&(this.selectItem(e,s.items[s.items.length-1]),this.selectedOptionUpdated=!0)}}}else{n=this.selectedOption?this.findOptionIndex(this.selectedOption.value,this.optionsToDisplay):-1;var r=this.findPrevEnabledOption(n);r&&(this.selectItem(e,r),this.selectedOptionUpdated=!0)}e.preventDefault();break;case 32:case 32:this.overlayVisible||(this.show(),e.preventDefault());break;case 13:(!this.filter||this.optionsToDisplay&&this.optionsToDisplay.length>0)&&this.hide(e),e.preventDefault();break;case 27:case 9:this.hide(e);break;default:t&&this.search(e)}},e.prototype.search=function(e){var t=this;this.searchTimeout&&clearTimeout(this.searchTimeout);var i,n=e.key;if(this.previousSearchChar=this.currentSearchChar,this.currentSearchChar=n,this.previousSearchChar===this.currentSearchChar?this.searchValue=this.currentSearchChar:this.searchValue=this.searchValue?this.searchValue+n:n,this.group){var o=this.selectedOption?this.findOptionGroupIndex(this.selectedOption.value,this.optionsToDisplay):{groupIndex:0,itemIndex:0};i=this.searchOptionWithinGroup(o)}else{o=this.selectedOption?this.findOptionIndex(this.selectedOption.value,this.optionsToDisplay):-1;i=this.searchOption(++o)}i&&!i.disabled&&(this.selectItem(e,i),this.selectedOptionUpdated=!0),this.searchTimeout=setTimeout((function(){t.searchValue=null}),250)},e.prototype.searchOption=function(e){var t;return this.searchValue&&((t=this.searchOptionInRange(e,this.optionsToDisplay.length))||(t=this.searchOptionInRange(0,e))),t},e.prototype.searchOptionInRange=function(e,t){for(var i=e;i\n
    \n \n
    \n \n {{label||\'empty\'}}\n \n \n {{placeholder||\'empty\'}}\n \n \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
      \n \n \n
    • \n {{optgroup.label||\'empty\'}}\n \n
    • \n \n
      \n
      \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    • {{emptyFilterMessage}}
    • \n
    \n
    \n
    \n \n ',animations:[n.trigger("overlayAnimation",[n.transition(":enter",[n.style({opacity:0,transform:"scaleY(0.8)"}),n.animate("{{showTransitionParams}}")]),n.transition(":leave",[n.animate("{{hideTransitionParams}}",n.style({opacity:0}))])])],host:{"[class.p-inputwrapper-filled]":"filled","[class.p-inputwrapper-focus]":"focused"},providers:[c],changeDetection:i.ChangeDetectionStrategy.OnPush,encapsulation:i.ViewEncapsulation.None,styles:[".p-dropdown{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;position:relative;user-select:none}.p-dropdown-clear-icon{margin-top:-.5rem;position:absolute;top:50%}.p-dropdown-trigger{-ms-flex-align:center;-ms-flex-negative:0;-ms-flex-pack:center;align-items:center;display:-ms-flexbox;display:flex;flex-shrink:0;justify-content:center}.p-dropdown-label{-ms-flex:1 1 auto;cursor:pointer;display:block;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:1%}.p-dropdown-label-empty{overflow:hidden;visibility:hidden}input.p-dropdown-label{cursor:default}.p-dropdown .p-dropdown-panel{min-width:100%}.p-dropdown-panel{position:absolute}.p-dropdown-items-wrapper{overflow:auto}.p-dropdown-item{cursor:pointer;font-weight:400;overflow:hidden;position:relative;white-space:nowrap}.p-dropdown-items{list-style-type:none;margin:0;padding:0}.p-dropdown-filter{width:100%}.p-dropdown-filter-container{position:relative}.p-dropdown-filter-icon{margin-top:-.5rem;position:absolute;top:50%}.p-fluid .p-dropdown{display:-ms-flexbox;display:flex}.p-fluid .p-dropdown .p-dropdown-label{width:1%}"]}]}],y.ctorParameters=function(){return[{type:i.ElementRef},{type:i.Renderer2},{type:i.ChangeDetectorRef},{type:i.NgZone}]},y.propDecorators={scrollHeight:[{type:i.Input}],filter:[{type:i.Input}],name:[{type:i.Input}],style:[{type:i.Input}],panelStyle:[{type:i.Input}],styleClass:[{type:i.Input}],panelStyleClass:[{type:i.Input}],readonly:[{type:i.Input}],required:[{type:i.Input}],editable:[{type:i.Input}],appendTo:[{type:i.Input}],tabindex:[{type:i.Input}],placeholder:[{type:i.Input}],filterPlaceholder:[{type:i.Input}],filterLocale:[{type:i.Input}],inputId:[{type:i.Input}],selectId:[{type:i.Input}],dataKey:[{type:i.Input}],filterBy:[{type:i.Input}],autofocus:[{type:i.Input}],resetFilterOnHide:[{type:i.Input}],dropdownIcon:[{type:i.Input}],optionLabel:[{type:i.Input}],autoDisplayFirst:[{type:i.Input}],group:[{type:i.Input}],showClear:[{type:i.Input}],emptyFilterMessage:[{type:i.Input}],virtualScroll:[{type:i.Input}],itemSize:[{type:i.Input}],autoZIndex:[{type:i.Input}],baseZIndex:[{type:i.Input}],showTransitionOptions:[{type:i.Input}],hideTransitionOptions:[{type:i.Input}],ariaFilterLabel:[{type:i.Input}],ariaLabelledBy:[{type:i.Input}],filterMatchMode:[{type:i.Input}],maxlength:[{type:i.Input}],tooltip:[{type:i.Input}],tooltipPosition:[{type:i.Input}],tooltipPositionStyle:[{type:i.Input}],tooltipStyleClass:[{type:i.Input}],autofocusFilter:[{type:i.Input}],onChange:[{type:i.Output}],onFocus:[{type:i.Output}],onBlur:[{type:i.Output}],onClick:[{type:i.Output}],onShow:[{type:i.Output}],onHide:[{type:i.Output}],containerViewChild:[{type:i.ViewChild,args:["container"]}],filterViewChild:[{type:i.ViewChild,args:["filter"]}],accessibleViewChild:[{type:i.ViewChild,args:["in"]}],viewPort:[{type:i.ViewChild,args:[t.CdkVirtualScrollViewport]}],editableInputViewChild:[{type:i.ViewChild,args:["editableInput"]}],templates:[{type:i.ContentChildren,args:[l.PrimeTemplate]}],disabled:[{type:i.Input}],options:[{type:i.Input}]};var f=function(){};f.decorators=[{type:i.NgModule,args:[{imports:[o.CommonModule,l.SharedModule,t.ScrollingModule,a.TooltipModule,d.RippleModule],exports:[y,l.SharedModule,t.ScrollingModule],declarations:[y,u]}]}],e.DROPDOWN_VALUE_ACCESSOR=c,e.Dropdown=y,e.DropdownItem=u,e.DropdownModule=f,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=primeng-dropdown.umd.min.js.map