primevue 3.16.0 → 3.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/autocomplete/AutoComplete.vue +16 -13
  2. package/autocomplete/autocomplete.cjs.js +16 -13
  3. package/autocomplete/autocomplete.cjs.min.js +1 -1
  4. package/autocomplete/autocomplete.esm.js +16 -13
  5. package/autocomplete/autocomplete.esm.min.js +1 -1
  6. package/autocomplete/autocomplete.js +16 -13
  7. package/autocomplete/autocomplete.min.js +1 -1
  8. package/cascadeselect/CascadeSelect.vue +5 -5
  9. package/cascadeselect/cascadeselect.cjs.js +5 -5
  10. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  11. package/cascadeselect/cascadeselect.esm.js +5 -5
  12. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  13. package/cascadeselect/cascadeselect.js +5 -5
  14. package/cascadeselect/cascadeselect.min.js +1 -1
  15. package/config/PrimeVue.d.ts +35 -0
  16. package/core/core.js +15 -10
  17. package/core/core.min.js +5 -8
  18. package/dropdown/Dropdown.d.ts +1 -1
  19. package/dropdown/Dropdown.vue +5 -5
  20. package/dropdown/dropdown.cjs.js +5 -5
  21. package/dropdown/dropdown.cjs.min.js +1 -1
  22. package/dropdown/dropdown.esm.js +5 -5
  23. package/dropdown/dropdown.esm.min.js +1 -1
  24. package/dropdown/dropdown.js +5 -5
  25. package/dropdown/dropdown.min.js +1 -1
  26. package/editor/Editor.d.ts +1 -1
  27. package/inputnumber/InputNumber.vue +1 -1
  28. package/inputnumber/inputnumber.cjs.js +1 -1
  29. package/inputnumber/inputnumber.cjs.min.js +1 -1
  30. package/inputnumber/inputnumber.esm.js +1 -1
  31. package/inputnumber/inputnumber.esm.min.js +1 -1
  32. package/inputnumber/inputnumber.js +1 -1
  33. package/inputnumber/inputnumber.min.js +1 -1
  34. package/listbox/Listbox.vue +5 -5
  35. package/listbox/listbox.cjs.js +5 -5
  36. package/listbox/listbox.cjs.min.js +1 -1
  37. package/listbox/listbox.esm.js +5 -5
  38. package/listbox/listbox.esm.min.js +1 -1
  39. package/listbox/listbox.js +5 -5
  40. package/listbox/listbox.min.js +1 -1
  41. package/multiselect/MultiSelect.d.ts +1 -1
  42. package/multiselect/MultiSelect.vue +12 -6
  43. package/multiselect/multiselect.cjs.js +13 -7
  44. package/multiselect/multiselect.cjs.min.js +1 -1
  45. package/multiselect/multiselect.esm.js +13 -7
  46. package/multiselect/multiselect.esm.min.js +1 -1
  47. package/multiselect/multiselect.js +13 -7
  48. package/multiselect/multiselect.min.js +1 -1
  49. package/package.json +2 -2
  50. package/portal/Portal.vue +13 -6
  51. package/portal/portal.cjs.js +9 -4
  52. package/portal/portal.cjs.min.js +1 -1
  53. package/portal/portal.esm.js +9 -4
  54. package/portal/portal.esm.min.js +1 -1
  55. package/portal/portal.js +9 -4
  56. package/portal/portal.min.js +1 -1
  57. package/web-types.json +1 -1
