!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/animations"),require("@angular/common"),require("primeng/dom"),require("primeng/utils"),require("primeng/api"),require("@angular/forms"),require("@angular/cdk/scrolling"),require("primeng/tooltip"),require("primeng/ripple")):"function"==typeof define&&define.amd?define("primeng/multiselect",["exports","@angular/core","@angular/animations","@angular/common","primeng/dom","primeng/utils","primeng/api","@angular/forms","@angular/cdk/scrolling","primeng/tooltip","primeng/ripple"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.multiselect={}),e.ng.core,e.ng.animations,e.ng.common,e.primeng.dom,e.primeng.utils,e.primeng.api,e.ng.forms,e.ng.cdk.scrolling,e.primeng.tooltip,e.primeng.ripple)}(this,(function(e,t,i,n,l,o,s,a,r,p,c){"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 u(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.")}function h(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,l,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){l={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(l)throw l.error}}return s}function d(){for(var e=[],t=0;t\n
\n
\n \n
\n
\n {{option.label}}\n \n \n ',encapsulation:t.ViewEncapsulation.None}]}],y.propDecorators={option:[{type:t.Input}],selected:[{type:t.Input}],disabled:[{type:t.Input}],itemSize:[{type:t.Input}],template:[{type:t.Input}],maxSelectionLimitReached:[{type:t.Input}],onClick:[{type:t.Output}],onKeydown:[{type:t.Output}]};var f=function(){function e(e,i,n){this.el=e,this.renderer=i,this.cd=n,this.scrollHeight="200px",this.filter=!0,this.displaySelectedLabel=!0,this.maxSelectedLabels=3,this.selectedItemsLabel="{0} items selected",this.showToggleAll=!0,this.emptyFilterMessage="No results found",this.resetFilterOnHide=!1,this.dropdownIcon="pi pi-chevron-down",this.showHeader=!0,this.autoZIndex=!0,this.baseZIndex=0,this.filterBy="label",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 t.EventEmitter,this.onFocus=new t.EventEmitter,this.onBlur=new t.EventEmitter,this.onClick=new t.EventEmitter,this.onPanelShow=new t.EventEmitter,this.onPanelHide=new t.EventEmitter,this.onModelChange=function(){},this.onModelTouched=function(){},this.disabledSelectedOptions=[]}return Object.defineProperty(e.prototype,"defaultLabel",{get:function(){return this._defaultLabel},set:function(e){this._defaultLabel=e,this.updateLabel()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){this._placeholder=e,this.updateLabel()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){var t=this.optionLabel?o.ObjectUtils.generateSelectItems(e,this.optionLabel):e;this.visibleOptions=t,this._options=t,this.updateLabel(),this.filterValue&&this.filterValue.length&&this.activateFilter()},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.updateLabel()},e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach((function(t){switch(t.getType()){case"item":e.itemTemplate=t.template;break;case"selectedItems":e.selectedItemsTemplate=t.template;break;case"header":e.headerTemplate=t.template;break;case"footer":e.footerTemplate=t.template;break;default:e.itemTemplate=t.template}}))},e.prototype.ngAfterViewInit=function(){this.overlayVisible&&this.show()},e.prototype.ngAfterViewChecked=function(){this.filtered&&(this.alignOverlay(),this.filtered=!1)},e.prototype.writeValue=function(e){this.value=e,this.updateLabel(),this.updateFilledState(),this.setDisabledSelectedOptions(),this.checkSelectionLimit(),this.cd.markForCheck()},e.prototype.checkSelectionLimit=function(){this.selectionLimit&&this.value&&this.value.length===this.selectionLimit?this.maxSelectionLimitReached=!0:this.maxSelectionLimitReached=!1},e.prototype.updateFilledState=function(){this.filled=this.value&&this.value.length>0},e.prototype.registerOnChange=function(e){this.onModelChange=e},e.prototype.registerOnTouched=function(e){this.onModelTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e,this.cd.markForCheck()},e.prototype.onOptionClick=function(e){var t=e.option;if(!t.disabled){var i=t.value,n=this.findSelectionIndex(i);-1!=n?(this.value=this.value.filter((function(e,t){return t!=n})),this.selectionLimit&&(this.maxSelectionLimitReached=!1)):((!this.selectionLimit||!this.value||this.value.length0){var t=[];t=d(this.disabledSelectedOptions),this.value=t}else this.value=[];else{var i=this.getVisibleOptions();if(i){t=[];this.disabledSelectedOptions&&this.disabledSelectedOptions.length>0&&(t=d(this.disabledSelectedOptions));for(var n=0;n0&&this.value.length==e+t},e.prototype.isAllVisibleOptionsChecked=function(){var e,t;if(this.visibleOptions&&0!==this.visibleOptions.length){try{for(var i=u(this.visibleOptions),n=i.next();!n.done;n=i.next()){var l=n.value;if(!this.isSelected(l.value))return!1}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return!0}return!1},e.prototype.getEnabledOptionCount=function(){var e,t;if(this.options){var i=0;try{for(var n=u(this.options),l=n.next();!l.done;l=n.next()){l.value.disabled||i++}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return i}return 0},e.prototype.setDisabledSelectedOptions=function(){var e,t;if(this.options&&(this.disabledSelectedOptions=[],this.value))try{for(var i=u(this.options),n=i.next();!n.done;n=i.next()){var l=n.value;l.disabled&&this.isSelected(l.value)&&this.disabledSelectedOptions.push(l.value)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.show=function(){this.overlayVisible||(this.overlayVisible=!0)},e.prototype.onOverlayAnimationStart=function(e){switch(e.toState){case"visible":this.overlay=e.element,this.appendOverlay(),this.autoZIndex&&(this.overlay.style.zIndex=String(this.baseZIndex+ ++l.DomHandler.zindex)),this.alignOverlay(),this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener(),this.filterInputChild&&this.filterInputChild.nativeElement&&(this.preventModelTouched=!0,this.autofocusFilter&&this.filterInputChild.nativeElement.focus()),this.onPanelShow.emit();break;case"void":this.onOverlayHide()}},e.prototype.appendOverlay=function(){this.appendTo&&("body"===this.appendTo?document.body.appendChild(this.overlay):l.DomHandler.appendChild(this.overlay,this.appendTo),this.overlay.style.minWidth||(this.overlay.style.minWidth=l.DomHandler.getWidth(this.containerViewChild.nativeElement)+"px"))},e.prototype.restoreOverlayAppend=function(){this.overlay&&this.appendTo&&this.el.nativeElement.appendChild(this.overlay)},e.prototype.alignOverlay=function(){this.overlay&&(this.appendTo?l.DomHandler.absolutePosition(this.overlay,this.containerViewChild.nativeElement):l.DomHandler.relativePosition(this.overlay,this.containerViewChild.nativeElement))},e.prototype.hide=function(){this.overlayVisible=!1,this.unbindDocumentClickListener(),this.resetFilterOnHide&&(this.filterInputChild.nativeElement.value="",this.onFilter()),this.onPanelHide.emit(),this.cd.markForCheck()},e.prototype.close=function(e){this.hide(),e.preventDefault(),e.stopPropagation()},e.prototype.onMouseclick=function(e,t){this.disabled||this.readonly||e.target.isSameNode(this.accessibleViewChild.nativeElement)||(this.onClick.emit(e),this.isOverlayClick(e)||(this.overlayVisible?this.hide():(t.focus(),this.show())))},e.prototype.isOverlayClick=function(e){return this.overlay&&this.overlay.contains(e.target)},e.prototype.isOutsideClicked=function(e){return!(this.el.nativeElement.isSameNode(e.target)||this.el.nativeElement.contains(e.target)||this.isOverlayClick(e))},e.prototype.onInputFocus=function(e){this.focus=!0,this.onFocus.emit({originalEvent:e})},e.prototype.onInputBlur=function(e){this.focus=!1,this.onBlur.emit({originalEvent:e}),this.preventModelTouched||this.onModelTouched(),this.preventModelTouched=!1},e.prototype.onOptionKeydown=function(e){if(!this.readonly)switch(e.originalEvent.which){case 40:var t=this.findNextItem(e.originalEvent.target.parentElement);t&&t.focus(),e.originalEvent.preventDefault();break;case 38:var i=this.findPrevItem(e.originalEvent.target.parentElement);i&&i.focus(),e.originalEvent.preventDefault();break;case 13:this.onOptionClick(e),e.originalEvent.preventDefault()}},e.prototype.findNextItem=function(e){var t=e.nextElementSibling;return t?l.DomHandler.hasClass(t.children[0],"p-disabled")||l.DomHandler.isHidden(t.children[0])?this.findNextItem(t):t.children[0]:null},e.prototype.findPrevItem=function(e){var t=e.previousElementSibling;return t?l.DomHandler.hasClass(t.children[0],"p-disabled")||l.DomHandler.isHidden(t.children[0])?this.findPrevItem(t):t.children[0]:null},e.prototype.onKeydown=function(e){switch(e.which){case 40:!this.overlayVisible&&e.altKey&&(this.show(),e.preventDefault());break;case 32:this.overlayVisible||(this.show(),e.preventDefault());break;case 27:this.hide()}},e.prototype.updateLabel=function(){if(this.value&&this.options&&this.value.length&&this.displaySelectedLabel){for(var e="",t=0;t0&&(e+=", "),e+=i)}if(this.value.length<=this.maxSelectedLabels)this.valuesAsString=e;else{var n=/{(.*?)}/;n.test(this.selectedItemsLabel)?this.valuesAsString=this.selectedItemsLabel.replace(this.selectedItemsLabel.match(n)[0],this.value.length+""):this.valuesAsString=this.selectedItemsLabel}}else this.valuesAsString=this.placeholder||this.defaultLabel},e.prototype.findLabelByValue=function(e){for(var t=null,i=0;i\n
\n \n
\n
\n
\n {{valuesAsString || \'empty\'}}\n \n
\n
\n
\n \n
\n
\n
\n \n \n
\n
\n \n
\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 \n ',animations:[i.trigger("overlayAnimation",[i.transition(":enter",[i.style({opacity:0,transform:"scaleY(0.8)"}),i.animate("{{showTransitionParams}}")]),i.transition(":leave",[i.animate("{{hideTransitionParams}}",i.style({opacity:0}))])])],host:{"[class.p-inputwrapper-filled]":"filled","[class.p-inputwrapper-focus]":"focus"},providers:[m],changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,styles:[".p-multiselect{-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-multiselect-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-multiselect-label-container{-ms-flex:1 1 auto;cursor:pointer;flex:1 1 auto;overflow:hidden}.p-multiselect-label{cursor:pointer;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.p-multiselect-label-empty{overflow:hidden;visibility:hidden}.p-multiselect .p-multiselect-panel{min-width:100%}.p-multiselect-panel{position:absolute}.p-multiselect-items-wrapper{overflow:auto}.p-multiselect-items{list-style-type:none;margin:0;padding:0}.p-multiselect-item{cursor:pointer;font-weight:400;overflow:hidden;position:relative;white-space:nowrap}.p-multiselect-header,.p-multiselect-item{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}.p-multiselect-header{-ms-flex-pack:justify;justify-content:space-between}.p-multiselect-filter-container{-ms-flex:1 1 auto;flex:1 1 auto;position:relative}.p-multiselect-filter-icon{margin-top:-.5rem;position:absolute;top:50%}.p-multiselect-filter-container .p-inputtext{width:100%}.p-multiselect-close{-ms-flex-align:center;-ms-flex-negative:0;-ms-flex-pack:center;align-items:center;flex-shrink:0;justify-content:center;overflow:hidden;position:relative}.p-fluid .p-multiselect,.p-multiselect-close{display:-ms-flexbox;display:flex}"]}]}],f.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:t.ChangeDetectorRef}]},f.propDecorators={scrollHeight:[{type:t.Input}],defaultLabel:[{type:t.Input}],placeholder:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],panelStyle:[{type:t.Input}],panelStyleClass:[{type:t.Input}],inputId:[{type:t.Input}],disabled:[{type:t.Input}],readonly:[{type:t.Input}],filter:[{type:t.Input}],filterPlaceHolder:[{type:t.Input}],filterLocale:[{type:t.Input}],overlayVisible:[{type:t.Input}],tabindex:[{type:t.Input}],appendTo:[{type:t.Input}],dataKey:[{type:t.Input}],name:[{type:t.Input}],ariaLabelledBy:[{type:t.Input}],displaySelectedLabel:[{type:t.Input}],maxSelectedLabels:[{type:t.Input}],selectionLimit:[{type:t.Input}],selectedItemsLabel:[{type:t.Input}],showToggleAll:[{type:t.Input}],emptyFilterMessage:[{type:t.Input}],resetFilterOnHide:[{type:t.Input}],dropdownIcon:[{type:t.Input}],optionLabel:[{type:t.Input}],showHeader:[{type:t.Input}],autoZIndex:[{type:t.Input}],baseZIndex:[{type:t.Input}],filterBy:[{type:t.Input}],virtualScroll:[{type:t.Input}],itemSize:[{type:t.Input}],showTransitionOptions:[{type:t.Input}],hideTransitionOptions:[{type:t.Input}],ariaFilterLabel:[{type:t.Input}],filterMatchMode:[{type:t.Input}],tooltip:[{type:t.Input}],tooltipPosition:[{type:t.Input}],tooltipPositionStyle:[{type:t.Input}],tooltipStyleClass:[{type:t.Input}],autofocusFilter:[{type:t.Input}],containerViewChild:[{type:t.ViewChild,args:["container"]}],filterInputChild:[{type:t.ViewChild,args:["filterInput"]}],accessibleViewChild:[{type:t.ViewChild,args:["in"]}],footerFacet:[{type:t.ContentChild,args:[s.Footer]}],headerFacet:[{type:t.ContentChild,args:[s.Header]}],templates:[{type:t.ContentChildren,args:[s.PrimeTemplate]}],onChange:[{type:t.Output}],onFocus:[{type:t.Output}],onBlur:[{type:t.Output}],onClick:[{type:t.Output}],onPanelShow:[{type:t.Output}],onPanelHide:[{type:t.Output}],options:[{type:t.Input}]};var v=function(){};v.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,s.SharedModule,r.ScrollingModule,p.TooltipModule,c.RippleModule],exports:[f,s.SharedModule,r.ScrollingModule],declarations:[f,y]}]}],e.MULTISELECT_VALUE_ACCESSOR=m,e.MultiSelect=f,e.MultiSelectItem=y,e.MultiSelectModule=v,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=primeng-multiselect.umd.min.js.map