primevue
Version:
PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBloc
2 lines (1 loc) • 24.9 kB
JavaScript
"use strict";var e=require("primevue/api"),t=require("primevue/icons/search"),i=require("primevue/ripple"),n=require("primevue/utils"),o=require("primevue/virtualscroller"),s=require("primevue/basecomponent"),r=require("primevue/listbox/style"),l=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(t),u=a(i),d=a(o);function p(e){return m(e)||O(e)||f(e)||h()}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?b(e,t):void 0}}function O(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var g={name:"Listbox",extends:{name:"BaseListbox",extends:a(s).default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:{type:Boolean,default:!1},dataKey:null,multiple:{type:Boolean,default:!1},metaKeySelection:{type:Boolean,default:!1},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:void 0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:a(r).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","filter"],list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",focusOnHover:!1,data:function(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||n.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||n.UniqueComponentId(),this.autoUpdateModel()},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?n.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?n.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,t){return(this.dataKey?n.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+t},getPTOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&n.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return n.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},onFirstHiddenFocus:function(){n.DomHandler.focus(this.list);var e=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');this.$refs.lastHiddenFocusableElement.tabIndex=n.DomHandler.isElement(e)?void 0:-1,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus:function(e){if(e.relatedTarget===this.list){var t=n.DomHandler.getFirstFocusableElement(this.$el,':not([data-p-hidden-focusable="true"])');n.DomHandler.focus(t),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else n.DomHandler.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout:function(e){!this.$el.contains(e.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus:function(e){this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.autoUpdateModel(),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",e)},onListKeyDown:function(e){var t=this,i=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"NumpadEnter":case"Space":this.onSpaceKey(e);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(this.multiple&&"KeyA"===e.code&&i){var o=this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,o),e.preventDefault();break}!i&&n.ObjectUtils.isPrintableCharacter(e.key)&&(this.searchOptions(e,e.key),e.preventDefault())}},onOptionSelect:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-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:function(e,t){this.changeFocusedOptionIndex(e,t)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOptionTouchEnd:function(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle:function(e,t){var i=this.isSelected(t),n=!1,o=null;!this.optionTouched&&this.metaKeySelection?i?e&&(e.metaKey||e.ctrlKey)&&(o=null,n=!0):(o=this.getOptionValue(t),n=!0):(o=i?null:this.getOptionValue(t),n=!0);n&&this.updateModel(e,o)},onOptionSelectMultiple:function(e,t){var i=this.isSelected(t),n=null;if(!this.optionTouched&&this.metaKeySelection){var o=e.metaKey||e.ctrlKey;n=i?o?this.removeOption(t):[this.getOptionValue(t)]:[].concat(p(n=o&&this.modelValue||[]),[this.getOptionValue(t)])}else n=i?this.removeOption(t):[].concat(p(this.modelValue||[]),[this.getOptionValue(t)]);this.updateModel(e,n)},onOptionSelectRange:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===i&&(i=this.findNearestSelectedOptionIndex(n,!0)),-1===n&&(n=this.findNearestSelectedOptionIndex(i)),-1!==i&&-1!==n){var o=Math.min(i,n),s=Math.max(i,n),r=this.visibleOptions.slice(o,s+1).filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,r)}},onFilterChange:function(e){this.$emit("filter",{originalEvent:e,value:e.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur:function(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown:function(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":case"NumpadEnter":this.onEnterKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e)}},onArrowDownKey:function(e){var 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:function(e){var 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:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])e.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{var 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:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(i,i),this.focusedOptionIndex=-1}else{var n=e.metaKey||e.ctrlKey,o=this.findLastOptionIndex();this.multiple&&e.shiftKey&&n&&this.onOptionSelectRange(e,this.startRangeIndex,o),this.changeFocusedOptionIndex(e,o)}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){-1!==this.focusedOptionIndex&&(this.multiple&&e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched:function(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption:function(e){return n.ObjectUtils.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){var t=this,i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((function(e){return n.ObjectUtils.equals(e,i,t.equalityKey)})):n.ObjectUtils.equals(this.modelValue,i,this.equalityKey)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?n.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidSelectedOption(t)})):-1},findNextSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e>0?n.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var t=-1;return this.hasSelectedOption&&(t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?-1===(t=this.findPrevSelectedOptionIndex(e))?this.findNextSelectedOptionIndex(e):t:-1===(t=this.findNextSelectedOptionIndex(e))?this.findPrevSelectedOptionIndex(e):t),t>-1?t:e},findFirstFocusedOptionIndex:function(){var e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1;-1===(n=-1!==this.focusedOptionIndex?-1===(n=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&-1===this.focusedOptionIndex&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500)},removeOption:function(e){var t=this;return this.modelValue.filter((function(i){return!n.ObjectUtils.equals(i,t.getOptionValue(e),t.equalityKey)}))},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(e,this.visibleOptions[t]))},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=n.DomHandler.findSingle(this.list,'li[id="'.concat(t,'"]'));i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&this.focused&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var 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:function(){return n.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},filterResultMessageText:function(){return n.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:u.default},components:{VirtualScroller:d.default,SearchIcon:c.default}};function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach((function(t){I(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function I(e,t,i){var n;return(t="symbol"==y(n=S(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function S(e,t){if("object"!=y(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var F=["id"],V=["tabindex"],M=["placeholder","aria-owns","aria-activedescendant","tabindex"],D=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],w=["id"],K=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"],L=["tabindex"];g.render=function(e,t,i,n,o,s){var r=l.resolveComponent("VirtualScroller"),a=l.resolveDirective("ripple");return l.openBlock(),l.createElementBlock("div",l.mergeProps({id:o.id,class:e.cx("root"),onFocusout:t[10]||(t[10]=function(){return s.onFocusout&&s.onFocusout.apply(s,arguments)})},e.ptm("root"),{"data-pc-name":"listbox"}),[l.createElementVNode("span",l.mergeProps({ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[0]||(t[0]=function(){return s.onFirstHiddenFocus&&s.onFirstHiddenFocus.apply(s,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,V),l.renderSlot(e.$slots,"header",{value:e.modelValue,options:s.visibleOptions}),e.filter?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,class:e.cx("header")},e.ptm("header")),[l.createElementVNode("div",l.mergeProps({class:e.cx("filterContainer")},e.ptm("filterContainer")),[l.withDirectives(l.createElementVNode("input",l.mergeProps({ref:"filterInput","onUpdate:modelValue":t[1]||(t[1]=function(e){return o.filterValue=e}),type:"text",class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:e.disabled||o.focused?-1:e.tabindex,onInput:t[2]||(t[2]=function(){return s.onFilterChange&&s.onFilterChange.apply(s,arguments)}),onBlur:t[3]||(t[3]=function(){return s.onFilterBlur&&s.onFilterBlur.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onFilterKeyDown&&s.onFilterKeyDown.apply(s,arguments)})},x(x({},e.filterInputProps),e.ptm("filterInput"))),null,16,M),[[l.vModelText,o.filterValue]]),l.renderSlot(e.$slots,"filtericon",{class:l.normalizeClass(e.cx("filterIcon"))},(function(){return[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.filterIcon?"span":"SearchIcon"),l.mergeProps({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16),l.createElementVNode("span",l.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.filterResultMessageText),17)],16)):l.createCommentVNode("",!0),l.createElementVNode("div",l.mergeProps({ref:"listWrapper",class:e.cx("wrapper"),style:e.listStyle},e.ptm("wrapper")),[l.createVNode(r,l.mergeProps({ref:s.virtualScrollerRef},e.virtualScrollerOptions,{style:e.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),l.createSlots({content:l.withCtx((function(i){var n=i.styleClass,r=i.contentRef,c=i.items,u=i.getItemOptions,d=i.contentStyle,p=i.itemSize;return[l.createElementVNode("ul",l.mergeProps({ref:function(e){return s.listRef(e,r)},id:o.id+"_list",class:[e.cx("list"),n],style:d,tabindex:-1,role:"listbox","aria-multiselectable":e.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":o.focused?s.focusedOptionId:void 0,"aria-disabled":e.disabled,onFocus:t[6]||(t[6]=function(){return s.onListFocus&&s.onListFocus.apply(s,arguments)}),onBlur:t[7]||(t[7]=function(){return s.onListBlur&&s.onListBlur.apply(s,arguments)}),onKeydown:t[8]||(t[8]=function(){return s.onListKeyDown&&s.onListKeyDown.apply(s,arguments)})},e.ptm("list")),[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c,(function(i,n){return l.openBlock(),l.createElementBlock(l.Fragment,{key:s.getOptionRenderKey(i,s.getOptionIndex(n,u))},[s.isOptionGroup(i)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[l.renderSlot(e.$slots,"optiongroup",{option:i.optionGroup,index:s.getOptionIndex(n,u)},(function(){return[l.createTextVNode(l.toDisplayString(s.getOptionGroupLabel(i.optionGroup)),1)]}))],16,w)):l.withDirectives((l.openBlock(),l.createElementBlock("li",l.mergeProps({key:1,id:o.id+"_"+s.getOptionIndex(n,u),style:{height:p?p+"px":void 0},class:e.cx("item",{option:i,index:n,getItemOptions:u}),role:"option","aria-label":s.getOptionLabel(i),"aria-selected":s.isSelected(i),"aria-disabled":s.isOptionDisabled(i),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(n,u)),onClick:function(e){return s.onOptionSelect(e,i,s.getOptionIndex(n,u))},onMousedown:function(e){return s.onOptionMouseDown(e,s.getOptionIndex(n,u))},onMousemove:function(e){return s.onOptionMouseMove(e,s.getOptionIndex(n,u))},onTouchend:t[5]||(t[5]=function(e){return s.onOptionTouchEnd()})},s.getPTOptions(i,u,n,"item"),{"data-p-highlight":s.isSelected(i),"data-p-focused":o.focusedOptionIndex===s.getOptionIndex(n,u),"data-p-disabled":s.isOptionDisabled(i)}),[l.renderSlot(e.$slots,"option",{option:i,index:s.getOptionIndex(n,u)},(function(){return[l.createTextVNode(l.toDisplayString(s.getOptionLabel(i)),1)]}))],16,K)),[[a]])],64)})),128)),o.filterValue&&(!c||c&&0===c.length)?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[l.renderSlot(e.$slots,"emptyfilter",{},(function(){return[l.createTextVNode(l.toDisplayString(s.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(l.openBlock(),l.createElementBlock("li",l.mergeProps({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[l.renderSlot(e.$slots,"empty",{},(function(){return[l.createTextVNode(l.toDisplayString(s.emptyMessageText),1)]}))],16)):l.createCommentVNode("",!0)],16,D)]})),_:2},[e.$slots.loader?{name:"loader",fn:l.withCtx((function(t){return[l.renderSlot(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["style","items","disabled","pt"])],16),l.renderSlot(e.$slots,"footer",{value:e.modelValue,options:s.visibleOptions}),!e.options||e.options&&0===e.options.length?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.emptyMessageText),17)):l.createCommentVNode("",!0),l.createElementVNode("span",l.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),l.toDisplayString(s.selectedMessageText),17),l.createElementVNode("span",l.mergeProps({ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:e.disabled?-1:e.tabindex,onFocus:t[9]||(t[9]=function(){return s.onLastHiddenFocus&&s.onLastHiddenFocus.apply(s,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16,L)],16,F)},module.exports=g;