@@ -1 +1 @@
1
- import{UniqueComponentId as e,ObjectUtils as t,DomHandler as i}from"primevue/utils";import{FilterService as s}from"primevue/api";import n from"primevue/ripple";import o from"primevue/virtualscroller";import{resolveComponent as l,resolveDirective as a,openBlock as r,createElementBlock as d,normalizeClass as p,createElementVNode as h,renderSlot as u,withDirectives as c,mergeProps as f,vModelText as O,toDisplayString as b,createCommentVNode as x,normalizeStyle as g,createVNode as m,createSlots as y,withCtx as I,Fragment as v,renderList as S,createTextVNode as F}from"vue";var K={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},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},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:"",selectOnFocus:!1,focusOnHover:!1,data:()=>({id:e(),filterValue:null,focused:!1,focusedOptionIndex:-1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id,this.autoUpdateModel()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?t.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?t.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,i){return(this.dataKey?t.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+i},isOptionDisabled(e){return!!this.optionDisabled&&t.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return t.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return t.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},onFirstHiddenFocus(){this.list.focus();const e=i.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");this.$refs.lastHiddenFocusableElement.tabIndex=t.isEmpty(e)?-1:void 0,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus(e){if(e.relatedTarget===this.list){const e=i.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");e&&e.focus(),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else this.$refs.firstHiddenFocusableElement.focus();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=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){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("KeyA"===e.code&&this.multiple&&(e.metaKey||e.ctrlKey)){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}t.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))},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 i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((e=>t.equals(e,i,this.equalityKey))):t.equals(this.modelValue,i,this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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?this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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((i=>!t.equals(i,this.getOptionValue(e),this.equalityKey)))},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.updateModel(e,this.getOptionValue(this.visibleOptions[t])))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,s=i.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(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,this.multiple?[e]:e)}},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 e=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?s.filter(e,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):e},hasSelectedOption(){return t.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return t.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:n},components:{VirtualScroller:o}};const V=["id"],M=["tabindex"],L={key:0,class:"p-listbox-header"},w={class:"p-listbox-filter-container"},D=["placeholder","aria-owns","aria-activedescendant","tabindex"],T=h("span",{class:"p-listbox-filter-icon pi pi-search"},null,-1),$={role:"status","aria-live":"polite",class:"p-hidden-accessible"},E=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],R=["id"],k=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],H={key:0,class:"p-listbox-empty-message",role:"option"},A={key:1,class:"p-listbox-empty-message",role:"option"},G={key:0,role:"status","aria-live":"polite",class:"p-hidden-accessible"},C={role:"status","aria-live":"polite",class:"p-hidden-accessible"},P=["tabindex"];!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: -.5rem;\n}\n.p-listbox-filter {\n width: 100%;\n}\n"),K.render=function(e,t,i,s,n,o){const K=l("VirtualScroller"),B=a("ripple");return r(),d("div",{id:n.id,class:p(o.containerClass),onFocusout:t[10]||(t[10]=(...e)=>o.onFocusout&&o.onFocusout(...e))},[h("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)=>o.onFirstHiddenFocus&&o.onFirstHiddenFocus(...e))},null,40,M),u(e.$slots,"header",{value:i.modelValue,options:o.visibleOptions}),i.filter?(r(),d("div",L,[h("div",w,[c(h("input",f({ref:"filterInput",type:"text",class:"p-listbox-filter p-inputtext p-component","onUpdate:modelValue":t[1]||(t[1]=e=>n.filterValue=e),placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":n.id+"_list","aria-activedescendant":o.focusedOptionId,tabindex:i.disabled||n.focused?-1:i.tabindex,onInput:t[2]||(t[2]=(...e)=>o.onFilterChange&&o.onFilterChange(...e)),onBlur:t[3]||(t[3]=(...e)=>o.onFilterBlur&&o.onFilterBlur(...e)),onKeydown:t[4]||(t[4]=(...e)=>o.onFilterKeyDown&&o.onFilterKeyDown(...e))},i.filterInputProps),null,16,D),[[O,n.filterValue]]),T]),h("span",$,b(o.filterResultMessageText),1)])):x("",!0),h("div",{ref:"listWrapper",class:"p-listbox-list-wrapper",style:g(i.listStyle)},[m(K,f({ref:o.virtualScrollerRef},i.virtualScrollerOptions,{style:i.listStyle,items:o.visibleOptions,tabindex:-1,disabled:o.virtualScrollerDisabled}),y({content:I((({styleClass:s,contentRef:l,items:a,getItemOptions:f,contentStyle:O,itemSize:m})=>[h("ul",{ref:e=>o.listRef(e,l),id:n.id+"_list",class:p(["p-listbox-list",s]),style:g(O),tabindex:-1,role:"listbox","aria-multiselectable":i.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":n.focused?o.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[6]||(t[6]=(...e)=>o.onListFocus&&o.onListFocus(...e)),onBlur:t[7]||(t[7]=(...e)=>o.onListBlur&&o.onListBlur(...e)),onKeydown:t[8]||(t[8]=(...e)=>o.onListKeyDown&&o.onListKeyDown(...e))},[(r(!0),d(v,null,S(a,((i,s)=>(r(),d(v,{key:o.getOptionRenderKey(i,o.getOptionIndex(s,f))},[o.isOptionGroup(i)?(r(),d("li",{key:0,id:n.id+"_"+o.getOptionIndex(s,f),style:g({height:m?m+"px":void 0}),class:"p-listbox-item-group",role:"option"},[u(e.$slots,"optiongroup",{option:i.optionGroup,index:o.getOptionIndex(s,f)},(()=>[F(b(o.getOptionGroupLabel(i.optionGroup)),1)]))],12,R)):c((r(),d("li",{key:1,id:n.id+"_"+o.getOptionIndex(s,f),style:g({height:m?m+"px":void 0}),class:p(["p-listbox-item",{"p-highlight":o.isSelected(i),"p-focus":n.focusedOptionIndex===o.getOptionIndex(s,f),"p-disabled":o.isOptionDisabled(i)}]),role:"option","aria-label":o.getOptionLabel(i),"aria-selected":o.isSelected(i),"aria-disabled":o.isOptionDisabled(i),"aria-setsize":o.ariaSetSize,"aria-posinset":o.getAriaPosInset(o.getOptionIndex(s,f)),onClick:e=>o.onOptionSelect(e,i,o.getOptionIndex(s,f)),onMousemove:e=>o.onOptionMouseMove(e,o.getOptionIndex(s,f)),onTouchend:t[5]||(t[5]=e=>o.onOptionTouchEnd())},[u(e.$slots,"option",{option:i,index:o.getOptionIndex(s,f)},(()=>[F(b(o.getOptionLabel(i)),1)]))],46,k)),[[B]])],64)))),128)),n.filterValue&&(!a||a&&0===a.length)?(r(),d("li",H,[u(e.$slots,"emptyfilter",{},(()=>[F(b(o.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(r(),d("li",A,[u(e.$slots,"empty",{},(()=>[F(b(o.emptyMessageText),1)]))])):x("",!0)],46,E),!i.options||i.options&&0===i.options.length?(r(),d("span",G,b(o.emptyMessageText),1)):x("",!0),h("span",C,b(o.selectedMessageText),1)])),_:2},[e.$slots.loader?{name:"loader",fn:I((({options:t})=>[u(e.$slots,"loader",{options:t})]))}:void 0]),1040,["style","items","disabled"])],4),u(e.$slots,"footer",{value:i.modelValue,options:o.visibleOptions}),h("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)=>o.onLastHiddenFocus&&o.onLastHiddenFocus(...e))},null,40,P)],42,V)};export{K as default};
1
+ import{UniqueComponentId as e,ObjectUtils as t,DomHandler as i}from"primevue/utils";import{FilterService as s}from"primevue/api";import n from"primevue/ripple";import o from"primevue/virtualscroller";import{resolveComponent as l,resolveDirective as a,openBlock as r,createElementBlock as d,normalizeClass as p,createElementVNode as h,renderSlot as u,withDirectives as c,mergeProps as f,vModelText as O,toDisplayString as b,createCommentVNode as x,normalizeStyle as g,createVNode as m,createSlots as y,withCtx as I,Fragment as v,renderList as S,createTextVNode as F}from"vue";var K={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},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},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:"",selectOnFocus:!1,focusOnHover:!1,data:()=>({id:e(),filterValue:null,focused:!1,focusedOptionIndex:-1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id,this.autoUpdateModel()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(e){return this.optionLabel?t.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?t.resolveFieldData(e,this.optionValue):e},getOptionRenderKey(e,i){return(this.dataKey?t.resolveFieldData(e,this.dataKey):this.getOptionLabel(e))+"_"+i},isOptionDisabled(e){return!!this.optionDisabled&&t.resolveFieldData(e,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(e){return t.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren(e){return t.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},onFirstHiddenFocus(){this.list.focus();const e=i.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");this.$refs.lastHiddenFocusableElement.tabIndex=t.isEmpty(e)?-1:void 0,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus(e){if(e.relatedTarget===this.list){const e=i.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");e&&e.focus(),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else this.$refs.firstHiddenFocusableElement.focus();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=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){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("KeyA"===e.code&&this.multiple&&(e.metaKey||e.ctrlKey)){const t=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t),e.preventDefault();break}t.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))},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 i=this.getOptionValue(e);return this.multiple?(this.modelValue||[]).some((e=>t.equals(e,i,this.equalityKey))):t.equals(this.modelValue,i,this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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?this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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((i=>!t.equals(i,this.getOptionValue(e),this.equalityKey)))},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.updateModel(e,this.getOptionValue(this.visibleOptions[t])))},scrollInView(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,s=i.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(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,this.multiple?[e]:e)}},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 e=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?s.filter(e,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):e},hasSelectedOption(){return t.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return t.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:n},components:{VirtualScroller:o}};const V=["id"],M=["tabindex"],L={key:0,class:"p-listbox-header"},w={class:"p-listbox-filter-container"},D=["placeholder","aria-owns","aria-activedescendant","tabindex"],T=h("span",{class:"p-listbox-filter-icon pi pi-search"},null,-1),$={role:"status","aria-live":"polite",class:"p-hidden-accessible"},E=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],R=["id"],k=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],H={key:0,class:"p-listbox-empty-message",role:"option"},A={key:1,class:"p-listbox-empty-message",role:"option"},G={key:0,role:"status","aria-live":"polite",class:"p-hidden-accessible"},C={role:"status","aria-live":"polite",class:"p-hidden-accessible"},P=["tabindex"];!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: -.5rem;\n}\n.p-listbox-filter {\n width: 100%;\n}\n"),K.render=function(e,t,i,s,n,o){const K=l("VirtualScroller"),B=a("ripple");return r(),d("div",{id:n.id,class:p(o.containerClass),onFocusout:t[10]||(t[10]=(...e)=>o.onFocusout&&o.onFocusout(...e))},[h("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)=>o.onFirstHiddenFocus&&o.onFirstHiddenFocus(...e))},null,40,M),u(e.$slots,"header",{value:i.modelValue,options:o.visibleOptions}),i.filter?(r(),d("div",L,[h("div",w,[c(h("input",f({ref:"filterInput",type:"text",class:"p-listbox-filter p-inputtext p-component","onUpdate:modelValue":t[1]||(t[1]=e=>n.filterValue=e),placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":n.id+"_list","aria-activedescendant":o.focusedOptionId,tabindex:i.disabled||n.focused?-1:i.tabindex,onInput:t[2]||(t[2]=(...e)=>o.onFilterChange&&o.onFilterChange(...e)),onBlur:t[3]||(t[3]=(...e)=>o.onFilterBlur&&o.onFilterBlur(...e)),onKeydown:t[4]||(t[4]=(...e)=>o.onFilterKeyDown&&o.onFilterKeyDown(...e))},i.filterInputProps),null,16,D),[[O,n.filterValue]]),T]),h("span",$,b(o.filterResultMessageText),1)])):x("",!0),h("div",{ref:"listWrapper",class:"p-listbox-list-wrapper",style:g(i.listStyle)},[m(K,f({ref:o.virtualScrollerRef},i.virtualScrollerOptions,{style:i.listStyle,items:o.visibleOptions,tabindex:-1,disabled:o.virtualScrollerDisabled}),y({content:I((({styleClass:s,contentRef:l,items:a,getItemOptions:f,contentStyle:O,itemSize:m})=>[h("ul",{ref:e=>o.listRef(e,l),id:n.id+"_list",class:p(["p-listbox-list",s]),style:g(O),tabindex:-1,role:"listbox","aria-multiselectable":i.multiple,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":n.focused?o.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:t[6]||(t[6]=(...e)=>o.onListFocus&&o.onListFocus(...e)),onBlur:t[7]||(t[7]=(...e)=>o.onListBlur&&o.onListBlur(...e)),onKeydown:t[8]||(t[8]=(...e)=>o.onListKeyDown&&o.onListKeyDown(...e))},[(r(!0),d(v,null,S(a,((i,s)=>(r(),d(v,{key:o.getOptionRenderKey(i,o.getOptionIndex(s,f))},[o.isOptionGroup(i)?(r(),d("li",{key:0,id:n.id+"_"+o.getOptionIndex(s,f),style:g({height:m?m+"px":void 0}),class:"p-listbox-item-group",role:"option"},[u(e.$slots,"optiongroup",{option:i.optionGroup,index:o.getOptionIndex(s,f)},(()=>[F(b(o.getOptionGroupLabel(i.optionGroup)),1)]))],12,R)):c((r(),d("li",{key:1,id:n.id+"_"+o.getOptionIndex(s,f),style:g({height:m?m+"px":void 0}),class:p(["p-listbox-item",{"p-highlight":o.isSelected(i),"p-focus":n.focusedOptionIndex===o.getOptionIndex(s,f),"p-disabled":o.isOptionDisabled(i)}]),role:"option","aria-label":o.getOptionLabel(i),"aria-selected":o.isSelected(i),"aria-disabled":o.isOptionDisabled(i),"aria-setsize":o.ariaSetSize,"aria-posinset":o.getAriaPosInset(o.getOptionIndex(s,f)),onClick:e=>o.onOptionSelect(e,i,o.getOptionIndex(s,f)),onMousemove:e=>o.onOptionMouseMove(e,o.getOptionIndex(s,f)),onTouchend:t[5]||(t[5]=e=>o.onOptionTouchEnd())},[u(e.$slots,"option",{option:i,index:o.getOptionIndex(s,f)},(()=>[F(b(o.getOptionLabel(i)),1)]))],46,k)),[[B]])],64)))),128)),n.filterValue&&(!a||a&&0===a.length)?(r(),d("li",H,[u(e.$slots,"emptyfilter",{},(()=>[F(b(o.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(r(),d("li",A,[u(e.$slots,"empty",{},(()=>[F(b(o.emptyMessageText),1)]))])):x("",!0)],46,E),!i.options||i.options&&0===i.options.length?(r(),d("span",G,b(o.emptyMessageText),1)):x("",!0),h("span",C,b(o.selectedMessageText),1)])),_:2},[e.$slots.loader?{name:"loader",fn:I((({options:t})=>[u(e.$slots,"loader",{options:t})]))}:void 0]),1040,["style","items","disabled"])],4),u(e.$slots,"footer",{value:i.modelValue,options:o.visibleOptions}),h("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)=>o.onLastHiddenFocus&&o.onLastHiddenFocus(...e))},null,40,P)],42,V)};export{K as default};
@@ -608,19 +608,19 @@ this.primevue.listbox = (function (utils, api, Ripple, VirtualScroller, vue) {
608
608
  return utils.ObjectUtils.isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;
609
609
  },
610
610
  filterMessageText() {
611
- return this.filterMessage || this.$primevue.config.locale.searchMessage;
611
+ return this.filterMessage || this.$primevue.config.locale.searchMessage || '';
612
612
  },
613
613
  emptyFilterMessageText() {
614
- return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage;
614
+ return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';
615
615
  },
616
616
  emptyMessageText() {
617
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage;
617
+ return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';
618
618
  },
619
619
  selectionMessageText() {
620
- return this.selectionMessage || this.$primevue.config.locale.selectionMessage;
620
+ return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';
621
621
  },
622
622
  emptySelectionMessageText() {
623
- return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage;
623
+ return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';
624
624
  },
625
625
  selectedMessageText() {
626
626
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.multiple ? this.modelValue.length : '1') : this.emptySelectionMessageText;
@@ -1 +1 @@
1
- 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(i),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},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},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:"",selectOnFocus:!1,focusOnHover:!1,data:()=>({id:e.UniqueComponentId(),filterValue:null,focused:!1,focusedOptionIndex:-1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id,this.autoUpdateModel()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t,i){return(this.dataKey?e.ObjectUtils.resolveFieldData(t,this.dataKey):this.getOptionLabel(t))+"_"+i},isOptionDisabled(t){return!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},onFirstHiddenFocus(){this.list.focus();const t=e.DomHandler.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");this.$refs.lastHiddenFocusableElement.tabIndex=e.ObjectUtils.isEmpty(t)?-1:void 0,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus(t){if(t.relatedTarget===this.list){const t=e.DomHandler.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");t&&t.focus(),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else this.$refs.firstHiddenFocusableElement.focus();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=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(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onSpaceKey(t);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(t);break;default:if("KeyA"===t.code&&this.multiple&&(t.metaKey||t.ctrlKey)){const e=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(t,e),t.preventDefault();break}e.ObjectUtils.isPrintableCharacter(t.key)&&(this.searchOptions(t,t.key),t.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))},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(t){const i=this.getOptionValue(t);return this.multiple?(this.modelValue||[]).some((t=>e.ObjectUtils.equals(t,i,this.equalityKey))):e.ObjectUtils.equals(this.modelValue,i,this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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?this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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(t){return this.modelValue.filter((i=>!e.ObjectUtils.equals(i,this.getOptionValue(t),this.equalityKey)))},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.updateModel(e,this.getOptionValue(this.visibleOptions[t])))},scrollInView(t=-1){const i=-1!==t?`${this.id}_${t}`:this.focusedOptionId,s=e.DomHandler.findSingle(this.list,`li[id="${i}"]`);s?s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==t?t:this.focusedOptionIndex)},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,this.multiple?[e]:e)}},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 e=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?t.FilterService.filter(e,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):e},hasSelectedOption(){return e.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return e.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"},h={class:"p-listbox-filter-container"},u=["placeholder","aria-owns","aria-activedescendant","tabindex"],f=n.createElementVNode("span",{class:"p-listbox-filter-icon pi pi-search"},null,-1),O={role:"status","aria-live":"polite",class:"p-hidden-accessible"},b=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],m=["id"],x=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],g={key:0,class:"p-listbox-empty-message",role:"option"},y={key:1,class:"p-listbox-empty-message",role:"option"},v={key:0,role:"status","aria-live":"polite",class:"p-hidden-accessible"},S={role:"status","aria-live":"polite",class:"p-hidden-accessible"},I=["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: -.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",h,[n.withDirectives(n.createElementVNode("input",n.mergeProps({ref:"filterInput",type:"text",class:"p-listbox-filter p-inputtext p-component","onUpdate:modelValue":t[1]||(t[1]=e=>o.filterValue=e),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,u),[[n.vModelText,o.filterValue]]),f]),n.createElementVNode("span",O,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:h})=>[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:h?h+"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:h?h+"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)),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,x)),[[r]])],64)))),128)),o.filterValue&&(!d||d&&0===d.length)?(n.openBlock(),n.createElementBlock("li",g,[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",y,[n.renderSlot(e.$slots,"empty",{},(()=>[n.createTextVNode(n.toDisplayString(l.emptyMessageText),1)]))])):n.createCommentVNode("",!0)],46,b),!i.options||i.options&&0===i.options.length?(n.openBlock(),n.createElementBlock("span",v,n.toDisplayString(l.emptyMessageText),1)):n.createCommentVNode("",!0),n.createElementVNode("span",S,n.toDisplayString(l.selectedMessageText),1)])),_:2},[e.$slots.loader?{name:"loader",fn:n.withCtx((({options:t})=>[n.renderSlot(e.$slots,"loader",{options:t})]))}:void 0]),1040,["style","items","disabled"])],4),n.renderSlot(e.$slots,"footer",{value:i.modelValue,options:l.visibleOptions}),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,I)],42,d)},r}(primevue.utils,primevue.api,primevue.ripple,primevue.virtualscroller,Vue);
1
+ 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(i),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},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},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:"",selectOnFocus:!1,focusOnHover:!1,data:()=>({id:e.UniqueComponentId(),filterValue:null,focused:!1,focusedOptionIndex:-1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id,this.autoUpdateModel()},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t,i){return(this.dataKey?e.ObjectUtils.resolveFieldData(t,this.dataKey):this.getOptionLabel(t))+"_"+i},isOptionDisabled(t){return!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},onFirstHiddenFocus(){this.list.focus();const t=e.DomHandler.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");this.$refs.lastHiddenFocusableElement.tabIndex=e.ObjectUtils.isEmpty(t)?-1:void 0,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus(t){if(t.relatedTarget===this.list){const t=e.DomHandler.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");t&&t.focus(),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else this.$refs.firstHiddenFocusableElement.focus();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=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(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onSpaceKey(t);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(t);break;default:if("KeyA"===t.code&&this.multiple&&(t.metaKey||t.ctrlKey)){const e=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(t,e),t.preventDefault();break}e.ObjectUtils.isPrintableCharacter(t.key)&&(this.searchOptions(t,t.key),t.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))},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(t){const i=this.getOptionValue(t);return this.multiple?(this.modelValue||[]).some((t=>e.ObjectUtils.equals(t,i,this.equalityKey))):e.ObjectUtils.equals(this.modelValue,i,this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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?this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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(t){return this.modelValue.filter((i=>!e.ObjectUtils.equals(i,this.getOptionValue(t),this.equalityKey)))},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.updateModel(e,this.getOptionValue(this.visibleOptions[t])))},scrollInView(t=-1){const i=-1!==t?`${this.id}_${t}`:this.focusedOptionId,s=e.DomHandler.findSingle(this.list,`li[id="${i}"]`);s?s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==t?t:this.focusedOptionIndex)},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,this.multiple?[e]:e)}},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 e=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?t.FilterService.filter(e,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):e},hasSelectedOption(){return e.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return e.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"},h={class:"p-listbox-filter-container"},u=["placeholder","aria-owns","aria-activedescendant","tabindex"],f=n.createElementVNode("span",{class:"p-listbox-filter-icon pi pi-search"},null,-1),O={role:"status","aria-live":"polite",class:"p-hidden-accessible"},b=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],m=["id"],x=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],g={key:0,class:"p-listbox-empty-message",role:"option"},y={key:1,class:"p-listbox-empty-message",role:"option"},v={key:0,role:"status","aria-live":"polite",class:"p-hidden-accessible"},S={role:"status","aria-live":"polite",class:"p-hidden-accessible"},I=["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: -.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",h,[n.withDirectives(n.createElementVNode("input",n.mergeProps({ref:"filterInput",type:"text",class:"p-listbox-filter p-inputtext p-component","onUpdate:modelValue":t[1]||(t[1]=e=>o.filterValue=e),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,u),[[n.vModelText,o.filterValue]]),f]),n.createElementVNode("span",O,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:h})=>[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:h?h+"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:h?h+"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)),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,x)),[[r]])],64)))),128)),o.filterValue&&(!d||d&&0===d.length)?(n.openBlock(),n.createElementBlock("li",g,[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",y,[n.renderSlot(e.$slots,"empty",{},(()=>[n.createTextVNode(n.toDisplayString(l.emptyMessageText),1)]))])):n.createCommentVNode("",!0)],46,b),!i.options||i.options&&0===i.options.length?(n.openBlock(),n.createElementBlock("span",v,n.toDisplayString(l.emptyMessageText),1)):n.createCommentVNode("",!0),n.createElementVNode("span",S,n.toDisplayString(l.selectedMessageText),1)])),_:2},[e.$slots.loader?{name:"loader",fn:n.withCtx((({options:t})=>[n.renderSlot(e.$slots,"loader",{options:t})]))}:void 0]),1040,["style","items","disabled"])],4),n.renderSlot(e.$slots,"footer",{value:i.modelValue,options:l.visibleOptions}),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,I)],42,d)},r}(primevue.utils,primevue.api,primevue.ripple,primevue.virtualscroller,Vue);
@@ -49,7 +49,7 @@ export interface MultiSelectFilterEvent {
49
49
  value: string;
50
50
  }
