UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Discord Chat](https://img.shields.io/discord/55794023

2 lines (1 loc) 20.4 kB
this.primevue=this.primevue||{},this.primevue.listbox=function(e,t,i,s,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t),a=o(s),r={name:"Listbox",emits:["update:modelValue","change","focus","blur","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:Boolean,dataKey:null,multiple:Boolean,metaKeySelection:Boolean,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},filterIcon:{type:String,default:"pi pi-search"},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",focusOnHover:!1,data(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||i.UniqueComponentId()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||i.UniqueComponentId(),this.autoUpdateModel()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?i.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?i.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,t){return(this.dataKey?i.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},isOptionDisabled(e){return!!this.optionDisabled&&i.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return i.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return i.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},onFirstHiddenFocus(){i.DomHandler.focus(this.list);const e=i.DomHandler.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");this.$refs.lastHiddenFocusableElement.tabIndex=i.ObjectUtils.isEmpty(e)?-1:void 0,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus(e){if(e.relatedTarget===this.list){const e=i.DomHandler.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");i.DomHandler.focus(e),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else i.DomHandler.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus(e){this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.$emit("focus",e)},onListBlur(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown(e){const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&"KeyA"===e.code&&t){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}!t&&i.ObjectUtils.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault())}},onOptionSelect(e,t,i=-1){this.disabled||this.isOptionDisabled(t)||(this.multiple?this.onOptionSelectMultiple(e,t):this.onOptionSelectSingle(e,t),this.optionTouched=!1,-1!==i&&(this.focusedOptionIndex=i))},onOptionMouseDown(e,t){this.changeFocusedOptionIndex(e,t)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOptionTouchEnd(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle(e,t){let i=this.isSelected(t),s=!1,n=null;if(!this.optionTouched&&this.metaKeySelection){let o=e.metaKey||e.ctrlKey;i?o&&(n=null,s=!0):(n=this.getOptionValue(t),s=!0)}else n=i?null:this.getOptionValue(t),s=!0;s&&this.updateModel(e,n)},onOptionSelectMultiple(e,t){let i=this.isSelected(t),s=null;if(!this.optionTouched&&this.metaKeySelection){let n=e.metaKey||e.ctrlKey;i?s=n?this.removeOption(t):[this.getOptionValue(t)]:(s=n&&this.modelValue||[],s=[...s,this.getOptionValue(t)])}else s=i?this.removeOption(t):[...this.modelValue||[],this.getOptionValue(t)];this.updateModel(e,s)},onOptionSelectRange(e,t=-1,i=-1){if(-1===t&&(t=this.findNearestSelectedOptionIndex(i,!0)),-1===i&&(i=this.findNearestSelectedOptionIndex(t)),-1!==t&&-1!==i){const s=Math.min(t,i),n=Math.max(t,i),o=this.visibleOptions.slice(s,n+1).filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,o)}},onFilterChange(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":this.onEnterKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e)}},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowUpKey(e){const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),e.preventDefault()},onArrowLeftKey(e,t=!1){t&&(this.focusedOptionIndex=-1)},onHomeKey(e,t=!1){if(t)e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{let t=e.metaKey||e.ctrlKey,i=this.findFirstOptionIndex();this.multiple&&e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onEndKey(e,t=!1){if(t){const t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{let t=e.metaKey||e.ctrlKey,i=this.findLastOptionIndex();this.multiple&&e.shiftKey&&t&&this.onOptionSelectRange(e,this.startRangeIndex,i),this.changeFocusedOptionIndex(e,i)}e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){-1!==this.focusedOptionIndex&&(this.multiple&&e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),e.preventDefault()},onSpaceKey(e){this.onEnterKey(e)},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(e){return e&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){const t=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((e=>i.ObjectUtils.equals(e,t,this.equalityKey))):i.ObjectUtils.equals(this.modelValue,t,this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return i.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?i.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e))):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?i.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidSelectedOption(e))):-1},findNextSelectedOptionIndex(e){const t=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidSelectedOption(e))):-1;return t>-1?t+e+1:-1},findPrevSelectedOptionIndex(e){const t=this.hasSelectedOption&&e>0?i.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidSelectedOption(e))):-1;return t>-1?t:-1},findNearestSelectedOptionIndex(e,t=!1){let i=-1;return this.hasSelectedOption&&(t?(i=this.findPrevSelectedOptionIndex(e),i=-1===i?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=-1===i?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex(){const e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1;-1!==this.focusedOptionIndex?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1===i&&-1===this.focusedOptionIndex&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500)},removeOption(e){return this.modelValue.filter((t=>!i.ObjectUtils.equals(t,this.getOptionValue(e),this.equalityKey)))},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(e,this.visibleOptions[t]))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,s=i.DomHandler.findSingle(this.list,`li[id="${t}"]`);s?s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions(e){return(e||[]).reduce(((e,t,i)=>{e.push({optionGroup:t,group:!0,index:i});const s=this.getOptionGroupChildren(t);return s&&s.forEach((t=>e.push(t))),e}),[])},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-listbox p-component",{"p-focus":this.focused,"p-disabled":this.disabled}]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?e.FilterService.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption(){return i.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return i.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:l.default},components:{VirtualScroller:a.default}};const d=["id"],p=["tabindex"],c={key:0,class:"p-listbox-header"},u={class:"p-listbox-filter-container"},h=["placeholder","aria-owns","aria-activedescendant","tabindex"],f={role:"status","aria-live":"polite",class:"p-hidden-accessible"},O=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],m=["id"],b=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove"],x={key:0,class:"p-listbox-empty-message",role:"option"},g={key:1,class:"p-listbox-empty-message",role:"option"},y={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},I={role:"status","aria-live":"polite",class:"p-hidden-accessible"},S=["tabindex"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-listbox-list-wrapper {\n overflow: auto;\n}\n.p-listbox-list {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n.p-listbox-item {\n cursor: pointer;\n position: relative;\n overflow: hidden;\n}\n.p-listbox-item-group {\n cursor: auto;\n}\n.p-listbox-filter-container {\n position: relative;\n}\n.p-listbox-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n.p-listbox-filter {\n width: 100%;\n}\n"),r.render=function(e,t,i,s,o,l){const a=n.resolveComponent("VirtualScroller"),r=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("div",{id:o.id,class:n.normalizeClass(l.containerClass),onFocusout:t[10]||(t[10]=(...e)=>l.onFocusout&&l.onFocusout(...e))},[n.createElementVNode("span",{ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:i.disabled?-1:i.tabindex,onFocus:t[0]||(t[0]=(...e)=>l.onFirstHiddenFocus&&l.onFirstHiddenFocus(...e))},null,40,p),n.renderSlot(e.$slots,"header",{value:i.modelValue,options:l.visibleOptions}),i.filter?(n.openBlock(),n.createElementBlock("div",c,[n.createElementVNode("div",u,[n.withDirectives(n.createElementVNode("input",n.mergeProps({ref:"filterInput","onUpdate:modelValue":t[1]||(t[1]=e=>o.filterValue=e),type:"text",class:"p-listbox-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":l.focusedOptionId,tabindex:i.disabled||o.focused?-1:i.tabindex,onInput:t[2]||(t[2]=(...e)=>l.onFilterChange&&l.onFilterChange(...e)),onBlur:t[3]||(t[3]=(...e)=>l.onFilterBlur&&l.onFilterBlur(...e)),onKeydown:t[4]||(t[4]=(...e)=>l.onFilterKeyDown&&l.onFilterKeyDown(...e))},i.filterInputProps),null,16,h),[[n.vModelText,o.filterValue]]),n.createElementVNode("span",{class:n.normalizeClass(["p-listbox-filter-icon",i.filterIcon])},null,2)]),n.createElementVNode("span",f,n.toDisplayString(l.filterResultMessageText),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",{ref:"listWrapper",class:"p-listbox-list-wrapper",style:n.normalizeStyle(i.listStyle)},[n.createVNode(a,n.mergeProps({ref:l.virtualScrollerRef},i.virtualScrollerOptions,{style:i.listStyle,items:l.visibleOptions,tabindex:-1,disabled:l.virtualScrollerDisabled}),n.createSlots({content:n.withCtx((({styleClass:s,contentRef:a,items:d,getItemOptions:p,contentStyle:c,itemSize:u})=>[n.createElementVNode("ul",{ref:e=>l.listRef(e,a),id:o.id+"_list",class:n.normalizeClass(["p-listbox-list",s]),style:n.normalizeStyle(c),tabindex:-1,role:"listbox","aria-multiselectable":i.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":o.focused?l.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[6]||(t[6]=(...e)=>l.onListFocus&&l.onListFocus(...e)),onBlur:t[7]||(t[7]=(...e)=>l.onListBlur&&l.onListBlur(...e)),onKeydown:t[8]||(t[8]=(...e)=>l.onListKeyDown&&l.onListKeyDown(...e))},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d,((i,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:l.getOptionRenderKey(i,l.getOptionIndex(s,p))},[l.isOptionGroup(i)?(n.openBlock(),n.createElementBlock("li",{key:0,id:o.id+"_"+l.getOptionIndex(s,p),style:n.normalizeStyle({height:u?u+"px":void 0}),class:"p-listbox-item-group",role:"option"},[n.renderSlot(e.$slots,"optiongroup",{option:i.optionGroup,index:l.getOptionIndex(s,p)},(()=>[n.createTextVNode(n.toDisplayString(l.getOptionGroupLabel(i.optionGroup)),1)]))],12,m)):n.withDirectives((n.openBlock(),n.createElementBlock("li",{key:1,id:o.id+"_"+l.getOptionIndex(s,p),style:n.normalizeStyle({height:u?u+"px":void 0}),class:n.normalizeClass(["p-listbox-item",{"p-highlight":l.isSelected(i),"p-focus":o.focusedOptionIndex===l.getOptionIndex(s,p),"p-disabled":l.isOptionDisabled(i)}]),role:"option","aria-label":l.getOptionLabel(i),"aria-selected":l.isSelected(i),"aria-disabled":l.isOptionDisabled(i),"aria-setsize":l.ariaSetSize,"aria-posinset":l.getAriaPosInset(l.getOptionIndex(s,p)),onClick:e=>l.onOptionSelect(e,i,l.getOptionIndex(s,p)),onMousedown:e=>l.onOptionMouseDown(e,l.getOptionIndex(s,p)),onMousemove:e=>l.onOptionMouseMove(e,l.getOptionIndex(s,p)),onTouchend:t[5]||(t[5]=e=>l.onOptionTouchEnd())},[n.renderSlot(e.$slots,"option",{option:i,index:l.getOptionIndex(s,p)},(()=>[n.createTextVNode(n.toDisplayString(l.getOptionLabel(i)),1)]))],46,b)),[[r]])],64)))),128)),o.filterValue&&(!d||d&&0===d.length)?(n.openBlock(),n.createElementBlock("li",x,[n.renderSlot(e.$slots,"emptyfilter",{},(()=>[n.createTextVNode(n.toDisplayString(l.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(n.openBlock(),n.createElementBlock("li",g,[n.renderSlot(e.$slots,"empty",{},(()=>[n.createTextVNode(n.toDisplayString(l.emptyMessageText),1)]))])):n.createCommentVNode("",!0)],46,O)])),_:2},[e.$slots.loader?{name:"loader",fn:n.withCtx((({options:t})=>[n.renderSlot(e.$slots,"loader",{options:t})])),key:"0"}:void 0]),1040,["style","items","disabled"])],4),n.renderSlot(e.$slots,"footer",{value:i.modelValue,options:l.visibleOptions}),!i.options||i.options&&0===i.options.length?(n.openBlock(),n.createElementBlock("span",y,n.toDisplayString(l.emptyMessageText),1)):n.createCommentVNode("",!0),n.createElementVNode("span",I,n.toDisplayString(l.selectedMessageText),1),n.createElementVNode("span",{ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:i.disabled?-1:i.tabindex,onFocus:t[9]||(t[9]=(...e)=>l.onLastHiddenFocus&&l.onLastHiddenFocus(...e))},null,40,S)],42,d)},r}(primevue.api,primevue.ripple,primevue.utils,primevue.virtualscroller,Vue);