51
51
 
52
- export interface MultiSelectProps extends HTMLDivElement {
52
+ export interface MultiSelectProps {
53
53
  /**
54
54
  * Value of the component.
55
55
  */
@@ -35,7 +35,7 @@
35
35
  <span ref="firstHiddenFocusableElementOnOverlay" role="presentation" aria-hidden="true" class="p-hidden-accessible p-hidden-focusable" :tabindex="0" @focus="onFirstHiddenFocus"></span>
36
36
  <slot name="header" :value="modelValue" :options="visibleOptions"></slot>
37
37
  <div v-if="(showToggleAll && selectionLimit == null) || filter" class="p-multiselect-header">
38
- <div v-if="showToggleAll && selectionLimit == null" class="p-checkbox p-component" @click="onToggleAll">
38
+ <div v-if="showToggleAll && selectionLimit == null" :class="headerCheckboxClass" @click="onToggleAll">
39
39
  <div class="p-hidden-accessible">
40
40
  <input type="checkbox" readonly :checked="allSelected" :aria-label="toggleAllAriaLabel" @focus="onHeaderCheckboxFocus" @blur="onHeaderCheckboxBlur">
41
41
  </div>
@@ -947,6 +947,12 @@ export default {
947
947
  'p-ripple-disabled': this.$primevue.config.ripple === false
948
948
  }];
949
949
  },
950
+ headerCheckboxClass() {
951
+ return ['p-checkbox p-component', {
952
+ 'p-checkbox-checked': this.allSelected,
953
+ 'p-checkbox-focused': this.headerCheckboxFocused
954
+ }];
955
+ },
950
956
  visibleOptions() {
951
957
  const options = this.optionGroupLabel ? this.flatOptions(this.options) : (this.options || []);
952
958
 
@@ -995,19 +1001,19 @@ export default {
995
1001
  return ObjectUtils.isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;
996
1002
  },
997
1003
  filterMessageText() {
998
- return this.filterMessage || this.$primevue.config.locale.searchMessage;
1004
+ return this.filterMessage || this.$primevue.config.locale.searchMessage || '';
999
1005
  },
1000
1006
  emptyFilterMessageText() {
1001
- return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage;
1007
+ return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';
1002
1008
  },
1003
1009
  emptyMessageText() {
1004
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage;
1010
+ return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';
1005
1011
  },
1006
1012
  selectionMessageText() {
1007
- return this.selectionMessage || this.$primevue.config.locale.selectionMessage;
1013
+ return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';
1008
1014
  },
1009
1015
  emptySelectionMessageText() {
1010
- return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage;
1016
+ return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';
1011
1017
  },
1012
1018
  selectedMessageText() {
1013
1019
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.modelValue.length) : this.emptySelectionMessageText;
@@ -843,6 +843,12 @@ var script = {
843
843
  'p-ripple-disabled': this.$primevue.config.ripple === false
844
844
  }];
845
845
  },
846
+ headerCheckboxClass() {
847
+ return ['p-checkbox p-component', {
848
+ 'p-checkbox-checked': this.allSelected,
849
+ 'p-checkbox-focused': this.headerCheckboxFocused
850
+ }];
851
+ },
846
852
  visibleOptions() {
847
853
  const options = this.optionGroupLabel ? this.flatOptions(this.options) : (this.options || []);
848
854
 
@@ -891,19 +897,19 @@ var script = {
891
897
  return utils.ObjectUtils.isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;
892
898
  },
893
899
  filterMessageText() {
894
- return this.filterMessage || this.$primevue.config.locale.searchMessage;
900
+ return this.filterMessage || this.$primevue.config.locale.searchMessage || '';
895
901
  },
896
902
  emptyFilterMessageText() {
897
- return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage;
903
+ return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';
898
904
  },
899
905
  emptyMessageText() {
900
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage;
906
+ return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';
901
907
  },
902
908
  selectionMessageText() {
903
- return this.selectionMessage || this.$primevue.config.locale.selectionMessage;
909
+ return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';
904
910
  },
905
911
  emptySelectionMessageText() {
906
- return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage;
912
+ return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';
907
913
  },
908
914
  selectedMessageText() {
909
915
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.modelValue.length) : this.emptySelectionMessageText;
@@ -1104,7 +1110,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1104
1110
  ($props.showToggleAll && $props.selectionLimit == null)
1105
1111
  ? (vue.openBlock(), vue.createElementBlock("div", {
1106
1112
  key: 0,
1107
- class: "p-checkbox p-component",
1113
+ class: vue.normalizeClass($options.headerCheckboxClass),
1108
1114
  onClick: _cache[6] || (_cache[6] = (...args) => ($options.onToggleAll && $options.onToggleAll(...args)))
1109
1115
  }, [
1110
1116
  vue.createElementVNode("div", _hoisted_8, [
@@ -1124,7 +1130,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1124
1130
  class: vue.normalizeClass(['p-checkbox-icon', {'pi pi-check': $options.allSelected}])
1125
1131
  }, null, 2)
1126
1132
  ], 2)
1127
- ]))
1133
+ ], 2))
1128
1134
  : vue.createCommentVNode("", true),
1129
1135
  ($props.filter)
1130
1136
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),i=require("primevue/api"),l=require("primevue/ripple"),s=require("primevue/virtualscroller"),n=require("primevue/portal"),o=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(t),c=a(l),d=a(s),p=a(n),h={name:"MultiSelect",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter","selectall-change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,inputId:String,inputProps:null,panelStyle:null,panelClass:null,panelProps:null,filterInputProps:null,closeButtonProps:null,dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},appendTo:{type:String,default:"body"},display:{type:String,default:"comma"},selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},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},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,startRangeIndex:-1,searchTimeout:null,searchValue:"",selectOnFocus:!1,focusOnHover:!1,data:()=>({id:e.UniqueComponentId(),focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id,this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t){return this.dataKey?e.ObjectUtils.resolveFieldData(t,this.dataKey):this.getOptionLabel(t)},isOptionDisabled(t){return!(!this.maxSelectionLimitReached||this.isSelected(t))||!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&this.$refs.focusInput.focus()},hide(e){this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&this.$refs.focusInput.focus()},onFocus(e){this.focused=!0,this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(t);break;default:if("KeyA"===t.code&&(t.metaKey||t.ctrlKey)){const e=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(t,e),t.preventDefault();break}e.ObjectUtils.isPrintableCharacter(t.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(t),t.preventDefault())}},onContainerClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus(t){if(t.relatedTarget===this.$refs.focusInput){const t=e.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)");t&&t.focus()}else this.$refs.focusInput.focus()},onLastHiddenFocus(){this.$refs.firstHiddenFocusableElementOnOverlay.focus()},onCloseClick(){this.hide(!0)},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onOptionSelect(t,i,l=-1,s=!1){if(this.disabled||this.isOptionDisabled(i))return;let n=null;n=this.isSelected(i)?this.modelValue.filter((t=>!e.ObjectUtils.equals(t,this.getOptionValue(i),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(i)],this.updateModel(t,n),s&&this.$refs.focusInput.focus(),-1!==l&&(this.focusedOptionIndex=l)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},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 l=Math.min(t,i),s=Math.max(t,i),n=this.visibleOptions.slice(l,s+1).filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,n)}},onFilterChange(e){const t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);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"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e,t=!1){if(e.altKey&&!t)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),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();e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show()}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();e.shiftKey&&t&&this.onOptionSelectRange(e,this.startRangeIndex,i),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show()}e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?-1!==this.focusedOptionIndex&&(e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e,t=!1){t||(this.overlayVisible&&this.hasFocusableElements()?(this.$refs.firstHiddenFocusableElementOnOverlay.focus(),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter(t){e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){"self"===this.appendTo?e.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(this.$el)+"px",e.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!e.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue(t){const i=this.visibleOptions.find((i=>!this.isOptionGroup(i)&&e.ObjectUtils.equals(this.getOptionValue(i),t,this.equalityKey)));return i?this.getOptionLabel(i):null},getSelectedItemsLabel(){let e=/{(.*?)}/;return e.test(this.selectedItemsLabel)?this.selectedItemsLabel.replace(this.selectedItemsLabel.match(e)[0],this.modelValue.length+""):this.selectedItemsLabel},onToggleAll(e){if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{const t=this.allSelected?[]:this.visibleOptions.filter((e=>!this.isOptionGroup(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t)}this.headerCheckboxFocused=!0},removeOption(t,i){let l=this.modelValue.filter((t=>!e.ObjectUtils.equals(t,i,this.equalityKey)));this.updateModel(t,l)},clearFilter(){this.filterValue=null},hasFocusableElements(){return e.DomHandler.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},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(t){const i=this.getOptionValue(t);return(this.modelValue||[]).some((t=>e.ObjectUtils.equals(t,i,this.equalityKey)))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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?this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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){this.searchValue=(this.searchValue||"")+e.key;let t=-1;if(-1!==this.focusedOptionIndex?(t=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),t=-1===t?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):t+this.focusedOptionIndex):t=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1===t&&-1===this.focusedOptionIndex){const e=this.findSelectedOptionIndex();t=e<0?this.findFirstOptionIndex():e}-1!==t&&this.changeFocusedOptionIndex(e,t),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView())},scrollInView(t=-1){const i=-1!==t?`${this.id}_${t}`:this.focusedOptionId,l=e.DomHandler.findSingle(this.list,`li[id="${i}"]`);l?l.scrollIntoView&&l.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==t?t:this.focusedOptionIndex)},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,[e])}},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 l=this.getOptionGroupChildren(t);return l&&l.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-multiselect-label",{"p-placeholder":this.label===this.placeholder,"p-multiselect-label-empty":!(this.placeholder||this.modelValue&&0!==this.modelValue.length)}]},dropdownIconClass(){return["p-multiselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]},panelStyleClass(){return["p-multiselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},visibleOptions(){const e=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?i.FilterService.filter(e,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):e},label(){let t;if(this.modelValue&&this.modelValue.length){if(e.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();t="";for(let e=0;e<this.modelValue.length;e++)0!==e&&(t+=", "),t+=this.getLabelByValue(this.modelValue[e])}else t=this.placeholder;return t},allSelected(){return null!==this.selectAll?this.selectAll:e.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((e=>this.isOptionGroup(e)||this.isValidSelectedOption(e)))},hasSelectedOption(){return e.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},maxSelectionLimitReached(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},filterResultMessageText(){return e.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.modelValue.length):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},toggleAllAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[this.allSelected?"selectAll":"unselectAll"]:void 0},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:c.default},components:{VirtualScroller:d.default,Portal:p.default}};const u={class:"p-hidden-accessible"},m=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],f={class:"p-multiselect-label-container"},b={class:"p-multiselect-token-label"},y=["onClick"],g={class:"p-multiselect-trigger"},O={key:0,class:"p-multiselect-header"},v={class:"p-hidden-accessible"},x=["checked","aria-label"],k={key:1,class:"p-multiselect-filter-container"},S=["value","placeholder","aria-owns","aria-activedescendant"],I=o.createElementVNode("span",{class:"p-multiselect-filter-icon pi pi-search"},null,-1),V={key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},w=["aria-label"],L=[o.createElementVNode("span",{class:"p-multiselect-close-icon pi pi-times"},null,-1)],F=["id"],C=["id"],E=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],D={class:"p-checkbox p-component"},B={key:0,class:"p-multiselect-empty-message",role:"option"},K={key:1,class:"p-multiselect-empty-message",role:"option"},M={key:0,role:"status","aria-live":"polite",class:"p-hidden-accessible"},N={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n cursor: pointer;\n}\n.p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-multiselect-token {\n cursor: default;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-multiselect-token-icon {\n cursor: pointer;\n}\n.p-multiselect .p-multiselect-panel {\n min-width: 100%;\n}\n.p-multiselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-multiselect-items-wrapper {\n overflow: auto;\n}\n.p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-multiselect-item {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-multiselect-item-group {\n cursor: auto;\n}\n.p-multiselect-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),h.render=function(e,t,i,l,s,n){const a=o.resolveComponent("VirtualScroller"),r=o.resolveComponent("Portal"),c=o.resolveDirective("ripple");return o.openBlock(),o.createElementBlock("div",{ref:"container",class:o.normalizeClass(n.containerClass),onClick:t[15]||(t[15]=(...e)=>n.onContainerClick&&n.onContainerClick(...e))},[o.createElementVNode("div",u,[o.createElementVNode("input",o.mergeProps({ref:"focusInput",id:i.inputId,type:"text",readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":s.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":s.focused?n.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>n.onFocus&&n.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>n.onBlur&&n.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>n.onKeyDown&&n.onKeyDown(...e))},i.inputProps),null,16,m)]),o.createElementVNode("div",f,[o.createElementVNode("div",{class:o.normalizeClass(n.labelClass)},[o.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>["comma"===i.display?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(n.label||"empty"),1)],64)):"chip"===i.display?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.modelValue,(t=>(o.openBlock(),o.createElementBlock("div",{class:"p-multiselect-token",key:n.getLabelByValue(t)},[o.renderSlot(e.$slots,"chip",{value:t},(()=>[o.createElementVNode("span",b,o.toDisplayString(n.getLabelByValue(t)),1)])),i.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:0,class:"p-multiselect-token-icon pi pi-times-circle",onClick:e=>n.removeOption(e,t)},null,8,y))])))),128)),i.modelValue&&0!==i.modelValue.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.placeholder||"empty"),1)],64))],64)):o.createCommentVNode("",!0)]))],2)]),o.createElementVNode("div",g,[o.renderSlot(e.$slots,"indicator",{},(()=>[o.createElementVNode("span",{class:o.normalizeClass(n.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),o.createVNode(r,{appendTo:i.appendTo},{default:o.withCtx((()=>[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:n.onOverlayEnter,onAfterEnter:n.onOverlayAfterEnter,onLeave:n.onOverlayLeave,onAfterLeave:n.onOverlayAfterLeave},{default:o.withCtx((()=>[s.overlayVisible?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:n.overlayRef,style:i.panelStyle,class:n.panelStyleClass,onClick:t[13]||(t[13]=(...e)=>n.onOverlayClick&&n.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>n.onOverlayKeyDown&&n.onOverlayKeyDown(...e))},i.panelProps),[o.createElementVNode("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[3]||(t[3]=(...e)=>n.onFirstHiddenFocus&&n.onFirstHiddenFocus(...e))},null,544),o.renderSlot(e.$slots,"header",{value:i.modelValue,options:n.visibleOptions}),i.showToggleAll&&null==i.selectionLimit||i.filter?(o.openBlock(),o.createElementBlock("div",O,[i.showToggleAll&&null==i.selectionLimit?(o.openBlock(),o.createElementBlock("div",{key:0,class:"p-checkbox p-component",onClick:t[6]||(t[6]=(...e)=>n.onToggleAll&&n.onToggleAll(...e))},[o.createElementVNode("div",v,[o.createElementVNode("input",{type:"checkbox",readonly:"",checked:n.allSelected,"aria-label":n.toggleAllAriaLabel,onFocus:t[4]||(t[4]=(...e)=>n.onHeaderCheckboxFocus&&n.onHeaderCheckboxFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>n.onHeaderCheckboxBlur&&n.onHeaderCheckboxBlur(...e))},null,40,x)]),o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.allSelected,"p-focus":s.headerCheckboxFocused}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{"pi pi-check":n.allSelected}])},null,2)],2)])):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("div",k,[o.createElementVNode("input",o.mergeProps({type:"text",ref:"filterInput",value:s.filterValue,onVnodeUpdated:t[7]||(t[7]=(...e)=>n.onFilterUpdated&&n.onFilterUpdated(...e)),class:"p-multiselect-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":s.id+"_list","aria-activedescendant":n.focusedOptionId,onKeydown:t[8]||(t[8]=(...e)=>n.onFilterKeyDown&&n.onFilterKeyDown(...e)),onBlur:t[9]||(t[9]=(...e)=>n.onFilterBlur&&n.onFilterBlur(...e)),onInput:t[10]||(t[10]=(...e)=>n.onFilterChange&&n.onFilterChange(...e))},i.filterInputProps),null,16,S),I])):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("span",V,o.toDisplayString(n.filterResultMessageText),1)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({class:"p-multiselect-close p-link","aria-label":n.closeAriaLabel,onClick:t[11]||(t[11]=(...e)=>n.onCloseClick&&n.onCloseClick(...e)),type:"button"},i.closeButtonProps),L,16,w)),[[c]])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"p-multiselect-items-wrapper",style:o.normalizeStyle({"max-height":n.virtualScrollerDisabled?i.scrollHeight:""})},[o.createVNode(a,o.mergeProps({ref:n.virtualScrollerRef},i.virtualScrollerOptions,{items:n.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:n.virtualScrollerDisabled}),o.createSlots({content:o.withCtx((({styleClass:t,contentRef:l,items:a,getItemOptions:r,contentStyle:d,itemSize:p})=>[o.createElementVNode("ul",{ref:e=>n.listRef(e,l),id:s.id+"_list",class:o.normalizeClass(["p-multiselect-items p-component",t]),style:o.normalizeStyle(d),role:"listbox","aria-multiselectable":"true"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a,((t,i)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.getOptionRenderKey(t,n.getOptionIndex(i,r))},[n.isOptionGroup(t)?(o.openBlock(),o.createElementBlock("li",{key:0,id:s.id+"_"+n.getOptionIndex(i,r),style:o.normalizeStyle({height:p?p+"px":void 0}),class:"p-multiselect-item-group",role:"option"},[o.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:n.getOptionIndex(i,r)},(()=>[o.createTextVNode(o.toDisplayString(n.getOptionGroupLabel(t.optionGroup)),1)]))],12,C)):o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:1,id:s.id+"_"+n.getOptionIndex(i,r),style:o.normalizeStyle({height:p?p+"px":void 0}),class:o.normalizeClass(["p-multiselect-item",{"p-highlight":n.isSelected(t),"p-focus":s.focusedOptionIndex===n.getOptionIndex(i,r),"p-disabled":n.isOptionDisabled(t)}]),role:"option","aria-label":n.getOptionLabel(t),"aria-selected":n.isSelected(t),"aria-disabled":n.isOptionDisabled(t),"aria-setsize":n.ariaSetSize,"aria-posinset":n.getAriaPosInset(n.getOptionIndex(i,r)),onClick:e=>n.onOptionSelect(e,t,n.getOptionIndex(i,r),!0),onMousemove:e=>n.onOptionMouseMove(e,n.getOptionIndex(i,r))},[o.createElementVNode("div",D,[o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.isSelected(t)}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{"pi pi-check":n.isSelected(t)}])},null,2)],2)]),o.renderSlot(e.$slots,"option",{option:t,index:n.getOptionIndex(i,r)},(()=>[o.createElementVNode("span",null,o.toDisplayString(n.getOptionLabel(t)),1)]))],46,E)),[[c]])],64)))),128)),s.filterValue&&(!a||a&&0===a.length)?(o.openBlock(),o.createElementBlock("li",B,[o.renderSlot(e.$slots,"emptyfilter",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("li",K,[o.renderSlot(e.$slots,"empty",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyMessageText),1)]))])):o.createCommentVNode("",!0)],14,F),!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("span",M,o.toDisplayString(n.emptyMessageText),1)):o.createCommentVNode("",!0),o.createElementVNode("span",N,o.toDisplayString(n.selectedMessageText),1)])),_:2},[e.$slots.loader?{name:"loader",fn:o.withCtx((({options:t})=>[o.renderSlot(e.$slots,"loader",{options:t})]))}:void 0]),1040,["items","style","disabled"])],4),o.renderSlot(e.$slots,"footer",{value:i.modelValue,options:n.visibleOptions}),o.createElementVNode("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=(...e)=>n.onLastHiddenFocus&&n.onLastHiddenFocus(...e))},null,544)],16)):o.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},module.exports=h;
1
+ "use strict";var e=require("primevue/utils"),t=require("primevue/overlayeventbus"),i=require("primevue/api"),l=require("primevue/ripple"),s=require("primevue/virtualscroller"),n=require("primevue/portal"),o=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(t),c=a(l),d=a(s),p=a(n),h={name:"MultiSelect",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter","selectall-change"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,inputId:String,inputProps:null,panelStyle:null,panelClass:null,panelProps:null,filterInputProps:null,closeButtonProps:null,dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},appendTo:{type:String,default:"body"},display:{type:String,default:"comma"},selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},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},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,startRangeIndex:-1,searchTimeout:null,searchValue:"",selectOnFocus:!1,focusOnHover:!1,data:()=>({id:e.UniqueComponentId(),focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.id=this.$attrs.id||this.id,this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(e.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel(t){return this.optionLabel?e.ObjectUtils.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?e.ObjectUtils.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t){return this.dataKey?e.ObjectUtils.resolveFieldData(t,this.dataKey):this.getOptionLabel(t)},isOptionDisabled(t){return!(!this.maxSelectionLimitReached||this.isSelected(t))||!!this.optionDisabled&&e.ObjectUtils.resolveFieldData(t,this.optionDisabled)},isOptionGroup(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return e.ObjectUtils.resolveFieldData(t,this.optionGroupChildren)},getAriaPosInset(e){return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((e=>this.isOptionGroup(e))).length:e)+1},show(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&this.$refs.focusInput.focus()},hide(e){this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),e&&this.$refs.focusInput.focus()},onFocus(e){this.focused=!0,this.focusedOptionIndex=this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e)},onBlur(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(t);break;default:if("KeyA"===t.code&&(t.metaKey||t.ctrlKey)){const e=this.visibleOptions.filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(t,e),t.preventDefault();break}e.ObjectUtils.isPrintableCharacter(t.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(t),t.preventDefault())}},onContainerClick(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus(t){if(t.relatedTarget===this.$refs.focusInput){const t=e.DomHandler.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)");t&&t.focus()}else this.$refs.focusInput.focus()},onLastHiddenFocus(){this.$refs.firstHiddenFocusableElementOnOverlay.focus()},onCloseClick(){this.hide(!0)},onHeaderCheckboxFocus(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur(){this.headerCheckboxFocused=!1},onOptionSelect(t,i,l=-1,s=!1){if(this.disabled||this.isOptionDisabled(i))return;let n=null;n=this.isSelected(i)?this.modelValue.filter((t=>!e.ObjectUtils.equals(t,this.getOptionValue(i),this.equalityKey))):[...this.modelValue||[],this.getOptionValue(i)],this.updateModel(t,n),s&&this.$refs.focusInput.focus(),-1!==l&&(this.focusedOptionIndex=l)},onOptionMouseMove(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},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 l=Math.min(t,i),s=Math.max(t,i),n=this.visibleOptions.slice(l,s+1).filter((e=>this.isValidOption(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,n)}},onFilterChange(e){const t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);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"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(e){r.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e,t=!1){if(e.altKey&&!t)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{const t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),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();e.shiftKey&&t&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show()}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();e.shiftKey&&t&&this.onOptionSelectRange(e,this.startRangeIndex,i),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show()}e.preventDefault()},onPageUpKey(e){this.scrollInView(0),e.preventDefault()},onPageDownKey(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey(e){this.overlayVisible?-1!==this.focusedOptionIndex&&(e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e,t=!1){t||(this.overlayVisible&&this.hasFocusableElements()?(this.$refs.firstHiddenFocusableElementOnOverlay.focus(),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter(t){e.ZIndexUtils.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(t){e.ZIndexUtils.clear(t)},alignOverlay(){"self"===this.appendTo?e.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=e.DomHandler.getOuterWidth(this.$el)+"px",e.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.isOutsideClicked(e)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new e.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!e.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue(t){const i=this.visibleOptions.find((i=>!this.isOptionGroup(i)&&e.ObjectUtils.equals(this.getOptionValue(i),t,this.equalityKey)));return i?this.getOptionLabel(i):null},getSelectedItemsLabel(){let e=/{(.*?)}/;return e.test(this.selectedItemsLabel)?this.selectedItemsLabel.replace(this.selectedItemsLabel.match(e)[0],this.modelValue.length+""):this.selectedItemsLabel},onToggleAll(e){if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{const t=this.allSelected?[]:this.visibleOptions.filter((e=>!this.isOptionGroup(e))).map((e=>this.getOptionValue(e)));this.updateModel(e,t)}this.headerCheckboxFocused=!0},removeOption(t,i){let l=this.modelValue.filter((t=>!e.ObjectUtils.equals(t,i,this.equalityKey)));this.updateModel(t,l)},clearFilter(){this.filterValue=null},hasFocusableElements(){return e.DomHandler.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},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(t){const i=this.getOptionValue(t);return(this.modelValue||[]).some((t=>e.ObjectUtils.equals(t,i,this.equalityKey)))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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?this.visibleOptions.findLastIndex((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?this.visibleOptions.slice(0,e).findLastIndex((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){this.searchValue=(this.searchValue||"")+e.key;let t=-1;if(-1!==this.focusedOptionIndex?(t=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))),t=-1===t?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((e=>this.isOptionMatched(e))):t+this.focusedOptionIndex):t=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1===t&&-1===this.focusedOptionIndex){const e=this.findSelectedOptionIndex();t=e<0?this.findFirstOptionIndex():e}-1!==t&&this.changeFocusedOptionIndex(e,t),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500)},changeFocusedOptionIndex(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView())},scrollInView(t=-1){const i=-1!==t?`${this.id}_${t}`:this.focusedOptionId,l=e.DomHandler.findSingle(this.list,`li[id="${i}"]`);l?l.scrollIntoView&&l.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==t?t:this.focusedOptionIndex)},autoUpdateModel(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();const e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,[e])}},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 l=this.getOptionGroupChildren(t);return l&&l.forEach((t=>e.push(t))),e}),[])},overlayRef(e){this.overlay=e},listRef(e,t){this.list=e,t&&t(e)},virtualScrollerRef(e){this.virtualScroller=e}},computed:{containerClass(){return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue&&this.modelValue.length,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-multiselect-label",{"p-placeholder":this.label===this.placeholder,"p-multiselect-label-empty":!(this.placeholder||this.modelValue&&0!==this.modelValue.length)}]},dropdownIconClass(){return["p-multiselect-trigger-icon",this.loading?this.loadingIcon:"pi pi-chevron-down"]},panelStyleClass(){return["p-multiselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},headerCheckboxClass(){return["p-checkbox p-component",{"p-checkbox-checked":this.allSelected,"p-checkbox-focused":this.headerCheckboxFocused}]},visibleOptions(){const e=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?i.FilterService.filter(e,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):e},label(){let t;if(this.modelValue&&this.modelValue.length){if(e.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();t="";for(let e=0;e<this.modelValue.length;e++)0!==e&&(t+=", "),t+=this.getLabelByValue(this.modelValue[e])}else t=this.placeholder;return t},allSelected(){return null!==this.selectAll?this.selectAll:e.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((e=>this.isOptionGroup(e)||this.isValidSelectedOption(e)))},hasSelectedOption(){return e.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},maxSelectionLimitReached(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},filterResultMessageText(){return e.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.modelValue.length):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionIndex?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter((e=>!this.isOptionGroup(e))).length},toggleAllAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[this.allSelected?"selectAll":"unselectAll"]:void 0},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:c.default},components:{VirtualScroller:d.default,Portal:p.default}};const u={class:"p-hidden-accessible"},m=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],f={class:"p-multiselect-label-container"},b={class:"p-multiselect-token-label"},y=["onClick"],g={class:"p-multiselect-trigger"},O={key:0,class:"p-multiselect-header"},x={class:"p-hidden-accessible"},v=["checked","aria-label"],k={key:1,class:"p-multiselect-filter-container"},S=["value","placeholder","aria-owns","aria-activedescendant"],I=o.createElementVNode("span",{class:"p-multiselect-filter-icon pi pi-search"},null,-1),V={key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},w=["aria-label"],L=[o.createElementVNode("span",{class:"p-multiselect-close-icon pi pi-times"},null,-1)],C=["id"],F=["id"],E=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],D={class:"p-checkbox p-component"},B={key:0,class:"p-multiselect-empty-message",role:"option"},K={key:1,class:"p-multiselect-empty-message",role:"option"},M={key:0,role:"status","aria-live":"polite",class:"p-hidden-accessible"},N={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-multiselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n cursor: pointer;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-multiselect-trigger {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-multiselect-label-container {\n overflow: hidden;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n cursor: pointer;\n}\n.p-multiselect-label {\n display: block;\n white-space: nowrap;\n cursor: pointer;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.p-multiselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-multiselect-token {\n cursor: default;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.p-multiselect-token-icon {\n cursor: pointer;\n}\n.p-multiselect .p-multiselect-panel {\n min-width: 100%;\n}\n.p-multiselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-multiselect-items-wrapper {\n overflow: auto;\n}\n.p-multiselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-multiselect-item {\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n font-weight: normal;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n}\n.p-multiselect-item-group {\n cursor: auto;\n}\n.p-multiselect-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.p-multiselect-filter-container {\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n.p-multiselect-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-multiselect-filter-container .p-inputtext {\n width: 100%;\n}\n.p-multiselect-close {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n overflow: hidden;\n position: relative;\n margin-left: auto;\n}\n.p-fluid .p-multiselect {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n"),h.render=function(e,t,i,l,s,n){const a=o.resolveComponent("VirtualScroller"),r=o.resolveComponent("Portal"),c=o.resolveDirective("ripple");return o.openBlock(),o.createElementBlock("div",{ref:"container",class:o.normalizeClass(n.containerClass),onClick:t[15]||(t[15]=(...e)=>n.onContainerClick&&n.onContainerClick(...e))},[o.createElementVNode("div",u,[o.createElementVNode("input",o.mergeProps({ref:"focusInput",id:i.inputId,type:"text",readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":s.overlayVisible,"aria-controls":s.id+"_list","aria-activedescendant":s.focused?n.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>n.onFocus&&n.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>n.onBlur&&n.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>n.onKeyDown&&n.onKeyDown(...e))},i.inputProps),null,16,m)]),o.createElementVNode("div",f,[o.createElementVNode("div",{class:o.normalizeClass(n.labelClass)},[o.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>["comma"===i.display?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(n.label||"empty"),1)],64)):"chip"===i.display?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.modelValue,(t=>(o.openBlock(),o.createElementBlock("div",{class:"p-multiselect-token",key:n.getLabelByValue(t)},[o.renderSlot(e.$slots,"chip",{value:t},(()=>[o.createElementVNode("span",b,o.toDisplayString(n.getLabelByValue(t)),1)])),i.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:0,class:"p-multiselect-token-icon pi pi-times-circle",onClick:e=>n.removeOption(e,t)},null,8,y))])))),128)),i.modelValue&&0!==i.modelValue.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.placeholder||"empty"),1)],64))],64)):o.createCommentVNode("",!0)]))],2)]),o.createElementVNode("div",g,[o.renderSlot(e.$slots,"indicator",{},(()=>[o.createElementVNode("span",{class:o.normalizeClass(n.dropdownIconClass),"aria-hidden":"true"},null,2)]))]),o.createVNode(r,{appendTo:i.appendTo},{default:o.withCtx((()=>[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:n.onOverlayEnter,onAfterEnter:n.onOverlayAfterEnter,onLeave:n.onOverlayLeave,onAfterLeave:n.onOverlayAfterLeave},{default:o.withCtx((()=>[s.overlayVisible?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:n.overlayRef,style:i.panelStyle,class:n.panelStyleClass,onClick:t[13]||(t[13]=(...e)=>n.onOverlayClick&&n.onOverlayClick(...e)),onKeydown:t[14]||(t[14]=(...e)=>n.onOverlayKeyDown&&n.onOverlayKeyDown(...e))},i.panelProps),[o.createElementVNode("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[3]||(t[3]=(...e)=>n.onFirstHiddenFocus&&n.onFirstHiddenFocus(...e))},null,544),o.renderSlot(e.$slots,"header",{value:i.modelValue,options:n.visibleOptions}),i.showToggleAll&&null==i.selectionLimit||i.filter?(o.openBlock(),o.createElementBlock("div",O,[i.showToggleAll&&null==i.selectionLimit?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(n.headerCheckboxClass),onClick:t[6]||(t[6]=(...e)=>n.onToggleAll&&n.onToggleAll(...e))},[o.createElementVNode("div",x,[o.createElementVNode("input",{type:"checkbox",readonly:"",checked:n.allSelected,"aria-label":n.toggleAllAriaLabel,onFocus:t[4]||(t[4]=(...e)=>n.onHeaderCheckboxFocus&&n.onHeaderCheckboxFocus(...e)),onBlur:t[5]||(t[5]=(...e)=>n.onHeaderCheckboxBlur&&n.onHeaderCheckboxBlur(...e))},null,40,v)]),o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.allSelected,"p-focus":s.headerCheckboxFocused}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{"pi pi-check":n.allSelected}])},null,2)],2)],2)):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("div",k,[o.createElementVNode("input",o.mergeProps({type:"text",ref:"filterInput",value:s.filterValue,onVnodeUpdated:t[7]||(t[7]=(...e)=>n.onFilterUpdated&&n.onFilterUpdated(...e)),class:"p-multiselect-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":s.id+"_list","aria-activedescendant":n.focusedOptionId,onKeydown:t[8]||(t[8]=(...e)=>n.onFilterKeyDown&&n.onFilterKeyDown(...e)),onBlur:t[9]||(t[9]=(...e)=>n.onFilterBlur&&n.onFilterBlur(...e)),onInput:t[10]||(t[10]=(...e)=>n.onFilterChange&&n.onFilterChange(...e))},i.filterInputProps),null,16,S),I])):o.createCommentVNode("",!0),i.filter?(o.openBlock(),o.createElementBlock("span",V,o.toDisplayString(n.filterResultMessageText),1)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("button",o.mergeProps({class:"p-multiselect-close p-link","aria-label":n.closeAriaLabel,onClick:t[11]||(t[11]=(...e)=>n.onCloseClick&&n.onCloseClick(...e)),type:"button"},i.closeButtonProps),L,16,w)),[[c]])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"p-multiselect-items-wrapper",style:o.normalizeStyle({"max-height":n.virtualScrollerDisabled?i.scrollHeight:""})},[o.createVNode(a,o.mergeProps({ref:n.virtualScrollerRef},i.virtualScrollerOptions,{items:n.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:n.virtualScrollerDisabled}),o.createSlots({content:o.withCtx((({styleClass:t,contentRef:l,items:a,getItemOptions:r,contentStyle:d,itemSize:p})=>[o.createElementVNode("ul",{ref:e=>n.listRef(e,l),id:s.id+"_list",class:o.normalizeClass(["p-multiselect-items p-component",t]),style:o.normalizeStyle(d),role:"listbox","aria-multiselectable":"true"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a,((t,i)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:n.getOptionRenderKey(t,n.getOptionIndex(i,r))},[n.isOptionGroup(t)?(o.openBlock(),o.createElementBlock("li",{key:0,id:s.id+"_"+n.getOptionIndex(i,r),style:o.normalizeStyle({height:p?p+"px":void 0}),class:"p-multiselect-item-group",role:"option"},[o.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:n.getOptionIndex(i,r)},(()=>[o.createTextVNode(o.toDisplayString(n.getOptionGroupLabel(t.optionGroup)),1)]))],12,F)):o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:1,id:s.id+"_"+n.getOptionIndex(i,r),style:o.normalizeStyle({height:p?p+"px":void 0}),class:o.normalizeClass(["p-multiselect-item",{"p-highlight":n.isSelected(t),"p-focus":s.focusedOptionIndex===n.getOptionIndex(i,r),"p-disabled":n.isOptionDisabled(t)}]),role:"option","aria-label":n.getOptionLabel(t),"aria-selected":n.isSelected(t),"aria-disabled":n.isOptionDisabled(t),"aria-setsize":n.ariaSetSize,"aria-posinset":n.getAriaPosInset(n.getOptionIndex(i,r)),onClick:e=>n.onOptionSelect(e,t,n.getOptionIndex(i,r),!0),onMousemove:e=>n.onOptionMouseMove(e,n.getOptionIndex(i,r))},[o.createElementVNode("div",D,[o.createElementVNode("div",{class:o.normalizeClass(["p-checkbox-box",{"p-highlight":n.isSelected(t)}])},[o.createElementVNode("span",{class:o.normalizeClass(["p-checkbox-icon",{"pi pi-check":n.isSelected(t)}])},null,2)],2)]),o.renderSlot(e.$slots,"option",{option:t,index:n.getOptionIndex(i,r)},(()=>[o.createElementVNode("span",null,o.toDisplayString(n.getOptionLabel(t)),1)]))],46,E)),[[c]])],64)))),128)),s.filterValue&&(!a||a&&0===a.length)?(o.openBlock(),o.createElementBlock("li",B,[o.renderSlot(e.$slots,"emptyfilter",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyFilterMessageText),1)]))])):!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("li",K,[o.renderSlot(e.$slots,"empty",{},(()=>[o.createTextVNode(o.toDisplayString(n.emptyMessageText),1)]))])):o.createCommentVNode("",!0)],14,C),!i.options||i.options&&0===i.options.length?(o.openBlock(),o.createElementBlock("span",M,o.toDisplayString(n.emptyMessageText),1)):o.createCommentVNode("",!0),o.createElementVNode("span",N,o.toDisplayString(n.selectedMessageText),1)])),_:2},[e.$slots.loader?{name:"loader",fn:o.withCtx((({options:t})=>[o.renderSlot(e.$slots,"loader",{options:t})]))}:void 0]),1040,["items","style","disabled"])],4),o.renderSlot(e.$slots,"footer",{value:i.modelValue,options:n.visibleOptions}),o.createElementVNode("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=(...e)=>n.onLastHiddenFocus&&n.onLastHiddenFocus(...e))},null,544)],16)):o.createCommentVNode("",!0)])),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:3},8,["appendTo"])],2)},module.exports=h;
@@ -834,6 +834,12 @@ var script = {
834
834
  'p-ripple-disabled': this.$primevue.config.ripple === false
835
835
  }];
836
836
  },
837
+ headerCheckboxClass() {
838
+ return ['p-checkbox p-component', {
839
+ 'p-checkbox-checked': this.allSelected,
840
+ 'p-checkbox-focused': this.headerCheckboxFocused
841
+ }];
842
+ },
837
843
  visibleOptions() {
838
844
  const options = this.optionGroupLabel ? this.flatOptions(this.options) : (this.options || []);
839
845
 
@@ -882,19 +888,19 @@ var script = {
882
888
  return ObjectUtils.isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;
883
889
  },
884
890
  filterMessageText() {
885
- return this.filterMessage || this.$primevue.config.locale.searchMessage;
891
+ return this.filterMessage || this.$primevue.config.locale.searchMessage || '';
886
892
  },
887
893
  emptyFilterMessageText() {
888
- return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage;
894
+ return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';
889
895
  },
890
896
  emptyMessageText() {
891
- return this.emptyMessage || this.$primevue.config.locale.emptyMessage;
897
+ return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';
892
898
  },
893
899
  selectionMessageText() {
894
- return this.selectionMessage || this.$primevue.config.locale.selectionMessage;
900
+ return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';
895
901
  },
896
902
  emptySelectionMessageText() {
897
- return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage;
903
+ return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';
898
904
  },
899
905
  selectedMessageText() {
900
906
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', this.modelValue.length) : this.emptySelectionMessageText;
@@ -1095,7 +1101,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1095
1101
  ($props.showToggleAll && $props.selectionLimit == null)
1096
1102
  ? (openBlock(), createElementBlock("div", {
1097
1103
  key: 0,
1098
- class: "p-checkbox p-component",
1104
+ class: normalizeClass($options.headerCheckboxClass),
1099
1105
  onClick: _cache[6] || (_cache[6] = (...args) => ($options.onToggleAll && $options.onToggleAll(...args)))
1100
1106
  }, [
1101
1107
  createElementVNode("div", _hoisted_8, [
@@ -1115,7 +1121,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1115
1121
  class: normalizeClass(['p-checkbox-icon', {'pi pi-check': $options.allSelected}])
1116
1122
  }, null, 2)
1117
1123
  ], 2)
1118
- ]))
1124
+ ], 2))
1119
1125
  : createCommentVNode("", true),
1120
1126
  ($props.filter)
1121
1127
  ? (openBlock(), createElementBlock("div", _hoisted_10, [